@fern-api/fern-api-dev 4.53.1 → 4.54.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.
- package/cli.cjs +258 -109
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -473739,11 +473739,34 @@ var OAuthAccessTokenResponseProperties = schemas_exports3.objectWithoutOptionalP
|
|
|
473739
473739
|
refreshToken: ResponseProperty.optional()
|
|
473740
473740
|
});
|
|
473741
473741
|
|
|
473742
|
+
// ../../ir-sdk/lib/sdk/serialization/resources/types/types/Literal.js
|
|
473743
|
+
var Literal2 = schemas_exports3.union("type", {
|
|
473744
|
+
string: schemas_exports3.object({
|
|
473745
|
+
string: schemas_exports3.string()
|
|
473746
|
+
}),
|
|
473747
|
+
boolean: schemas_exports3.object({
|
|
473748
|
+
boolean: schemas_exports3.boolean()
|
|
473749
|
+
})
|
|
473750
|
+
}).transform({
|
|
473751
|
+
transform: (value) => {
|
|
473752
|
+
switch (value.type) {
|
|
473753
|
+
case "string":
|
|
473754
|
+
return Literal.string(value.string);
|
|
473755
|
+
case "boolean":
|
|
473756
|
+
return Literal.boolean(value.boolean);
|
|
473757
|
+
default:
|
|
473758
|
+
return value;
|
|
473759
|
+
}
|
|
473760
|
+
},
|
|
473761
|
+
untransform: ({ _visit, ...value }) => value
|
|
473762
|
+
});
|
|
473763
|
+
|
|
473742
473764
|
// ../../ir-sdk/lib/sdk/serialization/resources/http/types/QueryParameter.js
|
|
473743
473765
|
var QueryParameter = schemas_exports3.objectWithoutOptionalProperties({
|
|
473744
473766
|
name: NameAndWireValue,
|
|
473745
473767
|
valueType: schemas_exports3.lazy(() => TypeReference3),
|
|
473746
473768
|
allowMultiple: schemas_exports3.boolean(),
|
|
473769
|
+
clientDefault: Literal2.optional(),
|
|
473747
473770
|
v2Examples: V2SchemaExamples.optional(),
|
|
473748
473771
|
explode: schemas_exports3.boolean().optional()
|
|
473749
473772
|
}).extend(Declaration);
|
|
@@ -475069,6 +475092,7 @@ var HttpHeader = schemas_exports3.objectWithoutOptionalProperties({
|
|
|
475069
475092
|
name: NameAndWireValue,
|
|
475070
475093
|
valueType: schemas_exports3.lazy(() => TypeReference3),
|
|
475071
475094
|
env: schemas_exports3.string().optional(),
|
|
475095
|
+
clientDefault: Literal2.optional(),
|
|
475072
475096
|
v2Examples: V2SchemaExamples.optional()
|
|
475073
475097
|
}).extend(Declaration);
|
|
475074
475098
|
|
|
@@ -476491,6 +476515,7 @@ var PathParameter = schemas_exports3.objectWithoutOptionalProperties({
|
|
|
476491
476515
|
valueType: schemas_exports3.lazy(() => TypeReference3),
|
|
476492
476516
|
location: PathParameterLocation2,
|
|
476493
476517
|
variable: VariableId.optional(),
|
|
476518
|
+
clientDefault: Literal2.optional(),
|
|
476494
476519
|
v2Examples: V2SchemaExamples.optional(),
|
|
476495
476520
|
explode: schemas_exports3.boolean().optional()
|
|
476496
476521
|
}).extend(WithDocs);
|
|
@@ -477902,28 +477927,6 @@ __export(types_exports6, {
|
|
|
477902
477927
|
UuidType: () => UuidType
|
|
477903
477928
|
});
|
|
477904
477929
|
|
|
477905
|
-
// ../../ir-sdk/lib/sdk/serialization/resources/types/types/Literal.js
|
|
477906
|
-
var Literal2 = schemas_exports3.union("type", {
|
|
477907
|
-
string: schemas_exports3.object({
|
|
477908
|
-
string: schemas_exports3.string()
|
|
477909
|
-
}),
|
|
477910
|
-
boolean: schemas_exports3.object({
|
|
477911
|
-
boolean: schemas_exports3.boolean()
|
|
477912
|
-
})
|
|
477913
|
-
}).transform({
|
|
477914
|
-
transform: (value) => {
|
|
477915
|
-
switch (value.type) {
|
|
477916
|
-
case "string":
|
|
477917
|
-
return Literal.string(value.string);
|
|
477918
|
-
case "boolean":
|
|
477919
|
-
return Literal.boolean(value.boolean);
|
|
477920
|
-
default:
|
|
477921
|
-
return value;
|
|
477922
|
-
}
|
|
477923
|
-
},
|
|
477924
|
-
untransform: ({ _visit, ...value }) => value
|
|
477925
|
-
});
|
|
477926
|
-
|
|
477927
477930
|
// ../../ir-sdk/lib/sdk/serialization/resources/types/types/ContainerType.js
|
|
477928
477931
|
var ContainerType2 = schemas_exports3.union(schemas_exports3.discriminant("type", "_type"), {
|
|
477929
477932
|
list: schemas_exports3.object({
|
|
@@ -506954,7 +506957,8 @@ var Header = schemas_exports9.objectWithoutOptionalProperties({
|
|
|
506954
506957
|
name: schemas_exports9.string(),
|
|
506955
506958
|
schema: schemas_exports9.lazy(() => Schema2),
|
|
506956
506959
|
env: schemas_exports9.string().optional(),
|
|
506957
|
-
parameterNameOverride: schemas_exports9.string().optional()
|
|
506960
|
+
parameterNameOverride: schemas_exports9.string().optional(),
|
|
506961
|
+
clientDefault: schemas_exports9.unknown().optional()
|
|
506958
506962
|
}).extend(WithDescription).extend(WithAvailability3).extend(WithSource);
|
|
506959
506963
|
|
|
506960
506964
|
// ../api-importers/openapi/openapi-ir/lib/sdk/serialization/resources/finalIr/types/HttpEndpointServer.js
|
|
@@ -507032,7 +507036,8 @@ var PathParameter2 = schemas_exports9.objectWithoutOptionalProperties({
|
|
|
507032
507036
|
name: schemas_exports9.string(),
|
|
507033
507037
|
schema: schemas_exports9.lazy(() => Schema2),
|
|
507034
507038
|
variableReference: schemas_exports9.string().optional(),
|
|
507035
|
-
parameterNameOverride: schemas_exports9.string().optional()
|
|
507039
|
+
parameterNameOverride: schemas_exports9.string().optional(),
|
|
507040
|
+
clientDefault: schemas_exports9.unknown().optional()
|
|
507036
507041
|
}).extend(WithDescription).extend(WithAvailability3).extend(WithSource);
|
|
507037
507042
|
|
|
507038
507043
|
// ../api-importers/openapi/openapi-ir/lib/sdk/serialization/resources/finalIr/types/QueryParameter.js
|
|
@@ -507040,7 +507045,8 @@ var QueryParameter2 = schemas_exports9.objectWithoutOptionalProperties({
|
|
|
507040
507045
|
name: schemas_exports9.string(),
|
|
507041
507046
|
schema: schemas_exports9.lazy(() => Schema2),
|
|
507042
507047
|
parameterNameOverride: schemas_exports9.string().optional(),
|
|
507043
|
-
explode: schemas_exports9.boolean().optional()
|
|
507048
|
+
explode: schemas_exports9.boolean().optional(),
|
|
507049
|
+
clientDefault: schemas_exports9.unknown().optional()
|
|
507044
507050
|
}).extend(WithDescription).extend(WithAvailability3).extend(WithSource);
|
|
507045
507051
|
|
|
507046
507052
|
// ../api-importers/openapi/openapi-ir/lib/sdk/serialization/resources/finalIr/types/FormUrlEncodedRequest.js
|
|
@@ -507742,7 +507748,8 @@ var HeaderWithExample = schemas_exports9.objectWithoutOptionalProperties({
|
|
|
507742
507748
|
name: schemas_exports9.string(),
|
|
507743
507749
|
schema: schemas_exports9.lazy(() => SchemaWithExample2),
|
|
507744
507750
|
env: schemas_exports9.string().optional(),
|
|
507745
|
-
parameterNameOverride: schemas_exports9.string().optional()
|
|
507751
|
+
parameterNameOverride: schemas_exports9.string().optional(),
|
|
507752
|
+
clientDefault: schemas_exports9.unknown().optional()
|
|
507746
507753
|
}).extend(WithDescription).extend(WithAvailability3).extend(WithSource);
|
|
507747
507754
|
|
|
507748
507755
|
// ../api-importers/openapi/openapi-ir/lib/sdk/serialization/resources/parseIr/types/NamedFullExample.js
|
|
@@ -507764,7 +507771,8 @@ var PathParameterWithExample = schemas_exports9.objectWithoutOptionalProperties(
|
|
|
507764
507771
|
schema: schemas_exports9.lazy(() => SchemaWithExample2),
|
|
507765
507772
|
variableReference: schemas_exports9.string().optional(),
|
|
507766
507773
|
parameterNameOverride: schemas_exports9.string().optional(),
|
|
507767
|
-
explode: schemas_exports9.boolean().optional()
|
|
507774
|
+
explode: schemas_exports9.boolean().optional(),
|
|
507775
|
+
clientDefault: schemas_exports9.unknown().optional()
|
|
507768
507776
|
}).extend(WithDescription).extend(WithAvailability3).extend(WithSource);
|
|
507769
507777
|
|
|
507770
507778
|
// ../api-importers/openapi/openapi-ir/lib/sdk/serialization/resources/parseIr/types/QueryParameterWithExample.js
|
|
@@ -507772,7 +507780,8 @@ var QueryParameterWithExample = schemas_exports9.objectWithoutOptionalProperties
|
|
|
507772
507780
|
name: schemas_exports9.string(),
|
|
507773
507781
|
schema: schemas_exports9.lazy(() => SchemaWithExample2),
|
|
507774
507782
|
parameterNameOverride: schemas_exports9.string().optional(),
|
|
507775
|
-
explode: schemas_exports9.boolean().optional()
|
|
507783
|
+
explode: schemas_exports9.boolean().optional(),
|
|
507784
|
+
clientDefault: schemas_exports9.unknown().optional()
|
|
507776
507785
|
}).extend(WithDescription).extend(WithAvailability3).extend(WithSource);
|
|
507777
507786
|
|
|
507778
507787
|
// ../api-importers/openapi/openapi-ir/lib/sdk/serialization/resources/parseIr/types/JsonRequestWithExample.js
|
|
@@ -509969,7 +509978,7 @@ function buildHeader({ header, context: context3, fileContainingReference, names
|
|
|
509969
509978
|
const headerType = getTypeFromTypeReference(typeReference2);
|
|
509970
509979
|
const headerWithoutXPrefix = header.name.replace(/^x-|^X-/, "");
|
|
509971
509980
|
const headerVariableName = header.parameterNameOverride != null ? header.parameterNameOverride : camelCase_default(headerWithoutXPrefix);
|
|
509972
|
-
if (header.description == null && header.name === headerVariableName && header.env == null && header.availability == null) {
|
|
509981
|
+
if (header.description == null && header.name === headerVariableName && header.env == null && header.availability == null && header.clientDefault == null) {
|
|
509973
509982
|
return headerType;
|
|
509974
509983
|
}
|
|
509975
509984
|
const headerSchema = {
|
|
@@ -509987,6 +509996,9 @@ function buildHeader({ header, context: context3, fileContainingReference, names
|
|
|
509987
509996
|
if (header.availability != null) {
|
|
509988
509997
|
headerSchema.availability = convertAvailability(header.availability);
|
|
509989
509998
|
}
|
|
509999
|
+
if (header.clientDefault != null) {
|
|
510000
|
+
headerSchema.default = header.clientDefault;
|
|
510001
|
+
}
|
|
509990
510002
|
return headerSchema;
|
|
509991
510003
|
}
|
|
509992
510004
|
|
|
@@ -509999,7 +510011,7 @@ function buildPathParameter({ pathParameter, context: context3, fileContainingRe
|
|
|
509999
510011
|
namespace,
|
|
510000
510012
|
declarationDepth: 0
|
|
510001
510013
|
});
|
|
510002
|
-
if (pathParameter.variableReference == null && pathParameter.description == null && pathParameter.availability == null) {
|
|
510014
|
+
if (pathParameter.variableReference == null && pathParameter.description == null && pathParameter.availability == null && pathParameter.clientDefault == null) {
|
|
510003
510015
|
return getTypeFromTypeReference(typeReference2);
|
|
510004
510016
|
}
|
|
510005
510017
|
const pathParameterSchema = pathParameter.variableReference != null ? {
|
|
@@ -510013,6 +510025,9 @@ function buildPathParameter({ pathParameter, context: context3, fileContainingRe
|
|
|
510013
510025
|
if (pathParameter.availability != null) {
|
|
510014
510026
|
pathParameterSchema.availability = convertAvailability(pathParameter.availability);
|
|
510015
510027
|
}
|
|
510028
|
+
if (pathParameter.clientDefault != null && "type" in pathParameterSchema) {
|
|
510029
|
+
pathParameterSchema.default = pathParameter.clientDefault;
|
|
510030
|
+
}
|
|
510016
510031
|
return pathParameterSchema;
|
|
510017
510032
|
}
|
|
510018
510033
|
|
|
@@ -510038,7 +510053,9 @@ function buildQueryParameter({ queryParameter, context: context3, fileContaining
|
|
|
510038
510053
|
const queryParameterSchema = {
|
|
510039
510054
|
type: queryParameterType
|
|
510040
510055
|
};
|
|
510041
|
-
if (
|
|
510056
|
+
if (queryParameter.clientDefault != null) {
|
|
510057
|
+
queryParameterSchema.default = queryParameter.clientDefault;
|
|
510058
|
+
} else if (queryParameterDefault != null) {
|
|
510042
510059
|
queryParameterSchema.default = queryParameterDefault;
|
|
510043
510060
|
}
|
|
510044
510061
|
if (typeReference2.allowMultiple) {
|
|
@@ -511456,7 +511473,8 @@ function buildIdempotencyHeaders(context3) {
|
|
|
511456
511473
|
parameterNameOverride: void 0,
|
|
511457
511474
|
description: void 0,
|
|
511458
511475
|
availability: void 0,
|
|
511459
|
-
source: void 0
|
|
511476
|
+
source: void 0,
|
|
511477
|
+
clientDefault: void 0
|
|
511460
511478
|
},
|
|
511461
511479
|
fileContainingReference: RelativeFilePath.of(ROOT_API_FILENAME),
|
|
511462
511480
|
context: context3,
|
|
@@ -517389,7 +517407,23 @@ var FernOpenAPIExtension = {
|
|
|
517389
517407
|
* - $ref: '#/components/schemas/CompletionEvent'
|
|
517390
517408
|
* - $ref: '#/components/schemas/ErrorEvent'
|
|
517391
517409
|
*/
|
|
517392
|
-
DISCRIMINATOR_CONTEXT: "x-fern-discriminator-context"
|
|
517410
|
+
DISCRIMINATOR_CONTEXT: "x-fern-discriminator-context",
|
|
517411
|
+
/**
|
|
517412
|
+
* Used to specify a client-side default value for a parameter (path, header, or query).
|
|
517413
|
+
* When present, the parameter becomes optional in the generated SDK, and the
|
|
517414
|
+
* default value is sent when the user doesn't provide one.
|
|
517415
|
+
*
|
|
517416
|
+
* Supports string and boolean literal values.
|
|
517417
|
+
*
|
|
517418
|
+
* Example usage:
|
|
517419
|
+
* parameters:
|
|
517420
|
+
* - name: X-API-Version
|
|
517421
|
+
* in: header
|
|
517422
|
+
* schema:
|
|
517423
|
+
* type: string
|
|
517424
|
+
* x-fern-default: "2024-02-08"
|
|
517425
|
+
*/
|
|
517426
|
+
FERN_DEFAULT: "x-fern-default"
|
|
517393
517427
|
};
|
|
517394
517428
|
|
|
517395
517429
|
// ../api-importers/openapi/openapi-ir-parser/lib/options.js
|
|
@@ -523731,7 +523765,8 @@ function parseAsyncAPIV2({ context: context3, breadcrumbs, source: source2, asyn
|
|
|
523731
523765
|
variableReference: void 0,
|
|
523732
523766
|
availability: convertAvailability2(parameter6),
|
|
523733
523767
|
source: source2,
|
|
523734
|
-
explode: void 0
|
|
523768
|
+
explode: void 0,
|
|
523769
|
+
clientDefault: void 0
|
|
523735
523770
|
});
|
|
523736
523771
|
}
|
|
523737
523772
|
}
|
|
@@ -523752,7 +523787,8 @@ function parseAsyncAPIV2({ context: context3, breadcrumbs, source: source2, asyn
|
|
|
523752
523787
|
parameterNameOverride: void 0,
|
|
523753
523788
|
env: void 0,
|
|
523754
523789
|
availability: convertAvailability2(resolvedSchema),
|
|
523755
|
-
source: source2
|
|
523790
|
+
source: source2,
|
|
523791
|
+
clientDefault: void 0
|
|
523756
523792
|
});
|
|
523757
523793
|
continue;
|
|
523758
523794
|
}
|
|
@@ -523765,7 +523801,8 @@ function parseAsyncAPIV2({ context: context3, breadcrumbs, source: source2, asyn
|
|
|
523765
523801
|
parameterNameOverride: void 0,
|
|
523766
523802
|
env: void 0,
|
|
523767
523803
|
availability: convertAvailability2(schema2),
|
|
523768
|
-
source: source2
|
|
523804
|
+
source: source2,
|
|
523805
|
+
clientDefault: void 0
|
|
523769
523806
|
});
|
|
523770
523807
|
}
|
|
523771
523808
|
}
|
|
@@ -523783,7 +523820,8 @@ function parseAsyncAPIV2({ context: context3, breadcrumbs, source: source2, asyn
|
|
|
523783
523820
|
parameterNameOverride: void 0,
|
|
523784
523821
|
availability: convertAvailability2(resolvedSchema),
|
|
523785
523822
|
source: source2,
|
|
523786
|
-
explode: void 0
|
|
523823
|
+
explode: void 0,
|
|
523824
|
+
clientDefault: void 0
|
|
523787
523825
|
});
|
|
523788
523826
|
continue;
|
|
523789
523827
|
}
|
|
@@ -523796,7 +523834,8 @@ function parseAsyncAPIV2({ context: context3, breadcrumbs, source: source2, asyn
|
|
|
523796
523834
|
parameterNameOverride: void 0,
|
|
523797
523835
|
availability: convertAvailability2(schema2),
|
|
523798
523836
|
source: source2,
|
|
523799
|
-
explode: void 0
|
|
523837
|
+
explode: void 0,
|
|
523838
|
+
clientDefault: void 0
|
|
523800
523839
|
});
|
|
523801
523840
|
}
|
|
523802
523841
|
}
|
|
@@ -524277,7 +524316,8 @@ function parseAsyncAPIV3({ context: context3, breadcrumbs, source: source2, asyn
|
|
|
524277
524316
|
variableReference: void 0,
|
|
524278
524317
|
availability: convertAvailability2(parameter6),
|
|
524279
524318
|
source: source2,
|
|
524280
|
-
explode: void 0
|
|
524319
|
+
explode: void 0,
|
|
524320
|
+
clientDefault: void 0
|
|
524281
524321
|
};
|
|
524282
524322
|
if (type8 === "header") {
|
|
524283
524323
|
headers2.push({
|
|
@@ -524309,7 +524349,8 @@ function parseAsyncAPIV3({ context: context3, breadcrumbs, source: source2, asyn
|
|
|
524309
524349
|
parameterNameOverride: void 0,
|
|
524310
524350
|
availability: convertAvailability2(resolvedSchema),
|
|
524311
524351
|
source: source2,
|
|
524312
|
-
explode: void 0
|
|
524352
|
+
explode: void 0,
|
|
524353
|
+
clientDefault: void 0
|
|
524313
524354
|
});
|
|
524314
524355
|
continue;
|
|
524315
524356
|
}
|
|
@@ -524322,7 +524363,8 @@ function parseAsyncAPIV3({ context: context3, breadcrumbs, source: source2, asyn
|
|
|
524322
524363
|
parameterNameOverride: void 0,
|
|
524323
524364
|
availability: convertAvailability2(schema2),
|
|
524324
524365
|
source: source2,
|
|
524325
|
-
explode: void 0
|
|
524366
|
+
explode: void 0,
|
|
524367
|
+
clientDefault: void 0
|
|
524326
524368
|
});
|
|
524327
524369
|
}
|
|
524328
524370
|
}
|
|
@@ -524344,7 +524386,8 @@ function parseAsyncAPIV3({ context: context3, breadcrumbs, source: source2, asyn
|
|
|
524344
524386
|
parameterNameOverride: void 0,
|
|
524345
524387
|
env: void 0,
|
|
524346
524388
|
availability: convertAvailability2(resolvedSchema),
|
|
524347
|
-
source: source2
|
|
524389
|
+
source: source2,
|
|
524390
|
+
clientDefault: void 0
|
|
524348
524391
|
});
|
|
524349
524392
|
continue;
|
|
524350
524393
|
}
|
|
@@ -524357,7 +524400,8 @@ function parseAsyncAPIV3({ context: context3, breadcrumbs, source: source2, asyn
|
|
|
524357
524400
|
parameterNameOverride: void 0,
|
|
524358
524401
|
env: void 0,
|
|
524359
524402
|
availability: convertAvailability2(schema2),
|
|
524360
|
-
source: source2
|
|
524403
|
+
source: source2,
|
|
524404
|
+
clientDefault: void 0
|
|
524361
524405
|
});
|
|
524362
524406
|
}
|
|
524363
524407
|
}
|
|
@@ -529548,13 +529592,15 @@ function convertParameters({ path: path97, httpMethod, parameters: parameters2,
|
|
|
529548
529592
|
});
|
|
529549
529593
|
}
|
|
529550
529594
|
}
|
|
529595
|
+
const clientDefault = getExtension(parameter6, FernOpenAPIExtension.FERN_DEFAULT) ?? getExtension(resolvedParameter, FernOpenAPIExtension.FERN_DEFAULT);
|
|
529551
529596
|
const convertedParameter = {
|
|
529552
529597
|
name: resolvedParameter.name,
|
|
529553
529598
|
schema: schema2,
|
|
529554
529599
|
description: resolvedParameter.description,
|
|
529555
529600
|
parameterNameOverride: getParameterName(resolvedParameter),
|
|
529556
529601
|
availability,
|
|
529557
|
-
source: source2
|
|
529602
|
+
source: source2,
|
|
529603
|
+
clientDefault
|
|
529558
529604
|
};
|
|
529559
529605
|
if (resolvedParameter.in === "query") {
|
|
529560
529606
|
convertedParameters.queryParameters.push({
|
|
@@ -530292,7 +530338,8 @@ function convertHttpOperation({ operationContext, context: context3, responseSta
|
|
|
530292
530338
|
title: void 0
|
|
530293
530339
|
}),
|
|
530294
530340
|
description: void 0,
|
|
530295
|
-
explode: void 0
|
|
530341
|
+
explode: void 0,
|
|
530342
|
+
clientDefault: void 0
|
|
530296
530343
|
});
|
|
530297
530344
|
}
|
|
530298
530345
|
}
|
|
@@ -530334,7 +530381,8 @@ function convertHttpOperation({ operationContext, context: context3, responseSta
|
|
|
530334
530381
|
title: void 0
|
|
530335
530382
|
}),
|
|
530336
530383
|
description: void 0,
|
|
530337
|
-
explode: void 0
|
|
530384
|
+
explode: void 0,
|
|
530385
|
+
clientDefault: void 0
|
|
530338
530386
|
});
|
|
530339
530387
|
}
|
|
530340
530388
|
}
|
|
@@ -530587,7 +530635,8 @@ function convertAsyncSyncOperation({ operationContext, context: context3, asyncE
|
|
|
530587
530635
|
parameterNameOverride: void 0,
|
|
530588
530636
|
env: void 0,
|
|
530589
530637
|
availability: void 0,
|
|
530590
|
-
source: source2
|
|
530638
|
+
source: source2,
|
|
530639
|
+
clientDefault: void 0
|
|
530591
530640
|
});
|
|
530592
530641
|
});
|
|
530593
530642
|
return {
|
|
@@ -531901,7 +531950,8 @@ function generateIr({ openApi, taskContext, options: options2, source: source2,
|
|
|
531901
531950
|
parameterNameOverride: queryParameter.parameterNameOverride,
|
|
531902
531951
|
explode: queryParameter.explode,
|
|
531903
531952
|
availability: queryParameter.availability,
|
|
531904
|
-
source: queryParameter.source
|
|
531953
|
+
source: queryParameter.source,
|
|
531954
|
+
clientDefault: queryParameter.clientDefault
|
|
531905
531955
|
};
|
|
531906
531956
|
}),
|
|
531907
531957
|
pathParameters: endpointWithExample.pathParameters.map((pathParameter) => {
|
|
@@ -531912,7 +531962,8 @@ function generateIr({ openApi, taskContext, options: options2, source: source2,
|
|
|
531912
531962
|
parameterNameOverride: pathParameter.parameterNameOverride,
|
|
531913
531963
|
variableReference: pathParameter.variableReference,
|
|
531914
531964
|
availability: pathParameter.availability,
|
|
531915
|
-
source: pathParameter.source
|
|
531965
|
+
source: pathParameter.source,
|
|
531966
|
+
clientDefault: pathParameter.clientDefault
|
|
531916
531967
|
};
|
|
531917
531968
|
}),
|
|
531918
531969
|
headers: endpointWithExample.headers.map((header) => {
|
|
@@ -531923,7 +531974,8 @@ function generateIr({ openApi, taskContext, options: options2, source: source2,
|
|
|
531923
531974
|
parameterNameOverride: header.parameterNameOverride,
|
|
531924
531975
|
env: header.env,
|
|
531925
531976
|
availability: header.availability,
|
|
531926
|
-
source: header.source
|
|
531977
|
+
source: header.source,
|
|
531978
|
+
clientDefault: header.clientDefault
|
|
531927
531979
|
};
|
|
531928
531980
|
}),
|
|
531929
531981
|
examples,
|
|
@@ -542315,6 +542367,20 @@ function removeSdkAlias(sdk) {
|
|
|
542315
542367
|
}
|
|
542316
542368
|
}
|
|
542317
542369
|
|
|
542370
|
+
// ../generation/ir-generator/lib/converters/services/convertDefaultToLiteral.js
|
|
542371
|
+
function convertDefaultToLiteral(defaultValue) {
|
|
542372
|
+
if (defaultValue == null) {
|
|
542373
|
+
return void 0;
|
|
542374
|
+
}
|
|
542375
|
+
if (typeof defaultValue === "string") {
|
|
542376
|
+
return Literal.string(defaultValue);
|
|
542377
|
+
}
|
|
542378
|
+
if (typeof defaultValue === "boolean") {
|
|
542379
|
+
return Literal.boolean(defaultValue);
|
|
542380
|
+
}
|
|
542381
|
+
return void 0;
|
|
542382
|
+
}
|
|
542383
|
+
|
|
542318
542384
|
// ../generation/ir-generator/lib/converters/services/convertExampleEndpointCall.js
|
|
542319
542385
|
init_lib4();
|
|
542320
542386
|
var import_url_join6 = __toESM(require_url_join(), 1);
|
|
@@ -544972,6 +545038,7 @@ function convertSingleUnionType({ rawValueType, rawSingleUnionType, fileContaini
|
|
|
544972
545038
|
function convertQueryParameter({ file: file4, queryParameterKey, queryParameter }) {
|
|
544973
545039
|
const { name: name2 } = getQueryParameterName({ queryParameterKey, queryParameter });
|
|
544974
545040
|
const valueType = file4.parseTypeReference(queryParameter);
|
|
545041
|
+
const defaultValue = typeof queryParameter !== "string" ? queryParameter.default : void 0;
|
|
544975
545042
|
return {
|
|
544976
545043
|
...convertDeclaration(queryParameter),
|
|
544977
545044
|
name: file4.casingsGenerator.generateNameAndWireValue({
|
|
@@ -544980,6 +545047,7 @@ function convertQueryParameter({ file: file4, queryParameterKey, queryParameter
|
|
|
544980
545047
|
}),
|
|
544981
545048
|
valueType,
|
|
544982
545049
|
allowMultiple: typeof queryParameter !== "string" && queryParameter["allow-multiple"] != null ? queryParameter["allow-multiple"] : false,
|
|
545050
|
+
clientDefault: convertDefaultToLiteral(defaultValue),
|
|
544983
545051
|
v2Examples: {
|
|
544984
545052
|
userSpecifiedExamples: {},
|
|
544985
545053
|
autogeneratedExamples: {}
|
|
@@ -546002,12 +546070,14 @@ function convertPathParameters2({ pathParameters, location: location2, file: fil
|
|
|
546002
546070
|
}));
|
|
546003
546071
|
}
|
|
546004
546072
|
function convertPathParameter({ parameterName, parameter: parameter6, location: location2, file: file4, variableResolver }) {
|
|
546073
|
+
const defaultValue = typeof parameter6 !== "string" && "type" in parameter6 ? parameter6.default : void 0;
|
|
546005
546074
|
return {
|
|
546006
546075
|
...convertDeclaration(parameter6),
|
|
546007
546076
|
name: file4.casingsGenerator.generateName(parameterName),
|
|
546008
546077
|
valueType: getPathParameterType({ parameter: parameter6, variableResolver, file: file4 }),
|
|
546009
546078
|
location: location2,
|
|
546010
546079
|
variable: isVariablePathParameter(parameter6) ? variableResolver.getVariableIdOrThrow(typeof parameter6 === "string" ? parameter6 : parameter6.variable) : void 0,
|
|
546080
|
+
clientDefault: convertDefaultToLiteral(defaultValue),
|
|
546011
546081
|
v2Examples: {
|
|
546012
546082
|
userSpecifiedExamples: {},
|
|
546013
546083
|
autogeneratedExamples: {}
|
|
@@ -546073,6 +546143,7 @@ function convertHttpMethod(method8) {
|
|
|
546073
546143
|
}
|
|
546074
546144
|
function convertHttpHeader({ headerKey, header, file: file4 }) {
|
|
546075
546145
|
const { name: name2 } = getHeaderName3({ headerKey, header });
|
|
546146
|
+
const defaultValue = typeof header !== "string" ? header.default : void 0;
|
|
546076
546147
|
return {
|
|
546077
546148
|
...convertDeclaration(header),
|
|
546078
546149
|
name: file4.casingsGenerator.generateNameAndWireValue({
|
|
@@ -546081,6 +546152,7 @@ function convertHttpHeader({ headerKey, header, file: file4 }) {
|
|
|
546081
546152
|
}),
|
|
546082
546153
|
valueType: file4.parseTypeReference(header),
|
|
546083
546154
|
env: typeof header === "string" ? void 0 : header.env,
|
|
546155
|
+
clientDefault: convertDefaultToLiteral(defaultValue),
|
|
546084
546156
|
v2Examples: {
|
|
546085
546157
|
userSpecifiedExamples: {},
|
|
546086
546158
|
autogeneratedExamples: {}
|
|
@@ -547543,7 +547615,8 @@ function convertChannel({ channel: channel3, typeResolver, exampleResolver, vari
|
|
|
547543
547615
|
userSpecifiedExamples: {},
|
|
547544
547616
|
autogeneratedExamples: {}
|
|
547545
547617
|
},
|
|
547546
|
-
explode: void 0
|
|
547618
|
+
explode: void 0,
|
|
547619
|
+
clientDefault: void 0
|
|
547547
547620
|
};
|
|
547548
547621
|
}) : [],
|
|
547549
547622
|
messages: Object.values(messages2),
|
|
@@ -585752,7 +585825,8 @@ var AbstractParameterConverter = class extends AbstractConverter {
|
|
|
585752
585825
|
schema: parameterSchemaWithExampleOverride ?? schema2
|
|
585753
585826
|
}),
|
|
585754
585827
|
availability,
|
|
585755
|
-
explode: this.getExplodeForQueryParameter()
|
|
585828
|
+
explode: this.getExplodeForQueryParameter(),
|
|
585829
|
+
clientDefault: void 0
|
|
585756
585830
|
},
|
|
585757
585831
|
inlinedTypes
|
|
585758
585832
|
};
|
|
@@ -585770,7 +585844,8 @@ var AbstractParameterConverter = class extends AbstractConverter {
|
|
|
585770
585844
|
v2Examples: this.convertParameterExamples({
|
|
585771
585845
|
schema: parameterSchemaWithExampleOverride ?? schema2
|
|
585772
585846
|
}),
|
|
585773
|
-
availability
|
|
585847
|
+
availability,
|
|
585848
|
+
clientDefault: void 0
|
|
585774
585849
|
},
|
|
585775
585850
|
inlinedTypes
|
|
585776
585851
|
};
|
|
@@ -585786,7 +585861,8 @@ var AbstractParameterConverter = class extends AbstractConverter {
|
|
|
585786
585861
|
v2Examples: this.convertParameterExamples({
|
|
585787
585862
|
schema: parameterSchemaWithExampleOverride ?? schema2
|
|
585788
585863
|
}),
|
|
585789
|
-
explode: this.getExplodeForPathParameter()
|
|
585864
|
+
explode: this.getExplodeForPathParameter(),
|
|
585865
|
+
clientDefault: void 0
|
|
585790
585866
|
},
|
|
585791
585867
|
inlinedTypes
|
|
585792
585868
|
};
|
|
@@ -588048,7 +588124,8 @@ function convertGlobalHeadersExtension({ globalHeaders, context: context3 }) {
|
|
|
588048
588124
|
env: header.env,
|
|
588049
588125
|
v2Examples: header.optional ? void 0 : constructGlobalHeaderExample({ header, context: context3 }),
|
|
588050
588126
|
availability: void 0,
|
|
588051
|
-
docs: void 0
|
|
588127
|
+
docs: void 0,
|
|
588128
|
+
clientDefault: void 0
|
|
588052
588129
|
}));
|
|
588053
588130
|
}
|
|
588054
588131
|
function constructGlobalHeaderExample({ header, context: context3 }) {
|
|
@@ -588599,7 +588676,8 @@ var AbstractOperationConverter = class extends AbstractConverter {
|
|
|
588599
588676
|
[exampleName]: this.generateStringParameterExample({ example: param })
|
|
588600
588677
|
}
|
|
588601
588678
|
},
|
|
588602
|
-
explode: void 0
|
|
588679
|
+
explode: void 0,
|
|
588680
|
+
clientDefault: void 0
|
|
588603
588681
|
});
|
|
588604
588682
|
}
|
|
588605
588683
|
}
|
|
@@ -589675,7 +589753,8 @@ var ResponseBodyConverter = class extends converters_exports.AbstractConverters.
|
|
|
589675
589753
|
valueType,
|
|
589676
589754
|
env: void 0,
|
|
589677
589755
|
v2Examples,
|
|
589678
|
-
availability: void 0
|
|
589756
|
+
availability: void 0,
|
|
589757
|
+
clientDefault: void 0
|
|
589679
589758
|
});
|
|
589680
589759
|
}
|
|
589681
589760
|
return headers2;
|
|
@@ -589949,7 +590028,8 @@ var ResponseErrorConverter = class extends converters_exports.AbstractConverters
|
|
|
589949
590028
|
valueType,
|
|
589950
590029
|
env: void 0,
|
|
589951
590030
|
v2Examples,
|
|
589952
|
-
availability: void 0
|
|
590031
|
+
availability: void 0,
|
|
590032
|
+
clientDefault: void 0
|
|
589953
590033
|
});
|
|
589954
590034
|
}
|
|
589955
590035
|
return headers2;
|
|
@@ -590452,7 +590532,8 @@ var OperationConverter = class _OperationConverter extends AbstractOperationConv
|
|
|
590452
590532
|
availability: void 0,
|
|
590453
590533
|
docs: void 0,
|
|
590454
590534
|
env: void 0,
|
|
590455
|
-
v2Examples: void 0
|
|
590535
|
+
v2Examples: void 0,
|
|
590536
|
+
clientDefault: void 0
|
|
590456
590537
|
};
|
|
590457
590538
|
switch (authScheme.type) {
|
|
590458
590539
|
case "bearer":
|
|
@@ -602380,7 +602461,7 @@ var AccessTokenPosthogManager = class {
|
|
|
602380
602461
|
properties: {
|
|
602381
602462
|
...event,
|
|
602382
602463
|
...event.properties,
|
|
602383
|
-
version: "4.
|
|
602464
|
+
version: "4.54.0",
|
|
602384
602465
|
usingAccessToken: true
|
|
602385
602466
|
}
|
|
602386
602467
|
});
|
|
@@ -602431,7 +602512,7 @@ var UserPosthogManager = class {
|
|
|
602431
602512
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
602432
602513
|
event: "CLI",
|
|
602433
602514
|
properties: {
|
|
602434
|
-
version: "4.
|
|
602515
|
+
version: "4.54.0",
|
|
602435
602516
|
...event,
|
|
602436
602517
|
...event.properties,
|
|
602437
602518
|
usingAccessToken: false,
|
|
@@ -826304,7 +826385,7 @@ var import_path54 = __toESM(require("path"), 1);
|
|
|
826304
826385
|
var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
826305
826386
|
var LOGS_FOLDER_NAME = "logs";
|
|
826306
826387
|
function getCliSource() {
|
|
826307
|
-
const version7 = "4.
|
|
826388
|
+
const version7 = "4.54.0";
|
|
826308
826389
|
return `cli@${version7}`;
|
|
826309
826390
|
}
|
|
826310
826391
|
var DebugLogger = class {
|
|
@@ -836528,7 +836609,7 @@ async function publishDocs({ token, organization, docsWorkspace, domain: domain3
|
|
|
836528
836609
|
}
|
|
836529
836610
|
return convertToFilePathPairs(startDocsRegisterResponse.body.uploadUrls, docsWorkspace.absoluteFilePath, sanitizedToAbsoluteMap);
|
|
836530
836611
|
} else {
|
|
836531
|
-
return await startDocsRegisterFailed(startDocsRegisterResponse.error, context3, organization);
|
|
836612
|
+
return await startDocsRegisterFailed(startDocsRegisterResponse.error, context3, organization, domain3);
|
|
836532
836613
|
}
|
|
836533
836614
|
} else {
|
|
836534
836615
|
const startDocsRegisterResponse = await fdr.docs.v2.write.startDocsRegister({
|
|
@@ -836564,7 +836645,7 @@ async function publishDocs({ token, organization, docsWorkspace, domain: domain3
|
|
|
836564
836645
|
}
|
|
836565
836646
|
return convertToFilePathPairs(startDocsRegisterResponse.body.uploadUrls, docsWorkspace.absoluteFilePath, sanitizedToAbsoluteMap);
|
|
836566
836647
|
} else {
|
|
836567
|
-
return startDocsRegisterFailed(startDocsRegisterResponse.error, context3, organization);
|
|
836648
|
+
return startDocsRegisterFailed(startDocsRegisterResponse.error, context3, organization, domain3);
|
|
836568
836649
|
}
|
|
836569
836650
|
}
|
|
836570
836651
|
},
|
|
@@ -836768,19 +836849,22 @@ function convertToFilePathPairs(uploadUrls, docsWorkspacePath, sanitizedToAbsolu
|
|
|
836768
836849
|
}
|
|
836769
836850
|
return toRet;
|
|
836770
836851
|
}
|
|
836771
|
-
async function startDocsRegisterFailed(error50, context3, organization) {
|
|
836852
|
+
async function startDocsRegisterFailed(error50, context3, organization, domain3) {
|
|
836772
836853
|
await context3.instrumentPostHogEvent({
|
|
836773
836854
|
command: "docs-generation",
|
|
836774
836855
|
properties: {
|
|
836775
836856
|
error: JSON.stringify(error50)
|
|
836776
836857
|
}
|
|
836777
836858
|
});
|
|
836859
|
+
const errorDetails = extractErrorDetails(error50);
|
|
836860
|
+
context3.logger.debug(`startDocsRegister failed for domain '${domain3}', org '${organization}'. Error details:
|
|
836861
|
+
${JSON.stringify(errorDetails, void 0, 2)}`);
|
|
836778
836862
|
const errorObj = error50;
|
|
836779
836863
|
const errorContent = errorObj?.content;
|
|
836780
836864
|
if (errorContent?.reason === "status-code" && errorContent?.statusCode === 409) {
|
|
836781
836865
|
throw new DocsPublishConflictError();
|
|
836782
836866
|
}
|
|
836783
|
-
const authErrorMessage = getAuthenticationErrorMessage(error50, organization);
|
|
836867
|
+
const authErrorMessage = getAuthenticationErrorMessage(error50, organization, domain3);
|
|
836784
836868
|
if (authErrorMessage != null) {
|
|
836785
836869
|
return context3.failAndThrow(authErrorMessage);
|
|
836786
836870
|
}
|
|
@@ -836790,9 +836874,7 @@ async function startDocsRegisterFailed(error50, context3, organization) {
|
|
|
836790
836874
|
case "InvalidDomainError":
|
|
836791
836875
|
return context3.failAndThrow("Please make sure that none of your custom domains are not overlapping (i.e. one is a substring of another)");
|
|
836792
836876
|
case "UnauthorizedError":
|
|
836793
|
-
return context3.failAndThrow(
|
|
836794
|
-
|
|
836795
|
-
Please ensure you have membership at https://dashboard.buildwithfern.com, and ask a team member for an invite if not.`);
|
|
836877
|
+
return context3.failAndThrow(buildAuthFailureMessage(domain3, organization, errorContent));
|
|
836796
836878
|
case "UserNotInOrgError":
|
|
836797
836879
|
return context3.failAndThrow(`You do not belong to organization '${organization}'. Please run 'fern login' to ensure you are logged in with the correct account.
|
|
836798
836880
|
|
|
@@ -836803,21 +836885,66 @@ Please ensure you have membership at https://dashboard.buildwithfern.com, and as
|
|
|
836803
836885
|
return context3.failAndThrow("Failed to publish docs.", error50);
|
|
836804
836886
|
}
|
|
836805
836887
|
}
|
|
836806
|
-
function getAuthenticationErrorMessage(error50, organization) {
|
|
836888
|
+
function getAuthenticationErrorMessage(error50, organization, domain3) {
|
|
836807
836889
|
const errorObj = error50;
|
|
836808
836890
|
const content5 = errorObj?.content;
|
|
836809
836891
|
if (content5?.reason === "status-code") {
|
|
836810
836892
|
const statusCode = content5.statusCode;
|
|
836811
836893
|
if (statusCode === 401 || statusCode === 403) {
|
|
836812
|
-
|
|
836813
|
-
const contactMessage = "Please ensure you have membership at https://dashboard.buildwithfern.com, and ask a team member for an invite if not.";
|
|
836814
|
-
return `${baseMessage}
|
|
836815
|
-
|
|
836816
|
-
${contactMessage}`;
|
|
836894
|
+
return buildAuthFailureMessage(domain3, organization, content5);
|
|
836817
836895
|
}
|
|
836818
836896
|
}
|
|
836819
836897
|
return void 0;
|
|
836820
836898
|
}
|
|
836899
|
+
function buildAuthFailureMessage(domain3, organization, errorContent) {
|
|
836900
|
+
const { code: code5, message } = extractServerError(errorContent);
|
|
836901
|
+
switch (code5) {
|
|
836902
|
+
case "FORBIDDEN":
|
|
836903
|
+
return buildForbiddenMessage(domain3, organization, message);
|
|
836904
|
+
case "UNAUTHORIZED":
|
|
836905
|
+
return buildUnauthorizedMessage(organization, message);
|
|
836906
|
+
case "INTERNAL_SERVER_ERROR":
|
|
836907
|
+
return `An internal server error occurred while publishing docs to '${domain3}'. Please try again or reach out to support@buildwithfern.com for assistance.`;
|
|
836908
|
+
default:
|
|
836909
|
+
if (message != null) {
|
|
836910
|
+
return message;
|
|
836911
|
+
}
|
|
836912
|
+
return `Failed to publish docs to '${domain3}'. Please reach out to support@buildwithfern.com for assistance.`;
|
|
836913
|
+
}
|
|
836914
|
+
}
|
|
836915
|
+
var FORBIDDEN_ORG_MEMBERSHIP_PATTERNS = ["does not belong to organization", "User does not belong"];
|
|
836916
|
+
function buildForbiddenMessage(domain3, organization, message) {
|
|
836917
|
+
if (message == null) {
|
|
836918
|
+
return `You do not have permission to publish docs to '${domain3}' under organization '${organization}'.`;
|
|
836919
|
+
}
|
|
836920
|
+
if (FORBIDDEN_ORG_MEMBERSHIP_PATTERNS.some((pattern) => message.includes(pattern))) {
|
|
836921
|
+
return `You are not a member of organization '${organization}'. Please run 'fern login' to ensure you are logged in with the correct account.
|
|
836922
|
+
|
|
836923
|
+
Please ensure you have membership at https://dashboard.buildwithfern.com, and ask a team member for an invite if not.`;
|
|
836924
|
+
}
|
|
836925
|
+
return message;
|
|
836926
|
+
}
|
|
836927
|
+
function buildUnauthorizedMessage(organization, message) {
|
|
836928
|
+
if (message != null && message.includes("Invalid authorization token")) {
|
|
836929
|
+
return "Your authentication token is invalid or expired. Please run 'fern login' to re-authenticate.";
|
|
836930
|
+
}
|
|
836931
|
+
return `You are not authorized to publish docs under organization '${organization}'. Please run 'fern login' to ensure you are logged in with the correct account.
|
|
836932
|
+
|
|
836933
|
+
Please ensure you have membership at https://dashboard.buildwithfern.com, and ask a team member for an invite if not.`;
|
|
836934
|
+
}
|
|
836935
|
+
function extractServerError(content5) {
|
|
836936
|
+
if (content5 == null) {
|
|
836937
|
+
return { code: void 0, message: void 0 };
|
|
836938
|
+
}
|
|
836939
|
+
const body = content5.body;
|
|
836940
|
+
if (body != null && typeof body === "object") {
|
|
836941
|
+
const code5 = typeof body.code === "string" ? body.code : void 0;
|
|
836942
|
+
const message2 = typeof body.message === "string" ? body.message : void 0;
|
|
836943
|
+
return { code: code5, message: message2 };
|
|
836944
|
+
}
|
|
836945
|
+
const message = typeof body === "string" && body.length > 0 ? body : typeof content5.errorMessage === "string" ? content5.errorMessage : typeof content5.message === "string" ? content5.message : void 0;
|
|
836946
|
+
return { code: void 0, message };
|
|
836947
|
+
}
|
|
836821
836948
|
function parseBasePath(domain3) {
|
|
836822
836949
|
try {
|
|
836823
836950
|
return new URL(wrapWithHttps(domain3)).pathname;
|
|
@@ -837316,7 +837443,7 @@ var LegacyDocsPublisher = class {
|
|
|
837316
837443
|
previewId: void 0,
|
|
837317
837444
|
disableTemplates: void 0,
|
|
837318
837445
|
skipUpload,
|
|
837319
|
-
cliVersion: "4.
|
|
837446
|
+
cliVersion: "4.54.0"
|
|
837320
837447
|
});
|
|
837321
837448
|
if (taskContext.getResult() === TaskResult.Failure) {
|
|
837322
837449
|
return { success: false };
|
|
@@ -875310,6 +875437,28 @@ var RustFilenameRegistry = class _RustFilenameRegistry {
|
|
|
875310
875437
|
baseTypeName
|
|
875311
875438
|
]);
|
|
875312
875439
|
}
|
|
875440
|
+
/**
|
|
875441
|
+
* Register filename for bytes request body types
|
|
875442
|
+
* @param endpointId - Unique endpoint ID from IR
|
|
875443
|
+
* @param baseFilename - Base filename in snake_case (without .rs extension)
|
|
875444
|
+
* @returns The registered unique filename (without .rs extension)
|
|
875445
|
+
*/
|
|
875446
|
+
registerBytesRequestFilename(endpointId, baseFilename) {
|
|
875447
|
+
return this.filenameRegistry.registerSymbol(this.getBytesRequestFilenameId(endpointId), [
|
|
875448
|
+
baseFilename,
|
|
875449
|
+
`${baseFilename}_request`,
|
|
875450
|
+
`${baseFilename}_bytes`
|
|
875451
|
+
]);
|
|
875452
|
+
}
|
|
875453
|
+
/**
|
|
875454
|
+
* Register type name for bytes request body
|
|
875455
|
+
* @param endpointId - Unique endpoint ID from IR
|
|
875456
|
+
* @param baseTypeName - Base type name in PascalCase
|
|
875457
|
+
* @returns The registered unique type name
|
|
875458
|
+
*/
|
|
875459
|
+
registerBytesRequestTypeName(endpointId, baseTypeName) {
|
|
875460
|
+
return this.typenameRegistry.registerSymbol(this.getBytesRequestTypeNameId(endpointId), [baseTypeName]);
|
|
875461
|
+
}
|
|
875313
875462
|
/**
|
|
875314
875463
|
* Register client name for a subpackage or root client
|
|
875315
875464
|
* @param clientId - Unique identifier for the client (subpackage ID or "root")
|
|
@@ -875451,6 +875600,28 @@ var RustFilenameRegistry = class _RustFilenameRegistry {
|
|
|
875451
875600
|
assertDefined(typename, `Type name not found for referenced request with query ${endpointId}`);
|
|
875452
875601
|
return typename;
|
|
875453
875602
|
}
|
|
875603
|
+
/**
|
|
875604
|
+
* Get registered filename for bytes request body
|
|
875605
|
+
* @param endpointId - Unique endpoint ID from IR
|
|
875606
|
+
* @returns Filename with .rs extension
|
|
875607
|
+
* @throws Error if filename not registered
|
|
875608
|
+
*/
|
|
875609
|
+
getBytesRequestFilenameOrThrow(endpointId) {
|
|
875610
|
+
const filename = this.filenameRegistry.getSymbolNameById(this.getBytesRequestFilenameId(endpointId));
|
|
875611
|
+
assertDefined(filename, `Filename not found for bytes request ${endpointId}`);
|
|
875612
|
+
return `${filename}.rs`;
|
|
875613
|
+
}
|
|
875614
|
+
/**
|
|
875615
|
+
* Get registered type name for bytes request body
|
|
875616
|
+
* @param endpointId - Unique endpoint ID from IR
|
|
875617
|
+
* @returns The unique type name
|
|
875618
|
+
* @throws Error if type name not registered
|
|
875619
|
+
*/
|
|
875620
|
+
getBytesRequestTypeNameOrThrow(endpointId) {
|
|
875621
|
+
const typename = this.typenameRegistry.getSymbolNameById(this.getBytesRequestTypeNameId(endpointId));
|
|
875622
|
+
assertDefined(typename, `Type name not found for bytes request ${endpointId}`);
|
|
875623
|
+
return typename;
|
|
875624
|
+
}
|
|
875454
875625
|
// =====================================
|
|
875455
875626
|
// Private Helper Methods
|
|
875456
875627
|
// =====================================
|
|
@@ -875487,6 +875658,12 @@ var RustFilenameRegistry = class _RustFilenameRegistry {
|
|
|
875487
875658
|
getReferencedRequestWithQueryTypeNameId(endpointId) {
|
|
875488
875659
|
return `${TYPENAME_ID_PREFIX}referenced_request_with_query_${endpointId}`;
|
|
875489
875660
|
}
|
|
875661
|
+
getBytesRequestFilenameId(endpointId) {
|
|
875662
|
+
return `${FILENAME_ID_PREFIX}bytes_request_${endpointId}`;
|
|
875663
|
+
}
|
|
875664
|
+
getBytesRequestTypeNameId(endpointId) {
|
|
875665
|
+
return `${TYPENAME_ID_PREFIX}bytes_request_${endpointId}`;
|
|
875666
|
+
}
|
|
875490
875667
|
};
|
|
875491
875668
|
|
|
875492
875669
|
// ../../../generators/rust/base/lib/utils/index.js
|
|
@@ -879814,10 +879991,7 @@ var EndpointSnippetGenerator8 = class {
|
|
|
879814
879991
|
const hasBody = request7.body != null;
|
|
879815
879992
|
const body = request7.body;
|
|
879816
879993
|
const isReferencedBodyOnly = body != null && !hasQueryParams && body.type === "referenced";
|
|
879817
|
-
|
|
879818
|
-
if (isBytesWithQueryParams) {
|
|
879819
|
-
args.push(...this.getBytesEndpointArgs({ request: request7, snippet: snippet2 }));
|
|
879820
|
-
} else if (isReferencedBodyOnly && body.type === "referenced") {
|
|
879994
|
+
if (isReferencedBodyOnly && body.type === "referenced") {
|
|
879821
879995
|
const bodyExpr = this.getReferencedRequestBodyPropertyExpression({
|
|
879822
879996
|
body: body.bodyType,
|
|
879823
879997
|
value: snippet2.requestBody
|
|
@@ -879834,34 +880008,6 @@ var EndpointSnippetGenerator8 = class {
|
|
|
879834
880008
|
}
|
|
879835
880009
|
return args;
|
|
879836
880010
|
}
|
|
879837
|
-
getBytesEndpointArgs({ request: request7, snippet: snippet2 }) {
|
|
879838
|
-
const args = [];
|
|
879839
|
-
const queryParameters = this.context.associateQueryParametersByWireValue({
|
|
879840
|
-
parameters: request7.queryParameters ?? [],
|
|
879841
|
-
values: snippet2.queryParameters ?? {}
|
|
879842
|
-
});
|
|
879843
|
-
const providedValues = /* @__PURE__ */ new Map();
|
|
879844
|
-
for (const qp4 of queryParameters) {
|
|
879845
|
-
const fieldName = this.context.getPropertyName(qp4.name.name);
|
|
879846
|
-
providedValues.set(fieldName, this.context.dynamicTypeLiteralMapper.convert(qp4));
|
|
879847
|
-
}
|
|
879848
|
-
const allQueryParams = request7.queryParameters ?? [];
|
|
879849
|
-
for (const param of allQueryParams) {
|
|
879850
|
-
const fieldName = this.context.getPropertyName(param.name.name);
|
|
879851
|
-
const value = providedValues.get(fieldName);
|
|
879852
|
-
if (value != null) {
|
|
879853
|
-
args.push(rust_exports.Expression.referenceOf(value));
|
|
879854
|
-
} else {
|
|
879855
|
-
args.push(rust_exports.Expression.referenceOf(rust_exports.Expression.raw("None")));
|
|
879856
|
-
}
|
|
879857
|
-
}
|
|
879858
|
-
if (snippet2.requestBody != null && typeof snippet2.requestBody === "string" && snippet2.requestBody !== "") {
|
|
879859
|
-
args.push(rust_exports.Expression.referenceOf(rust_exports.Expression.raw(`"${snippet2.requestBody}".as_bytes().to_vec()`)));
|
|
879860
|
-
} else {
|
|
879861
|
-
args.push(rust_exports.Expression.referenceOf(rust_exports.Expression.raw("vec![]")));
|
|
879862
|
-
}
|
|
879863
|
-
return args;
|
|
879864
|
-
}
|
|
879865
880011
|
getBodyRequestArg({ body, value }) {
|
|
879866
880012
|
switch (body.type) {
|
|
879867
880013
|
case "bytes":
|
|
@@ -879873,6 +880019,9 @@ var EndpointSnippetGenerator8 = class {
|
|
|
879873
880019
|
}
|
|
879874
880020
|
}
|
|
879875
880021
|
getBytesBodyRequestArg({ value }) {
|
|
880022
|
+
if (value == null) {
|
|
880023
|
+
return rust_exports.Expression.raw("vec![]");
|
|
880024
|
+
}
|
|
879876
880025
|
if (typeof value !== "string") {
|
|
879877
880026
|
this.context.errors.add({
|
|
879878
880027
|
severity: Severity.Critical,
|
|
@@ -910436,7 +910585,7 @@ var CliContext = class {
|
|
|
910436
910585
|
if (false) {
|
|
910437
910586
|
this.logger.error("CLI_VERSION is not defined");
|
|
910438
910587
|
}
|
|
910439
|
-
return "4.
|
|
910588
|
+
return "4.54.0";
|
|
910440
910589
|
}
|
|
910441
910590
|
getCliName() {
|
|
910442
910591
|
if (false) {
|
package/package.json
CHANGED