fern-api 0.19.14-rc0 → 0.19.14-rc2
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/bundle.cjs +78 -16
- package/package.json +1 -1
package/bundle.cjs
CHANGED
|
@@ -828595,6 +828595,7 @@ var GeneratorInvocationSchema = z.strictObject({
|
|
|
828595
828595
|
output: z.optional(GeneratorOutputSchema),
|
|
828596
828596
|
github: z.optional(GithubConfigurationSchema),
|
|
828597
828597
|
config: z.unknown(),
|
|
828598
|
+
"ir-version": z.optional(z.string()),
|
|
828598
828599
|
"smart-casing": z.optional(z.boolean()),
|
|
828599
828600
|
"disable-examples": z.optional(z.boolean())
|
|
828600
828601
|
});
|
|
@@ -828744,7 +828745,8 @@ async function convertGenerator({ absolutePathToGeneratorsConfiguration, generat
|
|
|
828744
828745
|
smartCasing: generator["smart-casing"] ?? false,
|
|
828745
828746
|
disableExamples: generator["disable-examples"] ?? false,
|
|
828746
828747
|
absolutePathToLocalOutput: ((_a2 = generator.output) == null ? void 0 : _a2.location) === "local-file-system" ? resolve(dirname(absolutePathToGeneratorsConfiguration), generator.output.path) : void 0,
|
|
828747
|
-
language: getLanguageFromGeneratorName(generator.name)
|
|
828748
|
+
language: getLanguageFromGeneratorName(generator.name),
|
|
828749
|
+
irVersionOverride: generator["ir-version"] ?? void 0
|
|
828748
828750
|
};
|
|
828749
828751
|
}
|
|
828750
828752
|
async function convertOutputMode({ absolutePathToGeneratorsConfiguration, generator }) {
|
|
@@ -832139,7 +832141,7 @@ var AccessTokenPosthogManager = class {
|
|
|
832139
832141
|
properties: {
|
|
832140
832142
|
...event,
|
|
832141
832143
|
...event.properties,
|
|
832142
|
-
version: "0.19.14-
|
|
832144
|
+
version: "0.19.14-rc2",
|
|
832143
832145
|
usingAccessToken: true
|
|
832144
832146
|
}
|
|
832145
832147
|
});
|
|
@@ -832201,7 +832203,7 @@ var UserPosthogManager = class {
|
|
|
832201
832203
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
832202
832204
|
event: "CLI",
|
|
832203
832205
|
properties: {
|
|
832204
|
-
version: "0.19.14-
|
|
832206
|
+
version: "0.19.14-rc2",
|
|
832205
832207
|
...event,
|
|
832206
832208
|
...event.properties
|
|
832207
832209
|
}
|
|
@@ -845667,6 +845669,46 @@ function convertSchemaWithExampleToSchema(schema2) {
|
|
|
845667
845669
|
assertNever(schema2);
|
|
845668
845670
|
}
|
|
845669
845671
|
}
|
|
845672
|
+
function convertSchemaWithExampleToOptionalSchema(schema2) {
|
|
845673
|
+
switch (schema2.type) {
|
|
845674
|
+
case "object":
|
|
845675
|
+
case "array":
|
|
845676
|
+
case "enum":
|
|
845677
|
+
case "literal":
|
|
845678
|
+
case "nullable":
|
|
845679
|
+
case "primitive":
|
|
845680
|
+
case "map":
|
|
845681
|
+
case "reference":
|
|
845682
|
+
case "unknown":
|
|
845683
|
+
return Schema2.optional({
|
|
845684
|
+
generatedName: schema2.generatedName,
|
|
845685
|
+
nameOverride: schema2.nameOverride,
|
|
845686
|
+
description: schema2.description,
|
|
845687
|
+
value: convertSchemaWithExampleToSchema(schema2),
|
|
845688
|
+
groupName: schema2.groupName
|
|
845689
|
+
});
|
|
845690
|
+
case "optional":
|
|
845691
|
+
return Schema2.optional({
|
|
845692
|
+
generatedName: schema2.generatedName,
|
|
845693
|
+
nameOverride: schema2.nameOverride,
|
|
845694
|
+
description: schema2.description,
|
|
845695
|
+
value: convertSchemaWithExampleToSchema(schema2.value),
|
|
845696
|
+
groupName: schema2.groupName
|
|
845697
|
+
});
|
|
845698
|
+
case "oneOf": {
|
|
845699
|
+
const oneOfSchema = convertToOneOf(schema2.value);
|
|
845700
|
+
return Schema2.optional({
|
|
845701
|
+
generatedName: oneOfSchema.generatedName,
|
|
845702
|
+
nameOverride: oneOfSchema.nameOverride,
|
|
845703
|
+
description: oneOfSchema.description,
|
|
845704
|
+
value: Schema2.oneOf(convertToOneOf(schema2.value)),
|
|
845705
|
+
groupName: oneOfSchema.groupName
|
|
845706
|
+
});
|
|
845707
|
+
}
|
|
845708
|
+
default:
|
|
845709
|
+
assertNever(schema2);
|
|
845710
|
+
}
|
|
845711
|
+
}
|
|
845670
845712
|
function convertToOneOf(oneOfSchema) {
|
|
845671
845713
|
switch (oneOfSchema.type) {
|
|
845672
845714
|
case "discriminated":
|
|
@@ -848213,9 +848255,9 @@ function convertRequest({ requestBody, document: document4, context, requestBrea
|
|
|
848213
848255
|
name: isReferenceObject(multipartSchema) && context.getNumberOfOccurrencesForRef(multipartSchema) === 1 ? resolvedMultipartSchema.id : void 0,
|
|
848214
848256
|
description: void 0,
|
|
848215
848257
|
properties: Object.entries(resolvedMultipartSchema.schema.properties ?? {}).map(([key2, definition2]) => {
|
|
848258
|
+
const required = resolvedMultipartSchema.schema.required;
|
|
848259
|
+
const isRequired = required !== void 0 && required.includes(key2);
|
|
848216
848260
|
if (!isReferenceObject(definition2) && (definition2.type === "string" && definition2.format === "binary" || definition2.type === "array" && !isReferenceObject(definition2.items) && definition2.items.type === "string" && definition2.items.format === "binary")) {
|
|
848217
|
-
const required = resolvedMultipartSchema.schema.required;
|
|
848218
|
-
const isRequired = required !== void 0 && required.includes(key2);
|
|
848219
848261
|
return {
|
|
848220
848262
|
key: key2,
|
|
848221
848263
|
schema: MultipartSchema.file({ isOptional: !isRequired, isArray: definition2.type === "array" }),
|
|
@@ -848224,10 +848266,11 @@ function convertRequest({ requestBody, document: document4, context, requestBrea
|
|
|
848224
848266
|
}
|
|
848225
848267
|
const schemaWithExample = convertSchema(definition2, false, context, [...requestBreadcrumbs, key2]);
|
|
848226
848268
|
const audiences = getExtension(definition2, FernOpenAPIExtension.AUDIENCES) ?? [];
|
|
848269
|
+
const schema2 = isRequired ? convertSchemaWithExampleToSchema(schemaWithExample) : convertSchemaWithExampleToOptionalSchema(schemaWithExample);
|
|
848227
848270
|
return {
|
|
848228
848271
|
key: key2,
|
|
848229
848272
|
audiences,
|
|
848230
|
-
schema: MultipartSchema.json(
|
|
848273
|
+
schema: MultipartSchema.json(schema2),
|
|
848231
848274
|
description: void 0
|
|
848232
848275
|
};
|
|
848233
848276
|
})
|
|
@@ -855717,10 +855760,10 @@ var CliContext = class {
|
|
|
855717
855760
|
return "fern-api";
|
|
855718
855761
|
}
|
|
855719
855762
|
getPackageVersion() {
|
|
855720
|
-
if ("0.19.14-
|
|
855763
|
+
if ("0.19.14-rc2" == null) {
|
|
855721
855764
|
this.logger.error("CLI_VERSION is not defined");
|
|
855722
855765
|
}
|
|
855723
|
-
return "0.19.14-
|
|
855766
|
+
return "0.19.14-rc2";
|
|
855724
855767
|
}
|
|
855725
855768
|
getCliName() {
|
|
855726
855769
|
if ("fern" == null) {
|
|
@@ -871384,6 +871427,15 @@ function migrateIntermediateRepresentationForGenerator({ intermediateRepresentat
|
|
|
871384
871427
|
});
|
|
871385
871428
|
return migrated.jsonify();
|
|
871386
871429
|
}
|
|
871430
|
+
function migrateIntermediateRepresentationToVersionForGenerator({ intermediateRepresentation, context, targetGenerator, irVersion }) {
|
|
871431
|
+
const migrated = getIntermediateRepresentationMigrator().migrateThroughVersion({
|
|
871432
|
+
version: irVersion,
|
|
871433
|
+
intermediateRepresentation,
|
|
871434
|
+
context,
|
|
871435
|
+
targetGenerator
|
|
871436
|
+
});
|
|
871437
|
+
return migrated.jsonify();
|
|
871438
|
+
}
|
|
871387
871439
|
|
|
871388
871440
|
// pnp:/home/circleci/project/packages/cli/generation/ir-migrations/lib/migrateIntermediateRepresentationThroughVersion.js
|
|
871389
871441
|
function migrateIntermediateRepresentationThroughVersion({ intermediateRepresentation, context, version: version3 }) {
|
|
@@ -872020,7 +872072,7 @@ async function runLocalGenerationForWorkspace({ projectConfig, workspace, genera
|
|
|
872020
872072
|
workspaceTempDir,
|
|
872021
872073
|
keepDocker,
|
|
872022
872074
|
context: interactiveTaskContext,
|
|
872023
|
-
irVersionOverride:
|
|
872075
|
+
irVersionOverride: generatorInvocation.irVersionOverride,
|
|
872024
872076
|
outputVersionOverride: void 0,
|
|
872025
872077
|
writeSnippets: false,
|
|
872026
872078
|
writeUnitTests: false
|
|
@@ -872152,7 +872204,7 @@ function substituteEnvVariables(content3, context) {
|
|
|
872152
872204
|
}
|
|
872153
872205
|
|
|
872154
872206
|
// pnp:/home/circleci/project/packages/cli/generation/remote-generation/remote-workspace-runner/lib/createAndStartJob.js
|
|
872155
|
-
async function createAndStartJob({ workspace, organization, intermediateRepresentation, generatorInvocation, version: version3, context, shouldLogS3Url, token, whitelabel }) {
|
|
872207
|
+
async function createAndStartJob({ workspace, organization, intermediateRepresentation, generatorInvocation, version: version3, context, shouldLogS3Url, token, whitelabel, irVersionOverride }) {
|
|
872156
872208
|
const job = await createJob({
|
|
872157
872209
|
workspace,
|
|
872158
872210
|
organization,
|
|
@@ -872163,7 +872215,7 @@ async function createAndStartJob({ workspace, organization, intermediateRepresen
|
|
|
872163
872215
|
token,
|
|
872164
872216
|
whitelabel
|
|
872165
872217
|
});
|
|
872166
|
-
await startJob({ intermediateRepresentation, job, context, generatorInvocation });
|
|
872218
|
+
await startJob({ intermediateRepresentation, job, context, generatorInvocation, irVersionOverride });
|
|
872167
872219
|
return job;
|
|
872168
872220
|
}
|
|
872169
872221
|
async function createJob({ workspace, organization, generatorInvocation, version: version3, context, shouldLogS3Url, token, whitelabel }) {
|
|
@@ -872248,11 +872300,19 @@ async function createJob({ workspace, organization, generatorInvocation, version
|
|
|
872248
872300
|
}
|
|
872249
872301
|
return createResponse.body;
|
|
872250
872302
|
}
|
|
872251
|
-
async function startJob({ intermediateRepresentation, generatorInvocation, job, context }) {
|
|
872303
|
+
async function startJob({ intermediateRepresentation, generatorInvocation, job, context, irVersionOverride }) {
|
|
872252
872304
|
var _a2;
|
|
872253
|
-
const migratedIntermediateRepresentation = await migrateIntermediateRepresentationForGenerator({
|
|
872305
|
+
const migratedIntermediateRepresentation = irVersionOverride == null ? await migrateIntermediateRepresentationForGenerator({
|
|
872306
|
+
intermediateRepresentation,
|
|
872307
|
+
context,
|
|
872308
|
+
targetGenerator: {
|
|
872309
|
+
name: generatorInvocation.name,
|
|
872310
|
+
version: generatorInvocation.version
|
|
872311
|
+
}
|
|
872312
|
+
}) : await migrateIntermediateRepresentationToVersionForGenerator({
|
|
872254
872313
|
intermediateRepresentation,
|
|
872255
872314
|
context,
|
|
872315
|
+
irVersion: irVersionOverride,
|
|
872256
872316
|
targetGenerator: {
|
|
872257
872317
|
name: generatorInvocation.name,
|
|
872258
872318
|
version: generatorInvocation.version
|
|
@@ -872475,7 +872535,7 @@ function convertLogLevel(logLevel) {
|
|
|
872475
872535
|
}
|
|
872476
872536
|
|
|
872477
872537
|
// pnp:/home/circleci/project/packages/cli/generation/remote-generation/remote-workspace-runner/lib/runRemoteGenerationForGenerator.js
|
|
872478
|
-
async function runRemoteGenerationForGenerator({ organization, workspace, interactiveTaskContext, generatorInvocation, version: version3, audiences, shouldLogS3Url, token, whitelabel }) {
|
|
872538
|
+
async function runRemoteGenerationForGenerator({ organization, workspace, interactiveTaskContext, generatorInvocation, version: version3, audiences, shouldLogS3Url, token, whitelabel, irVersionOverride }) {
|
|
872479
872539
|
const intermediateRepresentation = await generateIntermediateRepresentation({
|
|
872480
872540
|
workspace,
|
|
872481
872541
|
generationLanguage: generatorInvocation.language,
|
|
@@ -872492,7 +872552,8 @@ async function runRemoteGenerationForGenerator({ organization, workspace, intera
|
|
|
872492
872552
|
intermediateRepresentation,
|
|
872493
872553
|
shouldLogS3Url,
|
|
872494
872554
|
token,
|
|
872495
|
-
whitelabel
|
|
872555
|
+
whitelabel,
|
|
872556
|
+
irVersionOverride
|
|
872496
872557
|
});
|
|
872497
872558
|
interactiveTaskContext.logger.debug(`Job ID: ${job.jobId}`);
|
|
872498
872559
|
const taskId = job.taskIds[0];
|
|
@@ -872533,7 +872594,8 @@ async function runRemoteGenerationForAPIWorkspace({ organization, workspace, con
|
|
|
872533
872594
|
audiences: generatorGroup.audiences,
|
|
872534
872595
|
shouldLogS3Url,
|
|
872535
872596
|
token,
|
|
872536
|
-
whitelabel
|
|
872597
|
+
whitelabel,
|
|
872598
|
+
irVersionOverride: generatorInvocation.irVersionOverride
|
|
872537
872599
|
});
|
|
872538
872600
|
if (remoteTaskHandlerResponse != null && remoteTaskHandlerResponse.createdSnippets) {
|
|
872539
872601
|
snippetsProducedBy.push(generatorInvocation);
|