@fern-api/fern-api-dev 3.49.3 → 3.49.5-4-g8a859dc7967
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 +50 -18
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -1430143,7 +1430143,7 @@ var AccessTokenPosthogManager = class {
|
|
|
1430143
1430143
|
properties: {
|
|
1430144
1430144
|
...event,
|
|
1430145
1430145
|
...event.properties,
|
|
1430146
|
-
version: "3.49.
|
|
1430146
|
+
version: "3.49.5-4-g8a859dc7967",
|
|
1430147
1430147
|
usingAccessToken: true
|
|
1430148
1430148
|
}
|
|
1430149
1430149
|
});
|
|
@@ -1430242,7 +1430242,7 @@ var UserPosthogManager = class {
|
|
|
1430242
1430242
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
1430243
1430243
|
event: "CLI",
|
|
1430244
1430244
|
properties: {
|
|
1430245
|
-
version: "3.49.
|
|
1430245
|
+
version: "3.49.5-4-g8a859dc7967",
|
|
1430246
1430246
|
...event,
|
|
1430247
1430247
|
...event.properties,
|
|
1430248
1430248
|
usingAccessToken: false,
|
|
@@ -1509677,7 +1509677,7 @@ var CliContext = class {
|
|
|
1509677
1509677
|
if (false) {
|
|
1509678
1509678
|
this.logger.error("CLI_VERSION is not defined");
|
|
1509679
1509679
|
}
|
|
1509680
|
-
return "3.49.
|
|
1509680
|
+
return "3.49.5-4-g8a859dc7967";
|
|
1509681
1509681
|
}
|
|
1509682
1509682
|
getCliName() {
|
|
1509683
1509683
|
if (false) {
|
|
@@ -1557633,7 +1557633,7 @@ var OperationConverter = class _OperationConverter extends AbstractOperationConv
|
|
|
1557633
1557633
|
sdkRequest: void 0,
|
|
1557634
1557634
|
errors: errors4,
|
|
1557635
1557635
|
auth: this.computeEndpointAuth(),
|
|
1557636
|
-
security: this.
|
|
1557636
|
+
security: this.computeEndpointSecurity(),
|
|
1557637
1557637
|
availability: this.context.getAvailability({
|
|
1557638
1557638
|
node: this.operation,
|
|
1557639
1557639
|
breadcrumbs: this.breadcrumbs
|
|
@@ -1557872,6 +1557872,15 @@ var OperationConverter = class _OperationConverter extends AbstractOperationConv
|
|
|
1557872
1557872
|
}
|
|
1557873
1557873
|
return this.context.spec.security != null && this.context.spec.security.length > 0 || this.shouldApplyDefaultAuthOverrides();
|
|
1557874
1557874
|
}
|
|
1557875
|
+
computeEndpointSecurity() {
|
|
1557876
|
+
if (this.operation.security != null && this.operation.security.length === 0) {
|
|
1557877
|
+
return [];
|
|
1557878
|
+
}
|
|
1557879
|
+
if (this.context.authOverrides?.auth != null) {
|
|
1557880
|
+
return this.getDefaultSecurityFromAuthOverrides();
|
|
1557881
|
+
}
|
|
1557882
|
+
return this.operation.security ?? this.context.spec.security;
|
|
1557883
|
+
}
|
|
1557875
1557884
|
/**
|
|
1557876
1557885
|
* Converts security scheme IDs to HTTP headers
|
|
1557877
1557886
|
* @param securitySchemeIds - List of security scheme IDs
|
|
@@ -1557889,13 +1557898,24 @@ var OperationConverter = class _OperationConverter extends AbstractOperationConv
|
|
|
1557889
1557898
|
if (!this.context.authOverrides?.auth) {
|
|
1557890
1557899
|
return void 0;
|
|
1557891
1557900
|
}
|
|
1557892
|
-
const
|
|
1557893
|
-
if (typeof
|
|
1557894
|
-
|
|
1557901
|
+
const authConfig = this.context.authOverrides.auth;
|
|
1557902
|
+
if (typeof authConfig === "string") {
|
|
1557903
|
+
const securityRequirement = {};
|
|
1557904
|
+
securityRequirement[authConfig] = [];
|
|
1557905
|
+
return [securityRequirement];
|
|
1557895
1557906
|
}
|
|
1557896
|
-
|
|
1557897
|
-
|
|
1557898
|
-
|
|
1557907
|
+
if (typeof authConfig === "object" && "any" in authConfig) {
|
|
1557908
|
+
const anySchemes = authConfig.any;
|
|
1557909
|
+
if (Array.isArray(anySchemes)) {
|
|
1557910
|
+
return anySchemes.map((scheme) => {
|
|
1557911
|
+
const schemeName = typeof scheme === "string" ? scheme : scheme.scheme;
|
|
1557912
|
+
const securityRequirement = {};
|
|
1557913
|
+
securityRequirement[schemeName] = [];
|
|
1557914
|
+
return securityRequirement;
|
|
1557915
|
+
});
|
|
1557916
|
+
}
|
|
1557917
|
+
}
|
|
1557918
|
+
return void 0;
|
|
1557899
1557919
|
}
|
|
1557900
1557920
|
authSchemeToHeaders(securitySchemeIds) {
|
|
1557901
1557921
|
const headers2 = [];
|
|
@@ -1599332,7 +1599352,7 @@ function convertService(irService, ir14) {
|
|
|
1599332
1599352
|
availability: convertIrAvailability(irEndpoint.availability ?? irService.availability),
|
|
1599333
1599353
|
auth: irEndpoint.auth,
|
|
1599334
1599354
|
authV2: convertEndpointSecurity(irEndpoint.security),
|
|
1599335
|
-
multiAuth: convertMultiAuth(irEndpoint.security),
|
|
1599355
|
+
multiAuth: convertMultiAuth(irEndpoint.security, ir14.auth),
|
|
1599336
1599356
|
description: irEndpoint.docs ?? void 0,
|
|
1599337
1599357
|
method: convertHttpMethod2(irEndpoint.method),
|
|
1599338
1599358
|
defaultEnvironment: ir14.environments?.defaultEnvironment != null ? FdrAPI_exports.EnvironmentId(ir14.environments.defaultEnvironment) : void 0,
|
|
@@ -1599511,8 +1599531,13 @@ function convertEndpointSecurity(security) {
|
|
|
1599511
1599531
|
const authSchemeKeys = new Set(security.flatMap((item) => Object.keys(item)));
|
|
1599512
1599532
|
return Array.from(authSchemeKeys).map((key) => FdrAPI_exports.AuthSchemeId(key));
|
|
1599513
1599533
|
}
|
|
1599514
|
-
function convertMultiAuth(security) {
|
|
1599534
|
+
function convertMultiAuth(security, apiAuth) {
|
|
1599515
1599535
|
if (security == null) {
|
|
1599536
|
+
if (apiAuth != null && apiAuth.requirement === "ANY" && apiAuth.schemes.length > 0) {
|
|
1599537
|
+
return apiAuth.schemes.map((scheme) => ({
|
|
1599538
|
+
schemes: [FdrAPI_exports.AuthSchemeId(scheme.key)]
|
|
1599539
|
+
}));
|
|
1599540
|
+
}
|
|
1599516
1599541
|
return void 0;
|
|
1599517
1599542
|
}
|
|
1599518
1599543
|
if (security.length === 0) {
|
|
@@ -1600406,12 +1600431,12 @@ function buildExampleFromErrorType(errorDeclaration, ir14) {
|
|
|
1600406
1600431
|
}
|
|
1600407
1600432
|
|
|
1600408
1600433
|
// ../register/lib/ir-to-fdr-converter/convertIrToFdrApi.js
|
|
1600409
|
-
function convertIrToFdrApi({ ir: ir14, snippetsConfig, playgroundConfig, context: context2 }) {
|
|
1600434
|
+
function convertIrToFdrApi({ ir: ir14, snippetsConfig, playgroundConfig, context: context2, apiNameOverride }) {
|
|
1600410
1600435
|
const fdrApi = {
|
|
1600411
1600436
|
types: {},
|
|
1600412
1600437
|
subpackages: {},
|
|
1600413
1600438
|
rootPackage: convertPackage(ir14.rootPackage, ir14),
|
|
1600414
|
-
apiName: ir14.apiName.originalName,
|
|
1600439
|
+
apiName: apiNameOverride ?? ir14.apiName.originalName,
|
|
1600415
1600440
|
auth: convertAuth({ auth: ir14.auth, playgroundConfig, context: context2 }),
|
|
1600416
1600441
|
authSchemes: convertAllAuthSchemes({ auth: ir14.auth, playgroundConfig, context: context2 }),
|
|
1600417
1600442
|
snippetsConfiguration: snippetsConfig,
|
|
@@ -1601743,11 +1601768,12 @@ https://buildwithfern.com/learn/docs/getting-started/project-structure#api-defin
|
|
|
1601743
1601768
|
onError: (e6) => this.taskContext.failAndThrow(`Error substituting environment variables in API spec: ${e6}`)
|
|
1601744
1601769
|
}, { substituteAsEmpty: false });
|
|
1601745
1601770
|
}
|
|
1601771
|
+
const apiNameForRegistration = item.apiName ?? workspace.workspaceName;
|
|
1601746
1601772
|
const apiDefinitionId = await this.registerApi({
|
|
1601747
1601773
|
ir: ir14,
|
|
1601748
1601774
|
snippetsConfig,
|
|
1601749
1601775
|
playgroundConfig: { oauth: item.playground?.oauth },
|
|
1601750
|
-
apiName:
|
|
1601776
|
+
apiName: apiNameForRegistration,
|
|
1601751
1601777
|
workspace
|
|
1601752
1601778
|
});
|
|
1601753
1601779
|
const api = convertIrToApiDefinition({
|
|
@@ -1610892,7 +1610918,7 @@ var import_path40 = __toESM(require("path"), 1);
|
|
|
1610892
1610918
|
var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
|
|
1610893
1610919
|
var LOGS_FOLDER_NAME = "logs";
|
|
1610894
1610920
|
function getCliSource() {
|
|
1610895
|
-
const version7 = "3.49.
|
|
1610921
|
+
const version7 = "3.49.5-4-g8a859dc7967";
|
|
1610896
1610922
|
return `cli@${version7}`;
|
|
1610897
1610923
|
}
|
|
1610898
1610924
|
var DebugLogger = class {
|
|
@@ -1646127,7 +1646153,13 @@ async function publishDocs({ token, organization, docsWorkspace, domain: domain3
|
|
|
1646127
1646153
|
}
|
|
1646128
1646154
|
},
|
|
1646129
1646155
|
registerApi: async ({ ir: ir14, snippetsConfig, playgroundConfig, apiName, workspace }) => {
|
|
1646130
|
-
let apiDefinition = convertIrToFdrApi({
|
|
1646156
|
+
let apiDefinition = convertIrToFdrApi({
|
|
1646157
|
+
ir: ir14,
|
|
1646158
|
+
snippetsConfig,
|
|
1646159
|
+
playgroundConfig,
|
|
1646160
|
+
context: context2,
|
|
1646161
|
+
apiNameOverride: apiName
|
|
1646162
|
+
});
|
|
1646131
1646163
|
const aiEnhancerConfig = getAIEnhancerConfig(withAiExamples, docsWorkspace.config.aiExamples?.style ?? docsWorkspace.config.experimental?.aiExampleStyleInstructions);
|
|
1646132
1646164
|
if (aiEnhancerConfig && workspace) {
|
|
1646133
1646165
|
const sources = workspace.getSources();
|
|
@@ -1646168,7 +1646200,7 @@ async function publishDocs({ token, organization, docsWorkspace, domain: domain3
|
|
|
1646168
1646200
|
}
|
|
1646169
1646201
|
const response = await fdr.api.v1.register.registerApiDefinition({
|
|
1646170
1646202
|
orgId: FdrAPI_exports.OrgId(organization),
|
|
1646171
|
-
apiId: FdrAPI_exports.ApiId(ir14.apiName.originalName),
|
|
1646203
|
+
apiId: FdrAPI_exports.ApiId(apiName ?? ir14.apiName.originalName),
|
|
1646172
1646204
|
definition: apiDefinition,
|
|
1646173
1646205
|
definitionV2: void 0,
|
|
1646174
1646206
|
dynamicIRs: dynamicIRsByLanguage
|
package/package.json
CHANGED