@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
package/dist/js/orpc-client.mjs
CHANGED
|
@@ -3176,6 +3176,120 @@ import { OpenAPILink as OpenAPILink5 } from "@orpc/openapi-client/fetch";
|
|
|
3176
3176
|
// src/orpc-client/docs/v2/library-docs/contract.ts
|
|
3177
3177
|
import { oc as oc6 } from "@orpc/contract";
|
|
3178
3178
|
import * as z15 from "zod";
|
|
3179
|
+
|
|
3180
|
+
// src/orpc-client/docs/v2/library-docs/doxyfile.ts
|
|
3181
|
+
var MAX_DOXYFILE_CONTENT_LENGTH = 262144;
|
|
3182
|
+
var SETTING_LINE_RE = /^\s*([A-Z][A-Z0-9_]*)\s*(\+?=)(.*)$/;
|
|
3183
|
+
var AT_DIRECTIVE_RE = /^\s*@[A-Z_]+\b/;
|
|
3184
|
+
var BOOL_RE = /^(?:YES|NO)$/i;
|
|
3185
|
+
var FILE_PATTERN_RE = /^[A-Za-z0-9_.*?+-]+$/;
|
|
3186
|
+
var PREDEFINED_RE = /^[A-Za-z_][A-Za-z0-9_]*(?:\([A-Za-z0-9_,. ]*\))?(?::?=.*)?$/;
|
|
3187
|
+
var ALIAS_DEF_RE = /^\w+(?:\{\d+\})?=/;
|
|
3188
|
+
var DOXYFILE_ALLOWED_KEYS = {
|
|
3189
|
+
ALIASES: (value) => ALIAS_DEF_RE.test(value),
|
|
3190
|
+
PREDEFINED: (value) => PREDEFINED_RE.test(value),
|
|
3191
|
+
FILE_PATTERNS: (value) => FILE_PATTERN_RE.test(value),
|
|
3192
|
+
OPTIMIZE_OUTPUT_FOR_C: (value) => BOOL_RE.test(value)
|
|
3193
|
+
};
|
|
3194
|
+
function joinContinuations(text) {
|
|
3195
|
+
const logical = [];
|
|
3196
|
+
let buffer = "";
|
|
3197
|
+
for (const rawLine of text.split(/\r?\n/)) {
|
|
3198
|
+
const line = rawLine.replace(/\s+$/, "");
|
|
3199
|
+
if (line.endsWith("\\") && !line.endsWith("\\\\")) {
|
|
3200
|
+
buffer += `${line.slice(0, -1)} `;
|
|
3201
|
+
continue;
|
|
3202
|
+
}
|
|
3203
|
+
buffer += line;
|
|
3204
|
+
logical.push(buffer);
|
|
3205
|
+
buffer = "";
|
|
3206
|
+
}
|
|
3207
|
+
if (buffer) {
|
|
3208
|
+
logical.push(buffer);
|
|
3209
|
+
}
|
|
3210
|
+
return logical;
|
|
3211
|
+
}
|
|
3212
|
+
function tokenizeValue(value) {
|
|
3213
|
+
const tokens = [];
|
|
3214
|
+
let i = 0;
|
|
3215
|
+
const n = value.length;
|
|
3216
|
+
while (i < n) {
|
|
3217
|
+
const ch = value[i];
|
|
3218
|
+
if (/\s/.test(ch ?? "")) {
|
|
3219
|
+
i++;
|
|
3220
|
+
continue;
|
|
3221
|
+
}
|
|
3222
|
+
if (ch === '"') {
|
|
3223
|
+
i++;
|
|
3224
|
+
let buf = "";
|
|
3225
|
+
while (i < n) {
|
|
3226
|
+
const c = value[i];
|
|
3227
|
+
if (c === "\\" && i + 1 < n && value[i + 1] === '"') {
|
|
3228
|
+
buf += '"';
|
|
3229
|
+
i += 2;
|
|
3230
|
+
continue;
|
|
3231
|
+
}
|
|
3232
|
+
if (c === '"') {
|
|
3233
|
+
i++;
|
|
3234
|
+
break;
|
|
3235
|
+
}
|
|
3236
|
+
buf += c;
|
|
3237
|
+
i++;
|
|
3238
|
+
}
|
|
3239
|
+
tokens.push(buf);
|
|
3240
|
+
} else {
|
|
3241
|
+
let j = i;
|
|
3242
|
+
while (j < n && !/\s/.test(value[j] ?? "")) {
|
|
3243
|
+
j++;
|
|
3244
|
+
}
|
|
3245
|
+
tokens.push(value.slice(i, j));
|
|
3246
|
+
i = j;
|
|
3247
|
+
}
|
|
3248
|
+
}
|
|
3249
|
+
return tokens;
|
|
3250
|
+
}
|
|
3251
|
+
function validateDoxyfileContent(content) {
|
|
3252
|
+
const errors = [];
|
|
3253
|
+
const droppedKeys = [];
|
|
3254
|
+
if (content.length > MAX_DOXYFILE_CONTENT_LENGTH) {
|
|
3255
|
+
errors.push(`doxyfileContent exceeds ${MAX_DOXYFILE_CONTENT_LENGTH} characters`);
|
|
3256
|
+
return { errors, droppedKeys };
|
|
3257
|
+
}
|
|
3258
|
+
for (const line of joinContinuations(content)) {
|
|
3259
|
+
const stripped = line.trim();
|
|
3260
|
+
if (!stripped || stripped.startsWith("#")) {
|
|
3261
|
+
continue;
|
|
3262
|
+
}
|
|
3263
|
+
if (AT_DIRECTIVE_RE.test(stripped)) {
|
|
3264
|
+
const directive = stripped.split(/\s+/)[0] ?? stripped;
|
|
3265
|
+
if (!droppedKeys.includes(directive)) {
|
|
3266
|
+
droppedKeys.push(directive);
|
|
3267
|
+
}
|
|
3268
|
+
continue;
|
|
3269
|
+
}
|
|
3270
|
+
const match = SETTING_LINE_RE.exec(line);
|
|
3271
|
+
if (match == null) {
|
|
3272
|
+
continue;
|
|
3273
|
+
}
|
|
3274
|
+
const key = match[1] ?? "";
|
|
3275
|
+
const rawValue = match[3] ?? "";
|
|
3276
|
+
const validator = DOXYFILE_ALLOWED_KEYS[key];
|
|
3277
|
+
if (validator == null) {
|
|
3278
|
+
if (!droppedKeys.includes(key)) {
|
|
3279
|
+
droppedKeys.push(key);
|
|
3280
|
+
}
|
|
3281
|
+
continue;
|
|
3282
|
+
}
|
|
3283
|
+
for (const token of tokenizeValue(rawValue)) {
|
|
3284
|
+
if (token.endsWith("\\") || token.includes("$(") || !validator(token)) {
|
|
3285
|
+
errors.push(`Invalid value for Doxyfile setting ${key}: ${JSON.stringify(token)}`);
|
|
3286
|
+
}
|
|
3287
|
+
}
|
|
3288
|
+
}
|
|
3289
|
+
return { errors, droppedKeys };
|
|
3290
|
+
}
|
|
3291
|
+
|
|
3292
|
+
// src/orpc-client/docs/v2/library-docs/contract.ts
|
|
3179
3293
|
var ALLOWED_HOSTNAMES = /* @__PURE__ */ new Set(["github.com", "gitlab.com"]);
|
|
3180
3294
|
var GithubUrlSchema = z15.string().url().describe(
|
|
3181
3295
|
"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>."
|
|
@@ -3210,8 +3324,13 @@ var LibraryDocsBaseConfigSchema = z15.object({
|
|
|
3210
3324
|
slug: z15.string().nullish()
|
|
3211
3325
|
});
|
|
3212
3326
|
var PythonLibraryDocsConfigSchema = LibraryDocsBaseConfigSchema;
|
|
3327
|
+
var SafeDoxyfileContentSchema = z15.string().superRefine((content, ctx) => {
|
|
3328
|
+
for (const error of validateDoxyfileContent(content).errors) {
|
|
3329
|
+
ctx.addIssue({ code: z15.ZodIssueCode.custom, message: error });
|
|
3330
|
+
}
|
|
3331
|
+
}).nullish();
|
|
3213
3332
|
var CppLibraryDocsConfigSchema = LibraryDocsBaseConfigSchema.extend({
|
|
3214
|
-
doxyfileContent:
|
|
3333
|
+
doxyfileContent: SafeDoxyfileContentSchema
|
|
3215
3334
|
});
|
|
3216
3335
|
var StartLibraryDocsGenerationInputSchema = z15.discriminatedUnion("language", [
|
|
3217
3336
|
z15.object({
|
|
@@ -6442,6 +6561,7 @@ export {
|
|
|
6442
6561
|
CurrentVersionInputSchema,
|
|
6443
6562
|
CurrentVersionResponseSchema,
|
|
6444
6563
|
CustomSnippetPayloadSchema,
|
|
6564
|
+
DOXYFILE_ALLOWED_KEYS,
|
|
6445
6565
|
DashboardAnalyticsCommonInputSchema,
|
|
6446
6566
|
DashboardDocsSiteSchema,
|
|
6447
6567
|
DashboardFeedbackInputSchema,
|
|
@@ -6736,6 +6856,7 @@ export {
|
|
|
6736
6856
|
LoadDocsForUrlResponseSchema,
|
|
6737
6857
|
LocaleEntrySchema,
|
|
6738
6858
|
LongTypeSchema,
|
|
6859
|
+
MAX_DOXYFILE_CONTENT_LENGTH,
|
|
6739
6860
|
ManifestApiDefSchema,
|
|
6740
6861
|
ManifestBlobRefSchema,
|
|
6741
6862
|
ManifestFileSchema,
|
|
@@ -6874,6 +6995,7 @@ export {
|
|
|
6874
6995
|
RouteContextInputSchema,
|
|
6875
6996
|
RouteContextResponseSchema,
|
|
6876
6997
|
RubyGemSchema,
|
|
6998
|
+
SafeDoxyfileContentSchema,
|
|
6877
6999
|
ScalarTypeSchema,
|
|
6878
7000
|
ScriptSchema,
|
|
6879
7001
|
SdkDynamicIrDownloadSchema,
|
|
@@ -7027,6 +7149,7 @@ export {
|
|
|
7027
7149
|
snippetsFactoryContract,
|
|
7028
7150
|
stableStringify,
|
|
7029
7151
|
templatesContract,
|
|
7030
|
-
tokensContract
|
|
7152
|
+
tokensContract,
|
|
7153
|
+
validateDoxyfileContent
|
|
7031
7154
|
};
|
|
7032
7155
|
//# sourceMappingURL=orpc-client.mjs.map
|