@postman/sdk-config 0.11.0 → 0.13.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 +372 -24
- 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 +372 -24
- package/dist/index.js.map +1 -1
- package/dist/sdk-config/index.cjs +370 -23
- 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 +370 -23
- package/dist/sdk-config/index.js.map +1 -1
- package/dist/sdk-config/v1/index.cjs +370 -23
- package/dist/sdk-config/v1/index.cjs.map +1 -1
- package/dist/sdk-config/v1/index.d.cts +632 -31
- package/dist/sdk-config/v1/index.d.ts +632 -31
- package/dist/sdk-config/v1/index.js +370 -23
- package/dist/sdk-config/v1/index.js.map +1 -1
- package/dist/sdk-config-ir/index.cjs +57 -6
- 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 +57 -6
- package/dist/sdk-config-ir/index.js.map +1 -1
- package/dist/sdk-config-ir/v1/index.cjs +57 -6
- package/dist/sdk-config-ir/v1/index.cjs.map +1 -1
- package/dist/sdk-config-ir/v1/index.d.cts +211 -4
- package/dist/sdk-config-ir/v1/index.d.ts +211 -4
- package/dist/sdk-config-ir/v1/index.js +57 -6
- package/dist/sdk-config-ir/v1/index.js.map +1 -1
- package/dist/{typescript-CsAa1VSy.d.cts → typescript-BFRxjAah.d.cts} +65 -0
- package/dist/{typescript-CsAa1VSy.d.ts → typescript-BFRxjAah.d.ts} +65 -0
- package/package.json +1 -1
- package/src/sdk-config/v1/README.md +32 -11
- package/src/sdk-config-ir/v1/README.md +115 -60
package/dist/index.cjs
CHANGED
|
@@ -438,6 +438,12 @@ var dependencySchema = zod.z.strictObject({
|
|
|
438
438
|
}).refine(({ source, version }) => source !== void 0 || version !== void 0, {
|
|
439
439
|
message: "dependency must define a version or a source"
|
|
440
440
|
});
|
|
441
|
+
var bugsSchema = zod.z.strictObject({
|
|
442
|
+
url: nonEmptyStringSchema.optional().describe("The issue tracker URL."),
|
|
443
|
+
email: nonEmptyStringSchema.optional().describe("The address for reporting issues.")
|
|
444
|
+
}).refine(({ url, email }) => url !== void 0 || email !== void 0, {
|
|
445
|
+
message: "bugs must define a url or an email"
|
|
446
|
+
});
|
|
441
447
|
var projectUrlSchema = zod.z.strictObject({
|
|
442
448
|
label: nonEmptyStringSchema.describe("The label displayed for the project link."),
|
|
443
449
|
url: nonEmptyStringSchema.describe("The project link URL.")
|
|
@@ -452,6 +458,7 @@ var packageConfigSchema = zod.z.strictObject({
|
|
|
452
458
|
description: zod.z.string().optional().describe("The package description used in generated metadata."),
|
|
453
459
|
repository: nonEmptyStringSchema.optional().describe("The source repository for the generated SDK."),
|
|
454
460
|
homepage: nonEmptyStringSchema.optional().describe("The package homepage URL."),
|
|
461
|
+
bugs: bugsSchema.optional().describe("Where issues with the package are reported."),
|
|
455
462
|
documentationUrl: nonEmptyStringSchema.optional().describe("The package documentation URL."),
|
|
456
463
|
authors: zod.z.array(authorSchema).optional().describe("Authors credited in package metadata."),
|
|
457
464
|
developers: zod.z.array(developerSchema).optional().describe("Developers credited in package metadata."),
|
|
@@ -507,7 +514,10 @@ var cliDistributionConfigSchema = zod.z.strictObject({
|
|
|
507
514
|
"A GitHub App used to mint short-lived tokens for every channel without its own tokenSecretName."
|
|
508
515
|
),
|
|
509
516
|
homebrew: cliDistributionHomebrewSchema.optional().describe("Publishes a Homebrew formula to a tap repository on each tagged release."),
|
|
510
|
-
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
|
+
)
|
|
511
521
|
}).superRefine((distribution, context) => {
|
|
512
522
|
if (distribution.homebrew !== void 0 || distribution.scoop !== void 0) {
|
|
513
523
|
return;
|
|
@@ -520,6 +530,9 @@ var cliDistributionConfigSchema = zod.z.strictObject({
|
|
|
520
530
|
});
|
|
521
531
|
return;
|
|
522
532
|
}
|
|
533
|
+
if (distribution.githubAttestations !== void 0) {
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
523
536
|
context.addIssue({
|
|
524
537
|
code: "custom",
|
|
525
538
|
message: "distribution must configure at least one channel: homebrew or scoop"
|
|
@@ -531,14 +544,17 @@ var CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE = "CLI_DISTRIBUTION_NON_RELEASE_MODE"
|
|
|
531
544
|
var nonReleaseGithubModes = /* @__PURE__ */ new Set(["pull-request", "push", "commit"]);
|
|
532
545
|
function cliDistributionModeDiagnostic(output, outputPath) {
|
|
533
546
|
const mode = output?.github?.mode;
|
|
534
|
-
|
|
547
|
+
const distribution = output?.distribution;
|
|
548
|
+
if (distribution === void 0 || mode === void 0 || !nonReleaseGithubModes.has(mode)) {
|
|
535
549
|
return void 0;
|
|
536
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.";
|
|
537
553
|
return {
|
|
538
554
|
code: CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE,
|
|
539
555
|
severity: "warning",
|
|
540
556
|
path: [...outputPath, "github", "mode"],
|
|
541
|
-
reason: `GitHub mode "${mode}" does not create a release tag, so
|
|
557
|
+
reason: `GitHub mode "${mode}" does not create a release tag, so ${consequence}`,
|
|
542
558
|
suggestedAction: 'Use mode "release" or "commit-and-release", or push a version tag after merging generated changes.'
|
|
543
559
|
};
|
|
544
560
|
}
|
|
@@ -973,6 +989,7 @@ var DISTRIBUTION_KEYS = {
|
|
|
973
989
|
homebrew: { tap: "tap", formula: "formula", tokenEnvironmentVariable: "tokenSecretName" },
|
|
974
990
|
scoop: { bucket: "bucket", tokenEnvironmentVariable: "tokenSecretName" }
|
|
975
991
|
};
|
|
992
|
+
var DISTRIBUTION_SCALAR_KEYS = ["githubAttestations"];
|
|
976
993
|
function mapCliDistribution(config, state, basePath, targetIndex) {
|
|
977
994
|
if (!Object.hasOwn(config, "distribution")) return;
|
|
978
995
|
const raw = config.distribution;
|
|
@@ -1019,6 +1036,11 @@ function translateDistribution(distribution, path) {
|
|
|
1019
1036
|
}
|
|
1020
1037
|
value[block] = translatedBlock;
|
|
1021
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
|
+
}
|
|
1022
1044
|
return { value, consumedPaths, legacyKeys };
|
|
1023
1045
|
}
|
|
1024
1046
|
function invalidDistributionDiagnostic(issue, path, legacyKeys, targetIndex) {
|
|
@@ -1158,6 +1180,7 @@ function mapOutput(generator, language, index) {
|
|
|
1158
1180
|
output.publishV2,
|
|
1159
1181
|
rawOutput,
|
|
1160
1182
|
language,
|
|
1183
|
+
"zip",
|
|
1161
1184
|
[...outputPath, "publishV2"],
|
|
1162
1185
|
state,
|
|
1163
1186
|
index
|
|
@@ -1179,6 +1202,7 @@ function mapOutput(generator, language, index) {
|
|
|
1179
1202
|
output.registryOverrides,
|
|
1180
1203
|
rawOutput,
|
|
1181
1204
|
language,
|
|
1205
|
+
"zip",
|
|
1182
1206
|
[...outputPath, "registryOverrides"],
|
|
1183
1207
|
state,
|
|
1184
1208
|
index
|
|
@@ -1206,7 +1230,14 @@ function mapOutput(generator, language, index) {
|
|
|
1206
1230
|
}
|
|
1207
1231
|
}
|
|
1208
1232
|
function sanitizeNormalizedOutput(output, rawOutput, state, index) {
|
|
1209
|
-
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;
|
|
1210
1241
|
const publishShape = publish ? { publish } : {};
|
|
1211
1242
|
if (output.delivery !== "github") return { ...output, ...publishShape };
|
|
1212
1243
|
const { credentials, ...github } = output.github;
|
|
@@ -1233,12 +1264,21 @@ function githubOutput(value, publishInfo, rawOutput, language, sourcePath, state
|
|
|
1233
1264
|
);
|
|
1234
1265
|
consume(state, [...sourcePath, "owner"]);
|
|
1235
1266
|
consume(state, [...sourcePath, "repo"]);
|
|
1236
|
-
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;
|
|
1237
1276
|
const type = stringValue(value.type);
|
|
1238
1277
|
const licensePackage = mapGithubLicense(value.license, [...sourcePath, "license"], state);
|
|
1239
1278
|
const reviewers = mapReviewers(value.reviewers, [...sourcePath, "reviewers"], state);
|
|
1240
1279
|
if (type) consume(state, [...sourcePath, "type"]);
|
|
1241
1280
|
if (typeof value.makePr === "boolean") consume(state, [...sourcePath, "makePr"]);
|
|
1281
|
+
if (value.workflows === true) consume(state, [...sourcePath, "workflows"]);
|
|
1242
1282
|
if (stringValue(value.host)) consume(state, [...sourcePath, "host"]);
|
|
1243
1283
|
if (stringValue(value.branch)) consume(state, [...sourcePath, "branch"]);
|
|
1244
1284
|
consumeCredentialObject(value.credentials, [...sourcePath, "credentials"], state);
|
|
@@ -1325,7 +1365,7 @@ function reviewerNames(value, expectedType, sourcePath, state) {
|
|
|
1325
1365
|
});
|
|
1326
1366
|
return names.length ? names : void 0;
|
|
1327
1367
|
}
|
|
1328
|
-
function mapPublication(value, rawOutput, language, sourcePath, state, index) {
|
|
1368
|
+
function mapPublication(value, rawOutput, language, delivery, sourcePath, state, index) {
|
|
1329
1369
|
if (!isObject(value))
|
|
1330
1370
|
fail(
|
|
1331
1371
|
"FERN_PUBLICATION_INVALID",
|
|
@@ -1346,6 +1386,7 @@ function mapPublication(value, rawOutput, language, sourcePath, state, index) {
|
|
|
1346
1386
|
compact({ registry, url: registryUrl }),
|
|
1347
1387
|
nested,
|
|
1348
1388
|
rawOutput,
|
|
1389
|
+
delivery,
|
|
1349
1390
|
state,
|
|
1350
1391
|
index
|
|
1351
1392
|
);
|
|
@@ -1366,7 +1407,7 @@ function mapPublication(value, rawOutput, language, sourcePath, state, index) {
|
|
|
1366
1407
|
...packageName || Object.keys(metadata).length ? { package: { ...optional("packageName", packageName), ...metadata } } : {}
|
|
1367
1408
|
};
|
|
1368
1409
|
}
|
|
1369
|
-
function sanitizePublishConfig(publish, resolvedPublication, rawOutput, state, index) {
|
|
1410
|
+
function sanitizePublishConfig(publish, resolvedPublication, rawOutput, delivery, state, index) {
|
|
1370
1411
|
const rawPublication = rawOutput?.location === publish.registry ? rawOutput : void 0;
|
|
1371
1412
|
const rawPath = ["group", "generators", index, "output"];
|
|
1372
1413
|
if (publish.registry === "npm" || publish.registry === "crates") {
|
|
@@ -1462,6 +1503,33 @@ function sanitizePublishConfig(publish, resolvedPublication, rawOutput, state, i
|
|
|
1462
1503
|
signature
|
|
1463
1504
|
});
|
|
1464
1505
|
}
|
|
1506
|
+
if (publish.registry === "nuget" || publish.registry === "rubygems") {
|
|
1507
|
+
const apiKey = mapApiKeyExpression(
|
|
1508
|
+
publish.registry,
|
|
1509
|
+
rawPublication,
|
|
1510
|
+
resolvedPublication,
|
|
1511
|
+
rawPath,
|
|
1512
|
+
state,
|
|
1513
|
+
index,
|
|
1514
|
+
fernDefaultApiKey(publish.registry, rawOutput, delivery)
|
|
1515
|
+
);
|
|
1516
|
+
warnForUnexpectedCredentialFields(
|
|
1517
|
+
rawPublication,
|
|
1518
|
+
resolvedPublication,
|
|
1519
|
+
["apiKey"],
|
|
1520
|
+
rawPath,
|
|
1521
|
+
state,
|
|
1522
|
+
index
|
|
1523
|
+
);
|
|
1524
|
+
return compact({
|
|
1525
|
+
registry: publish.registry,
|
|
1526
|
+
url: publish.url,
|
|
1527
|
+
releaseBranch: publish.releaseBranch,
|
|
1528
|
+
tolerateRepublish: publish.tolerateRepublish,
|
|
1529
|
+
apiKey,
|
|
1530
|
+
trustedPublishing: usesTrustedPublishing(rawPublication) || void 0
|
|
1531
|
+
});
|
|
1532
|
+
}
|
|
1465
1533
|
warnForUnrepresentableCredentials(rawPublication, resolvedPublication, rawPath, state, index);
|
|
1466
1534
|
return compact({
|
|
1467
1535
|
registry: publish.registry,
|
|
@@ -1470,11 +1538,19 @@ function sanitizePublishConfig(publish, resolvedPublication, rawOutput, state, i
|
|
|
1470
1538
|
tolerateRepublish: publish.tolerateRepublish
|
|
1471
1539
|
});
|
|
1472
1540
|
}
|
|
1473
|
-
function mapLegacyPublication(value, rawOutput, language, sourcePath, state, index) {
|
|
1541
|
+
function mapLegacyPublication(value, rawOutput, language, delivery, sourcePath, state, index) {
|
|
1474
1542
|
const registry = defaultRegistry(language, sourcePath, index);
|
|
1475
1543
|
const overrides = isObject(value) ? value : {};
|
|
1476
1544
|
const override = isObject(overrides[registry]) ? overrides[registry] : {};
|
|
1477
|
-
return mapPublication(
|
|
1545
|
+
return mapPublication(
|
|
1546
|
+
override,
|
|
1547
|
+
rawOutput,
|
|
1548
|
+
language,
|
|
1549
|
+
delivery,
|
|
1550
|
+
[...sourcePath, registry],
|
|
1551
|
+
state,
|
|
1552
|
+
index
|
|
1553
|
+
);
|
|
1478
1554
|
}
|
|
1479
1555
|
function mapCredentialExpression(rawPublication, resolvedPublication, field, rawPath, state, index) {
|
|
1480
1556
|
const rawValue = rawPublication?.[field];
|
|
@@ -1489,6 +1565,45 @@ function mapCredentialExpression(rawPublication, resolvedPublication, field, raw
|
|
|
1489
1565
|
}
|
|
1490
1566
|
return void 0;
|
|
1491
1567
|
}
|
|
1568
|
+
var TRUSTED_PUBLISHING_VALUES = /* @__PURE__ */ new Set(["OIDC", "<USE_OIDC>"]);
|
|
1569
|
+
function rawApiKeyValue(raw) {
|
|
1570
|
+
return raw?.apiKey ?? raw?.["api-key"];
|
|
1571
|
+
}
|
|
1572
|
+
function usesTrustedPublishing(rawPublication) {
|
|
1573
|
+
const rawValue = rawApiKeyValue(rawPublication);
|
|
1574
|
+
return typeof rawValue === "string" && TRUSTED_PUBLISHING_VALUES.has(rawValue);
|
|
1575
|
+
}
|
|
1576
|
+
function mapApiKeyExpression(registry, rawPublication, resolvedPublication, rawPath, state, index, defaultSecretName) {
|
|
1577
|
+
const rawValue = rawApiKeyValue(rawPublication);
|
|
1578
|
+
if (isEnvironmentExpression(rawValue)) return rawValue;
|
|
1579
|
+
if (usesTrustedPublishing(rawPublication)) return void 0;
|
|
1580
|
+
if (defaultSecretName !== void 0) return defaultSecretName;
|
|
1581
|
+
if (rawValue === void 0 && !hasResolvedCredential(resolvedPublication, "apiKey")) {
|
|
1582
|
+
return void 0;
|
|
1583
|
+
}
|
|
1584
|
+
addCredentialDiagnostic(
|
|
1585
|
+
state,
|
|
1586
|
+
[...rawPath, "apiKey"],
|
|
1587
|
+
["targets", index, "output", "publish", "apiKey"],
|
|
1588
|
+
apiKeyOmissionReason(registry)
|
|
1589
|
+
);
|
|
1590
|
+
return void 0;
|
|
1591
|
+
}
|
|
1592
|
+
function apiKeyOmissionReason(registry) {
|
|
1593
|
+
const label = registry === "nuget" ? "NuGet" : "RubyGems";
|
|
1594
|
+
return `Fern ${label} apiKey is not an exact environment expression naming a secret`;
|
|
1595
|
+
}
|
|
1596
|
+
var FERN_DEFAULT_NUGET_API_KEY = "${NUGET_API_TOKEN}";
|
|
1597
|
+
function fernDefaultApiKey(registry, rawOutput, delivery) {
|
|
1598
|
+
if (registry !== "nuget" || delivery !== "github" || rawOutput?.location !== "nuget") {
|
|
1599
|
+
return void 0;
|
|
1600
|
+
}
|
|
1601
|
+
const rawApiKey = rawApiKeyValue(rawOutput);
|
|
1602
|
+
if (typeof rawApiKey === "string" && TRUSTED_PUBLISHING_VALUES.has(rawApiKey)) {
|
|
1603
|
+
return void 0;
|
|
1604
|
+
}
|
|
1605
|
+
return FERN_DEFAULT_NUGET_API_KEY;
|
|
1606
|
+
}
|
|
1492
1607
|
function mapPypiCredentialExpressions(rawPublication, resolvedPublication, rawPath, state, index) {
|
|
1493
1608
|
const rawToken = rawPublication?.token;
|
|
1494
1609
|
if (isEnvironmentExpression(rawToken)) {
|
|
@@ -2204,6 +2319,29 @@ var mavenSignatureSchema = zod.z.strictObject({
|
|
|
2204
2319
|
"The armored secret key, or an environment expression that resolves to it."
|
|
2205
2320
|
)
|
|
2206
2321
|
});
|
|
2322
|
+
function apiKeySecretSchema(registry, example) {
|
|
2323
|
+
return nonEmptyStringSchema.regex(
|
|
2324
|
+
/^\$\{[A-Za-z_][A-Za-z0-9_]*\}$/,
|
|
2325
|
+
`${registry} apiKey must be an environment expression naming a secret, such as ${example}`
|
|
2326
|
+
);
|
|
2327
|
+
}
|
|
2328
|
+
function apiKeySecretDescription(registry, example) {
|
|
2329
|
+
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.`;
|
|
2330
|
+
}
|
|
2331
|
+
function trustedPublishingSchema(registry) {
|
|
2332
|
+
return zod.z.boolean().optional().describe(
|
|
2333
|
+
`Whether ${registry} publication uses trusted publishing (OIDC) instead of an API key secret.`
|
|
2334
|
+
);
|
|
2335
|
+
}
|
|
2336
|
+
function refineApiKeyAgainstTrustedPublishing(publish, context) {
|
|
2337
|
+
if (publish.trustedPublishing === true && publish.apiKey !== void 0) {
|
|
2338
|
+
context.addIssue({
|
|
2339
|
+
code: "custom",
|
|
2340
|
+
message: "apiKey must be omitted when trustedPublishing is true",
|
|
2341
|
+
path: ["apiKey"]
|
|
2342
|
+
});
|
|
2343
|
+
}
|
|
2344
|
+
}
|
|
2207
2345
|
var commonPublishShape = {
|
|
2208
2346
|
url: nonEmptyStringSchema.optional().describe("A custom package registry URL."),
|
|
2209
2347
|
releaseBranch: nonEmptyStringSchema.optional().describe("The branch used by generated package release workflows."),
|
|
@@ -2239,12 +2377,16 @@ var sdkConfigV1PublishConfigSchema = zod.z.discriminatedUnion("registry", [
|
|
|
2239
2377
|
}),
|
|
2240
2378
|
zod.z.strictObject({
|
|
2241
2379
|
registry: zod.z.literal("nuget").describe("Publishes the package to a NuGet-compatible registry."),
|
|
2380
|
+
apiKey: apiKeySecretSchema("NuGet", "${NUGET_API_KEY}").optional().describe(apiKeySecretDescription("NuGet", "${NUGET_API_KEY}")),
|
|
2381
|
+
trustedPublishing: trustedPublishingSchema("NuGet"),
|
|
2242
2382
|
...commonPublishShape
|
|
2243
|
-
}),
|
|
2383
|
+
}).superRefine(refineApiKeyAgainstTrustedPublishing),
|
|
2244
2384
|
zod.z.strictObject({
|
|
2245
2385
|
registry: zod.z.literal("rubygems").describe("Publishes the package to a RubyGems-compatible registry."),
|
|
2386
|
+
apiKey: apiKeySecretSchema("RubyGems", "${RUBYGEMS_API_KEY}").optional().describe(apiKeySecretDescription("RubyGems", "${RUBYGEMS_API_KEY}")),
|
|
2387
|
+
trustedPublishing: trustedPublishingSchema("RubyGems"),
|
|
2246
2388
|
...commonPublishShape
|
|
2247
|
-
}),
|
|
2389
|
+
}).superRefine(refineApiKeyAgainstTrustedPublishing),
|
|
2248
2390
|
zod.z.strictObject({
|
|
2249
2391
|
registry: zod.z.literal("crates").describe("Publishes the crate to a Cargo-compatible registry."),
|
|
2250
2392
|
token: nonEmptyStringSchema.optional().describe("The Cargo registry token, or an environment expression that resolves to it."),
|
|
@@ -2302,7 +2444,7 @@ var sdkConfigV1OutputConfigSchema = zod.z.discriminatedUnion(
|
|
|
2302
2444
|
);
|
|
2303
2445
|
var cliDistributionShape = {
|
|
2304
2446
|
distribution: cliDistributionConfigSchema.optional().describe(
|
|
2305
|
-
"CLI release channels
|
|
2447
|
+
"CLI release channels and build attestation settings for the generated release workflow; credentials are GitHub Actions secret names."
|
|
2306
2448
|
)
|
|
2307
2449
|
};
|
|
2308
2450
|
function rejectDistributionWithoutGithub(output, context) {
|
|
@@ -2348,6 +2490,9 @@ var apiImportSettingsSchema = zod.z.strictObject({
|
|
|
2348
2490
|
discriminatedUnionV2: zod.z.boolean().optional().describe("Whether oneOf and anyOf schemas use the newer discriminator inference rules."),
|
|
2349
2491
|
undiscriminatedUnionsWithLiterals: zod.z.boolean().optional().describe("Whether literal-bearing unions remain undiscriminated during import."),
|
|
2350
2492
|
inlineAllOfSchemas: zod.z.boolean().optional().describe("Whether schemas composed with allOf are inlined when possible."),
|
|
2493
|
+
inferDiscriminatedUnionBaseProperties: zod.z.boolean().optional().describe(
|
|
2494
|
+
"Whether properties every discriminated-union variant shares are lifted onto the union."
|
|
2495
|
+
),
|
|
2351
2496
|
resolveSchemaCollisions: zod.z.boolean().optional().describe("Whether colliding imported schema names are resolved automatically."),
|
|
2352
2497
|
asyncApiMessageNaming: zod.z.enum(["v1", "v2"]).optional().describe("The naming strategy used for messages imported from AsyncAPI."),
|
|
2353
2498
|
defaultIntegerFormat: zod.z.enum(["int32", "int64", "uint32", "uint64"]).optional().describe("The integer format used when a schema does not declare one.")
|
|
@@ -2446,7 +2591,7 @@ var packageScriptSchema = zod.z.strictObject({
|
|
|
2446
2591
|
command: nonEmptyStringSchema.describe("The command executed by the package script.")
|
|
2447
2592
|
});
|
|
2448
2593
|
var httpClientSchema = zod.z.strictObject({
|
|
2449
|
-
name: zod.z.enum(["axios", "fetch"]).describe("The HTTP client used by generated TypeScript code.")
|
|
2594
|
+
name: zod.z.enum(["axios", "fetch", "node-fetch"]).describe("The HTTP client used by generated TypeScript code.")
|
|
2450
2595
|
});
|
|
2451
2596
|
var typescriptGenerationConfigSchema = zod.z.strictObject({
|
|
2452
2597
|
typescriptVersion: nonEmptyStringSchema.optional().describe("The TypeScript version used by the generated project."),
|
|
@@ -2462,6 +2607,37 @@ var typescriptGenerationConfigSchema = zod.z.strictObject({
|
|
|
2462
2607
|
/** Name of the top-level namespace export emitted by Fern-compatible TypeScript SDKs. */
|
|
2463
2608
|
namespaceExportName: nonEmptyStringSchema.optional().describe("The top-level namespace export name."),
|
|
2464
2609
|
consolidateTypeFiles: zod.z.boolean().optional().describe("Whether generated types are consolidated into fewer source files."),
|
|
2610
|
+
formDataSupport: zod.z.enum(["Node16", "Node18"]).optional().describe(
|
|
2611
|
+
"The multipart form-data implementation: Node16 uses the form-data packages, Node18 uses the platform FormData."
|
|
2612
|
+
),
|
|
2613
|
+
allowExtraFields: zod.z.boolean().optional().describe(
|
|
2614
|
+
"Whether response parsing keeps unrecognized object keys and accepts unrecognized union members and enum values."
|
|
2615
|
+
),
|
|
2616
|
+
generateSubpackageExports: zod.z.boolean().optional().describe(
|
|
2617
|
+
"Whether the package manifest exports each subpackage client as its own entry point."
|
|
2618
|
+
),
|
|
2619
|
+
exportAllRequestsAtRoot: zod.z.boolean().optional().describe("Whether every request type is also exported from the package root."),
|
|
2620
|
+
generateEndpointMetadata: zod.z.boolean().optional().describe("Whether generated clients expose metadata for each endpoint."),
|
|
2621
|
+
outputEsm: zod.z.boolean().optional().describe(
|
|
2622
|
+
"Whether the package is marked as an ES module while still shipping its CommonJS build."
|
|
2623
|
+
),
|
|
2624
|
+
neverThrowErrors: zod.z.boolean().optional().describe(
|
|
2625
|
+
"Whether client methods return a wrapped response instead of throwing on a non-2xx status."
|
|
2626
|
+
),
|
|
2627
|
+
includeOtherInUnionTypes: zod.z.boolean().optional().describe("Whether union types gain a member for variants the SDK does not recognize."),
|
|
2628
|
+
includeUtilsOnUnionMembers: zod.z.boolean().optional().describe("Whether helper utilities are generated on each member of a union type."),
|
|
2629
|
+
omitFernHeaders: zod.z.boolean().optional().describe("Whether requests omit the SDK identification headers and the User-Agent header."),
|
|
2630
|
+
linter: zod.z.enum(["biome", "oxlint", "none"]).optional().describe("The linter configured in the generated project."),
|
|
2631
|
+
formatter: zod.z.enum(["prettier", "biome", "oxfmt", "none"]).optional().describe("The formatter configured in the generated project."),
|
|
2632
|
+
exports: jsonObjectSchema.optional().describe(
|
|
2633
|
+
"package.json exports entries, keyed by subpath, applied over the generated exports. Each subpath replaces the generated one."
|
|
2634
|
+
),
|
|
2635
|
+
files: zod.z.array(nonEmptyStringSchema).optional().describe("package.json files entries, listed ahead of the generated ones."),
|
|
2636
|
+
engines: zod.z.record(nonEmptyStringSchema, nonEmptyStringSchema).optional().describe("package.json engines version ranges, keyed by engine name such as node."),
|
|
2637
|
+
lintStaged: zod.z.record(nonEmptyStringSchema, zod.z.array(nonEmptyStringSchema).min(1)).optional().describe("lint-staged commands to run, keyed by file glob."),
|
|
2638
|
+
browser: zod.z.record(nonEmptyStringSchema, zod.z.union([zod.z.boolean(), nonEmptyStringSchema])).optional().describe(
|
|
2639
|
+
"package.json browser field: a module or file is excluded (false) or replaced by another path."
|
|
2640
|
+
),
|
|
2465
2641
|
allowCustomFetcher: zod.z.boolean().optional().describe("Whether callers can supply a custom fetch implementation."),
|
|
2466
2642
|
useBrandedStringAliases: zod.z.boolean().optional().describe("Whether string aliases are emitted as distinct branded types."),
|
|
2467
2643
|
useLegacyExports: zod.z.boolean().optional().describe("Whether the package emits the legacy export layout."),
|
|
@@ -2535,7 +2711,7 @@ var pythonGenerationConfigSchema = zod.z.strictObject({
|
|
|
2535
2711
|
additionalInitExports: zod.z.array(additionalInitExportSchema).optional().describe("Additional names re-exported from the package initializer.")
|
|
2536
2712
|
});
|
|
2537
2713
|
var rubyGenerationConfigSchema = zod.z.strictObject({
|
|
2538
|
-
requirePaths: zod.z.array(nonEmptyStringSchema).optional().describe("
|
|
2714
|
+
requirePaths: zod.z.array(nonEmptyStringSchema).optional().describe("Files the generated entry file loads with `require`.")
|
|
2539
2715
|
});
|
|
2540
2716
|
var rustGenerationConfigSchema = zod.z.strictObject({
|
|
2541
2717
|
/**
|
|
@@ -2877,16 +3053,21 @@ function mapFernConfigToSdkConfigV1(input) {
|
|
|
2877
3053
|
...optional("client", clients.targetOverrides[index]),
|
|
2878
3054
|
...optional("docs", docs.targetOverrides[index])
|
|
2879
3055
|
};
|
|
2880
|
-
const
|
|
3056
|
+
const mappedPackage = { ...invocation.package, ...outputPackage, ...generator.package };
|
|
2881
3057
|
invocation.unsupportedFields.push(
|
|
2882
3058
|
...resolveTargetPackage(
|
|
2883
|
-
|
|
3059
|
+
mappedPackage,
|
|
2884
3060
|
invocation.packageFallbacks,
|
|
2885
3061
|
generator,
|
|
2886
3062
|
output.delivery,
|
|
2887
3063
|
index
|
|
2888
3064
|
)
|
|
2889
3065
|
);
|
|
3066
|
+
const targetPackage = withRustCratesPublishDefaults(mappedPackage, {
|
|
3067
|
+
language,
|
|
3068
|
+
output,
|
|
3069
|
+
generator
|
|
3070
|
+
});
|
|
2890
3071
|
if (Object.keys(targetPackage).length > 0 || outputPackage || generator.package) {
|
|
2891
3072
|
target.package = targetPackage;
|
|
2892
3073
|
}
|
|
@@ -2955,6 +3136,21 @@ function mapFernConfigToSdkConfigV1(input) {
|
|
|
2955
3136
|
])
|
|
2956
3137
|
};
|
|
2957
3138
|
}
|
|
3139
|
+
function withRustCratesPublishDefaults(packageConfig, { language, output, generator }) {
|
|
3140
|
+
if (language !== "rust" || !("publish" in output) || output.publish?.registry !== "crates") {
|
|
3141
|
+
return packageConfig;
|
|
3142
|
+
}
|
|
3143
|
+
const { packageName } = packageConfig;
|
|
3144
|
+
return {
|
|
3145
|
+
...packageName ? { description: `Rust SDK for ${packageName} generated by Fern` } : {},
|
|
3146
|
+
...usesCustomLicenseFile(generator) ? {} : { license: { type: "MIT" } },
|
|
3147
|
+
...packageConfig
|
|
3148
|
+
};
|
|
3149
|
+
}
|
|
3150
|
+
function usesCustomLicenseFile({ config, raw }) {
|
|
3151
|
+
const metadata = isObject(raw) && isObject(raw.metadata) ? raw.metadata : void 0;
|
|
3152
|
+
return isObject(config) && typeof config.packageLicenseFile === "string" || isObject(metadata?.license);
|
|
3153
|
+
}
|
|
2958
3154
|
function resolveLanguage(generator, index) {
|
|
2959
3155
|
const language = generator.sdkLanguage ?? generatorLanguages[generator.name];
|
|
2960
3156
|
if (!language || !isFernLanguage(language)) {
|
|
@@ -3093,6 +3289,13 @@ function mapInvocation(generator, language, activeLanguages, index) {
|
|
|
3093
3289
|
}
|
|
3094
3290
|
}
|
|
3095
3291
|
const docs = mapReadme(generator.readme, language, activeLanguages, state, [...prefix, "readme"]);
|
|
3292
|
+
if (language === "typescript") {
|
|
3293
|
+
const includeApiReference = takeBoolean(config, ["includeApiReference"], state, [
|
|
3294
|
+
...prefix,
|
|
3295
|
+
"config"
|
|
3296
|
+
]);
|
|
3297
|
+
if (includeApiReference !== void 0) docs.includeApiReference = includeApiReference;
|
|
3298
|
+
}
|
|
3096
3299
|
const unsupportedFields = [
|
|
3097
3300
|
...state.valueDiagnostics ?? [],
|
|
3098
3301
|
...collectUnsupported(config, [...prefix, "config"], state),
|
|
@@ -3239,7 +3442,12 @@ function mapCommonConfig(language, config, state, client, generation, packageCon
|
|
|
3239
3442
|
}
|
|
3240
3443
|
const pythonClient = language === "python" ? takeObject(config, ["client"], state, basePath) : void 0;
|
|
3241
3444
|
const typescriptNaming = language === "typescript" || language === "mcp" ? takeObject(config, ["naming"], state, basePath) : void 0;
|
|
3242
|
-
const directClientName = takeString(
|
|
3445
|
+
const directClientName = takeString(
|
|
3446
|
+
config,
|
|
3447
|
+
language === "ruby" ? ["clientName"] : ["clientName", "clientClassName"],
|
|
3448
|
+
state,
|
|
3449
|
+
basePath
|
|
3450
|
+
);
|
|
3243
3451
|
const nestedClientName = pythonClient ? takeString(pythonClient.value, ["className"], state, pythonClient.path) : typescriptNaming ? takeString(typescriptNaming.value, ["client"], state, typescriptNaming.path) : language === "ruby" ? (
|
|
3244
3452
|
// Fern's Ruby generator renames the root client class (`Auth0::Management`) with it.
|
|
3245
3453
|
takeString(config, ["clientModuleName"], state, basePath)
|
|
@@ -3273,7 +3481,13 @@ function mapCommonConfig(language, config, state, client, generation, packageCon
|
|
|
3273
3481
|
});
|
|
3274
3482
|
if (Object.keys(naming).length) generation.naming = naming;
|
|
3275
3483
|
const wireTests = takeBoolean(config, ["enableWireTests", "generateWireTests"], state, basePath);
|
|
3276
|
-
|
|
3484
|
+
const wireTestsFallback = language === "typescript" ? takeBoolean(config, ["wireTestsFallbackToAutoGeneratedErrorExamples"], state, basePath) : void 0;
|
|
3485
|
+
if (wireTests !== void 0 || wireTestsFallback !== void 0) {
|
|
3486
|
+
generation.wireTests = { enabled: wireTests ?? true };
|
|
3487
|
+
if (wireTestsFallback !== void 0) {
|
|
3488
|
+
generation.wireTests.fallbackToGeneratedErrorExamples = wireTestsFallback;
|
|
3489
|
+
}
|
|
3490
|
+
}
|
|
3277
3491
|
const webSockets = takeBoolean(
|
|
3278
3492
|
config,
|
|
3279
3493
|
["generateWebSocketClients", "shouldGenerateWebsocketClients", "enableWebsockets"],
|
|
@@ -3316,10 +3530,10 @@ function mapTypescriptStreams(config, state, basePath) {
|
|
|
3316
3530
|
function mapLanguageConfig(language, config, state, packageConfig, basePath, targetIndex) {
|
|
3317
3531
|
switch (language) {
|
|
3318
3532
|
case "typescript":
|
|
3319
|
-
return mapTypescript(config, state, packageConfig, basePath);
|
|
3533
|
+
return mapTypescript(config, state, packageConfig, basePath, true);
|
|
3320
3534
|
case "mcp":
|
|
3321
3535
|
return {
|
|
3322
|
-
...mapTypescript(config, state, packageConfig, basePath),
|
|
3536
|
+
...mapTypescript(config, state, packageConfig, basePath, false),
|
|
3323
3537
|
...mapMcp(config, state, basePath)
|
|
3324
3538
|
};
|
|
3325
3539
|
case "python":
|
|
@@ -3345,7 +3559,7 @@ function mapLanguageConfig(language, config, state, packageConfig, basePath, tar
|
|
|
3345
3559
|
return mapTerraform(config, state, packageConfig, basePath);
|
|
3346
3560
|
}
|
|
3347
3561
|
}
|
|
3348
|
-
function mapTypescript(config, state, packageConfig, basePath) {
|
|
3562
|
+
function mapTypescript(config, state, packageConfig, basePath, sdkTarget) {
|
|
3349
3563
|
const packageJsonManifest = mapPackageManifest(
|
|
3350
3564
|
config,
|
|
3351
3565
|
["packageJson"],
|
|
@@ -3358,18 +3572,74 @@ function mapTypescript(config, state, packageConfig, basePath) {
|
|
|
3358
3572
|
const packageManagerVersionPart = packageManagerAtIndex >= 0 ? packageJsonPackageManager?.slice(packageManagerAtIndex + 1).split("+")[0] : void 0;
|
|
3359
3573
|
const packageManagerVersion = packageManagerVersionPart || void 0;
|
|
3360
3574
|
if (packageJsonManifest) liftPackageJsonDependencies(packageJsonManifest, state, packageConfig);
|
|
3575
|
+
const manifestOptions = sdkTarget && packageJsonManifest ? mapPackageManifestOptions(packageJsonManifest, state, packageConfig) : {};
|
|
3361
3576
|
const serdeLayer = takeBoolean(config, ["serdeLayer"], state, basePath);
|
|
3362
3577
|
const noSerdeLayer = takeBoolean(config, ["noSerdeLayer"], state, basePath);
|
|
3363
|
-
const fetchSupport = takeEnum(
|
|
3578
|
+
const fetchSupport = takeEnum(
|
|
3579
|
+
config,
|
|
3580
|
+
["fetchSupport"],
|
|
3581
|
+
sdkTarget ? ["native", "node-fetch"] : ["native"],
|
|
3582
|
+
state,
|
|
3583
|
+
basePath
|
|
3584
|
+
);
|
|
3364
3585
|
const namingObject = takeObject(config, ["naming"], state, basePath);
|
|
3365
3586
|
const nestedNamespace = namingObject ? takeString(namingObject.value, ["namespace"], state, namingObject.path) : void 0;
|
|
3587
|
+
const sdkOnlyOptions = sdkTarget ? {
|
|
3588
|
+
formDataSupport: takeEnum(
|
|
3589
|
+
config,
|
|
3590
|
+
["formDataSupport"],
|
|
3591
|
+
["Node16", "Node18"],
|
|
3592
|
+
state,
|
|
3593
|
+
basePath
|
|
3594
|
+
),
|
|
3595
|
+
allowExtraFields: takeBoolean(config, ["allowExtraFields"], state, basePath),
|
|
3596
|
+
generateSubpackageExports: takeBoolean(
|
|
3597
|
+
config,
|
|
3598
|
+
["generateSubpackageExports"],
|
|
3599
|
+
state,
|
|
3600
|
+
basePath
|
|
3601
|
+
),
|
|
3602
|
+
exportAllRequestsAtRoot: takeBoolean(config, ["exportAllRequestsAtRoot"], state, basePath),
|
|
3603
|
+
generateEndpointMetadata: takeBoolean(
|
|
3604
|
+
config,
|
|
3605
|
+
["generateEndpointMetadata"],
|
|
3606
|
+
state,
|
|
3607
|
+
basePath
|
|
3608
|
+
),
|
|
3609
|
+
outputEsm: takeBoolean(config, ["outputEsm"], state, basePath),
|
|
3610
|
+
neverThrowErrors: takeBoolean(config, ["neverThrowErrors"], state, basePath),
|
|
3611
|
+
includeOtherInUnionTypes: takeBoolean(
|
|
3612
|
+
config,
|
|
3613
|
+
["includeOtherInUnionTypes"],
|
|
3614
|
+
state,
|
|
3615
|
+
basePath
|
|
3616
|
+
),
|
|
3617
|
+
includeUtilsOnUnionMembers: takeBoolean(
|
|
3618
|
+
config,
|
|
3619
|
+
["includeUtilsOnUnionMembers"],
|
|
3620
|
+
state,
|
|
3621
|
+
basePath
|
|
3622
|
+
),
|
|
3623
|
+
omitFernHeaders: takeBoolean(config, ["omitFernHeaders"], state, basePath),
|
|
3624
|
+
linter: takeEnum(config, ["linter"], ["biome", "oxlint", "none"], state, basePath),
|
|
3625
|
+
formatter: takeEnum(
|
|
3626
|
+
config,
|
|
3627
|
+
["formatter"],
|
|
3628
|
+
["prettier", "biome", "oxfmt", "none"],
|
|
3629
|
+
state,
|
|
3630
|
+
basePath
|
|
3631
|
+
)
|
|
3632
|
+
} : {};
|
|
3366
3633
|
return compact({
|
|
3634
|
+
...sdkOnlyOptions,
|
|
3635
|
+
// Only the manifest writes these keys; nothing in sdkOnlyOptions or below shares a name.
|
|
3636
|
+
...manifestOptions,
|
|
3367
3637
|
typescriptVersion: takeString(config, ["typescriptVersion"], state, basePath),
|
|
3368
3638
|
zodVersion: takeString(config, ["zodVersion"], state, basePath),
|
|
3369
3639
|
packageManager: takeEnum(config, ["packageManager"], ["pnpm", "yarn"], state, basePath),
|
|
3370
3640
|
packageManagerVersion,
|
|
3371
3641
|
testFramework: takeEnum(config, ["testFramework"], ["jest", "vitest"], state, basePath),
|
|
3372
|
-
httpClient: fetchSupport ===
|
|
3642
|
+
httpClient: fetchSupport === void 0 ? void 0 : { name: fetchSupport === "native" ? "fetch" : "node-fetch" },
|
|
3373
3643
|
bundle: takeBoolean(config, ["bundle"], state, basePath),
|
|
3374
3644
|
exportClassDefault: takeBoolean(config, ["exportClassDefault"], state, basePath),
|
|
3375
3645
|
namespaceExportName: takeString(config, ["namespaceExportName", "namespaceExport"], state, basePath) ?? nestedNamespace,
|
|
@@ -3766,6 +4036,83 @@ function mapPackageManifest(config, aliases, state, packageConfig, basePath) {
|
|
|
3766
4036
|
);
|
|
3767
4037
|
return manifest;
|
|
3768
4038
|
}
|
|
4039
|
+
function mapPackageManifestOptions(manifest, state, packageConfig) {
|
|
4040
|
+
const bugs = takeManifestBugs(manifest, state);
|
|
4041
|
+
if (bugs) packageConfig.bugs = bugs;
|
|
4042
|
+
const repository = takeManifestRepository(manifest, state);
|
|
4043
|
+
if (repository !== void 0 && packageConfig.repository === void 0) {
|
|
4044
|
+
packageConfig.repository = repository;
|
|
4045
|
+
}
|
|
4046
|
+
const exports = takeObject(manifest.value, ["exports"], state, manifest.path);
|
|
4047
|
+
if (exports) consume(state, exports.path);
|
|
4048
|
+
return compact({
|
|
4049
|
+
exports: exports?.value,
|
|
4050
|
+
scripts: takeManifestScripts(manifest, state),
|
|
4051
|
+
files: takeStringArray(manifest.value, ["files"], state, manifest.path),
|
|
4052
|
+
engines: takeManifestStringRecord(manifest, "engines", state),
|
|
4053
|
+
lintStaged: takeManifestLintStaged(manifest, state),
|
|
4054
|
+
browser: takeManifestBrowser(manifest, state)
|
|
4055
|
+
});
|
|
4056
|
+
}
|
|
4057
|
+
function takeManifestBugs(manifest, state) {
|
|
4058
|
+
const text = takeString(manifest.value, ["bugs"], state, manifest.path);
|
|
4059
|
+
if (text !== void 0) return { url: text };
|
|
4060
|
+
const located = takeObject(manifest.value, ["bugs"], state, manifest.path);
|
|
4061
|
+
if (!located) return void 0;
|
|
4062
|
+
const url = takeString(located.value, ["url"], state, located.path);
|
|
4063
|
+
const email = takeString(located.value, ["email"], state, located.path);
|
|
4064
|
+
return url === void 0 && email === void 0 ? void 0 : compact({ url, email });
|
|
4065
|
+
}
|
|
4066
|
+
function takeManifestRepository(manifest, state) {
|
|
4067
|
+
const text = takeString(manifest.value, ["repository"], state, manifest.path);
|
|
4068
|
+
if (text !== void 0) return text;
|
|
4069
|
+
const located = takeObject(manifest.value, ["repository"], state, manifest.path);
|
|
4070
|
+
if (!located) return void 0;
|
|
4071
|
+
const url = takeString(located.value, ["url"], state, located.path);
|
|
4072
|
+
if (url !== void 0) void takeEnum(located.value, ["type"], ["git"], state, located.path);
|
|
4073
|
+
return url;
|
|
4074
|
+
}
|
|
4075
|
+
function takeManifestScripts(manifest, state) {
|
|
4076
|
+
const located = takeObject(manifest.value, ["scripts"], state, manifest.path);
|
|
4077
|
+
if (!located) return void 0;
|
|
4078
|
+
const scripts = Object.entries(located.value).flatMap(([name, command]) => {
|
|
4079
|
+
if (typeof command !== "string" || !command) return [];
|
|
4080
|
+
consume(state, [...located.path, name]);
|
|
4081
|
+
return [{ name, command }];
|
|
4082
|
+
});
|
|
4083
|
+
return scripts.length ? scripts : void 0;
|
|
4084
|
+
}
|
|
4085
|
+
function takeManifestStringRecord(manifest, key, state) {
|
|
4086
|
+
const located = takeObject(manifest.value, [key], state, manifest.path);
|
|
4087
|
+
if (!located) return void 0;
|
|
4088
|
+
const entries = Object.entries(located.value).flatMap(([name, value]) => {
|
|
4089
|
+
if (typeof value !== "string" || !value) return [];
|
|
4090
|
+
consume(state, [...located.path, name]);
|
|
4091
|
+
return [[name, value]];
|
|
4092
|
+
});
|
|
4093
|
+
return entries.length ? Object.fromEntries(entries) : void 0;
|
|
4094
|
+
}
|
|
4095
|
+
function takeManifestLintStaged(manifest, state) {
|
|
4096
|
+
const located = takeObject(manifest.value, ["lint-staged"], state, manifest.path);
|
|
4097
|
+
if (!located) return void 0;
|
|
4098
|
+
const entries = Object.entries(located.value).flatMap(([glob, commands]) => {
|
|
4099
|
+
const list = typeof commands === "string" ? [commands] : stringArrayValue(commands);
|
|
4100
|
+
if (!list?.length || list.some((command) => !command)) return [];
|
|
4101
|
+
consume(state, [...located.path, glob]);
|
|
4102
|
+
return [[glob, list]];
|
|
4103
|
+
});
|
|
4104
|
+
return entries.length ? Object.fromEntries(entries) : void 0;
|
|
4105
|
+
}
|
|
4106
|
+
function takeManifestBrowser(manifest, state) {
|
|
4107
|
+
const located = takeObject(manifest.value, ["browser"], state, manifest.path);
|
|
4108
|
+
if (!located) return void 0;
|
|
4109
|
+
const entries = Object.entries(located.value).flatMap(([name, value]) => {
|
|
4110
|
+
if (typeof value !== "boolean" && (typeof value !== "string" || !value)) return [];
|
|
4111
|
+
consume(state, [...located.path, name]);
|
|
4112
|
+
return [[name, value]];
|
|
4113
|
+
});
|
|
4114
|
+
return entries.length ? Object.fromEntries(entries) : void 0;
|
|
4115
|
+
}
|
|
3769
4116
|
function takeManifestAuthors(manifest, state) {
|
|
3770
4117
|
const located = locate(manifest.value, ["authors"], manifest.path);
|
|
3771
4118
|
if (!located || !Array.isArray(located.value)) return [];
|
|
@@ -4150,6 +4497,7 @@ var publishConfigSchema = zod.z.discriminatedUnion("registry", [
|
|
|
4150
4497
|
zod.z.strictObject({
|
|
4151
4498
|
registry: zod.z.literal("rubygems").describe("Publishes the package to a RubyGems-compatible registry."),
|
|
4152
4499
|
apiKeyEnvironmentVariable: nonEmptyStringSchema.optional().describe("The environment variable containing the RubyGems API key."),
|
|
4500
|
+
...trustedPublishingShape,
|
|
4153
4501
|
...commonPublishShape2
|
|
4154
4502
|
}),
|
|
4155
4503
|
zod.z.strictObject({
|
|
@@ -4220,7 +4568,7 @@ var githubOutputSchema2 = zod.z.strictObject({
|
|
|
4220
4568
|
var distributionShape = {
|
|
4221
4569
|
/** Valid only for `cli` targets with GitHub delivery; secret names only, never values. */
|
|
4222
4570
|
distribution: cliDistributionConfigSchema.optional().describe(
|
|
4223
|
-
"CLI release channels
|
|
4571
|
+
"CLI release channels and build attestation settings for the generated release workflow; credentials are GitHub Actions secret names."
|
|
4224
4572
|
)
|
|
4225
4573
|
};
|
|
4226
4574
|
var credentialResolutionShape = {
|