@postman/sdk-config 0.12.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 +158 -15
- 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 +158 -15
- package/dist/index.js.map +1 -1
- package/dist/sdk-config/index.cjs +156 -14
- 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 +156 -14
- package/dist/sdk-config/index.js.map +1 -1
- package/dist/sdk-config/v1/index.cjs +156 -14
- package/dist/sdk-config/v1/index.cjs.map +1 -1
- package/dist/sdk-config/v1/index.d.cts +400 -31
- package/dist/sdk-config/v1/index.d.ts +400 -31
- package/dist/sdk-config/v1/index.js +156 -14
- package/dist/sdk-config/v1/index.js.map +1 -1
- package/dist/sdk-config-ir/index.cjs +18 -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 +18 -5
- package/dist/sdk-config-ir/index.js.map +1 -1
- package/dist/sdk-config-ir/v1/index.cjs +18 -5
- package/dist/sdk-config-ir/v1/index.cjs.map +1 -1
- package/dist/sdk-config-ir/v1/index.d.cts +27 -4
- package/dist/sdk-config-ir/v1/index.d.ts +27 -4
- package/dist/sdk-config-ir/v1/index.js +18 -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 +32 -11
- package/src/sdk-config-ir/v1/README.md +36 -29
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { FernConfigMappingDiagnostic, FernConfigMappingError, FernConfigMappingResult, FernResolvedGeneratorGroupInput, FernResolvedGeneratorInput, FernSdkConfigLanguage, SDK_CONFIG_V1_SCHEMA_VERSION, SdkConfigV1, SdkConfigV1ApiConfig, SdkConfigV1ApiConfigInput, SdkConfigV1CliOutputConfig, SdkConfigV1ClientConfig, SdkConfigV1ClientConfigInput, SdkConfigV1ClientConfigOverride, SdkConfigV1Dependency, SdkConfigV1DocsConfig, SdkConfigV1Document, SdkConfigV1GenerationConfig, SdkConfigV1GenerationConfigInput, SdkConfigV1GenerationConfigOverride, SdkConfigV1Input, SdkConfigV1OutputConfig, SdkConfigV1PackageConfig, SdkConfigV1PublishConfig, SdkConfigV1PublishRegistry, SdkConfigV1ReplayConfig, SdkConfigV1SourceConfig, SdkConfigV1SourceSpec, SdkConfigV1Target, SdkConfigV1WebhookSignature, SdkConfigV1WebhookSignatureInput, getSdkConfigV1Diagnostics, mapFernConfigToSdkConfigV1, parseSdkConfigV1, parseSdkConfigV1ForConsumption, sdkConfigV1ApiConfigSchema, sdkConfigV1AuthConfigSchema, sdkConfigV1AuthSchemeSchema, sdkConfigV1CliOutputConfigSchema, sdkConfigV1ClientConfigOverrideSchema, sdkConfigV1ClientConfigSchema, sdkConfigV1DependencySchema, sdkConfigV1DocsConfigSchema, sdkConfigV1GenerationConfigOverrideSchema, sdkConfigV1GenerationConfigSchema, sdkConfigV1OutputConfigSchema, sdkConfigV1PackageConfigSchema, sdkConfigV1PublishConfigSchema, sdkConfigV1PublishRegistrySchema, sdkConfigV1ReadmeCustomSectionSchema, sdkConfigV1ReadmeEndpointSchema, sdkConfigV1ReplayConfigSchema, sdkConfigV1Schema, sdkConfigV1SourceConfigSchema, sdkConfigV1SourceSpecSchema, sdkConfigV1TargetSchema, sdkConfigV1WebhookSignatureSchema, splitSdkConfigV1TargetGeneration, validateSdkConfigV1 } from './v1/index.cjs';
|
|
2
|
-
export { C as SDK_CONFIG_V1_CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE, a as SdkConfigV1CliDistributionConfig, b as SdkConfigV1CliDistributionGithubAppConfig, c as SdkConfigV1CliDistributionHomebrewConfig, d as SdkConfigV1CliDistributionScoopConfig, S as SdkConfigV1Diagnostic, s as sdkConfigV1CliDistributionConfigSchema, t as sdkConfigV1CliDistributionGithubAppSchema, u as sdkConfigV1CliDistributionHomebrewSchema, v as sdkConfigV1CliDistributionScoopSchema, w as sdkConfigV1CliGenerationConfigSchema, x as sdkConfigV1ComposerPackageNameSchema, y as sdkConfigV1CsharpGenerationConfigSchema, A as sdkConfigV1ExactSemverSchema, B as sdkConfigV1GithubActionsSecretNameSchema, E as sdkConfigV1GoGenerationConfigSchema, F as sdkConfigV1GoModulePathSchema, H as sdkConfigV1JavaGenerationConfigSchema, N as sdkConfigV1KotlinGenerationConfigSchema, Q as sdkConfigV1McpGenerationConfigSchema, U as sdkConfigV1NonEmptyStringSchema, W as sdkConfigV1PhpGenerationConfigSchema, X as sdkConfigV1PythonGenerationConfigSchema, Y as sdkConfigV1RelativePathSchema, Z as sdkConfigV1RubyGenerationConfigSchema, _ as sdkConfigV1RustGenerationConfigSchema, $ as sdkConfigV1SwiftGenerationConfigSchema, a0 as sdkConfigV1TerraformGenerationConfigSchema, a1 as sdkConfigV1TypescriptGenerationConfigSchema } from '../typescript-
|
|
2
|
+
export { C as SDK_CONFIG_V1_CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE, a as SdkConfigV1CliDistributionConfig, b as SdkConfigV1CliDistributionGithubAppConfig, c as SdkConfigV1CliDistributionHomebrewConfig, d as SdkConfigV1CliDistributionScoopConfig, S as SdkConfigV1Diagnostic, s as sdkConfigV1CliDistributionConfigSchema, t as sdkConfigV1CliDistributionGithubAppSchema, u as sdkConfigV1CliDistributionHomebrewSchema, v as sdkConfigV1CliDistributionScoopSchema, w as sdkConfigV1CliGenerationConfigSchema, x as sdkConfigV1ComposerPackageNameSchema, y as sdkConfigV1CsharpGenerationConfigSchema, A as sdkConfigV1ExactSemverSchema, B as sdkConfigV1GithubActionsSecretNameSchema, E as sdkConfigV1GoGenerationConfigSchema, F as sdkConfigV1GoModulePathSchema, H as sdkConfigV1JavaGenerationConfigSchema, N as sdkConfigV1KotlinGenerationConfigSchema, Q as sdkConfigV1McpGenerationConfigSchema, U as sdkConfigV1NonEmptyStringSchema, W as sdkConfigV1PhpGenerationConfigSchema, X as sdkConfigV1PythonGenerationConfigSchema, Y as sdkConfigV1RelativePathSchema, Z as sdkConfigV1RubyGenerationConfigSchema, _ as sdkConfigV1RustGenerationConfigSchema, $ as sdkConfigV1SwiftGenerationConfigSchema, a0 as sdkConfigV1TerraformGenerationConfigSchema, a1 as sdkConfigV1TypescriptGenerationConfigSchema } from '../typescript-BFRxjAah.cjs';
|
|
3
3
|
import 'zod';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { FernConfigMappingDiagnostic, FernConfigMappingError, FernConfigMappingResult, FernResolvedGeneratorGroupInput, FernResolvedGeneratorInput, FernSdkConfigLanguage, SDK_CONFIG_V1_SCHEMA_VERSION, SdkConfigV1, SdkConfigV1ApiConfig, SdkConfigV1ApiConfigInput, SdkConfigV1CliOutputConfig, SdkConfigV1ClientConfig, SdkConfigV1ClientConfigInput, SdkConfigV1ClientConfigOverride, SdkConfigV1Dependency, SdkConfigV1DocsConfig, SdkConfigV1Document, SdkConfigV1GenerationConfig, SdkConfigV1GenerationConfigInput, SdkConfigV1GenerationConfigOverride, SdkConfigV1Input, SdkConfigV1OutputConfig, SdkConfigV1PackageConfig, SdkConfigV1PublishConfig, SdkConfigV1PublishRegistry, SdkConfigV1ReplayConfig, SdkConfigV1SourceConfig, SdkConfigV1SourceSpec, SdkConfigV1Target, SdkConfigV1WebhookSignature, SdkConfigV1WebhookSignatureInput, getSdkConfigV1Diagnostics, mapFernConfigToSdkConfigV1, parseSdkConfigV1, parseSdkConfigV1ForConsumption, sdkConfigV1ApiConfigSchema, sdkConfigV1AuthConfigSchema, sdkConfigV1AuthSchemeSchema, sdkConfigV1CliOutputConfigSchema, sdkConfigV1ClientConfigOverrideSchema, sdkConfigV1ClientConfigSchema, sdkConfigV1DependencySchema, sdkConfigV1DocsConfigSchema, sdkConfigV1GenerationConfigOverrideSchema, sdkConfigV1GenerationConfigSchema, sdkConfigV1OutputConfigSchema, sdkConfigV1PackageConfigSchema, sdkConfigV1PublishConfigSchema, sdkConfigV1PublishRegistrySchema, sdkConfigV1ReadmeCustomSectionSchema, sdkConfigV1ReadmeEndpointSchema, sdkConfigV1ReplayConfigSchema, sdkConfigV1Schema, sdkConfigV1SourceConfigSchema, sdkConfigV1SourceSpecSchema, sdkConfigV1TargetSchema, sdkConfigV1WebhookSignatureSchema, splitSdkConfigV1TargetGeneration, validateSdkConfigV1 } from './v1/index.js';
|
|
2
|
-
export { C as SDK_CONFIG_V1_CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE, a as SdkConfigV1CliDistributionConfig, b as SdkConfigV1CliDistributionGithubAppConfig, c as SdkConfigV1CliDistributionHomebrewConfig, d as SdkConfigV1CliDistributionScoopConfig, S as SdkConfigV1Diagnostic, s as sdkConfigV1CliDistributionConfigSchema, t as sdkConfigV1CliDistributionGithubAppSchema, u as sdkConfigV1CliDistributionHomebrewSchema, v as sdkConfigV1CliDistributionScoopSchema, w as sdkConfigV1CliGenerationConfigSchema, x as sdkConfigV1ComposerPackageNameSchema, y as sdkConfigV1CsharpGenerationConfigSchema, A as sdkConfigV1ExactSemverSchema, B as sdkConfigV1GithubActionsSecretNameSchema, E as sdkConfigV1GoGenerationConfigSchema, F as sdkConfigV1GoModulePathSchema, H as sdkConfigV1JavaGenerationConfigSchema, N as sdkConfigV1KotlinGenerationConfigSchema, Q as sdkConfigV1McpGenerationConfigSchema, U as sdkConfigV1NonEmptyStringSchema, W as sdkConfigV1PhpGenerationConfigSchema, X as sdkConfigV1PythonGenerationConfigSchema, Y as sdkConfigV1RelativePathSchema, Z as sdkConfigV1RubyGenerationConfigSchema, _ as sdkConfigV1RustGenerationConfigSchema, $ as sdkConfigV1SwiftGenerationConfigSchema, a0 as sdkConfigV1TerraformGenerationConfigSchema, a1 as sdkConfigV1TypescriptGenerationConfigSchema } from '../typescript-
|
|
2
|
+
export { C as SDK_CONFIG_V1_CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE, a as SdkConfigV1CliDistributionConfig, b as SdkConfigV1CliDistributionGithubAppConfig, c as SdkConfigV1CliDistributionHomebrewConfig, d as SdkConfigV1CliDistributionScoopConfig, S as SdkConfigV1Diagnostic, s as sdkConfigV1CliDistributionConfigSchema, t as sdkConfigV1CliDistributionGithubAppSchema, u as sdkConfigV1CliDistributionHomebrewSchema, v as sdkConfigV1CliDistributionScoopSchema, w as sdkConfigV1CliGenerationConfigSchema, x as sdkConfigV1ComposerPackageNameSchema, y as sdkConfigV1CsharpGenerationConfigSchema, A as sdkConfigV1ExactSemverSchema, B as sdkConfigV1GithubActionsSecretNameSchema, E as sdkConfigV1GoGenerationConfigSchema, F as sdkConfigV1GoModulePathSchema, H as sdkConfigV1JavaGenerationConfigSchema, N as sdkConfigV1KotlinGenerationConfigSchema, Q as sdkConfigV1McpGenerationConfigSchema, U as sdkConfigV1NonEmptyStringSchema, W as sdkConfigV1PhpGenerationConfigSchema, X as sdkConfigV1PythonGenerationConfigSchema, Y as sdkConfigV1RelativePathSchema, Z as sdkConfigV1RubyGenerationConfigSchema, _ as sdkConfigV1RustGenerationConfigSchema, $ as sdkConfigV1SwiftGenerationConfigSchema, a0 as sdkConfigV1TerraformGenerationConfigSchema, a1 as sdkConfigV1TypescriptGenerationConfigSchema } from '../typescript-BFRxjAah.js';
|
|
3
3
|
import 'zod';
|
package/dist/sdk-config/index.js
CHANGED
|
@@ -508,7 +508,10 @@ var cliDistributionConfigSchema = z.strictObject({
|
|
|
508
508
|
"A GitHub App used to mint short-lived tokens for every channel without its own tokenSecretName."
|
|
509
509
|
),
|
|
510
510
|
homebrew: cliDistributionHomebrewSchema.optional().describe("Publishes a Homebrew formula to a tap repository on each tagged release."),
|
|
511
|
-
scoop: cliDistributionScoopSchema.optional().describe("Publishes a Scoop manifest to a bucket repository on each tagged release.")
|
|
511
|
+
scoop: cliDistributionScoopSchema.optional().describe("Publishes a Scoop manifest to a bucket repository on each tagged release."),
|
|
512
|
+
githubAttestations: z.union([z.literal("auto"), z.boolean()], { error: 'must be "auto", true, or false' }).optional().describe(
|
|
513
|
+
'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.'
|
|
514
|
+
)
|
|
512
515
|
}).superRefine((distribution, context) => {
|
|
513
516
|
if (distribution.homebrew !== void 0 || distribution.scoop !== void 0) {
|
|
514
517
|
return;
|
|
@@ -521,6 +524,9 @@ var cliDistributionConfigSchema = z.strictObject({
|
|
|
521
524
|
});
|
|
522
525
|
return;
|
|
523
526
|
}
|
|
527
|
+
if (distribution.githubAttestations !== void 0) {
|
|
528
|
+
return;
|
|
529
|
+
}
|
|
524
530
|
context.addIssue({
|
|
525
531
|
code: "custom",
|
|
526
532
|
message: "distribution must configure at least one channel: homebrew or scoop"
|
|
@@ -532,14 +538,17 @@ var CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE = "CLI_DISTRIBUTION_NON_RELEASE_MODE"
|
|
|
532
538
|
var nonReleaseGithubModes = /* @__PURE__ */ new Set(["pull-request", "push", "commit"]);
|
|
533
539
|
function cliDistributionModeDiagnostic(output, outputPath) {
|
|
534
540
|
const mode = output?.github?.mode;
|
|
535
|
-
|
|
541
|
+
const distribution = output?.distribution;
|
|
542
|
+
if (distribution === void 0 || mode === void 0 || !nonReleaseGithubModes.has(mode)) {
|
|
536
543
|
return void 0;
|
|
537
544
|
}
|
|
545
|
+
const hasChannel = distribution.homebrew !== void 0 || distribution.scoop !== void 0;
|
|
546
|
+
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.";
|
|
538
547
|
return {
|
|
539
548
|
code: CLI_DISTRIBUTION_NON_RELEASE_MODE_CODE,
|
|
540
549
|
severity: "warning",
|
|
541
550
|
path: [...outputPath, "github", "mode"],
|
|
542
|
-
reason: `GitHub mode "${mode}" does not create a release tag, so
|
|
551
|
+
reason: `GitHub mode "${mode}" does not create a release tag, so ${consequence}`,
|
|
543
552
|
suggestedAction: 'Use mode "release" or "commit-and-release", or push a version tag after merging generated changes.'
|
|
544
553
|
};
|
|
545
554
|
}
|
|
@@ -974,6 +983,7 @@ var DISTRIBUTION_KEYS = {
|
|
|
974
983
|
homebrew: { tap: "tap", formula: "formula", tokenEnvironmentVariable: "tokenSecretName" },
|
|
975
984
|
scoop: { bucket: "bucket", tokenEnvironmentVariable: "tokenSecretName" }
|
|
976
985
|
};
|
|
986
|
+
var DISTRIBUTION_SCALAR_KEYS = ["githubAttestations"];
|
|
977
987
|
function mapCliDistribution(config, state, basePath, targetIndex) {
|
|
978
988
|
if (!Object.hasOwn(config, "distribution")) return;
|
|
979
989
|
const raw = config.distribution;
|
|
@@ -1020,6 +1030,11 @@ function translateDistribution(distribution, path) {
|
|
|
1020
1030
|
}
|
|
1021
1031
|
value[block] = translatedBlock;
|
|
1022
1032
|
}
|
|
1033
|
+
for (const key of DISTRIBUTION_SCALAR_KEYS) {
|
|
1034
|
+
if (!Object.hasOwn(distribution, key)) continue;
|
|
1035
|
+
value[key] = distribution[key];
|
|
1036
|
+
consumedPaths.push([...path, key]);
|
|
1037
|
+
}
|
|
1023
1038
|
return { value, consumedPaths, legacyKeys };
|
|
1024
1039
|
}
|
|
1025
1040
|
function invalidDistributionDiagnostic(issue, path, legacyKeys, targetIndex) {
|
|
@@ -1159,6 +1174,7 @@ function mapOutput(generator, language, index) {
|
|
|
1159
1174
|
output.publishV2,
|
|
1160
1175
|
rawOutput,
|
|
1161
1176
|
language,
|
|
1177
|
+
"zip",
|
|
1162
1178
|
[...outputPath, "publishV2"],
|
|
1163
1179
|
state,
|
|
1164
1180
|
index
|
|
@@ -1180,6 +1196,7 @@ function mapOutput(generator, language, index) {
|
|
|
1180
1196
|
output.registryOverrides,
|
|
1181
1197
|
rawOutput,
|
|
1182
1198
|
language,
|
|
1199
|
+
"zip",
|
|
1183
1200
|
[...outputPath, "registryOverrides"],
|
|
1184
1201
|
state,
|
|
1185
1202
|
index
|
|
@@ -1207,7 +1224,14 @@ function mapOutput(generator, language, index) {
|
|
|
1207
1224
|
}
|
|
1208
1225
|
}
|
|
1209
1226
|
function sanitizeNormalizedOutput(output, rawOutput, state, index) {
|
|
1210
|
-
const publish = output.publish ? sanitizePublishConfig(
|
|
1227
|
+
const publish = output.publish ? sanitizePublishConfig(
|
|
1228
|
+
output.publish,
|
|
1229
|
+
output.publish,
|
|
1230
|
+
rawOutput,
|
|
1231
|
+
output.delivery,
|
|
1232
|
+
state,
|
|
1233
|
+
index
|
|
1234
|
+
) : void 0;
|
|
1211
1235
|
const publishShape = publish ? { publish } : {};
|
|
1212
1236
|
if (output.delivery !== "github") return { ...output, ...publishShape };
|
|
1213
1237
|
const { credentials, ...github } = output.github;
|
|
@@ -1234,7 +1258,15 @@ function githubOutput(value, publishInfo, rawOutput, language, sourcePath, state
|
|
|
1234
1258
|
);
|
|
1235
1259
|
consume(state, [...sourcePath, "owner"]);
|
|
1236
1260
|
consume(state, [...sourcePath, "repo"]);
|
|
1237
|
-
const publication = publishInfo ? mapPublication(
|
|
1261
|
+
const publication = publishInfo ? mapPublication(
|
|
1262
|
+
publishInfo,
|
|
1263
|
+
rawOutput,
|
|
1264
|
+
language,
|
|
1265
|
+
"github",
|
|
1266
|
+
[...sourcePath, "publishInfo"],
|
|
1267
|
+
state,
|
|
1268
|
+
index
|
|
1269
|
+
) : void 0;
|
|
1238
1270
|
const type = stringValue(value.type);
|
|
1239
1271
|
const licensePackage = mapGithubLicense(value.license, [...sourcePath, "license"], state);
|
|
1240
1272
|
const reviewers = mapReviewers(value.reviewers, [...sourcePath, "reviewers"], state);
|
|
@@ -1327,7 +1359,7 @@ function reviewerNames(value, expectedType, sourcePath, state) {
|
|
|
1327
1359
|
});
|
|
1328
1360
|
return names.length ? names : void 0;
|
|
1329
1361
|
}
|
|
1330
|
-
function mapPublication(value, rawOutput, language, sourcePath, state, index) {
|
|
1362
|
+
function mapPublication(value, rawOutput, language, delivery, sourcePath, state, index) {
|
|
1331
1363
|
if (!isObject(value))
|
|
1332
1364
|
fail(
|
|
1333
1365
|
"FERN_PUBLICATION_INVALID",
|
|
@@ -1348,6 +1380,7 @@ function mapPublication(value, rawOutput, language, sourcePath, state, index) {
|
|
|
1348
1380
|
compact({ registry, url: registryUrl }),
|
|
1349
1381
|
nested,
|
|
1350
1382
|
rawOutput,
|
|
1383
|
+
delivery,
|
|
1351
1384
|
state,
|
|
1352
1385
|
index
|
|
1353
1386
|
);
|
|
@@ -1368,7 +1401,7 @@ function mapPublication(value, rawOutput, language, sourcePath, state, index) {
|
|
|
1368
1401
|
...packageName || Object.keys(metadata).length ? { package: { ...optional("packageName", packageName), ...metadata } } : {}
|
|
1369
1402
|
};
|
|
1370
1403
|
}
|
|
1371
|
-
function sanitizePublishConfig(publish, resolvedPublication, rawOutput, state, index) {
|
|
1404
|
+
function sanitizePublishConfig(publish, resolvedPublication, rawOutput, delivery, state, index) {
|
|
1372
1405
|
const rawPublication = rawOutput?.location === publish.registry ? rawOutput : void 0;
|
|
1373
1406
|
const rawPath = ["group", "generators", index, "output"];
|
|
1374
1407
|
if (publish.registry === "npm" || publish.registry === "crates") {
|
|
@@ -1464,6 +1497,33 @@ function sanitizePublishConfig(publish, resolvedPublication, rawOutput, state, i
|
|
|
1464
1497
|
signature
|
|
1465
1498
|
});
|
|
1466
1499
|
}
|
|
1500
|
+
if (publish.registry === "nuget" || publish.registry === "rubygems") {
|
|
1501
|
+
const apiKey = mapApiKeyExpression(
|
|
1502
|
+
publish.registry,
|
|
1503
|
+
rawPublication,
|
|
1504
|
+
resolvedPublication,
|
|
1505
|
+
rawPath,
|
|
1506
|
+
state,
|
|
1507
|
+
index,
|
|
1508
|
+
fernDefaultApiKey(publish.registry, rawOutput, delivery)
|
|
1509
|
+
);
|
|
1510
|
+
warnForUnexpectedCredentialFields(
|
|
1511
|
+
rawPublication,
|
|
1512
|
+
resolvedPublication,
|
|
1513
|
+
["apiKey"],
|
|
1514
|
+
rawPath,
|
|
1515
|
+
state,
|
|
1516
|
+
index
|
|
1517
|
+
);
|
|
1518
|
+
return compact({
|
|
1519
|
+
registry: publish.registry,
|
|
1520
|
+
url: publish.url,
|
|
1521
|
+
releaseBranch: publish.releaseBranch,
|
|
1522
|
+
tolerateRepublish: publish.tolerateRepublish,
|
|
1523
|
+
apiKey,
|
|
1524
|
+
trustedPublishing: usesTrustedPublishing(rawPublication) || void 0
|
|
1525
|
+
});
|
|
1526
|
+
}
|
|
1467
1527
|
warnForUnrepresentableCredentials(rawPublication, resolvedPublication, rawPath, state, index);
|
|
1468
1528
|
return compact({
|
|
1469
1529
|
registry: publish.registry,
|
|
@@ -1472,11 +1532,19 @@ function sanitizePublishConfig(publish, resolvedPublication, rawOutput, state, i
|
|
|
1472
1532
|
tolerateRepublish: publish.tolerateRepublish
|
|
1473
1533
|
});
|
|
1474
1534
|
}
|
|
1475
|
-
function mapLegacyPublication(value, rawOutput, language, sourcePath, state, index) {
|
|
1535
|
+
function mapLegacyPublication(value, rawOutput, language, delivery, sourcePath, state, index) {
|
|
1476
1536
|
const registry = defaultRegistry(language, sourcePath, index);
|
|
1477
1537
|
const overrides = isObject(value) ? value : {};
|
|
1478
1538
|
const override = isObject(overrides[registry]) ? overrides[registry] : {};
|
|
1479
|
-
return mapPublication(
|
|
1539
|
+
return mapPublication(
|
|
1540
|
+
override,
|
|
1541
|
+
rawOutput,
|
|
1542
|
+
language,
|
|
1543
|
+
delivery,
|
|
1544
|
+
[...sourcePath, registry],
|
|
1545
|
+
state,
|
|
1546
|
+
index
|
|
1547
|
+
);
|
|
1480
1548
|
}
|
|
1481
1549
|
function mapCredentialExpression(rawPublication, resolvedPublication, field, rawPath, state, index) {
|
|
1482
1550
|
const rawValue = rawPublication?.[field];
|
|
@@ -1491,6 +1559,45 @@ function mapCredentialExpression(rawPublication, resolvedPublication, field, raw
|
|
|
1491
1559
|
}
|
|
1492
1560
|
return void 0;
|
|
1493
1561
|
}
|
|
1562
|
+
var TRUSTED_PUBLISHING_VALUES = /* @__PURE__ */ new Set(["OIDC", "<USE_OIDC>"]);
|
|
1563
|
+
function rawApiKeyValue(raw) {
|
|
1564
|
+
return raw?.apiKey ?? raw?.["api-key"];
|
|
1565
|
+
}
|
|
1566
|
+
function usesTrustedPublishing(rawPublication) {
|
|
1567
|
+
const rawValue = rawApiKeyValue(rawPublication);
|
|
1568
|
+
return typeof rawValue === "string" && TRUSTED_PUBLISHING_VALUES.has(rawValue);
|
|
1569
|
+
}
|
|
1570
|
+
function mapApiKeyExpression(registry, rawPublication, resolvedPublication, rawPath, state, index, defaultSecretName) {
|
|
1571
|
+
const rawValue = rawApiKeyValue(rawPublication);
|
|
1572
|
+
if (isEnvironmentExpression(rawValue)) return rawValue;
|
|
1573
|
+
if (usesTrustedPublishing(rawPublication)) return void 0;
|
|
1574
|
+
if (defaultSecretName !== void 0) return defaultSecretName;
|
|
1575
|
+
if (rawValue === void 0 && !hasResolvedCredential(resolvedPublication, "apiKey")) {
|
|
1576
|
+
return void 0;
|
|
1577
|
+
}
|
|
1578
|
+
addCredentialDiagnostic(
|
|
1579
|
+
state,
|
|
1580
|
+
[...rawPath, "apiKey"],
|
|
1581
|
+
["targets", index, "output", "publish", "apiKey"],
|
|
1582
|
+
apiKeyOmissionReason(registry)
|
|
1583
|
+
);
|
|
1584
|
+
return void 0;
|
|
1585
|
+
}
|
|
1586
|
+
function apiKeyOmissionReason(registry) {
|
|
1587
|
+
const label = registry === "nuget" ? "NuGet" : "RubyGems";
|
|
1588
|
+
return `Fern ${label} apiKey is not an exact environment expression naming a secret`;
|
|
1589
|
+
}
|
|
1590
|
+
var FERN_DEFAULT_NUGET_API_KEY = "${NUGET_API_TOKEN}";
|
|
1591
|
+
function fernDefaultApiKey(registry, rawOutput, delivery) {
|
|
1592
|
+
if (registry !== "nuget" || delivery !== "github" || rawOutput?.location !== "nuget") {
|
|
1593
|
+
return void 0;
|
|
1594
|
+
}
|
|
1595
|
+
const rawApiKey = rawApiKeyValue(rawOutput);
|
|
1596
|
+
if (typeof rawApiKey === "string" && TRUSTED_PUBLISHING_VALUES.has(rawApiKey)) {
|
|
1597
|
+
return void 0;
|
|
1598
|
+
}
|
|
1599
|
+
return FERN_DEFAULT_NUGET_API_KEY;
|
|
1600
|
+
}
|
|
1494
1601
|
function mapPypiCredentialExpressions(rawPublication, resolvedPublication, rawPath, state, index) {
|
|
1495
1602
|
const rawToken = rawPublication?.token;
|
|
1496
1603
|
if (isEnvironmentExpression(rawToken)) {
|
|
@@ -2194,6 +2301,29 @@ var mavenSignatureSchema = z.strictObject({
|
|
|
2194
2301
|
"The armored secret key, or an environment expression that resolves to it."
|
|
2195
2302
|
)
|
|
2196
2303
|
});
|
|
2304
|
+
function apiKeySecretSchema(registry, example) {
|
|
2305
|
+
return nonEmptyStringSchema.regex(
|
|
2306
|
+
/^\$\{[A-Za-z_][A-Za-z0-9_]*\}$/,
|
|
2307
|
+
`${registry} apiKey must be an environment expression naming a secret, such as ${example}`
|
|
2308
|
+
);
|
|
2309
|
+
}
|
|
2310
|
+
function apiKeySecretDescription(registry, example) {
|
|
2311
|
+
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.`;
|
|
2312
|
+
}
|
|
2313
|
+
function trustedPublishingSchema(registry) {
|
|
2314
|
+
return z.boolean().optional().describe(
|
|
2315
|
+
`Whether ${registry} publication uses trusted publishing (OIDC) instead of an API key secret.`
|
|
2316
|
+
);
|
|
2317
|
+
}
|
|
2318
|
+
function refineApiKeyAgainstTrustedPublishing(publish, context) {
|
|
2319
|
+
if (publish.trustedPublishing === true && publish.apiKey !== void 0) {
|
|
2320
|
+
context.addIssue({
|
|
2321
|
+
code: "custom",
|
|
2322
|
+
message: "apiKey must be omitted when trustedPublishing is true",
|
|
2323
|
+
path: ["apiKey"]
|
|
2324
|
+
});
|
|
2325
|
+
}
|
|
2326
|
+
}
|
|
2197
2327
|
var commonPublishShape = {
|
|
2198
2328
|
url: nonEmptyStringSchema.optional().describe("A custom package registry URL."),
|
|
2199
2329
|
releaseBranch: nonEmptyStringSchema.optional().describe("The branch used by generated package release workflows."),
|
|
@@ -2229,12 +2359,16 @@ var sdkConfigV1PublishConfigSchema = z.discriminatedUnion("registry", [
|
|
|
2229
2359
|
}),
|
|
2230
2360
|
z.strictObject({
|
|
2231
2361
|
registry: z.literal("nuget").describe("Publishes the package to a NuGet-compatible registry."),
|
|
2362
|
+
apiKey: apiKeySecretSchema("NuGet", "${NUGET_API_KEY}").optional().describe(apiKeySecretDescription("NuGet", "${NUGET_API_KEY}")),
|
|
2363
|
+
trustedPublishing: trustedPublishingSchema("NuGet"),
|
|
2232
2364
|
...commonPublishShape
|
|
2233
|
-
}),
|
|
2365
|
+
}).superRefine(refineApiKeyAgainstTrustedPublishing),
|
|
2234
2366
|
z.strictObject({
|
|
2235
2367
|
registry: z.literal("rubygems").describe("Publishes the package to a RubyGems-compatible registry."),
|
|
2368
|
+
apiKey: apiKeySecretSchema("RubyGems", "${RUBYGEMS_API_KEY}").optional().describe(apiKeySecretDescription("RubyGems", "${RUBYGEMS_API_KEY}")),
|
|
2369
|
+
trustedPublishing: trustedPublishingSchema("RubyGems"),
|
|
2236
2370
|
...commonPublishShape
|
|
2237
|
-
}),
|
|
2371
|
+
}).superRefine(refineApiKeyAgainstTrustedPublishing),
|
|
2238
2372
|
z.strictObject({
|
|
2239
2373
|
registry: z.literal("crates").describe("Publishes the crate to a Cargo-compatible registry."),
|
|
2240
2374
|
token: nonEmptyStringSchema.optional().describe("The Cargo registry token, or an environment expression that resolves to it."),
|
|
@@ -2292,7 +2426,7 @@ var sdkConfigV1OutputConfigSchema = z.discriminatedUnion(
|
|
|
2292
2426
|
);
|
|
2293
2427
|
var cliDistributionShape = {
|
|
2294
2428
|
distribution: cliDistributionConfigSchema.optional().describe(
|
|
2295
|
-
"CLI release channels
|
|
2429
|
+
"CLI release channels and build attestation settings for the generated release workflow; credentials are GitHub Actions secret names."
|
|
2296
2430
|
)
|
|
2297
2431
|
};
|
|
2298
2432
|
function rejectDistributionWithoutGithub(output, context) {
|
|
@@ -2338,6 +2472,9 @@ var apiImportSettingsSchema = z.strictObject({
|
|
|
2338
2472
|
discriminatedUnionV2: z.boolean().optional().describe("Whether oneOf and anyOf schemas use the newer discriminator inference rules."),
|
|
2339
2473
|
undiscriminatedUnionsWithLiterals: z.boolean().optional().describe("Whether literal-bearing unions remain undiscriminated during import."),
|
|
2340
2474
|
inlineAllOfSchemas: z.boolean().optional().describe("Whether schemas composed with allOf are inlined when possible."),
|
|
2475
|
+
inferDiscriminatedUnionBaseProperties: z.boolean().optional().describe(
|
|
2476
|
+
"Whether properties every discriminated-union variant shares are lifted onto the union."
|
|
2477
|
+
),
|
|
2341
2478
|
resolveSchemaCollisions: z.boolean().optional().describe("Whether colliding imported schema names are resolved automatically."),
|
|
2342
2479
|
asyncApiMessageNaming: z.enum(["v1", "v2"]).optional().describe("The naming strategy used for messages imported from AsyncAPI."),
|
|
2343
2480
|
defaultIntegerFormat: z.enum(["int32", "int64", "uint32", "uint64"]).optional().describe("The integer format used when a schema does not declare one.")
|
|
@@ -2556,7 +2693,7 @@ var pythonGenerationConfigSchema = z.strictObject({
|
|
|
2556
2693
|
additionalInitExports: z.array(additionalInitExportSchema).optional().describe("Additional names re-exported from the package initializer.")
|
|
2557
2694
|
});
|
|
2558
2695
|
var rubyGenerationConfigSchema = z.strictObject({
|
|
2559
|
-
requirePaths: z.array(nonEmptyStringSchema).optional().describe("
|
|
2696
|
+
requirePaths: z.array(nonEmptyStringSchema).optional().describe("Files the generated entry file loads with `require`.")
|
|
2560
2697
|
});
|
|
2561
2698
|
var rustGenerationConfigSchema = z.strictObject({
|
|
2562
2699
|
/**
|
|
@@ -3287,7 +3424,12 @@ function mapCommonConfig(language, config, state, client, generation, packageCon
|
|
|
3287
3424
|
}
|
|
3288
3425
|
const pythonClient = language === "python" ? takeObject(config, ["client"], state, basePath) : void 0;
|
|
3289
3426
|
const typescriptNaming = language === "typescript" || language === "mcp" ? takeObject(config, ["naming"], state, basePath) : void 0;
|
|
3290
|
-
const directClientName = takeString(
|
|
3427
|
+
const directClientName = takeString(
|
|
3428
|
+
config,
|
|
3429
|
+
language === "ruby" ? ["clientName"] : ["clientName", "clientClassName"],
|
|
3430
|
+
state,
|
|
3431
|
+
basePath
|
|
3432
|
+
);
|
|
3291
3433
|
const nestedClientName = pythonClient ? takeString(pythonClient.value, ["className"], state, pythonClient.path) : typescriptNaming ? takeString(typescriptNaming.value, ["client"], state, typescriptNaming.path) : language === "ruby" ? (
|
|
3292
3434
|
// Fern's Ruby generator renames the root client class (`Auth0::Management`) with it.
|
|
3293
3435
|
takeString(config, ["clientModuleName"], state, basePath)
|