@gitbook/api 0.192.0 → 0.194.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.
package/dist/client.d.ts CHANGED
@@ -324,13 +324,13 @@ export declare enum SiteQuestionType {
324
324
  Unknown = "unknown"
325
325
  }
326
326
  /**
327
- * The field to sort site findings by. `updatedAt` returns the most recently updated findings first. `severity` returns the most severe findings first. `questions` returns the most asked-about findings first. Defaults to 'updatedAt'.
327
+ * The field to sort site findings by. `updatedAt` returns the most recently updated findings first. `severity` returns the most severe findings first. `sources` returns the findings with the most linked sources (questions plus records) first. Defaults to 'updatedAt'.
328
328
  * @default "updatedAt"
329
329
  */
330
330
  export declare enum SiteFindingOrderBy {
331
331
  UpdatedAt = "updatedAt",
332
332
  Severity = "severity",
333
- Questions = "questions"
333
+ Sources = "sources"
334
334
  }
335
335
  /** Findings source filter matching evidence coming from site questions. */
336
336
  export declare enum SiteTriageFilterQuestions {
@@ -726,6 +726,7 @@ export declare enum SiteFeatureKey {
726
726
  SitesAiAssistant = "sites-ai-assistant",
727
727
  SitesAiInsights = "sites-ai-insights",
728
728
  SitesConnections = "sites-connections",
729
+ SitesContentGaps = "sites-content-gaps",
729
730
  SitesChannels = "sites-channels",
730
731
  SitesEmbed = "sites-embed",
731
732
  SitesApiPlayground = "sites-api-playground",
@@ -812,6 +813,14 @@ export declare enum BillingTrialStatus {
812
813
  Ended = "ended",
813
814
  Expired = "expired"
814
815
  }
816
+ /** The AI credit bundle to top up every month */
817
+ export declare enum BillingCreditsBundle {
818
+ None = "none",
819
+ Value135001500 = "13500_1500",
820
+ Value240006000 = "24000_6000",
821
+ Value4200018000 = "42000_18000",
822
+ Value6500035000 = "65000_35000"
823
+ }
815
824
  /** Interval for a billing subscription */
816
825
  export declare enum BillingInterval {
817
826
  Monthly = "monthly",
@@ -1095,9 +1104,9 @@ export declare enum ContentVisibility {
1095
1104
  Private = "private"
1096
1105
  }
1097
1106
  /** Data passed through a realtime channel */
1098
- export type APIChannelData = APIChannelGitSyncOperationData | APIChannelTranslationRunData | APIChannelImportRunData | APIChannelMutationData;
1107
+ export type APIChannelData = APIChannelGitSyncOperationData | APIChannelGitSyncSiteOperationData | APIChannelTranslationRunData | APIChannelImportRunData | APIChannelMutationData;
1099
1108
  /** Channel to subscribe to for realtime updates. */
1100
- export type APIChannel = APIChannelSpaceInfo | APIChannelSpaceContent | APIChannelSpaceGitInfo | APIChannelSpacePublishingAuth | APIChannelSpacePublishingCustomization | APIChannelSpaceIntegrations | APIChannelUserAPITokens | APIChannelUserOrganizations | APIChannelUserProfile | APIChannelChangeRequest | APIChannelChangeRequests | APIChannelChangeRequestReviews | APIChannelCollection | APIChannelCollectionPublishingCustomization | APIChannelOrganizationInfo | APIChannelOrganizationAgentData | APIChannelOrganizationInviteLinks | APIChannelOrganizationMembers | APIChannelOrganizationMember | APIChannelOrganizationSAML | APIChannelOrganizationTeams | APIChannelOrganizationTeam | APIChannelOrganizationTeamMembers | APIChannelOrganizationTeamMember | APIChannelOrganizationSpaces | APIChannelOrganizationCollections | APIChannelOrganizationIntegrations | APIChannelOrganizationInstallations | APIChannelOrganizationSites | APIChannelOrganizationOpenAPISpecs | APIChannelOrganizationTranslations | APIChannelOrganizationTranslationsGlossary | APIChannelOrganizationCustomFonts | APIChannelOrganizationAgentInstructions | APIChannelOrganizationChangeRequests | APIChannelSpaceComments | APIChannelChangeRequestComments | APIChannelCommentInfo | APIChannelCommentReplies | APIChannelIntegration | APIChannelIntegrationInstallation | APIChannelIntegrationSpaceInstallation | APIChannelIntegrationSpaceInstallations | APIChannelIntegrationSiteInstallation | APIChannelIntegrationSiteInstallations | APIChannelPublishedContentSite | APIChannelSiteRedirects | APIChannelSite | APIChannelSiteChannels | APIChannelSiteContext | APIChannelSiteCustomization | APIChannelSiteAgentSettings | APIChannelSiteIntegrations | APIChannelSiteSpace | APIChannelSiteSpaceCustomization | APIChannelSiteStructure | APIChannelSiteAdaptiveSchema | APIChannelSitePublishingAuth | APIChannelSiteShareLinks | APIChannelSiteShareLink | APIChannelSiteMcpServers | APIChannelSiteMcpServer | APIChannelSiteSection | APIChannelCustomHostname | APIChannelGitSyncInstallation | APIChannelGitSyncOperation | APIChannelOpenAPISpec | APIChannelSubdomain | APIChannelTranslation | APIChannelTranslationRun | APIChannelImportRun;
1109
+ export type APIChannel = APIChannelSpaceInfo | APIChannelSpaceContent | APIChannelSpaceGitInfo | APIChannelSpacePublishingAuth | APIChannelSpacePublishingCustomization | APIChannelSpaceIntegrations | APIChannelUserAPITokens | APIChannelUserOrganizations | APIChannelUserProfile | APIChannelChangeRequest | APIChannelChangeRequests | APIChannelChangeRequestReviews | APIChannelCollection | APIChannelCollectionPublishingCustomization | APIChannelOrganizationInfo | APIChannelOrganizationAgentData | APIChannelOrganizationInviteLinks | APIChannelOrganizationMembers | APIChannelOrganizationMember | APIChannelOrganizationSAML | APIChannelOrganizationTeams | APIChannelOrganizationTeam | APIChannelOrganizationTeamMembers | APIChannelOrganizationTeamMember | APIChannelOrganizationSpaces | APIChannelOrganizationCollections | APIChannelOrganizationIntegrations | APIChannelOrganizationInstallations | APIChannelOrganizationSites | APIChannelOrganizationOpenAPISpecs | APIChannelOrganizationTranslations | APIChannelOrganizationTranslationsGlossary | APIChannelOrganizationCustomFonts | APIChannelOrganizationAgentInstructions | APIChannelOrganizationChangeRequests | APIChannelSpaceComments | APIChannelChangeRequestComments | APIChannelCommentInfo | APIChannelCommentReplies | APIChannelIntegration | APIChannelIntegrationInstallation | APIChannelIntegrationSpaceInstallation | APIChannelIntegrationSpaceInstallations | APIChannelIntegrationSiteInstallation | APIChannelIntegrationSiteInstallations | APIChannelPublishedContentSite | APIChannelSiteRedirects | APIChannelSite | APIChannelSiteChannels | APIChannelSiteContext | APIChannelSiteCustomization | APIChannelSiteAgentSettings | APIChannelSiteIntegrations | APIChannelSiteSpace | APIChannelSiteSpaceCustomization | APIChannelSiteStructure | APIChannelSiteAdaptiveSchema | APIChannelSitePublishingAuth | APIChannelSiteShareLinks | APIChannelSiteShareLink | APIChannelSiteMcpServers | APIChannelSiteMcpServer | APIChannelSiteSection | APIChannelCustomHostname | APIChannelGitSyncInstallation | APIChannelGitSyncOperation | APIChannelGitSyncSiteOperation | APIChannelOpenAPISpec | APIChannelSubdomain | APIChannelTranslation | APIChannelTranslationRun | APIChannelImportRun;
1101
1110
  /** An absolute reference to content in GitBook. */
1102
1111
  export type ContentLocation = ContentLocationFile | ContentLocationURL | ContentLocationPage | ContentLocationUser | ContentLocationCollection | ContentLocationSpace | ContentLocationReusableContent | ContentLocationOpenAPI;
1103
1112
  export type PublishedContentRedirect = {
@@ -1137,6 +1146,14 @@ export type ContentKitInlineElement = ContentKitText | ContentKitImage | Content
1137
1146
  export type ContentKitDescendantElement = ContentKitButton | ContentKitTextInput | ContentKitHStack | ContentKitVStack | ContentKitBox | ContentKitDivider | ContentKitWebFrame | ContentKitCodeBlock | ContentKitMarkdown | ContentKitCard | ContentKitImage | ContentKitInput | ContentKitSelect | ContentKitSwitch | ContentKitCheckbox | ContentKitRadio | ContentKitText | ContentKitHint | ContentKitLink | ContentKitStepperStep;
1138
1147
  /** Any event that can be received from GitBook. */
1139
1148
  export type Event = InstallationSetupEvent | InstallationDeletedEvent | SpaceInstallationSetupEvent | SpaceInstallationDeletedEvent | SiteInstallationSetupEvent | SiteInstallationDeletedEvent | SiteViewEvent | SpaceContentUpdatedEvent | SpaceGitSyncCompletedEvent | SpaceGitSyncStartedEvent | SpaceVisibilityUpdatedEvent | TaskEvent | FetchEvent | FetchPublishedScriptEvent | FetchVisitorAuthenticationEvent | UIRenderEvent | ContentComputeDocumentEvent | ContentComputeRevisionEvent | PageFeedbackEvent;
1149
+ /** An outcome of a content change. */
1150
+ export type ChangeRequestContentUpdateChange = ({
1151
+ object: "created_page";
1152
+ } & ChangeRequestContentUpdateInsertedPage) | ({
1153
+ object: "updated_page";
1154
+ } & ChangeRequestContentUpdateUpdatedPage) | ({
1155
+ object: "deleted_page";
1156
+ } & ChangeRequestContentUpdateDeletedPage);
1140
1157
  export type ChangeRequestContentChange = ({
1141
1158
  operation: "update_page";
1142
1159
  } & ChangeRequestContentChangeUpdatePage) | ({
@@ -1145,7 +1162,9 @@ export type ChangeRequestContentChange = ({
1145
1162
  operation: "delete_page";
1146
1163
  } & ChangeRequestContentChangeDeletePage) | ({
1147
1164
  operation: "revert_page";
1148
- } & ChangeRequestContentChangeRevertPage);
1165
+ } & ChangeRequestContentChangeRevertPage) | ({
1166
+ operation: "insert_files";
1167
+ } & ChangeRequestContentChangeInsertFiles);
1149
1168
  export type Revision = RevisionTypeEdits | RevisionTypeMerge | RevisionTypeRollback | RevisionTypeUpdate | RevisionTypeComputed;
1150
1169
  export type RevisionPage = RevisionPageDocument | RevisionPageGroup | RevisionPageLink | RevisionPageComputed;
1151
1170
  export interface ApiInformation {
@@ -3311,6 +3330,8 @@ export interface RevisionPageUpdate {
3311
3330
  * @minLength 1
3312
3331
  */
3313
3332
  title?: string;
3333
+ /** Slug of the page in its parent, used to build the page's path. When omitted, the slug is derived from the title. The slug must be unique among the page's siblings; any collision is rejected. */
3334
+ slug?: RevisionPageSlug;
3314
3335
  /** Emoji of the page. Set to an empty string to remove it. */
3315
3336
  emoji?: Emoji;
3316
3337
  /** Icon of the page. Set to an empty string to remove it. */
@@ -3338,7 +3359,7 @@ export type ChangeRequestContentChangeUpdatePage = RevisionPageUpdate & {
3338
3359
  document?: Document;
3339
3360
  };
3340
3361
  /**
3341
- * Insert a new page into the change request.
3362
+ * Insert a new page into the change request. The title is taken from `title`, or, when the document is markdown, from the document's frontmatter or leading heading (which take precedence, matching Git Sync). When no title can be resolved, the page falls back to a default title.
3342
3363
  * @example {"operation":"insert_page","title":"New page","document":{"markdown":"# New page\n\nThis is a new page.\n"}}
3343
3364
  */
3344
3365
  export type ChangeRequestContentChangeInsertPage = RevisionPageUpdate & {
@@ -3350,6 +3371,8 @@ export type ChangeRequestContentChangeInsertPage = RevisionPageUpdate & {
3350
3371
  * @min 0
3351
3372
  */
3352
3373
  at?: number;
3374
+ /** Temporary local reference for the page, used only for the lifetime of this request and never persisted. Other pages inserted in the same batch can link to this page by its ref (e.g. `[Page](./<ref>.md)`), which resolves to the page's ID at apply time — regardless of operation order or the page's eventual slug. A ref must be unique within the batch and must not collide with an existing page's path. */
3375
+ ref?: string;
3353
3376
  /** Document for the new page. When provided as markdown, its frontmatter is read to set the page metadata. */
3354
3377
  document: Document;
3355
3378
  };
@@ -3375,6 +3398,81 @@ export interface ChangeRequestContentChangeRevertPage {
3375
3398
  /** Keys of the specific blocks to revert within the page's document, as they appear in the page's document. If omitted, the whole page is reverted. */
3376
3399
  block?: string[];
3377
3400
  }
3401
+ /**
3402
+ * Upload files (images or attachments) into the change request. A document references one as `![Alt](/files/<fileId>)` or `[Label](/files/<fileId>)` — use a `ref` to reference it from a later change in the same batch, or read the generated IDs from `insertedFiles`.
3403
+ * @example {"operation":"insert_files","files":[{"ref":"architecture.png","name":"architecture.png","url":"https://example.com/architecture.png"}]}
3404
+ */
3405
+ export interface ChangeRequestContentChangeInsertFiles {
3406
+ operation: "insert_files";
3407
+ /**
3408
+ * @maxItems 20
3409
+ * @minItems 1
3410
+ */
3411
+ files: (({
3412
+ /**
3413
+ * Public http(s) URL to fetch the file from. A URL resolving to a private or reserved address is rejected — send internally hosted bytes with `base64` instead.
3414
+ * @format uri
3415
+ * @maxLength 2048
3416
+ */
3417
+ url: string;
3418
+ } | {
3419
+ /** Base64-encoded bytes, max 1MB. Requires `contentType`. */
3420
+ base64: string;
3421
+ }) & {
3422
+ /** Temporary local reference for the file, used only for the lifetime of this request and never persisted. Pages inserted in the same batch can link to this file by its ref (e.g. `[File](./<ref>)`), which resolves to the file's ID at apply time — regardless of operation order or the file's eventual path. A ref must be unique within the batch and must not collide a page ref in the batch or an existing page path. */
3423
+ ref?: string;
3424
+ /**
3425
+ * Filename to store the file under, including its extension.
3426
+ * @minLength 1
3427
+ * @maxLength 256
3428
+ */
3429
+ name: string;
3430
+ /** MIME type. Required with `base64`; overrides the source's own type otherwise. */
3431
+ contentType?: string;
3432
+ })[];
3433
+ }
3434
+ export interface ChangeRequestContentUpdatePageRef {
3435
+ /** Type of Object, always equals to "page". */
3436
+ object: "page";
3437
+ /** Unique identifier of the page. */
3438
+ id: string;
3439
+ urls: {
3440
+ /** API URL to fetch the page's full, normalized content. */
3441
+ location: URL;
3442
+ };
3443
+ }
3444
+ /** A page created by the operation with its resolved ID, ref as passed by the caller, and a URL to fetch its content. */
3445
+ export interface ChangeRequestContentUpdateInsertedPage {
3446
+ /** Type of Object, always equals to "created_page". */
3447
+ object: "created_page";
3448
+ /** The batch-local `ref` provided on the insert operation, echoed so the caller can map their reference to the created page's ID. Absent when the operation had no ref. */
3449
+ ref?: string;
3450
+ /** Reference to the created page, with a URL to fetch its normalized content. */
3451
+ page: ChangeRequestContentUpdatePageRef;
3452
+ }
3453
+ /** A page updated by the operation, with a URL to fetch its content. */
3454
+ export interface ChangeRequestContentUpdateUpdatedPage {
3455
+ /** Type of Object, always equals to "updated_page". */
3456
+ object: "updated_page";
3457
+ /** Reference to the updated page, with a URL to fetch its normalized content. */
3458
+ page: ChangeRequestContentUpdatePageRef;
3459
+ }
3460
+ /** A page deleted by the batch. Only its ID is returned, as it no longer has content. */
3461
+ export interface ChangeRequestContentUpdateDeletedPage {
3462
+ /** Type of Object, always equals to "deleted_page". */
3463
+ object: "deleted_page";
3464
+ /** ID of the deleted page. */
3465
+ page: string;
3466
+ }
3467
+ /** The result of applying a batch of content changes. */
3468
+ export interface ChangeRequestContentUpdate {
3469
+ /** The change request after the batch was applied. */
3470
+ changeRequest: ChangeRequest;
3471
+ /** One entry per affected page (deduplicated), in the order the pages were first touched by the batch. */
3472
+ changes: ChangeRequestContentUpdateChange[];
3473
+ /** Files created by the `insert_files` changes in this batch, in the order they were inserted. Use their IDs to reference them from a document. */
3474
+ insertedFiles?: RevisionFile[];
3475
+ }
3378
3476
  export interface ChangedRevisionPage {
3379
3477
  id: string;
3380
3478
  type: RevisionPageType;
@@ -3758,6 +3856,8 @@ export interface OrganizationBilling {
3758
3856
  canChangeInterval: boolean;
3759
3857
  /** Whether configuring SAML is allowed */
3760
3858
  canUseSAML: boolean;
3859
+ /** The AI credit bundle the organization tops up every month, or null when the organization is not billed for AI usage. `none` means pay as you go. */
3860
+ creditsBundle: BillingCreditsBundle | null;
3761
3861
  }
3762
3862
  /**
3763
3863
  * A short description giving context on the reason for the block.
@@ -4627,6 +4727,12 @@ export interface Site {
4627
4727
  gitSync?: GitSyncState;
4628
4728
  /** @format date-time */
4629
4729
  createdAt: string;
4730
+ /**
4731
+ * When GitBook last completed a scan of the site's content
4732
+ * gaps. Absent until the site has been scanned at least once.
4733
+ * @format date-time
4734
+ */
4735
+ lastScanAt?: string;
4630
4736
  adaptiveContent?: SiteAdaptiveContent;
4631
4737
  ads?: SiteAds;
4632
4738
  /**
@@ -5079,6 +5185,8 @@ export interface SiteSpace {
5079
5185
  default?: boolean;
5080
5186
  /** Conditional expression used to evaluate whether the site space should be shown to the site's visitor. */
5081
5187
  condition?: Expression;
5188
+ /** Custom home page within the space, rendered at the site space's path root instead of the space's default landing page. */
5189
+ pageId?: string | null;
5082
5190
  /** Whether the site space is draft and not live. */
5083
5191
  draft: boolean;
5084
5192
  /** Whether the space has advanced customization feature enabled */
@@ -5369,9 +5477,41 @@ export interface UpgradeOrganizationBilling {
5369
5477
  coupon?: BillingCoupon;
5370
5478
  /** Optional usage addons to apply when upgrading: - if set, apply provided billable addons (non-billable meters are ignored) - if omitted, keep current subscription addons (or billing addons for new subs) - if omitted during interval switch, keep addon selection and switch addon price interval - if empty, or all provided meters are ignored, remove all existing billable addons */
5371
5479
  addons?: BillingMeter[];
5480
+ /** The AI credit bundle to top up every month */
5481
+ creditsBundle?: BillingCreditsBundle;
5372
5482
  /** Mode to use for the upgrade (default value is `commit`): - `commit`: a checkout session is returned or the upgrade is applied directly - `preview`: a preview invoice is always returned */
5373
5483
  mode?: "commit" | "preview";
5374
5484
  }
5485
+ /** A product line of an invoice, enriched and normalized for the billing summary UI. */
5486
+ export interface BillingInvoiceSummaryLine {
5487
+ /** How Stripe describes the line, as a fallback for lines the client cannot label itself. */
5488
+ description: string;
5489
+ amount: number;
5490
+ /** How many units the line bills, such as the number of members. */
5491
+ quantity?: number;
5492
+ /** Which kind of site a `sites` line bills for. */
5493
+ siteType?: SiteType;
5494
+ /** Price of a single unit, over the period the line covers. */
5495
+ unitAmount?: number;
5496
+ periodStart: Timestamp;
5497
+ periodEnd: Timestamp;
5498
+ /** What the invoice line is billing for, so a preview can be grouped by product area. */
5499
+ category: "members" | "sites" | "addons" | "credits" | "usage" | "watermark_removal" | "other";
5500
+ }
5501
+ /** An amount adjusting an invoice, summed across everything of its type. */
5502
+ export interface BillingInvoiceAdjustment {
5503
+ /** What adjusts the amount an invoice bills, beyond the products it lists. `proration` is the net of the mid-period changes, and `balance` the credit applied from the customer's balance. */
5504
+ type: "proration" | "watermark_removal" | "balance";
5505
+ /** The adjustment, negative when it reduces the amount billed. */
5506
+ amount: number;
5507
+ }
5508
+ /** A total of AI credits, and how much of it is left. */
5509
+ export interface BillingCreditsTotals {
5510
+ /** Credits granted for the current AI billing period. */
5511
+ grantedCredits: number;
5512
+ /** Credits still available of those granted. */
5513
+ remainingCredits: number;
5514
+ }
5375
5515
  export interface BillingInvoicePreview {
5376
5516
  /** Final total owed for this invoice after discounts and credits. */
5377
5517
  amount: number;
@@ -5390,6 +5530,72 @@ export interface BillingInvoicePreview {
5390
5530
  periodStart: Timestamp;
5391
5531
  periodEnd: Timestamp;
5392
5532
  }[];
5533
+ /** Structured representation of the invoice for the current billing summary UI. */
5534
+ summary: {
5535
+ /** Product lines enriched and normalized for the billing summary UI. */
5536
+ lines: BillingInvoiceSummaryLine[];
5537
+ /** What adjusts the amount billed beyond the products listed, each summed across its type. Only the ones that apply are returned. */
5538
+ adjustments: BillingInvoiceAdjustment[];
5539
+ /** AI credits available for the current AI billing period. Empty when the organization is not billed for AI usage. */
5540
+ creditGrants: {
5541
+ /** Where the credits come from. `paid` is the credits the monthly bundle pays for, `bonus` the ones included with it, `site` the allowance of the organization's published paid sites, and `rollover` what was left of the previous period. */
5542
+ type: "paid" | "bonus" | "site" | "rollover";
5543
+ /** Credits the grant was created with. */
5544
+ grantedCredits: number;
5545
+ /** Credits of the grant spent by the usage metered so far. */
5546
+ usedCredits: number;
5547
+ /** Credits of the grant still available. */
5548
+ remainingCredits: number;
5549
+ /** For a `site` grant, the published sites the credits come from. */
5550
+ sites?: {
5551
+ /** The type of the site */
5552
+ siteType: SiteType;
5553
+ /** How many sites of this type are published. */
5554
+ count: number;
5555
+ /** Credits included with one site of this type. */
5556
+ creditsPerSite: number;
5557
+ /** Credits these sites contribute to the grant. */
5558
+ grantedCredits: number;
5559
+ }[];
5560
+ }[];
5561
+ /** The AI credits of the current billing period, grouped the ways the billing screens display them. */
5562
+ credits: {
5563
+ /** Credits granted across every grant. */
5564
+ grantedCredits: number;
5565
+ /** Credits spent by the usage metered so far. */
5566
+ usedCredits: number;
5567
+ /** Credits still available across every grant. */
5568
+ remainingCredits: number;
5569
+ /** Part of the metered AI usage paid by credits rather than billed, as a positive amount. */
5570
+ coveredAmount: number;
5571
+ /** The credits the organization pays for. */
5572
+ paid: BillingCreditsTotals;
5573
+ /** The credits included at no extra cost, from the bundle, sites and rollover. */
5574
+ free: BillingCreditsTotals;
5575
+ /** The credits of the monthly bundle, both paid and bonus. */
5576
+ bundle: BillingCreditsTotals;
5577
+ };
5578
+ /** When the upcoming invoice is charged. */
5579
+ chargeDate?: Timestamp;
5580
+ /** The renewal invoice, when the plan and the AI usage bill on different cadences. Absent when a single invoice covers everything. */
5581
+ renewal?: {
5582
+ /** Product lines of the renewal invoice. */
5583
+ lines: BillingInvoiceSummaryLine[];
5584
+ /** What adjusts the renewal beyond the products listed. Prorations and the customer balance are reported on the upcoming invoice instead. */
5585
+ adjustments: BillingInvoiceAdjustment[];
5586
+ /** Discounts still applying when the subscription renews. */
5587
+ discounts: {
5588
+ /** The description of the applied discount. */
5589
+ description: string;
5590
+ /** The amount of the applied discount. */
5591
+ amount: number;
5592
+ }[];
5593
+ /** Total owed for the renewal invoice. */
5594
+ amount: number;
5595
+ /** When the renewal invoice is charged. */
5596
+ chargeDate: Timestamp;
5597
+ };
5598
+ };
5393
5599
  /** Discounts applied to the subscription. */
5394
5600
  discounts?: {
5395
5601
  /** The description of the applied discount. */
@@ -6037,12 +6243,9 @@ export interface GitSyncInstallationSetupCommon {
6037
6243
  projectDirectory?: string;
6038
6244
  /** Optional template used when generating commit messages. */
6039
6245
  commitMessageTemplate?: string;
6040
- /**
6041
- * Whether previews should be generated from branches outside the configured branch.
6042
- * @default false
6043
- */
6246
+ /** Whether previews should be generated from branches outside the configured branch. For space installations belonging to a parent installation, this field is inherited from the parent installation and cannot be set. */
6044
6247
  previewExternalBranches?: boolean;
6045
- /** Agent instruction files GitBook should always export at the repository root. */
6248
+ /** Agent instruction files GitBook should always export at the repository root. For space installations belonging to a parent installation, this field is inherited from the parent installation and cannot be set. */
6046
6249
  agentInstructions?: ("agents" | "claude")[];
6047
6250
  /** Which side should be treated as the source of truth when Git Sync is configured. */
6048
6251
  priority?: GitSyncInstallationPriority;
@@ -6120,6 +6323,21 @@ export interface GitRepositoryRef {
6120
6323
  latestImportedCommitId?: string;
6121
6324
  updatedAt: Timestamp;
6122
6325
  }
6326
+ /** A repository-backed review and permission boundary for GitBook content. */
6327
+ export interface GitSyncRoot {
6328
+ object: "git-sync-root";
6329
+ /** Unique identifier of the Sync Root. */
6330
+ id: string;
6331
+ /** Unique identifier of the top-level installation that owns this Sync Root. */
6332
+ installationId: string;
6333
+ /** Resource targeted by a Git Sync installation. */
6334
+ target: GitSyncInstallationTarget;
6335
+ /** System responsible for completing merges by default for this Sync Root. */
6336
+ defaultMergeAuthorityPolicy: "provider" | "gitbook";
6337
+ status: "active" | "disabled";
6338
+ createdAt: Timestamp;
6339
+ updatedAt: Timestamp;
6340
+ }
6123
6341
  export type GitSyncInstallation = GitSyncInstallationSetup & {
6124
6342
  object: "git-sync-installation";
6125
6343
  /** Unique identifier of the Git Sync installation. */
@@ -6131,6 +6349,8 @@ export type GitSyncInstallation = GitSyncInstallationSetup & {
6131
6349
  status: GitSyncInstallationStatus;
6132
6350
  repositoryConnection?: GitRepositoryConnection;
6133
6351
  repositoryRef?: GitRepositoryRef;
6352
+ /** Effective Sync Root for this installation, inherited from its parent when present. */
6353
+ syncRoot?: GitSyncRoot;
6134
6354
  createdAt: Timestamp;
6135
6355
  /** Identifier of the user who created the installation. */
6136
6356
  createdBy: string;
@@ -8075,6 +8295,8 @@ export interface SiteInsightsQueryDateTimeColumn {
8075
8295
  }
8076
8296
  export type SiteInsightsQueryEventsColumn = SiteInsightsQueryDateTimeColumn | {
8077
8297
  column: "url";
8298
+ } | {
8299
+ column: "urlPath";
8078
8300
  } | {
8079
8301
  column: "eventType";
8080
8302
  } | {
@@ -8172,6 +8394,9 @@ export type SiteInsightsQueryEventsValues = {
8172
8394
  } | {
8173
8395
  column: "url";
8174
8396
  values: URL[];
8397
+ } | {
8398
+ column: "urlPath";
8399
+ values: string[];
8175
8400
  } | {
8176
8401
  column: "eventsCount";
8177
8402
  values: number[];
@@ -8664,12 +8889,22 @@ export type OrganizationBillingDateOverride = true | Timestamp;
8664
8889
  * @min 0
8665
8890
  */
8666
8891
  export type OrganizationBillingNumericOverride = number;
8892
+ /**
8893
+ * Current percentage billing override, when set.
8894
+ * @min 0
8895
+ * @max 100
8896
+ */
8897
+ export type OrganizationBillingPercentageOverride = number;
8667
8898
  export interface OrganizationBillingOverrides {
8668
8899
  overrides: {
8669
8900
  /** Current interval-change override, when set. */
8670
8901
  frozenInterval?: OrganizationBillingDateOverride;
8671
8902
  /** Current SAML override, when set. */
8672
8903
  enableSAML?: OrganizationBillingDateOverride;
8904
+ /** Contractual AI credit allowance for Enterprise organizations only. */
8905
+ aiCreditAllowance?: OrganizationBillingNumericOverride;
8906
+ /** Percentage of remaining paid AI credits carried into the next billing period. Paid self-serve organizations default to 50% when unset. */
8907
+ aiCreditRollover?: OrganizationBillingPercentageOverride;
8673
8908
  /** Current minimum users override, when set. */
8674
8909
  minUsers?: OrganizationBillingNumericOverride;
8675
8910
  /** Current maximum users override, when set. */
@@ -8982,7 +9217,7 @@ export interface InputFile {
8982
9217
  height: number;
8983
9218
  };
8984
9219
  }
8985
- export interface GitSyncOperation {
9220
+ export interface GitSyncSpaceOperation {
8986
9221
  /**
8987
9222
  * * `running`: The operation is still running
8988
9223
  * * `failure`: The operation failed
@@ -9012,6 +9247,40 @@ export interface GitSyncOperation {
9012
9247
  /** Error details, defined if state is `failure`. */
9013
9248
  error?: string;
9014
9249
  }
9250
+ /**
9251
+ * Deprecated. Use `GitSyncSpaceOperation` instead.
9252
+ * @deprecated
9253
+ */
9254
+ export type GitSyncOperation = GitSyncSpaceOperation;
9255
+ export interface GitSyncSiteOperation {
9256
+ /**
9257
+ * * `running`: The operation is still running
9258
+ * * `failure`: The operation failed
9259
+ * * `success`: The operation was successful
9260
+ * * `timeout`: The operation timed out
9261
+ */
9262
+ state: GitSyncOperationState;
9263
+ direction: GitSyncOperationDirection;
9264
+ /**
9265
+ * Core stages of a Git Sync process. This is not exhaustive, but should cover
9266
+ * the important ones.
9267
+ * - repo_fetch: Includes fetching the latest repository contents from remote provider.
9268
+ * - config_check: Includes checking if the YAML config is valid, etc.
9269
+ * - content_process: Includes processing of pages & files to be imported/exported.
9270
+ * - finalize: Includes finalizing the sync process like creating the commit on git, or
9271
+ * creating a new revision.
9272
+ */
9273
+ stage: GitSyncOperationStage;
9274
+ /** Date when the operation was started */
9275
+ startedAt: Timestamp;
9276
+ /** Date when the operation was last updated */
9277
+ updatedAt: Timestamp;
9278
+ /** Date when the operation was successful (when state is `success`) */
9279
+ completedAt?: Timestamp;
9280
+ /** Error details, defined if state is `failure`. */
9281
+ error?: string;
9282
+ spaces: Record<string, GitSyncSpaceOperation>;
9283
+ }
9015
9284
  /**
9016
9285
  * A section group — a container that nests sections (and other section
9017
9286
  * groups). Discriminated by `type: section-group`. Up to one level of nested
@@ -9555,6 +9824,10 @@ export interface APIChannelGitSyncOperation {
9555
9824
  channel: "space-gitsync-operation";
9556
9825
  space: string;
9557
9826
  }
9827
+ export interface APIChannelGitSyncSiteOperation {
9828
+ channel: "site-gitsync-operation";
9829
+ site: string;
9830
+ }
9558
9831
  /** Subscription channel for changes in OpenAPI specification. */
9559
9832
  export interface APIChannelOpenAPISpec {
9560
9833
  channel: "openapi-spec";
@@ -9591,7 +9864,11 @@ export interface APIChannelImportRunData {
9591
9864
  }
9592
9865
  export interface APIChannelGitSyncOperationData {
9593
9866
  channel: "space-gitsync-operation";
9594
- data: GitSyncOperation;
9867
+ data: GitSyncSpaceOperation;
9868
+ }
9869
+ export interface APIChannelGitSyncSiteOperationData {
9870
+ channel: "site-gitsync-operation";
9871
+ data: GitSyncSiteOperation;
9595
9872
  }
9596
9873
  export interface APIChannelMutationData {
9597
9874
  channel: "*";
@@ -10930,7 +11207,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
10930
11207
  computed?: boolean;
10931
11208
  }, params?: RequestParams) => Promise<HttpResponse<Revision, any>>;
10932
11209
  /**
10933
- * @description Applies an ordered array of content changes (up to 50) to the change request atomically, creating a single new revision. Changes are applied sequentially; if any single change is invalid the entire batch is rejected and no revision is created. Use this to create, update, move, or delete pages within a change request before merging to live. This is the primary way to programmatically author content in a change request. When page content is provided as markdown, links to other pages are resolved against the change request's current page tree. You can link a page by: - Page ID — `/pages/<pageId>` (also `/pages/<pageId>#anchor`). - Page slug path — `/pages/<slug>` for a top-level page, or `/pages/<parent-slug>/<slug>` for a nested page (e.g. `/pages/guides/getting-started`). - Markdown file path — the path the page would have in Git: `/pages/<slug>.md` for a page, or `/pages/<slug>/README.md` for a page that has child pages. The space's root page is `/pages/README.md`. - Relative markdown link — resolved against the page being edited, e.g. `./sibling.md`, `../other.md`, or `../README.md` (the parent page). Folder-style links without an extension (e.g. `./section`) resolve to that folder's page. External URLs (`https://…`) are kept as-is. A link that does not match any page in the change request is left as plain text rather than causing the request to fail.
11210
+ * @description Applies an ordered array of content changes (up to 50) to the change request atomically, creating a single new revision. Changes are applied sequentially; if any single change is invalid the entire batch is rejected and no revision is created. Use this to create, update, move, or delete pages within a change request before merging to live. This is the primary way to programmatically author content in a change request. To put an image or attachment in a page, upload it with an `insert_files` change. Give the file a `ref` and a page inserted in the same batch can reference it as `![Alt](./<ref>)` or `[File](./<ref>)`, which resolves to the file's ID at apply time regardless of operation order. Uploaded files are also listed as `insertedFiles` when `compat=false`, and a file already in the change request can be referenced directly as `/files/<fileId>`. Inline `data:` URIs in markdown are not ingested and large image blocks are dropped, so upload the bytes with `insert_files` instead. When page content is provided as markdown, links to other pages are resolved against the change request's current page tree. You can link a page by: - Page ID — `/pages/<pageId>` (also `/pages/<pageId>#anchor`). - Page slug path — `/pages/<slug>` for a top-level page, or `/pages/<parent-slug>/<slug>` for a nested page (e.g. `/pages/guides/getting-started`). - Markdown file path — the path the page would have in Git: `/pages/<slug>.md` for a page, or `/pages/<slug>/README.md` for a page that has child pages. The space's root page is `/pages/README.md`. - Relative markdown link — resolved against the page being edited, e.g. `./sibling.md`, `../other.md`, or `../README.md` (the parent page). Folder-style links without an extension (e.g. `./section`) resolve to that folder's page. External URLs (`https://…`) are kept as-is. A link that does not match any page in the change request is left as plain text rather than causing the request to fail. GitBook normalizes submitted content, so the stored page may differ from what was sent. To help callers reconcile local state with the stored result, the response can list each created and modified page with its resolved ID and a `urls.location` to fetch the page's persisted content. **Response shape (`compat`)** — this endpoint is changing what it returns: - `compat=true` (current default) returns the updated change request, matching the endpoint's original behavior. - `compat=false` returns the updated change request **and** the list of affected pages (see the response schema). The default is `true` for now to preserve backwards compatibility, but **will switch to `false` in a future release**, at which point the affected-page list is always included. You should pass `compat=false` if you want the new behavior today and avoid unexpected errors when the default flips in the future.
10934
11211
  *
10935
11212
  * @tags change-request-content
10936
11213
  * @name UpdateChangeRequestContent
@@ -10944,7 +11221,13 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
10944
11221
  * @minItems 1
10945
11222
  */
10946
11223
  changes: ChangeRequestContentChange[];
10947
- }, params?: RequestParams) => Promise<HttpResponse<ChangeRequest, {
11224
+ }, query?: {
11225
+ /**
11226
+ * When `true`, the updated change request is returned. When `false`, the updated change request and the list of affected pages are returned.
11227
+ * @default true
11228
+ */
11229
+ compat?: boolean;
11230
+ }, params?: RequestParams) => Promise<HttpResponse<ChangeRequest | ChangeRequestContentUpdate, {
10948
11231
  error: {
10949
11232
  /** @format int32 */
10950
11233
  code: 404;
@@ -14511,6 +14794,8 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
14511
14794
  * @default false
14512
14795
  */
14513
14796
  draft?: boolean;
14797
+ /** Custom home page within the space, rendered at the site space's path root instead of the space's default landing page. */
14798
+ pageId?: string | null;
14514
14799
  }, params?: RequestParams) => Promise<HttpResponse<SiteSpace, any>>;
14515
14800
  /**
14516
14801
  * @description Returns a paginated list of site spaces — the links between a site and its content source spaces. Each site space can be a language variant or content version within a section. Use the default filter to retrieve only the primary site space, or omit it to get all linked spaces including drafts.
@@ -14917,6 +15202,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
14917
15202
  hasChangeRequests?: boolean;
14918
15203
  /** Filter findings by the source of their evidence. Each entry is either `connection:<connectionId>` (findings with at least one piece of evidence coming from the given connection) or `questions` (findings with at least one piece of evidence coming from a site question). When multiple entries are given, findings matching any of them are returned. */
14919
15204
  source?: (SiteTriageFilterQuestions | SiteTriageFilterConnections)[];
15205
+ /**
15206
+ * Only return findings last updated at or after this date.
15207
+ * @format date-time
15208
+ */
15209
+ updatedAfter?: string;
15210
+ /**
15211
+ * Only return findings last updated before this date.
15212
+ * @format date-time
15213
+ */
15214
+ updatedBefore?: string;
14920
15215
  /** Sort findings by the given field. */
14921
15216
  orderBy?: SiteFindingOrderBy;
14922
15217
  }, params?: RequestParams) => Promise<HttpResponse<List & {
@@ -15429,6 +15724,8 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
15429
15724
  path?: SiteSpacePath;
15430
15725
  /** Conditional expression used to evaluate whether the site space should be shown to the site's visitor (should evaluate to a boolean). If not set, the condition will remain unchanged. If set to null, the condition will be removed. */
15431
15726
  condition?: Expression | null;
15727
+ /** Custom home page within the space, rendered at the site space's path root instead of the space's default landing page. If not set, the page will remain unchanged unless spaceId is changed, in which case the custom home page will be removed. If set to null, the custom home page will be removed. */
15728
+ pageId?: string | null;
15432
15729
  /** The content that this site space points to. If not set, the space will remain unchanged. */
15433
15730
  spaceId?: string;
15434
15731
  /** Whether the site space is hidden. If true, the site space will not be shown in the site's navigation. If not set, the hidden state will remain unchanged. If set to false, the site space will be shown in site navigation. */
@@ -16689,7 +16986,10 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
16689
16986
  * @request PATCH:/git/installations/{installationId}
16690
16987
  * @secure
16691
16988
  */
16692
- updateGitSyncInstallationById: (installationId: string, data: GitSyncInstallationSetup, params?: RequestParams) => Promise<HttpResponse<GitSyncInstallation, {
16989
+ updateGitSyncInstallationById: (installationId: string, data: GitSyncInstallationSetup & {
16990
+ /** Project directories keyed by child installation ID for a site installation. */
16991
+ childInstallationProjectDirectories?: Record<string, string>;
16992
+ }, params?: RequestParams) => Promise<HttpResponse<GitSyncInstallation, {
16693
16993
  error: {
16694
16994
  /** @format int32 */
16695
16995
  code: 401;
@@ -77,7 +77,7 @@ export declare const SITE_PROXY_ORIGIN_MAX_LENGTH = 512;
77
77
  export declare const SITE_PROXY_ORIGIN_PATTERN = "^([\\w-]+\\.)*[\\w-]+\\.[a-zA-Z]{2,}(\\/[\\w-]+)+$";
78
78
  export declare const SITE_VISIBILITY_ENUM: ["public", "unlisted", "share-link", "visitor-auth"];
79
79
  export declare const SITE_ADS_TOPIC_ENUM: ["webdev", "crypto"];
80
- export declare const SITE_FEATURE_KEY_ENUM: ["sites-adaptive-content", "sites-advanced-customization", "sites-advanced-insights", "sites-ads", "sites-ai-search", "sites-ai-assistant", "sites-ai-insights", "sites-connections", "sites-channels", "sites-embed", "sites-api-playground", "sites-basic-customization", "sites-custom-domain", "sites-custom-fonts", "sites-custom-subdirectory", "sites-full-text-search", "sites-multivariant-site", "sites-no-custom-domain", "sites-page-feedback", "sites-page-traffic-insights", "sites-pdf-export", "sites-preview-deployments", "sites-public-visibility", "sites-redirects", "sites-search-insights", "sites-sections", "sites-seo", "sites-share-links", "sites-unlisted-visibility", "sites-user-contribution", "sites-visitor-authentication", "sites-visitors"];
80
+ export declare const SITE_FEATURE_KEY_ENUM: ["sites-adaptive-content", "sites-advanced-customization", "sites-advanced-insights", "sites-ads", "sites-ai-search", "sites-ai-assistant", "sites-ai-insights", "sites-connections", "sites-content-gaps", "sites-channels", "sites-embed", "sites-api-playground", "sites-basic-customization", "sites-custom-domain", "sites-custom-fonts", "sites-custom-subdirectory", "sites-full-text-search", "sites-multivariant-site", "sites-no-custom-domain", "sites-page-feedback", "sites-page-traffic-insights", "sites-pdf-export", "sites-preview-deployments", "sites-public-visibility", "sites-redirects", "sites-search-insights", "sites-sections", "sites-seo", "sites-share-links", "sites-unlisted-visibility", "sites-user-contribution", "sites-visitor-authentication", "sites-visitors"];
81
81
  export declare const SITE_CUSTOMIZATION_FEATURE_ENUM: ["header-logo", "header-primary-link", "theme-preset", "premium-fonts", "custom-icons", "footer-logo", "footer-links", "footer-copyright", "semantic-colors"];
82
82
  export declare const CONTENT_KIT_ICON_ENUM: ["close", "edit", "github", "gitlab", "maximize", "email", "settings", "search", "delete", "star", "warning", "link", "link-external", "eye", "eye-off", "lock", "check", "check-circle"];
83
83
  export declare const SITE_SECTION_TITLE_MAX_LENGTH = 128;
@@ -154,7 +154,7 @@ export declare const SITE_FINDING_TYPE_ENUM: ["content-outdated", "content-incor
154
154
  export declare const SITE_FINDING_SEVERITY_ENUM: ["low", "medium", "high"];
155
155
  export declare const SITE_TRIAGE_FILTER_QUESTIONS_ENUM: ["questions"];
156
156
  export declare const SITE_TRIAGE_FILTER_CONNECTIONS_PATTERN = "^connection:.+$";
157
- export declare const SITE_FINDING_ORDER_BY_ENUM: ["updatedAt", "severity", "questions"];
157
+ export declare const SITE_FINDING_ORDER_BY_ENUM: ["updatedAt", "severity", "sources"];
158
158
  export declare const SITE_FINDING_TITLE_MAX_LENGTH = 256;
159
159
  export declare const SITE_QUESTION_TYPE_ENUM: ["exploring", "how-to", "troubleshooting", "reference", "unknown"];
160
160
  export declare const CONTEXT_CONNECTION_LABEL_MAX_LENGTH = 128;