@postman/sdk-config 0.5.1 → 0.6.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 +15 -0
- package/dist/index.cjs +151 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +148 -1
- package/dist/index.js.map +1 -1
- package/dist/sdk-config/index.cjs +112 -0
- package/dist/sdk-config/index.cjs.map +1 -1
- package/dist/sdk-config/index.d.cts +1 -1
- package/dist/sdk-config/index.d.ts +1 -1
- package/dist/sdk-config/index.js +112 -1
- package/dist/sdk-config/index.js.map +1 -1
- package/dist/sdk-config/v1/index.cjs +112 -0
- package/dist/sdk-config/v1/index.cjs.map +1 -1
- package/dist/sdk-config/v1/index.d.cts +7 -1
- package/dist/sdk-config/v1/index.d.ts +7 -1
- package/dist/sdk-config/v1/index.js +112 -1
- package/dist/sdk-config/v1/index.js.map +1 -1
- package/dist/sdk-config-ir/index.cjs +148 -0
- package/dist/sdk-config-ir/index.cjs.map +1 -1
- package/dist/sdk-config-ir/index.d.cts +1 -1
- package/dist/sdk-config-ir/index.d.ts +1 -1
- package/dist/sdk-config-ir/index.js +146 -1
- package/dist/sdk-config-ir/index.js.map +1 -1
- package/dist/sdk-config-ir/v1/index.cjs +148 -0
- package/dist/sdk-config-ir/v1/index.cjs.map +1 -1
- package/dist/sdk-config-ir/v1/index.d.cts +23 -1
- package/dist/sdk-config-ir/v1/index.d.ts +23 -1
- package/dist/sdk-config-ir/v1/index.js +146 -1
- package/dist/sdk-config-ir/v1/index.js.map +1 -1
- package/package.json +1 -1
- package/src/sdk-config-ir/v1/README.md +6 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { FernConfigMappingDiagnostic, FernConfigMappingError, FernConfigMappingResult, FernResolvedGeneratorGroupInput, FernResolvedGeneratorInput, FernSdkConfigLanguage, SDK_CONFIG_V1_SCHEMA_VERSION, SdkConfigV1, SdkConfigV1ApiConfig, SdkConfigV1ApiConfigInput, SdkConfigV1ClientConfig, SdkConfigV1ClientConfigInput, SdkConfigV1ClientConfigOverride, SdkConfigV1Dependency, SdkConfigV1DocsConfig, SdkConfigV1Document, SdkConfigV1GenerationConfig, SdkConfigV1GenerationConfigInput, SdkConfigV1GenerationConfigOverride, SdkConfigV1Input, SdkConfigV1OutputConfig, SdkConfigV1PackageConfig, SdkConfigV1PublishConfig, SdkConfigV1PublishRegistry, SdkConfigV1ReplayConfig, SdkConfigV1SourceConfig, SdkConfigV1SourceSpec, SdkConfigV1Target, SdkConfigV1WebhookSignature, SdkConfigV1WebhookSignatureInput, mapFernConfigToSdkConfigV1, parseSdkConfigV1, sdkConfigV1ApiConfigSchema, sdkConfigV1AuthConfigSchema, sdkConfigV1AuthSchemeSchema, sdkConfigV1ClientConfigOverrideSchema, sdkConfigV1ClientConfigSchema, sdkConfigV1DependencySchema, sdkConfigV1DocsConfigSchema, sdkConfigV1GenerationConfigOverrideSchema, sdkConfigV1GenerationConfigSchema, sdkConfigV1OutputConfigSchema, sdkConfigV1PackageConfigSchema, sdkConfigV1PublishConfigSchema, sdkConfigV1PublishRegistrySchema, sdkConfigV1ReadmeCustomSectionSchema, sdkConfigV1ReadmeEndpointSchema, sdkConfigV1ReplayConfigSchema, sdkConfigV1Schema, sdkConfigV1SourceConfigSchema, sdkConfigV1SourceSpecSchema, sdkConfigV1TargetSchema, sdkConfigV1WebhookSignatureSchema, splitSdkConfigV1TargetGeneration, validateSdkConfigV1 } from './sdk-config/v1/index.cjs';
|
|
1
|
+
export { FernConfigMappingDiagnostic, FernConfigMappingError, FernConfigMappingResult, FernResolvedGeneratorGroupInput, FernResolvedGeneratorInput, FernSdkConfigLanguage, SDK_CONFIG_V1_SCHEMA_VERSION, SdkConfigV1, SdkConfigV1ApiConfig, SdkConfigV1ApiConfigInput, SdkConfigV1ClientConfig, SdkConfigV1ClientConfigInput, SdkConfigV1ClientConfigOverride, SdkConfigV1Dependency, SdkConfigV1DocsConfig, SdkConfigV1Document, SdkConfigV1GenerationConfig, SdkConfigV1GenerationConfigInput, SdkConfigV1GenerationConfigOverride, SdkConfigV1Input, SdkConfigV1OutputConfig, SdkConfigV1PackageConfig, SdkConfigV1PublishConfig, SdkConfigV1PublishRegistry, SdkConfigV1ReplayConfig, SdkConfigV1SourceConfig, SdkConfigV1SourceSpec, SdkConfigV1Target, SdkConfigV1WebhookSignature, SdkConfigV1WebhookSignatureInput, mapFernConfigToSdkConfigV1, parseSdkConfigV1, parseSdkConfigV1ForConsumption, sdkConfigV1ApiConfigSchema, sdkConfigV1AuthConfigSchema, sdkConfigV1AuthSchemeSchema, sdkConfigV1ClientConfigOverrideSchema, sdkConfigV1ClientConfigSchema, sdkConfigV1DependencySchema, sdkConfigV1DocsConfigSchema, sdkConfigV1GenerationConfigOverrideSchema, sdkConfigV1GenerationConfigSchema, sdkConfigV1OutputConfigSchema, sdkConfigV1PackageConfigSchema, sdkConfigV1PublishConfigSchema, sdkConfigV1PublishRegistrySchema, sdkConfigV1ReadmeCustomSectionSchema, sdkConfigV1ReadmeEndpointSchema, sdkConfigV1ReplayConfigSchema, sdkConfigV1Schema, sdkConfigV1SourceConfigSchema, sdkConfigV1SourceSpecSchema, sdkConfigV1TargetSchema, sdkConfigV1WebhookSignatureSchema, splitSdkConfigV1TargetGeneration, validateSdkConfigV1 } from './sdk-config/v1/index.cjs';
|
|
2
2
|
export { C as CliGenerationConfig, a as CsharpGenerationConfig, D as Dependency, G as GoGenerationConfig, J as JavaGenerationConfig, b as JsonObject, c as JsonValue, K as KotlinGenerationConfig, M as McpAvailabilityStatus, d as McpGenerationConfig, e as McpToolFilter, P as PackageConfig, f as PhpGenerationConfig, g as PlanModifiers, h as PythonGenerationConfig, R as RubyGenerationConfig, i as RustGenerationConfig, S as SwiftGenerationConfig, T as TerraformGenerationConfig, j as TypescriptGenerationConfig, k as cliGenerationConfigSchema, l as composerPackageNameSchema, m as csharpGenerationConfigSchema, n as dependencySchema, o as exactSemverSchema, p as goGenerationConfigSchema, q as goModulePathSchema, r as javaGenerationConfigSchema, s as jsonObjectSchema, t as jsonValueSchema, u as kotlinGenerationConfigSchema, v as mcpAvailabilityStatuses, w as mcpGenerationConfigSchema, x as nonEmptyStringSchema, y as packageConfigSchema, z as phpGenerationConfigSchema, A as pythonGenerationConfigSchema, B as relativePathSchema, E as rubyGenerationConfigSchema, F as rustGenerationConfigSchema, k as sdkConfigV1CliGenerationConfigSchema, l as sdkConfigV1ComposerPackageNameSchema, m as sdkConfigV1CsharpGenerationConfigSchema, o as sdkConfigV1ExactSemverSchema, p as sdkConfigV1GoGenerationConfigSchema, q as sdkConfigV1GoModulePathSchema, r as sdkConfigV1JavaGenerationConfigSchema, u as sdkConfigV1KotlinGenerationConfigSchema, w as sdkConfigV1McpGenerationConfigSchema, x as sdkConfigV1NonEmptyStringSchema, z as sdkConfigV1PhpGenerationConfigSchema, A as sdkConfigV1PythonGenerationConfigSchema, B as sdkConfigV1RelativePathSchema, E as sdkConfigV1RubyGenerationConfigSchema, F as sdkConfigV1RustGenerationConfigSchema, H as sdkConfigV1SwiftGenerationConfigSchema, I as sdkConfigV1TerraformGenerationConfigSchema, L as sdkConfigV1TypescriptGenerationConfigSchema, H as swiftGenerationConfigSchema, I as terraformGenerationConfigSchema, L as typescriptGenerationConfigSchema } from './typescript-BruxA5zG.cjs';
|
|
3
|
-
export { ApiConfig, ApiConfigInput, ApiImportSettings, AuthConfig, AuthScheme, ClientConfig, ClientConfigInput, ClientConfigOverride, CompatibilityConfig, CredentialResolution, DocsConfig, GenerationConfig, LanguageGenerationConfig, LegacyInput, OutputConfig, PublishConfig, PublishRegistry, ReadmeCustomSection, ReadmeEndpoint, ReplayConfig, SDK_CONFIG_IR_V1_SCHEMA_VERSION, SdkConfigIrV1, SdkConfigIrV1Input, SourceConfig, SourceSpecConfig, SourceSpecType, TargetConfig, TargetLanguage, UnsupportedField, WebhookSignature, WebhookSignatureInput, apiConfigSchema, apiImportSettingsSchema, authConfigSchema, authSchemeSchema, clientConfigOverrideSchema, clientConfigSchema, clientRetryOverrideSchema, compatibilityConfigSchema, docsConfigSchema, generationConfigSchema, languageGenerationConfigSchema, legacyInputSchema, outputConfigSchema, parseSdkConfigIrV1, publishConfigSchema, publishRegistrySchema, readmeCustomSectionSchema, readmeEndpointSchema, replayConfigSchema, sdkConfigIrV1Schema, sourceConfigSchema, sourceSpecConfigSchema, sourceSpecTypeSchema, targetConfigSchema, targetLanguageSchema, unsupportedFieldSchema, webhookSignatureSchema } from './sdk-config-ir/v1/index.cjs';
|
|
3
|
+
export { ApiConfig, ApiConfigInput, ApiImportSettings, AuthConfig, AuthScheme, ClientConfig, ClientConfigInput, ClientConfigOverride, CompatibilityConfig, CredentialResolution, DocsConfig, GenerationConfig, LanguageGenerationConfig, LegacyInput, OutputConfig, PublishConfig, PublishRegistry, ReadmeCustomSection, ReadmeEndpoint, ReplayConfig, SDK_CONFIG_IR_V1_SCHEMA_VERSION, SdkConfigIrCapability, SdkConfigIrV1, SdkConfigIrV1Input, SerializedSdkConfigIrV1, SourceConfig, SourceSpecConfig, SourceSpecType, TargetConfig, TargetLanguage, UnsupportedField, WebhookSignature, WebhookSignatureInput, apiConfigSchema, apiImportSettingsSchema, authConfigSchema, authSchemeSchema, clientConfigOverrideSchema, clientConfigSchema, clientRetryOverrideSchema, compatibilityConfigSchema, docsConfigSchema, generationConfigSchema, languageGenerationConfigSchema, legacyInputSchema, outputConfigSchema, parseSdkConfigIrV1, parseSdkConfigIrV1ForConsumption, publishConfigSchema, publishRegistrySchema, readmeCustomSectionSchema, readmeEndpointSchema, replayConfigSchema, sdkConfigIrCapabilitySchema, sdkConfigIrV1Schema, serializeSdkConfigIrV1, sourceConfigSchema, sourceSpecConfigSchema, sourceSpecTypeSchema, targetConfigSchema, targetLanguageSchema, unsupportedFieldSchema, webhookSignatureSchema } from './sdk-config-ir/v1/index.cjs';
|
|
4
4
|
import 'zod';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { FernConfigMappingDiagnostic, FernConfigMappingError, FernConfigMappingResult, FernResolvedGeneratorGroupInput, FernResolvedGeneratorInput, FernSdkConfigLanguage, SDK_CONFIG_V1_SCHEMA_VERSION, SdkConfigV1, SdkConfigV1ApiConfig, SdkConfigV1ApiConfigInput, SdkConfigV1ClientConfig, SdkConfigV1ClientConfigInput, SdkConfigV1ClientConfigOverride, SdkConfigV1Dependency, SdkConfigV1DocsConfig, SdkConfigV1Document, SdkConfigV1GenerationConfig, SdkConfigV1GenerationConfigInput, SdkConfigV1GenerationConfigOverride, SdkConfigV1Input, SdkConfigV1OutputConfig, SdkConfigV1PackageConfig, SdkConfigV1PublishConfig, SdkConfigV1PublishRegistry, SdkConfigV1ReplayConfig, SdkConfigV1SourceConfig, SdkConfigV1SourceSpec, SdkConfigV1Target, SdkConfigV1WebhookSignature, SdkConfigV1WebhookSignatureInput, mapFernConfigToSdkConfigV1, parseSdkConfigV1, sdkConfigV1ApiConfigSchema, sdkConfigV1AuthConfigSchema, sdkConfigV1AuthSchemeSchema, sdkConfigV1ClientConfigOverrideSchema, sdkConfigV1ClientConfigSchema, sdkConfigV1DependencySchema, sdkConfigV1DocsConfigSchema, sdkConfigV1GenerationConfigOverrideSchema, sdkConfigV1GenerationConfigSchema, sdkConfigV1OutputConfigSchema, sdkConfigV1PackageConfigSchema, sdkConfigV1PublishConfigSchema, sdkConfigV1PublishRegistrySchema, sdkConfigV1ReadmeCustomSectionSchema, sdkConfigV1ReadmeEndpointSchema, sdkConfigV1ReplayConfigSchema, sdkConfigV1Schema, sdkConfigV1SourceConfigSchema, sdkConfigV1SourceSpecSchema, sdkConfigV1TargetSchema, sdkConfigV1WebhookSignatureSchema, splitSdkConfigV1TargetGeneration, validateSdkConfigV1 } from './sdk-config/v1/index.js';
|
|
1
|
+
export { FernConfigMappingDiagnostic, FernConfigMappingError, FernConfigMappingResult, FernResolvedGeneratorGroupInput, FernResolvedGeneratorInput, FernSdkConfigLanguage, SDK_CONFIG_V1_SCHEMA_VERSION, SdkConfigV1, SdkConfigV1ApiConfig, SdkConfigV1ApiConfigInput, SdkConfigV1ClientConfig, SdkConfigV1ClientConfigInput, SdkConfigV1ClientConfigOverride, SdkConfigV1Dependency, SdkConfigV1DocsConfig, SdkConfigV1Document, SdkConfigV1GenerationConfig, SdkConfigV1GenerationConfigInput, SdkConfigV1GenerationConfigOverride, SdkConfigV1Input, SdkConfigV1OutputConfig, SdkConfigV1PackageConfig, SdkConfigV1PublishConfig, SdkConfigV1PublishRegistry, SdkConfigV1ReplayConfig, SdkConfigV1SourceConfig, SdkConfigV1SourceSpec, SdkConfigV1Target, SdkConfigV1WebhookSignature, SdkConfigV1WebhookSignatureInput, mapFernConfigToSdkConfigV1, parseSdkConfigV1, parseSdkConfigV1ForConsumption, sdkConfigV1ApiConfigSchema, sdkConfigV1AuthConfigSchema, sdkConfigV1AuthSchemeSchema, sdkConfigV1ClientConfigOverrideSchema, sdkConfigV1ClientConfigSchema, sdkConfigV1DependencySchema, sdkConfigV1DocsConfigSchema, sdkConfigV1GenerationConfigOverrideSchema, sdkConfigV1GenerationConfigSchema, sdkConfigV1OutputConfigSchema, sdkConfigV1PackageConfigSchema, sdkConfigV1PublishConfigSchema, sdkConfigV1PublishRegistrySchema, sdkConfigV1ReadmeCustomSectionSchema, sdkConfigV1ReadmeEndpointSchema, sdkConfigV1ReplayConfigSchema, sdkConfigV1Schema, sdkConfigV1SourceConfigSchema, sdkConfigV1SourceSpecSchema, sdkConfigV1TargetSchema, sdkConfigV1WebhookSignatureSchema, splitSdkConfigV1TargetGeneration, validateSdkConfigV1 } from './sdk-config/v1/index.js';
|
|
2
2
|
export { C as CliGenerationConfig, a as CsharpGenerationConfig, D as Dependency, G as GoGenerationConfig, J as JavaGenerationConfig, b as JsonObject, c as JsonValue, K as KotlinGenerationConfig, M as McpAvailabilityStatus, d as McpGenerationConfig, e as McpToolFilter, P as PackageConfig, f as PhpGenerationConfig, g as PlanModifiers, h as PythonGenerationConfig, R as RubyGenerationConfig, i as RustGenerationConfig, S as SwiftGenerationConfig, T as TerraformGenerationConfig, j as TypescriptGenerationConfig, k as cliGenerationConfigSchema, l as composerPackageNameSchema, m as csharpGenerationConfigSchema, n as dependencySchema, o as exactSemverSchema, p as goGenerationConfigSchema, q as goModulePathSchema, r as javaGenerationConfigSchema, s as jsonObjectSchema, t as jsonValueSchema, u as kotlinGenerationConfigSchema, v as mcpAvailabilityStatuses, w as mcpGenerationConfigSchema, x as nonEmptyStringSchema, y as packageConfigSchema, z as phpGenerationConfigSchema, A as pythonGenerationConfigSchema, B as relativePathSchema, E as rubyGenerationConfigSchema, F as rustGenerationConfigSchema, k as sdkConfigV1CliGenerationConfigSchema, l as sdkConfigV1ComposerPackageNameSchema, m as sdkConfigV1CsharpGenerationConfigSchema, o as sdkConfigV1ExactSemverSchema, p as sdkConfigV1GoGenerationConfigSchema, q as sdkConfigV1GoModulePathSchema, r as sdkConfigV1JavaGenerationConfigSchema, u as sdkConfigV1KotlinGenerationConfigSchema, w as sdkConfigV1McpGenerationConfigSchema, x as sdkConfigV1NonEmptyStringSchema, z as sdkConfigV1PhpGenerationConfigSchema, A as sdkConfigV1PythonGenerationConfigSchema, B as sdkConfigV1RelativePathSchema, E as sdkConfigV1RubyGenerationConfigSchema, F as sdkConfigV1RustGenerationConfigSchema, H as sdkConfigV1SwiftGenerationConfigSchema, I as sdkConfigV1TerraformGenerationConfigSchema, L as sdkConfigV1TypescriptGenerationConfigSchema, H as swiftGenerationConfigSchema, I as terraformGenerationConfigSchema, L as typescriptGenerationConfigSchema } from './typescript-BruxA5zG.js';
|
|
3
|
-
export { ApiConfig, ApiConfigInput, ApiImportSettings, AuthConfig, AuthScheme, ClientConfig, ClientConfigInput, ClientConfigOverride, CompatibilityConfig, CredentialResolution, DocsConfig, GenerationConfig, LanguageGenerationConfig, LegacyInput, OutputConfig, PublishConfig, PublishRegistry, ReadmeCustomSection, ReadmeEndpoint, ReplayConfig, SDK_CONFIG_IR_V1_SCHEMA_VERSION, SdkConfigIrV1, SdkConfigIrV1Input, SourceConfig, SourceSpecConfig, SourceSpecType, TargetConfig, TargetLanguage, UnsupportedField, WebhookSignature, WebhookSignatureInput, apiConfigSchema, apiImportSettingsSchema, authConfigSchema, authSchemeSchema, clientConfigOverrideSchema, clientConfigSchema, clientRetryOverrideSchema, compatibilityConfigSchema, docsConfigSchema, generationConfigSchema, languageGenerationConfigSchema, legacyInputSchema, outputConfigSchema, parseSdkConfigIrV1, publishConfigSchema, publishRegistrySchema, readmeCustomSectionSchema, readmeEndpointSchema, replayConfigSchema, sdkConfigIrV1Schema, sourceConfigSchema, sourceSpecConfigSchema, sourceSpecTypeSchema, targetConfigSchema, targetLanguageSchema, unsupportedFieldSchema, webhookSignatureSchema } from './sdk-config-ir/v1/index.js';
|
|
3
|
+
export { ApiConfig, ApiConfigInput, ApiImportSettings, AuthConfig, AuthScheme, ClientConfig, ClientConfigInput, ClientConfigOverride, CompatibilityConfig, CredentialResolution, DocsConfig, GenerationConfig, LanguageGenerationConfig, LegacyInput, OutputConfig, PublishConfig, PublishRegistry, ReadmeCustomSection, ReadmeEndpoint, ReplayConfig, SDK_CONFIG_IR_V1_SCHEMA_VERSION, SdkConfigIrCapability, SdkConfigIrV1, SdkConfigIrV1Input, SerializedSdkConfigIrV1, SourceConfig, SourceSpecConfig, SourceSpecType, TargetConfig, TargetLanguage, UnsupportedField, WebhookSignature, WebhookSignatureInput, apiConfigSchema, apiImportSettingsSchema, authConfigSchema, authSchemeSchema, clientConfigOverrideSchema, clientConfigSchema, clientRetryOverrideSchema, compatibilityConfigSchema, docsConfigSchema, generationConfigSchema, languageGenerationConfigSchema, legacyInputSchema, outputConfigSchema, parseSdkConfigIrV1, parseSdkConfigIrV1ForConsumption, publishConfigSchema, publishRegistrySchema, readmeCustomSectionSchema, readmeEndpointSchema, replayConfigSchema, sdkConfigIrCapabilitySchema, sdkConfigIrV1Schema, serializeSdkConfigIrV1, sourceConfigSchema, sourceSpecConfigSchema, sourceSpecTypeSchema, targetConfigSchema, targetLanguageSchema, unsupportedFieldSchema, webhookSignatureSchema } from './sdk-config-ir/v1/index.js';
|
|
4
4
|
import 'zod';
|
package/dist/index.js
CHANGED
|
@@ -1333,6 +1333,125 @@ function outputDiagnostic(path, index) {
|
|
|
1333
1333
|
suggestedAction: resolvedGuidance?.suggestedAction ?? "Review this output setting and preserve it outside SDK Config when no equivalent exists."
|
|
1334
1334
|
};
|
|
1335
1335
|
}
|
|
1336
|
+
var OMIT = /* @__PURE__ */ Symbol("omit");
|
|
1337
|
+
function inputJsonSchema(schema) {
|
|
1338
|
+
return z.toJSONSchema(schema, {
|
|
1339
|
+
io: "input",
|
|
1340
|
+
unrepresentable: "any"
|
|
1341
|
+
});
|
|
1342
|
+
}
|
|
1343
|
+
function stripUnknownProperties(value, schema) {
|
|
1344
|
+
return project(value, schema, schema, false);
|
|
1345
|
+
}
|
|
1346
|
+
function omitSchemaDefaults(value, schema) {
|
|
1347
|
+
const projected = project(value, schema, schema, true);
|
|
1348
|
+
return projected === OMIT ? void 0 : projected;
|
|
1349
|
+
}
|
|
1350
|
+
function project(value, candidateSchema, rootSchema, omitDefaults) {
|
|
1351
|
+
const resolvedCandidate = resolveSchema(candidateSchema, rootSchema);
|
|
1352
|
+
if (omitDefaults && Object.hasOwn(resolvedCandidate, "default") && deepEqual(value, resolvedCandidate.default)) {
|
|
1353
|
+
return OMIT;
|
|
1354
|
+
}
|
|
1355
|
+
const schema = selectSchema(value, resolvedCandidate, rootSchema);
|
|
1356
|
+
if (omitDefaults && schema !== resolvedCandidate && Object.hasOwn(schema, "default") && deepEqual(value, schema.default)) {
|
|
1357
|
+
return OMIT;
|
|
1358
|
+
}
|
|
1359
|
+
if (Array.isArray(value)) {
|
|
1360
|
+
if (!schema.items) return value;
|
|
1361
|
+
return value.map((item) => {
|
|
1362
|
+
const projected = project(item, schema.items, rootSchema, omitDefaults);
|
|
1363
|
+
return projected === OMIT ? item : projected;
|
|
1364
|
+
});
|
|
1365
|
+
}
|
|
1366
|
+
if (!isRecord(value) || schema.type !== "object") return value;
|
|
1367
|
+
const entries = [];
|
|
1368
|
+
const properties = schema.properties ?? {};
|
|
1369
|
+
const unionProperties = omitDefaults ? properties : collectAlternativeProperties(resolvedCandidate, rootSchema);
|
|
1370
|
+
for (const [key, propertySchema] of Object.entries(properties)) {
|
|
1371
|
+
if (!Object.hasOwn(value, key)) continue;
|
|
1372
|
+
const projected = project(value[key], propertySchema, rootSchema, omitDefaults);
|
|
1373
|
+
if (projected !== OMIT) entries.push([key, projected]);
|
|
1374
|
+
}
|
|
1375
|
+
for (const [key, fieldValue] of Object.entries(value)) {
|
|
1376
|
+
if (Object.hasOwn(properties, key)) continue;
|
|
1377
|
+
if (Object.hasOwn(unionProperties, key)) {
|
|
1378
|
+
entries.push([key, fieldValue]);
|
|
1379
|
+
continue;
|
|
1380
|
+
}
|
|
1381
|
+
if (schema.additionalProperties !== false) {
|
|
1382
|
+
const projected = typeof schema.additionalProperties === "object" ? project(fieldValue, schema.additionalProperties, rootSchema, omitDefaults) : fieldValue;
|
|
1383
|
+
if (projected !== OMIT) entries.push([key, projected]);
|
|
1384
|
+
} else if (omitDefaults) {
|
|
1385
|
+
throw new Error(`Cannot serialize property unknown to the wire schema: ${key}`);
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1388
|
+
return Object.fromEntries(entries);
|
|
1389
|
+
}
|
|
1390
|
+
function collectAlternativeProperties(schema, rootSchema) {
|
|
1391
|
+
const alternatives = schema.oneOf ?? schema.anyOf;
|
|
1392
|
+
if (!alternatives) return schema.properties ?? {};
|
|
1393
|
+
return Object.assign(
|
|
1394
|
+
{},
|
|
1395
|
+
...alternatives.map((alternative) => resolveSchema(alternative, rootSchema).properties ?? {})
|
|
1396
|
+
);
|
|
1397
|
+
}
|
|
1398
|
+
function selectSchema(value, schema, rootSchema) {
|
|
1399
|
+
const alternatives = schema.oneOf ?? schema.anyOf;
|
|
1400
|
+
if (!alternatives || alternatives.length === 0) return schema;
|
|
1401
|
+
const best = alternatives.map((alternative, index) => {
|
|
1402
|
+
const resolved = resolveSchema(alternative, rootSchema);
|
|
1403
|
+
return { index, schema: resolved, score: schemaMatchScore(value, resolved) };
|
|
1404
|
+
}).sort((left, right) => right.score - left.score || left.index - right.index)[0];
|
|
1405
|
+
return best.score === Number.NEGATIVE_INFINITY ? schema : best.schema;
|
|
1406
|
+
}
|
|
1407
|
+
function schemaMatchScore(value, schema) {
|
|
1408
|
+
if (Object.hasOwn(schema, "const") && !deepEqual(value, schema.const)) {
|
|
1409
|
+
return Number.NEGATIVE_INFINITY;
|
|
1410
|
+
}
|
|
1411
|
+
if (schema.enum && !schema.enum.some((candidate) => deepEqual(value, candidate))) {
|
|
1412
|
+
return Number.NEGATIVE_INFINITY;
|
|
1413
|
+
}
|
|
1414
|
+
if (schema.type === "object") {
|
|
1415
|
+
if (!isRecord(value)) return Number.NEGATIVE_INFINITY;
|
|
1416
|
+
const properties = schema.properties ?? {};
|
|
1417
|
+
for (const [key, propertySchema] of Object.entries(properties)) {
|
|
1418
|
+
if (!Object.hasOwn(value, key)) continue;
|
|
1419
|
+
if (Object.hasOwn(propertySchema, "const") && !deepEqual(value[key], propertySchema.const)) {
|
|
1420
|
+
return Number.NEGATIVE_INFINITY;
|
|
1421
|
+
}
|
|
1422
|
+
}
|
|
1423
|
+
return Object.keys(value).filter((key) => Object.hasOwn(properties, key)).length;
|
|
1424
|
+
}
|
|
1425
|
+
if (schema.type === "array") return Array.isArray(value) ? 1 : Number.NEGATIVE_INFINITY;
|
|
1426
|
+
if (schema.type === "string") return typeof value === "string" ? 1 : Number.NEGATIVE_INFINITY;
|
|
1427
|
+
if (schema.type === "number" || schema.type === "integer") {
|
|
1428
|
+
return typeof value === "number" ? 1 : Number.NEGATIVE_INFINITY;
|
|
1429
|
+
}
|
|
1430
|
+
if (schema.type === "boolean") return typeof value === "boolean" ? 1 : Number.NEGATIVE_INFINITY;
|
|
1431
|
+
if (schema.type === "null") return value === null ? 1 : Number.NEGATIVE_INFINITY;
|
|
1432
|
+
return 0;
|
|
1433
|
+
}
|
|
1434
|
+
function resolveSchema(schema, rootSchema) {
|
|
1435
|
+
if (!schema.$ref) return schema;
|
|
1436
|
+
if (!schema.$ref.startsWith("#/$defs/")) return schema;
|
|
1437
|
+
const name = schema.$ref.slice("#/$defs/".length).replaceAll("~1", "/").replaceAll("~0", "~");
|
|
1438
|
+
return rootSchema.$defs?.[name] ?? schema;
|
|
1439
|
+
}
|
|
1440
|
+
function isRecord(value) {
|
|
1441
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
1442
|
+
}
|
|
1443
|
+
function deepEqual(left, right) {
|
|
1444
|
+
if (Object.is(left, right)) return true;
|
|
1445
|
+
if (Array.isArray(left) && Array.isArray(right)) {
|
|
1446
|
+
return left.length === right.length && left.every((value, index) => deepEqual(value, right[index]));
|
|
1447
|
+
}
|
|
1448
|
+
if (isRecord(left) && isRecord(right)) {
|
|
1449
|
+
const leftKeys = Object.keys(left);
|
|
1450
|
+
const rightKeys = Object.keys(right);
|
|
1451
|
+
return leftKeys.length === rightKeys.length && leftKeys.every((key) => Object.hasOwn(right, key) && deepEqual(left[key], right[key]));
|
|
1452
|
+
}
|
|
1453
|
+
return false;
|
|
1454
|
+
}
|
|
1336
1455
|
var namingConfigSchema = z.strictObject({
|
|
1337
1456
|
clientName: nonEmptyStringSchema.optional(),
|
|
1338
1457
|
exportedClientName: nonEmptyStringSchema.optional(),
|
|
@@ -2011,6 +2130,10 @@ function validateSdkConfigV1(value) {
|
|
|
2011
2130
|
function parseSdkConfigV1(value) {
|
|
2012
2131
|
return sdkConfigV1Schema.parse(value);
|
|
2013
2132
|
}
|
|
2133
|
+
var sdkConfigV1InputJsonSchema = inputJsonSchema(sdkConfigV1Schema);
|
|
2134
|
+
function parseSdkConfigV1ForConsumption(value) {
|
|
2135
|
+
return parseSdkConfigV1(stripUnknownProperties(value, sdkConfigV1InputJsonSchema));
|
|
2136
|
+
}
|
|
2014
2137
|
|
|
2015
2138
|
// src/sdk-config/v1/fern-config-mapper.ts
|
|
2016
2139
|
var generatorLanguages = {
|
|
@@ -3417,7 +3540,31 @@ var sdkConfigIrV1Schema = z.strictObject({
|
|
|
3417
3540
|
function parseSdkConfigIrV1(value) {
|
|
3418
3541
|
return sdkConfigIrV1Schema.parse(value);
|
|
3419
3542
|
}
|
|
3543
|
+
var sdkConfigIrCapabilitySchema = z.enum(["generation.generateFullProject"]);
|
|
3544
|
+
var sdkConfigIrV1InputJsonSchema = inputJsonSchema(sdkConfigIrV1Schema);
|
|
3545
|
+
function serializeSdkConfigIrV1(value) {
|
|
3546
|
+
const parsed = parseSdkConfigIrV1(value);
|
|
3547
|
+
const wireValue = omitSchemaDefaults(parsed, sdkConfigIrV1InputJsonSchema);
|
|
3548
|
+
const requiredCapabilities = [];
|
|
3549
|
+
if (wireValue === void 0) {
|
|
3550
|
+
throw new Error("SDK Config IR v1 root cannot be omitted from its wire payload");
|
|
3551
|
+
}
|
|
3552
|
+
if (parsed.generation.generateFullProject) {
|
|
3553
|
+
requiredCapabilities.push("generation.generateFullProject");
|
|
3554
|
+
}
|
|
3555
|
+
const json = JSON.stringify(wireValue);
|
|
3556
|
+
if (json === void 0) {
|
|
3557
|
+
throw new Error("SDK Config IR v1 could not be serialized as JSON");
|
|
3558
|
+
}
|
|
3559
|
+
return {
|
|
3560
|
+
body: new TextEncoder().encode(json),
|
|
3561
|
+
requiredCapabilities
|
|
3562
|
+
};
|
|
3563
|
+
}
|
|
3564
|
+
function parseSdkConfigIrV1ForConsumption(value) {
|
|
3565
|
+
return parseSdkConfigIrV1(stripUnknownProperties(value, sdkConfigIrV1InputJsonSchema));
|
|
3566
|
+
}
|
|
3420
3567
|
|
|
3421
|
-
export { FernConfigMappingError, SDK_CONFIG_IR_V1_SCHEMA_VERSION, SDK_CONFIG_V1_SCHEMA_VERSION, apiConfigSchema, apiImportSettingsSchema, authConfigSchema, authSchemeSchema, cliGenerationConfigSchema, clientConfigOverrideSchema, clientConfigSchema, clientRetryOverrideSchema, compatibilityConfigSchema, composerPackageNameSchema, csharpGenerationConfigSchema, dependencySchema, docsConfigSchema, exactSemverSchema, generationConfigSchema, goGenerationConfigSchema, goModulePathSchema, javaGenerationConfigSchema, jsonObjectSchema, jsonValueSchema, kotlinGenerationConfigSchema, languageGenerationConfigSchema, legacyInputSchema, mapFernConfigToSdkConfigV1, mcpAvailabilityStatuses, mcpGenerationConfigSchema, nonEmptyStringSchema, outputConfigSchema, packageConfigSchema, parseSdkConfigIrV1, parseSdkConfigV1, phpGenerationConfigSchema, publishConfigSchema, publishRegistrySchema, pythonGenerationConfigSchema, readmeCustomSectionSchema, readmeEndpointSchema, relativePathSchema, replayConfigSchema, rubyGenerationConfigSchema, rustGenerationConfigSchema, sdkConfigIrV1Schema, sdkConfigV1ApiConfigSchema, sdkConfigV1AuthConfigSchema, sdkConfigV1AuthSchemeSchema, cliGenerationConfigSchema as sdkConfigV1CliGenerationConfigSchema, sdkConfigV1ClientConfigOverrideSchema, sdkConfigV1ClientConfigSchema, composerPackageNameSchema as sdkConfigV1ComposerPackageNameSchema, csharpGenerationConfigSchema as sdkConfigV1CsharpGenerationConfigSchema, sdkConfigV1DependencySchema, sdkConfigV1DocsConfigSchema, exactSemverSchema as sdkConfigV1ExactSemverSchema, sdkConfigV1GenerationConfigOverrideSchema, sdkConfigV1GenerationConfigSchema, goGenerationConfigSchema as sdkConfigV1GoGenerationConfigSchema, goModulePathSchema as sdkConfigV1GoModulePathSchema, javaGenerationConfigSchema as sdkConfigV1JavaGenerationConfigSchema, kotlinGenerationConfigSchema as sdkConfigV1KotlinGenerationConfigSchema, mcpGenerationConfigSchema as sdkConfigV1McpGenerationConfigSchema, nonEmptyStringSchema as sdkConfigV1NonEmptyStringSchema, sdkConfigV1OutputConfigSchema, sdkConfigV1PackageConfigSchema, phpGenerationConfigSchema as sdkConfigV1PhpGenerationConfigSchema, sdkConfigV1PublishConfigSchema, sdkConfigV1PublishRegistrySchema, pythonGenerationConfigSchema as sdkConfigV1PythonGenerationConfigSchema, sdkConfigV1ReadmeCustomSectionSchema, sdkConfigV1ReadmeEndpointSchema, relativePathSchema as sdkConfigV1RelativePathSchema, sdkConfigV1ReplayConfigSchema, rubyGenerationConfigSchema as sdkConfigV1RubyGenerationConfigSchema, rustGenerationConfigSchema as sdkConfigV1RustGenerationConfigSchema, sdkConfigV1Schema, sdkConfigV1SourceConfigSchema, sdkConfigV1SourceSpecSchema, swiftGenerationConfigSchema as sdkConfigV1SwiftGenerationConfigSchema, sdkConfigV1TargetSchema, terraformGenerationConfigSchema as sdkConfigV1TerraformGenerationConfigSchema, typescriptGenerationConfigSchema as sdkConfigV1TypescriptGenerationConfigSchema, sdkConfigV1WebhookSignatureSchema, sourceConfigSchema, sourceSpecConfigSchema, sourceSpecTypeSchema, splitSdkConfigV1TargetGeneration, swiftGenerationConfigSchema, targetConfigSchema, targetLanguageSchema, terraformGenerationConfigSchema, typescriptGenerationConfigSchema, unsupportedFieldSchema, validateSdkConfigV1, webhookSignatureSchema };
|
|
3568
|
+
export { FernConfigMappingError, SDK_CONFIG_IR_V1_SCHEMA_VERSION, SDK_CONFIG_V1_SCHEMA_VERSION, apiConfigSchema, apiImportSettingsSchema, authConfigSchema, authSchemeSchema, cliGenerationConfigSchema, clientConfigOverrideSchema, clientConfigSchema, clientRetryOverrideSchema, compatibilityConfigSchema, composerPackageNameSchema, csharpGenerationConfigSchema, dependencySchema, docsConfigSchema, exactSemverSchema, generationConfigSchema, goGenerationConfigSchema, goModulePathSchema, javaGenerationConfigSchema, jsonObjectSchema, jsonValueSchema, kotlinGenerationConfigSchema, languageGenerationConfigSchema, legacyInputSchema, mapFernConfigToSdkConfigV1, mcpAvailabilityStatuses, mcpGenerationConfigSchema, nonEmptyStringSchema, outputConfigSchema, packageConfigSchema, parseSdkConfigIrV1, parseSdkConfigIrV1ForConsumption, parseSdkConfigV1, parseSdkConfigV1ForConsumption, phpGenerationConfigSchema, publishConfigSchema, publishRegistrySchema, pythonGenerationConfigSchema, readmeCustomSectionSchema, readmeEndpointSchema, relativePathSchema, replayConfigSchema, rubyGenerationConfigSchema, rustGenerationConfigSchema, sdkConfigIrCapabilitySchema, sdkConfigIrV1Schema, sdkConfigV1ApiConfigSchema, sdkConfigV1AuthConfigSchema, sdkConfigV1AuthSchemeSchema, cliGenerationConfigSchema as sdkConfigV1CliGenerationConfigSchema, sdkConfigV1ClientConfigOverrideSchema, sdkConfigV1ClientConfigSchema, composerPackageNameSchema as sdkConfigV1ComposerPackageNameSchema, csharpGenerationConfigSchema as sdkConfigV1CsharpGenerationConfigSchema, sdkConfigV1DependencySchema, sdkConfigV1DocsConfigSchema, exactSemverSchema as sdkConfigV1ExactSemverSchema, sdkConfigV1GenerationConfigOverrideSchema, sdkConfigV1GenerationConfigSchema, goGenerationConfigSchema as sdkConfigV1GoGenerationConfigSchema, goModulePathSchema as sdkConfigV1GoModulePathSchema, javaGenerationConfigSchema as sdkConfigV1JavaGenerationConfigSchema, kotlinGenerationConfigSchema as sdkConfigV1KotlinGenerationConfigSchema, mcpGenerationConfigSchema as sdkConfigV1McpGenerationConfigSchema, nonEmptyStringSchema as sdkConfigV1NonEmptyStringSchema, sdkConfigV1OutputConfigSchema, sdkConfigV1PackageConfigSchema, phpGenerationConfigSchema as sdkConfigV1PhpGenerationConfigSchema, sdkConfigV1PublishConfigSchema, sdkConfigV1PublishRegistrySchema, pythonGenerationConfigSchema as sdkConfigV1PythonGenerationConfigSchema, sdkConfigV1ReadmeCustomSectionSchema, sdkConfigV1ReadmeEndpointSchema, relativePathSchema as sdkConfigV1RelativePathSchema, sdkConfigV1ReplayConfigSchema, rubyGenerationConfigSchema as sdkConfigV1RubyGenerationConfigSchema, rustGenerationConfigSchema as sdkConfigV1RustGenerationConfigSchema, sdkConfigV1Schema, sdkConfigV1SourceConfigSchema, sdkConfigV1SourceSpecSchema, swiftGenerationConfigSchema as sdkConfigV1SwiftGenerationConfigSchema, sdkConfigV1TargetSchema, terraformGenerationConfigSchema as sdkConfigV1TerraformGenerationConfigSchema, typescriptGenerationConfigSchema as sdkConfigV1TypescriptGenerationConfigSchema, sdkConfigV1WebhookSignatureSchema, serializeSdkConfigIrV1, sourceConfigSchema, sourceSpecConfigSchema, sourceSpecTypeSchema, splitSdkConfigV1TargetGeneration, swiftGenerationConfigSchema, targetConfigSchema, targetLanguageSchema, terraformGenerationConfigSchema, typescriptGenerationConfigSchema, unsupportedFieldSchema, validateSdkConfigV1, webhookSignatureSchema };
|
|
3422
3569
|
//# sourceMappingURL=index.js.map
|
|
3423
3570
|
//# sourceMappingURL=index.js.map
|