@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.
- package/dist/client/libraryDocs.d.ts +5 -0
- package/dist/client/libraryDocs.d.ts.map +1 -1
- package/dist/js/client/FdrClient.js +120 -1
- package/dist/js/client/FdrClient.js.map +1 -1
- package/dist/js/client/FdrClient.mjs +120 -1
- package/dist/js/client/FdrClient.mjs.map +1 -1
- package/dist/js/client/types.js.map +1 -1
- package/dist/js/client/types.mjs.map +1 -1
- package/dist/js/converters/index.js.map +1 -1
- package/dist/js/converters/index.mjs.map +1 -1
- package/dist/js/index.js +120 -1
- package/dist/js/index.js.map +1 -1
- package/dist/js/index.mjs +120 -1
- package/dist/js/index.mjs.map +1 -1
- package/dist/js/navigation/index.js.map +1 -1
- package/dist/js/navigation/index.mjs.map +1 -1
- package/dist/js/orpc-client.js +130 -3
- package/dist/js/orpc-client.js.map +1 -1
- package/dist/js/orpc-client.mjs +125 -2
- package/dist/js/orpc-client.mjs.map +1 -1
- package/dist/orpc-client/docs/v2/library-docs/__test__/doxyfile.test.d.ts +2 -0
- package/dist/orpc-client/docs/v2/library-docs/__test__/doxyfile.test.d.ts.map +1 -0
- package/dist/orpc-client/docs/v2/library-docs/__test__/doxyfile.test.js +68 -0
- package/dist/orpc-client/docs/v2/library-docs/__test__/doxyfile.test.js.map +1 -0
- package/dist/orpc-client/docs/v2/library-docs/contract.d.ts +9 -3
- package/dist/orpc-client/docs/v2/library-docs/contract.d.ts.map +1 -1
- package/dist/orpc-client/docs/v2/library-docs/contract.js +15 -1
- package/dist/orpc-client/docs/v2/library-docs/contract.js.map +1 -1
- package/dist/orpc-client/docs/v2/library-docs/doxyfile.d.ts +32 -0
- package/dist/orpc-client/docs/v2/library-docs/doxyfile.d.ts.map +1 -0
- package/dist/orpc-client/docs/v2/library-docs/doxyfile.js +142 -0
- package/dist/orpc-client/docs/v2/library-docs/doxyfile.js.map +1 -0
- package/dist/orpc-client/docs/v2/library-docs/index.d.ts +1 -0
- package/dist/orpc-client/docs/v2/library-docs/index.d.ts.map +1 -1
- package/dist/orpc-client/docs/v2/library-docs/index.js +1 -0
- package/dist/orpc-client/docs/v2/library-docs/index.js.map +1 -1
- package/dist/types/client/libraryDocs.d.ts +5 -0
- package/dist/types/client/libraryDocs.d.ts.map +1 -1
- package/dist/types/orpc-client/docs/v2/library-docs/__test__/doxyfile.test.d.ts +2 -0
- package/dist/types/orpc-client/docs/v2/library-docs/__test__/doxyfile.test.d.ts.map +1 -0
- package/dist/types/orpc-client/docs/v2/library-docs/contract.d.ts +9 -3
- package/dist/types/orpc-client/docs/v2/library-docs/contract.d.ts.map +1 -1
- package/dist/types/orpc-client/docs/v2/library-docs/doxyfile.d.ts +32 -0
- package/dist/types/orpc-client/docs/v2/library-docs/doxyfile.d.ts.map +1 -0
- package/dist/types/orpc-client/docs/v2/library-docs/index.d.ts +1 -0
- package/dist/types/orpc-client/docs/v2/library-docs/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -2960,6 +2960,120 @@ import { OpenAPILink as OpenAPILink5 } from "@orpc/openapi-client/fetch";
|
|
|
2960
2960
|
// src/orpc-client/docs/v2/library-docs/contract.ts
|
|
2961
2961
|
import { oc as oc6 } from "@orpc/contract";
|
|
2962
2962
|
import * as z14 from "zod";
|
|
2963
|
+
|
|
2964
|
+
// src/orpc-client/docs/v2/library-docs/doxyfile.ts
|
|
2965
|
+
var MAX_DOXYFILE_CONTENT_LENGTH = 262144;
|
|
2966
|
+
var SETTING_LINE_RE = /^\s*([A-Z][A-Z0-9_]*)\s*(\+?=)(.*)$/;
|
|
2967
|
+
var AT_DIRECTIVE_RE = /^\s*@[A-Z_]+\b/;
|
|
2968
|
+
var BOOL_RE = /^(?:YES|NO)$/i;
|
|
2969
|
+
var FILE_PATTERN_RE = /^[A-Za-z0-9_.*?+-]+$/;
|
|
2970
|
+
var PREDEFINED_RE = /^[A-Za-z_][A-Za-z0-9_]*(?:\([A-Za-z0-9_,. ]*\))?(?::?=.*)?$/;
|
|
2971
|
+
var ALIAS_DEF_RE = /^\w+(?:\{\d+\})?=/;
|
|
2972
|
+
var DOXYFILE_ALLOWED_KEYS = {
|
|
2973
|
+
ALIASES: (value) => ALIAS_DEF_RE.test(value),
|
|
2974
|
+
PREDEFINED: (value) => PREDEFINED_RE.test(value),
|
|
2975
|
+
FILE_PATTERNS: (value) => FILE_PATTERN_RE.test(value),
|
|
2976
|
+
OPTIMIZE_OUTPUT_FOR_C: (value) => BOOL_RE.test(value)
|
|
2977
|
+
};
|
|
2978
|
+
function joinContinuations(text) {
|
|
2979
|
+
const logical = [];
|
|
2980
|
+
let buffer = "";
|
|
2981
|
+
for (const rawLine of text.split(/\r?\n/)) {
|
|
2982
|
+
const line = rawLine.replace(/\s+$/, "");
|
|
2983
|
+
if (line.endsWith("\\") && !line.endsWith("\\\\")) {
|
|
2984
|
+
buffer += `${line.slice(0, -1)} `;
|
|
2985
|
+
continue;
|
|
2986
|
+
}
|
|
2987
|
+
buffer += line;
|
|
2988
|
+
logical.push(buffer);
|
|
2989
|
+
buffer = "";
|
|
2990
|
+
}
|
|
2991
|
+
if (buffer) {
|
|
2992
|
+
logical.push(buffer);
|
|
2993
|
+
}
|
|
2994
|
+
return logical;
|
|
2995
|
+
}
|
|
2996
|
+
function tokenizeValue(value) {
|
|
2997
|
+
const tokens = [];
|
|
2998
|
+
let i = 0;
|
|
2999
|
+
const n = value.length;
|
|
3000
|
+
while (i < n) {
|
|
3001
|
+
const ch = value[i];
|
|
3002
|
+
if (/\s/.test(ch ?? "")) {
|
|
3003
|
+
i++;
|
|
3004
|
+
continue;
|
|
3005
|
+
}
|
|
3006
|
+
if (ch === '"') {
|
|
3007
|
+
i++;
|
|
3008
|
+
let buf = "";
|
|
3009
|
+
while (i < n) {
|
|
3010
|
+
const c = value[i];
|
|
3011
|
+
if (c === "\\" && i + 1 < n && value[i + 1] === '"') {
|
|
3012
|
+
buf += '"';
|
|
3013
|
+
i += 2;
|
|
3014
|
+
continue;
|
|
3015
|
+
}
|
|
3016
|
+
if (c === '"') {
|
|
3017
|
+
i++;
|
|
3018
|
+
break;
|
|
3019
|
+
}
|
|
3020
|
+
buf += c;
|
|
3021
|
+
i++;
|
|
3022
|
+
}
|
|
3023
|
+
tokens.push(buf);
|
|
3024
|
+
} else {
|
|
3025
|
+
let j = i;
|
|
3026
|
+
while (j < n && !/\s/.test(value[j] ?? "")) {
|
|
3027
|
+
j++;
|
|
3028
|
+
}
|
|
3029
|
+
tokens.push(value.slice(i, j));
|
|
3030
|
+
i = j;
|
|
3031
|
+
}
|
|
3032
|
+
}
|
|
3033
|
+
return tokens;
|
|
3034
|
+
}
|
|
3035
|
+
function validateDoxyfileContent(content) {
|
|
3036
|
+
const errors = [];
|
|
3037
|
+
const droppedKeys = [];
|
|
3038
|
+
if (content.length > MAX_DOXYFILE_CONTENT_LENGTH) {
|
|
3039
|
+
errors.push(`doxyfileContent exceeds ${MAX_DOXYFILE_CONTENT_LENGTH} characters`);
|
|
3040
|
+
return { errors, droppedKeys };
|
|
3041
|
+
}
|
|
3042
|
+
for (const line of joinContinuations(content)) {
|
|
3043
|
+
const stripped = line.trim();
|
|
3044
|
+
if (!stripped || stripped.startsWith("#")) {
|
|
3045
|
+
continue;
|
|
3046
|
+
}
|
|
3047
|
+
if (AT_DIRECTIVE_RE.test(stripped)) {
|
|
3048
|
+
const directive = stripped.split(/\s+/)[0] ?? stripped;
|
|
3049
|
+
if (!droppedKeys.includes(directive)) {
|
|
3050
|
+
droppedKeys.push(directive);
|
|
3051
|
+
}
|
|
3052
|
+
continue;
|
|
3053
|
+
}
|
|
3054
|
+
const match = SETTING_LINE_RE.exec(line);
|
|
3055
|
+
if (match == null) {
|
|
3056
|
+
continue;
|
|
3057
|
+
}
|
|
3058
|
+
const key = match[1] ?? "";
|
|
3059
|
+
const rawValue = match[3] ?? "";
|
|
3060
|
+
const validator = DOXYFILE_ALLOWED_KEYS[key];
|
|
3061
|
+
if (validator == null) {
|
|
3062
|
+
if (!droppedKeys.includes(key)) {
|
|
3063
|
+
droppedKeys.push(key);
|
|
3064
|
+
}
|
|
3065
|
+
continue;
|
|
3066
|
+
}
|
|
3067
|
+
for (const token of tokenizeValue(rawValue)) {
|
|
3068
|
+
if (token.endsWith("\\") || token.includes("$(") || !validator(token)) {
|
|
3069
|
+
errors.push(`Invalid value for Doxyfile setting ${key}: ${JSON.stringify(token)}`);
|
|
3070
|
+
}
|
|
3071
|
+
}
|
|
3072
|
+
}
|
|
3073
|
+
return { errors, droppedKeys };
|
|
3074
|
+
}
|
|
3075
|
+
|
|
3076
|
+
// src/orpc-client/docs/v2/library-docs/contract.ts
|
|
2963
3077
|
var ALLOWED_HOSTNAMES = /* @__PURE__ */ new Set(["github.com", "gitlab.com"]);
|
|
2964
3078
|
var GithubUrlSchema = z14.string().url().describe(
|
|
2965
3079
|
"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>."
|
|
@@ -2994,8 +3108,13 @@ var LibraryDocsBaseConfigSchema = z14.object({
|
|
|
2994
3108
|
slug: z14.string().nullish()
|
|
2995
3109
|
});
|
|
2996
3110
|
var PythonLibraryDocsConfigSchema = LibraryDocsBaseConfigSchema;
|
|
3111
|
+
var SafeDoxyfileContentSchema = z14.string().superRefine((content, ctx) => {
|
|
3112
|
+
for (const error of validateDoxyfileContent(content).errors) {
|
|
3113
|
+
ctx.addIssue({ code: z14.ZodIssueCode.custom, message: error });
|
|
3114
|
+
}
|
|
3115
|
+
}).nullish();
|
|
2997
3116
|
var CppLibraryDocsConfigSchema = LibraryDocsBaseConfigSchema.extend({
|
|
2998
|
-
doxyfileContent:
|
|
3117
|
+
doxyfileContent: SafeDoxyfileContentSchema
|
|
2999
3118
|
});
|
|
3000
3119
|
var StartLibraryDocsGenerationInputSchema = z14.discriminatedUnion("language", [
|
|
3001
3120
|
z14.object({
|