fern-api 0.23.0-rc5 → 0.23.0-rc7
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 +288 -203
- package/package.json +1 -1
package/bundle.cjs
CHANGED
|
@@ -341328,6 +341328,12 @@ var init_HeaderExample = __esm({
|
|
|
341328
341328
|
}
|
|
341329
341329
|
});
|
|
341330
341330
|
|
|
341331
|
+
// pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/api/resources/finalIr/types/ErrorExample.js
|
|
341332
|
+
var init_ErrorExample = __esm({
|
|
341333
|
+
"pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/api/resources/finalIr/types/ErrorExample.js"() {
|
|
341334
|
+
}
|
|
341335
|
+
});
|
|
341336
|
+
|
|
341331
341337
|
// pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/api/resources/finalIr/types/EndpointSdkName.js
|
|
341332
341338
|
var init_EndpointSdkName = __esm({
|
|
341333
341339
|
"pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/api/resources/finalIr/types/EndpointSdkName.js"() {
|
|
@@ -342062,6 +342068,7 @@ var init_types28 = __esm({
|
|
|
342062
342068
|
init_PathParameterExample();
|
|
342063
342069
|
init_QueryParameterExample();
|
|
342064
342070
|
init_HeaderExample();
|
|
342071
|
+
init_ErrorExample();
|
|
342065
342072
|
init_EndpointSdkName();
|
|
342066
342073
|
init_HttpMethod3();
|
|
342067
342074
|
init_PathParameter3();
|
|
@@ -342128,6 +342135,12 @@ var init_EndpointWithExample = __esm({
|
|
|
342128
342135
|
}
|
|
342129
342136
|
});
|
|
342130
342137
|
|
|
342138
|
+
// pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/api/resources/parseIr/types/HttpErrorWithExample.js
|
|
342139
|
+
var init_HttpErrorWithExample = __esm({
|
|
342140
|
+
"pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/api/resources/parseIr/types/HttpErrorWithExample.js"() {
|
|
342141
|
+
}
|
|
342142
|
+
});
|
|
342143
|
+
|
|
342131
342144
|
// pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/api/resources/parseIr/types/RequestWithExample.js
|
|
342132
342145
|
var RequestWithExample;
|
|
342133
342146
|
var init_RequestWithExample = __esm({
|
|
@@ -342711,6 +342724,7 @@ var init_types29 = __esm({
|
|
|
342711
342724
|
init_NamedFullExample();
|
|
342712
342725
|
init_WebsocketHandshakeWithExample();
|
|
342713
342726
|
init_EndpointWithExample();
|
|
342727
|
+
init_HttpErrorWithExample();
|
|
342714
342728
|
init_RequestWithExample();
|
|
342715
342729
|
init_JsonRequestWithExample();
|
|
342716
342730
|
init_ResponseWithExample();
|
|
@@ -344773,7 +344787,6 @@ var init_OpenApiIntermediateRepresentation2 = __esm({
|
|
|
344773
344787
|
webhooks: schemas_exports5.list(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).Webhook)),
|
|
344774
344788
|
channel: schemas_exports5.list(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).WebsocketChannel)),
|
|
344775
344789
|
schemas: schemas_exports5.record(schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).SchemaId), schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).Schema)),
|
|
344776
|
-
errors: schemas_exports5.record(schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).StatusCode), schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).HttpError)),
|
|
344777
344790
|
variables: schemas_exports5.record(schemas_exports5.string(), schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).PrimitiveSchema)),
|
|
344778
344791
|
nonRequestReferencedSchemas: schemas_exports5.set(schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).SchemaId)),
|
|
344779
344792
|
securitySchemes: schemas_exports5.record(schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).SecuritySchemeId), schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).SecurityScheme)),
|
|
@@ -344827,7 +344840,8 @@ var init_HttpError2 = __esm({
|
|
|
344827
344840
|
"pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/serialization/resources/finalIr/types/HttpError.js"() {
|
|
344828
344841
|
init_core3();
|
|
344829
344842
|
HttpError = schemas_exports5.objectWithoutOptionalProperties({
|
|
344830
|
-
schema: schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).Schema).optional()
|
|
344843
|
+
schema: schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).Schema).optional(),
|
|
344844
|
+
examples: schemas_exports5.list(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).ErrorExample)).optional()
|
|
344831
344845
|
}).extend(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).WithDescription)).extend(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).WithName));
|
|
344832
344846
|
}
|
|
344833
344847
|
});
|
|
@@ -344946,7 +344960,7 @@ var init_Endpoint2 = __esm({
|
|
|
344946
344960
|
requestNameOverride: schemas_exports5.string().optional(),
|
|
344947
344961
|
request: schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).Request).optional(),
|
|
344948
344962
|
response: schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).Response).optional(),
|
|
344949
|
-
|
|
344963
|
+
errors: schemas_exports5.record(schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).StatusCode), schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).HttpError)),
|
|
344950
344964
|
server: schemas_exports5.list(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).Server)),
|
|
344951
344965
|
examples: schemas_exports5.list(schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).EndpointExample))
|
|
344952
344966
|
}).extend(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).WithDescription));
|
|
@@ -345119,6 +345133,19 @@ var init_HeaderExample2 = __esm({
|
|
|
345119
345133
|
}
|
|
345120
345134
|
});
|
|
345121
345135
|
|
|
345136
|
+
// pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/serialization/resources/finalIr/types/ErrorExample.js
|
|
345137
|
+
var ErrorExample;
|
|
345138
|
+
var init_ErrorExample2 = __esm({
|
|
345139
|
+
"pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/serialization/resources/finalIr/types/ErrorExample.js"() {
|
|
345140
|
+
init_core3();
|
|
345141
|
+
ErrorExample = schemas_exports5.objectWithoutOptionalProperties({
|
|
345142
|
+
name: schemas_exports5.string().optional(),
|
|
345143
|
+
description: schemas_exports5.string().optional(),
|
|
345144
|
+
example: schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).FullExample)
|
|
345145
|
+
});
|
|
345146
|
+
}
|
|
345147
|
+
});
|
|
345148
|
+
|
|
345122
345149
|
// pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/serialization/resources/finalIr/types/EndpointSdkName.js
|
|
345123
345150
|
var EndpointSdkName;
|
|
345124
345151
|
var init_EndpointSdkName2 = __esm({
|
|
@@ -345756,6 +345783,7 @@ var init_types32 = __esm({
|
|
|
345756
345783
|
init_PathParameterExample2();
|
|
345757
345784
|
init_QueryParameterExample2();
|
|
345758
345785
|
init_HeaderExample2();
|
|
345786
|
+
init_ErrorExample2();
|
|
345759
345787
|
init_EndpointSdkName2();
|
|
345760
345788
|
init_HttpMethod4();
|
|
345761
345789
|
init_PathParameter4();
|
|
@@ -345814,6 +345842,7 @@ __export(finalIr_exports2, {
|
|
|
345814
345842
|
EndpointSdkName: () => EndpointSdkName,
|
|
345815
345843
|
EnumSchema: () => EnumSchema2,
|
|
345816
345844
|
EnumValue: () => EnumValue2,
|
|
345845
|
+
ErrorExample: () => ErrorExample,
|
|
345817
345846
|
FernExample: () => FernExample,
|
|
345818
345847
|
FileResponse: () => FileResponse,
|
|
345819
345848
|
FileSchema: () => FileSchema,
|
|
@@ -345876,7 +345905,7 @@ var init_NamedFullExample2 = __esm({
|
|
|
345876
345905
|
NamedFullExample = schemas_exports5.objectWithoutOptionalProperties({
|
|
345877
345906
|
name: schemas_exports5.string().optional(),
|
|
345878
345907
|
value: schemas_exports5.unknown()
|
|
345879
|
-
});
|
|
345908
|
+
}).extend(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).WithDescription));
|
|
345880
345909
|
}
|
|
345881
345910
|
});
|
|
345882
345911
|
|
|
@@ -345915,13 +345944,26 @@ var init_EndpointWithExample2 = __esm({
|
|
|
345915
345944
|
requestNameOverride: schemas_exports5.string().optional(),
|
|
345916
345945
|
request: schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).RequestWithExample).optional(),
|
|
345917
345946
|
response: schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).ResponseWithExample).optional(),
|
|
345918
|
-
|
|
345947
|
+
errors: schemas_exports5.record(schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).StatusCode), schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).HttpErrorWithExample)),
|
|
345919
345948
|
server: schemas_exports5.list(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).Server)),
|
|
345920
345949
|
examples: schemas_exports5.list(schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).EndpointExample))
|
|
345921
345950
|
}).extend(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).WithDescription));
|
|
345922
345951
|
}
|
|
345923
345952
|
});
|
|
345924
345953
|
|
|
345954
|
+
// pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/serialization/resources/parseIr/types/HttpErrorWithExample.js
|
|
345955
|
+
var HttpErrorWithExample;
|
|
345956
|
+
var init_HttpErrorWithExample2 = __esm({
|
|
345957
|
+
"pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/serialization/resources/parseIr/types/HttpErrorWithExample.js"() {
|
|
345958
|
+
init_core3();
|
|
345959
|
+
HttpErrorWithExample = schemas_exports5.objectWithoutOptionalProperties({
|
|
345960
|
+
statusCode: schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).StatusCode),
|
|
345961
|
+
schema: schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).SchemaWithExample),
|
|
345962
|
+
fullExamples: schemas_exports5.list(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).NamedFullExample)).optional()
|
|
345963
|
+
}).extend(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).WithDescription)).extend(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).WithName));
|
|
345964
|
+
}
|
|
345965
|
+
});
|
|
345966
|
+
|
|
345925
345967
|
// pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/serialization/resources/parseIr/types/RequestWithExample.js
|
|
345926
345968
|
var RequestWithExample2;
|
|
345927
345969
|
var init_RequestWithExample2 = __esm({
|
|
@@ -346430,6 +346472,7 @@ var init_types33 = __esm({
|
|
|
346430
346472
|
init_NamedFullExample2();
|
|
346431
346473
|
init_WebsocketHandshakeWithExample2();
|
|
346432
346474
|
init_EndpointWithExample2();
|
|
346475
|
+
init_HttpErrorWithExample2();
|
|
346433
346476
|
init_RequestWithExample2();
|
|
346434
346477
|
init_JsonRequestWithExample2();
|
|
346435
346478
|
init_ResponseWithExample2();
|
|
@@ -346479,6 +346522,7 @@ __export(parseIr_exports2, {
|
|
|
346479
346522
|
EnumSchemaWithExample: () => EnumSchemaWithExample,
|
|
346480
346523
|
FloatWithExample: () => FloatWithExample,
|
|
346481
346524
|
HeaderWithExample: () => HeaderWithExample,
|
|
346525
|
+
HttpErrorWithExample: () => HttpErrorWithExample,
|
|
346482
346526
|
Int64WithExample: () => Int64WithExample,
|
|
346483
346527
|
IntWithExample: () => IntWithExample,
|
|
346484
346528
|
JsonRequestWithExample: () => JsonRequestWithExample,
|
|
@@ -346551,6 +346595,7 @@ __export(serialization_exports3, {
|
|
|
346551
346595
|
EnumSchema: () => EnumSchema2,
|
|
346552
346596
|
EnumSchemaWithExample: () => EnumSchemaWithExample,
|
|
346553
346597
|
EnumValue: () => EnumValue2,
|
|
346598
|
+
ErrorExample: () => ErrorExample,
|
|
346554
346599
|
FernExample: () => FernExample,
|
|
346555
346600
|
FileResponse: () => FileResponse,
|
|
346556
346601
|
FileSchema: () => FileSchema,
|
|
@@ -346565,6 +346610,7 @@ __export(serialization_exports3, {
|
|
|
346565
346610
|
HeaderSecurityScheme: () => HeaderSecurityScheme,
|
|
346566
346611
|
HeaderWithExample: () => HeaderWithExample,
|
|
346567
346612
|
HttpError: () => HttpError,
|
|
346613
|
+
HttpErrorWithExample: () => HttpErrorWithExample,
|
|
346568
346614
|
HttpMethod: () => HttpMethod6,
|
|
346569
346615
|
Int64WithExample: () => Int64WithExample,
|
|
346570
346616
|
IntWithExample: () => IntWithExample,
|
|
@@ -852804,7 +852850,7 @@ var AccessTokenPosthogManager = class {
|
|
|
852804
852850
|
properties: {
|
|
852805
852851
|
...event,
|
|
852806
852852
|
...event.properties,
|
|
852807
|
-
version: "0.23.0-
|
|
852853
|
+
version: "0.23.0-rc7",
|
|
852808
852854
|
usingAccessToken: true
|
|
852809
852855
|
}
|
|
852810
852856
|
});
|
|
@@ -852866,7 +852912,7 @@ var UserPosthogManager = class {
|
|
|
852866
852912
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
852867
852913
|
event: "CLI",
|
|
852868
852914
|
properties: {
|
|
852869
|
-
version: "0.23.0-
|
|
852915
|
+
version: "0.23.0-rc7",
|
|
852870
852916
|
...event,
|
|
852871
852917
|
...event.properties
|
|
852872
852918
|
}
|
|
@@ -867110,11 +867156,11 @@ function convertSchemaObject(schema2, wrapAsNullable, context, breadcrumbs, prop
|
|
|
867110
867156
|
const examples = getExtension(schema2, OpenAPIExtension.EXAMPLES);
|
|
867111
867157
|
const fullExamples = [];
|
|
867112
867158
|
if (schema2.example != null) {
|
|
867113
|
-
fullExamples.push({ name: void 0, value: schema2.example });
|
|
867159
|
+
fullExamples.push({ name: void 0, value: schema2.example, description: void 0 });
|
|
867114
867160
|
}
|
|
867115
867161
|
if (examples != null && Object.keys(examples).length > 0) {
|
|
867116
867162
|
fullExamples.push(...Object.entries(examples).map(([name2, value]) => {
|
|
867117
|
-
return { name: value.summary ?? name2, value: value.value };
|
|
867163
|
+
return { name: value.summary ?? name2, value: value.value, description: value.description };
|
|
867118
867164
|
}));
|
|
867119
867165
|
}
|
|
867120
867166
|
const fernSchema = getFernTypeExtension({ schema: schema2, description, nameOverride, generatedName });
|
|
@@ -869568,32 +869614,51 @@ function getApplicationJsonSchemaMediaObject(media, context) {
|
|
|
869568
869614
|
continue;
|
|
869569
869615
|
}
|
|
869570
869616
|
const schema2 = mediaObject.schema;
|
|
869571
|
-
|
|
869572
|
-
|
|
869573
|
-
|
|
869574
|
-
}
|
|
869575
|
-
const examples = getExtension(mediaObject, OpenAPIExtension.EXAMPLES);
|
|
869576
|
-
if (examples != null && Object.keys(examples).length > 0) {
|
|
869577
|
-
fullExamples.push(...Object.entries(examples).map(([name2, value]) => {
|
|
869578
|
-
return { name: value.summary ?? name2, value: value.value };
|
|
869579
|
-
}));
|
|
869580
|
-
}
|
|
869581
|
-
if (mediaObject.examples != null && Object.keys(mediaObject.examples).length > 0) {
|
|
869582
|
-
fullExamples.push(...Object.entries(mediaObject.examples).map(([name2, example]) => {
|
|
869583
|
-
const resolvedExample = isReferenceObject(example) ? context.resolveExampleReference(example) : example;
|
|
869584
|
-
return { name: resolvedExample.summary ?? name2, value: resolvedExample.value };
|
|
869585
|
-
}));
|
|
869586
|
-
}
|
|
869587
|
-
if (schema2 != null) {
|
|
869588
|
-
return {
|
|
869589
|
-
schema: schema2,
|
|
869590
|
-
examples: fullExamples
|
|
869591
|
-
};
|
|
869592
|
-
}
|
|
869617
|
+
return {
|
|
869618
|
+
schema: schema2 ?? {},
|
|
869619
|
+
examples: getExamples(mediaObject, context)
|
|
869620
|
+
};
|
|
869593
869621
|
}
|
|
869594
869622
|
}
|
|
869595
869623
|
return void 0;
|
|
869596
869624
|
}
|
|
869625
|
+
function getSchemaMediaObject(media, context) {
|
|
869626
|
+
for (const contentType of Object.keys(media)) {
|
|
869627
|
+
const mediaObject = media[contentType];
|
|
869628
|
+
if (mediaObject == null) {
|
|
869629
|
+
continue;
|
|
869630
|
+
}
|
|
869631
|
+
const schema2 = mediaObject.schema;
|
|
869632
|
+
return {
|
|
869633
|
+
schema: schema2 ?? {},
|
|
869634
|
+
examples: getExamples(mediaObject, context)
|
|
869635
|
+
};
|
|
869636
|
+
}
|
|
869637
|
+
return void 0;
|
|
869638
|
+
}
|
|
869639
|
+
function getExamples(mediaObject, context) {
|
|
869640
|
+
const fullExamples = [];
|
|
869641
|
+
if (mediaObject.example != null) {
|
|
869642
|
+
fullExamples.push({ name: void 0, value: mediaObject.example, description: void 0 });
|
|
869643
|
+
}
|
|
869644
|
+
const examples = getExtension(mediaObject, OpenAPIExtension.EXAMPLES);
|
|
869645
|
+
if (examples != null && Object.keys(examples).length > 0) {
|
|
869646
|
+
fullExamples.push(...Object.entries(examples).map(([name2, value]) => {
|
|
869647
|
+
return { name: value.summary ?? name2, value: value.value, description: value.description };
|
|
869648
|
+
}));
|
|
869649
|
+
}
|
|
869650
|
+
if (mediaObject.examples != null && Object.keys(mediaObject.examples).length > 0) {
|
|
869651
|
+
fullExamples.push(...Object.entries(mediaObject.examples).map(([name2, example]) => {
|
|
869652
|
+
const resolvedExample = isReferenceObject(example) ? context.resolveExampleReference(example) : example;
|
|
869653
|
+
return {
|
|
869654
|
+
name: resolvedExample.summary ?? name2,
|
|
869655
|
+
value: resolvedExample.value,
|
|
869656
|
+
description: resolvedExample.description
|
|
869657
|
+
};
|
|
869658
|
+
}));
|
|
869659
|
+
}
|
|
869660
|
+
return fullExamples;
|
|
869661
|
+
}
|
|
869597
869662
|
|
|
869598
869663
|
// pnp:/home/circleci/project/packages/cli/openapi-parser/lib/openapi/v3/converters/endpoint/convertRequest.js
|
|
869599
869664
|
var APPLICATION_JSON_CONTENT = "application/json";
|
|
@@ -869881,18 +869946,12 @@ var DummyOpenAPIV3ParserContext = class extends AbstractOpenAPIV3ParserContext {
|
|
|
869881
869946
|
getReferencedSchemas() {
|
|
869882
869947
|
return /* @__PURE__ */ new Set();
|
|
869883
869948
|
}
|
|
869884
|
-
markSchemaForStatusCode(_statusCode, _schema) {
|
|
869885
|
-
return;
|
|
869886
|
-
}
|
|
869887
869949
|
markReferencedByDiscriminatedUnion(_schema, _discrminant, _times) {
|
|
869888
869950
|
return;
|
|
869889
869951
|
}
|
|
869890
869952
|
getReferencesFromDiscriminatedUnion(_schema) {
|
|
869891
869953
|
return void 0;
|
|
869892
869954
|
}
|
|
869893
|
-
getErrors() {
|
|
869894
|
-
return {};
|
|
869895
|
-
}
|
|
869896
869955
|
excludeSchema(_schemaId) {
|
|
869897
869956
|
}
|
|
869898
869957
|
isSchemaExcluded(_schemaId) {
|
|
@@ -870079,6 +870138,59 @@ var HEADERS_TO_SKIP = /* @__PURE__ */ new Set([
|
|
|
870079
870138
|
"X-Ping-Custom-Domain"
|
|
870080
870139
|
]);
|
|
870081
870140
|
|
|
870141
|
+
// pnp:/home/circleci/project/packages/cli/openapi-parser/lib/openapi/v3/converters/convertToHttpError.js
|
|
870142
|
+
var ERROR_NAMES_BY_STATUS_CODE = {
|
|
870143
|
+
400: "BadRequestError",
|
|
870144
|
+
401: "UnauthorizedError",
|
|
870145
|
+
402: "PaymentRequiredError",
|
|
870146
|
+
403: "ForbiddenError",
|
|
870147
|
+
404: "NotFoundError",
|
|
870148
|
+
405: "MethodNotAllowedError",
|
|
870149
|
+
406: "NotAcceptableError",
|
|
870150
|
+
407: "ProxyAuthenticationRequiredError",
|
|
870151
|
+
408: "RequestTimeoutError",
|
|
870152
|
+
409: "ConflictError",
|
|
870153
|
+
410: "GoneError",
|
|
870154
|
+
411: "LengthRequiredError",
|
|
870155
|
+
412: "PreconditionFailedError",
|
|
870156
|
+
413: "ContentTooLargeError",
|
|
870157
|
+
414: "URITooLongError",
|
|
870158
|
+
415: "UnsupportedMediaTypeError",
|
|
870159
|
+
416: "RangeNotSatisfiableError",
|
|
870160
|
+
417: "ExpectationFailedError",
|
|
870161
|
+
418: "ImATeapotError",
|
|
870162
|
+
419: "AuthenticationTimeoutError",
|
|
870163
|
+
420: "MethodFailureError",
|
|
870164
|
+
421: "MisdirectedRequestError",
|
|
870165
|
+
422: "UnprocessableEntityError",
|
|
870166
|
+
423: "LockedError",
|
|
870167
|
+
424: "FailedDependencyError",
|
|
870168
|
+
425: "TooEarlyError",
|
|
870169
|
+
426: "UpgradeRequiredError",
|
|
870170
|
+
428: "PreconditionError",
|
|
870171
|
+
429: "TooManyRequestsError",
|
|
870172
|
+
430: "RequestHeaderFieldsTooLargeError",
|
|
870173
|
+
431: "RequestHeaderFieldsTooLargeError",
|
|
870174
|
+
444: "NoResponseError",
|
|
870175
|
+
449: "RetryWithError",
|
|
870176
|
+
450: "BlockedByWindowsParentalControlsError",
|
|
870177
|
+
451: "UnavailableForLegalReasonsError",
|
|
870178
|
+
499: "ClientClosedRequestError",
|
|
870179
|
+
500: "InternalServerError",
|
|
870180
|
+
501: "NotImplementedError",
|
|
870181
|
+
502: "BadGatewayError",
|
|
870182
|
+
503: "ServiceUnavailableError",
|
|
870183
|
+
504: "GatewayTimeoutError",
|
|
870184
|
+
505: "HTTPVersionNotSupportedError",
|
|
870185
|
+
506: "VariantAlsoNegotiatesError",
|
|
870186
|
+
507: "InsufficientStorageError",
|
|
870187
|
+
508: "LoopDetectedError",
|
|
870188
|
+
509: "BandwidthLimitExceededError",
|
|
870189
|
+
510: "NotExtendedError",
|
|
870190
|
+
511: "NetworkAuthenticationRequiredError"
|
|
870191
|
+
};
|
|
870192
|
+
var ERROR_NAMES = new Set(Object.values(ERROR_NAMES_BY_STATUS_CODE));
|
|
870193
|
+
|
|
870082
870194
|
// pnp:/home/circleci/project/packages/cli/openapi-parser/lib/openapi/v3/converters/endpoint/convertResponse.js
|
|
870083
870195
|
var APPLICATION_OCTET_STREAM_CONTENT = "application/octet-stream";
|
|
870084
870196
|
var APPLICATION_PDF = "application/pdf";
|
|
@@ -870087,9 +870199,9 @@ var TEXT_PLAIN_CONTENT = "text/plain";
|
|
|
870087
870199
|
var SUCCESSFUL_STATUS_CODES = ["200", "201", "204"];
|
|
870088
870200
|
function convertResponse({ operationContext, responses, context, responseBreadcrumbs, responseStatusCode, streamFormat }) {
|
|
870089
870201
|
if (responses == null) {
|
|
870090
|
-
return { value: void 0,
|
|
870202
|
+
return { value: void 0, errors: {} };
|
|
870091
870203
|
}
|
|
870092
|
-
const
|
|
870204
|
+
const errors = markErrorSchemas({ responses, context });
|
|
870093
870205
|
for (const statusCode of responseStatusCode != null ? [responseStatusCode] : SUCCESSFUL_STATUS_CODES) {
|
|
870094
870206
|
const response = responses[statusCode];
|
|
870095
870207
|
if (response == null) {
|
|
@@ -870107,20 +870219,20 @@ function convertResponse({ operationContext, responses, context, responseBreadcr
|
|
|
870107
870219
|
case "json":
|
|
870108
870220
|
return {
|
|
870109
870221
|
value: convertedResponse,
|
|
870110
|
-
|
|
870222
|
+
errors
|
|
870111
870223
|
};
|
|
870112
870224
|
case "streamingJson":
|
|
870113
870225
|
case "streamingSse":
|
|
870114
870226
|
return {
|
|
870115
870227
|
value: convertedResponse,
|
|
870116
|
-
|
|
870228
|
+
errors
|
|
870117
870229
|
};
|
|
870118
870230
|
case "file":
|
|
870119
870231
|
case "text":
|
|
870120
870232
|
case "streamingText":
|
|
870121
870233
|
return {
|
|
870122
870234
|
value: convertedResponse,
|
|
870123
|
-
|
|
870235
|
+
errors
|
|
870124
870236
|
};
|
|
870125
870237
|
default:
|
|
870126
870238
|
assertNever(convertedResponse);
|
|
@@ -870129,11 +870241,11 @@ function convertResponse({ operationContext, responses, context, responseBreadcr
|
|
|
870129
870241
|
}
|
|
870130
870242
|
return {
|
|
870131
870243
|
value: void 0,
|
|
870132
|
-
|
|
870244
|
+
errors
|
|
870133
870245
|
};
|
|
870134
870246
|
}
|
|
870135
870247
|
function convertResolvedResponse({ operationContext, streamFormat, response, context, responseBreadcrumbs }) {
|
|
870136
|
-
var _a5, _b4, _c4, _d2, _e
|
|
870248
|
+
var _a5, _b4, _c4, _d2, _e;
|
|
870137
870249
|
const resolvedResponse = isReferenceObject(response) ? context.resolveResponseReference(response) : response;
|
|
870138
870250
|
if (resolvedResponse.content != null) {
|
|
870139
870251
|
const isdownloadFile = Object.entries(resolvedResponse.content).find(([_4, mediaObject]) => {
|
|
@@ -870172,30 +870284,30 @@ function convertResolvedResponse({ operationContext, streamFormat, response, con
|
|
|
870172
870284
|
fullExamples: jsonMediaObject.examples
|
|
870173
870285
|
});
|
|
870174
870286
|
}
|
|
870175
|
-
if (((
|
|
870287
|
+
if (((_a5 = resolvedResponse.content) == null ? void 0 : _a5[APPLICATION_OCTET_STREAM_CONTENT]) != null) {
|
|
870176
870288
|
return ResponseWithExample.file({ description: resolvedResponse.description });
|
|
870177
870289
|
}
|
|
870178
|
-
if (((
|
|
870290
|
+
if (((_b4 = resolvedResponse.content) == null ? void 0 : _b4[APPLICATION_PDF]) != null) {
|
|
870179
870291
|
return ResponseWithExample.file({ description: resolvedResponse.description });
|
|
870180
870292
|
}
|
|
870181
|
-
if (((
|
|
870182
|
-
const textPlainSchema = (
|
|
870293
|
+
if (((_c4 = resolvedResponse.content) == null ? void 0 : _c4[TEXT_PLAIN_CONTENT]) != null) {
|
|
870294
|
+
const textPlainSchema = (_d2 = resolvedResponse.content[TEXT_PLAIN_CONTENT]) == null ? void 0 : _d2.schema;
|
|
870183
870295
|
if (textPlainSchema == null) {
|
|
870184
870296
|
return ResponseWithExample.text({ description: resolvedResponse.description });
|
|
870185
870297
|
}
|
|
870186
870298
|
const resolvedTextPlainSchema = isReferenceObject(textPlainSchema) ? context.resolveSchemaReference(textPlainSchema) : textPlainSchema;
|
|
870187
870299
|
if (resolvedTextPlainSchema.type === "string" && resolvedTextPlainSchema.format === "byte") {
|
|
870188
|
-
return;
|
|
870300
|
+
return ResponseWithExample.file({ description: resolvedResponse.description });
|
|
870189
870301
|
}
|
|
870190
870302
|
return ResponseWithExample.text({ description: resolvedResponse.description });
|
|
870191
870303
|
}
|
|
870192
|
-
if (((
|
|
870304
|
+
if (((_e = resolvedResponse.content) == null ? void 0 : _e[AUDIO_MPEG]) != null) {
|
|
870193
870305
|
return ResponseWithExample.file({ description: resolvedResponse.description });
|
|
870194
870306
|
}
|
|
870195
870307
|
return void 0;
|
|
870196
870308
|
}
|
|
870197
870309
|
function markErrorSchemas({ responses, context }) {
|
|
870198
|
-
const
|
|
870310
|
+
const errors = {};
|
|
870199
870311
|
for (const [statusCode, response] of Object.entries(responses)) {
|
|
870200
870312
|
if (statusCode === "default") {
|
|
870201
870313
|
continue;
|
|
@@ -870204,12 +870316,23 @@ function markErrorSchemas({ responses, context }) {
|
|
|
870204
870316
|
if (parsedStatusCode < 400 || parsedStatusCode > 600) {
|
|
870205
870317
|
continue;
|
|
870206
870318
|
}
|
|
870207
|
-
errorStatusCodes.push(parsedStatusCode);
|
|
870208
870319
|
const resolvedResponse = isReferenceObject(response) ? context.resolveResponseReference(response) : response;
|
|
870209
|
-
const
|
|
870210
|
-
|
|
870320
|
+
const mediaObject = getSchemaMediaObject(resolvedResponse.content ?? {}, context);
|
|
870321
|
+
const errorName = ERROR_NAMES_BY_STATUS_CODE[parsedStatusCode];
|
|
870322
|
+
if (errorName == null) {
|
|
870323
|
+
context.logger.warn(`No error name found for status code ${statusCode}`);
|
|
870324
|
+
continue;
|
|
870325
|
+
}
|
|
870326
|
+
errors[parsedStatusCode] = {
|
|
870327
|
+
statusCode: parsedStatusCode,
|
|
870328
|
+
nameOverride: void 0,
|
|
870329
|
+
generatedName: errorName,
|
|
870330
|
+
description: resolvedResponse.description,
|
|
870331
|
+
schema: convertSchema((mediaObject == null ? void 0 : mediaObject.schema) ?? {}, false, context, [errorName, "Body"]),
|
|
870332
|
+
fullExamples: mediaObject == null ? void 0 : mediaObject.examples
|
|
870333
|
+
};
|
|
870211
870334
|
}
|
|
870212
|
-
return
|
|
870335
|
+
return errors;
|
|
870213
870336
|
}
|
|
870214
870337
|
|
|
870215
870338
|
// pnp:/home/circleci/project/packages/cli/openapi-parser/lib/openapi/v3/converters/operation/convertHttpOperation.js
|
|
@@ -870276,7 +870399,7 @@ function convertHttpOperation({ operationContext, context, responseStatusCode, s
|
|
|
870276
870399
|
generatedRequestName: getGeneratedTypeName(requestBreadcrumbs),
|
|
870277
870400
|
request: convertedRequest,
|
|
870278
870401
|
response: convertedResponse.value,
|
|
870279
|
-
|
|
870402
|
+
errors: convertedResponse.errors,
|
|
870280
870403
|
server: (operation.servers ?? []).map((server) => convertServer(server)),
|
|
870281
870404
|
description: operation.description,
|
|
870282
870405
|
authed: isEndpointAuthed(operation, document4),
|
|
@@ -870784,46 +870907,6 @@ function getScopes(oauthSecurityScheme) {
|
|
|
870784
870907
|
return void 0;
|
|
870785
870908
|
}
|
|
870786
870909
|
|
|
870787
|
-
// pnp:/home/circleci/project/packages/cli/openapi-parser/lib/openapi/v3/converters/convertToHttpError.js
|
|
870788
|
-
var ERROR_NAMES_BY_STATUS_CODE = {
|
|
870789
|
-
400: "BadRequestError",
|
|
870790
|
-
401: "UnauthorizedError",
|
|
870791
|
-
403: "ForbiddenError",
|
|
870792
|
-
404: "NotFoundError",
|
|
870793
|
-
408: "RequestTimeoutError",
|
|
870794
|
-
409: "ConflictError",
|
|
870795
|
-
413: "ContentTooLargeError",
|
|
870796
|
-
422: "UnprocessableEntityError",
|
|
870797
|
-
428: "PreconditionError",
|
|
870798
|
-
429: "TooManyRequestsError",
|
|
870799
|
-
500: "InternalServerError",
|
|
870800
|
-
501: "NotImplementedError",
|
|
870801
|
-
503: "ServiceUnavailableError"
|
|
870802
|
-
};
|
|
870803
|
-
var ERROR_NAMES = new Set(Object.values(ERROR_NAMES_BY_STATUS_CODE));
|
|
870804
|
-
function convertToError({ statusCode, errorBodyCollector, context }) {
|
|
870805
|
-
const errorName = ERROR_NAMES_BY_STATUS_CODE[statusCode];
|
|
870806
|
-
if (errorName == null) {
|
|
870807
|
-
return void 0;
|
|
870808
|
-
}
|
|
870809
|
-
const schemas = errorBodyCollector.getSchemas();
|
|
870810
|
-
if (schemas.length === 1 && schemas[0] != null) {
|
|
870811
|
-
const schema2 = convertSchema(schemas[0], false, context, [errorName, "Body"]);
|
|
870812
|
-
return {
|
|
870813
|
-
generatedName: errorName,
|
|
870814
|
-
nameOverride: void 0,
|
|
870815
|
-
schema: schema2,
|
|
870816
|
-
description: void 0
|
|
870817
|
-
};
|
|
870818
|
-
}
|
|
870819
|
-
return {
|
|
870820
|
-
generatedName: errorName,
|
|
870821
|
-
nameOverride: void 0,
|
|
870822
|
-
schema: Schema2.unknown({ nameOverride: void 0, generatedName: errorName }),
|
|
870823
|
-
description: void 0
|
|
870824
|
-
};
|
|
870825
|
-
}
|
|
870826
|
-
|
|
870827
870910
|
// pnp:/home/circleci/project/packages/cli/openapi-parser/lib/openapi/v3/extensions/getFernGroups.js
|
|
870828
870911
|
var XFernGroupsSchema = z.record(z.string(), z.object({
|
|
870829
870912
|
summary: z.string().optional(),
|
|
@@ -870879,49 +870962,12 @@ function getVariableDefinitions(document4) {
|
|
|
870879
870962
|
}));
|
|
870880
870963
|
}
|
|
870881
870964
|
|
|
870882
|
-
// pnp:/home/circleci/project/packages/cli/openapi-parser/lib/openapi/v3/ErrorBodyCollector.js
|
|
870883
|
-
var ErrorBodyCollector = class {
|
|
870884
|
-
references = /* @__PURE__ */ new Set();
|
|
870885
|
-
schemas = [];
|
|
870886
|
-
convertedSchemas = [];
|
|
870887
|
-
context;
|
|
870888
|
-
constructor(context) {
|
|
870889
|
-
this.context = context;
|
|
870890
|
-
}
|
|
870891
|
-
collect(schema2) {
|
|
870892
|
-
if (isReferenceObject(schema2)) {
|
|
870893
|
-
if (this.references.has(schema2.$ref)) {
|
|
870894
|
-
} else {
|
|
870895
|
-
this.schemas.push(schema2);
|
|
870896
|
-
this.references.add(schema2.$ref);
|
|
870897
|
-
}
|
|
870898
|
-
} else {
|
|
870899
|
-
const convertedCurrentSchema = convertSchema(schema2, false, this.context, []);
|
|
870900
|
-
let isDupe = false;
|
|
870901
|
-
for (const convertedSchema of this.convertedSchemas) {
|
|
870902
|
-
isDupe = isSchemaEqual(convertedSchema, convertedCurrentSchema);
|
|
870903
|
-
if (isDupe) {
|
|
870904
|
-
break;
|
|
870905
|
-
}
|
|
870906
|
-
}
|
|
870907
|
-
if (!isDupe) {
|
|
870908
|
-
this.schemas.push(schema2);
|
|
870909
|
-
this.convertedSchemas.push(convertedCurrentSchema);
|
|
870910
|
-
}
|
|
870911
|
-
}
|
|
870912
|
-
}
|
|
870913
|
-
getSchemas() {
|
|
870914
|
-
return this.schemas;
|
|
870915
|
-
}
|
|
870916
|
-
};
|
|
870917
|
-
|
|
870918
870965
|
// pnp:/home/circleci/project/packages/cli/openapi-parser/lib/openapi/v3/OpenAPIV3ParserContext.js
|
|
870919
870966
|
var OpenAPIV3ParserContext = class extends AbstractOpenAPIV3ParserContext {
|
|
870920
870967
|
nonRequestReferencedSchemas = /* @__PURE__ */ new Set();
|
|
870921
870968
|
twoOrMoreRequestsReferencedSchemas = /* @__PURE__ */ new Set();
|
|
870922
870969
|
singleRequestReferencedSchemas = /* @__PURE__ */ new Set();
|
|
870923
870970
|
discrminatedUnionReferences = {};
|
|
870924
|
-
errorBodies = {};
|
|
870925
870971
|
schemasToExclude = /* @__PURE__ */ new Set();
|
|
870926
870972
|
constructor({ document: document4, taskContext, authHeaders }) {
|
|
870927
870973
|
super({ document: document4, taskContext, authHeaders });
|
|
@@ -870942,16 +870988,6 @@ var OpenAPIV3ParserContext = class extends AbstractOpenAPIV3ParserContext {
|
|
|
870942
870988
|
getReferencedSchemas() {
|
|
870943
870989
|
return /* @__PURE__ */ new Set([...this.nonRequestReferencedSchemas, ...this.twoOrMoreRequestsReferencedSchemas]);
|
|
870944
870990
|
}
|
|
870945
|
-
markSchemaForStatusCode(statusCode, schema2) {
|
|
870946
|
-
var _a5;
|
|
870947
|
-
if (this.errorBodies[statusCode] != null) {
|
|
870948
|
-
(_a5 = this.errorBodies[statusCode]) == null ? void 0 : _a5.collect(schema2);
|
|
870949
|
-
} else {
|
|
870950
|
-
const collector = new ErrorBodyCollector(this);
|
|
870951
|
-
collector.collect(schema2);
|
|
870952
|
-
this.errorBodies[statusCode] = collector;
|
|
870953
|
-
}
|
|
870954
|
-
}
|
|
870955
870991
|
markReferencedByDiscriminatedUnion(schema2, discrminant, times2) {
|
|
870956
870992
|
const existingReference = this.discrminatedUnionReferences[schema2.$ref];
|
|
870957
870993
|
if (existingReference != null) {
|
|
@@ -870967,21 +871003,6 @@ var OpenAPIV3ParserContext = class extends AbstractOpenAPIV3ParserContext {
|
|
|
870967
871003
|
getReferencesFromDiscriminatedUnion(schema2) {
|
|
870968
871004
|
return this.discrminatedUnionReferences[schema2.$ref];
|
|
870969
871005
|
}
|
|
870970
|
-
getErrors() {
|
|
870971
|
-
const errors = {};
|
|
870972
|
-
Object.entries(this.errorBodies).forEach(([statusCode, errorBodyCollector]) => {
|
|
870973
|
-
const parsedStatusCode = parseInt(statusCode);
|
|
870974
|
-
const convertedError = convertToError({
|
|
870975
|
-
statusCode: parsedStatusCode,
|
|
870976
|
-
errorBodyCollector,
|
|
870977
|
-
context: this
|
|
870978
|
-
});
|
|
870979
|
-
if (convertedError != null) {
|
|
870980
|
-
errors[parsedStatusCode] = convertedError;
|
|
870981
|
-
}
|
|
870982
|
-
});
|
|
870983
|
-
return errors;
|
|
870984
|
-
}
|
|
870985
871006
|
excludeSchema(schemaId) {
|
|
870986
871007
|
this.schemasToExclude.add(schemaId);
|
|
870987
871008
|
}
|
|
@@ -871205,7 +871226,27 @@ function generateIr({ openApi, taskContext, disableExamples }) {
|
|
|
871205
871226
|
env: header.env
|
|
871206
871227
|
};
|
|
871207
871228
|
}),
|
|
871208
|
-
examples
|
|
871229
|
+
examples,
|
|
871230
|
+
errors: mapValues_default(endpointWithExample.errors, (error) => {
|
|
871231
|
+
var _a6;
|
|
871232
|
+
return {
|
|
871233
|
+
generatedName: error.generatedName,
|
|
871234
|
+
nameOverride: error.nameOverride,
|
|
871235
|
+
schema: convertSchemaWithExampleToSchema(error.schema),
|
|
871236
|
+
description: error.description,
|
|
871237
|
+
examples: (_a6 = error.fullExamples) == null ? void 0 : _a6.map((example) => {
|
|
871238
|
+
const fullExample = convertToFullExample(example.value);
|
|
871239
|
+
if (fullExample == null) {
|
|
871240
|
+
return void 0;
|
|
871241
|
+
}
|
|
871242
|
+
return {
|
|
871243
|
+
name: example.name,
|
|
871244
|
+
description: example.description,
|
|
871245
|
+
example: fullExample
|
|
871246
|
+
};
|
|
871247
|
+
}).filter(isNonNullish)
|
|
871248
|
+
};
|
|
871249
|
+
})
|
|
871209
871250
|
};
|
|
871210
871251
|
});
|
|
871211
871252
|
const groupInfo = getFernGroups({ document: openApi, context });
|
|
@@ -871228,7 +871269,6 @@ function generateIr({ openApi, taskContext, disableExamples }) {
|
|
|
871228
871269
|
schemas,
|
|
871229
871270
|
securitySchemes,
|
|
871230
871271
|
hasEndpointsMarkedInternal: endpoints.some((endpoint) => endpoint.internal),
|
|
871231
|
-
errors: context.getErrors(),
|
|
871232
871272
|
nonRequestReferencedSchemas: context.getReferencedSchemas(),
|
|
871233
871273
|
variables,
|
|
871234
871274
|
globalHeaders
|
|
@@ -871318,7 +871358,6 @@ async function parse3({ workspace, taskContext }) {
|
|
|
871318
871358
|
webhooks: [],
|
|
871319
871359
|
channel: [],
|
|
871320
871360
|
schemas: {},
|
|
871321
|
-
errors: {},
|
|
871322
871361
|
variables: {},
|
|
871323
871362
|
nonRequestReferencedSchemas: /* @__PURE__ */ new Set(),
|
|
871324
871363
|
securitySchemes: {},
|
|
@@ -871390,10 +871429,6 @@ function merge3(ir1, ir2) {
|
|
|
871390
871429
|
...ir1.schemas,
|
|
871391
871430
|
...ir2.schemas
|
|
871392
871431
|
},
|
|
871393
|
-
errors: {
|
|
871394
|
-
...ir1.errors,
|
|
871395
|
-
...ir2.errors
|
|
871396
|
-
},
|
|
871397
871432
|
variables: {
|
|
871398
871433
|
...ir1.variables,
|
|
871399
871434
|
...ir2.variables
|
|
@@ -872211,7 +872246,7 @@ function convertToHttpMethod(httpMethod) {
|
|
|
872211
872246
|
|
|
872212
872247
|
// pnp:/home/circleci/project/packages/cli/openapi-ir-to-fern/lib/buildEndpoint.js
|
|
872213
872248
|
function buildEndpoint({ endpoint, declarationFile, context }) {
|
|
872214
|
-
const {
|
|
872249
|
+
const { nonRequestReferencedSchemas } = context.ir;
|
|
872215
872250
|
let schemaIdsToExclude = [];
|
|
872216
872251
|
const names2 = /* @__PURE__ */ new Set();
|
|
872217
872252
|
const pathParameters = {};
|
|
@@ -872368,18 +872403,54 @@ function buildEndpoint({ endpoint, declarationFile, context }) {
|
|
|
872368
872403
|
} else if (endpoint.availability === EndpointAvailability.Deprecated) {
|
|
872369
872404
|
convertedEndpoint.availability = "deprecated";
|
|
872370
872405
|
}
|
|
872371
|
-
endpoint.
|
|
872406
|
+
Object.entries(endpoint.errors).forEach(([statusCode, httpError]) => {
|
|
872372
872407
|
var _a5;
|
|
872373
|
-
|
|
872374
|
-
|
|
872375
|
-
|
|
872376
|
-
|
|
872408
|
+
let errorName = httpError.generatedName;
|
|
872409
|
+
const fileContainingReference = RelativeFilePath.of(FERN_PACKAGE_MARKER_FILENAME);
|
|
872410
|
+
if (context.builder.enableUniqueErrorsPerEndpoint) {
|
|
872411
|
+
errorName = `${endpoint.generatedRequestName}${httpError.generatedName}`;
|
|
872412
|
+
if (httpError.schema != null) {
|
|
872413
|
+
if (httpError.schema.type !== "reference" && httpError.schema.type !== "oneOf") {
|
|
872414
|
+
httpError.schema.generatedName = `${endpoint.generatedRequestName}${httpError.schema.generatedName}`;
|
|
872415
|
+
} else if (httpError.schema.type === "oneOf") {
|
|
872416
|
+
httpError.schema.value.generatedName = `${endpoint.generatedRequestName}${httpError.schema.value.generatedName}`;
|
|
872417
|
+
}
|
|
872377
872418
|
}
|
|
872378
|
-
|
|
872379
|
-
|
|
872380
|
-
|
|
872419
|
+
}
|
|
872420
|
+
const errorDeclaration = {
|
|
872421
|
+
"status-code": parseInt(statusCode)
|
|
872422
|
+
};
|
|
872423
|
+
if (httpError.schema != null) {
|
|
872424
|
+
const typeReference = buildTypeReference({
|
|
872425
|
+
schema: httpError.schema,
|
|
872426
|
+
context,
|
|
872427
|
+
fileContainingReference
|
|
872428
|
+
});
|
|
872429
|
+
errorDeclaration.type = getTypeFromTypeReference(typeReference);
|
|
872430
|
+
errorDeclaration.docs = httpError.description;
|
|
872431
|
+
}
|
|
872432
|
+
context.builder.addError(ERROR_DECLARATIONS_FILENAME, {
|
|
872433
|
+
name: errorName,
|
|
872434
|
+
schema: errorDeclaration
|
|
872435
|
+
});
|
|
872436
|
+
if (convertedEndpoint.errors == null) {
|
|
872437
|
+
convertedEndpoint.errors = [];
|
|
872438
|
+
}
|
|
872439
|
+
const prefix = context.builder.addImport({
|
|
872440
|
+
file: declarationFile,
|
|
872441
|
+
fileToImport: ERROR_DECLARATIONS_FILENAME
|
|
872442
|
+
});
|
|
872443
|
+
convertedEndpoint.errors.push(prefix != null ? `${prefix}.${errorName}` : errorName);
|
|
872444
|
+
const errorTypeReference = errorDeclaration.type;
|
|
872445
|
+
if (errorTypeReference != null) {
|
|
872446
|
+
(_a5 = httpError.examples) == null ? void 0 : _a5.forEach((example) => {
|
|
872447
|
+
const convertedExample = {
|
|
872448
|
+
value: convertFullExample2(example.example),
|
|
872449
|
+
name: example.name,
|
|
872450
|
+
docs: example.description
|
|
872451
|
+
};
|
|
872452
|
+
context.builder.addTypeExample(fileContainingReference, errorTypeReference, convertedExample);
|
|
872381
872453
|
});
|
|
872382
|
-
convertedEndpoint.errors.push(prefix != null ? `${prefix}.${errorName}` : errorName);
|
|
872383
872454
|
}
|
|
872384
872455
|
});
|
|
872385
872456
|
if (endpoint.examples.length > 0) {
|
|
@@ -872848,23 +872919,6 @@ function buildFernDefinition(context) {
|
|
|
872848
872919
|
schema: typeDeclaration.schema
|
|
872849
872920
|
});
|
|
872850
872921
|
}
|
|
872851
|
-
for (const [statusCode, httpError] of Object.entries(context.ir.errors)) {
|
|
872852
|
-
const errorDeclaration = {
|
|
872853
|
-
"status-code": parseInt(statusCode)
|
|
872854
|
-
};
|
|
872855
|
-
if (httpError.schema != null) {
|
|
872856
|
-
const typeReference = buildTypeReference({
|
|
872857
|
-
schema: httpError.schema,
|
|
872858
|
-
context,
|
|
872859
|
-
fileContainingReference: RelativeFilePath.of(FERN_PACKAGE_MARKER_FILENAME)
|
|
872860
|
-
});
|
|
872861
|
-
errorDeclaration.type = getTypeFromTypeReference(typeReference);
|
|
872862
|
-
}
|
|
872863
|
-
context.builder.addError(ERROR_DECLARATIONS_FILENAME, {
|
|
872864
|
-
name: httpError.generatedName,
|
|
872865
|
-
schema: errorDeclaration
|
|
872866
|
-
});
|
|
872867
|
-
}
|
|
872868
872922
|
if (context.ir.tags.orderedTagIds != null && context.ir.tags.orderedTagIds.length > 0) {
|
|
872869
872923
|
const containsValidTagIds = context.ir.tags.orderedTagIds.every((tagId) => {
|
|
872870
872924
|
return sdkGroups.has(tagId);
|
|
@@ -872882,11 +872936,13 @@ function buildFernDefinition(context) {
|
|
|
872882
872936
|
var import_path16 = require("path");
|
|
872883
872937
|
var FernDefinitionBuilderImpl = class {
|
|
872884
872938
|
modifyBasePaths;
|
|
872939
|
+
enableUniqueErrorsPerEndpoint;
|
|
872885
872940
|
rootApiFile;
|
|
872886
872941
|
packageMarkerFile = {};
|
|
872887
872942
|
definitionFiles = {};
|
|
872888
|
-
constructor(ir, modifyBasePaths) {
|
|
872943
|
+
constructor(ir, modifyBasePaths, enableUniqueErrorsPerEndpoint) {
|
|
872889
872944
|
this.modifyBasePaths = modifyBasePaths;
|
|
872945
|
+
this.enableUniqueErrorsPerEndpoint = enableUniqueErrorsPerEndpoint;
|
|
872890
872946
|
this.rootApiFile = {
|
|
872891
872947
|
name: "api",
|
|
872892
872948
|
"error-discrimination": {
|
|
@@ -872991,12 +873047,40 @@ var FernDefinitionBuilderImpl = class {
|
|
|
872991
873047
|
}
|
|
872992
873048
|
fernFile.types[name2] = schema2;
|
|
872993
873049
|
}
|
|
873050
|
+
addTypeExample(file, name2, convertedExample) {
|
|
873051
|
+
const fernFile = this.getOrCreateFile(file);
|
|
873052
|
+
if (fernFile.types == null) {
|
|
873053
|
+
fernFile.types = {};
|
|
873054
|
+
}
|
|
873055
|
+
const type2 = fernFile.types[name2];
|
|
873056
|
+
if (type2 != null) {
|
|
873057
|
+
if (typeof type2 === "string") {
|
|
873058
|
+
fernFile.types[name2] = {
|
|
873059
|
+
type: type2,
|
|
873060
|
+
examples: [convertedExample]
|
|
873061
|
+
};
|
|
873062
|
+
} else {
|
|
873063
|
+
if (type2.examples == null) {
|
|
873064
|
+
type2.examples = [];
|
|
873065
|
+
}
|
|
873066
|
+
type2.examples.push(convertedExample);
|
|
873067
|
+
}
|
|
873068
|
+
}
|
|
873069
|
+
}
|
|
872994
873070
|
addError(file, { name: name2, schema: schema2 }) {
|
|
873071
|
+
var _a5;
|
|
872995
873072
|
const fernFile = this.getOrCreateFile(file);
|
|
872996
873073
|
if (fernFile.errors == null) {
|
|
872997
873074
|
fernFile.errors = {};
|
|
872998
873075
|
}
|
|
872999
|
-
fernFile.errors[name2]
|
|
873076
|
+
if (fernFile.errors[name2] == null) {
|
|
873077
|
+
fernFile.errors[name2] = schema2;
|
|
873078
|
+
} else if (((_a5 = fernFile.errors[name2]) == null ? void 0 : _a5.type) !== schema2.type) {
|
|
873079
|
+
fernFile.errors[name2] = {
|
|
873080
|
+
"status-code": schema2["status-code"],
|
|
873081
|
+
type: "unknown"
|
|
873082
|
+
};
|
|
873083
|
+
}
|
|
873000
873084
|
}
|
|
873001
873085
|
addEndpoint(file, { name: name2, schema: schema2 }) {
|
|
873002
873086
|
const fernFile = this.getOrCreateFile(file);
|
|
@@ -873175,11 +873259,11 @@ var OpenApiIrConverterContext = class {
|
|
|
873175
873259
|
ir;
|
|
873176
873260
|
builder;
|
|
873177
873261
|
defaultServerName = void 0;
|
|
873178
|
-
constructor({ taskContext, ir }) {
|
|
873262
|
+
constructor({ taskContext, ir, enableUniqueErrorsPerEndpoint }) {
|
|
873179
873263
|
this.logger = taskContext.logger;
|
|
873180
873264
|
this.taskContext = taskContext;
|
|
873181
873265
|
this.ir = ir;
|
|
873182
|
-
this.builder = new FernDefinitionBuilderImpl(ir, false);
|
|
873266
|
+
this.builder = new FernDefinitionBuilderImpl(ir, false, enableUniqueErrorsPerEndpoint);
|
|
873183
873267
|
}
|
|
873184
873268
|
getSchema(id) {
|
|
873185
873269
|
const schema2 = this.ir.schemas[id];
|
|
@@ -873200,20 +873284,21 @@ var OpenApiIrConverterContext = class {
|
|
|
873200
873284
|
};
|
|
873201
873285
|
|
|
873202
873286
|
// pnp:/home/circleci/project/packages/cli/openapi-ir-to-fern/lib/convert.js
|
|
873203
|
-
function convert2(
|
|
873204
|
-
const context = new OpenApiIrConverterContext(
|
|
873287
|
+
function convert2(opts) {
|
|
873288
|
+
const context = new OpenApiIrConverterContext(opts);
|
|
873205
873289
|
return buildFernDefinition(context);
|
|
873206
873290
|
}
|
|
873207
873291
|
|
|
873208
873292
|
// pnp:/home/circleci/project/packages/cli/workspace-loader/lib/utils/convertOpenApiWorkspaceToFernWorkspace.js
|
|
873209
|
-
async function convertToFernWorkspace(openapiWorkspace, context) {
|
|
873293
|
+
async function convertToFernWorkspace(openapiWorkspace, context, enableUniqueErrorsPerEndpoint = false) {
|
|
873210
873294
|
const openApiIr = await parse3({
|
|
873211
873295
|
workspace: openapiWorkspace,
|
|
873212
873296
|
taskContext: context
|
|
873213
873297
|
});
|
|
873214
873298
|
const definition2 = convert2({
|
|
873215
873299
|
taskContext: context,
|
|
873216
|
-
openApiIr
|
|
873300
|
+
ir: openApiIr,
|
|
873301
|
+
enableUniqueErrorsPerEndpoint
|
|
873217
873302
|
});
|
|
873218
873303
|
return {
|
|
873219
873304
|
type: "fern",
|
|
@@ -877214,10 +877299,10 @@ var CliContext = class {
|
|
|
877214
877299
|
return "fern-api";
|
|
877215
877300
|
}
|
|
877216
877301
|
getPackageVersion() {
|
|
877217
|
-
if ("0.23.0-
|
|
877302
|
+
if ("0.23.0-rc7" == null) {
|
|
877218
877303
|
this.logger.error("CLI_VERSION is not defined");
|
|
877219
877304
|
}
|
|
877220
|
-
return "0.23.0-
|
|
877305
|
+
return "0.23.0-rc7";
|
|
877221
877306
|
}
|
|
877222
877307
|
getCliName() {
|
|
877223
877308
|
if ("fern" == null) {
|
|
@@ -922797,7 +922882,7 @@ async function generateDocsWorkspace({
|
|
|
922797
922882
|
await validateDocsWorkspaceAndLogIssues({ workspace: docsWorkspace, context, logWarnings: false });
|
|
922798
922883
|
const fernWorkspaces = await Promise.all(
|
|
922799
922884
|
project.apiWorkspaces.map(async (workspace) => {
|
|
922800
|
-
return workspace.type === "fern" ? workspace : await convertToFernWorkspace(workspace, context);
|
|
922885
|
+
return workspace.type === "fern" ? workspace : await convertToFernWorkspace(workspace, context, true);
|
|
922801
922886
|
})
|
|
922802
922887
|
);
|
|
922803
922888
|
await runRemoteGenerationForDocsWorkspace({
|