fern-api 0.30.0-rc0 → 0.30.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/bundle.cjs +45 -15
- package/package.json +1 -1
package/bundle.cjs
CHANGED
|
@@ -1032732,12 +1032732,13 @@ var GeneratorInvocationSchema = z.strictObject({
|
|
|
1032732
1032732
|
output: z.optional(GeneratorOutputSchema),
|
|
1032733
1032733
|
github: z.optional(GithubConfigurationSchema),
|
|
1032734
1032734
|
config: z.unknown(),
|
|
1032735
|
+
metadata: z.optional(GeneratorPublishMetadataSchema),
|
|
1032736
|
+
keywords: z.optional(z.array(z.string())),
|
|
1032737
|
+
snippets: z.optional(GeneratorSnippetsSchema),
|
|
1032735
1032738
|
"ir-version": z.optional(z.string()),
|
|
1032736
1032739
|
"smart-casing": z.optional(z.boolean()),
|
|
1032737
1032740
|
"disable-examples": z.optional(z.boolean()),
|
|
1032738
|
-
|
|
1032739
|
-
"publish-metadata": z.optional(GeneratorPublishMetadataSchema),
|
|
1032740
|
-
metadata: z.optional(GeneratorPublishMetadataSchema)
|
|
1032741
|
+
"publish-metadata": z.optional(GeneratorPublishMetadataSchema)
|
|
1032741
1032742
|
});
|
|
1032742
1032743
|
|
|
1032743
1032744
|
// pnp:/home/circleci/project/packages/cli/configuration/lib/generators-yml/schemas/GeneratorGroupSchema.js
|
|
@@ -1032934,6 +1032935,7 @@ async function convertGenerator({ absolutePathToGeneratorsConfiguration, generat
|
|
|
1032934
1032935
|
maybeGroupLevelMetadata,
|
|
1032935
1032936
|
maybeTopLevelMetadata
|
|
1032936
1032937
|
}),
|
|
1032938
|
+
keywords: generator.keywords,
|
|
1032937
1032939
|
smartCasing: generator["smart-casing"] ?? false,
|
|
1032938
1032940
|
disableExamples: generator["disable-examples"] ?? false,
|
|
1032939
1032941
|
absolutePathToLocalOutput: ((_a5 = generator.output) == null ? void 0 : _a5.location) === "local-file-system" ? resolve(dirname(absolutePathToGeneratorsConfiguration), generator.output.path) : void 0,
|
|
@@ -1036166,7 +1036168,7 @@ var AccessTokenPosthogManager = class {
|
|
|
1036166
1036168
|
properties: {
|
|
1036167
1036169
|
...event,
|
|
1036168
1036170
|
...event.properties,
|
|
1036169
|
-
version: "0.30.0
|
|
1036171
|
+
version: "0.30.0",
|
|
1036170
1036172
|
usingAccessToken: true
|
|
1036171
1036173
|
}
|
|
1036172
1036174
|
});
|
|
@@ -1036228,7 +1036230,7 @@ var UserPosthogManager = class {
|
|
|
1036228
1036230
|
distinctId: this.userId ?? await this.getPersistedDistinctId(),
|
|
1036229
1036231
|
event: "CLI",
|
|
1036230
1036232
|
properties: {
|
|
1036231
|
-
version: "0.30.0
|
|
1036233
|
+
version: "0.30.0",
|
|
1036232
1036234
|
...event,
|
|
1036233
1036235
|
...event.properties
|
|
1036234
1036236
|
}
|
|
@@ -1053898,10 +1053900,10 @@ var CliContext = class {
|
|
|
1053898
1053900
|
return "fern-api";
|
|
1053899
1053901
|
}
|
|
1053900
1053902
|
getPackageVersion() {
|
|
1053901
|
-
if ("0.30.0
|
|
1053903
|
+
if ("0.30.0" == null) {
|
|
1053902
1053904
|
this.logger.error("CLI_VERSION is not defined");
|
|
1053903
1053905
|
}
|
|
1053904
|
-
return "0.30.0
|
|
1053906
|
+
return "0.30.0";
|
|
1053905
1053907
|
}
|
|
1053906
1053908
|
getCliName() {
|
|
1053907
1053909
|
if ("fern" == null) {
|
|
@@ -1054492,13 +1054494,16 @@ var RESERVED_KEYWORDS = {
|
|
|
1054492
1054494
|
|
|
1054493
1054495
|
// pnp:/home/circleci/project/packages/cli/generation/ir-generator/lib/casings/CasingsGenerator.js
|
|
1054494
1054496
|
var CAPITALIZE_INITIALISM = ["go", "ruby"];
|
|
1054495
|
-
function constructCasingsGenerator({ generationLanguage, smartCasing }) {
|
|
1054497
|
+
function constructCasingsGenerator({ generationLanguage, keywords: keywords3, smartCasing }) {
|
|
1054496
1054498
|
const casingsGenerator = {
|
|
1054497
1054499
|
generateName: (name2, opts) => {
|
|
1054498
1054500
|
var _a5, _b4, _c4, _d2;
|
|
1054499
1054501
|
const generateSafeAndUnsafeString = (unsafeString) => ({
|
|
1054500
1054502
|
unsafeName: unsafeString,
|
|
1054501
|
-
safeName:
|
|
1054503
|
+
safeName: sanitizeName({
|
|
1054504
|
+
name: unsafeString,
|
|
1054505
|
+
keywords: getKeywords({ generationLanguage, keywords: keywords3 })
|
|
1054506
|
+
})
|
|
1054502
1054507
|
});
|
|
1054503
1054508
|
let camelCaseName = camelCase_default(name2);
|
|
1054504
1054509
|
let pascalCaseName = upperFirst_default(camelCaseName);
|
|
@@ -1054549,12 +1054554,11 @@ function constructCasingsGenerator({ generationLanguage, smartCasing }) {
|
|
|
1054549
1054554
|
};
|
|
1054550
1054555
|
return casingsGenerator;
|
|
1054551
1054556
|
}
|
|
1054552
|
-
function
|
|
1054553
|
-
if (
|
|
1054557
|
+
function sanitizeName({ name: name2, keywords: keywords3 }) {
|
|
1054558
|
+
if (keywords3 == null) {
|
|
1054554
1054559
|
return name2;
|
|
1054555
1054560
|
}
|
|
1054556
|
-
|
|
1054557
|
-
if (reservedKeywords.has(name2)) {
|
|
1054561
|
+
if (keywords3.has(name2)) {
|
|
1054558
1054562
|
return name2 + "_";
|
|
1054559
1054563
|
} else if (startsWithNumber2(name2)) {
|
|
1054560
1054564
|
return "_" + name2;
|
|
@@ -1054562,6 +1054566,15 @@ function sanitizeNameForLanguage(name2, generationLanguage) {
|
|
|
1054562
1054566
|
return name2;
|
|
1054563
1054567
|
}
|
|
1054564
1054568
|
}
|
|
1054569
|
+
function getKeywords({ generationLanguage, keywords: keywords3 }) {
|
|
1054570
|
+
if (keywords3 != null) {
|
|
1054571
|
+
return new Set(keywords3);
|
|
1054572
|
+
}
|
|
1054573
|
+
if (generationLanguage != null) {
|
|
1054574
|
+
return RESERVED_KEYWORDS[generationLanguage];
|
|
1054575
|
+
}
|
|
1054576
|
+
return void 0;
|
|
1054577
|
+
}
|
|
1054565
1054578
|
var STARTS_WITH_NUMBER2 = /^[0-9]/;
|
|
1054566
1054579
|
function startsWithNumber2(str3) {
|
|
1054567
1054580
|
return STARTS_WITH_NUMBER2.test(str3);
|
|
@@ -1055232,6 +1055245,7 @@ function constructFernFileContext({ relativeFilepath, definitionFile, casingsGen
|
|
|
1055232
1055245
|
// pnp:/home/circleci/project/packages/cli/generation/ir-generator/lib/utils/getAllPropertiesForObject.js
|
|
1055233
1055246
|
var CASINGS_GENERATOR = constructCasingsGenerator({
|
|
1055234
1055247
|
generationLanguage: void 0,
|
|
1055248
|
+
keywords: void 0,
|
|
1055235
1055249
|
smartCasing: false
|
|
1055236
1055250
|
});
|
|
1055237
1055251
|
function getAllPropertiesForObject({
|
|
@@ -1055257,6 +1055271,7 @@ function getAllPropertiesForObject({
|
|
|
1055257
1055271
|
if (smartCasing) {
|
|
1055258
1055272
|
casingsGenerator = constructCasingsGenerator({
|
|
1055259
1055273
|
generationLanguage: void 0,
|
|
1055274
|
+
keywords: void 0,
|
|
1055260
1055275
|
smartCasing
|
|
1055261
1055276
|
});
|
|
1055262
1055277
|
}
|
|
@@ -1060658,8 +1060673,8 @@ var VariableResolverImpl = _VariableResolverImpl;
|
|
|
1060658
1060673
|
__publicField(VariableResolverImpl, "VARIABLE_PREFIX", "$");
|
|
1060659
1060674
|
|
|
1060660
1060675
|
// pnp:/home/circleci/project/packages/cli/generation/ir-generator/lib/generateIntermediateRepresentation.js
|
|
1060661
|
-
async function generateIntermediateRepresentation({ workspace, generationLanguage, smartCasing, disableExamples, audiences }) {
|
|
1060662
|
-
const casingsGenerator = constructCasingsGenerator({ generationLanguage, smartCasing });
|
|
1060676
|
+
async function generateIntermediateRepresentation({ workspace, generationLanguage, keywords: keywords3, smartCasing, disableExamples, audiences }) {
|
|
1060677
|
+
const casingsGenerator = constructCasingsGenerator({ generationLanguage, keywords: keywords3, smartCasing });
|
|
1060663
1060678
|
const irGraph = new IrGraph(audiences);
|
|
1060664
1060679
|
const rootApiFileContext = constructRootApiFileContext({
|
|
1060665
1060680
|
casingsGenerator,
|
|
@@ -1068612,6 +1068627,7 @@ var DocsDefinitionResolver = class {
|
|
|
1068612
1068627
|
workspace,
|
|
1068613
1068628
|
audiences: item.audiences,
|
|
1068614
1068629
|
generationLanguage: void 0,
|
|
1068630
|
+
keywords: void 0,
|
|
1068615
1068631
|
smartCasing: false,
|
|
1068616
1068632
|
disableExamples: false
|
|
1068617
1068633
|
});
|
|
@@ -1071511,6 +1071527,7 @@ async function registerApi({ organization, workspace, context, token, audiences,
|
|
|
1071511
1071527
|
workspace,
|
|
1071512
1071528
|
audiences,
|
|
1071513
1071529
|
generationLanguage: void 0,
|
|
1071530
|
+
keywords: void 0,
|
|
1071514
1071531
|
smartCasing: false,
|
|
1071515
1071532
|
disableExamples: false
|
|
1071516
1071533
|
});
|
|
@@ -1095666,6 +1095683,7 @@ function minimumString(strings) {
|
|
|
1095666
1095683
|
// pnp:/home/circleci/project/packages/cli/yaml/validator/lib/utils/casingsGenerator.js
|
|
1095667
1095684
|
var CASINGS_GENERATOR2 = constructCasingsGenerator({
|
|
1095668
1095685
|
generationLanguage: void 0,
|
|
1095686
|
+
keywords: void 0,
|
|
1095669
1095687
|
smartCasing: false
|
|
1095670
1095688
|
});
|
|
1095671
1095689
|
|
|
@@ -1099313,6 +1099331,7 @@ async function generateIrForFernWorkspace({
|
|
|
1099313
1099331
|
workspace,
|
|
1099314
1099332
|
context,
|
|
1099315
1099333
|
generationLanguage,
|
|
1099334
|
+
keywords: keywords3,
|
|
1099316
1099335
|
smartCasing,
|
|
1099317
1099336
|
disableExamples,
|
|
1099318
1099337
|
audiences
|
|
@@ -1099321,6 +1099340,7 @@ async function generateIrForFernWorkspace({
|
|
|
1099321
1099340
|
return generateIntermediateRepresentation({
|
|
1099322
1099341
|
workspace,
|
|
1099323
1099342
|
generationLanguage,
|
|
1099343
|
+
keywords: keywords3,
|
|
1099324
1099344
|
smartCasing,
|
|
1099325
1099345
|
disableExamples,
|
|
1099326
1099346
|
audiences
|
|
@@ -1099343,6 +1099363,7 @@ async function generateFdrApiDefinitionForWorkspaces({
|
|
|
1099343
1099363
|
context,
|
|
1099344
1099364
|
generationLanguage: void 0,
|
|
1099345
1099365
|
audiences,
|
|
1099366
|
+
keywords: void 0,
|
|
1099346
1099367
|
smartCasing: false,
|
|
1099347
1099368
|
disableExamples: false
|
|
1099348
1099369
|
});
|
|
@@ -1106914,6 +1106935,7 @@ async function generateIrForWorkspaces({
|
|
|
1106914
1106935
|
generationLanguage,
|
|
1106915
1106936
|
audiences,
|
|
1106916
1106937
|
version: version3,
|
|
1106938
|
+
keywords: keywords3,
|
|
1106917
1106939
|
smartCasing
|
|
1106918
1106940
|
}) {
|
|
1106919
1106941
|
await Promise.all(
|
|
@@ -1106947,6 +1106969,7 @@ async function generateIrForWorkspaces({
|
|
|
1106947
1106969
|
workspace: fernWorkspace,
|
|
1106948
1106970
|
context,
|
|
1106949
1106971
|
generationLanguage,
|
|
1106972
|
+
keywords: keywords3,
|
|
1106950
1106973
|
smartCasing,
|
|
1106951
1106974
|
disableExamples: false,
|
|
1106952
1106975
|
audiences,
|
|
@@ -1106967,6 +1106990,7 @@ async function getIntermediateRepresentation({
|
|
|
1106967
1106990
|
context,
|
|
1106968
1106991
|
generationLanguage,
|
|
1106969
1106992
|
audiences,
|
|
1106993
|
+
keywords: keywords3,
|
|
1106970
1106994
|
smartCasing,
|
|
1106971
1106995
|
disableExamples,
|
|
1106972
1106996
|
version: version3
|
|
@@ -1106976,6 +1107000,7 @@ async function getIntermediateRepresentation({
|
|
|
1106976
1107000
|
context,
|
|
1106977
1107001
|
generationLanguage,
|
|
1106978
1107002
|
audiences,
|
|
1107003
|
+
keywords: keywords3,
|
|
1106979
1107004
|
smartCasing,
|
|
1106980
1107005
|
disableExamples
|
|
1106981
1107006
|
});
|
|
@@ -1107364,6 +1107389,7 @@ async function getIntermediateRepresentation2({ workspace, audiences, generatorI
|
|
|
1107364
1107389
|
workspace,
|
|
1107365
1107390
|
audiences,
|
|
1107366
1107391
|
generationLanguage: generatorInvocation.language,
|
|
1107392
|
+
keywords: generatorInvocation.keywords,
|
|
1107367
1107393
|
smartCasing: generatorInvocation.smartCasing,
|
|
1107368
1107394
|
disableExamples: generatorInvocation.disableExamples
|
|
1107369
1107395
|
});
|
|
@@ -1108200,6 +1108226,7 @@ async function runRemoteGenerationForGenerator({ projectConfig, organization, wo
|
|
|
1108200
1108226
|
const intermediateRepresentation = await generateIntermediateRepresentation({
|
|
1108201
1108227
|
workspace,
|
|
1108202
1108228
|
generationLanguage: generatorInvocation.language,
|
|
1108229
|
+
keywords: generatorInvocation.keywords,
|
|
1108203
1108230
|
smartCasing: generatorInvocation.smartCasing,
|
|
1108204
1108231
|
disableExamples: generatorInvocation.disableExamples,
|
|
1108205
1108232
|
audiences
|
|
@@ -1108987,6 +1109014,7 @@ async function mockServer({
|
|
|
1108987
1109014
|
workspace: fernWorkspace,
|
|
1108988
1109015
|
audiences: { type: "all" },
|
|
1108989
1109016
|
generationLanguage: void 0,
|
|
1109017
|
+
keywords: void 0,
|
|
1108990
1109018
|
smartCasing: false,
|
|
1108991
1109019
|
disableExamples: false
|
|
1108992
1109020
|
});
|
|
@@ -1109117,6 +1109145,7 @@ async function testOutput({
|
|
|
1109117
1109145
|
workspace: fernWorkspace,
|
|
1109118
1109146
|
audiences: { type: "all" },
|
|
1109119
1109147
|
generationLanguage: void 0,
|
|
1109148
|
+
keywords: void 0,
|
|
1109120
1109149
|
smartCasing: false,
|
|
1109121
1109150
|
disableExamples: false
|
|
1109122
1109151
|
});
|
|
@@ -1112283,6 +1112312,7 @@ function addIrCommand(cli, cliContext) {
|
|
|
1112283
1112312
|
generationLanguage: argv.language,
|
|
1112284
1112313
|
audiences: argv.audience.length > 0 ? { type: "select", audiences: argv.audience } : { type: "all" },
|
|
1112285
1112314
|
version: argv.version,
|
|
1112315
|
+
keywords: void 0,
|
|
1112286
1112316
|
smartCasing: false
|
|
1112287
1112317
|
});
|
|
1112288
1112318
|
}
|