fern-api 0.31.25-rc1 → 0.32.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/bundle.cjs +318 -56
- package/package.json +1 -1
package/bundle.cjs
CHANGED
|
@@ -355192,6 +355192,39 @@ var init_PlatformHeaders = __esm({
|
|
|
355192
355192
|
}
|
|
355193
355193
|
});
|
|
355194
355194
|
|
|
355195
|
+
// pnp:/home/runner/work/fern/fern/packages/ir-sdk/lib/sdk/api/resources/ir/types/ApiVersionScheme.js
|
|
355196
|
+
var ApiVersionScheme;
|
|
355197
|
+
var init_ApiVersionScheme = __esm({
|
|
355198
|
+
"pnp:/home/runner/work/fern/fern/packages/ir-sdk/lib/sdk/api/resources/ir/types/ApiVersionScheme.js"() {
|
|
355199
|
+
init_api();
|
|
355200
|
+
ApiVersionScheme = {
|
|
355201
|
+
header: (value) => {
|
|
355202
|
+
return {
|
|
355203
|
+
...value,
|
|
355204
|
+
type: "header",
|
|
355205
|
+
_visit: function(visitor) {
|
|
355206
|
+
return ApiVersionScheme._visit(this, visitor);
|
|
355207
|
+
}
|
|
355208
|
+
};
|
|
355209
|
+
},
|
|
355210
|
+
_visit: (value, visitor) => {
|
|
355211
|
+
switch (value.type) {
|
|
355212
|
+
case "header":
|
|
355213
|
+
return visitor.header(value);
|
|
355214
|
+
default:
|
|
355215
|
+
return visitor._other(value);
|
|
355216
|
+
}
|
|
355217
|
+
}
|
|
355218
|
+
};
|
|
355219
|
+
}
|
|
355220
|
+
});
|
|
355221
|
+
|
|
355222
|
+
// pnp:/home/runner/work/fern/fern/packages/ir-sdk/lib/sdk/api/resources/ir/types/HeaderApiVersionScheme.js
|
|
355223
|
+
var init_HeaderApiVersionScheme = __esm({
|
|
355224
|
+
"pnp:/home/runner/work/fern/fern/packages/ir-sdk/lib/sdk/api/resources/ir/types/HeaderApiVersionScheme.js"() {
|
|
355225
|
+
}
|
|
355226
|
+
});
|
|
355227
|
+
|
|
355195
355228
|
// pnp:/home/runner/work/fern/fern/packages/ir-sdk/lib/sdk/api/resources/ir/types/ErrorDiscriminationStrategy.js
|
|
355196
355229
|
var ErrorDiscriminationStrategy;
|
|
355197
355230
|
var init_ErrorDiscriminationStrategy = __esm({
|
|
@@ -355266,6 +355299,8 @@ var init_types8 = __esm({
|
|
|
355266
355299
|
init_ReadmeConfig();
|
|
355267
355300
|
init_SdkConfig();
|
|
355268
355301
|
init_PlatformHeaders();
|
|
355302
|
+
init_ApiVersionScheme();
|
|
355303
|
+
init_HeaderApiVersionScheme();
|
|
355269
355304
|
init_ErrorDiscriminationStrategy();
|
|
355270
355305
|
init_ErrorDiscriminationByPropertyStrategy();
|
|
355271
355306
|
init_Package();
|
|
@@ -355278,6 +355313,7 @@ var init_types8 = __esm({
|
|
|
355278
355313
|
// pnp:/home/runner/work/fern/fern/packages/ir-sdk/lib/sdk/api/resources/ir/index.js
|
|
355279
355314
|
var ir_exports = {};
|
|
355280
355315
|
__export(ir_exports, {
|
|
355316
|
+
ApiVersionScheme: () => ApiVersionScheme,
|
|
355281
355317
|
ErrorDiscriminationStrategy: () => ErrorDiscriminationStrategy
|
|
355282
355318
|
});
|
|
355283
355319
|
var init_ir = __esm({
|
|
@@ -356805,6 +356841,7 @@ var init_resources2 = __esm({
|
|
|
356805
356841
|
// pnp:/home/runner/work/fern/fern/packages/ir-sdk/lib/sdk/api/index.js
|
|
356806
356842
|
var api_exports7 = {};
|
|
356807
356843
|
__export(api_exports7, {
|
|
356844
|
+
ApiVersionScheme: () => ApiVersionScheme,
|
|
356808
356845
|
AuthScheme: () => AuthScheme,
|
|
356809
356846
|
AuthSchemesRequirement: () => AuthSchemesRequirement,
|
|
356810
356847
|
AvailabilityStatus: () => AvailabilityStatus,
|
|
@@ -360327,6 +360364,7 @@ var init_IntermediateRepresentation2 = __esm({
|
|
|
360327
360364
|
"pnp:/home/runner/work/fern/fern/packages/ir-sdk/lib/sdk/serialization/resources/ir/types/IntermediateRepresentation.js"() {
|
|
360328
360365
|
init_core2();
|
|
360329
360366
|
IntermediateRepresentation = schemas_exports4.objectWithoutOptionalProperties({
|
|
360367
|
+
apiVersion: schemas_exports4.lazy(async () => (await Promise.resolve().then(() => (init_serialization2(), serialization_exports2))).ApiVersionScheme).optional(),
|
|
360330
360368
|
apiName: schemas_exports4.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization2(), serialization_exports2))).Name),
|
|
360331
360369
|
apiDisplayName: schemas_exports4.string().optional(),
|
|
360332
360370
|
apiDocs: schemas_exports4.string().optional(),
|
|
@@ -360396,6 +360434,40 @@ var init_PlatformHeaders2 = __esm({
|
|
|
360396
360434
|
}
|
|
360397
360435
|
});
|
|
360398
360436
|
|
|
360437
|
+
// pnp:/home/runner/work/fern/fern/packages/ir-sdk/lib/sdk/serialization/resources/ir/types/ApiVersionScheme.js
|
|
360438
|
+
var ApiVersionScheme2;
|
|
360439
|
+
var init_ApiVersionScheme2 = __esm({
|
|
360440
|
+
"pnp:/home/runner/work/fern/fern/packages/ir-sdk/lib/sdk/serialization/resources/ir/types/ApiVersionScheme.js"() {
|
|
360441
|
+
init_api();
|
|
360442
|
+
init_core2();
|
|
360443
|
+
ApiVersionScheme2 = schemas_exports4.union("type", {
|
|
360444
|
+
header: schemas_exports4.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization2(), serialization_exports2))).HeaderApiVersionScheme)
|
|
360445
|
+
}).transform({
|
|
360446
|
+
transform: (value) => {
|
|
360447
|
+
switch (value.type) {
|
|
360448
|
+
case "header":
|
|
360449
|
+
return ApiVersionScheme.header(value);
|
|
360450
|
+
default:
|
|
360451
|
+
return value;
|
|
360452
|
+
}
|
|
360453
|
+
},
|
|
360454
|
+
untransform: ({ _visit, ...value }) => value
|
|
360455
|
+
});
|
|
360456
|
+
}
|
|
360457
|
+
});
|
|
360458
|
+
|
|
360459
|
+
// pnp:/home/runner/work/fern/fern/packages/ir-sdk/lib/sdk/serialization/resources/ir/types/HeaderApiVersionScheme.js
|
|
360460
|
+
var HeaderApiVersionScheme;
|
|
360461
|
+
var init_HeaderApiVersionScheme2 = __esm({
|
|
360462
|
+
"pnp:/home/runner/work/fern/fern/packages/ir-sdk/lib/sdk/serialization/resources/ir/types/HeaderApiVersionScheme.js"() {
|
|
360463
|
+
init_core2();
|
|
360464
|
+
HeaderApiVersionScheme = schemas_exports4.objectWithoutOptionalProperties({
|
|
360465
|
+
header: schemas_exports4.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization2(), serialization_exports2))).HttpHeader),
|
|
360466
|
+
value: schemas_exports4.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization2(), serialization_exports2))).EnumTypeDeclaration)
|
|
360467
|
+
});
|
|
360468
|
+
}
|
|
360469
|
+
});
|
|
360470
|
+
|
|
360399
360471
|
// pnp:/home/runner/work/fern/fern/packages/ir-sdk/lib/sdk/serialization/resources/ir/types/ErrorDiscriminationStrategy.js
|
|
360400
360472
|
var ErrorDiscriminationStrategy2;
|
|
360401
360473
|
var init_ErrorDiscriminationStrategy2 = __esm({
|
|
@@ -360493,6 +360565,8 @@ var init_types20 = __esm({
|
|
|
360493
360565
|
init_ReadmeConfig2();
|
|
360494
360566
|
init_SdkConfig2();
|
|
360495
360567
|
init_PlatformHeaders2();
|
|
360568
|
+
init_ApiVersionScheme2();
|
|
360569
|
+
init_HeaderApiVersionScheme2();
|
|
360496
360570
|
init_ErrorDiscriminationStrategy2();
|
|
360497
360571
|
init_ErrorDiscriminationByPropertyStrategy2();
|
|
360498
360572
|
init_Package2();
|
|
@@ -360505,8 +360579,10 @@ var init_types20 = __esm({
|
|
|
360505
360579
|
// pnp:/home/runner/work/fern/fern/packages/ir-sdk/lib/sdk/serialization/resources/ir/index.js
|
|
360506
360580
|
var ir_exports2 = {};
|
|
360507
360581
|
__export(ir_exports2, {
|
|
360582
|
+
ApiVersionScheme: () => ApiVersionScheme2,
|
|
360508
360583
|
ErrorDiscriminationByPropertyStrategy: () => ErrorDiscriminationByPropertyStrategy,
|
|
360509
360584
|
ErrorDiscriminationStrategy: () => ErrorDiscriminationStrategy2,
|
|
360585
|
+
HeaderApiVersionScheme: () => HeaderApiVersionScheme,
|
|
360510
360586
|
IntermediateRepresentation: () => IntermediateRepresentation,
|
|
360511
360587
|
Package: () => Package,
|
|
360512
360588
|
PackageNavigationConfig: () => PackageNavigationConfig,
|
|
@@ -360657,6 +360733,7 @@ var init_EnumTypeDeclaration2 = __esm({
|
|
|
360657
360733
|
"pnp:/home/runner/work/fern/fern/packages/ir-sdk/lib/sdk/serialization/resources/types/types/EnumTypeDeclaration.js"() {
|
|
360658
360734
|
init_core2();
|
|
360659
360735
|
EnumTypeDeclaration = schemas_exports4.objectWithoutOptionalProperties({
|
|
360736
|
+
default: schemas_exports4.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization2(), serialization_exports2))).EnumValue).optional(),
|
|
360660
360737
|
values: schemas_exports4.list(schemas_exports4.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization2(), serialization_exports2))).EnumValue))
|
|
360661
360738
|
});
|
|
360662
360739
|
}
|
|
@@ -361985,6 +362062,7 @@ var serialization_exports2 = {};
|
|
|
361985
362062
|
__export(serialization_exports2, {
|
|
361986
362063
|
AliasTypeDeclaration: () => AliasTypeDeclaration,
|
|
361987
362064
|
ApiAuth: () => ApiAuth,
|
|
362065
|
+
ApiVersionScheme: () => ApiVersionScheme2,
|
|
361988
362066
|
AuthScheme: () => AuthScheme2,
|
|
361989
362067
|
AuthSchemesRequirement: () => AuthSchemesRequirement2,
|
|
361990
362068
|
AutogeneratedEndpointExample: () => AutogeneratedEndpointExample,
|
|
@@ -362066,6 +362144,7 @@ __export(serialization_exports2, {
|
|
|
362066
362144
|
FilePropertySingle: () => FilePropertySingle,
|
|
362067
362145
|
FileUploadRequest: () => FileUploadRequest,
|
|
362068
362146
|
FileUploadRequestProperty: () => FileUploadRequestProperty2,
|
|
362147
|
+
HeaderApiVersionScheme: () => HeaderApiVersionScheme,
|
|
362069
362148
|
HeaderAuthScheme: () => HeaderAuthScheme,
|
|
362070
362149
|
HttpEndpoint: () => HttpEndpoint,
|
|
362071
362150
|
HttpHeader: () => HttpHeader,
|
|
@@ -372274,6 +372353,7 @@ var init_OpenApiIntermediateRepresentation2 = __esm({
|
|
|
372274
372353
|
"pnp:/home/runner/work/fern/fern/packages/cli/openapi-ir-sdk/lib/sdk/serialization/resources/finalIr/types/OpenApiIntermediateRepresentation.js"() {
|
|
372275
372354
|
init_core3();
|
|
372276
372355
|
OpenApiIntermediateRepresentation = schemas_exports5.objectWithoutOptionalProperties({
|
|
372356
|
+
apiVersion: schemas_exports5.unknown().optional(),
|
|
372277
372357
|
title: schemas_exports5.string().optional(),
|
|
372278
372358
|
description: schemas_exports5.string().optional(),
|
|
372279
372359
|
basePath: schemas_exports5.string().optional(),
|
|
@@ -1122319,7 +1122399,7 @@ var AccessTokenPosthogManager = class {
|
|
|
1122319
1122399
|
properties: {
|
|
1122320
1122400
|
...event,
|
|
1122321
1122401
|
...event.properties,
|
|
1122322
|
-
version: "0.
|
|
1122402
|
+
version: "0.32.0",
|
|
1122323
1122403
|
usingAccessToken: true
|
|
1122324
1122404
|
}
|
|
1122325
1122405
|
});
|
|
@@ -1122381,7 +1122461,7 @@ var UserPosthogManager = class {
|
|
|
1122381
1122461
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
1122382
1122462
|
event: "CLI",
|
|
1122383
1122463
|
properties: {
|
|
1122384
|
-
version: "0.
|
|
1122464
|
+
version: "0.32.0",
|
|
1122385
1122465
|
...event,
|
|
1122386
1122466
|
...event.properties
|
|
1122387
1122467
|
}
|
|
@@ -1124913,6 +1124993,7 @@ async function visitTypeDeclaration({ typeName, declaration, visitor, nodePathFo
|
|
|
1124913
1124993
|
},
|
|
1124914
1124994
|
availability: noop,
|
|
1124915
1124995
|
audiences: noop,
|
|
1124996
|
+
default: noop,
|
|
1124916
1124997
|
examples: visitExamples
|
|
1124917
1124998
|
});
|
|
1124918
1124999
|
}
|
|
@@ -1125148,6 +1125229,7 @@ async function visitRootApiFileYamlAst(contents, visitor) {
|
|
|
1125148
1125229
|
var _a5;
|
|
1125149
1125230
|
await ((_a5 = visitor.file) == null ? void 0 : _a5.call(visitor, contents, []));
|
|
1125150
1125231
|
await visitObject(contents, {
|
|
1125232
|
+
version: noop,
|
|
1125151
1125233
|
name: noop,
|
|
1125152
1125234
|
"display-name": noop,
|
|
1125153
1125235
|
imports: noop,
|
|
@@ -1134479,7 +1134561,7 @@ function isExternalUrl(url) {
|
|
|
1134479
1134561
|
return /^(https?:)?\/\//.test(url);
|
|
1134480
1134562
|
}
|
|
1134481
1134563
|
function isDataUrl(url) {
|
|
1134482
|
-
return
|
|
1134564
|
+
return url.startsWith("data:");
|
|
1134483
1134565
|
}
|
|
1134484
1134566
|
function replaceImagePathsAndUrls(markdown, fileIdsMap, markdownFilesToPathName, metadata, context) {
|
|
1134485
1134567
|
const { content: content5, data: data2 } = (0, import_gray_matter.default)(markdown);
|
|
@@ -1135039,6 +1135121,9 @@ __export(schemas_exports3, {
|
|
|
1135039
1135121
|
UndiscriminatedUnionSchema: () => UndiscriminatedUnionSchema,
|
|
1135040
1135122
|
ValidationSchema: () => ValidationSchema,
|
|
1135041
1135123
|
VariableDeclarationSchema: () => VariableDeclarationSchema,
|
|
1135124
|
+
VersionDeclarationHeaderObjectSchema: () => VersionDeclarationHeaderObjectSchema,
|
|
1135125
|
+
VersionDeclarationHeaderSchema: () => VersionDeclarationHeaderSchema,
|
|
1135126
|
+
VersionDeclarationSchema: () => VersionDeclarationSchema,
|
|
1135042
1135127
|
WebSocketChannelInlinedMessageSchema: () => WebSocketChannelInlinedMessageSchema,
|
|
1135043
1135128
|
WebSocketChannelMessageBodySchema: () => WebSocketChannelMessageBodySchema,
|
|
1135044
1135129
|
WebSocketChannelMessageSchema: () => WebSocketChannelMessageSchema,
|
|
@@ -1135301,6 +1135386,7 @@ var EnumValueSchema = WithNameAndDocsSchema.extend({
|
|
|
1135301
1135386
|
|
|
1135302
1135387
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-schema/lib/schemas/EnumSchema.js
|
|
1135303
1135388
|
var EnumSchema = BaseTypeDeclarationSchema.extend({
|
|
1135389
|
+
default: z.string().optional(),
|
|
1135304
1135390
|
enum: z.array(z.union([z.string(), EnumValueSchema]))
|
|
1135305
1135391
|
});
|
|
1135306
1135392
|
|
|
@@ -1135685,6 +1135771,23 @@ var PackageMarkerFileSchema = DefinitionFileSchema.extend({
|
|
|
1135685
1135771
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-schema/lib/schemas/VariableDeclarationSchema.js
|
|
1135686
1135772
|
var VariableDeclarationSchema = TypeReferenceWithDocsSchema;
|
|
1135687
1135773
|
|
|
1135774
|
+
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-schema/lib/schemas/VersionDeclarationHeaderObjectSchema.js
|
|
1135775
|
+
var VersionDeclarationHeaderObjectSchema = z.strictObject({
|
|
1135776
|
+
name: z.string().optional().describe("The name of the parameter used to represent the header"),
|
|
1135777
|
+
env: z.string().optional().describe("The environment variable to read the header value from (if any)"),
|
|
1135778
|
+
value: z.string().describe("The wire representation of the header (e.g. X-API-Version)")
|
|
1135779
|
+
});
|
|
1135780
|
+
|
|
1135781
|
+
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-schema/lib/schemas/VersionDeclarationHeaderSchema.js
|
|
1135782
|
+
var VersionDeclarationHeaderSchema = z.union([z.string(), VersionDeclarationHeaderObjectSchema]);
|
|
1135783
|
+
|
|
1135784
|
+
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-schema/lib/schemas/VersionDeclarationSchema.js
|
|
1135785
|
+
var VersionDeclarationSchema = z.strictObject({
|
|
1135786
|
+
header: z.union([z.string(), VersionDeclarationHeaderSchema]),
|
|
1135787
|
+
default: z.string().optional(),
|
|
1135788
|
+
values: z.array(z.union([z.string(), EnumValueSchema]))
|
|
1135789
|
+
});
|
|
1135790
|
+
|
|
1135688
1135791
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-schema/lib/schemas/file-schemas/RootApiFileSchema.js
|
|
1135689
1135792
|
var RootApiFileSchema = z.strictObject({
|
|
1135690
1135793
|
name: z.string(),
|
|
@@ -1135700,10 +1135803,11 @@ var RootApiFileSchema = z.strictObject({
|
|
|
1135700
1135803
|
docs: z.optional(z.string()),
|
|
1135701
1135804
|
errors: z.optional(z.array(z.string())),
|
|
1135702
1135805
|
"base-path": z.optional(z.string()),
|
|
1135703
|
-
|
|
1135806
|
+
"path-parameters": z.optional(z.record(HttpPathParameterSchema)),
|
|
1135704
1135807
|
"idempotency-headers": z.optional(z.record(z.string(), HttpHeaderSchema)),
|
|
1135705
1135808
|
variables: z.optional(z.record(VariableDeclarationSchema)),
|
|
1135706
|
-
pagination: z.optional(PaginationSchema)
|
|
1135809
|
+
pagination: z.optional(PaginationSchema),
|
|
1135810
|
+
version: z.optional(VersionDeclarationSchema)
|
|
1135707
1135811
|
});
|
|
1135708
1135812
|
|
|
1135709
1135813
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/yaml-schema/lib/utils/getRequestBody.js
|
|
@@ -1137527,7 +1137631,8 @@ var FernOpenAPIExtension = {
|
|
|
1137527
1137631
|
FERN_IDEMPOTENCY_HEADERS: "x-fern-idempotency-headers",
|
|
1137528
1137632
|
IDEMPOTENT: "x-fern-idempotent",
|
|
1137529
1137633
|
FERN_PROPERTY_NAME: "x-fern-property-name",
|
|
1137530
|
-
IS_UNDISCRIMINATED: "x-fern-undiscriminated"
|
|
1137634
|
+
IS_UNDISCRIMINATED: "x-fern-undiscriminated",
|
|
1137635
|
+
FERN_VERSION: "x-fern-version"
|
|
1137531
1137636
|
};
|
|
1137532
1137637
|
|
|
1137533
1137638
|
// pnp:/home/runner/work/fern/fern/packages/cli/openapi-parser/lib/openapi/v3/extensions/getFernEnum.js
|
|
@@ -1142079,6 +1142184,48 @@ var RedoclyCodeSampleSchema = z.object({
|
|
|
1142079
1142184
|
});
|
|
1142080
1142185
|
var RedoclyCodeSampleArraySchema = z.array(RedoclyCodeSampleSchema);
|
|
1142081
1142186
|
|
|
1142187
|
+
// pnp:/home/runner/work/fern/fern/packages/cli/openapi-parser/lib/openapi/v3/extensions/readmeExtensions.js
|
|
1142188
|
+
var ReadmeOpenAPIExtension = {
|
|
1142189
|
+
README_EXT: "x-readme"
|
|
1142190
|
+
};
|
|
1142191
|
+
|
|
1142192
|
+
// pnp:/home/runner/work/fern/fern/packages/cli/openapi-parser/lib/openapi/v3/extensions/getReadmeCodeSamples.js
|
|
1142193
|
+
function isReadMeCodeSamples(maybeCodeSamples) {
|
|
1142194
|
+
if (!Array.isArray(maybeCodeSamples)) {
|
|
1142195
|
+
return false;
|
|
1142196
|
+
}
|
|
1142197
|
+
for (const maybeCodeSample of maybeCodeSamples) {
|
|
1142198
|
+
if (!isPlainObject(maybeCodeSample)) {
|
|
1142199
|
+
return false;
|
|
1142200
|
+
}
|
|
1142201
|
+
if (typeof maybeCodeSample.language !== "string" || typeof maybeCodeSample.code !== "string") {
|
|
1142202
|
+
return false;
|
|
1142203
|
+
}
|
|
1142204
|
+
}
|
|
1142205
|
+
return true;
|
|
1142206
|
+
}
|
|
1142207
|
+
function getRawReadmeCodeSamples(operationObject) {
|
|
1142208
|
+
const readme = getExtension(operationObject, ReadmeOpenAPIExtension.README_EXT);
|
|
1142209
|
+
if (!isPlainObject(readme)) {
|
|
1142210
|
+
return [];
|
|
1142211
|
+
}
|
|
1142212
|
+
const readmeCodeSamples = readme["code-samples"];
|
|
1142213
|
+
if (!isReadMeCodeSamples(readmeCodeSamples)) {
|
|
1142214
|
+
return [];
|
|
1142215
|
+
}
|
|
1142216
|
+
const customCodeSamples = [];
|
|
1142217
|
+
for (const codeSample of readmeCodeSamples) {
|
|
1142218
|
+
customCodeSamples.push({
|
|
1142219
|
+
name: codeSample.name,
|
|
1142220
|
+
language: codeSample.language,
|
|
1142221
|
+
code: codeSample.code,
|
|
1142222
|
+
install: codeSample.install,
|
|
1142223
|
+
docs: void 0
|
|
1142224
|
+
});
|
|
1142225
|
+
}
|
|
1142226
|
+
return customCodeSamples;
|
|
1142227
|
+
}
|
|
1142228
|
+
|
|
1142082
1142229
|
// pnp:/home/runner/work/fern/fern/packages/cli/openapi-parser/lib/openapi/v3/extensions/getExamplesFromExtension.js
|
|
1142083
1142230
|
function getExamplesFromExtension(operationContext, operationObject, context) {
|
|
1142084
1142231
|
const exampleEndpointCalls = getExtensionAndValidate(operationObject, FernOpenAPIExtension.EXAMPLES, schemas_exports3.ExampleEndpointCallArraySchema, context, [...operationContext.baseBreadcrumbs, `${operationContext.method} ${operationContext.path}`]) ?? [];
|
|
@@ -1142099,6 +1142246,12 @@ function getExamplesFromExtension(operationContext, operationObject, context) {
|
|
|
1142099
1142246
|
}))
|
|
1142100
1142247
|
});
|
|
1142101
1142248
|
}
|
|
1142249
|
+
const readmeCodeSamples = getRawReadmeCodeSamples(operationObject);
|
|
1142250
|
+
if (readmeCodeSamples.length > 0) {
|
|
1142251
|
+
exampleEndpointCalls.push({
|
|
1142252
|
+
"code-samples": readmeCodeSamples
|
|
1142253
|
+
});
|
|
1142254
|
+
}
|
|
1142102
1142255
|
return exampleEndpointCalls.map(EndpointExample.unknown);
|
|
1142103
1142256
|
}
|
|
1142104
1142257
|
|
|
@@ -1142693,7 +1142846,7 @@ function convertHttpOperation({ operationContext, context, responseStatusCode, s
|
|
|
1142693
1142846
|
responseStatusCode
|
|
1142694
1142847
|
});
|
|
1142695
1142848
|
const availability = getFernAvailability(operation);
|
|
1142696
|
-
const examples =
|
|
1142849
|
+
const examples = getExamplesFromExtension(operationContext, operation, context);
|
|
1142697
1142850
|
return {
|
|
1142698
1142851
|
summary: operation.summary,
|
|
1142699
1142852
|
internal: getExtension(operation, OpenAPIExtension.INTERNAL),
|
|
@@ -1143299,6 +1143452,11 @@ function getFernGroups({ document: document6, context }) {
|
|
|
1143299
1143452
|
return getExtensionAndValidate(document6, FernOpenAPIExtension.GROUPS, XFernGroupsSchema, context);
|
|
1143300
1143453
|
}
|
|
1143301
1143454
|
|
|
1143455
|
+
// pnp:/home/runner/work/fern/fern/packages/cli/openapi-parser/lib/openapi/v3/extensions/getFernVersion.js
|
|
1143456
|
+
function getFernVersion({ context, document: document6 }) {
|
|
1143457
|
+
return getExtensionAndValidate(document6, FernOpenAPIExtension.FERN_VERSION, schemas_exports3.VersionDeclarationSchema, context) ?? void 0;
|
|
1143458
|
+
}
|
|
1143459
|
+
|
|
1143302
1143460
|
// pnp:/home/runner/work/fern/fern/packages/cli/openapi-parser/lib/openapi/v3/extensions/getGlobalHeaders.js
|
|
1143303
1143461
|
function getGlobalHeaders(document6) {
|
|
1143304
1143462
|
const globalHeaders = getExtension(document6, FernOpenAPIExtension.FERN_GLOBAL_HEADERS);
|
|
@@ -1143711,6 +1143869,10 @@ function generateIr({ openApi, taskContext, options: options2 }) {
|
|
|
1143711
1143869
|
});
|
|
1143712
1143870
|
const groupInfo = getFernGroups({ document: openApi, context });
|
|
1143713
1143871
|
const ir = {
|
|
1143872
|
+
apiVersion: getFernVersion({
|
|
1143873
|
+
context,
|
|
1143874
|
+
document: openApi
|
|
1143875
|
+
}),
|
|
1143714
1143876
|
basePath: getFernBasePath(openApi),
|
|
1143715
1143877
|
title: openApi.info.title,
|
|
1143716
1143878
|
description: openApi.info.description,
|
|
@@ -1143879,6 +1144041,7 @@ var DEFAULT_PARSE_OPENAPI_SETTINGS = {
|
|
|
1143879
1144041
|
// pnp:/home/runner/work/fern/fern/packages/cli/openapi-parser/lib/parse.js
|
|
1143880
1144042
|
async function parse4({ specs, taskContext, optionOverrides }) {
|
|
1143881
1144043
|
let ir = {
|
|
1144044
|
+
apiVersion: void 0,
|
|
1143882
1144045
|
title: void 0,
|
|
1143883
1144046
|
description: void 0,
|
|
1143884
1144047
|
basePath: void 0,
|
|
@@ -1143961,6 +1144124,7 @@ function getParseOptions({ specSettings, overrides }) {
|
|
|
1143961
1144124
|
}
|
|
1143962
1144125
|
function merge3(ir1, ir2) {
|
|
1143963
1144126
|
return {
|
|
1144127
|
+
apiVersion: ir1.apiVersion ?? ir2.apiVersion,
|
|
1143964
1144128
|
title: ir1.title ?? ir2.title,
|
|
1143965
1144129
|
description: ir1.description ?? ir2.description,
|
|
1143966
1144130
|
basePath: ir1.basePath ?? ir2.basePath,
|
|
@@ -1145600,6 +1145764,9 @@ function getDeclarationFileFromGroupName(groupName) {
|
|
|
1145600
1145764
|
var EXTERNAL_AUDIENCE = "external";
|
|
1145601
1145765
|
var ERROR_DECLARATIONS_FILENAME = RelativeFilePath.of(FERN_PACKAGE_MARKER_FILENAME);
|
|
1145602
1145766
|
function buildFernDefinition(context) {
|
|
1145767
|
+
if (context.ir.apiVersion != null) {
|
|
1145768
|
+
context.builder.setApiVersion(context.ir.apiVersion);
|
|
1145769
|
+
}
|
|
1145603
1145770
|
buildEnvironments(context);
|
|
1145604
1145771
|
buildGlobalHeaders(context);
|
|
1145605
1145772
|
buildIdempotencyHeaders(context);
|
|
@@ -1145711,6 +1145878,9 @@ var FernDefinitionBuilderImpl = class {
|
|
|
1145711
1145878
|
setBasePath(basePath) {
|
|
1145712
1145879
|
this.basePath = basePath;
|
|
1145713
1145880
|
}
|
|
1145881
|
+
setApiVersion(apiVersionScheme) {
|
|
1145882
|
+
this.rootApiFile.version = apiVersionScheme;
|
|
1145883
|
+
}
|
|
1145714
1145884
|
getEnvironmentType() {
|
|
1145715
1145885
|
const environmentEntry = Object.entries(this.rootApiFile.environments ?? {})[0];
|
|
1145716
1145886
|
if (environmentEntry == null) {
|
|
@@ -1150002,10 +1150172,10 @@ var CliContext = class {
|
|
|
1150002
1150172
|
return "fern-api";
|
|
1150003
1150173
|
}
|
|
1150004
1150174
|
getPackageVersion() {
|
|
1150005
|
-
if ("0.
|
|
1150175
|
+
if ("0.32.0" == null) {
|
|
1150006
1150176
|
this.logger.error("CLI_VERSION is not defined");
|
|
1150007
1150177
|
}
|
|
1150008
|
-
return "0.
|
|
1150178
|
+
return "0.32.0";
|
|
1150009
1150179
|
}
|
|
1150010
1150180
|
getCliName() {
|
|
1150011
1150181
|
if ("fern" == null) {
|
|
@@ -1152380,20 +1152550,29 @@ function areLiteralTypesEquivalent({ expected, actual }) {
|
|
|
1152380
1152550
|
|
|
1152381
1152551
|
// pnp:/home/runner/work/fern/fern/packages/cli/generation/ir-generator/lib/converters/type-declarations/convertEnumTypeDeclaration.js
|
|
1152382
1152552
|
async function convertEnumTypeDeclaration({ _enum, file }) {
|
|
1152383
|
-
|
|
1152384
|
-
|
|
1152385
|
-
|
|
1152386
|
-
|
|
1152387
|
-
|
|
1152388
|
-
|
|
1152389
|
-
|
|
1152390
|
-
|
|
1152391
|
-
|
|
1152392
|
-
|
|
1152393
|
-
|
|
1152394
|
-
|
|
1152395
|
-
|
|
1152396
|
-
|
|
1152553
|
+
const values3 = await Promise.all(_enum.enum.map(async (value) => {
|
|
1152554
|
+
return {
|
|
1152555
|
+
...await convertDeclaration(value),
|
|
1152556
|
+
name: file.casingsGenerator.generateNameAndWireValue({
|
|
1152557
|
+
wireValue: typeof value === "string" ? value : value.value,
|
|
1152558
|
+
name: getEnumName(value).name,
|
|
1152559
|
+
opts: {
|
|
1152560
|
+
casingOverrides: typeof value !== "string" ? value.casing : void 0
|
|
1152561
|
+
}
|
|
1152562
|
+
})
|
|
1152563
|
+
};
|
|
1152564
|
+
}));
|
|
1152565
|
+
let defaultValue;
|
|
1152566
|
+
if (_enum.default != null) {
|
|
1152567
|
+
defaultValue = values3.find((enumValue) => enumValue.name.wireValue === _enum.default);
|
|
1152568
|
+
if (defaultValue == null) {
|
|
1152569
|
+
throw new Error(`Default value ${_enum.default} not found in enum values`);
|
|
1152570
|
+
}
|
|
1152571
|
+
}
|
|
1152572
|
+
return {
|
|
1152573
|
+
default: defaultValue,
|
|
1152574
|
+
values: values3
|
|
1152575
|
+
};
|
|
1152397
1152576
|
}
|
|
1152398
1152577
|
function getEnumNameFromEnumValue(enumValue, _enum) {
|
|
1152399
1152578
|
const maybeEnumDefintion = _enum.enum.find((value) => typeof value === "string" ? false : value.value === enumValue);
|
|
@@ -1154057,6 +1154236,52 @@ async function generateOAuth({ file, docs, rawScheme, propertyResolver, endpoint
|
|
|
1154057
1154236
|
}
|
|
1154058
1154237
|
}
|
|
1154059
1154238
|
|
|
1154239
|
+
// pnp:/home/runner/work/fern/fern/packages/cli/generation/ir-generator/lib/converters/convertApiVersionScheme.js
|
|
1154240
|
+
async function convertApiVersionScheme({ file, rawApiFileSchema }) {
|
|
1154241
|
+
if (rawApiFileSchema.version == null) {
|
|
1154242
|
+
return void 0;
|
|
1154243
|
+
}
|
|
1154244
|
+
return ApiVersionScheme.header({
|
|
1154245
|
+
header: await convertHeader({
|
|
1154246
|
+
file,
|
|
1154247
|
+
header: rawApiFileSchema.version.header
|
|
1154248
|
+
}),
|
|
1154249
|
+
value: await convertEnum2({
|
|
1154250
|
+
file,
|
|
1154251
|
+
versionDeclaration: rawApiFileSchema.version
|
|
1154252
|
+
})
|
|
1154253
|
+
});
|
|
1154254
|
+
}
|
|
1154255
|
+
async function convertHeader({ file, header }) {
|
|
1154256
|
+
if (typeof header === "string") {
|
|
1154257
|
+
return await convertHttpHeader({
|
|
1154258
|
+
file,
|
|
1154259
|
+
headerKey: header,
|
|
1154260
|
+
header: {
|
|
1154261
|
+
type: "string"
|
|
1154262
|
+
}
|
|
1154263
|
+
});
|
|
1154264
|
+
}
|
|
1154265
|
+
return await convertHttpHeader({
|
|
1154266
|
+
file,
|
|
1154267
|
+
headerKey: header.value,
|
|
1154268
|
+
header: {
|
|
1154269
|
+
type: "string",
|
|
1154270
|
+
name: header.name,
|
|
1154271
|
+
env: header.env
|
|
1154272
|
+
}
|
|
1154273
|
+
});
|
|
1154274
|
+
}
|
|
1154275
|
+
async function convertEnum2({ file, versionDeclaration }) {
|
|
1154276
|
+
return await convertEnumTypeDeclaration({
|
|
1154277
|
+
_enum: {
|
|
1154278
|
+
default: versionDeclaration.default,
|
|
1154279
|
+
enum: versionDeclaration.values
|
|
1154280
|
+
},
|
|
1154281
|
+
file
|
|
1154282
|
+
});
|
|
1154283
|
+
}
|
|
1154284
|
+
|
|
1154060
1154285
|
// pnp:/home/runner/work/fern/fern/packages/cli/generation/ir-generator/lib/converters/convertChannel.js
|
|
1154061
1154286
|
async function convertChannel({ channel, typeResolver, exampleResolver, variableResolver, file, workspace }) {
|
|
1154062
1154287
|
const messages2 = [];
|
|
@@ -1154839,7 +1155064,7 @@ async function convertType({ typeDeclaration, file, typeResolver }) {
|
|
|
1154839
1155064
|
object: (object4) => convertObjectTypeDeclaration({ object: object4, file }),
|
|
1154840
1155065
|
discriminatedUnion: (union5) => convertDiscriminatedUnionTypeDeclaration({ union: union5, file, typeResolver }),
|
|
1154841
1155066
|
undiscriminatedUnion: (union5) => convertUndiscriminatedUnionTypeDeclaration({ union: union5, file }),
|
|
1154842
|
-
enum: (enum_4) => convertEnumTypeDeclaration({ _enum: enum_4, file })
|
|
1155067
|
+
enum: async (enum_4) => Type2.enum(await convertEnumTypeDeclaration({ _enum: enum_4, file }))
|
|
1154843
1155068
|
});
|
|
1154844
1155069
|
}
|
|
1154845
1155070
|
|
|
@@ -1157116,6 +1157341,10 @@ async function generateIntermediateRepresentation({ workspace, generationLanguag
|
|
|
1157116
1157341
|
const exampleResolver = new ExampleResolverImpl(typeResolver);
|
|
1157117
1157342
|
const variableResolver = new VariableResolverImpl();
|
|
1157118
1157343
|
const intermediateRepresentation = {
|
|
1157344
|
+
apiVersion: await convertApiVersionScheme({
|
|
1157345
|
+
file: rootApiFileContext,
|
|
1157346
|
+
rawApiFileSchema: workspace.definition.rootApiFile.contents
|
|
1157347
|
+
}),
|
|
1157119
1157348
|
apiName: casingsGenerator.generateName(workspace.definition.rootApiFile.contents.name),
|
|
1157120
1157349
|
apiDisplayName: workspace.definition.rootApiFile.contents["display-name"],
|
|
1157121
1157350
|
apiDocs: await formatDocs(workspace.definition.rootApiFile.contents.docs),
|
|
@@ -1191119,6 +1191348,38 @@ function isRawStringValidation(validation) {
|
|
|
1191119
1191348
|
return maybeStringValidation2.minLength != null || maybeStringValidation2.maxLength != null || maybeStringValidation2.pattern != null || maybeStringValidation2.format != null;
|
|
1191120
1191349
|
}
|
|
1191121
1191350
|
|
|
1191351
|
+
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/validator/lib/rules/valid-version/valid-version.js
|
|
1191352
|
+
var ValidVersionRule = {
|
|
1191353
|
+
name: "valid-version",
|
|
1191354
|
+
create: ({ workspace }) => {
|
|
1191355
|
+
const typeResolver = new TypeResolverImpl(workspace);
|
|
1191356
|
+
return {
|
|
1191357
|
+
rootApiFile: {
|
|
1191358
|
+
file: (root4) => {
|
|
1191359
|
+
return validateApiVersionSchema({
|
|
1191360
|
+
root: root4,
|
|
1191361
|
+
typeResolver
|
|
1191362
|
+
});
|
|
1191363
|
+
}
|
|
1191364
|
+
}
|
|
1191365
|
+
};
|
|
1191366
|
+
}
|
|
1191367
|
+
};
|
|
1191368
|
+
function validateApiVersionSchema({ root: root4, typeResolver }) {
|
|
1191369
|
+
const violations = [];
|
|
1191370
|
+
if (root4.version == null || root4.version.default == null) {
|
|
1191371
|
+
return [];
|
|
1191372
|
+
}
|
|
1191373
|
+
const enumValues = new Set(root4.version.values.map((enumValue) => typeof enumValue === "string" ? enumValue : enumValue.value));
|
|
1191374
|
+
if (!enumValues.has(root4.version.default)) {
|
|
1191375
|
+
violations.push({
|
|
1191376
|
+
severity: "error",
|
|
1191377
|
+
message: `Default version "${root4.version.default}" not found in version values`
|
|
1191378
|
+
});
|
|
1191379
|
+
}
|
|
1191380
|
+
return violations;
|
|
1191381
|
+
}
|
|
1191382
|
+
|
|
1191122
1191383
|
// pnp:/home/runner/work/fern/fern/packages/cli/yaml/validator/lib/getAllRules.js
|
|
1191123
1191384
|
function getAllRules2() {
|
|
1191124
1191385
|
return [
|
|
@@ -1191160,7 +1191421,8 @@ function getAllRules2() {
|
|
|
1191160
1191421
|
ValidPaginationRule,
|
|
1191161
1191422
|
ValidExampleErrorRule,
|
|
1191162
1191423
|
ValidTypeReferenceWithDefaultAndValidationRule,
|
|
1191163
|
-
ValidStreamConditionRule
|
|
1191424
|
+
ValidStreamConditionRule,
|
|
1191425
|
+
ValidVersionRule
|
|
1191164
1191426
|
];
|
|
1191165
1191427
|
}
|
|
1191166
1191428
|
function getAllEnabledRules() {
|
|
@@ -1191820,11 +1192082,11 @@ function convertAuth3(auth) {
|
|
|
1191820
1192082
|
if (scheme._type !== "header") {
|
|
1191821
1192083
|
return scheme;
|
|
1191822
1192084
|
}
|
|
1191823
|
-
return IrVersions_exports.V13.auth.AuthScheme.header(
|
|
1192085
|
+
return IrVersions_exports.V13.auth.AuthScheme.header(convertHeader2(scheme));
|
|
1191824
1192086
|
})
|
|
1191825
1192087
|
};
|
|
1191826
1192088
|
}
|
|
1191827
|
-
function
|
|
1192089
|
+
function convertHeader2(header) {
|
|
1191828
1192090
|
return {
|
|
1191829
1192091
|
docs: header.docs,
|
|
1191830
1192092
|
prefix: header.prefix,
|
|
@@ -1192147,11 +1192409,11 @@ function convertAuth4(auth) {
|
|
|
1192147
1192409
|
if (scheme._type !== "header") {
|
|
1192148
1192410
|
return scheme;
|
|
1192149
1192411
|
}
|
|
1192150
|
-
return IrVersions_exports.V14.auth.AuthScheme.header(
|
|
1192412
|
+
return IrVersions_exports.V14.auth.AuthScheme.header(convertHeader3(scheme));
|
|
1192151
1192413
|
})
|
|
1192152
1192414
|
};
|
|
1192153
1192415
|
}
|
|
1192154
|
-
function
|
|
1192416
|
+
function convertHeader3(header) {
|
|
1192155
1192417
|
return {
|
|
1192156
1192418
|
docs: header.docs,
|
|
1192157
1192419
|
prefix: header.prefix,
|
|
@@ -1193110,7 +1193372,7 @@ var V23_TO_V22_MIGRATION = {
|
|
|
1193110
1193372
|
v22Services[serviceId] = {
|
|
1193111
1193373
|
...service,
|
|
1193112
1193374
|
endpoints: v22Endpoints,
|
|
1193113
|
-
headers: service.headers.map((header) =>
|
|
1193375
|
+
headers: service.headers.map((header) => convertHeader4(header)),
|
|
1193114
1193376
|
pathParameters: service.pathParameters.map((pathParameter) => convertPathParameter5(pathParameter))
|
|
1193115
1193377
|
};
|
|
1193116
1193378
|
}
|
|
@@ -1193128,7 +1193390,7 @@ var V23_TO_V22_MIGRATION = {
|
|
|
1193128
1193390
|
...v23.auth,
|
|
1193129
1193391
|
schemes: v23.auth.schemes.map((scheme) => convertAuthScheme2(scheme))
|
|
1193130
1193392
|
},
|
|
1193131
|
-
headers: v23.headers.map((header) =>
|
|
1193393
|
+
headers: v23.headers.map((header) => convertHeader4(header)),
|
|
1193132
1193394
|
types: mapValues_default2(v23.types, (type2) => convertType2(type2)),
|
|
1193133
1193395
|
services: v22Services,
|
|
1193134
1193396
|
errors: mapValues_default2(v23.errors, (error) => convertError(error)),
|
|
@@ -1193148,7 +1193410,7 @@ function convertEndpoint8(endpoint) {
|
|
|
1193148
1193410
|
}
|
|
1193149
1193411
|
return {
|
|
1193150
1193412
|
...endpoint,
|
|
1193151
|
-
headers: endpoint.headers.map((header) =>
|
|
1193413
|
+
headers: endpoint.headers.map((header) => convertHeader4(header)),
|
|
1193152
1193414
|
pathParameters: endpoint.pathParameters.map((pathParameter) => convertPathParameter5(pathParameter)),
|
|
1193153
1193415
|
allPathParameters: endpoint.allPathParameters.map((pathParameter) => convertPathParameter5(pathParameter)),
|
|
1193154
1193416
|
queryParameters: endpoint.queryParameters.map((queryParameter) => convertQueryParameter4(queryParameter)),
|
|
@@ -1193184,7 +1193446,7 @@ function convertRequestBody4(requestBody) {
|
|
|
1193184
1193446
|
assertNever(requestBody);
|
|
1193185
1193447
|
}
|
|
1193186
1193448
|
}
|
|
1193187
|
-
function
|
|
1193449
|
+
function convertHeader4(header) {
|
|
1193188
1193450
|
return {
|
|
1193189
1193451
|
...header,
|
|
1193190
1193452
|
valueType: convertTypeReference4(header.valueType)
|
|
@@ -1193788,7 +1194050,7 @@ var V26_TO_V25_MIGRATION = {
|
|
|
1193788
1194050
|
types: Object.fromEntries(Object.entries(v26.types).map(([key2, val]) => {
|
|
1193789
1194051
|
return [key2, convertTypeDeclaration3(val)];
|
|
1193790
1194052
|
})),
|
|
1193791
|
-
headers: v26.headers.map((header) =>
|
|
1194053
|
+
headers: v26.headers.map((header) => convertHeader5(header)),
|
|
1193792
1194054
|
webhookGroups: Object.fromEntries(Object.entries(v26.webhookGroups).map(([key2, val]) => {
|
|
1193793
1194055
|
return [key2, val.map((webhook) => convertWebhook(webhook))];
|
|
1193794
1194056
|
})),
|
|
@@ -1193801,7 +1194063,7 @@ var V26_TO_V25_MIGRATION = {
|
|
|
1193801
1194063
|
function convertWebhook(val) {
|
|
1193802
1194064
|
return {
|
|
1193803
1194065
|
...val,
|
|
1193804
|
-
headers: val.headers.map((header) =>
|
|
1194066
|
+
headers: val.headers.map((header) => convertHeader5(header)),
|
|
1193805
1194067
|
availability: val.availability == null ? {
|
|
1193806
1194068
|
status: IrVersions_exports.V25.AvailabilityStatus.GeneralAvailability,
|
|
1193807
1194069
|
message: void 0
|
|
@@ -1193812,7 +1194074,7 @@ function convertHttpService4(val) {
|
|
|
1193812
1194074
|
return {
|
|
1193813
1194075
|
...val,
|
|
1193814
1194076
|
endpoints: val.endpoints.map((endpoint) => convertEndpoint9(endpoint)),
|
|
1193815
|
-
headers: val.headers.map((header) =>
|
|
1194077
|
+
headers: val.headers.map((header) => convertHeader5(header)),
|
|
1193816
1194078
|
availability: val.availability == null ? {
|
|
1193817
1194079
|
status: IrVersions_exports.V25.AvailabilityStatus.GeneralAvailability,
|
|
1193818
1194080
|
message: void 0
|
|
@@ -1193822,7 +1194084,7 @@ function convertHttpService4(val) {
|
|
|
1193822
1194084
|
function convertEndpoint9(val) {
|
|
1193823
1194085
|
return {
|
|
1193824
1194086
|
...val,
|
|
1193825
|
-
headers: val.headers.map((header) =>
|
|
1194087
|
+
headers: val.headers.map((header) => convertHeader5(header)),
|
|
1193826
1194088
|
queryParameters: val.queryParameters.map((query) => convertQueryParameter5(query)),
|
|
1193827
1194089
|
availability: val.availability == null ? {
|
|
1193828
1194090
|
status: IrVersions_exports.V25.AvailabilityStatus.GeneralAvailability,
|
|
@@ -1193830,7 +1194092,7 @@ function convertEndpoint9(val) {
|
|
|
1193830
1194092
|
} : val.availability
|
|
1193831
1194093
|
};
|
|
1193832
1194094
|
}
|
|
1193833
|
-
function
|
|
1194095
|
+
function convertHeader5(val) {
|
|
1193834
1194096
|
return {
|
|
1193835
1194097
|
...val,
|
|
1193836
1194098
|
availability: val.availability == null ? {
|
|
@@ -1196816,14 +1197078,14 @@ function convertAuth6(auth) {
|
|
|
1196816
1197078
|
case "bearer":
|
|
1196817
1197079
|
return IrVersions_exports.V44.auth.AuthScheme.bearer(scheme);
|
|
1196818
1197080
|
case "header":
|
|
1196819
|
-
return IrVersions_exports.V44.auth.AuthScheme.header(
|
|
1197081
|
+
return IrVersions_exports.V44.auth.AuthScheme.header(convertHeader6(scheme));
|
|
1196820
1197082
|
case "oauth":
|
|
1196821
1197083
|
return IrVersions_exports.V44.auth.AuthScheme.oauth(convertOAuth(scheme));
|
|
1196822
1197084
|
}
|
|
1196823
1197085
|
})
|
|
1196824
1197086
|
};
|
|
1196825
1197087
|
}
|
|
1196826
|
-
function
|
|
1197088
|
+
function convertHeader6(header) {
|
|
1196827
1197089
|
return {
|
|
1196828
1197090
|
...header,
|
|
1196829
1197091
|
valueType: convertTypeReference5(header.valueType)
|
|
@@ -1197802,7 +1198064,7 @@ function convertTypeReference6(typeReference) {
|
|
|
1197802
1198064
|
}
|
|
1197803
1198065
|
|
|
1197804
1198066
|
// pnp:/home/runner/work/fern/fern/packages/cli/generation/ir-migrations/lib/migrations/v5-to-v4/convertHeader.js
|
|
1197805
|
-
function
|
|
1198067
|
+
function convertHeader7(header) {
|
|
1197806
1198068
|
return {
|
|
1197807
1198069
|
name: convertNameAndWireValueToV1(header.name),
|
|
1197808
1198070
|
nameV2: convertNameAndWireValueToV2(header.name),
|
|
@@ -1197824,7 +1198086,7 @@ function convertAuthScheme6(scheme) {
|
|
|
1197824
1198086
|
return IrVersions_exports.V5.auth.AuthScheme._visit(scheme, {
|
|
1197825
1198087
|
basic: IrVersions_exports.V4.auth.AuthScheme.basic,
|
|
1197826
1198088
|
bearer: IrVersions_exports.V4.auth.AuthScheme.bearer,
|
|
1197827
|
-
header: (header) => IrVersions_exports.V4.auth.AuthScheme.header(
|
|
1198089
|
+
header: (header) => IrVersions_exports.V4.auth.AuthScheme.header(convertHeader7(header)),
|
|
1197828
1198090
|
_unknown: () => {
|
|
1197829
1198091
|
throw new Error("Unknown AuthScheme: " + scheme._type);
|
|
1197830
1198092
|
}
|
|
@@ -1197964,7 +1198226,7 @@ function convertService7({ service, errorResolver }) {
|
|
|
1197964
1198226
|
basePath: convertBasePathToString(service.basePath),
|
|
1197965
1198227
|
basePathV2: service.basePath,
|
|
1197966
1198228
|
endpoints: service.endpoints.map((endpoint) => convertEndpoint12({ endpoint, errorResolver })),
|
|
1197967
|
-
headers: service.headers.map((header) =>
|
|
1198229
|
+
headers: service.headers.map((header) => convertHeader7(header)),
|
|
1197968
1198230
|
pathParameters: service.pathParameters.map((pathParameter) => convertPathParameter8(pathParameter))
|
|
1197969
1198231
|
};
|
|
1197970
1198232
|
}
|
|
@@ -1197987,7 +1198249,7 @@ function convertEndpoint12({ endpoint, errorResolver }) {
|
|
|
1197987
1198249
|
nameV2: convertNameToV2(endpoint.name),
|
|
1197988
1198250
|
displayName: endpoint.displayName,
|
|
1197989
1198251
|
method: endpoint.method,
|
|
1197990
|
-
headers: endpoint.headers.map((header) =>
|
|
1198252
|
+
headers: endpoint.headers.map((header) => convertHeader7(header)),
|
|
1197991
1198253
|
path: endpoint.path,
|
|
1197992
1198254
|
pathParameters: endpoint.pathParameters.map((pathParameter) => convertPathParameter8(pathParameter)),
|
|
1197993
1198255
|
queryParameters: endpoint.queryParameters.map((queryParameter) => convertQueryParameter8(queryParameter)),
|
|
@@ -1198404,7 +1198666,7 @@ var V5_TO_V4_MIGRATION = {
|
|
|
1198404
1198666
|
apiDisplayName: v52.apiDisplayName,
|
|
1198405
1198667
|
apiDocs: v52.apiDocs,
|
|
1198406
1198668
|
auth: convertAuth7(v52.auth),
|
|
1198407
|
-
headers: v52.headers.map((header) =>
|
|
1198669
|
+
headers: v52.headers.map((header) => convertHeader7(header)),
|
|
1198408
1198670
|
types: v52.types.map((typeDeclaration) => convertTypeDeclaration5(typeDeclaration)),
|
|
1198409
1198671
|
services: {
|
|
1198410
1198672
|
http: v52.services.map((service) => convertService7({ service, errorResolver })),
|
|
@@ -1198667,14 +1198929,14 @@ function convertAuth8(auth) {
|
|
|
1198667
1198929
|
case "bearer":
|
|
1198668
1198930
|
return IrVersions_exports.V49.auth.AuthScheme.bearer(scheme);
|
|
1198669
1198931
|
case "header":
|
|
1198670
|
-
return IrVersions_exports.V49.auth.AuthScheme.header(
|
|
1198932
|
+
return IrVersions_exports.V49.auth.AuthScheme.header(convertHeader8(scheme));
|
|
1198671
1198933
|
case "oauth":
|
|
1198672
1198934
|
return IrVersions_exports.V49.auth.AuthScheme.oauth(convertOAuth2(scheme));
|
|
1198673
1198935
|
}
|
|
1198674
1198936
|
})
|
|
1198675
1198937
|
};
|
|
1198676
1198938
|
}
|
|
1198677
|
-
function
|
|
1198939
|
+
function convertHeader8(header) {
|
|
1198678
1198940
|
return {
|
|
1198679
1198941
|
...header,
|
|
1198680
1198942
|
valueType: convertTypeReference7(header.valueType)
|
|
@@ -1199228,7 +1199490,7 @@ var V8_TO_V7_MIGRATION = {
|
|
|
1199228
1199490
|
return {
|
|
1199229
1199491
|
...v8,
|
|
1199230
1199492
|
auth: convertAuth9(v8.auth),
|
|
1199231
|
-
headers: v8.headers.map((header) =>
|
|
1199493
|
+
headers: v8.headers.map((header) => convertHeader9(header)),
|
|
1199232
1199494
|
types: v8.types.map((type2) => convertTypeDeclaration6(type2)),
|
|
1199233
1199495
|
errors: v8.errors.map((error) => convertErrorDeclaration8(error)),
|
|
1199234
1199496
|
services: v8.services.map((service) => convertHttpService9(service))
|
|
@@ -1199246,11 +1199508,11 @@ function convertAuth9(auth) {
|
|
|
1199246
1199508
|
if (scheme._type !== "header") {
|
|
1199247
1199509
|
return scheme;
|
|
1199248
1199510
|
}
|
|
1199249
|
-
return IrVersions_exports.V7.auth.AuthScheme.header(
|
|
1199511
|
+
return IrVersions_exports.V7.auth.AuthScheme.header(convertHeader9(scheme));
|
|
1199250
1199512
|
})
|
|
1199251
1199513
|
};
|
|
1199252
1199514
|
}
|
|
1199253
|
-
function
|
|
1199515
|
+
function convertHeader9(header) {
|
|
1199254
1199516
|
return {
|
|
1199255
1199517
|
docs: header.docs,
|
|
1199256
1199518
|
availability: header.availability,
|
|
@@ -1199462,7 +1199724,7 @@ function convertHttpService9(service) {
|
|
|
1199462
1199724
|
basePath: service.basePath,
|
|
1199463
1199725
|
baseUrl: service.baseUrl,
|
|
1199464
1199726
|
pathParameters: service.pathParameters.map((pathParameter) => convertPathParameter10(pathParameter)),
|
|
1199465
|
-
headers: service.headers.map((header) =>
|
|
1199727
|
+
headers: service.headers.map((header) => convertHeader9(header)),
|
|
1199466
1199728
|
endpoints: service.endpoints.map((endpoint) => convertEndpoint14(endpoint))
|
|
1199467
1199729
|
};
|
|
1199468
1199730
|
}
|
|
@@ -1199488,7 +1199750,7 @@ function convertEndpoint14(endpoint) {
|
|
|
1199488
1199750
|
sdkRequest: endpoint.sdkRequest != null ? convertSdkRequest7(endpoint.sdkRequest) : void 0,
|
|
1199489
1199751
|
requestBody: endpoint.requestBody != null ? convertRequestBody8(endpoint.requestBody) : void 0,
|
|
1199490
1199752
|
response: convertHttpResponse8(endpoint.response),
|
|
1199491
|
-
headers: endpoint.headers.map((header) =>
|
|
1199753
|
+
headers: endpoint.headers.map((header) => convertHeader9(header)),
|
|
1199492
1199754
|
queryParameters: endpoint.queryParameters.map((queryParameter) => convertQueryParameter10(queryParameter)),
|
|
1199493
1199755
|
examples: endpoint.examples.map((example) => convertExampleEndpointCall9(example))
|
|
1199494
1199756
|
};
|
|
@@ -1204671,7 +1204933,7 @@ async function loadAndUpdateGenerators({
|
|
|
1204671
1204933
|
return void 0;
|
|
1204672
1204934
|
}
|
|
1204673
1204935
|
const contents = await (0, import_promises76.readFile)(filepath);
|
|
1204674
|
-
context.logger.
|
|
1204936
|
+
context.logger.debug(`Found generators: ${contents.toString()}`);
|
|
1204675
1204937
|
const parsedDocument = import_yaml10.default.parseDocument(contents.toString());
|
|
1204676
1204938
|
const generatorGroups = parsedDocument.get("groups");
|
|
1204677
1204939
|
if (generatorGroups == null) {
|
|
@@ -1204682,7 +1204944,7 @@ async function loadAndUpdateGenerators({
|
|
|
1204682
1204944
|
context.failAndThrow(`Expected 'groups' to be a map in ${import_path42.default.relative(process.cwd(), filepath)}`);
|
|
1204683
1204945
|
return void 0;
|
|
1204684
1204946
|
}
|
|
1204685
|
-
context.logger.
|
|
1204947
|
+
context.logger.debug(`Groups found: ${generatorGroups.toString()}`);
|
|
1204686
1204948
|
for (const groupBlock of generatorGroups.items) {
|
|
1204687
1204949
|
const groupName = groupBlock.key;
|
|
1204688
1204950
|
const group = groupBlock.value;
|
|
@@ -1204702,7 +1204964,7 @@ async function loadAndUpdateGenerators({
|
|
|
1204702
1204964
|
);
|
|
1204703
1204965
|
continue;
|
|
1204704
1204966
|
}
|
|
1204705
|
-
context.logger.
|
|
1204967
|
+
context.logger.debug(`Generators found: ${generators.toString()}`);
|
|
1204706
1204968
|
for (const generator of generators.items) {
|
|
1204707
1204969
|
if (!import_yaml10.default.isMap(generator)) {
|
|
1204708
1204970
|
context.failAndThrow(
|
|
@@ -1204716,7 +1204978,7 @@ async function loadAndUpdateGenerators({
|
|
|
1204716
1204978
|
const normalizedGeneratorName = generators_yml_exports.getGeneratorNameOrThrow(generatorName, context);
|
|
1204717
1204979
|
const currentVersion = generator.get("version");
|
|
1204718
1204980
|
const latestVersion2 = await generators_yml_exports.getLatestGeneratorVersion(normalizedGeneratorName, context);
|
|
1204719
|
-
context.logger.
|
|
1204981
|
+
context.logger.debug(`${generatorName}, ${currentVersion}, ${latestVersion2}`);
|
|
1204720
1204982
|
if (latestVersion2 == null) {
|
|
1204721
1204983
|
continue;
|
|
1204722
1204984
|
}
|