@fern-api/fdr-sdk 1.2.93-9d4e38f080 → 1.2.94-cdc1690f8b

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 (33) hide show
  1. package/dist/js/client/FdrClient.js +150 -6
  2. package/dist/js/client/FdrClient.js.map +1 -1
  3. package/dist/js/client/FdrClient.mjs +150 -6
  4. package/dist/js/client/FdrClient.mjs.map +1 -1
  5. package/dist/js/client/types.js.map +1 -1
  6. package/dist/js/client/types.mjs.map +1 -1
  7. package/dist/js/converters/index.js.map +1 -1
  8. package/dist/js/converters/index.mjs.map +1 -1
  9. package/dist/js/index.js +150 -6
  10. package/dist/js/index.js.map +1 -1
  11. package/dist/js/index.mjs +150 -6
  12. package/dist/js/index.mjs.map +1 -1
  13. package/dist/js/navigation/index.js.map +1 -1
  14. package/dist/js/navigation/index.mjs.map +1 -1
  15. package/dist/js/orpc-client.js +160 -8
  16. package/dist/js/orpc-client.js.map +1 -1
  17. package/dist/js/orpc-client.mjs +155 -7
  18. package/dist/js/orpc-client.mjs.map +1 -1
  19. package/dist/types/client/libraryDocs.d.ts +5 -0
  20. package/dist/types/client/libraryDocs.d.ts.map +1 -1
  21. package/dist/types/orpc-client/dashboard-agent/contract.d.ts +94 -0
  22. package/dist/types/orpc-client/dashboard-agent/contract.d.ts.map +1 -1
  23. package/dist/types/orpc-client/docs/v2/library-docs/__test__/doxyfile.test.d.ts +2 -0
  24. package/dist/types/orpc-client/docs/v2/library-docs/__test__/doxyfile.test.d.ts.map +1 -0
  25. package/dist/types/orpc-client/docs/v2/library-docs/contract.d.ts +9 -3
  26. package/dist/types/orpc-client/docs/v2/library-docs/contract.d.ts.map +1 -1
  27. package/dist/types/orpc-client/docs/v2/library-docs/doxyfile.d.ts +32 -0
  28. package/dist/types/orpc-client/docs/v2/library-docs/doxyfile.d.ts.map +1 -0
  29. package/dist/types/orpc-client/docs/v2/library-docs/index.d.ts +1 -0
  30. package/dist/types/orpc-client/docs/v2/library-docs/index.d.ts.map +1 -1
  31. package/dist/types/orpc-client/docs-deployment/contract.d.ts +8 -0
  32. package/dist/types/orpc-client/docs-deployment/contract.d.ts.map +1 -1
  33. package/package.json +1 -1
@@ -2019,7 +2019,9 @@ var GetDocsStatusResponseSchema = z8.object({
2019
2019
  });
2020
2020
  var GetDocsDeploymentsResponseSchema = z8.object({
2021
2021
  deployments: z8.array(DocsDeploymentSchema),
2022
- hasMore: z8.boolean()
2022
+ hasMore: z8.boolean(),
2023
+ /** Pass back as `cursor` to fetch the next page. Absent when `hasMore` is false. */
2024
+ nextCursor: z8.string().optional()
2023
2025
  });
2024
2026
  var CreateDeploymentResponseSchema = z8.object({
2025
2027
  deploymentId: z8.string()
@@ -2177,7 +2179,9 @@ var DashboardFeedbackInputSchema = z10.object({
2177
2179
  domain: z10.string().min(1),
2178
2180
  dateRange: z10.string().optional(),
2179
2181
  feedbackType: z10.enum(["page", "code_block", "all"]).optional(),
2180
- limit: z10.number().int().min(1).max(50).optional()
2182
+ limit: z10.number().int().min(1).max(50).optional(),
2183
+ /** `nextCursor` from a previous page; continues that page's ordering. */
2184
+ cursor: z10.string().optional()
2181
2185
  });
2182
2186
  var DashboardListOrgMembersInputSchema = z10.object({
2183
2187
  orgId: z10.string(),
@@ -2236,20 +2240,37 @@ var LlmBotTrafficResponseSchema = z10.object({
2236
2240
  });
2237
2241
  var RecentFeedbackResponseSchema = z10.object({
2238
2242
  resolvedDateRange: ResolvedDateRangeSchema,
2243
+ /**
2244
+ * Vote counts over the whole date range, not just the returned page, and over page
2245
+ * feedback only: code-block reports carry no helpful/unhelpful vote and are counted
2246
+ * by `codeBlockCount` instead.
2247
+ */
2239
2248
  helpfulCount: z10.number(),
2240
2249
  unhelpfulCount: z10.number(),
2250
+ codeBlockCount: z10.number(),
2251
+ /** Entries matching the filters over the whole date range. */
2252
+ totalCount: z10.number(),
2241
2253
  entries: z10.array(
2242
2254
  z10.object({
2243
2255
  date: z10.string(),
2244
2256
  location: z10.string(),
2257
+ /** Always false for code-block reports, which carry no vote. */
2245
2258
  wasHelpful: z10.boolean(),
2246
2259
  userFeedback: z10.string(),
2247
2260
  feedbackType: z10.string().optional(),
2248
2261
  /** URL of the docs page the feedback was submitted on. */
2249
- url: z10.string().optional()
2262
+ url: z10.string().optional(),
2263
+ /** What the reader selected on the page, for page feedback. */
2264
+ selection: z10.string().optional(),
2265
+ /** Language of the code block a code-block report was filed against. */
2266
+ language: z10.string().optional(),
2267
+ /** The reported code block, truncated. */
2268
+ code: z10.string().optional()
2250
2269
  })
2251
2270
  ),
2252
- hasMore: z10.boolean()
2271
+ hasMore: z10.boolean(),
2272
+ /** Pass back as `cursor` to fetch the next page. Absent when `hasMore` is false. */
2273
+ nextCursor: z10.string().optional()
2253
2274
  });
2254
2275
  var QueryAnalyticsResponseSchema = z10.object({
2255
2276
  resolvedDateRange: ResolvedDateRangeSchema,
@@ -2264,7 +2285,11 @@ var QueryAnalyticsResponseSchema = z10.object({
2264
2285
  visitors: z10.number().optional(),
2265
2286
  sessions: z10.number().optional()
2266
2287
  })
2267
- )
2288
+ ),
2289
+ /** The row cap the query ran with, after clamping. */
2290
+ limit: z10.number(),
2291
+ /** True when the metric had more rows than `limit`, so `rows` is a truncated ranking. */
2292
+ hasMore: z10.boolean()
2268
2293
  });
2269
2294
  var OrgMembersResponseSchema = z10.object({
2270
2295
  members: z10.array(
@@ -3151,6 +3176,120 @@ import { OpenAPILink as OpenAPILink5 } from "@orpc/openapi-client/fetch";
3151
3176
  // src/orpc-client/docs/v2/library-docs/contract.ts
3152
3177
  import { oc as oc6 } from "@orpc/contract";
3153
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
3154
3293
  var ALLOWED_HOSTNAMES = /* @__PURE__ */ new Set(["github.com", "gitlab.com"]);
3155
3294
  var GithubUrlSchema = z15.string().url().describe(
3156
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>."
@@ -3185,8 +3324,13 @@ var LibraryDocsBaseConfigSchema = z15.object({
3185
3324
  slug: z15.string().nullish()
3186
3325
  });
3187
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();
3188
3332
  var CppLibraryDocsConfigSchema = LibraryDocsBaseConfigSchema.extend({
3189
- doxyfileContent: z15.string().nullish()
3333
+ doxyfileContent: SafeDoxyfileContentSchema
3190
3334
  });
3191
3335
  var StartLibraryDocsGenerationInputSchema = z15.discriminatedUnion("language", [
3192
3336
  z15.object({
@@ -6417,6 +6561,7 @@ export {
6417
6561
  CurrentVersionInputSchema,
6418
6562
  CurrentVersionResponseSchema,
6419
6563
  CustomSnippetPayloadSchema,
6564
+ DOXYFILE_ALLOWED_KEYS,
6420
6565
  DashboardAnalyticsCommonInputSchema,
6421
6566
  DashboardDocsSiteSchema,
6422
6567
  DashboardFeedbackInputSchema,
@@ -6711,6 +6856,7 @@ export {
6711
6856
  LoadDocsForUrlResponseSchema,
6712
6857
  LocaleEntrySchema,
6713
6858
  LongTypeSchema,
6859
+ MAX_DOXYFILE_CONTENT_LENGTH,
6714
6860
  ManifestApiDefSchema,
6715
6861
  ManifestBlobRefSchema,
6716
6862
  ManifestFileSchema,
@@ -6849,6 +6995,7 @@ export {
6849
6995
  RouteContextInputSchema,
6850
6996
  RouteContextResponseSchema,
6851
6997
  RubyGemSchema,
6998
+ SafeDoxyfileContentSchema,
6852
6999
  ScalarTypeSchema,
6853
7000
  ScriptSchema,
6854
7001
  SdkDynamicIrDownloadSchema,
@@ -7002,6 +7149,7 @@ export {
7002
7149
  snippetsFactoryContract,
7003
7150
  stableStringify,
7004
7151
  templatesContract,
7005
- tokensContract
7152
+ tokensContract,
7153
+ validateDoxyfileContent
7006
7154
  };
7007
7155
  //# sourceMappingURL=orpc-client.mjs.map