@fern-api/fdr-sdk 1.2.92-bd650af30b → 1.2.93-80ac90df5f

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 (57) hide show
  1. package/dist/js/api-definition/index.js +6 -3
  2. package/dist/js/api-definition/index.js.map +1 -1
  3. package/dist/js/api-definition/index.mjs +6 -3
  4. package/dist/js/api-definition/index.mjs.map +1 -1
  5. package/dist/js/client/FdrClient.js +156 -9
  6. package/dist/js/client/FdrClient.js.map +1 -1
  7. package/dist/js/client/FdrClient.mjs +156 -9
  8. package/dist/js/client/FdrClient.mjs.map +1 -1
  9. package/dist/js/client/types.js +6 -3
  10. package/dist/js/client/types.js.map +1 -1
  11. package/dist/js/client/types.mjs +6 -3
  12. package/dist/js/client/types.mjs.map +1 -1
  13. package/dist/js/converters/index.js +10 -5
  14. package/dist/js/converters/index.js.map +1 -1
  15. package/dist/js/converters/index.mjs +10 -5
  16. package/dist/js/converters/index.mjs.map +1 -1
  17. package/dist/js/index.js +160 -11
  18. package/dist/js/index.js.map +1 -1
  19. package/dist/js/index.mjs +160 -11
  20. package/dist/js/index.mjs.map +1 -1
  21. package/dist/js/navigation/index.js +8 -4
  22. package/dist/js/navigation/index.js.map +1 -1
  23. package/dist/js/navigation/index.mjs +8 -4
  24. package/dist/js/navigation/index.mjs.map +1 -1
  25. package/dist/js/orpc-client.js +166 -11
  26. package/dist/js/orpc-client.js.map +1 -1
  27. package/dist/js/orpc-client.mjs +161 -10
  28. package/dist/js/orpc-client.mjs.map +1 -1
  29. package/dist/types/api-definition/migrators/v1ToV2.d.ts.map +1 -1
  30. package/dist/types/converters/__test__/websocket-explorer-round-trip.test.d.ts +2 -0
  31. package/dist/types/converters/__test__/websocket-explorer-round-trip.test.d.ts.map +1 -0
  32. package/dist/types/converters/db/convertAPIDefinitionToDb.d.ts.map +1 -1
  33. package/dist/types/converters/read/convertDbAPIDefinitionToRead.d.ts +2 -0
  34. package/dist/types/converters/read/convertDbAPIDefinitionToRead.d.ts.map +1 -1
  35. package/dist/types/navigation/utils/toApis.d.ts +1 -0
  36. package/dist/types/navigation/utils/toApis.d.ts.map +1 -1
  37. package/dist/types/orpc-client/api/contract-db.d.ts +24 -0
  38. package/dist/types/orpc-client/api/contract-db.d.ts.map +1 -1
  39. package/dist/types/orpc-client/api/contract-latest.d.ts +13 -0
  40. package/dist/types/orpc-client/api/contract-latest.d.ts.map +1 -1
  41. package/dist/types/orpc-client/api/contract-read.d.ts +27 -0
  42. package/dist/types/orpc-client/api/contract-read.d.ts.map +1 -1
  43. package/dist/types/orpc-client/api/contract-register.d.ts +27 -0
  44. package/dist/types/orpc-client/api/contract-register.d.ts.map +1 -1
  45. package/dist/types/orpc-client/dashboard-agent/contract.d.ts +94 -0
  46. package/dist/types/orpc-client/dashboard-agent/contract.d.ts.map +1 -1
  47. package/dist/types/orpc-client/docs/v2/library-docs/__test__/doxyfile.test.d.ts +2 -0
  48. package/dist/types/orpc-client/docs/v2/library-docs/__test__/doxyfile.test.d.ts.map +1 -0
  49. package/dist/types/orpc-client/docs/v2/library-docs/contract.d.ts +9 -3
  50. package/dist/types/orpc-client/docs/v2/library-docs/contract.d.ts.map +1 -1
  51. package/dist/types/orpc-client/docs/v2/library-docs/doxyfile.d.ts +32 -0
  52. package/dist/types/orpc-client/docs/v2/library-docs/doxyfile.d.ts.map +1 -0
  53. package/dist/types/orpc-client/docs/v2/library-docs/index.d.ts +1 -0
  54. package/dist/types/orpc-client/docs/v2/library-docs/index.d.ts.map +1 -1
  55. package/dist/types/orpc-client/docs-deployment/contract.d.ts +8 -0
  56. package/dist/types/orpc-client/docs-deployment/contract.d.ts.map +1 -1
  57. package/package.json +1 -1
package/dist/js/index.mjs CHANGED
@@ -1766,7 +1766,8 @@ var RegisterWebSocketChannelSchema = z3.object({
1766
1766
  headers: z3.array(HeaderSchema),
1767
1767
  queryParameters: z3.array(QueryParameterSchema),
1768
1768
  messages: z3.array(WebSocketMessageSchema),
1769
- examples: z3.array(ExampleWebSocketSessionSchema)
1769
+ examples: z3.array(ExampleWebSocketSessionSchema),
1770
+ includeInApiExplorer: z3.boolean().nullish()
1770
1771
  });
1771
1772
  var SourceIdSchema = z3.string();
1772
1773
  function SourceId(value) {
@@ -2370,7 +2371,8 @@ var LatestWebSocketChannelSchema = z4.object({
2370
2371
  pathParameters: z4.array(LatestParameterPropertySchema).nullish(),
2371
2372
  queryParameters: z4.array(LatestParameterPropertySchema).nullish(),
2372
2373
  requestHeaders: z4.array(LatestObjectPropertySchema).nullish(),
2373
- examples: z4.array(LatestExampleWebSocketSessionSchema).nullish()
2374
+ examples: z4.array(LatestExampleWebSocketSessionSchema).nullish(),
2375
+ includeInApiExplorer: z4.boolean().nullish()
2374
2376
  });
2375
2377
  var LatestSubpackageMetadataSchema = z4.object({
2376
2378
  id: SubpackageIdSchema,
@@ -4528,7 +4530,8 @@ var ApiDefinitionV1ToLatest = class _ApiDefinitionV1ToLatest {
4528
4530
  pathParameters: this.migratePathOrQueryParameters(v1?.path?.pathParameters),
4529
4531
  queryParameters: this.migratePathOrQueryParameters(v1?.queryParameters),
4530
4532
  requestHeaders: this.migrateParameters(v1?.headers),
4531
- examples: this.migrateChannelExamples(v1?.examples, messages)
4533
+ examples: this.migrateChannelExamples(v1?.examples, messages),
4534
+ includeInApiExplorer: v1?.includeInApiExplorer ?? true
4532
4535
  };
4533
4536
  };
4534
4537
  migrateWebhook = (id, v1, namespace) => {
@@ -6964,7 +6967,8 @@ var ReadWebSocketChannelSchema = z5.object({
6964
6967
  headers: z5.array(HeaderSchema),
6965
6968
  queryParameters: z5.array(QueryParameterSchema),
6966
6969
  messages: z5.array(WebSocketMessageSchema),
6967
- examples: z5.array(ExampleWebSocketSessionSchema)
6970
+ examples: z5.array(ExampleWebSocketSessionSchema),
6971
+ includeInApiExplorer: z5.boolean().nullish()
6968
6972
  });
6969
6973
  var ReadApiDefinitionPackageSchema = z5.object({
6970
6974
  endpoints: z5.array(ReadEndpointDefinitionSchema),
@@ -7167,7 +7171,9 @@ var GetDocsStatusResponseSchema = z7.object({
7167
7171
  });
7168
7172
  var GetDocsDeploymentsResponseSchema = z7.object({
7169
7173
  deployments: z7.array(DocsDeploymentSchema),
7170
- hasMore: z7.boolean()
7174
+ hasMore: z7.boolean(),
7175
+ /** Pass back as `cursor` to fetch the next page. Absent when `hasMore` is false. */
7176
+ nextCursor: z7.string().optional()
7171
7177
  });
7172
7178
  var CreateDeploymentResponseSchema = z7.object({
7173
7179
  deploymentId: z7.string()
@@ -7325,7 +7331,9 @@ var DashboardFeedbackInputSchema = z9.object({
7325
7331
  domain: z9.string().min(1),
7326
7332
  dateRange: z9.string().optional(),
7327
7333
  feedbackType: z9.enum(["page", "code_block", "all"]).optional(),
7328
- limit: z9.number().int().min(1).max(50).optional()
7334
+ limit: z9.number().int().min(1).max(50).optional(),
7335
+ /** `nextCursor` from a previous page; continues that page's ordering. */
7336
+ cursor: z9.string().optional()
7329
7337
  });
7330
7338
  var DashboardListOrgMembersInputSchema = z9.object({
7331
7339
  orgId: z9.string(),
@@ -7384,20 +7392,37 @@ var LlmBotTrafficResponseSchema = z9.object({
7384
7392
  });
7385
7393
  var RecentFeedbackResponseSchema = z9.object({
7386
7394
  resolvedDateRange: ResolvedDateRangeSchema,
7395
+ /**
7396
+ * Vote counts over the whole date range, not just the returned page, and over page
7397
+ * feedback only: code-block reports carry no helpful/unhelpful vote and are counted
7398
+ * by `codeBlockCount` instead.
7399
+ */
7387
7400
  helpfulCount: z9.number(),
7388
7401
  unhelpfulCount: z9.number(),
7402
+ codeBlockCount: z9.number(),
7403
+ /** Entries matching the filters over the whole date range. */
7404
+ totalCount: z9.number(),
7389
7405
  entries: z9.array(
7390
7406
  z9.object({
7391
7407
  date: z9.string(),
7392
7408
  location: z9.string(),
7409
+ /** Always false for code-block reports, which carry no vote. */
7393
7410
  wasHelpful: z9.boolean(),
7394
7411
  userFeedback: z9.string(),
7395
7412
  feedbackType: z9.string().optional(),
7396
7413
  /** URL of the docs page the feedback was submitted on. */
7397
- url: z9.string().optional()
7414
+ url: z9.string().optional(),
7415
+ /** What the reader selected on the page, for page feedback. */
7416
+ selection: z9.string().optional(),
7417
+ /** Language of the code block a code-block report was filed against. */
7418
+ language: z9.string().optional(),
7419
+ /** The reported code block, truncated. */
7420
+ code: z9.string().optional()
7398
7421
  })
7399
7422
  ),
7400
- hasMore: z9.boolean()
7423
+ hasMore: z9.boolean(),
7424
+ /** Pass back as `cursor` to fetch the next page. Absent when `hasMore` is false. */
7425
+ nextCursor: z9.string().optional()
7401
7426
  });
7402
7427
  var QueryAnalyticsResponseSchema = z9.object({
7403
7428
  resolvedDateRange: ResolvedDateRangeSchema,
@@ -7412,7 +7437,11 @@ var QueryAnalyticsResponseSchema = z9.object({
7412
7437
  visitors: z9.number().optional(),
7413
7438
  sessions: z9.number().optional()
7414
7439
  })
7415
- )
7440
+ ),
7441
+ /** The row cap the query ran with, after clamping. */
7442
+ limit: z9.number(),
7443
+ /** True when the metric had more rows than `limit`, so `rows` is a truncated ranking. */
7444
+ hasMore: z9.boolean()
7416
7445
  });
7417
7446
  var OrgMembersResponseSchema = z9.object({
7418
7447
  members: z9.array(
@@ -8333,6 +8362,120 @@ import { OpenAPILink as OpenAPILink5 } from "@orpc/openapi-client/fetch";
8333
8362
  // src/orpc-client/docs/v2/library-docs/contract.ts
8334
8363
  import { oc as oc6 } from "@orpc/contract";
8335
8364
  import * as z14 from "zod";
8365
+
8366
+ // src/orpc-client/docs/v2/library-docs/doxyfile.ts
8367
+ var MAX_DOXYFILE_CONTENT_LENGTH = 262144;
8368
+ var SETTING_LINE_RE = /^\s*([A-Z][A-Z0-9_]*)\s*(\+?=)(.*)$/;
8369
+ var AT_DIRECTIVE_RE = /^\s*@[A-Z_]+\b/;
8370
+ var BOOL_RE = /^(?:YES|NO)$/i;
8371
+ var FILE_PATTERN_RE = /^[A-Za-z0-9_.*?+-]+$/;
8372
+ var PREDEFINED_RE = /^[A-Za-z_][A-Za-z0-9_]*(?:\([A-Za-z0-9_,. ]*\))?(?::?=.*)?$/;
8373
+ var ALIAS_DEF_RE = /^\w+(?:\{\d+\})?=/;
8374
+ var DOXYFILE_ALLOWED_KEYS = {
8375
+ ALIASES: (value) => ALIAS_DEF_RE.test(value),
8376
+ PREDEFINED: (value) => PREDEFINED_RE.test(value),
8377
+ FILE_PATTERNS: (value) => FILE_PATTERN_RE.test(value),
8378
+ OPTIMIZE_OUTPUT_FOR_C: (value) => BOOL_RE.test(value)
8379
+ };
8380
+ function joinContinuations(text) {
8381
+ const logical = [];
8382
+ let buffer = "";
8383
+ for (const rawLine of text.split(/\r?\n/)) {
8384
+ const line = rawLine.replace(/\s+$/, "");
8385
+ if (line.endsWith("\\") && !line.endsWith("\\\\")) {
8386
+ buffer += `${line.slice(0, -1)} `;
8387
+ continue;
8388
+ }
8389
+ buffer += line;
8390
+ logical.push(buffer);
8391
+ buffer = "";
8392
+ }
8393
+ if (buffer) {
8394
+ logical.push(buffer);
8395
+ }
8396
+ return logical;
8397
+ }
8398
+ function tokenizeValue(value) {
8399
+ const tokens = [];
8400
+ let i = 0;
8401
+ const n = value.length;
8402
+ while (i < n) {
8403
+ const ch = value[i];
8404
+ if (/\s/.test(ch ?? "")) {
8405
+ i++;
8406
+ continue;
8407
+ }
8408
+ if (ch === '"') {
8409
+ i++;
8410
+ let buf = "";
8411
+ while (i < n) {
8412
+ const c = value[i];
8413
+ if (c === "\\" && i + 1 < n && value[i + 1] === '"') {
8414
+ buf += '"';
8415
+ i += 2;
8416
+ continue;
8417
+ }
8418
+ if (c === '"') {
8419
+ i++;
8420
+ break;
8421
+ }
8422
+ buf += c;
8423
+ i++;
8424
+ }
8425
+ tokens.push(buf);
8426
+ } else {
8427
+ let j = i;
8428
+ while (j < n && !/\s/.test(value[j] ?? "")) {
8429
+ j++;
8430
+ }
8431
+ tokens.push(value.slice(i, j));
8432
+ i = j;
8433
+ }
8434
+ }
8435
+ return tokens;
8436
+ }
8437
+ function validateDoxyfileContent(content) {
8438
+ const errors = [];
8439
+ const droppedKeys = [];
8440
+ if (content.length > MAX_DOXYFILE_CONTENT_LENGTH) {
8441
+ errors.push(`doxyfileContent exceeds ${MAX_DOXYFILE_CONTENT_LENGTH} characters`);
8442
+ return { errors, droppedKeys };
8443
+ }
8444
+ for (const line of joinContinuations(content)) {
8445
+ const stripped = line.trim();
8446
+ if (!stripped || stripped.startsWith("#")) {
8447
+ continue;
8448
+ }
8449
+ if (AT_DIRECTIVE_RE.test(stripped)) {
8450
+ const directive = stripped.split(/\s+/)[0] ?? stripped;
8451
+ if (!droppedKeys.includes(directive)) {
8452
+ droppedKeys.push(directive);
8453
+ }
8454
+ continue;
8455
+ }
8456
+ const match = SETTING_LINE_RE.exec(line);
8457
+ if (match == null) {
8458
+ continue;
8459
+ }
8460
+ const key = match[1] ?? "";
8461
+ const rawValue = match[3] ?? "";
8462
+ const validator = DOXYFILE_ALLOWED_KEYS[key];
8463
+ if (validator == null) {
8464
+ if (!droppedKeys.includes(key)) {
8465
+ droppedKeys.push(key);
8466
+ }
8467
+ continue;
8468
+ }
8469
+ for (const token of tokenizeValue(rawValue)) {
8470
+ if (token.endsWith("\\") || token.includes("$(") || !validator(token)) {
8471
+ errors.push(`Invalid value for Doxyfile setting ${key}: ${JSON.stringify(token)}`);
8472
+ }
8473
+ }
8474
+ }
8475
+ return { errors, droppedKeys };
8476
+ }
8477
+
8478
+ // src/orpc-client/docs/v2/library-docs/contract.ts
8336
8479
  var ALLOWED_HOSTNAMES = /* @__PURE__ */ new Set(["github.com", "gitlab.com"]);
8337
8480
  var GithubUrlSchema = z14.string().url().describe(
8338
8481
  "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>."
@@ -8367,8 +8510,13 @@ var LibraryDocsBaseConfigSchema = z14.object({
8367
8510
  slug: z14.string().nullish()
8368
8511
  });
8369
8512
  var PythonLibraryDocsConfigSchema = LibraryDocsBaseConfigSchema;
8513
+ var SafeDoxyfileContentSchema = z14.string().superRefine((content, ctx) => {
8514
+ for (const error of validateDoxyfileContent(content).errors) {
8515
+ ctx.addIssue({ code: z14.ZodIssueCode.custom, message: error });
8516
+ }
8517
+ }).nullish();
8370
8518
  var CppLibraryDocsConfigSchema = LibraryDocsBaseConfigSchema.extend({
8371
- doxyfileContent: z14.string().nullish()
8519
+ doxyfileContent: SafeDoxyfileContentSchema
8372
8520
  });
8373
8521
  var StartLibraryDocsGenerationInputSchema = z14.discriminatedUnion("language", [
8374
8522
  z14.object({
@@ -13943,7 +14091,8 @@ function transformWebsocket({ writeShape }) {
13943
14091
  name: writeShape.name,
13944
14092
  path: writeShape.path,
13945
14093
  queryParameters: writeShape.queryParameters,
13946
- examples: writeShape.examples
14094
+ examples: writeShape.examples,
14095
+ includeInApiExplorer: writeShape.includeInApiExplorer
13947
14096
  };
13948
14097
  }
13949
14098
  function transformWebhook({