@fern-api/fern-api-dev 3.52.0-63-g2019600bc72 → 3.52.1-2-g35a8ecf9b7c
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/cli.cjs +38 -24
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -1572257,49 +1572257,63 @@ var OneOfSchemaConverter = class extends AbstractConverter {
|
|
|
1572257
1572257
|
if (isDiscriminated === false) {
|
|
1572258
1572258
|
return this.convertAsUndiscriminatedUnion();
|
|
1572259
1572259
|
}
|
|
1572260
|
-
if (this.schema.discriminator != null
|
|
1572261
|
-
discriminantProperty: this.schema.discriminator.propertyName
|
|
1572262
|
-
})) {
|
|
1572260
|
+
if (this.schema.discriminator != null) {
|
|
1572263
1572261
|
return this.convertAsDiscriminatedUnion();
|
|
1572264
1572262
|
}
|
|
1572265
1572263
|
return this.convertAsUndiscriminatedUnion();
|
|
1572266
1572264
|
}
|
|
1572267
|
-
|
|
1572268
|
-
|
|
1572269
|
-
|
|
1572270
|
-
|
|
1572271
|
-
|
|
1572272
|
-
|
|
1572273
|
-
|
|
1572274
|
-
return false;
|
|
1572275
|
-
}
|
|
1572265
|
+
/**
|
|
1572266
|
+
* Filters out the discriminant property from a schema's properties.
|
|
1572267
|
+
* This is needed when the discriminant is redeclared in variant schemas.
|
|
1572268
|
+
*/
|
|
1572269
|
+
filterDiscriminantFromSchema(schema2, discriminantProperty) {
|
|
1572270
|
+
if (schema2.properties == null || !(discriminantProperty in schema2.properties)) {
|
|
1572271
|
+
return schema2;
|
|
1572276
1572272
|
}
|
|
1572277
|
-
|
|
1572273
|
+
const { [discriminantProperty]: _15, ...filteredProperties } = schema2.properties;
|
|
1572274
|
+
const filteredRequired = schema2.required?.filter((prop) => prop !== discriminantProperty);
|
|
1572275
|
+
return {
|
|
1572276
|
+
...schema2,
|
|
1572277
|
+
properties: filteredProperties,
|
|
1572278
|
+
required: filteredRequired
|
|
1572279
|
+
};
|
|
1572278
1572280
|
}
|
|
1572279
1572281
|
convertAsDiscriminatedUnion() {
|
|
1572280
1572282
|
if (this.schema.discriminator == null) {
|
|
1572281
1572283
|
return void 0;
|
|
1572282
1572284
|
}
|
|
1572285
|
+
const discriminantProperty = this.schema.discriminator.propertyName;
|
|
1572283
1572286
|
const unionTypes = [];
|
|
1572284
1572287
|
let referencedTypes = /* @__PURE__ */ new Set();
|
|
1572285
1572288
|
let inlinedTypes = {};
|
|
1572286
1572289
|
for (const [discriminant8, reference4] of Object.entries(this.schema.discriminator.mapping ?? {})) {
|
|
1572290
|
+
const typeId = this.context.getTypeIdFromSchemaReference({ $ref: reference4 });
|
|
1572291
|
+
const breadcrumbs = [...this.breadcrumbs, "discriminator", "mapping", discriminant8];
|
|
1572292
|
+
const resolvedSchema = this.context.resolveReference({
|
|
1572293
|
+
reference: { $ref: reference4 },
|
|
1572294
|
+
breadcrumbs
|
|
1572295
|
+
});
|
|
1572296
|
+
let schemaOrReference = { $ref: reference4 };
|
|
1572297
|
+
if (resolvedSchema.resolved && resolvedSchema.value.properties != null && discriminantProperty in resolvedSchema.value.properties) {
|
|
1572298
|
+
const filteredSchema = this.filterDiscriminantFromSchema(resolvedSchema.value, discriminantProperty);
|
|
1572299
|
+
schemaOrReference = filteredSchema;
|
|
1572300
|
+
}
|
|
1572287
1572301
|
const singleUnionTypeSchemaConverter = new SchemaOrReferenceConverter({
|
|
1572288
1572302
|
context: this.context,
|
|
1572289
|
-
schemaOrReference
|
|
1572290
|
-
|
|
1572303
|
+
schemaOrReference,
|
|
1572304
|
+
schemaIdOverride: typeId ?? void 0,
|
|
1572305
|
+
breadcrumbs
|
|
1572291
1572306
|
});
|
|
1572292
|
-
const typeId = this.context.getTypeIdFromSchemaReference({ $ref: reference4 });
|
|
1572293
1572307
|
if (typeId != null) {
|
|
1572294
1572308
|
referencedTypes.add(typeId);
|
|
1572295
1572309
|
}
|
|
1572296
1572310
|
const convertedSchema = singleUnionTypeSchemaConverter.convert();
|
|
1572297
1572311
|
if (convertedSchema?.type != null && typeId != null) {
|
|
1572298
|
-
for (const
|
|
1572299
|
-
referencedTypes.add(
|
|
1572312
|
+
for (const inlinedTypeId of Object.keys(convertedSchema?.inlinedTypes ?? {})) {
|
|
1572313
|
+
referencedTypes.add(inlinedTypeId);
|
|
1572300
1572314
|
}
|
|
1572301
|
-
for (const
|
|
1572302
|
-
referencedTypes.add(
|
|
1572315
|
+
for (const refTypeId of convertedSchema.schema?.typeDeclaration.referencedTypes ?? []) {
|
|
1572316
|
+
referencedTypes.add(refTypeId);
|
|
1572303
1572317
|
}
|
|
1572304
1572318
|
const nameAndWireValue = this.context.casingsGenerator.generateNameAndWireValue({
|
|
1572305
1572319
|
name: discriminant8,
|
|
@@ -1650969,7 +1650983,7 @@ var AccessTokenPosthogManager = class {
|
|
|
1650969
1650983
|
properties: {
|
|
1650970
1650984
|
...event,
|
|
1650971
1650985
|
...event.properties,
|
|
1650972
|
-
version: "3.52.
|
|
1650986
|
+
version: "3.52.1-2-g35a8ecf9b7c",
|
|
1650973
1650987
|
usingAccessToken: true
|
|
1650974
1650988
|
}
|
|
1650975
1650989
|
});
|
|
@@ -1651019,7 +1651033,7 @@ var UserPosthogManager = class {
|
|
|
1651019
1651033
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
1651020
1651034
|
event: "CLI",
|
|
1651021
1651035
|
properties: {
|
|
1651022
|
-
version: "3.52.
|
|
1651036
|
+
version: "3.52.1-2-g35a8ecf9b7c",
|
|
1651023
1651037
|
...event,
|
|
1651024
1651038
|
...event.properties,
|
|
1651025
1651039
|
usingAccessToken: false,
|
|
@@ -1684161,7 +1684175,7 @@ var CliContext = class {
|
|
|
1684161
1684175
|
if (false) {
|
|
1684162
1684176
|
this.logger.error("CLI_VERSION is not defined");
|
|
1684163
1684177
|
}
|
|
1684164
|
-
return "3.52.
|
|
1684178
|
+
return "3.52.1-2-g35a8ecf9b7c";
|
|
1684165
1684179
|
}
|
|
1684166
1684180
|
getCliName() {
|
|
1684167
1684181
|
if (false) {
|
|
@@ -1687274,7 +1687288,7 @@ var import_path54 = __toESM(require("path"), 1);
|
|
|
1687274
1687288
|
var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
1687275
1687289
|
var LOGS_FOLDER_NAME = "logs";
|
|
1687276
1687290
|
function getCliSource() {
|
|
1687277
|
-
const version7 = "3.52.
|
|
1687291
|
+
const version7 = "3.52.1-2-g35a8ecf9b7c";
|
|
1687278
1687292
|
return `cli@${version7}`;
|
|
1687279
1687293
|
}
|
|
1687280
1687294
|
var DebugLogger = class {
|
package/package.json
CHANGED