@gitbook/api 0.207.0 → 0.209.0

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.
@@ -16,7 +16,7 @@ export declare const MEMBER_ROLE_ENUM: ["admin", "create", "edit", "review", "co
16
16
  export declare const ORGANIZATION_TEAM_TITLE_MAX_LENGTH = 64;
17
17
  export declare const ORGANIZATION_TEAM_TITLE_MIN_LENGTH = 1;
18
18
  export declare const ICON_MAX_LENGTH = 50;
19
- export declare const DOCUMENT_TEXT_COLOR_ENUM: ["default", "green", "blue", "red", "orange", "yellow", "purple", "pink", "violet", "cyan", "$primary", "$info", "$success", "$warning", "$danger", "$tint"];
19
+ export declare const DOCUMENT_TEXT_COLOR_ENUM: ["default", "green", "blue", "red", "orange", "yellow", "purple", "pink", "violet", "cyan", "$primary", "$secondary", "$info", "$success", "$warning", "$danger", "$tint"];
20
20
  export declare const TEXT_ALIGNMENT_ENUM: ["start", "center", "end"];
21
21
  export declare const CARDS_IMAGE_OBJECT_FIT_ENUM: ["contain", "fill", "cover"];
22
22
  export declare const VERTICAL_ALIGNMENT_ENUM: ["top", "middle", "bottom"];
@@ -33,9 +33,14 @@ export declare const CHANGE_REQUEST_SUBJECT_MIN_LENGTH = 0;
33
33
  export declare const CHANGE_REQUEST_LINK_TITLE_MAX_LENGTH = 128;
34
34
  export declare const CHANGE_REQUEST_ORDER_BY_ENUM: ["updatedAt", "createdAt"];
35
35
  export declare const CHANGE_REQUEST_REVIEW_STATUS_ENUM: ["changes-requested", "approved"];
36
+ export declare const VARIABLE_NAME_MAX_LENGTH = 64;
37
+ export declare const VARIABLE_NAME_MIN_LENGTH = 1;
38
+ export declare const VARIABLE_NAME_PATTERN = "^[a-zA-Z_$][a-zA-Z0-9_$]*$";
39
+ export declare const REVISION_TAG_LABEL_MAX_LENGTH = 50;
40
+ export declare const REVISION_TAG_LABEL_MIN_LENGTH = 1;
36
41
  export declare const REVISION_PAGE_TYPE_ENUM: ["document", "group", "link", "computed"];
37
42
  export declare const REVISION_PAGE_LAYOUT_PRESET_ENUM: ["docs", "editorial", "landing"];
38
- export declare const MEMBER_DISABLED_REASON_ENUM: ["billing", "scim", "admin"];
43
+ export declare const MEMBER_DISABLED_REASON_ENUM: ["billing", "scim", "admin", "gitbook"];
39
44
  export declare const INTEGRATION_TITLE_MAX_LENGTH = 30;
40
45
  export declare const INTEGRATION_TITLE_MIN_LENGTH = 2;
41
46
  export declare const INTEGRATION_DESCRIPTION_MAX_LENGTH = 100;
@@ -66,7 +71,6 @@ export declare const COLLECTION_DESCRIPTION_MIN_LENGTH = 0;
66
71
  export declare const INTEGRATION_INSTALLATION_STATUS_ENUM: ["active", "pending", "paused"];
67
72
  export declare const INTEGRATION_INSTALLATION_SPACE_SELECTION_ENUM: ["all", "selected"];
68
73
  export declare const INTEGRATION_INSTALLATION_SITE_SELECTION_ENUM: ["all", "selected"];
69
- export declare const PAGE_FEEDBACK_RATING_ENUM: ["bad", "ok", "good"];
70
74
  export declare const SITE_TYPE_ENUM: ["basic", "premium", "ultimate", "sponsored"];
71
75
  export declare const SITE_TITLE_MAX_LENGTH = 128;
72
76
  export declare const SITE_TITLE_MIN_LENGTH = 2;
@@ -199,6 +203,7 @@ export declare const SITE_CORE_CHANNEL_TYPE_ENUM: ["site", "embed", "api"];
199
203
  export declare const SITE_CONFIGURABLE_CHANNEL_TYPE_ENUM: ["builtin:slack", "builtin:discord", "builtin:github", "builtin:linear"];
200
204
  export declare const SITE_QUESTION_VISITOR_TYPE_ENUM: ["human", "agent", "bot", "unknown"];
201
205
  export declare const SITE_QUESTION_ANSWER_RESOLUTION_ENUM: ["no", "partially", "yes"];
206
+ export declare const SITE_QUESTION_TIMELINE_INTERVAL_ENUM: ["hour", "day", "week", "month"];
202
207
  export declare const SITE_QUESTION_ANSWER_HELPFULNESS_ENUM: ["low", "medium", "high"];
203
208
  export declare const AIMESSAGE_ROLE_ENUM: ["user", "assistant", "developer"];
204
209
  export declare const AIMESSAGE_STEP_START_CONDITION_ENUM: ["compaction"];
@@ -209,6 +214,7 @@ export declare const SITE_SETTINGS_SCAN_TOPICS_ENUM: ["auto", "never"];
209
214
  export declare const SITE_SETTINGS_FINDING_CHANGE_REQUESTS_ENUM: ["always", "auto-fixable", "never"];
210
215
  export declare const SITE_INSIGHTS_DISPLAY_CONTEXT_ENUM: ["site", "server", "embed", "mcp"];
211
216
  export declare const SITE_INSIGHTS_MARKDOWN_SOURCE_ENUM: ["page-action"];
217
+ export declare const PAGE_FEEDBACK_RATING_ENUM: ["bad", "ok", "good"];
212
218
  export declare const SITE_INSIGHTS_LINK_POSITION_ENUM: ["announcement", "header", "footer", "sidebar", "content"];
213
219
  export declare const SITE_INSIGHTS_TRADEMARK_PLACEMENT_ENUM: ["sidebar", "ad", "footer", "pdf", "embed"];
214
220
  export declare const SITE_INSIGHTS_AD_PLACEMENT_ENUM: ["aside"];
package/dist/index.cjs CHANGED
@@ -419,6 +419,8 @@ __export(src_exports, {
419
419
  REVISION_PAGE_SLUG_MIN_LENGTH: () => REVISION_PAGE_SLUG_MIN_LENGTH,
420
420
  REVISION_PAGE_TYPE_ENUM: () => REVISION_PAGE_TYPE_ENUM,
421
421
  REVISION_SEMANTIC_CHANGE_TYPE_ENUM: () => REVISION_SEMANTIC_CHANGE_TYPE_ENUM,
422
+ REVISION_TAG_LABEL_MAX_LENGTH: () => REVISION_TAG_LABEL_MAX_LENGTH,
423
+ REVISION_TAG_LABEL_MIN_LENGTH: () => REVISION_TAG_LABEL_MIN_LENGTH,
422
424
  RevisionPageDocumentCoverTextColor: () => RevisionPageDocumentCoverTextColor,
423
425
  RevisionPageLayoutOptionsCoverMask: () => RevisionPageLayoutOptionsCoverMask,
424
426
  RevisionPageLayoutOptionsCoverSize: () => RevisionPageLayoutOptionsCoverSize,
@@ -491,6 +493,7 @@ __export(src_exports, {
491
493
  SITE_QUESTION_ANSWER_RELEVANCE_ENUM: () => SITE_QUESTION_ANSWER_RELEVANCE_ENUM,
492
494
  SITE_QUESTION_ANSWER_RESOLUTION_ENUM: () => SITE_QUESTION_ANSWER_RESOLUTION_ENUM,
493
495
  SITE_QUESTION_ANSWER_SOURCE_TYPE_ENUM: () => SITE_QUESTION_ANSWER_SOURCE_TYPE_ENUM,
496
+ SITE_QUESTION_TIMELINE_INTERVAL_ENUM: () => SITE_QUESTION_TIMELINE_INTERVAL_ENUM,
494
497
  SITE_QUESTION_TYPE_ENUM: () => SITE_QUESTION_TYPE_ENUM,
495
498
  SITE_QUESTION_VISITOR_TYPE_ENUM: () => SITE_QUESTION_VISITOR_TYPE_ENUM,
496
499
  SITE_REDIRECT_ORDER_BY_ENUM: () => SITE_REDIRECT_ORDER_BY_ENUM,
@@ -564,6 +567,7 @@ __export(src_exports, {
564
567
  SiteQuestionAnswerRelevance: () => SiteQuestionAnswerRelevance,
565
568
  SiteQuestionAnswerResolution: () => SiteQuestionAnswerResolution,
566
569
  SiteQuestionAnswerSourceType: () => SiteQuestionAnswerSourceType,
570
+ SiteQuestionTimelineInterval: () => SiteQuestionTimelineInterval,
567
571
  SiteQuestionType: () => SiteQuestionType,
568
572
  SiteQuestionVisitorType: () => SiteQuestionVisitorType,
569
573
  SiteRedirectOrderBy: () => SiteRedirectOrderBy,
@@ -587,6 +591,9 @@ __export(src_exports, {
587
591
  TranslationLanguage: () => TranslationLanguage,
588
592
  TranslationStatus: () => TranslationStatus,
589
593
  URL_MAX_LENGTH: () => URL_MAX_LENGTH,
594
+ VARIABLE_NAME_MAX_LENGTH: () => VARIABLE_NAME_MAX_LENGTH,
595
+ VARIABLE_NAME_MIN_LENGTH: () => VARIABLE_NAME_MIN_LENGTH,
596
+ VARIABLE_NAME_PATTERN: () => VARIABLE_NAME_PATTERN,
590
597
  VERTICAL_ALIGNMENT_ENUM: () => VERTICAL_ALIGNMENT_ENUM,
591
598
  VerticalAlignment: () => VerticalAlignment,
592
599
  YOUTUBE_CHANNEL_ID_PATTERN: () => YOUTUBE_CHANNEL_ID_PATTERN,
@@ -596,7 +603,7 @@ module.exports = __toCommonJS(src_exports);
596
603
 
597
604
  // package.json
598
605
  var name = "@gitbook/api";
599
- var version = "0.207.0";
606
+ var version = "0.209.0";
600
607
 
601
608
  // src/client.ts
602
609
  var import_event_iterator = __toESM(require_node(), 1);
@@ -607,49 +614,134 @@ var ParseError = class extends Error {
607
614
  super(message), this.name = "ParseError", this.type = options.type, this.field = options.field, this.value = options.value, this.line = options.line;
608
615
  }
609
616
  };
617
+ var LF = 10;
618
+ var CR = 13;
619
+ var SPACE = 32;
610
620
  function noop(_arg) {
611
621
  }
612
- function createParser(callbacks) {
613
- if (typeof callbacks == "function")
622
+ function createParser(config) {
623
+ if (typeof config == "function")
614
624
  throw new TypeError(
615
- "`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?"
625
+ "`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?"
616
626
  );
617
- const { onEvent = noop, onError = noop, onRetry = noop, onComment } = callbacks;
618
- let incompleteLine = "", isFirstChunk = true, id, data = "", eventType = "";
619
- function feed(newChunk) {
620
- const chunk = isFirstChunk ? newChunk.replace(/^\xEF\xBB\xBF/, "") : newChunk, [complete, incomplete] = splitLines(`${incompleteLine}${chunk}`);
621
- for (const line of complete)
622
- parseLine(line);
623
- incompleteLine = incomplete, isFirstChunk = false;
627
+ const { onEvent = noop, onError = noop, onRetry = noop, onComment, maxBufferSize } = config, pendingFragments = [];
628
+ let pendingFragmentsLength = 0, isFirstChunk = true, id, data = "", dataLines = 0, eventType, terminated = false;
629
+ function feed(chunk) {
630
+ if (terminated)
631
+ throw new Error(
632
+ "Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing."
633
+ );
634
+ if (isFirstChunk && (isFirstChunk = false, chunk.charCodeAt(0) === 239 && chunk.charCodeAt(1) === 187 && chunk.charCodeAt(2) === 191 && (chunk = chunk.slice(3))), pendingFragments.length === 0) {
635
+ const trailing2 = processLines(chunk);
636
+ trailing2 !== "" && (pendingFragments.push(trailing2), pendingFragmentsLength = trailing2.length), checkBufferSize();
637
+ return;
638
+ }
639
+ if (chunk.indexOf(`
640
+ `) === -1 && chunk.indexOf("\r") === -1) {
641
+ pendingFragments.push(chunk), pendingFragmentsLength += chunk.length, checkBufferSize();
642
+ return;
643
+ }
644
+ pendingFragments.push(chunk);
645
+ const input = pendingFragments.join("");
646
+ pendingFragments.length = 0, pendingFragmentsLength = 0;
647
+ const trailing = processLines(input);
648
+ trailing !== "" && (pendingFragments.push(trailing), pendingFragmentsLength = trailing.length), checkBufferSize();
649
+ }
650
+ function checkBufferSize() {
651
+ maxBufferSize !== void 0 && (pendingFragmentsLength + data.length <= maxBufferSize || (terminated = true, pendingFragments.length = 0, pendingFragmentsLength = 0, id = void 0, data = "", dataLines = 0, eventType = void 0, onError(
652
+ new ParseError(`Buffered data exceeded max buffer size of ${maxBufferSize} characters`, {
653
+ type: "max-buffer-size-exceeded"
654
+ })
655
+ )));
656
+ }
657
+ function processLines(chunk) {
658
+ let searchIndex = 0;
659
+ if (chunk.indexOf("\r") === -1) {
660
+ let lfIndex = chunk.indexOf(`
661
+ `, searchIndex);
662
+ for (; lfIndex !== -1; ) {
663
+ if (searchIndex === lfIndex) {
664
+ dataLines > 0 && onEvent({ id, event: eventType, data }), id = void 0, data = "", dataLines = 0, eventType = void 0, searchIndex = lfIndex + 1, lfIndex = chunk.indexOf(`
665
+ `, searchIndex);
666
+ continue;
667
+ }
668
+ const firstCharCode = chunk.charCodeAt(searchIndex);
669
+ if (isDataPrefix(chunk, searchIndex, firstCharCode)) {
670
+ const valueStart = chunk.charCodeAt(searchIndex + 5) === SPACE ? searchIndex + 6 : searchIndex + 5, value = chunk.slice(valueStart, lfIndex);
671
+ if (dataLines === 0 && chunk.charCodeAt(lfIndex + 1) === LF) {
672
+ onEvent({ id, event: eventType, data: value }), id = void 0, data = "", eventType = void 0, searchIndex = lfIndex + 2, lfIndex = chunk.indexOf(`
673
+ `, searchIndex);
674
+ continue;
675
+ }
676
+ data = dataLines === 0 ? value : `${data}
677
+ ${value}`, dataLines++;
678
+ } else
679
+ isEventPrefix(chunk, searchIndex, firstCharCode) ? eventType = chunk.slice(
680
+ chunk.charCodeAt(searchIndex + 6) === SPACE ? searchIndex + 7 : searchIndex + 6,
681
+ lfIndex
682
+ ) || void 0 : parseLine(chunk, searchIndex, lfIndex);
683
+ searchIndex = lfIndex + 1, lfIndex = chunk.indexOf(`
684
+ `, searchIndex);
685
+ }
686
+ return chunk.slice(searchIndex);
687
+ }
688
+ for (; searchIndex < chunk.length; ) {
689
+ const crIndex = chunk.indexOf("\r", searchIndex), lfIndex = chunk.indexOf(`
690
+ `, searchIndex);
691
+ let lineEnd = -1;
692
+ if (crIndex !== -1 && lfIndex !== -1 ? lineEnd = crIndex < lfIndex ? crIndex : lfIndex : crIndex !== -1 ? crIndex === chunk.length - 1 ? lineEnd = -1 : lineEnd = crIndex : lfIndex !== -1 && (lineEnd = lfIndex), lineEnd === -1)
693
+ break;
694
+ parseLine(chunk, searchIndex, lineEnd), searchIndex = lineEnd + 1, chunk.charCodeAt(searchIndex - 1) === CR && chunk.charCodeAt(searchIndex) === LF && searchIndex++;
695
+ }
696
+ return chunk.slice(searchIndex);
624
697
  }
625
- function parseLine(line) {
626
- if (line === "") {
698
+ function parseLine(chunk, start, end) {
699
+ if (start === end) {
627
700
  dispatchEvent();
628
701
  return;
629
702
  }
630
- if (line.startsWith(":")) {
631
- onComment && onComment(line.slice(line.startsWith(": ") ? 2 : 1));
703
+ const firstCharCode = chunk.charCodeAt(start);
704
+ if (isDataPrefix(chunk, start, firstCharCode)) {
705
+ const valueStart = chunk.charCodeAt(start + 5) === SPACE ? start + 6 : start + 5, value2 = chunk.slice(valueStart, end);
706
+ data = dataLines === 0 ? value2 : `${data}
707
+ ${value2}`, dataLines++;
708
+ return;
709
+ }
710
+ if (isEventPrefix(chunk, start, firstCharCode)) {
711
+ eventType = chunk.slice(chunk.charCodeAt(start + 6) === SPACE ? start + 7 : start + 6, end) || void 0;
632
712
  return;
633
713
  }
634
- const fieldSeparatorIndex = line.indexOf(":");
635
- if (fieldSeparatorIndex !== -1) {
636
- const field = line.slice(0, fieldSeparatorIndex), offset = line[fieldSeparatorIndex + 1] === " " ? 2 : 1, value = line.slice(fieldSeparatorIndex + offset);
637
- processField(field, value, line);
714
+ if (firstCharCode === 105 && chunk.charCodeAt(start + 1) === 100 && chunk.charCodeAt(start + 2) === 58) {
715
+ const value2 = chunk.slice(chunk.charCodeAt(start + 3) === SPACE ? start + 4 : start + 3, end);
716
+ value2.includes("\0") || (id = value2);
638
717
  return;
639
718
  }
640
- processField(line, "", line);
719
+ if (firstCharCode === 58) {
720
+ if (onComment) {
721
+ const line2 = chunk.slice(start, end);
722
+ onComment(line2.slice(chunk.charCodeAt(start + 1) === SPACE ? 2 : 1));
723
+ }
724
+ return;
725
+ }
726
+ const line = chunk.slice(start, end), fieldSeparatorIndex = line.indexOf(":");
727
+ if (fieldSeparatorIndex === -1) {
728
+ processField(line, "", line);
729
+ return;
730
+ }
731
+ const field = line.slice(0, fieldSeparatorIndex), offset = line.charCodeAt(fieldSeparatorIndex + 1) === SPACE ? 2 : 1, value = line.slice(fieldSeparatorIndex + offset);
732
+ processField(field, value, line);
641
733
  }
642
734
  function processField(field, value, line) {
643
735
  switch (field) {
644
736
  case "event":
645
- eventType = value;
737
+ eventType = value || void 0;
646
738
  break;
647
739
  case "data":
648
- data = `${data}${value}
649
- `;
740
+ data = dataLines === 0 ? value : `${data}
741
+ ${value}`, dataLines++;
650
742
  break;
651
743
  case "id":
652
- id = value.includes("\0") ? void 0 : value;
744
+ value.includes("\0") || (id = value);
653
745
  break;
654
746
  case "retry":
655
747
  /^\d+$/.test(value) ? onRetry(parseInt(value, 10)) : onError(
@@ -671,35 +763,26 @@ function createParser(callbacks) {
671
763
  }
672
764
  }
673
765
  function dispatchEvent() {
674
- data.length > 0 && onEvent({
766
+ dataLines > 0 && onEvent({
675
767
  id,
676
- event: eventType || void 0,
677
- data: data.endsWith(`
678
- `) ? data.slice(0, -1) : data
679
- }), id = void 0, data = "", eventType = "";
768
+ event: eventType,
769
+ data
770
+ }), id = void 0, data = "", dataLines = 0, eventType = void 0;
680
771
  }
681
772
  function reset(options = {}) {
682
- incompleteLine && options.consume && parseLine(incompleteLine), isFirstChunk = true, id = void 0, data = "", eventType = "", incompleteLine = "";
773
+ if (options.consume && pendingFragments.length > 0) {
774
+ const incompleteLine = pendingFragments.join("");
775
+ parseLine(incompleteLine, 0, incompleteLine.length);
776
+ }
777
+ isFirstChunk = true, id = void 0, data = "", dataLines = 0, eventType = void 0, pendingFragments.length = 0, pendingFragmentsLength = 0, terminated = false;
683
778
  }
684
779
  return { feed, reset };
685
780
  }
686
- function splitLines(chunk) {
687
- const lines = [];
688
- let incompleteLine = "", searchIndex = 0;
689
- for (; searchIndex < chunk.length; ) {
690
- const crIndex = chunk.indexOf("\r", searchIndex), lfIndex = chunk.indexOf(`
691
- `, searchIndex);
692
- let lineEnd = -1;
693
- if (crIndex !== -1 && lfIndex !== -1 ? lineEnd = Math.min(crIndex, lfIndex) : crIndex !== -1 ? crIndex === chunk.length - 1 ? lineEnd = -1 : lineEnd = crIndex : lfIndex !== -1 && (lineEnd = lfIndex), lineEnd === -1) {
694
- incompleteLine = chunk.slice(searchIndex);
695
- break;
696
- } else {
697
- const line = chunk.slice(searchIndex, lineEnd);
698
- lines.push(line), searchIndex = lineEnd + 1, chunk[searchIndex - 1] === "\r" && chunk[searchIndex] === `
699
- ` && searchIndex++;
700
- }
701
- }
702
- return [lines, incompleteLine];
781
+ function isDataPrefix(chunk, i, firstCharCode) {
782
+ return firstCharCode === 100 && chunk.charCodeAt(i + 1) === 97 && chunk.charCodeAt(i + 2) === 116 && chunk.charCodeAt(i + 3) === 97 && chunk.charCodeAt(i + 4) === 58;
783
+ }
784
+ function isEventPrefix(chunk, i, firstCharCode) {
785
+ return firstCharCode === 101 && chunk.charCodeAt(i + 1) === 118 && chunk.charCodeAt(i + 2) === 101 && chunk.charCodeAt(i + 3) === 110 && chunk.charCodeAt(i + 4) === 116 && chunk.charCodeAt(i + 5) === 58;
703
786
  }
704
787
 
705
788
  // src/client.ts
@@ -1017,6 +1100,12 @@ var SiteInsightsLinkPosition = /* @__PURE__ */ ((SiteInsightsLinkPosition2) => {
1017
1100
  SiteInsightsLinkPosition2["Content"] = "content";
1018
1101
  return SiteInsightsLinkPosition2;
1019
1102
  })(SiteInsightsLinkPosition || {});
1103
+ var PageFeedbackRating = /* @__PURE__ */ ((PageFeedbackRating2) => {
1104
+ PageFeedbackRating2["Bad"] = "bad";
1105
+ PageFeedbackRating2["Ok"] = "ok";
1106
+ PageFeedbackRating2["Good"] = "good";
1107
+ return PageFeedbackRating2;
1108
+ })(PageFeedbackRating || {});
1020
1109
  var SiteInsightsMarkdownSource = /* @__PURE__ */ ((SiteInsightsMarkdownSource2) => {
1021
1110
  SiteInsightsMarkdownSource2["PageAction"] = "page-action";
1022
1111
  return SiteInsightsMarkdownSource2;
@@ -1073,6 +1162,13 @@ var SiteQuestionAnswerHelpfulness = /* @__PURE__ */ ((SiteQuestionAnswerHelpfuln
1073
1162
  SiteQuestionAnswerHelpfulness2["High"] = "high";
1074
1163
  return SiteQuestionAnswerHelpfulness2;
1075
1164
  })(SiteQuestionAnswerHelpfulness || {});
1165
+ var SiteQuestionTimelineInterval = /* @__PURE__ */ ((SiteQuestionTimelineInterval2) => {
1166
+ SiteQuestionTimelineInterval2["Hour"] = "hour";
1167
+ SiteQuestionTimelineInterval2["Day"] = "day";
1168
+ SiteQuestionTimelineInterval2["Week"] = "week";
1169
+ SiteQuestionTimelineInterval2["Month"] = "month";
1170
+ return SiteQuestionTimelineInterval2;
1171
+ })(SiteQuestionTimelineInterval || {});
1076
1172
  var SiteQuestionAnswerResolution = /* @__PURE__ */ ((SiteQuestionAnswerResolution2) => {
1077
1173
  SiteQuestionAnswerResolution2["No"] = "no";
1078
1174
  SiteQuestionAnswerResolution2["Partially"] = "partially";
@@ -1647,12 +1743,6 @@ var SiteType = /* @__PURE__ */ ((SiteType2) => {
1647
1743
  SiteType2["Sponsored"] = "sponsored";
1648
1744
  return SiteType2;
1649
1745
  })(SiteType || {});
1650
- var PageFeedbackRating = /* @__PURE__ */ ((PageFeedbackRating2) => {
1651
- PageFeedbackRating2["Bad"] = "bad";
1652
- PageFeedbackRating2["Ok"] = "ok";
1653
- PageFeedbackRating2["Good"] = "good";
1654
- return PageFeedbackRating2;
1655
- })(PageFeedbackRating || {});
1656
1746
  var IntegrationInstallationSiteSelection = /* @__PURE__ */ ((IntegrationInstallationSiteSelection2) => {
1657
1747
  IntegrationInstallationSiteSelection2["All"] = "all";
1658
1748
  IntegrationInstallationSiteSelection2["Selected"] = "selected";
@@ -1774,6 +1864,7 @@ var MemberDisabledReason = /* @__PURE__ */ ((MemberDisabledReason2) => {
1774
1864
  MemberDisabledReason2["Billing"] = "billing";
1775
1865
  MemberDisabledReason2["Scim"] = "scim";
1776
1866
  MemberDisabledReason2["Admin"] = "admin";
1867
+ MemberDisabledReason2["Gitbook"] = "gitbook";
1777
1868
  return MemberDisabledReason2;
1778
1869
  })(MemberDisabledReason || {});
1779
1870
  var RevisionPageLayoutPreset = /* @__PURE__ */ ((RevisionPageLayoutPreset2) => {
@@ -1862,6 +1953,7 @@ var DocumentTextColor = /* @__PURE__ */ ((DocumentTextColor2) => {
1862
1953
  DocumentTextColor2["Violet"] = "violet";
1863
1954
  DocumentTextColor2["Cyan"] = "cyan";
1864
1955
  DocumentTextColor2["Primary"] = "$primary";
1956
+ DocumentTextColor2["Secondary"] = "$secondary";
1865
1957
  DocumentTextColor2["Info"] = "$info";
1866
1958
  DocumentTextColor2["Success"] = "$success";
1867
1959
  DocumentTextColor2["Warning"] = "$warning";
@@ -3228,6 +3320,33 @@ var Api = class extends HttpClient {
3228
3320
  format: "json",
3229
3321
  ...params
3230
3322
  }),
3323
+ createIntegrationOAuthTransaction: (integrationName, installationId, data, params = {}) => this.request({
3324
+ path: `/integrations/${integrationName}/installations/${installationId}/oauth-transactions`,
3325
+ method: "POST",
3326
+ body: data,
3327
+ secure: true,
3328
+ type: "application/json" /* Json */,
3329
+ format: "json",
3330
+ ...params
3331
+ }),
3332
+ consumeIntegrationOAuthTransaction: (integrationName, transactionId, data, params = {}) => this.request({
3333
+ path: `/integrations/${integrationName}/oauth-transactions/${transactionId}/consume`,
3334
+ method: "POST",
3335
+ body: data,
3336
+ secure: true,
3337
+ type: "application/json" /* Json */,
3338
+ format: "json",
3339
+ ...params
3340
+ }),
3341
+ confirmIntegrationOAuthTransaction: (integrationName, transactionId, data, params = {}) => this.request({
3342
+ path: `/integrations/${integrationName}/oauth-transactions/${transactionId}/confirm`,
3343
+ method: "POST",
3344
+ body: data,
3345
+ secure: true,
3346
+ type: "application/json" /* Json */,
3347
+ format: "json",
3348
+ ...params
3349
+ }),
3231
3350
  listIntegrationInstallationSpaces: (integrationName, installationId, query, params = {}) => this.request({
3232
3351
  path: `/integrations/${integrationName}/installations/${installationId}/spaces`,
3233
3352
  method: "GET",
@@ -4498,15 +4617,6 @@ var Api = class extends HttpClient {
4498
4617
  format: "json",
4499
4618
  ...params
4500
4619
  }),
4501
- updateSiteFindingById: (organizationId, siteId, siteFindingId, data, params = {}) => this.request({
4502
- path: `/orgs/${organizationId}/sites/${siteId}/findings/${siteFindingId}`,
4503
- method: "PATCH",
4504
- body: data,
4505
- secure: true,
4506
- type: "application/json" /* Json */,
4507
- format: "json",
4508
- ...params
4509
- }),
4510
4620
  listChangeRequestsForSiteFinding: (organizationId, siteId, siteFindingId, query, params = {}) => this.request({
4511
4621
  path: `/orgs/${organizationId}/sites/${siteId}/findings/${siteFindingId}/change-requests`,
4512
4622
  method: "GET",
@@ -4676,6 +4786,14 @@ var Api = class extends HttpClient {
4676
4786
  format: "json",
4677
4787
  ...params
4678
4788
  }),
4789
+ getSiteQuestionTimeline: (organizationId, siteId, query, params = {}) => this.request({
4790
+ path: `/orgs/${organizationId}/sites/${siteId}/question-timeline`,
4791
+ method: "GET",
4792
+ query,
4793
+ secure: true,
4794
+ format: "json",
4795
+ ...params
4796
+ }),
4679
4797
  listSiteQuestionAnswers: (organizationId, siteId, query, params = {}) => this.request({
4680
4798
  path: `/orgs/${organizationId}/sites/${siteId}/answers`,
4681
4799
  method: "GET",
@@ -5304,7 +5422,7 @@ var MEMBER_ROLE_ENUM = ["admin", "create", "edit", "review", "comment", "read"];
5304
5422
  var ORGANIZATION_TEAM_TITLE_MAX_LENGTH = 64;
5305
5423
  var ORGANIZATION_TEAM_TITLE_MIN_LENGTH = 1;
5306
5424
  var ICON_MAX_LENGTH = 50;
5307
- var DOCUMENT_TEXT_COLOR_ENUM = ["default", "green", "blue", "red", "orange", "yellow", "purple", "pink", "violet", "cyan", "$primary", "$info", "$success", "$warning", "$danger", "$tint"];
5425
+ var DOCUMENT_TEXT_COLOR_ENUM = ["default", "green", "blue", "red", "orange", "yellow", "purple", "pink", "violet", "cyan", "$primary", "$secondary", "$info", "$success", "$warning", "$danger", "$tint"];
5308
5426
  var TEXT_ALIGNMENT_ENUM = ["start", "center", "end"];
5309
5427
  var CARDS_IMAGE_OBJECT_FIT_ENUM = ["contain", "fill", "cover"];
5310
5428
  var VERTICAL_ALIGNMENT_ENUM = ["top", "middle", "bottom"];
@@ -5321,9 +5439,14 @@ var CHANGE_REQUEST_SUBJECT_MIN_LENGTH = 0;
5321
5439
  var CHANGE_REQUEST_LINK_TITLE_MAX_LENGTH = 128;
5322
5440
  var CHANGE_REQUEST_ORDER_BY_ENUM = ["updatedAt", "createdAt"];
5323
5441
  var CHANGE_REQUEST_REVIEW_STATUS_ENUM = ["changes-requested", "approved"];
5442
+ var VARIABLE_NAME_MAX_LENGTH = 64;
5443
+ var VARIABLE_NAME_MIN_LENGTH = 1;
5444
+ var VARIABLE_NAME_PATTERN = "^[a-zA-Z_$][a-zA-Z0-9_$]*$";
5445
+ var REVISION_TAG_LABEL_MAX_LENGTH = 50;
5446
+ var REVISION_TAG_LABEL_MIN_LENGTH = 1;
5324
5447
  var REVISION_PAGE_TYPE_ENUM = ["document", "group", "link", "computed"];
5325
5448
  var REVISION_PAGE_LAYOUT_PRESET_ENUM = ["docs", "editorial", "landing"];
5326
- var MEMBER_DISABLED_REASON_ENUM = ["billing", "scim", "admin"];
5449
+ var MEMBER_DISABLED_REASON_ENUM = ["billing", "scim", "admin", "gitbook"];
5327
5450
  var INTEGRATION_TITLE_MAX_LENGTH = 30;
5328
5451
  var INTEGRATION_TITLE_MIN_LENGTH = 2;
5329
5452
  var INTEGRATION_DESCRIPTION_MAX_LENGTH = 100;
@@ -5354,7 +5477,6 @@ var COLLECTION_DESCRIPTION_MIN_LENGTH = 0;
5354
5477
  var INTEGRATION_INSTALLATION_STATUS_ENUM = ["active", "pending", "paused"];
5355
5478
  var INTEGRATION_INSTALLATION_SPACE_SELECTION_ENUM = ["all", "selected"];
5356
5479
  var INTEGRATION_INSTALLATION_SITE_SELECTION_ENUM = ["all", "selected"];
5357
- var PAGE_FEEDBACK_RATING_ENUM = ["bad", "ok", "good"];
5358
5480
  var SITE_TYPE_ENUM = ["basic", "premium", "ultimate", "sponsored"];
5359
5481
  var SITE_TITLE_MAX_LENGTH = 128;
5360
5482
  var SITE_TITLE_MIN_LENGTH = 2;
@@ -5487,6 +5609,7 @@ var SITE_CORE_CHANNEL_TYPE_ENUM = ["site", "embed", "api"];
5487
5609
  var SITE_CONFIGURABLE_CHANNEL_TYPE_ENUM = ["builtin:slack", "builtin:discord", "builtin:github", "builtin:linear"];
5488
5610
  var SITE_QUESTION_VISITOR_TYPE_ENUM = ["human", "agent", "bot", "unknown"];
5489
5611
  var SITE_QUESTION_ANSWER_RESOLUTION_ENUM = ["no", "partially", "yes"];
5612
+ var SITE_QUESTION_TIMELINE_INTERVAL_ENUM = ["hour", "day", "week", "month"];
5490
5613
  var SITE_QUESTION_ANSWER_HELPFULNESS_ENUM = ["low", "medium", "high"];
5491
5614
  var AIMESSAGE_ROLE_ENUM = ["user", "assistant", "developer"];
5492
5615
  var AIMESSAGE_STEP_START_CONDITION_ENUM = ["compaction"];
@@ -5497,6 +5620,7 @@ var SITE_SETTINGS_SCAN_TOPICS_ENUM = ["auto", "never"];
5497
5620
  var SITE_SETTINGS_FINDING_CHANGE_REQUESTS_ENUM = ["always", "auto-fixable", "never"];
5498
5621
  var SITE_INSIGHTS_DISPLAY_CONTEXT_ENUM = ["site", "server", "embed", "mcp"];
5499
5622
  var SITE_INSIGHTS_MARKDOWN_SOURCE_ENUM = ["page-action"];
5623
+ var PAGE_FEEDBACK_RATING_ENUM = ["bad", "ok", "good"];
5500
5624
  var SITE_INSIGHTS_LINK_POSITION_ENUM = ["announcement", "header", "footer", "sidebar", "content"];
5501
5625
  var SITE_INSIGHTS_TRADEMARK_PLACEMENT_ENUM = ["sidebar", "ad", "footer", "pdf", "embed"];
5502
5626
  var SITE_INSIGHTS_AD_PLACEMENT_ENUM = ["aside"];
@@ -5852,6 +5976,8 @@ var GitBookAPI = class extends Api {
5852
5976
  REVISION_PAGE_SLUG_MIN_LENGTH,
5853
5977
  REVISION_PAGE_TYPE_ENUM,
5854
5978
  REVISION_SEMANTIC_CHANGE_TYPE_ENUM,
5979
+ REVISION_TAG_LABEL_MAX_LENGTH,
5980
+ REVISION_TAG_LABEL_MIN_LENGTH,
5855
5981
  RevisionPageDocumentCoverTextColor,
5856
5982
  RevisionPageLayoutOptionsCoverMask,
5857
5983
  RevisionPageLayoutOptionsCoverSize,
@@ -5924,6 +6050,7 @@ var GitBookAPI = class extends Api {
5924
6050
  SITE_QUESTION_ANSWER_RELEVANCE_ENUM,
5925
6051
  SITE_QUESTION_ANSWER_RESOLUTION_ENUM,
5926
6052
  SITE_QUESTION_ANSWER_SOURCE_TYPE_ENUM,
6053
+ SITE_QUESTION_TIMELINE_INTERVAL_ENUM,
5927
6054
  SITE_QUESTION_TYPE_ENUM,
5928
6055
  SITE_QUESTION_VISITOR_TYPE_ENUM,
5929
6056
  SITE_REDIRECT_ORDER_BY_ENUM,
@@ -5997,6 +6124,7 @@ var GitBookAPI = class extends Api {
5997
6124
  SiteQuestionAnswerRelevance,
5998
6125
  SiteQuestionAnswerResolution,
5999
6126
  SiteQuestionAnswerSourceType,
6127
+ SiteQuestionTimelineInterval,
6000
6128
  SiteQuestionType,
6001
6129
  SiteQuestionVisitorType,
6002
6130
  SiteRedirectOrderBy,
@@ -6020,6 +6148,9 @@ var GitBookAPI = class extends Api {
6020
6148
  TranslationLanguage,
6021
6149
  TranslationStatus,
6022
6150
  URL_MAX_LENGTH,
6151
+ VARIABLE_NAME_MAX_LENGTH,
6152
+ VARIABLE_NAME_MIN_LENGTH,
6153
+ VARIABLE_NAME_PATTERN,
6023
6154
  VERTICAL_ALIGNMENT_ENUM,
6024
6155
  VerticalAlignment,
6025
6156
  YOUTUBE_CHANNEL_ID_PATTERN,