fern-api 0.22.0 → 0.23.0-rc0
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 +85 -22
- package/package.json +1 -1
package/bundle.cjs
CHANGED
|
@@ -341245,6 +341245,15 @@ var init_Response = __esm({
|
|
|
341245
341245
|
}
|
|
341246
341246
|
};
|
|
341247
341247
|
},
|
|
341248
|
+
streamingSse: (value) => {
|
|
341249
|
+
return {
|
|
341250
|
+
...value,
|
|
341251
|
+
type: "streamingSse",
|
|
341252
|
+
_visit: function(visitor) {
|
|
341253
|
+
return Response2._visit(this, visitor);
|
|
341254
|
+
}
|
|
341255
|
+
};
|
|
341256
|
+
},
|
|
341248
341257
|
streamingText: (value) => {
|
|
341249
341258
|
return {
|
|
341250
341259
|
...value,
|
|
@@ -341271,6 +341280,8 @@ var init_Response = __esm({
|
|
|
341271
341280
|
return visitor.json(value);
|
|
341272
341281
|
case "text":
|
|
341273
341282
|
return visitor.text(value);
|
|
341283
|
+
case "streamingSse":
|
|
341284
|
+
return visitor.streamingSse(value);
|
|
341274
341285
|
case "streamingText":
|
|
341275
341286
|
return visitor.streamingText(value);
|
|
341276
341287
|
case "streamingJson":
|
|
@@ -341909,6 +341920,15 @@ var init_ResponseWithExample = __esm({
|
|
|
341909
341920
|
}
|
|
341910
341921
|
};
|
|
341911
341922
|
},
|
|
341923
|
+
streamingSse: (value) => {
|
|
341924
|
+
return {
|
|
341925
|
+
...value,
|
|
341926
|
+
type: "streamingSse",
|
|
341927
|
+
_visit: function(visitor) {
|
|
341928
|
+
return ResponseWithExample._visit(this, visitor);
|
|
341929
|
+
}
|
|
341930
|
+
};
|
|
341931
|
+
},
|
|
341912
341932
|
streamingText: (value) => {
|
|
341913
341933
|
return {
|
|
341914
341934
|
...value,
|
|
@@ -341935,6 +341955,8 @@ var init_ResponseWithExample = __esm({
|
|
|
341935
341955
|
return visitor.json(value);
|
|
341936
341956
|
case "text":
|
|
341937
341957
|
return visitor.text(value);
|
|
341958
|
+
case "streamingSse":
|
|
341959
|
+
return visitor.streamingSse(value);
|
|
341938
341960
|
case "streamingText":
|
|
341939
341961
|
return visitor.streamingText(value);
|
|
341940
341962
|
case "streamingJson":
|
|
@@ -344984,6 +345006,7 @@ var init_Response2 = __esm({
|
|
|
344984
345006
|
file: schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).FileResponse),
|
|
344985
345007
|
json: schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).JsonResponse),
|
|
344986
345008
|
text: schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).TextResponse),
|
|
345009
|
+
streamingSse: schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).JsonResponse),
|
|
344987
345010
|
streamingText: schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).TextResponse),
|
|
344988
345011
|
streamingJson: schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).JsonResponse)
|
|
344989
345012
|
}).transform({
|
|
@@ -344995,6 +345018,8 @@ var init_Response2 = __esm({
|
|
|
344995
345018
|
return Response2.json(value);
|
|
344996
345019
|
case "text":
|
|
344997
345020
|
return Response2.text(value);
|
|
345021
|
+
case "streamingSse":
|
|
345022
|
+
return Response2.streamingSse(value);
|
|
344998
345023
|
case "streamingText":
|
|
344999
345024
|
return Response2.streamingText(value);
|
|
345000
345025
|
case "streamingJson":
|
|
@@ -345652,6 +345677,7 @@ var init_ResponseWithExample2 = __esm({
|
|
|
345652
345677
|
file: schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).FileResponse),
|
|
345653
345678
|
json: schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).JsonResponseWithExample),
|
|
345654
345679
|
text: schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).TextResponse),
|
|
345680
|
+
streamingSse: schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).JsonResponse),
|
|
345655
345681
|
streamingText: schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).TextResponse),
|
|
345656
345682
|
streamingJson: schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).JsonResponse)
|
|
345657
345683
|
}).transform({
|
|
@@ -345663,6 +345689,8 @@ var init_ResponseWithExample2 = __esm({
|
|
|
345663
345689
|
return ResponseWithExample.json(value);
|
|
345664
345690
|
case "text":
|
|
345665
345691
|
return ResponseWithExample.text(value);
|
|
345692
|
+
case "streamingSse":
|
|
345693
|
+
return ResponseWithExample.streamingSse(value);
|
|
345666
345694
|
case "streamingText":
|
|
345667
345695
|
return ResponseWithExample.streamingText(value);
|
|
345668
345696
|
case "streamingJson":
|
|
@@ -847779,7 +847807,7 @@ var AccessTokenPosthogManager = class {
|
|
|
847779
847807
|
properties: {
|
|
847780
847808
|
...event,
|
|
847781
847809
|
...event.properties,
|
|
847782
|
-
version: "0.
|
|
847810
|
+
version: "0.23.0-rc0",
|
|
847783
847811
|
usingAccessToken: true
|
|
847784
847812
|
}
|
|
847785
847813
|
});
|
|
@@ -847841,7 +847869,7 @@ var UserPosthogManager = class {
|
|
|
847841
847869
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
847842
847870
|
event: "CLI",
|
|
847843
847871
|
properties: {
|
|
847844
|
-
version: "0.
|
|
847872
|
+
version: "0.23.0-rc0",
|
|
847845
847873
|
...event,
|
|
847846
847874
|
...event.properties
|
|
847847
847875
|
}
|
|
@@ -864501,11 +864529,19 @@ function getFernStreamingExtension(operation) {
|
|
|
864501
864529
|
}
|
|
864502
864530
|
if (typeof streaming === "boolean") {
|
|
864503
864531
|
return streaming ? {
|
|
864504
|
-
type: "stream"
|
|
864532
|
+
type: "stream",
|
|
864533
|
+
format: "json"
|
|
864505
864534
|
} : void 0;
|
|
864506
864535
|
}
|
|
864536
|
+
if (streaming["stream-condition"] == null && streaming.format != null) {
|
|
864537
|
+
return {
|
|
864538
|
+
type: "stream",
|
|
864539
|
+
format: streaming.format
|
|
864540
|
+
};
|
|
864541
|
+
}
|
|
864507
864542
|
return {
|
|
864508
864543
|
type: "streamCondition",
|
|
864544
|
+
format: streaming.format ?? "json",
|
|
864509
864545
|
streamConditionProperty: maybeTrimRequestPrefix(streaming["stream-condition"]),
|
|
864510
864546
|
responseStream: streaming["response-stream"],
|
|
864511
864547
|
response: streaming.response
|
|
@@ -865044,7 +865080,7 @@ var APPLICATION_PDF = "application/pdf";
|
|
|
865044
865080
|
var AUDIO_MPEG = "audio/mpeg";
|
|
865045
865081
|
var TEXT_PLAIN_CONTENT = "text/plain";
|
|
865046
865082
|
var SUCCESSFUL_STATUS_CODES = ["200", "201", "204"];
|
|
865047
|
-
function convertResponse({ operationContext, responses, context, responseBreadcrumbs, responseStatusCode,
|
|
865083
|
+
function convertResponse({ operationContext, responses, context, responseBreadcrumbs, responseStatusCode, streamFormat }) {
|
|
865048
865084
|
if (responses == null) {
|
|
865049
865085
|
return { value: void 0, errorStatusCodes: [] };
|
|
865050
865086
|
}
|
|
@@ -865059,7 +865095,7 @@ function convertResponse({ operationContext, responses, context, responseBreadcr
|
|
|
865059
865095
|
response,
|
|
865060
865096
|
context,
|
|
865061
865097
|
responseBreadcrumbs,
|
|
865062
|
-
|
|
865098
|
+
streamFormat
|
|
865063
865099
|
});
|
|
865064
865100
|
if (convertedResponse != null) {
|
|
865065
865101
|
switch (convertedResponse.type) {
|
|
@@ -865069,6 +865105,7 @@ function convertResponse({ operationContext, responses, context, responseBreadcr
|
|
|
865069
865105
|
errorStatusCodes
|
|
865070
865106
|
};
|
|
865071
865107
|
case "streamingJson":
|
|
865108
|
+
case "streamingSse":
|
|
865072
865109
|
return {
|
|
865073
865110
|
value: convertedResponse,
|
|
865074
865111
|
errorStatusCodes
|
|
@@ -865090,7 +865127,7 @@ function convertResponse({ operationContext, responses, context, responseBreadcr
|
|
|
865090
865127
|
errorStatusCodes
|
|
865091
865128
|
};
|
|
865092
865129
|
}
|
|
865093
|
-
function convertResolvedResponse({ operationContext,
|
|
865130
|
+
function convertResolvedResponse({ operationContext, streamFormat, response, context, responseBreadcrumbs }) {
|
|
865094
865131
|
var _a4, _b3, _c3, _d, _e, _f, _g, _h;
|
|
865095
865132
|
const resolvedResponse = isReferenceObject(response) ? context.resolveResponseReference(response) : response;
|
|
865096
865133
|
if (resolvedResponse.content != null) {
|
|
@@ -865107,12 +865144,21 @@ function convertResolvedResponse({ operationContext, isStreaming, response, cont
|
|
|
865107
865144
|
}
|
|
865108
865145
|
const jsonMediaObject = getApplicationJsonSchemaMediaObject(resolvedResponse.content ?? {}, context);
|
|
865109
865146
|
if (jsonMediaObject != null) {
|
|
865110
|
-
if (
|
|
865111
|
-
|
|
865112
|
-
|
|
865113
|
-
|
|
865114
|
-
|
|
865115
|
-
|
|
865147
|
+
if (streamFormat != null) {
|
|
865148
|
+
switch (streamFormat) {
|
|
865149
|
+
case "json":
|
|
865150
|
+
return ResponseWithExample.streamingJson({
|
|
865151
|
+
description: resolvedResponse.description,
|
|
865152
|
+
responseProperty: void 0,
|
|
865153
|
+
schema: convertSchemaWithExampleToSchema(convertSchema(jsonMediaObject.schema, false, context, responseBreadcrumbs))
|
|
865154
|
+
});
|
|
865155
|
+
case "sse":
|
|
865156
|
+
return ResponseWithExample.streamingSse({
|
|
865157
|
+
description: resolvedResponse.description,
|
|
865158
|
+
responseProperty: void 0,
|
|
865159
|
+
schema: convertSchemaWithExampleToSchema(convertSchema(jsonMediaObject.schema, false, context, responseBreadcrumbs))
|
|
865160
|
+
});
|
|
865161
|
+
}
|
|
865116
865162
|
}
|
|
865117
865163
|
return ResponseWithExample.json({
|
|
865118
865164
|
description: resolvedResponse.description,
|
|
@@ -865162,7 +865208,7 @@ function markErrorSchemas({ responses, context }) {
|
|
|
865162
865208
|
}
|
|
865163
865209
|
|
|
865164
865210
|
// pnp:/home/circleci/project/packages/cli/openapi-parser/lib/openapi/v3/converters/operation/convertHttpOperation.js
|
|
865165
|
-
function convertHttpOperation({ operationContext, context, responseStatusCode, suffix,
|
|
865211
|
+
function convertHttpOperation({ operationContext, context, responseStatusCode, suffix, streamFormat }) {
|
|
865166
865212
|
const { document: document4, operation, path: path34, method: method2, baseBreadcrumbs, sdkMethodName } = operationContext;
|
|
865167
865213
|
const requestNameOverride = getExtension(operation, [
|
|
865168
865214
|
FernOpenAPIExtension.REQUEST_NAME_V1,
|
|
@@ -865203,7 +865249,7 @@ function convertHttpOperation({ operationContext, context, responseStatusCode, s
|
|
|
865203
865249
|
const responseBreadcrumbs = [...baseBreadcrumbs, "Response"];
|
|
865204
865250
|
const convertedResponse = convertResponse({
|
|
865205
865251
|
operationContext,
|
|
865206
|
-
|
|
865252
|
+
streamFormat,
|
|
865207
865253
|
responses: operation.responses,
|
|
865208
865254
|
context,
|
|
865209
865255
|
responseBreadcrumbs,
|
|
@@ -865265,7 +865311,8 @@ function convertAsyncSyncOperation({ operationContext, context, asyncExtension }
|
|
|
865265
865311
|
}))
|
|
865266
865312
|
}
|
|
865267
865313
|
},
|
|
865268
|
-
context
|
|
865314
|
+
context,
|
|
865315
|
+
streamFormat: void 0
|
|
865269
865316
|
});
|
|
865270
865317
|
const asyncOperation = convertHttpOperation({
|
|
865271
865318
|
operationContext: {
|
|
@@ -865276,7 +865323,8 @@ function convertAsyncSyncOperation({ operationContext, context, asyncExtension }
|
|
|
865276
865323
|
},
|
|
865277
865324
|
context,
|
|
865278
865325
|
suffix: "async",
|
|
865279
|
-
responseStatusCode: asyncResponseStatusCode
|
|
865326
|
+
responseStatusCode: asyncResponseStatusCode,
|
|
865327
|
+
streamFormat: void 0
|
|
865280
865328
|
});
|
|
865281
865329
|
asyncOperation.headers.push({
|
|
865282
865330
|
name: headerToIgnore,
|
|
@@ -865314,7 +865362,7 @@ function convertStreamingOperation({ operationContext, context, streamingExtensi
|
|
|
865314
865362
|
const streamingOperation = convertHttpOperation({
|
|
865315
865363
|
operationContext,
|
|
865316
865364
|
context,
|
|
865317
|
-
|
|
865365
|
+
streamFormat: streamingExtension.format
|
|
865318
865366
|
});
|
|
865319
865367
|
return {
|
|
865320
865368
|
streaming: streamingOperation,
|
|
@@ -865353,7 +865401,7 @@ function convertStreamingOperation({ operationContext, context, streamingExtensi
|
|
|
865353
865401
|
baseBreadcrumbs: [...operationContext.baseBreadcrumbs, STREAM_SUFFIX]
|
|
865354
865402
|
},
|
|
865355
865403
|
context,
|
|
865356
|
-
|
|
865404
|
+
streamFormat: streamingExtension.format,
|
|
865357
865405
|
suffix: STREAM_SUFFIX
|
|
865358
865406
|
});
|
|
865359
865407
|
const nonStreamingRequestBody = getRequestBody2({
|
|
@@ -865367,6 +865415,7 @@ function convertStreamingOperation({ operationContext, context, streamingExtensi
|
|
|
865367
865415
|
response: streamingExtension.response
|
|
865368
865416
|
});
|
|
865369
865417
|
const nonStreamingOperation = convertHttpOperation({
|
|
865418
|
+
streamFormat: void 0,
|
|
865370
865419
|
operationContext: {
|
|
865371
865420
|
...operationContext,
|
|
865372
865421
|
operation: {
|
|
@@ -865543,7 +865592,8 @@ function convertOperation({ context, pathItemContext, operation }) {
|
|
|
865543
865592
|
}
|
|
865544
865593
|
const convertedHttpOperation = convertHttpOperation({
|
|
865545
865594
|
context,
|
|
865546
|
-
operationContext
|
|
865595
|
+
operationContext,
|
|
865596
|
+
streamFormat: void 0
|
|
865547
865597
|
});
|
|
865548
865598
|
return { type: "http", value: convertedHttpOperation };
|
|
865549
865599
|
}
|
|
@@ -867259,7 +867309,20 @@ function buildEndpoint({ endpoint, declarationFile, context }) {
|
|
|
867259
867309
|
});
|
|
867260
867310
|
convertedEndpoint["response-stream"] = {
|
|
867261
867311
|
docs: jsonResponse.description ?? void 0,
|
|
867262
|
-
type: getTypeFromTypeReference(responseTypeReference)
|
|
867312
|
+
type: getTypeFromTypeReference(responseTypeReference),
|
|
867313
|
+
format: "json"
|
|
867314
|
+
};
|
|
867315
|
+
},
|
|
867316
|
+
streamingSse: (jsonResponse) => {
|
|
867317
|
+
const responseTypeReference = buildTypeReference({
|
|
867318
|
+
schema: jsonResponse.schema,
|
|
867319
|
+
context,
|
|
867320
|
+
fileContainingReference: declarationFile
|
|
867321
|
+
});
|
|
867322
|
+
convertedEndpoint["response-stream"] = {
|
|
867323
|
+
docs: jsonResponse.description ?? void 0,
|
|
867324
|
+
type: getTypeFromTypeReference(responseTypeReference),
|
|
867325
|
+
format: "sse"
|
|
867263
867326
|
};
|
|
867264
867327
|
},
|
|
867265
867328
|
file: (fileResponse) => {
|
|
@@ -872147,10 +872210,10 @@ var CliContext = class {
|
|
|
872147
872210
|
return "fern-api";
|
|
872148
872211
|
}
|
|
872149
872212
|
getPackageVersion() {
|
|
872150
|
-
if ("0.
|
|
872213
|
+
if ("0.23.0-rc0" == null) {
|
|
872151
872214
|
this.logger.error("CLI_VERSION is not defined");
|
|
872152
872215
|
}
|
|
872153
|
-
return "0.
|
|
872216
|
+
return "0.23.0-rc0";
|
|
872154
872217
|
}
|
|
872155
872218
|
getCliName() {
|
|
872156
872219
|
if ("fern" == null) {
|