@fern-api/fern-api-dev 5.119.2 → 5.120.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 +59 -40
  2. package/package.json +1 -1
package/cli.cjs CHANGED
@@ -37607,6 +37607,23 @@ var init_titleCase = __esm({
37607
37607
  }
37608
37608
  });
37609
37609
 
37610
+ // ../../commons/core-utils/lib/tokenizeOperationId.js
37611
+ function tokenizeOperationId(input3, respectWordBoundaries = false) {
37612
+ if (respectWordBoundaries) {
37613
+ return words_default(input3).map((token) => token.toLowerCase());
37614
+ }
37615
+ const tokens = CAMEL_OR_PASCAL_CASE_REGEX.test(input3) ? input3.split(/(?=[A-Z])/) : input3.split(/[^a-zA-Z0-9]+/);
37616
+ return compact_default(tokens.map((token) => token.toLowerCase()));
37617
+ }
37618
+ var CAMEL_OR_PASCAL_CASE_REGEX;
37619
+ var init_tokenizeOperationId = __esm({
37620
+ "../../commons/core-utils/lib/tokenizeOperationId.js"() {
37621
+ "use strict";
37622
+ init_lodash();
37623
+ CAMEL_OR_PASCAL_CASE_REGEX = /^[a-z]+(?:[A-Z][a-z]+)*$/;
37624
+ }
37625
+ });
37626
+
37610
37627
  // ../../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/code.js
37611
37628
  var require_code = __commonJS({
37612
37629
  "../../../node_modules/.pnpm/ajv@8.18.0/node_modules/ajv/dist/compile/codegen/code.js"(exports2) {
@@ -44838,6 +44855,7 @@ __export(lib_exports, {
44838
44855
  sanitizeNullValues: () => sanitizeNullValues,
44839
44856
  stripLeadingSlash: () => stripLeadingSlash,
44840
44857
  titleCase: () => titleCase,
44858
+ tokenizeOperationId: () => tokenizeOperationId,
44841
44859
  undefinedIfNullish: () => undefinedIfNullish,
44842
44860
  undefinedIfSomeNullish: () => undefinedIfSomeNullish,
44843
44861
  validateAgainstJsonSchema: () => validateAgainstJsonSchema,
@@ -44885,6 +44903,7 @@ var init_lib4 = __esm({
44885
44903
  init_semverUtils();
44886
44904
  init_stripLeadingSlash();
44887
44905
  init_titleCase();
44906
+ init_tokenizeOperationId();
44888
44907
  init_validateAgainstJsonSchema();
44889
44908
  init_visitDiscriminatedUnion();
44890
44909
  }
@@ -131280,6 +131299,7 @@ var init_OpenApiSettingsSchema2 = __esm({
131280
131299
  "ignore-tags": schemas_exports8.boolean().optional(),
131281
131300
  "respect-parameter-content": schemas_exports8.boolean().optional(),
131282
131301
  "respect-per-spec-base-path": schemas_exports8.boolean().optional(),
131302
+ "respect-operation-id-word-boundaries": schemas_exports8.boolean().optional(),
131283
131303
  "namespaced-errors": schemas_exports8.boolean().optional()
131284
131304
  }).extend(BaseApiSettingsSchema);
131285
131305
  }
@@ -147918,8 +147938,8 @@ function getUnresolvedEndpointLocation(endpoint3) {
147918
147938
  endpointId: sanitizeEndpointId(operationId)
147919
147939
  };
147920
147940
  }
147921
- const tagTokens = tokenizeString(tag2);
147922
- const operationIdTokens = tokenizeString(operationId);
147941
+ const tagTokens = tokenizeOperationId(tag2);
147942
+ const operationIdTokens = tokenizeOperationId(operationId);
147923
147943
  if (isEqual_default(tagTokens, operationIdTokens)) {
147924
147944
  return {
147925
147945
  file: RelativeFilePath.of("__package__.yml"),
@@ -147982,17 +148002,6 @@ function getEndpointLocation(endpoint3) {
147982
148002
  location: getUnresolvedEndpointLocation(endpoint3)
147983
148003
  });
147984
148004
  }
147985
- function tokenizeString(input3) {
147986
- let tokens;
147987
- if (/^[a-z]+(?:[A-Z][a-z]+)*$/.test(input3)) {
147988
- tokens = input3.split(/(?=[A-Z])/);
147989
- } else {
147990
- tokens = input3.split(/[^a-zA-Z0-9]+/);
147991
- }
147992
- tokens = tokens.map((token) => token.toLowerCase());
147993
- tokens = compact_default(tokens);
147994
- return tokens;
147995
- }
147996
148005
  function maybeGetFastApiEndpointLocation({ operationId, tag: tag2, path: path124, method: method8 }) {
147997
148006
  const pathSegment = path124.split(NON_ALPHANUMERIC_EXCEPT_BRACES_REGEX).join("_").replaceAll(BRACE_REGEX, "_");
147998
148007
  const operationIdSuffix = `${pathSegment}_${method8.toLowerCase()}`;
@@ -148010,6 +148019,7 @@ var init_getEndpointLocation = __esm({
148010
148019
  "../api-importers/openapi/openapi-ir-to-fern/lib/utils/getEndpointLocation.js"() {
148011
148020
  "use strict";
148012
148021
  init_lib12();
148022
+ init_lib4();
148013
148023
  init_lib7();
148014
148024
  init_lib6();
148015
148025
  init_lodash();
@@ -148261,8 +148271,8 @@ function getUnresolvedWebhookLocation({ webhook, context: context3 }) {
148261
148271
  endpointId: operationId
148262
148272
  };
148263
148273
  }
148264
- const tagTokens = tokenizeString(tag2);
148265
- const operationIdTokens = tokenizeString(operationId);
148274
+ const tagTokens = tokenizeOperationId(tag2);
148275
+ const operationIdTokens = tokenizeOperationId(operationId);
148266
148276
  if (isEqual_default(tagTokens, operationIdTokens)) {
148267
148277
  return {
148268
148278
  file: RelativeFilePath.of("__package__.yml"),
@@ -148501,7 +148511,6 @@ var init_buildWebhooks = __esm({
148501
148511
  init_buildTypeReference();
148502
148512
  init_convertFullExample();
148503
148513
  init_convertSdkGroupName();
148504
- init_getEndpointLocation();
148505
148514
  init_getNamespaceFromGroup();
148506
148515
  init_getTypeFromTypeReference();
148507
148516
  }
@@ -152221,6 +152230,7 @@ var init_BaseOpenAPIWorkspace = __esm({
152221
152230
  defaultIntegerFormat;
152222
152231
  pathParameterOrder;
152223
152232
  coerceConstsTo;
152233
+ respectOperationIdWordBoundaries;
152224
152234
  converter;
152225
152235
  constructor(args) {
152226
152236
  super(args);
@@ -152246,6 +152256,7 @@ var init_BaseOpenAPIWorkspace = __esm({
152246
152256
  this.defaultIntegerFormat = args.defaultIntegerFormat;
152247
152257
  this.pathParameterOrder = args.pathParameterOrder;
152248
152258
  this.coerceConstsTo = args.coerceConstsTo;
152259
+ this.respectOperationIdWordBoundaries = args.respectOperationIdWordBoundaries;
152249
152260
  this.converter = new FernDefinitionConverter(args);
152250
152261
  }
152251
152262
  async getDefinition({ context: context3, absoluteFilePath, relativePathToDependency }, settings) {
@@ -153167,6 +153178,7 @@ var init_options2 = __esm({
153167
153178
  ignoreTags: false,
153168
153179
  respectParameterContent: false,
153169
153180
  respectPerSpecBasePath: false,
153181
+ respectOperationIdWordBoundaries: false,
153170
153182
  namespacedErrors: false
153171
153183
  };
153172
153184
  }
@@ -200400,6 +200412,7 @@ var init_getAPIDefinitionSettings = __esm({
200400
200412
  ignoreTags: "ignoreTags",
200401
200413
  respectParameterContent: "respectParameterContent",
200402
200414
  respectPerSpecBasePath: "respectPerSpecBasePath",
200415
+ respectOperationIdWordBoundaries: "respectOperationIdWordBoundaries",
200403
200416
  namespacedErrors: "namespacedErrors"
200404
200417
  };
200405
200418
  }
@@ -265615,6 +265628,7 @@ function parseOpenApiDefinitionSettingsSchema(settings) {
265615
265628
  ignoreTags: settings?.["ignore-tags"],
265616
265629
  respectParameterContent: settings?.["respect-parameter-content"],
265617
265630
  respectPerSpecBasePath: settings?.["respect-per-spec-base-path"],
265631
+ respectOperationIdWordBoundaries: settings?.["respect-operation-id-word-boundaries"],
265618
265632
  namespacedErrors: settings?.["namespaced-errors"]
265619
265633
  };
265620
265634
  }
@@ -266490,6 +266504,7 @@ var init_convertGeneratorsConfiguration = __esm({
266490
266504
  ignoreTags: void 0,
266491
266505
  respectParameterContent: void 0,
266492
266506
  respectPerSpecBasePath: void 0,
266507
+ respectOperationIdWordBoundaries: void 0,
266493
266508
  namespacedErrors: void 0
266494
266509
  };
266495
266510
  }
@@ -357806,21 +357821,6 @@ var init_RequestBodyConverter = __esm({
357806
357821
  });
357807
357822
 
357808
357823
  // ../api-importers/openapi-to-ir/lib/3.1/paths/operations/AbstractOperationConverter.js
357809
- function tokenizeString2(input3) {
357810
- let tokens = isCamelOrPascalCase(input3) ? splitOnCapitalLetters(input3) : splitOnNonAlphanumericCharacters(input3);
357811
- tokens = tokens.map((token) => token.toLowerCase());
357812
- tokens = compact_default(tokens);
357813
- return tokens;
357814
- }
357815
- function isCamelOrPascalCase(input3) {
357816
- return /^[a-z]+(?:[A-Z][a-z]+)*$/.test(input3);
357817
- }
357818
- function splitOnCapitalLetters(input3) {
357819
- return input3.split(/(?=[A-Z])/);
357820
- }
357821
- function splitOnNonAlphanumericCharacters(input3) {
357822
- return input3.split(/[^a-zA-Z0-9]+/);
357823
- }
357824
357824
  function isHeaderAuthScheme3(scheme) {
357825
357825
  return scheme?.header != null;
357826
357826
  }
@@ -357828,6 +357828,7 @@ var PATH_PARAM_REGEX, HEADERS_TO_SKIP2, AbstractOperationConverter;
357828
357828
  var init_AbstractOperationConverter = __esm({
357829
357829
  "../api-importers/openapi-to-ir/lib/3.1/paths/operations/AbstractOperationConverter.js"() {
357830
357830
  "use strict";
357831
+ init_lib4();
357831
357832
  init_lib9();
357832
357833
  init_lib22();
357833
357834
  init_lib30();
@@ -358077,8 +358078,9 @@ var init_AbstractOperationConverter = __esm({
358077
358078
  if (tag2 == null) {
358078
358079
  return { method: this.sanitizeMethodName(methodName) };
358079
358080
  }
358080
- const tagTokens = tokenizeString2(tag2);
358081
- const methodNameTokens = tokenizeString2(methodName);
358081
+ const respectWordBoundaries = this.context.settings.respectOperationIdWordBoundaries;
358082
+ const tagTokens = tokenizeOperationId(tag2, respectWordBoundaries);
358083
+ const methodNameTokens = tokenizeOperationId(methodName, respectWordBoundaries);
358082
358084
  if (isEqual_default(tagTokens, methodNameTokens)) {
358083
358085
  return {
358084
358086
  method: tag2
@@ -358100,6 +358102,12 @@ var init_AbstractOperationConverter = __esm({
358100
358102
  };
358101
358103
  }
358102
358104
  const methodTokens = methodNameTokens.slice(tagTokens.length);
358105
+ if (methodTokens[0] != null && /^\d/.test(methodTokens[0])) {
358106
+ return {
358107
+ group: [tag2],
358108
+ method: this.sanitizeMethodName(methodName)
358109
+ };
358110
+ }
358103
358111
  return {
358104
358112
  group: [tag2],
358105
358113
  method: camelCase_default(methodTokens.join("_"))
@@ -375111,7 +375119,8 @@ var init_OSSWorkspace = __esm({
375111
375119
  inferDefaultEnvironment: collapseSpecBooleanSetting(specs, (s5) => s5?.inferDefaultEnvironment),
375112
375120
  defaultIntegerFormat: specs[0]?.settings?.defaultIntegerFormat,
375113
375121
  pathParameterOrder: specs[0]?.settings?.pathParameterOrder,
375114
- coerceConstsTo: specs[0]?.settings?.coerceConstsTo
375122
+ coerceConstsTo: specs[0]?.settings?.coerceConstsTo,
375123
+ respectOperationIdWordBoundaries: collapseSpecBooleanSetting(specs, (s5) => s5?.respectOperationIdWordBoundaries)
375115
375124
  });
375116
375125
  this.specs = specs;
375117
375126
  this.allSpecs = allSpecs;
@@ -698124,6 +698133,15 @@ var OpenApiSettingsSchema2 = BaseApiSettingsSchema2.extend({
698124
698133
  * Defaults to false.
698125
698134
  */
698126
698135
  "respect-per-spec-base-path": external_exports.boolean().optional(),
698136
+ /**
698137
+ * If true, operation ids are split on every word boundary (camelCase transitions and digits)
698138
+ * when deriving endpoint names, so a redundant tag prefix is stripped and the remaining words
698139
+ * are preserved (e.g. tag `sharing` + operation id `Sharing_ListFolderMembers` yields
698140
+ * `listFolderMembers` rather than `listfoldermembers`).
698141
+ * This changes endpoint names, and therefore SDK method names and docs URLs.
698142
+ * Defaults to false.
698143
+ */
698144
+ "respect-operation-id-word-boundaries": external_exports.boolean().optional(),
698127
698145
  /**
698128
698146
  * If true, an error whose body schema carries `x-fern-sdk-namespace` is declared in, and shared
698129
698147
  * within, that namespace instead of the endpoint's namespace.
@@ -706720,7 +706738,7 @@ var AccessTokenPosthogManager = class {
706720
706738
  properties: {
706721
706739
  ...event,
706722
706740
  ...event.properties,
706723
- version: "5.119.2",
706741
+ version: "5.120.0",
706724
706742
  usingAccessToken: true,
706725
706743
  ...getRunIdProperties()
706726
706744
  }
@@ -706786,7 +706804,7 @@ var UserPosthogManager = class {
706786
706804
  distinctId: this.userId ?? await this.getPersistedDistinctId(),
706787
706805
  event: "CLI",
706788
706806
  properties: {
706789
- version: "5.119.2",
706807
+ version: "5.120.0",
706790
706808
  ...event,
706791
706809
  ...event.properties,
706792
706810
  usingAccessToken: false,
@@ -713606,6 +713624,7 @@ var LegacyApiSpecAdapter = class {
713606
713624
  ignoreTags: settings["ignore-tags"],
713607
713625
  respectParameterContent: settings["respect-parameter-content"],
713608
713626
  respectPerSpecBasePath: settings["respect-per-spec-base-path"],
713627
+ respectOperationIdWordBoundaries: settings["respect-operation-id-word-boundaries"],
713609
713628
  namespacedErrors: settings["namespaced-errors"]
713610
713629
  };
713611
713630
  const hasSettings = Object.values(result).some((v3) => v3 != null);
@@ -888464,7 +888483,7 @@ var LOCAL_STORAGE_FOLDER4 = ".fern-dev";
888464
888483
  var LOGS_FOLDER_NAME = "logs";
888465
888484
  var MAX_LOGS_DIR_SIZE_BYTES = 100 * 1024 * 1024;
888466
888485
  function getCliSource() {
888467
- const version7 = "5.119.2";
888486
+ const version7 = "5.120.0";
888468
888487
  return `cli@${version7}`;
888469
888488
  }
888470
888489
  var DebugLogger = class {
@@ -915811,7 +915830,7 @@ var LegacyDocsPublisher = class {
915811
915830
  previewId,
915812
915831
  disableTemplates: void 0,
915813
915832
  skipUpload,
915814
- cliVersion: "5.119.2",
915833
+ cliVersion: "5.120.0",
915815
915834
  loginCommand: "fern auth login"
915816
915835
  });
915817
915836
  if (taskContext.getResult() === TaskResult.Failure) {
@@ -983229,7 +983248,7 @@ function getAutomationContextFromEnv() {
983229
983248
  config_branch: process.env.FERN_CONFIG_BRANCH,
983230
983249
  config_pr_number: process.env.FERN_CONFIG_PR_NUMBER,
983231
983250
  trigger: process.env.GITHUB_EVENT_NAME,
983232
- cli_version: "5.119.2"
983251
+ cli_version: "5.120.0"
983233
983252
  };
983234
983253
  }
983235
983254
  function isAutomationMode() {
@@ -984061,7 +984080,7 @@ var CliContext = class _CliContext {
984061
984080
  if (false) {
984062
984081
  this.logger.error("CLI_VERSION is not defined");
984063
984082
  }
984064
- return "5.119.2";
984083
+ return "5.120.0";
984065
984084
  }
984066
984085
  getCliName() {
984067
984086
  if (false) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "5.119.2",
2
+ "version": "5.120.0",
3
3
  "repository": {
4
4
  "type": "git",
5
5
  "url": "git+https://github.com/fern-api/fern.git",