fern-api 0.29.3 → 0.29.4
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 +104 -6
- package/package.json +1 -1
package/bundle.cjs
CHANGED
|
@@ -363202,6 +363202,12 @@ var init_GlobalHeader = __esm({
|
|
|
363202
363202
|
}
|
|
363203
363203
|
});
|
|
363204
363204
|
|
|
363205
|
+
// pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/api/resources/finalIr/types/IdempotencyHeader.js
|
|
363206
|
+
var init_IdempotencyHeader = __esm({
|
|
363207
|
+
"pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/api/resources/finalIr/types/IdempotencyHeader.js"() {
|
|
363208
|
+
}
|
|
363209
|
+
});
|
|
363210
|
+
|
|
363205
363211
|
// pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/api/resources/finalIr/types/Tags.js
|
|
363206
363212
|
var init_Tags = __esm({
|
|
363207
363213
|
"pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/api/resources/finalIr/types/Tags.js"() {
|
|
@@ -364242,6 +364248,7 @@ var init_types28 = __esm({
|
|
|
364242
364248
|
init_OpenApiIntermediateRepresentation();
|
|
364243
364249
|
init_SdkGroupInfo();
|
|
364244
364250
|
init_GlobalHeader();
|
|
364251
|
+
init_IdempotencyHeader();
|
|
364245
364252
|
init_Tags();
|
|
364246
364253
|
init_HttpError();
|
|
364247
364254
|
init_Webhook3();
|
|
@@ -366990,7 +366997,8 @@ var init_OpenApiIntermediateRepresentation2 = __esm({
|
|
|
366990
366997
|
variables: schemas_exports5.record(schemas_exports5.string(), schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).PrimitiveSchema)),
|
|
366991
366998
|
nonRequestReferencedSchemas: schemas_exports5.set(schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).SchemaId)),
|
|
366992
366999
|
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)),
|
|
366993
|
-
globalHeaders: schemas_exports5.list(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).GlobalHeader)).optional()
|
|
367000
|
+
globalHeaders: schemas_exports5.list(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).GlobalHeader)).optional(),
|
|
367001
|
+
idempotencyHeaders: schemas_exports5.list(schemas_exports5.lazyObject(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).IdempotencyHeader)).optional()
|
|
366994
367002
|
});
|
|
366995
367003
|
}
|
|
366996
367004
|
});
|
|
@@ -367022,6 +367030,20 @@ var init_GlobalHeader2 = __esm({
|
|
|
367022
367030
|
}
|
|
367023
367031
|
});
|
|
367024
367032
|
|
|
367033
|
+
// pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/serialization/resources/finalIr/types/IdempotencyHeader.js
|
|
367034
|
+
var IdempotencyHeader;
|
|
367035
|
+
var init_IdempotencyHeader2 = __esm({
|
|
367036
|
+
"pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/serialization/resources/finalIr/types/IdempotencyHeader.js"() {
|
|
367037
|
+
init_core3();
|
|
367038
|
+
IdempotencyHeader = schemas_exports5.objectWithoutOptionalProperties({
|
|
367039
|
+
header: schemas_exports5.string(),
|
|
367040
|
+
name: schemas_exports5.string().optional(),
|
|
367041
|
+
env: schemas_exports5.string().optional(),
|
|
367042
|
+
schema: schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).Schema).optional()
|
|
367043
|
+
});
|
|
367044
|
+
}
|
|
367045
|
+
});
|
|
367046
|
+
|
|
367025
367047
|
// pnp:/home/circleci/project/packages/cli/openapi-ir-sdk/lib/sdk/serialization/resources/finalIr/types/Tags.js
|
|
367026
367048
|
var Tags;
|
|
367027
367049
|
var init_Tags2 = __esm({
|
|
@@ -367146,6 +367168,7 @@ var init_Endpoint2 = __esm({
|
|
|
367146
367168
|
Endpoint = schemas_exports5.objectWithoutOptionalProperties({
|
|
367147
367169
|
authed: schemas_exports5.boolean(),
|
|
367148
367170
|
internal: schemas_exports5.boolean().optional(),
|
|
367171
|
+
idempotent: schemas_exports5.boolean().optional(),
|
|
367149
367172
|
method: schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).HttpMethod),
|
|
367150
367173
|
availability: schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).EndpointAvailability).optional(),
|
|
367151
367174
|
audiences: schemas_exports5.list(schemas_exports5.string()),
|
|
@@ -368053,6 +368076,7 @@ var init_types32 = __esm({
|
|
|
368053
368076
|
init_OpenApiIntermediateRepresentation2();
|
|
368054
368077
|
init_SdkGroupInfo2();
|
|
368055
368078
|
init_GlobalHeader2();
|
|
368079
|
+
init_IdempotencyHeader2();
|
|
368056
368080
|
init_Tags2();
|
|
368057
368081
|
init_HttpError2();
|
|
368058
368082
|
init_Webhook4();
|
|
@@ -368149,6 +368173,7 @@ __export(finalIr_exports2, {
|
|
|
368149
368173
|
HeaderExample: () => HeaderExample,
|
|
368150
368174
|
HttpError: () => HttpError,
|
|
368151
368175
|
HttpMethod: () => HttpMethod6,
|
|
368176
|
+
IdempotencyHeader: () => IdempotencyHeader,
|
|
368152
368177
|
IntSchema: () => IntSchema,
|
|
368153
368178
|
JsonRequest: () => JsonRequest,
|
|
368154
368179
|
JsonResponse: () => JsonResponse3,
|
|
@@ -368229,6 +368254,7 @@ var init_EndpointWithExample2 = __esm({
|
|
|
368229
368254
|
EndpointWithExample = schemas_exports5.objectWithoutOptionalProperties({
|
|
368230
368255
|
authed: schemas_exports5.boolean(),
|
|
368231
368256
|
internal: schemas_exports5.boolean().optional(),
|
|
368257
|
+
idempotent: schemas_exports5.boolean().optional(),
|
|
368232
368258
|
method: schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).HttpMethod),
|
|
368233
368259
|
availability: schemas_exports5.lazy(async () => (await Promise.resolve().then(() => (init_serialization3(), serialization_exports3))).EndpointAvailability).optional(),
|
|
368234
368260
|
audiences: schemas_exports5.list(schemas_exports5.string()),
|
|
@@ -368934,6 +368960,7 @@ __export(serialization_exports3, {
|
|
|
368934
368960
|
HttpError: () => HttpError,
|
|
368935
368961
|
HttpErrorWithExample: () => HttpErrorWithExample,
|
|
368936
368962
|
HttpMethod: () => HttpMethod6,
|
|
368963
|
+
IdempotencyHeader: () => IdempotencyHeader,
|
|
368937
368964
|
Int64WithExample: () => Int64WithExample,
|
|
368938
368965
|
IntSchema: () => IntSchema,
|
|
368939
368966
|
IntWithExample: () => IntWithExample,
|
|
@@ -1012978,7 +1013005,7 @@ var AccessTokenPosthogManager = class {
|
|
|
1012978
1013005
|
properties: {
|
|
1012979
1013006
|
...event,
|
|
1012980
1013007
|
...event.properties,
|
|
1012981
|
-
version: "0.29.
|
|
1013008
|
+
version: "0.29.4",
|
|
1012982
1013009
|
usingAccessToken: true
|
|
1012983
1013010
|
}
|
|
1012984
1013011
|
});
|
|
@@ -1013040,7 +1013067,7 @@ var UserPosthogManager = class {
|
|
|
1013040
1013067
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
1013041
1013068
|
event: "CLI",
|
|
1013042
1013069
|
properties: {
|
|
1013043
|
-
version: "0.29.
|
|
1013070
|
+
version: "0.29.4",
|
|
1013044
1013071
|
...event,
|
|
1013045
1013072
|
...event.properties
|
|
1013046
1013073
|
}
|
|
@@ -1018243,6 +1018270,8 @@ var FernOpenAPIExtension = {
|
|
|
1018243
1018270
|
FERN_HEADER_AUTH: "x-fern-header",
|
|
1018244
1018271
|
FERN_BASIC_AUTH: "x-fern-basic",
|
|
1018245
1018272
|
FERN_GLOBAL_HEADERS: "x-fern-global-headers",
|
|
1018273
|
+
FERN_IDEMPOTENCY_HEADERS: "x-fern-idempotency-headers",
|
|
1018274
|
+
IDEMPOTENT: "x-fern-idempotent",
|
|
1018246
1018275
|
FERN_PROPERTY_NAME: "x-fern-property-name"
|
|
1018247
1018276
|
};
|
|
1018248
1018277
|
|
|
@@ -1023142,6 +1023171,7 @@ function markErrorSchemas({ responses, context }) {
|
|
|
1023142
1023171
|
// pnp:/home/circleci/project/packages/cli/openapi-parser/lib/openapi/v3/converters/operation/convertHttpOperation.js
|
|
1023143
1023172
|
function convertHttpOperation({ operationContext, context, responseStatusCode, suffix, streamFormat }) {
|
|
1023144
1023173
|
const { document: document6, operation, path: path42, method: method2, baseBreadcrumbs, sdkMethodName } = operationContext;
|
|
1023174
|
+
const idempotent = getExtension(operation, FernOpenAPIExtension.IDEMPOTENT);
|
|
1023145
1023175
|
const requestNameOverride = getExtension(operation, [
|
|
1023146
1023176
|
FernOpenAPIExtension.REQUEST_NAME_V1,
|
|
1023147
1023177
|
FernOpenAPIExtension.REQUEST_NAME_V2
|
|
@@ -1023192,6 +1023222,7 @@ function convertHttpOperation({ operationContext, context, responseStatusCode, s
|
|
|
1023192
1023222
|
return {
|
|
1023193
1023223
|
summary: operation.summary,
|
|
1023194
1023224
|
internal: getExtension(operation, OpenAPIExtension.INTERNAL),
|
|
1023225
|
+
idempotent,
|
|
1023195
1023226
|
audiences: getExtension(operation, FernOpenAPIExtension.AUDIENCES) ?? [],
|
|
1023196
1023227
|
operationId: operation.operationId != null && suffix != null ? operation.operationId + "_" + suffix : operation.operationId,
|
|
1023197
1023228
|
tags: operation.tags ?? [],
|
|
@@ -1023766,6 +1023797,25 @@ function getGlobalHeaders(document6) {
|
|
|
1023766
1023797
|
return result2;
|
|
1023767
1023798
|
}
|
|
1023768
1023799
|
|
|
1023800
|
+
// pnp:/home/circleci/project/packages/cli/openapi-parser/lib/openapi/v3/extensions/getIdempotencyHeaders.js
|
|
1023801
|
+
function getIdempotencyHeaders(document6) {
|
|
1023802
|
+
const idempotencyHeaders = getExtension(document6, FernOpenAPIExtension.FERN_IDEMPOTENCY_HEADERS);
|
|
1023803
|
+
const result2 = [];
|
|
1023804
|
+
for (const header of idempotencyHeaders ?? []) {
|
|
1023805
|
+
result2.push({
|
|
1023806
|
+
...header,
|
|
1023807
|
+
schema: header.type != null ? getSchemaFromFernType({
|
|
1023808
|
+
fernType: header.type,
|
|
1023809
|
+
description: void 0,
|
|
1023810
|
+
generatedName: header.name ?? header.header,
|
|
1023811
|
+
groupName: void 0,
|
|
1023812
|
+
nameOverride: void 0
|
|
1023813
|
+
}) : void 0
|
|
1023814
|
+
});
|
|
1023815
|
+
}
|
|
1023816
|
+
return result2;
|
|
1023817
|
+
}
|
|
1023818
|
+
|
|
1023769
1023819
|
// pnp:/home/circleci/project/packages/cli/openapi-parser/lib/openapi/v3/extensions/getVariableDefinitions.js
|
|
1023770
1023820
|
function getVariableDefinitions(document6) {
|
|
1023771
1023821
|
const variables = getExtension(document6, FernOpenAPIExtension.SDK_VARIABLES);
|
|
@@ -1023949,6 +1023999,7 @@ function generateIr({ openApi, taskContext, disableExamples, audiences, shouldUs
|
|
|
1023949
1023999
|
const context = new OpenAPIV3ParserContext({ document: openApi, taskContext, authHeaders, shouldUseTitleAsName });
|
|
1023950
1024000
|
const variables = getVariableDefinitions(openApi);
|
|
1023951
1024001
|
const globalHeaders = getGlobalHeaders(openApi);
|
|
1024002
|
+
const idempotencyHeaders = getIdempotencyHeaders(openApi);
|
|
1023952
1024003
|
const endpointsWithExample = [];
|
|
1023953
1024004
|
const webhooks = [];
|
|
1023954
1024005
|
Object.entries(openApi.paths).forEach(([path42, pathItem]) => {
|
|
@@ -1024110,7 +1024161,8 @@ function generateIr({ openApi, taskContext, disableExamples, audiences, shouldUs
|
|
|
1024110
1024161
|
hasEndpointsMarkedInternal: endpoints.some((endpoint) => endpoint.internal),
|
|
1024111
1024162
|
nonRequestReferencedSchemas: context.getReferencedSchemas(),
|
|
1024112
1024163
|
variables,
|
|
1024113
|
-
globalHeaders
|
|
1024164
|
+
globalHeaders,
|
|
1024165
|
+
idempotencyHeaders
|
|
1024114
1024166
|
};
|
|
1024115
1024167
|
return ir;
|
|
1024116
1024168
|
}
|
|
@@ -1024224,6 +1024276,7 @@ async function parse3({ workspace, taskContext }) {
|
|
|
1024224
1024276
|
nonRequestReferencedSchemas: /* @__PURE__ */ new Set(),
|
|
1024225
1024277
|
securitySchemes: {},
|
|
1024226
1024278
|
globalHeaders: [],
|
|
1024279
|
+
idempotencyHeaders: [],
|
|
1024227
1024280
|
groups: {}
|
|
1024228
1024281
|
};
|
|
1024229
1024282
|
for (const spec of workspace.specs) {
|
|
@@ -1024310,6 +1024363,7 @@ function merge3(ir1, ir2) {
|
|
|
1024310
1024363
|
...ir2.securitySchemes
|
|
1024311
1024364
|
},
|
|
1024312
1024365
|
globalHeaders: ir1.globalHeaders != null ? [...ir1.globalHeaders, ...ir2.globalHeaders ?? []] : void 0,
|
|
1024366
|
+
idempotencyHeaders: ir1.idempotencyHeaders != null ? [...ir1.idempotencyHeaders, ...ir2.idempotencyHeaders ?? []] : void 0,
|
|
1024313
1024367
|
groups: {
|
|
1024314
1024368
|
...ir1.groups,
|
|
1024315
1024369
|
...ir2.groups
|
|
@@ -1024921,6 +1024975,40 @@ function buildGlobalHeaders(context) {
|
|
|
1024921
1024975
|
}
|
|
1024922
1024976
|
}
|
|
1024923
1024977
|
|
|
1024978
|
+
// pnp:/home/circleci/project/packages/cli/openapi-ir-to-fern/lib/buildIdempotencyHeaders.js
|
|
1024979
|
+
var STRING_SCHEMA = Schema2.primitive({
|
|
1024980
|
+
description: void 0,
|
|
1024981
|
+
generatedName: "",
|
|
1024982
|
+
groupName: void 0,
|
|
1024983
|
+
nameOverride: void 0,
|
|
1024984
|
+
schema: PrimitiveSchemaValue.string({
|
|
1024985
|
+
default: void 0,
|
|
1024986
|
+
pattern: void 0,
|
|
1024987
|
+
format: void 0,
|
|
1024988
|
+
minLength: void 0,
|
|
1024989
|
+
maxLength: void 0
|
|
1024990
|
+
})
|
|
1024991
|
+
});
|
|
1024992
|
+
function buildIdempotencyHeaders(context) {
|
|
1024993
|
+
for (const header of context.ir.idempotencyHeaders ?? []) {
|
|
1024994
|
+
const convertedHeader = buildHeader({
|
|
1024995
|
+
header: {
|
|
1024996
|
+
...header,
|
|
1024997
|
+
schema: header.schema ?? STRING_SCHEMA,
|
|
1024998
|
+
name: header.name ?? header.header,
|
|
1024999
|
+
parameterNameOverride: void 0,
|
|
1025000
|
+
description: void 0
|
|
1025001
|
+
},
|
|
1025002
|
+
fileContainingReference: RelativeFilePath.of(ROOT_API_FILENAME),
|
|
1025003
|
+
context
|
|
1025004
|
+
});
|
|
1025005
|
+
context.builder.addIdempotencyHeader({
|
|
1025006
|
+
name: header.header,
|
|
1025007
|
+
schema: wrapTypeReferenceAsOptional(convertedHeader)
|
|
1025008
|
+
});
|
|
1025009
|
+
}
|
|
1025010
|
+
}
|
|
1025011
|
+
|
|
1024924
1025012
|
// pnp:/home/circleci/project/packages/cli/openapi-ir-to-fern/lib/buildEndpointExample.js
|
|
1024925
1025013
|
function buildEndpointExample({ endpointExample, context }) {
|
|
1024926
1025014
|
const example = {};
|
|
@@ -1025279,6 +1025367,9 @@ function buildEndpoint({ endpoint, declarationFile, context }) {
|
|
|
1025279
1025367
|
convertedEndpoint.url = serverOverride.name ?? void 0;
|
|
1025280
1025368
|
}
|
|
1025281
1025369
|
}
|
|
1025370
|
+
if (endpoint.idempotent) {
|
|
1025371
|
+
convertedEndpoint.idempotent = true;
|
|
1025372
|
+
}
|
|
1025282
1025373
|
if (endpoint.availability === EndpointAvailability.Beta) {
|
|
1025283
1025374
|
convertedEndpoint.availability = "pre-release";
|
|
1025284
1025375
|
} else if (endpoint.availability === EndpointAvailability.GenerallyAvailable) {
|
|
@@ -1025782,6 +1025873,7 @@ var ERROR_DECLARATIONS_FILENAME = RelativeFilePath.of(FERN_PACKAGE_MARKER_FILENA
|
|
|
1025782
1025873
|
function buildFernDefinition(context) {
|
|
1025783
1025874
|
buildEnvironments(context);
|
|
1025784
1025875
|
buildGlobalHeaders(context);
|
|
1025876
|
+
buildIdempotencyHeaders(context);
|
|
1025785
1025877
|
buildAuthSchemes(context);
|
|
1025786
1025878
|
buildVariables(context);
|
|
1025787
1025879
|
if (context.ir.basePath != null) {
|
|
@@ -1025913,6 +1026005,12 @@ var FernDefinitionBuilderImpl = class {
|
|
|
1025913
1026005
|
}
|
|
1025914
1026006
|
this.rootApiFile.headers[name2] = schema2;
|
|
1025915
1026007
|
}
|
|
1026008
|
+
addIdempotencyHeader({ name: name2, schema: schema2 }) {
|
|
1026009
|
+
if (this.rootApiFile["idempotency-headers"] == null) {
|
|
1026010
|
+
this.rootApiFile["idempotency-headers"] = {};
|
|
1026011
|
+
}
|
|
1026012
|
+
this.rootApiFile["idempotency-headers"][name2] = schema2;
|
|
1026013
|
+
}
|
|
1025916
1026014
|
addVariable({ name: name2, schema: schema2 }) {
|
|
1025917
1026015
|
if (this.rootApiFile.variables == null) {
|
|
1025918
1026016
|
this.rootApiFile.variables = {};
|
|
@@ -1030395,10 +1030493,10 @@ var CliContext = class {
|
|
|
1030395
1030493
|
return "fern-api";
|
|
1030396
1030494
|
}
|
|
1030397
1030495
|
getPackageVersion() {
|
|
1030398
|
-
if ("0.29.
|
|
1030496
|
+
if ("0.29.4" == null) {
|
|
1030399
1030497
|
this.logger.error("CLI_VERSION is not defined");
|
|
1030400
1030498
|
}
|
|
1030401
|
-
return "0.29.
|
|
1030499
|
+
return "0.29.4";
|
|
1030402
1030500
|
}
|
|
1030403
1030501
|
getCliName() {
|
|
1030404
1030502
|
if ("fern" == null) {
|