@fern-api/fern-api-dev 3.44.1-3-g1bd0a088d2 → 3.45.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.
Files changed (2) hide show
  1. package/cli.cjs +68 -9
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -1420087,7 +1420087,7 @@ var AccessTokenPosthogManager = class {
1420087
1420087
  properties: {
1420088
1420088
  ...event,
1420089
1420089
  ...event.properties,
1420090
- version: "3.44.1-3-g1bd0a088d2",
1420090
+ version: "3.45.0",
1420091
1420091
  usingAccessToken: true
1420092
1420092
  }
1420093
1420093
  });
@@ -1420186,7 +1420186,7 @@ var UserPosthogManager = class {
1420186
1420186
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
1420187
1420187
  event: "CLI",
1420188
1420188
  properties: {
1420189
- version: "3.44.1-3-g1bd0a088d2",
1420189
+ version: "3.45.0",
1420190
1420190
  ...event,
1420191
1420191
  ...event.properties,
1420192
1420192
  usingAccessToken: false,
@@ -1479957,6 +1479957,7 @@ var Webhook = schemas_exports5.objectWithoutOptionalProperties({
1479957
1479957
  method: WebhookHttpMethod4,
1479958
1479958
  headers: schemas_exports5.list(HttpHeader),
1479959
1479959
  payload: WebhookPayload2,
1479960
+ fileUploadPayload: FileUploadRequest.optional(),
1479960
1479961
  responses: schemas_exports5.list(HttpResponse).optional(),
1479961
1479962
  examples: schemas_exports5.list(ExampleWebhookCall).optional(),
1479962
1479963
  v2Examples: V2WebhookExamples.optional()
@@ -1499558,7 +1499559,7 @@ var CliContext = class {
1499558
1499559
  if (false) {
1499559
1499560
  this.logger.error("CLI_VERSION is not defined");
1499560
1499561
  }
1499561
- return "3.44.1-3-g1bd0a088d2";
1499562
+ return "3.45.0";
1499562
1499563
  }
1499563
1499564
  getCliName() {
1499564
1499565
  if (false) {
@@ -1508171,6 +1508172,8 @@ __export(serialization_exports6, {
1508171
1508172
  LongSchema: () => LongSchema,
1508172
1508173
  MapSchema: () => MapSchema,
1508173
1508174
  MapSchemaWithExample: () => MapSchemaWithExample,
1508175
+ MultipartFormDataWebhookPayload: () => MultipartFormDataWebhookPayload,
1508176
+ MultipartFormDataWebhookPayloadWithExample: () => MultipartFormDataWebhookPayloadWithExample,
1508174
1508177
  MultipartRequest: () => MultipartRequest,
1508175
1508178
  MultipartRequestProperty: () => MultipartRequestProperty,
1508176
1508179
  MultipartRequestPropertyEncoding: () => MultipartRequestPropertyEncoding2,
@@ -1510009,6 +1510012,7 @@ __export(finalIr_exports2, {
1510009
1510012
  LiteralSchemaValue: () => LiteralSchemaValue2,
1510010
1510013
  LongSchema: () => LongSchema,
1510011
1510014
  MapSchema: () => MapSchema,
1510015
+ MultipartFormDataWebhookPayload: () => MultipartFormDataWebhookPayload,
1510012
1510016
  MultipartRequest: () => MultipartRequest,
1510013
1510017
  MultipartRequestProperty: () => MultipartRequestProperty,
1510014
1510018
  MultipartRequestPropertyEncoding: () => MultipartRequestPropertyEncoding2,
@@ -1510475,6 +1510479,12 @@ var Endpoint2 = schemas_exports8.objectWithoutOptionalProperties({
1510475
1510479
  // ../api-importers/openapi/openapi-ir/lib/sdk/serialization/resources/finalIr/types/WebhookHttpMethod.js
1510476
1510480
  var WebhookHttpMethod6 = schemas_exports8.enum_(["GET", "POST"]);
1510477
1510481
 
1510482
+ // ../api-importers/openapi/openapi-ir/lib/sdk/serialization/resources/finalIr/types/MultipartFormDataWebhookPayload.js
1510483
+ var MultipartFormDataWebhookPayload = schemas_exports8.objectWithoutOptionalProperties({
1510484
+ name: schemas_exports8.string().optional(),
1510485
+ properties: schemas_exports8.list(MultipartRequestProperty)
1510486
+ }).extend(WithDescription).extend(WithSource);
1510487
+
1510478
1510488
  // ../api-importers/openapi/openapi-ir/lib/sdk/serialization/resources/finalIr/types/WebhookExampleCall.js
1510479
1510489
  var WebhookExampleCall = schemas_exports8.objectWithoutOptionalProperties({
1510480
1510490
  name: schemas_exports8.string().optional(),
@@ -1510492,6 +1510502,7 @@ var Webhook2 = schemas_exports8.objectWithoutOptionalProperties({
1510492
1510502
  headers: schemas_exports8.list(Header),
1510493
1510503
  generatedPayloadName: schemas_exports8.string(),
1510494
1510504
  payload: schemas_exports8.lazy(() => Schema4),
1510505
+ multipartFormData: MultipartFormDataWebhookPayload.optional(),
1510495
1510506
  response: Response9.optional(),
1510496
1510507
  examples: schemas_exports8.list(WebhookExampleCall)
1510497
1510508
  }).extend(WithDescription).extend(WithSource).extend(WithNamespace);
@@ -1510880,6 +1510891,7 @@ __export(parseIr_exports2, {
1510880
1510891
  JsonRequestWithExample: () => JsonRequestWithExample,
1510881
1510892
  JsonResponseWithExample: () => JsonResponseWithExample,
1510882
1510893
  MapSchemaWithExample: () => MapSchemaWithExample,
1510894
+ MultipartFormDataWebhookPayloadWithExample: () => MultipartFormDataWebhookPayloadWithExample,
1510883
1510895
  NamedFullExample: () => NamedFullExample,
1510884
1510896
  NullableSchemaWithExample: () => NullableSchemaWithExample,
1510885
1510897
  ObjectPropertyWithExample: () => ObjectPropertyWithExample,
@@ -1511062,6 +1511074,12 @@ var EndpointWithExample = schemas_exports8.objectWithoutOptionalProperties({
1511062
1511074
  retries: RetriesConfiguration4.optional()
1511063
1511075
  }).extend(WithDescription).extend(WithAvailability3).extend(WithSource).extend(WithNamespace);
1511064
1511076
 
1511077
+ // ../api-importers/openapi/openapi-ir/lib/sdk/serialization/resources/parseIr/types/MultipartFormDataWebhookPayloadWithExample.js
1511078
+ var MultipartFormDataWebhookPayloadWithExample = schemas_exports8.objectWithoutOptionalProperties({
1511079
+ name: schemas_exports8.string().optional(),
1511080
+ properties: schemas_exports8.list(MultipartRequestProperty)
1511081
+ }).extend(WithDescription).extend(WithSource);
1511082
+
1511065
1511083
  // ../api-importers/openapi/openapi-ir/lib/sdk/serialization/resources/parseIr/types/WebhookWithExample.js
1511066
1511084
  var WebhookWithExample = schemas_exports8.objectWithoutOptionalProperties({
1511067
1511085
  audiences: schemas_exports8.list(schemas_exports8.string()),
@@ -1511073,6 +1511091,7 @@ var WebhookWithExample = schemas_exports8.objectWithoutOptionalProperties({
1511073
1511091
  headers: schemas_exports8.list(HeaderWithExample),
1511074
1511092
  generatedPayloadName: schemas_exports8.string(),
1511075
1511093
  payload: schemas_exports8.lazy(() => SchemaWithExample2),
1511094
+ multipartFormData: MultipartFormDataWebhookPayloadWithExample.optional(),
1511076
1511095
  response: ResponseWithExample2.optional(),
1511077
1511096
  examples: schemas_exports8.list(WebhookExampleCall)
1511078
1511097
  }).extend(WithDescription).extend(WithSource).extend(WithNamespace);
@@ -1525842,10 +1525861,32 @@ function convertWebhookOperation({ context: context2, operationContext, source:
1525842
1525861
  source: source2,
1525843
1525862
  namespace: context2.namespace
1525844
1525863
  })).filter((request6) => request6 != null).map((request6) => {
1525845
- if (request6 == null || request6.type !== "json" && request6.type !== "formUrlEncoded") {
1525846
- context2.logger.error(`Skipping webhook ${path69} because non-json and non-formUrlEncoded request body`);
1525864
+ if (request6 == null || request6.type !== "json" && request6.type !== "formUrlEncoded" && request6.type !== "multipart") {
1525865
+ context2.logger.error(`Skipping webhook ${path69} because non-json, non-formUrlEncoded, and non-multipart request body`);
1525847
1525866
  return void 0;
1525848
1525867
  }
1525868
+ let multipartFormData;
1525869
+ let payload;
1525870
+ if (request6.type === "multipart") {
1525871
+ multipartFormData = {
1525872
+ name: request6.name,
1525873
+ properties: request6.properties,
1525874
+ description: request6.description,
1525875
+ source: request6.source
1525876
+ };
1525877
+ payload = SchemaWithExample.unknown({
1525878
+ nameOverride: void 0,
1525879
+ generatedName: getGeneratedTypeName(payloadBreadcrumbs, context2.options.preserveSchemaIds),
1525880
+ title: void 0,
1525881
+ description: request6.description,
1525882
+ availability: void 0,
1525883
+ namespace: context2.namespace,
1525884
+ groupName: void 0,
1525885
+ example: void 0
1525886
+ });
1525887
+ } else {
1525888
+ payload = request6.schema;
1525889
+ }
1525849
1525890
  const webhook = {
1525850
1525891
  summary: operation.summary,
1525851
1525892
  audiences: getExtension(operation, FernOpenAPIExtension.AUDIENCES) ?? [],
@@ -1525856,10 +1525897,11 @@ function convertWebhookOperation({ context: context2, operationContext, source:
1525856
1525897
  tags: context2.resolveTagsToTagIds(operation.tags),
1525857
1525898
  headers: convertedParameters.headers,
1525858
1525899
  generatedPayloadName: getGeneratedTypeName(payloadBreadcrumbs, context2.options.preserveSchemaIds),
1525859
- payload: request6.schema,
1525900
+ payload,
1525901
+ multipartFormData,
1525860
1525902
  response: convertedResponse?.value,
1525861
1525903
  description: operation.description,
1525862
- examples: convertWebhookExamples(request6.fullExamples),
1525904
+ examples: convertWebhookExamples(request6.type === "multipart" ? void 0 : request6.fullExamples),
1525863
1525905
  source: source2
1525864
1525906
  };
1525865
1525907
  return webhook;
@@ -1541267,6 +1541309,7 @@ var WebhookConverter = class extends AbstractOperationConverter {
1541267
1541309
  return void 0;
1541268
1541310
  }
1541269
1541311
  let payload;
1541312
+ let fileUploadPayload;
1541270
1541313
  if (requestBody.type === "inlinedRequestBody") {
1541271
1541314
  payload = WebhookPayload.inlinedPayload({
1541272
1541315
  name: requestBody.name,
@@ -1541278,6 +1541321,19 @@ var WebhookConverter = class extends AbstractOperationConverter {
1541278
1541321
  payloadType: requestBody.requestBodyType,
1541279
1541322
  docs: requestBody.docs
1541280
1541323
  });
1541324
+ } else if (requestBody.type === "fileUpload") {
1541325
+ fileUploadPayload = {
1541326
+ name: requestBody.name,
1541327
+ properties: requestBody.properties,
1541328
+ docs: requestBody.docs,
1541329
+ v2Examples: requestBody.v2Examples,
1541330
+ contentType: requestBody.contentType
1541331
+ };
1541332
+ payload = WebhookPayload.inlinedPayload({
1541333
+ name: requestBody.name,
1541334
+ extends: [],
1541335
+ properties: []
1541336
+ });
1541281
1541337
  } else {
1541282
1541338
  return void 0;
1541283
1541339
  }
@@ -1541295,6 +1541351,7 @@ var WebhookConverter = class extends AbstractOperationConverter {
1541295
1541351
  method: httpMethod,
1541296
1541352
  headers: headers2,
1541297
1541353
  payload,
1541354
+ fileUploadPayload,
1541298
1541355
  responses: responses.length > 0 ? responses : void 0,
1541299
1541356
  examples: [],
1541300
1541357
  availability: this.context.getAvailability({
@@ -1575761,6 +1575818,7 @@ function convertWebhookGroup({ webhooks: webhooks2, file, typeResolver, exampleR
1575761
1575818
  name: file.casingsGenerator.generateName(webhookId),
1575762
1575819
  headers: webhook.headers != null ? Object.entries(webhook.headers).map(([headerKey, header]) => convertHttpHeader({ headerKey, header, file })) : [],
1575763
1575820
  payload: convertWebhookPayloadSchema({ payload: webhook.payload, file }),
1575821
+ fileUploadPayload: void 0,
1575764
1575822
  responses: convertWebhookResponses({ webhook, file, typeResolver }),
1575765
1575823
  examples: webhook.examples != null ? convertWebhookExamples2({
1575766
1575824
  webhook,
@@ -1595368,7 +1595426,7 @@ var import_path37 = __toESM(require("path"), 1);
1595368
1595426
  var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
1595369
1595427
  var LOGS_FOLDER_NAME = "logs";
1595370
1595428
  function getCliSource() {
1595371
- const version6 = "3.44.1-3-g1bd0a088d2";
1595429
+ const version6 = "3.45.0";
1595372
1595430
  return `cli@${version6}`;
1595373
1595431
  }
1595374
1595432
  var DebugLogger = class {
@@ -1628308,8 +1628366,9 @@ function convertWebhookGroup10(webhookGroup) {
1628308
1628366
  return webhookGroup.map((webhook) => convertWebhook8(webhook));
1628309
1628367
  }
1628310
1628368
  function convertWebhook8(webhook) {
1628369
+ const { fileUploadPayload: _15, ...webhookWithoutFileUpload } = webhook;
1628311
1628370
  return {
1628312
- ...webhook,
1628371
+ ...webhookWithoutFileUpload,
1628313
1628372
  headers: webhook.headers.map((h14) => convertHttpHeader10(h14)),
1628314
1628373
  payload: convertWebhookPayload8(webhook.payload),
1628315
1628374
  // Responses contain TypeReferences that need conversion, but since skipValidation is true
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "3.44.1-3-g1bd0a088d2",
2
+ "version": "3.45.0",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",