@fern-api/fern-api-dev 3.44.1 → 3.46.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 +213 -19
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -1329010,7 +1329010,7 @@ function sortBy(arr, criteria) {
1329010
1329010
  return orderBy(arr, criteria, ["asc"]);
1329011
1329011
  }
1329012
1329012
 
1329013
- // ../../../node_modules/.pnpm/@fern-api+fdr-sdk@0.143.4-ab4e98f61_typescript@5.9.3/node_modules/@fern-api/fdr-sdk/dist/js/index.mjs
1329013
+ // ../../../node_modules/.pnpm/@fern-api+fdr-sdk@0.143.6-48348b476_typescript@5.9.3/node_modules/@fern-api/fdr-sdk/dist/js/index.mjs
1329014
1329014
  var import_ts_essentials = __toESM(require_dist(), 1);
1329015
1329015
 
1329016
1329016
  // ../../../node_modules/.pnpm/es-toolkit@1.43.0/node_modules/es-toolkit/dist/object/mapValues.mjs
@@ -1329031,7 +1329031,7 @@ function words2(str3) {
1329031
1329031
  return Array.from(str3.match(CASE_SPLIT_PATTERN) ?? []);
1329032
1329032
  }
1329033
1329033
 
1329034
- // ../../../node_modules/.pnpm/@fern-api+fdr-sdk@0.143.4-ab4e98f61_typescript@5.9.3/node_modules/@fern-api/fdr-sdk/dist/js/index.mjs
1329034
+ // ../../../node_modules/.pnpm/@fern-api+fdr-sdk@0.143.6-48348b476_typescript@5.9.3/node_modules/@fern-api/fdr-sdk/dist/js/index.mjs
1329035
1329035
  var import_qs = __toESM(require_lib2(), 1);
1329036
1329036
  var import_ts_essentials2 = __toESM(require_dist(), 1);
1329037
1329037
  var import_ts_essentials3 = __toESM(require_dist(), 1);
@@ -1334772,7 +1334772,7 @@ function kebabCase2(str3) {
1334772
1334772
  return words$1.map((word) => word.toLowerCase()).join("-");
1334773
1334773
  }
1334774
1334774
 
1334775
- // ../../../node_modules/.pnpm/@fern-api+fdr-sdk@0.143.4-ab4e98f61_typescript@5.9.3/node_modules/@fern-api/fdr-sdk/dist/js/index.mjs
1334775
+ // ../../../node_modules/.pnpm/@fern-api+fdr-sdk@0.143.6-48348b476_typescript@5.9.3/node_modules/@fern-api/fdr-sdk/dist/js/index.mjs
1334776
1334776
  var import_fast_deep_equal = __toESM(require_fast_deep_equal(), 1);
1334777
1334777
  var import_ts_essentials4 = __toESM(require_dist(), 1);
1334778
1334778
  var import_url_join2 = __toESM(require_url_join(), 1);
@@ -1334791,7 +1334791,7 @@ function once(func) {
1334791
1334791
  };
1334792
1334792
  }
1334793
1334793
 
1334794
- // ../../../node_modules/.pnpm/@fern-api+fdr-sdk@0.143.4-ab4e98f61_typescript@5.9.3/node_modules/@fern-api/fdr-sdk/dist/js/index.mjs
1334794
+ // ../../../node_modules/.pnpm/@fern-api+fdr-sdk@0.143.6-48348b476_typescript@5.9.3/node_modules/@fern-api/fdr-sdk/dist/js/index.mjs
1334795
1334795
  var import_ts_essentials6 = __toESM(require_dist(), 1);
1334796
1334796
  var import_ts_essentials7 = __toESM(require_dist(), 1);
1334797
1334797
  var import_url_join3 = __toESM(require_url_join(), 1);
@@ -1335021,7 +1335021,7 @@ var esm_default2 = typeof structuredClone === "function" ? (
1335021
1335021
  (any8, options2) => options2 && ("json" in options2 || "lossy" in options2) ? deserialize(serialize(any8, options2)) : structuredClone(any8)
1335022
1335022
  ) : (any8, options2) => deserialize(serialize(any8, options2));
1335023
1335023
 
1335024
- // ../../../node_modules/.pnpm/@fern-api+fdr-sdk@0.143.4-ab4e98f61_typescript@5.9.3/node_modules/@fern-api/fdr-sdk/dist/js/index.mjs
1335024
+ // ../../../node_modules/.pnpm/@fern-api+fdr-sdk@0.143.6-48348b476_typescript@5.9.3/node_modules/@fern-api/fdr-sdk/dist/js/index.mjs
1335025
1335025
  var import_ts_essentials12 = __toESM(require_dist(), 1);
1335026
1335026
  var __create2 = Object.create;
1335027
1335027
  var __defProp2 = Object.defineProperty;
@@ -1336588,7 +1336588,7 @@ var ApiTypeIdVisitor = class _ApiTypeIdVisitor {
1336588
1336588
  _ApiTypeIdVisitor.visitTypeShape(header.valueShape, visit3);
1336589
1336589
  });
1336590
1336590
  if (webhook.payloads?.[0] != null) {
1336591
- _ApiTypeIdVisitor.visitTypeShape(webhook.payloads[0].shape, visit3);
1336591
+ _ApiTypeIdVisitor.visitWebhookPayloadShape(webhook.payloads[0].shape, visit3);
1336592
1336592
  }
1336593
1336593
  webhook.responses?.forEach((response) => {
1336594
1336594
  if (response.body != null) {
@@ -1336596,6 +1336596,13 @@ var ApiTypeIdVisitor = class _ApiTypeIdVisitor {
1336596
1336596
  }
1336597
1336597
  });
1336598
1336598
  }
1336599
+ static visitWebhookPayloadShape(payloadShape, visit3) {
1336600
+ return visitDiscriminatedUnion_default(payloadShape)._visit({
1336601
+ object: (value) => _ApiTypeIdVisitor.visitObjectType(value, visit3),
1336602
+ alias: (value) => _ApiTypeIdVisitor.visitTypeReference(value.value, visit3),
1336603
+ formData: (value) => _ApiTypeIdVisitor.visitFormDataRequest(value, visit3)
1336604
+ });
1336605
+ }
1336599
1336606
  static visitHttpRequestBodyShape(bodyShape, visit3) {
1336600
1336607
  return visitDiscriminatedUnion_default(bodyShape)._visit({
1336601
1336608
  object: (value) => _ApiTypeIdVisitor.visitObjectType(value, visit3),
@@ -1338164,10 +1338171,30 @@ var ApiDefinitionV1ToLatest = class _ApiDefinitionV1ToLatest {
1338164
1338171
  })
1338165
1338172
  });
1338166
1338173
  };
1338174
+ migrateWebhookPayloadShape = (shape) => {
1338175
+ return visitDiscriminatedUnion_default(shape)._visit({
1338176
+ object: (obj) => ({
1338177
+ type: "object",
1338178
+ extends: obj.extends,
1338179
+ properties: this.migrateObjectProperties(obj.properties),
1338180
+ extraProperties: void 0
1338181
+ }),
1338182
+ reference: (ref2) => ({
1338183
+ type: "alias",
1338184
+ value: this.migrateTypeReference(ref2.value)
1338185
+ }),
1338186
+ formData: (formData) => ({
1338187
+ type: "formData",
1338188
+ description: formData.description,
1338189
+ availability: formData.availability,
1338190
+ fields: this.migrateFormDataProperties(formData.properties)
1338191
+ })
1338192
+ });
1338193
+ };
1338167
1338194
  migrateWebhookPayload = (payload) => {
1338168
1338195
  return {
1338169
1338196
  description: payload.description,
1338170
- shape: this.migrateJsonShape(payload.type)
1338197
+ shape: this.migrateWebhookPayloadShape(payload.type)
1338171
1338198
  };
1338172
1338199
  };
1338173
1338200
  migrateChannelExamples = (examples, messages2) => {
@@ -1386178,6 +1386205,7 @@ var Transformer = class _Transformer {
1386178
1386205
  ExampleWebSocketSession: visitor.ExampleWebSocketSession ?? identity_default2,
1386179
1386206
  TypeDefinition: visitor.TypeDefinition ?? identity_default2,
1386180
1386207
  TypeShape: visitor.TypeShape ?? identity_default2,
1386208
+ WebhookPayloadShape: visitor.WebhookPayloadShape ?? identity_default2,
1386181
1386209
  ObjectType: visitor.ObjectType ?? identity_default2,
1386182
1386210
  ObjectProperty: visitor.ObjectProperty ?? identity_default2,
1386183
1386211
  EnumValue: visitor.EnumValue ?? identity_default2,
@@ -1386241,6 +1386269,7 @@ var Transformer = class _Transformer {
1386241
1386269
  ExampleWebSocketSession: visit3,
1386242
1386270
  TypeDefinition: visit3,
1386243
1386271
  TypeShape: visit3,
1386272
+ WebhookPayloadShape: visit3,
1386244
1386273
  ObjectType: visit3,
1386245
1386274
  ObjectProperty: visit3,
1386246
1386275
  EnumValue: visit3,
@@ -1386325,6 +1386354,7 @@ var Transformer = class _Transformer {
1386325
1386354
  WebSocketMessage: (message, key) => visitor.WebSocketMessage(this.webSocketMessage(message, key), key),
1386326
1386355
  TypeDefinition: (type8, key) => visitor.TypeDefinition(this.typeDefinition(type8, key), key),
1386327
1386356
  TypeShape: (shape, key) => visitor.TypeShape(this.typeShape(shape, key), key),
1386357
+ WebhookPayloadShape: (shape, key) => visitor.WebhookPayloadShape(this.webhookPayloadShape(shape, key), key),
1386328
1386358
  ObjectType: (type8, key) => visitor.ObjectType(this.objectType(type8, key), key),
1386329
1386359
  DiscriminatedUnionVariant: (variant, key) => visitor.DiscriminatedUnionVariant(this.objectType(variant, key), key),
1386330
1386360
  FormDataRequest: (request6, key) => visitor.FormDataRequest(this.formDataRequest(request6, key), key),
@@ -1386471,9 +1386501,22 @@ var Transformer = class _Transformer {
1386471
1386501
  };
1386472
1386502
  };
1386473
1386503
  webhookPayload = (payload, parentKey) => {
1386474
- const shape = this.visitor.TypeShape(payload.shape, `${parentKey}/shape`);
1386504
+ const shape = this.visitor.WebhookPayloadShape(payload.shape, `${parentKey}/shape`);
1386475
1386505
  return { ...payload, shape };
1386476
1386506
  };
1386507
+ webhookPayloadShape = (shape, parentKey) => {
1386508
+ return visitDiscriminatedUnion_default(shape)._visit({
1386509
+ object: (value) => ({
1386510
+ ...value,
1386511
+ ...this.visitor.ObjectType(value, `${parentKey}/object`)
1386512
+ }),
1386513
+ alias: identity_default2,
1386514
+ formData: (value) => ({
1386515
+ ...value,
1386516
+ ...this.visitor.FormDataRequest(value, `${parentKey}/formData`)
1386517
+ })
1386518
+ });
1386519
+ };
1386477
1386520
  webSocketChannel = (channel, parentKey) => {
1386478
1386521
  const pathParameters = channel.pathParameters?.map((param) => ({
1386479
1386522
  ...this.visitor.ObjectProperty(param, `${parentKey}/path/${param.key}`),
@@ -1395588,10 +1395631,41 @@ function generateWebhookPayloadExample(shape, resolveTypeById) {
1395588
1395631
  return generateExampleObject(shape, resolveTypeById, false, /* @__PURE__ */ new Set(), 0);
1395589
1395632
  case "reference":
1395590
1395633
  return generateExampleFromTypeReference(shape.value, resolveTypeById, false, /* @__PURE__ */ new Set(), 0);
1395634
+ case "formData":
1395635
+ return generateFormDataWebhookPayloadExample(shape, resolveTypeById);
1395591
1395636
  default:
1395592
1395637
  assertNever_default(shape);
1395593
1395638
  }
1395594
1395639
  }
1395640
+ function generateFormDataWebhookPayloadExample(formDataRequest, resolveTypeById) {
1395641
+ const example = {};
1395642
+ formDataRequest.properties.forEach((property10) => {
1395643
+ switch (property10.type) {
1395644
+ case "file": {
1395645
+ if (property10.value.isOptional) {
1395646
+ break;
1395647
+ }
1395648
+ if (property10.value.type === "fileArray") {
1395649
+ example[property10.value.key] = ["<filename1>", "<filename2>"];
1395650
+ } else {
1395651
+ example[property10.value.key] = "<filename1>";
1395652
+ }
1395653
+ break;
1395654
+ }
1395655
+ case "bodyProperty": {
1395656
+ example[property10.key] = generateExampleFromTypeReference(
1395657
+ property10.valueType,
1395658
+ resolveTypeById,
1395659
+ false,
1395660
+ /* @__PURE__ */ new Set(),
1395661
+ 0
1395662
+ );
1395663
+ break;
1395664
+ }
1395665
+ }
1395666
+ });
1395667
+ return example;
1395668
+ }
1395595
1395669
  function generateHttpRequestBodyExample(type8, resolveTypeById) {
1395596
1395670
  switch (type8.type) {
1395597
1395671
  case "object": {
@@ -1398279,7 +1398353,14 @@ var ApiTypeIdVisitor2 = class _ApiTypeIdVisitor2 {
1398279
1398353
  webhook.headers.forEach((header) => {
1398280
1398354
  _ApiTypeIdVisitor2.visitTypeReference(header.type, visit3);
1398281
1398355
  });
1398282
- _ApiTypeIdVisitor2.visitObjectOrReference(webhook.payload.type, visit3);
1398356
+ _ApiTypeIdVisitor2.visitWebhookPayloadShape(webhook.payload.type, visit3);
1398357
+ }
1398358
+ static visitWebhookPayloadShape(payloadShape, visit3) {
1398359
+ return visitDiscriminatedUnion_default(payloadShape)._visit({
1398360
+ object: (value) => _ApiTypeIdVisitor2.visitObjectType(value, visit3),
1398361
+ reference: (value) => _ApiTypeIdVisitor2.visitTypeReference(value.value, visit3),
1398362
+ formData: (value) => _ApiTypeIdVisitor2.visitFormDataRequest(value, visit3)
1398363
+ });
1398283
1398364
  }
1398284
1398365
  static visitHttpRequestBodyShape(bodyShape, visit3) {
1398285
1398366
  return visitDiscriminatedUnion_default(bodyShape)._visit({
@@ -1420006,7 +1420087,7 @@ var AccessTokenPosthogManager = class {
1420006
1420087
  properties: {
1420007
1420088
  ...event,
1420008
1420089
  ...event.properties,
1420009
- version: "3.44.1",
1420090
+ version: "3.46.0",
1420010
1420091
  usingAccessToken: true
1420011
1420092
  }
1420012
1420093
  });
@@ -1420105,7 +1420186,7 @@ var UserPosthogManager = class {
1420105
1420186
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
1420106
1420187
  event: "CLI",
1420107
1420188
  properties: {
1420108
- version: "3.44.1",
1420189
+ version: "3.46.0",
1420109
1420190
  ...event,
1420110
1420191
  ...event.properties,
1420111
1420192
  usingAccessToken: false,
@@ -1479876,6 +1479957,7 @@ var Webhook = schemas_exports5.objectWithoutOptionalProperties({
1479876
1479957
  method: WebhookHttpMethod4,
1479877
1479958
  headers: schemas_exports5.list(HttpHeader),
1479878
1479959
  payload: WebhookPayload2,
1479960
+ fileUploadPayload: FileUploadRequest.optional(),
1479879
1479961
  responses: schemas_exports5.list(HttpResponse).optional(),
1479880
1479962
  examples: schemas_exports5.list(ExampleWebhookCall).optional(),
1479881
1479963
  v2Examples: V2WebhookExamples.optional()
@@ -1499477,7 +1499559,7 @@ var CliContext = class {
1499477
1499559
  if (false) {
1499478
1499560
  this.logger.error("CLI_VERSION is not defined");
1499479
1499561
  }
1499480
- return "3.44.1";
1499562
+ return "3.46.0";
1499481
1499563
  }
1499482
1499564
  getCliName() {
1499483
1499565
  if (false) {
@@ -1508090,6 +1508172,8 @@ __export(serialization_exports6, {
1508090
1508172
  LongSchema: () => LongSchema,
1508091
1508173
  MapSchema: () => MapSchema,
1508092
1508174
  MapSchemaWithExample: () => MapSchemaWithExample,
1508175
+ MultipartFormDataWebhookPayload: () => MultipartFormDataWebhookPayload,
1508176
+ MultipartFormDataWebhookPayloadWithExample: () => MultipartFormDataWebhookPayloadWithExample,
1508093
1508177
  MultipartRequest: () => MultipartRequest,
1508094
1508178
  MultipartRequestProperty: () => MultipartRequestProperty,
1508095
1508179
  MultipartRequestPropertyEncoding: () => MultipartRequestPropertyEncoding2,
@@ -1509928,6 +1510012,7 @@ __export(finalIr_exports2, {
1509928
1510012
  LiteralSchemaValue: () => LiteralSchemaValue2,
1509929
1510013
  LongSchema: () => LongSchema,
1509930
1510014
  MapSchema: () => MapSchema,
1510015
+ MultipartFormDataWebhookPayload: () => MultipartFormDataWebhookPayload,
1509931
1510016
  MultipartRequest: () => MultipartRequest,
1509932
1510017
  MultipartRequestProperty: () => MultipartRequestProperty,
1509933
1510018
  MultipartRequestPropertyEncoding: () => MultipartRequestPropertyEncoding2,
@@ -1510394,6 +1510479,12 @@ var Endpoint2 = schemas_exports8.objectWithoutOptionalProperties({
1510394
1510479
  // ../api-importers/openapi/openapi-ir/lib/sdk/serialization/resources/finalIr/types/WebhookHttpMethod.js
1510395
1510480
  var WebhookHttpMethod6 = schemas_exports8.enum_(["GET", "POST"]);
1510396
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
+
1510397
1510488
  // ../api-importers/openapi/openapi-ir/lib/sdk/serialization/resources/finalIr/types/WebhookExampleCall.js
1510398
1510489
  var WebhookExampleCall = schemas_exports8.objectWithoutOptionalProperties({
1510399
1510490
  name: schemas_exports8.string().optional(),
@@ -1510411,6 +1510502,7 @@ var Webhook2 = schemas_exports8.objectWithoutOptionalProperties({
1510411
1510502
  headers: schemas_exports8.list(Header),
1510412
1510503
  generatedPayloadName: schemas_exports8.string(),
1510413
1510504
  payload: schemas_exports8.lazy(() => Schema4),
1510505
+ multipartFormData: MultipartFormDataWebhookPayload.optional(),
1510414
1510506
  response: Response9.optional(),
1510415
1510507
  examples: schemas_exports8.list(WebhookExampleCall)
1510416
1510508
  }).extend(WithDescription).extend(WithSource).extend(WithNamespace);
@@ -1510799,6 +1510891,7 @@ __export(parseIr_exports2, {
1510799
1510891
  JsonRequestWithExample: () => JsonRequestWithExample,
1510800
1510892
  JsonResponseWithExample: () => JsonResponseWithExample,
1510801
1510893
  MapSchemaWithExample: () => MapSchemaWithExample,
1510894
+ MultipartFormDataWebhookPayloadWithExample: () => MultipartFormDataWebhookPayloadWithExample,
1510802
1510895
  NamedFullExample: () => NamedFullExample,
1510803
1510896
  NullableSchemaWithExample: () => NullableSchemaWithExample,
1510804
1510897
  ObjectPropertyWithExample: () => ObjectPropertyWithExample,
@@ -1510981,6 +1511074,12 @@ var EndpointWithExample = schemas_exports8.objectWithoutOptionalProperties({
1510981
1511074
  retries: RetriesConfiguration4.optional()
1510982
1511075
  }).extend(WithDescription).extend(WithAvailability3).extend(WithSource).extend(WithNamespace);
1510983
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
+
1510984
1511083
  // ../api-importers/openapi/openapi-ir/lib/sdk/serialization/resources/parseIr/types/WebhookWithExample.js
1510985
1511084
  var WebhookWithExample = schemas_exports8.objectWithoutOptionalProperties({
1510986
1511085
  audiences: schemas_exports8.list(schemas_exports8.string()),
@@ -1510992,6 +1511091,7 @@ var WebhookWithExample = schemas_exports8.objectWithoutOptionalProperties({
1510992
1511091
  headers: schemas_exports8.list(HeaderWithExample),
1510993
1511092
  generatedPayloadName: schemas_exports8.string(),
1510994
1511093
  payload: schemas_exports8.lazy(() => SchemaWithExample2),
1511094
+ multipartFormData: MultipartFormDataWebhookPayloadWithExample.optional(),
1510995
1511095
  response: ResponseWithExample2.optional(),
1510996
1511096
  examples: schemas_exports8.list(WebhookExampleCall)
1510997
1511097
  }).extend(WithDescription).extend(WithSource).extend(WithNamespace);
@@ -1525761,10 +1525861,32 @@ function convertWebhookOperation({ context: context2, operationContext, source:
1525761
1525861
  source: source2,
1525762
1525862
  namespace: context2.namespace
1525763
1525863
  })).filter((request6) => request6 != null).map((request6) => {
1525764
- if (request6 == null || request6.type !== "json" && request6.type !== "formUrlEncoded") {
1525765
- 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`);
1525766
1525866
  return void 0;
1525767
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
+ }
1525768
1525890
  const webhook = {
1525769
1525891
  summary: operation.summary,
1525770
1525892
  audiences: getExtension(operation, FernOpenAPIExtension.AUDIENCES) ?? [],
@@ -1525775,10 +1525897,11 @@ function convertWebhookOperation({ context: context2, operationContext, source:
1525775
1525897
  tags: context2.resolveTagsToTagIds(operation.tags),
1525776
1525898
  headers: convertedParameters.headers,
1525777
1525899
  generatedPayloadName: getGeneratedTypeName(payloadBreadcrumbs, context2.options.preserveSchemaIds),
1525778
- payload: request6.schema,
1525900
+ payload,
1525901
+ multipartFormData,
1525779
1525902
  response: convertedResponse?.value,
1525780
1525903
  description: operation.description,
1525781
- examples: convertWebhookExamples(request6.fullExamples),
1525904
+ examples: convertWebhookExamples(request6.type === "multipart" ? void 0 : request6.fullExamples),
1525782
1525905
  source: source2
1525783
1525906
  };
1525784
1525907
  return webhook;
@@ -1541186,6 +1541309,7 @@ var WebhookConverter = class extends AbstractOperationConverter {
1541186
1541309
  return void 0;
1541187
1541310
  }
1541188
1541311
  let payload;
1541312
+ let fileUploadPayload;
1541189
1541313
  if (requestBody.type === "inlinedRequestBody") {
1541190
1541314
  payload = WebhookPayload.inlinedPayload({
1541191
1541315
  name: requestBody.name,
@@ -1541197,6 +1541321,19 @@ var WebhookConverter = class extends AbstractOperationConverter {
1541197
1541321
  payloadType: requestBody.requestBodyType,
1541198
1541322
  docs: requestBody.docs
1541199
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
+ });
1541200
1541337
  } else {
1541201
1541338
  return void 0;
1541202
1541339
  }
@@ -1541214,6 +1541351,7 @@ var WebhookConverter = class extends AbstractOperationConverter {
1541214
1541351
  method: httpMethod,
1541215
1541352
  headers: headers2,
1541216
1541353
  payload,
1541354
+ fileUploadPayload,
1541217
1541355
  responses: responses.length > 0 ? responses : void 0,
1541218
1541356
  examples: [],
1541219
1541357
  availability: this.context.getAvailability({
@@ -1575680,6 +1575818,7 @@ function convertWebhookGroup({ webhooks: webhooks2, file, typeResolver, exampleR
1575680
1575818
  name: file.casingsGenerator.generateName(webhookId),
1575681
1575819
  headers: webhook.headers != null ? Object.entries(webhook.headers).map(([headerKey, header]) => convertHttpHeader({ headerKey, header, file })) : [],
1575682
1575820
  payload: convertWebhookPayloadSchema({ payload: webhook.payload, file }),
1575821
+ fileUploadPayload: void 0,
1575683
1575822
  responses: convertWebhookResponses({ webhook, file, typeResolver }),
1575684
1575823
  examples: webhook.examples != null ? convertWebhookExamples2({
1575685
1575824
  webhook,
@@ -1583703,7 +1583842,7 @@ function convertWebhookGroup2(webhookGroup) {
1583703
1583842
  type: convertTypeReference(header.valueType),
1583704
1583843
  availability: convertIrAvailability(header.availability)
1583705
1583844
  })),
1583706
- payload: convertWebhookPayload(webhook.payload),
1583845
+ payload: convertWebhookPayloadWithFileUpload(webhook.payload, webhook.fileUploadPayload),
1583707
1583846
  examples: webhookExamples,
1583708
1583847
  responses: webhook.responses?.map(convertResponse2).filter(isNonNullish)
1583709
1583848
  };
@@ -1584683,6 +1584822,60 @@ function convertHttpEndpointExample({ userSpecifiedExample, autogeneratedExample
1584683
1584822
  })).filter(isNonNullish)
1584684
1584823
  };
1584685
1584824
  }
1584825
+ function convertWebhookPayloadWithFileUpload(irWebhookPayload, fileUploadPayload) {
1584826
+ if (fileUploadPayload != null) {
1584827
+ return {
1584828
+ type: {
1584829
+ type: "formData",
1584830
+ name: fileUploadPayload.name.originalName,
1584831
+ description: fileUploadPayload.docs ?? void 0,
1584832
+ availability: void 0,
1584833
+ properties: fileUploadPayload.properties.map((property10) => {
1584834
+ return property10._visit({
1584835
+ file: (file) => {
1584836
+ const fileValue = file._visit({
1584837
+ file: (singleFile) => ({
1584838
+ type: "file",
1584839
+ key: FdrAPI_exports.PropertyKey(singleFile.key.wireValue),
1584840
+ isOptional: singleFile.isOptional,
1584841
+ contentType: singleFile.contentType,
1584842
+ description: singleFile.docs ?? void 0,
1584843
+ availability: void 0
1584844
+ }),
1584845
+ fileArray: (multipleFiles) => ({
1584846
+ type: "fileArray",
1584847
+ key: FdrAPI_exports.PropertyKey(multipleFiles.key.wireValue),
1584848
+ isOptional: multipleFiles.isOptional,
1584849
+ contentType: multipleFiles.contentType,
1584850
+ description: multipleFiles.docs ?? void 0,
1584851
+ availability: void 0
1584852
+ }),
1584853
+ _other: () => void 0
1584854
+ });
1584855
+ if (fileValue == null) {
1584856
+ return;
1584857
+ }
1584858
+ return { type: "file", value: fileValue };
1584859
+ },
1584860
+ bodyProperty: (bodyProperty) => ({
1584861
+ type: "bodyProperty",
1584862
+ key: FdrAPI_exports.PropertyKey(bodyProperty.name.wireValue),
1584863
+ valueType: convertTypeReference(bodyProperty.valueType),
1584864
+ contentType: bodyProperty.contentType,
1584865
+ description: bodyProperty.docs ?? void 0,
1584866
+ availability: convertIrAvailability(bodyProperty.availability),
1584867
+ exploded: bodyProperty.style === "exploded",
1584868
+ propertyAccess: void 0
1584869
+ }),
1584870
+ _other: () => void 0
1584871
+ });
1584872
+ }).filter(isNonNullish)
1584873
+ },
1584874
+ description: fileUploadPayload.docs ?? void 0
1584875
+ };
1584876
+ }
1584877
+ return convertWebhookPayload(irWebhookPayload);
1584878
+ }
1584686
1584879
  function convertWebhookPayload(irWebhookPayload) {
1584687
1584880
  switch (irWebhookPayload.type) {
1584688
1584881
  case "inlinedPayload":
@@ -1595287,7 +1595480,7 @@ var import_path37 = __toESM(require("path"), 1);
1595287
1595480
  var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
1595288
1595481
  var LOGS_FOLDER_NAME = "logs";
1595289
1595482
  function getCliSource() {
1595290
- const version6 = "3.44.1";
1595483
+ const version6 = "3.46.0";
1595291
1595484
  return `cli@${version6}`;
1595292
1595485
  }
1595293
1595486
  var DebugLogger = class {
@@ -1628227,8 +1628420,9 @@ function convertWebhookGroup10(webhookGroup) {
1628227
1628420
  return webhookGroup.map((webhook) => convertWebhook8(webhook));
1628228
1628421
  }
1628229
1628422
  function convertWebhook8(webhook) {
1628423
+ const { fileUploadPayload: _15, ...webhookWithoutFileUpload } = webhook;
1628230
1628424
  return {
1628231
- ...webhook,
1628425
+ ...webhookWithoutFileUpload,
1628232
1628426
  headers: webhook.headers.map((h14) => convertHttpHeader10(h14)),
1628233
1628427
  payload: convertWebhookPayload8(webhook.payload),
1628234
1628428
  // 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",
2
+ "version": "3.46.0",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",