@fern-api/fdr-sdk 1.2.93-91063bdea2 → 1.2.93-c507986598

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 (47) hide show
  1. package/dist/client/libraryDocs.d.ts +5 -0
  2. package/dist/client/libraryDocs.d.ts.map +1 -1
  3. package/dist/js/client/FdrClient.js +120 -1
  4. package/dist/js/client/FdrClient.js.map +1 -1
  5. package/dist/js/client/FdrClient.mjs +120 -1
  6. package/dist/js/client/FdrClient.mjs.map +1 -1
  7. package/dist/js/client/types.js.map +1 -1
  8. package/dist/js/client/types.mjs.map +1 -1
  9. package/dist/js/converters/index.js.map +1 -1
  10. package/dist/js/converters/index.mjs.map +1 -1
  11. package/dist/js/index.js +120 -1
  12. package/dist/js/index.js.map +1 -1
  13. package/dist/js/index.mjs +120 -1
  14. package/dist/js/index.mjs.map +1 -1
  15. package/dist/js/navigation/index.js.map +1 -1
  16. package/dist/js/navigation/index.mjs.map +1 -1
  17. package/dist/js/orpc-client.js +130 -3
  18. package/dist/js/orpc-client.js.map +1 -1
  19. package/dist/js/orpc-client.mjs +125 -2
  20. package/dist/js/orpc-client.mjs.map +1 -1
  21. package/dist/orpc-client/docs/v2/library-docs/__test__/doxyfile.test.d.ts +2 -0
  22. package/dist/orpc-client/docs/v2/library-docs/__test__/doxyfile.test.d.ts.map +1 -0
  23. package/dist/orpc-client/docs/v2/library-docs/__test__/doxyfile.test.js +68 -0
  24. package/dist/orpc-client/docs/v2/library-docs/__test__/doxyfile.test.js.map +1 -0
  25. package/dist/orpc-client/docs/v2/library-docs/contract.d.ts +9 -3
  26. package/dist/orpc-client/docs/v2/library-docs/contract.d.ts.map +1 -1
  27. package/dist/orpc-client/docs/v2/library-docs/contract.js +15 -1
  28. package/dist/orpc-client/docs/v2/library-docs/contract.js.map +1 -1
  29. package/dist/orpc-client/docs/v2/library-docs/doxyfile.d.ts +32 -0
  30. package/dist/orpc-client/docs/v2/library-docs/doxyfile.d.ts.map +1 -0
  31. package/dist/orpc-client/docs/v2/library-docs/doxyfile.js +142 -0
  32. package/dist/orpc-client/docs/v2/library-docs/doxyfile.js.map +1 -0
  33. package/dist/orpc-client/docs/v2/library-docs/index.d.ts +1 -0
  34. package/dist/orpc-client/docs/v2/library-docs/index.d.ts.map +1 -1
  35. package/dist/orpc-client/docs/v2/library-docs/index.js +1 -0
  36. package/dist/orpc-client/docs/v2/library-docs/index.js.map +1 -1
  37. package/dist/types/client/libraryDocs.d.ts +5 -0
  38. package/dist/types/client/libraryDocs.d.ts.map +1 -1
  39. package/dist/types/orpc-client/docs/v2/library-docs/__test__/doxyfile.test.d.ts +2 -0
  40. package/dist/types/orpc-client/docs/v2/library-docs/__test__/doxyfile.test.d.ts.map +1 -0
  41. package/dist/types/orpc-client/docs/v2/library-docs/contract.d.ts +9 -3
  42. package/dist/types/orpc-client/docs/v2/library-docs/contract.d.ts.map +1 -1
  43. package/dist/types/orpc-client/docs/v2/library-docs/doxyfile.d.ts +32 -0
  44. package/dist/types/orpc-client/docs/v2/library-docs/doxyfile.d.ts.map +1 -0
  45. package/dist/types/orpc-client/docs/v2/library-docs/index.d.ts +1 -0
  46. package/dist/types/orpc-client/docs/v2/library-docs/index.d.ts.map +1 -1
  47. package/package.json +1 -1
@@ -92,6 +92,7 @@ __export(orpc_client_exports, {
92
92
  CurrentVersionInputSchema: () => CurrentVersionInputSchema,
93
93
  CurrentVersionResponseSchema: () => CurrentVersionResponseSchema,
94
94
  CustomSnippetPayloadSchema: () => CustomSnippetPayloadSchema,
95
+ DOXYFILE_ALLOWED_KEYS: () => DOXYFILE_ALLOWED_KEYS,
95
96
  DashboardAnalyticsCommonInputSchema: () => DashboardAnalyticsCommonInputSchema,
96
97
  DashboardDocsSiteSchema: () => DashboardDocsSiteSchema,
97
98
  DashboardFeedbackInputSchema: () => DashboardFeedbackInputSchema,
@@ -386,6 +387,7 @@ __export(orpc_client_exports, {
386
387
  LoadDocsForUrlResponseSchema: () => LoadDocsForUrlResponseSchema,
387
388
  LocaleEntrySchema: () => LocaleEntrySchema,
388
389
  LongTypeSchema: () => LongTypeSchema,
390
+ MAX_DOXYFILE_CONTENT_LENGTH: () => MAX_DOXYFILE_CONTENT_LENGTH,
389
391
  ManifestApiDefSchema: () => ManifestApiDefSchema,
390
392
  ManifestBlobRefSchema: () => ManifestBlobRefSchema,
391
393
  ManifestFileSchema: () => ManifestFileSchema,
@@ -524,6 +526,7 @@ __export(orpc_client_exports, {
524
526
  RouteContextInputSchema: () => RouteContextInputSchema,
525
527
  RouteContextResponseSchema: () => RouteContextResponseSchema,
526
528
  RubyGemSchema: () => RubyGemSchema,
529
+ SafeDoxyfileContentSchema: () => SafeDoxyfileContentSchema,
527
530
  ScalarTypeSchema: () => ScalarTypeSchema,
528
531
  ScriptSchema: () => ScriptSchema,
529
532
  SdkDynamicIrDownloadSchema: () => SdkDynamicIrDownloadSchema,
@@ -677,7 +680,8 @@ __export(orpc_client_exports, {
677
680
  snippetsFactoryContract: () => snippetsFactoryContract,
678
681
  stableStringify: () => stableStringify,
679
682
  templatesContract: () => templatesContract,
680
- tokensContract: () => tokensContract
683
+ tokensContract: () => tokensContract,
684
+ validateDoxyfileContent: () => validateDoxyfileContent
681
685
  });
682
686
  module.exports = __toCommonJS(orpc_client_exports);
683
687
  var import_client47 = require("@orpc/client");
@@ -3857,6 +3861,120 @@ var import_fetch5 = require("@orpc/openapi-client/fetch");
3857
3861
  // src/orpc-client/docs/v2/library-docs/contract.ts
3858
3862
  var import_contract10 = require("@orpc/contract");
3859
3863
  var z15 = __toESM(require("zod"), 1);
3864
+
3865
+ // src/orpc-client/docs/v2/library-docs/doxyfile.ts
3866
+ var MAX_DOXYFILE_CONTENT_LENGTH = 262144;
3867
+ var SETTING_LINE_RE = /^\s*([A-Z][A-Z0-9_]*)\s*(\+?=)(.*)$/;
3868
+ var AT_DIRECTIVE_RE = /^\s*@[A-Z_]+\b/;
3869
+ var BOOL_RE = /^(?:YES|NO)$/i;
3870
+ var FILE_PATTERN_RE = /^[A-Za-z0-9_.*?+-]+$/;
3871
+ var PREDEFINED_RE = /^[A-Za-z_][A-Za-z0-9_]*(?:\([A-Za-z0-9_,. ]*\))?(?::?=.*)?$/;
3872
+ var ALIAS_DEF_RE = /^\w+(?:\{\d+\})?=/;
3873
+ var DOXYFILE_ALLOWED_KEYS = {
3874
+ ALIASES: (value) => ALIAS_DEF_RE.test(value),
3875
+ PREDEFINED: (value) => PREDEFINED_RE.test(value),
3876
+ FILE_PATTERNS: (value) => FILE_PATTERN_RE.test(value),
3877
+ OPTIMIZE_OUTPUT_FOR_C: (value) => BOOL_RE.test(value)
3878
+ };
3879
+ function joinContinuations(text) {
3880
+ const logical = [];
3881
+ let buffer = "";
3882
+ for (const rawLine of text.split(/\r?\n/)) {
3883
+ const line = rawLine.replace(/\s+$/, "");
3884
+ if (line.endsWith("\\") && !line.endsWith("\\\\")) {
3885
+ buffer += `${line.slice(0, -1)} `;
3886
+ continue;
3887
+ }
3888
+ buffer += line;
3889
+ logical.push(buffer);
3890
+ buffer = "";
3891
+ }
3892
+ if (buffer) {
3893
+ logical.push(buffer);
3894
+ }
3895
+ return logical;
3896
+ }
3897
+ function tokenizeValue(value) {
3898
+ const tokens = [];
3899
+ let i = 0;
3900
+ const n = value.length;
3901
+ while (i < n) {
3902
+ const ch = value[i];
3903
+ if (/\s/.test(ch ?? "")) {
3904
+ i++;
3905
+ continue;
3906
+ }
3907
+ if (ch === '"') {
3908
+ i++;
3909
+ let buf = "";
3910
+ while (i < n) {
3911
+ const c = value[i];
3912
+ if (c === "\\" && i + 1 < n && value[i + 1] === '"') {
3913
+ buf += '"';
3914
+ i += 2;
3915
+ continue;
3916
+ }
3917
+ if (c === '"') {
3918
+ i++;
3919
+ break;
3920
+ }
3921
+ buf += c;
3922
+ i++;
3923
+ }
3924
+ tokens.push(buf);
3925
+ } else {
3926
+ let j = i;
3927
+ while (j < n && !/\s/.test(value[j] ?? "")) {
3928
+ j++;
3929
+ }
3930
+ tokens.push(value.slice(i, j));
3931
+ i = j;
3932
+ }
3933
+ }
3934
+ return tokens;
3935
+ }
3936
+ function validateDoxyfileContent(content) {
3937
+ const errors = [];
3938
+ const droppedKeys = [];
3939
+ if (content.length > MAX_DOXYFILE_CONTENT_LENGTH) {
3940
+ errors.push(`doxyfileContent exceeds ${MAX_DOXYFILE_CONTENT_LENGTH} characters`);
3941
+ return { errors, droppedKeys };
3942
+ }
3943
+ for (const line of joinContinuations(content)) {
3944
+ const stripped = line.trim();
3945
+ if (!stripped || stripped.startsWith("#")) {
3946
+ continue;
3947
+ }
3948
+ if (AT_DIRECTIVE_RE.test(stripped)) {
3949
+ const directive = stripped.split(/\s+/)[0] ?? stripped;
3950
+ if (!droppedKeys.includes(directive)) {
3951
+ droppedKeys.push(directive);
3952
+ }
3953
+ continue;
3954
+ }
3955
+ const match = SETTING_LINE_RE.exec(line);
3956
+ if (match == null) {
3957
+ continue;
3958
+ }
3959
+ const key = match[1] ?? "";
3960
+ const rawValue = match[3] ?? "";
3961
+ const validator = DOXYFILE_ALLOWED_KEYS[key];
3962
+ if (validator == null) {
3963
+ if (!droppedKeys.includes(key)) {
3964
+ droppedKeys.push(key);
3965
+ }
3966
+ continue;
3967
+ }
3968
+ for (const token of tokenizeValue(rawValue)) {
3969
+ if (token.endsWith("\\") || token.includes("$(") || !validator(token)) {
3970
+ errors.push(`Invalid value for Doxyfile setting ${key}: ${JSON.stringify(token)}`);
3971
+ }
3972
+ }
3973
+ }
3974
+ return { errors, droppedKeys };
3975
+ }
3976
+
3977
+ // src/orpc-client/docs/v2/library-docs/contract.ts
3860
3978
  var ALLOWED_HOSTNAMES = /* @__PURE__ */ new Set(["github.com", "gitlab.com"]);
3861
3979
  var GithubUrlSchema = z15.string().url().describe(
3862
3980
  "HTTPS URL of a GitHub or GitLab repository. Currently only github.com and gitlab.com are supported. Must match the pattern https://github.com/<owner>/<repo> or https://gitlab.com/<owner>/<repo>."
@@ -3891,8 +4009,13 @@ var LibraryDocsBaseConfigSchema = z15.object({
3891
4009
  slug: z15.string().nullish()
3892
4010
  });
3893
4011
  var PythonLibraryDocsConfigSchema = LibraryDocsBaseConfigSchema;
4012
+ var SafeDoxyfileContentSchema = z15.string().superRefine((content, ctx) => {
4013
+ for (const error of validateDoxyfileContent(content).errors) {
4014
+ ctx.addIssue({ code: z15.ZodIssueCode.custom, message: error });
4015
+ }
4016
+ }).nullish();
3894
4017
  var CppLibraryDocsConfigSchema = LibraryDocsBaseConfigSchema.extend({
3895
- doxyfileContent: z15.string().nullish()
4018
+ doxyfileContent: SafeDoxyfileContentSchema
3896
4019
  });
3897
4020
  var StartLibraryDocsGenerationInputSchema = z15.discriminatedUnion("language", [
3898
4021
  z15.object({
@@ -7124,6 +7247,7 @@ var UpsertThemeBodySchema = z37.object({
7124
7247
  CurrentVersionInputSchema,
7125
7248
  CurrentVersionResponseSchema,
7126
7249
  CustomSnippetPayloadSchema,
7250
+ DOXYFILE_ALLOWED_KEYS,
7127
7251
  DashboardAnalyticsCommonInputSchema,
7128
7252
  DashboardDocsSiteSchema,
7129
7253
  DashboardFeedbackInputSchema,
@@ -7418,6 +7542,7 @@ var UpsertThemeBodySchema = z37.object({
7418
7542
  LoadDocsForUrlResponseSchema,
7419
7543
  LocaleEntrySchema,
7420
7544
  LongTypeSchema,
7545
+ MAX_DOXYFILE_CONTENT_LENGTH,
7421
7546
  ManifestApiDefSchema,
7422
7547
  ManifestBlobRefSchema,
7423
7548
  ManifestFileSchema,
@@ -7556,6 +7681,7 @@ var UpsertThemeBodySchema = z37.object({
7556
7681
  RouteContextInputSchema,
7557
7682
  RouteContextResponseSchema,
7558
7683
  RubyGemSchema,
7684
+ SafeDoxyfileContentSchema,
7559
7685
  ScalarTypeSchema,
7560
7686
  ScriptSchema,
7561
7687
  SdkDynamicIrDownloadSchema,
@@ -7709,6 +7835,7 @@ var UpsertThemeBodySchema = z37.object({
7709
7835
  snippetsFactoryContract,
7710
7836
  stableStringify,
7711
7837
  templatesContract,
7712
- tokensContract
7838
+ tokensContract,
7839
+ validateDoxyfileContent
7713
7840
  });
7714
7841
  //# sourceMappingURL=orpc-client.js.map