@gitbook/api 0.162.0 → 0.164.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
@@ -1954,6 +1954,11 @@ export interface OrganizationBilling {
1954
1954
  endDate: Timestamp | null;
1955
1955
  /** If true, we were unable to collect the last payment */
1956
1956
  hasPaymentFailed: boolean;
1957
+ /**
1958
+ * If true, organization can create a checkout session to subscribe/update billing.
1959
+ * If false, organization must resolve other billing issues before a checkout can be done.
1960
+ */
1961
+ canCheckout: boolean;
1957
1962
  /** If true, the billing is set to cancel at the end of its current period */
1958
1963
  isScheduledToCancel: boolean;
1959
1964
  /** Pricing information for the organization */
@@ -4346,6 +4351,12 @@ export interface SubscriptionChanges {
4346
4351
  isPublished: boolean;
4347
4352
  })[];
4348
4353
  }
4354
+ /**
4355
+ * Coupon or promotion code to apply to billing operations.
4356
+ * @minLength 1
4357
+ * @maxLength 500
4358
+ */
4359
+ export type BillingCoupon = string;
4349
4360
  export interface UpgradeOrganizationBilling {
4350
4361
  /** Name of the product */
4351
4362
  product: BillingProduct;
@@ -4355,6 +4366,8 @@ export interface UpgradeOrganizationBilling {
4355
4366
  changes?: SubscriptionChanges;
4356
4367
  /** Reason that triggered the billing upgrade */
4357
4368
  reason?: string;
4369
+ /** Coupon or promotion code to apply to the subscription */
4370
+ coupon?: BillingCoupon;
4358
4371
  /** Mode to use for the upgrade (default value is `commit`): - `auto`: user is redirect to checkout if possible, other a preview of the auto-upgrade is returned. - `commit`: a checkout session is returned or an auto-upgrade is done - `preview`: a preview invoice is always returned */
4359
4372
  mode?: 'auto' | 'commit' | 'preview';
4360
4373
  }
@@ -4374,13 +4387,13 @@ export interface BillingInvoicePreview {
4374
4387
  periodStart: Timestamp;
4375
4388
  periodEnd: Timestamp;
4376
4389
  }[];
4377
- /** Discount applied to the subscription. */
4378
- discount?: {
4379
- /** The combined description of all discounts applied to the subscription. */
4390
+ /** Discounts applied to the subscription. */
4391
+ discounts?: {
4392
+ /** The description of the applied discount. */
4380
4393
  description: string;
4381
- /** The total amount of all discounts applied to the subscription. */
4394
+ /** The amount of the applied discount. */
4382
4395
  amount: number;
4383
- };
4396
+ }[];
4384
4397
  }
4385
4398
  export type BillingUpgrade = {
4386
4399
  result: 'checkout';
@@ -4433,7 +4446,6 @@ export declare enum BillingSwitchAction {
4433
4446
  Upgrade = "upgrade",
4434
4447
  UpgradePassive = "upgrade_passive",
4435
4448
  Downgrade = "downgrade",
4436
- UndoCancel = "undo_cancel",
4437
4449
  SwitchInterval = "switch_interval"
4438
4450
  }
4439
4451
  /** Identifier of a billing meter */
@@ -4455,6 +4467,7 @@ export interface BillingMeterUsage {
4455
4467
  }
4456
4468
  /** Search result representing a space. */
4457
4469
  export interface SearchSpaceResult {
4470
+ type: 'space';
4458
4471
  id: string;
4459
4472
  title: string;
4460
4473
  pages: SearchPageResult[];
@@ -5771,6 +5784,21 @@ export type SiteSearchScope = {
5771
5784
  /** Search in all sections and site spaces. This scope is wide and deep. */
5772
5785
  mode: 'all';
5773
5786
  };
5787
+ /** Search result representing a site context record. */
5788
+ export interface SearchRecordResult {
5789
+ type: 'record';
5790
+ /** The ID of the context record. */
5791
+ id: string;
5792
+ /** The title of the record. */
5793
+ title: string;
5794
+ /** The description of the record. */
5795
+ description?: string;
5796
+ /**
5797
+ * URL of the record in the source system.
5798
+ * @format uri
5799
+ */
5800
+ url: string;
5801
+ }
5774
5802
  export declare enum ContextRecordType {
5775
5803
  Ticket = "ticket",
5776
5804
  Document = "document"
@@ -5904,39 +5932,6 @@ export type ContextConnection = {
5904
5932
  location: string;
5905
5933
  };
5906
5934
  } & ContextConnectorSetup;
5907
- export interface ContextTopic {
5908
- object: 'context-topic';
5909
- /** The ID of the topic */
5910
- id: string;
5911
- /** The label of the topic */
5912
- label: string;
5913
- createdAt: Timestamp;
5914
- updatedAt: Timestamp;
5915
- /** Name of the icon */
5916
- icon: Icon;
5917
- summary: JSONDocument;
5918
- usageSettings: ContextUsageSettings;
5919
- /**
5920
- * The weekly pulse of the records for the past 3 months
5921
- * @maxItems 13
5922
- * @minItems 13
5923
- */
5924
- weeklyPulse: number[];
5925
- connectors: Record<string, number>;
5926
- /** The stats of the topic */
5927
- stats: {
5928
- /** The number of records in the topic */
5929
- records: number;
5930
- };
5931
- /** URLs associated with the topic */
5932
- urls: {
5933
- /**
5934
- * URL of the topic in the API
5935
- * @format uri
5936
- */
5937
- location: string;
5938
- };
5939
- }
5940
5935
  /** Aggregated feedback for answers linked to a site question. */
5941
5936
  export interface SiteQuestionStatsFeedback {
5942
5937
  /** Count of answers with positive feedback. */
@@ -5964,12 +5959,62 @@ export interface SiteQuestionStats {
5964
5959
  /** Aggregated answered assessment for answers linked to a site question. */
5965
5960
  answered: SiteQuestionStatsAnswered;
5966
5961
  }
5962
+ export interface SiteTopic {
5963
+ object: 'context-topic';
5964
+ /** The ID of the topic */
5965
+ id: string;
5966
+ /** The label of the topic */
5967
+ label: string;
5968
+ /** The parent topic when this topic is nested under another one */
5969
+ parent?: {
5970
+ /** The ID of the parent topic */
5971
+ id: string;
5972
+ /** The label of the parent topic */
5973
+ label: string;
5974
+ };
5975
+ createdAt: Timestamp;
5976
+ updatedAt: Timestamp;
5977
+ /** Name of the icon */
5978
+ icon: Icon;
5979
+ summary: JSONDocument;
5980
+ usageSettings: ContextUsageSettings;
5981
+ /**
5982
+ * The weekly pulse of related question answers for the past 3 months
5983
+ * @maxItems 13
5984
+ * @minItems 13
5985
+ */
5986
+ weeklyPulse: number[];
5987
+ /** The number of pages associated with the topic */
5988
+ pages: number;
5989
+ /** The number of records in the topic */
5990
+ records: number;
5991
+ /** Aggregated stats for answers linked to a site question. */
5992
+ questions: SiteQuestionStats;
5993
+ /** URLs associated with the topic */
5994
+ urls: {
5995
+ /**
5996
+ * URL of the topic in the API
5997
+ * @format uri
5998
+ */
5999
+ location: string;
6000
+ };
6001
+ }
6002
+ /** Type classification of the user question. */
6003
+ export declare enum SiteQuestionType {
6004
+ Exploring = "exploring",
6005
+ HowTo = "how-to",
6006
+ Troubleshooting = "troubleshooting",
6007
+ Reference = "reference",
6008
+ Unknown = "unknown"
6009
+ }
5967
6010
  export interface SiteQuestion {
5968
6011
  object: 'site-question';
5969
6012
  /** The ID of the site question. */
5970
6013
  id: string;
5971
6014
  /** Canonical text for the unique site question. */
5972
6015
  question: string;
6016
+ /** Type classification of the user question. */
6017
+ type: SiteQuestionType;
5973
6018
  createdAt: Timestamp;
5974
6019
  /** Aggregated stats for answers linked to a site question. */
5975
6020
  stats: SiteQuestionStats;
@@ -6012,8 +6057,14 @@ export interface SiteQuestionAnswer {
6012
6057
  object: 'site-question-answer';
6013
6058
  /** The ID of the site question answer. */
6014
6059
  id: string;
6015
- /** The ID of the parent site question. */
6016
- question: string;
6060
+ question: {
6061
+ /** The ID of the parent site question. */
6062
+ id: string;
6063
+ /** Type classification of the user question. */
6064
+ type: SiteQuestionType;
6065
+ };
6066
+ /** The IDs of the associated site topics. */
6067
+ topics: string[];
6017
6068
  input: {
6018
6069
  /** Normalized question text for this answer. */
6019
6070
  text?: string;
@@ -6673,11 +6724,15 @@ export type SiteInsightsEventSearchOpenResult = SiteInsightsEventBase & {
6673
6724
  type: 'search_open_result';
6674
6725
  /** Query of the search. */
6675
6726
  query: string;
6727
+ /** Target of the opened search result. */
6676
6728
  result: {
6677
6729
  /** ID of the concerned space. */
6678
6730
  spaceId: string;
6679
6731
  /** ID of the concerned page. */
6680
6732
  pageId: string;
6733
+ } | {
6734
+ /** ID of the concerned record. */
6735
+ recordId: string;
6681
6736
  };
6682
6737
  };
6683
6738
  export type SiteInsightsEventPagePostFeedback = SiteInsightsEventBase & {
@@ -6824,6 +6879,8 @@ export type SiteInsightsQueryEventsColumn = SiteInsightsQueryDateTimeColumn | {
6824
6879
  column: 'eventAPIOperationMethod';
6825
6880
  } | {
6826
6881
  column: 'eventSearchQuery';
6882
+ } | {
6883
+ column: 'eventSearchResultRecordId';
6827
6884
  } | {
6828
6885
  column: 'eventPageFeedbackRating';
6829
6886
  } | {
@@ -6999,6 +7056,9 @@ export type SiteInsightsQueryEventsValues = {
6999
7056
  } | {
7000
7057
  column: 'eventSearchQuery';
7001
7058
  values: string[];
7059
+ } | {
7060
+ column: 'eventSearchResultRecordId';
7061
+ values: (string | null)[];
7002
7062
  } | {
7003
7063
  column: 'pageFeedbackRating';
7004
7064
  values: {
@@ -7114,7 +7174,7 @@ export interface SiteAdsStats {
7114
7174
  /**
7115
7175
  * The source path to redirect from.
7116
7176
  * @maxLength 512
7117
- * @pattern ^\/(?:[A-Za-z0-9\-._~]|%[0-9A-Fa-f]{2})+(?:\/(?:[A-Za-z0-9\-._~]|%[0-9A-Fa-f]{2})+)*$
7177
+ * @pattern ^\/(?!\*)(?!.*\*.+)(?:[A-Za-z0-9\-._~]|%[0-9A-Fa-f]{2})+(?:\/(?:[A-Za-z0-9\-._~]|%[0-9A-Fa-f]{2})+)*(?:\/\*|\*)?$
7118
7178
  */
7119
7179
  export type SiteRedirectSourcePath = string;
7120
7180
  export interface SiteRedirectDestinationSiteSection {
@@ -7141,8 +7201,18 @@ export interface SiteRedirect {
7141
7201
  id: string;
7142
7202
  /** The source path to redirect from. */
7143
7203
  source: SiteRedirectSourcePath;
7204
+ /** Capture and append the wildcard-matched suffix to the destination URL. */
7205
+ captureWildcard: boolean;
7144
7206
  destination: SiteRedirectDestination;
7145
7207
  }
7208
+ export interface SiteRedirectInputDestinationPath {
7209
+ kind: 'path';
7210
+ /** Unique identifier for the space containing the page referenced by the path. */
7211
+ spaceId: string;
7212
+ /** Path to the page within the space revision to resolve. */
7213
+ path: string;
7214
+ }
7215
+ export type SiteRedirectInputDestination = SiteRedirectDestination | SiteRedirectInputDestinationPath;
7146
7216
  /**
7147
7217
  * Name of the MCP server
7148
7218
  * @minLength 1
@@ -13478,7 +13548,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
13478
13548
  */
13479
13549
  limit?: number;
13480
13550
  }, params?: RequestParams) => Promise<HttpResponse<List & {
13481
- items: SearchSpaceResult[];
13551
+ items: (SearchSpaceResult | SearchRecordResult)[];
13482
13552
  }, any>>;
13483
13553
  /**
13484
13554
  * @description The response is streamed.
@@ -13543,6 +13613,8 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
13543
13613
  connector?: ContextConnector;
13544
13614
  /** Filter context records by connection id. */
13545
13615
  connection?: string;
13616
+ /** Filter context records by associated site topic ID. */
13617
+ topic?: string;
13546
13618
  }, params?: RequestParams) => Promise<HttpResponse<List & {
13547
13619
  items: ContextRecord[];
13548
13620
  }, any>>;
@@ -13556,6 +13628,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
13556
13628
  * @secure
13557
13629
  */
13558
13630
  upsertSiteContextRecords: (organizationId: string, siteId: string, data: ContextRecordInput[], params?: RequestParams) => Promise<HttpResponse<void, any>>;
13631
+ /**
13632
+ * No description
13633
+ *
13634
+ * @tags site-context
13635
+ * @name GetSiteContextRecordById
13636
+ * @summary Get a context record
13637
+ * @request GET:/orgs/{organizationId}/sites/{siteId}/context-records/{siteContextRecordId}
13638
+ * @secure
13639
+ */
13640
+ getSiteContextRecordById: (organizationId: string, siteId: string, siteContextRecordId: string, params?: RequestParams) => Promise<HttpResponse<ContextRecord, any>>;
13559
13641
  /**
13560
13642
  * No description
13561
13643
  *
@@ -13643,45 +13725,36 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
13643
13725
  * No description
13644
13726
  *
13645
13727
  * @tags site-context
13646
- * @name ListSiteContextTopics
13647
- * @summary List all context topics
13648
- * @request GET:/orgs/{organizationId}/sites/{siteId}/context-topics
13728
+ * @name ListSiteTopics
13729
+ * @summary List all topics
13730
+ * @request GET:/orgs/{organizationId}/sites/{siteId}/topics
13649
13731
  * @secure
13650
13732
  */
13651
- listSiteContextTopics: (organizationId: string, siteId: string, query?: {
13652
- /** Identifier of the page results to fetch. */
13653
- page?: string;
13654
- /**
13655
- * The number of results per page
13656
- * @min 0
13657
- * @max 1000
13658
- */
13659
- limit?: number;
13660
- }, params?: RequestParams) => Promise<HttpResponse<List & {
13661
- items: ContextTopic[];
13733
+ listSiteTopics: (organizationId: string, siteId: string, params?: RequestParams) => Promise<HttpResponse<{
13734
+ items: SiteTopic[];
13662
13735
  }, any>>;
13663
13736
  /**
13664
13737
  * No description
13665
13738
  *
13666
13739
  * @tags site-context
13667
- * @name GetSiteContextTopicById
13668
- * @summary Get a context topic
13669
- * @request GET:/orgs/{organizationId}/sites/{siteId}/context-topics/{siteContextTopicId}
13740
+ * @name GetSiteTopicById
13741
+ * @summary Get a topic
13742
+ * @request GET:/orgs/{organizationId}/sites/{siteId}/topics/{siteTopicId}
13670
13743
  * @secure
13671
13744
  */
13672
- getSiteContextTopicById: (organizationId: string, siteId: string, siteContextTopicId: string, params?: RequestParams) => Promise<HttpResponse<ContextTopic, any>>;
13745
+ getSiteTopicById: (organizationId: string, siteId: string, siteTopicId: string, params?: RequestParams) => Promise<HttpResponse<SiteTopic, any>>;
13673
13746
  /**
13674
13747
  * No description
13675
13748
  *
13676
13749
  * @tags site-context
13677
- * @name UpdateSiteContextTopicById
13678
- * @summary Update a context topic
13679
- * @request PATCH:/orgs/{organizationId}/sites/{siteId}/context-topics/{siteContextTopicId}
13750
+ * @name UpdateSiteTopicById
13751
+ * @summary Update a topic
13752
+ * @request PATCH:/orgs/{organizationId}/sites/{siteId}/topics/{siteTopicId}
13680
13753
  * @secure
13681
13754
  */
13682
- updateSiteContextTopicById: (organizationId: string, siteId: string, siteContextTopicId: string, data: {
13755
+ updateSiteTopicById: (organizationId: string, siteId: string, siteTopicId: string, data: {
13683
13756
  usageSettings: ContextUsageSettings;
13684
- }, params?: RequestParams) => Promise<HttpResponse<ContextTopic, any>>;
13757
+ }, params?: RequestParams) => Promise<HttpResponse<SiteTopic, any>>;
13685
13758
  /**
13686
13759
  * No description
13687
13760
  *
@@ -13692,6 +13765,8 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
13692
13765
  * @secure
13693
13766
  */
13694
13767
  listSiteQuestions: (organizationId: string, siteId: string, query?: {
13768
+ /** Filter questions by question type. */
13769
+ type?: SiteQuestionType;
13695
13770
  /** Identifier of the page results to fetch. */
13696
13771
  page?: string;
13697
13772
  /**
@@ -13733,6 +13808,10 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
13733
13808
  confidence?: SiteQuestionAnswerConfidence;
13734
13809
  /** Filter answers by question relevance. */
13735
13810
  relevance?: SiteQuestionAnswerRelevance;
13811
+ /** Filter answers by question type. */
13812
+ questionType?: SiteQuestionType;
13813
+ /** Filter answers by associated site topic ID. */
13814
+ topic?: string;
13736
13815
  /** Filter answers by thread root answer ID. Includes the root answer itself. */
13737
13816
  thread?: string;
13738
13817
  /** Identifier of the page results to fetch. */
@@ -14298,8 +14377,61 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
14298
14377
  createSiteRedirect: (organizationId: string, siteId: string, data: {
14299
14378
  /** The source path to redirect from. */
14300
14379
  source: SiteRedirectSourcePath;
14301
- destination: SiteRedirectDestination;
14380
+ /**
14381
+ * Capture and append the wildcard-matched suffix to the destination URL.
14382
+ * @default false
14383
+ */
14384
+ captureWildcard?: boolean;
14385
+ destination: SiteRedirectInputDestination;
14302
14386
  }, params?: RequestParams) => Promise<HttpResponse<SiteRedirect, any>>;
14387
+ /**
14388
+ * No description
14389
+ *
14390
+ * @tags site-redirects
14391
+ * @name BulkUpsertSiteRedirects
14392
+ * @summary Create or update site redirects in bulk
14393
+ * @request PUT:/orgs/{organizationId}/sites/{siteId}/redirects
14394
+ * @secure
14395
+ */
14396
+ bulkUpsertSiteRedirects: (organizationId: string, siteId: string, data: {
14397
+ /**
14398
+ * @maxItems 500
14399
+ * @minItems 1
14400
+ */
14401
+ redirects: {
14402
+ /** The source path to redirect from. */
14403
+ source: SiteRedirectSourcePath;
14404
+ /**
14405
+ * Capture and append the wildcard-matched suffix to the destination URL.
14406
+ * @default false
14407
+ */
14408
+ captureWildcard?: boolean;
14409
+ destination: SiteRedirectInputDestination;
14410
+ }[];
14411
+ }, params?: RequestParams) => Promise<HttpResponse<{
14412
+ results: ({
14413
+ /** The redirect was created. */
14414
+ status: "created";
14415
+ /** The source path to redirect from. */
14416
+ source: SiteRedirectSourcePath;
14417
+ /** The ID of the created redirect. */
14418
+ id: string;
14419
+ } | {
14420
+ /** The redirect was updated. */
14421
+ status: "updated";
14422
+ /** The source path to redirect from. */
14423
+ source: SiteRedirectSourcePath;
14424
+ /** The ID of the updated redirect. */
14425
+ id: string;
14426
+ } | {
14427
+ /** There was an error processing the redirect. */
14428
+ status: "error";
14429
+ /** The source path to redirect from. */
14430
+ source: SiteRedirectSourcePath;
14431
+ /** The error message. */
14432
+ error: string;
14433
+ })[];
14434
+ }, any>>;
14303
14435
  /**
14304
14436
  * No description
14305
14437
  *
@@ -14335,6 +14467,8 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
14335
14467
  updateSiteRedirectById: (organizationId: string, siteId: string, siteRedirectId: string, data: {
14336
14468
  /** The source path to redirect from. */
14337
14469
  source?: SiteRedirectSourcePath;
14470
+ /** Capture and append the wildcard-matched suffix to the destination URL. */
14471
+ captureWildcard?: boolean;
14338
14472
  destination?: SiteRedirectDestination;
14339
14473
  }, params?: RequestParams) => Promise<HttpResponse<SiteRedirect, any>>;
14340
14474
  /**
@@ -92,7 +92,9 @@ export declare const SITE_SPACE_PATH_MIN_LENGTH = 1;
92
92
  export declare const SITE_SECTION_GROUP_TITLE_MAX_LENGTH = 100;
93
93
  export declare const SITE_SECTION_GROUP_TITLE_MIN_LENGTH = 1;
94
94
  export declare const TEAM_MEMBER_ROLE_ENUM: ["owner", "member"];
95
- export declare const BILLING_SWITCH_ACTION_ENUM: ["trial", "upgrade", "upgrade_passive", "downgrade", "undo_cancel", "switch_interval"];
95
+ export declare const BILLING_COUPON_MAX_LENGTH = 500;
96
+ export declare const BILLING_COUPON_MIN_LENGTH = 1;
97
+ export declare const BILLING_SWITCH_ACTION_ENUM: ["trial", "upgrade", "upgrade_passive", "downgrade", "switch_interval"];
96
98
  export declare const BILLING_METER_ENUM: ["ai_responses", "ai_agent_responses", "translation_words"];
97
99
  export declare const SAMLPROVIDER_LABEL_MAX_LENGTH = 30;
98
100
  export declare const SAMLPROVIDER_LABEL_MIN_LENGTH = 1;
@@ -141,6 +143,7 @@ export declare const CONTEXT_RECORD_DESCRIPTION_MAX_LENGTH = 512;
141
143
  export declare const CONTEXT_CONNECTION_LABEL_MAX_LENGTH = 128;
142
144
  export declare const CONTEXT_CONNECTION_LABEL_MIN_LENGTH = 0;
143
145
  export declare const CONTEXT_CONNECTION_STATUS_ENUM: ["pending", "syncing", "succeeded", "failed"];
146
+ export declare const SITE_QUESTION_TYPE_ENUM: ["exploring", "how-to", "troubleshooting", "reference", "unknown"];
144
147
  export declare const SITE_QUESTION_ANSWER_RESOLUTION_ENUM: ["no", "partially", "yes"];
145
148
  export declare const SITE_QUESTION_ANSWER_CONFIDENCE_ENUM: ["low", "medium", "high"];
146
149
  export declare const SITE_QUESTION_ANSWER_RELEVANCE_ENUM: ["relevant", "spam", "off-topic", "unclear"];
@@ -158,7 +161,7 @@ export declare const SITE_INSIGHTS_VISITOR_BOT_ENUM: ["unknown", "googlebot", "b
158
161
  export declare const SITE_INSIGHTS_QUERY_OPERATOR_ENUM: ["in", "notIn", "greaterThan", "greaterThanOrEqual", "lessThan", "lessThanOrEqual"];
159
162
  export declare const SITE_INSIGHTS_QUERY_RANGE_PRESET_ENUM: ["lastYear", "last3Months", "last30Days", "last7Days", "last24Hours"];
160
163
  export declare const SITE_REDIRECT_SOURCE_PATH_MAX_LENGTH = 512;
161
- export declare const SITE_REDIRECT_SOURCE_PATH_PATTERN = "^\\/(?:[A-Za-z0-9\\-._~]|%[0-9A-Fa-f]{2})+(?:\\/(?:[A-Za-z0-9\\-._~]|%[0-9A-Fa-f]{2})+)*$";
164
+ export declare const SITE_REDIRECT_SOURCE_PATH_PATTERN = "^\\/(?!\\*)(?!.*\\*.+)(?:[A-Za-z0-9\\-._~]|%[0-9A-Fa-f]{2})+(?:\\/(?:[A-Za-z0-9\\-._~]|%[0-9A-Fa-f]{2})+)*(?:\\/\\*|\\*)?$";
162
165
  export declare const SITE_MCP_SERVER_NAME_MAX_LENGTH = 100;
163
166
  export declare const SITE_MCP_SERVER_NAME_MIN_LENGTH = 1;
164
167
  export declare const CUSTOM_HOSTNAME_DNS_STATUS_ENUM: ["dns_passed", "dns_wrong_cname", "dns_no_cname", "dns_cloudflare_proxied", "dns_wrong_caa"];
package/dist/index.cjs CHANGED
@@ -189,6 +189,8 @@ __export(src_exports, {
189
189
  APITOKEN_LABEL_MAX_LENGTH: () => APITOKEN_LABEL_MAX_LENGTH,
190
190
  AgentStatus: () => AgentStatus,
191
191
  Api: () => Api,
192
+ BILLING_COUPON_MAX_LENGTH: () => BILLING_COUPON_MAX_LENGTH,
193
+ BILLING_COUPON_MIN_LENGTH: () => BILLING_COUPON_MIN_LENGTH,
192
194
  BILLING_INTERVAL_ENUM: () => BILLING_INTERVAL_ENUM,
193
195
  BILLING_METER_ENUM: () => BILLING_METER_ENUM,
194
196
  BILLING_PRODUCT_ENUM: () => BILLING_PRODUCT_ENUM,
@@ -407,6 +409,7 @@ __export(src_exports, {
407
409
  SITE_QUESTION_ANSWER_RELEVANCE_ENUM: () => SITE_QUESTION_ANSWER_RELEVANCE_ENUM,
408
410
  SITE_QUESTION_ANSWER_RESOLUTION_ENUM: () => SITE_QUESTION_ANSWER_RESOLUTION_ENUM,
409
411
  SITE_QUESTION_ANSWER_SOURCE_TYPE_ENUM: () => SITE_QUESTION_ANSWER_SOURCE_TYPE_ENUM,
412
+ SITE_QUESTION_TYPE_ENUM: () => SITE_QUESTION_TYPE_ENUM,
410
413
  SITE_REDIRECT_SOURCE_PATH_MAX_LENGTH: () => SITE_REDIRECT_SOURCE_PATH_MAX_LENGTH,
411
414
  SITE_REDIRECT_SOURCE_PATH_PATTERN: () => SITE_REDIRECT_SOURCE_PATH_PATTERN,
412
415
  SITE_SECTION_DESCRIPTION_MAX_LENGTH: () => SITE_SECTION_DESCRIPTION_MAX_LENGTH,
@@ -452,6 +455,7 @@ __export(src_exports, {
452
455
  SiteQuestionAnswerRelevance: () => SiteQuestionAnswerRelevance,
453
456
  SiteQuestionAnswerResolution: () => SiteQuestionAnswerResolution,
454
457
  SiteQuestionAnswerSourceType: () => SiteQuestionAnswerSourceType,
458
+ SiteQuestionType: () => SiteQuestionType,
455
459
  SiteSocialAccountPlatform: () => SiteSocialAccountPlatform,
456
460
  SiteType: () => SiteType,
457
461
  SiteVisibility: () => SiteVisibility,
@@ -473,7 +477,7 @@ module.exports = __toCommonJS(src_exports);
473
477
 
474
478
  // package.json
475
479
  var name = "@gitbook/api";
476
- var version = "0.162.0";
480
+ var version = "0.164.0";
477
481
 
478
482
  // src/client.ts
479
483
  var import_event_iterator = __toESM(require_node(), 1);
@@ -970,7 +974,6 @@ var BillingSwitchAction = /* @__PURE__ */ ((BillingSwitchAction2) => {
970
974
  BillingSwitchAction2["Upgrade"] = "upgrade";
971
975
  BillingSwitchAction2["UpgradePassive"] = "upgrade_passive";
972
976
  BillingSwitchAction2["Downgrade"] = "downgrade";
973
- BillingSwitchAction2["UndoCancel"] = "undo_cancel";
974
977
  BillingSwitchAction2["SwitchInterval"] = "switch_interval";
975
978
  return BillingSwitchAction2;
976
979
  })(BillingSwitchAction || {});
@@ -1216,6 +1219,14 @@ var ContextConnectionStatus = /* @__PURE__ */ ((ContextConnectionStatus2) => {
1216
1219
  ContextConnectionStatus2["Failed"] = "failed";
1217
1220
  return ContextConnectionStatus2;
1218
1221
  })(ContextConnectionStatus || {});
1222
+ var SiteQuestionType = /* @__PURE__ */ ((SiteQuestionType2) => {
1223
+ SiteQuestionType2["Exploring"] = "exploring";
1224
+ SiteQuestionType2["HowTo"] = "how-to";
1225
+ SiteQuestionType2["Troubleshooting"] = "troubleshooting";
1226
+ SiteQuestionType2["Reference"] = "reference";
1227
+ SiteQuestionType2["Unknown"] = "unknown";
1228
+ return SiteQuestionType2;
1229
+ })(SiteQuestionType || {});
1219
1230
  var SiteQuestionAnswerResolution = /* @__PURE__ */ ((SiteQuestionAnswerResolution2) => {
1220
1231
  SiteQuestionAnswerResolution2["No"] = "no";
1221
1232
  SiteQuestionAnswerResolution2["Partially"] = "partially";
@@ -3840,6 +3851,13 @@ var Api = class extends HttpClient {
3840
3851
  type: "application/json" /* Json */,
3841
3852
  ...params
3842
3853
  }),
3854
+ getSiteContextRecordById: (organizationId, siteId, siteContextRecordId, params = {}) => this.request({
3855
+ path: `/orgs/${organizationId}/sites/${siteId}/context-records/${siteContextRecordId}`,
3856
+ method: "GET",
3857
+ secure: true,
3858
+ format: "json",
3859
+ ...params
3860
+ }),
3843
3861
  listSiteContextConnections: (organizationId, siteId, query, params = {}) => this.request({
3844
3862
  path: `/orgs/${organizationId}/sites/${siteId}/context-connections`,
3845
3863
  method: "GET",
@@ -3885,23 +3903,22 @@ var Api = class extends HttpClient {
3885
3903
  secure: true,
3886
3904
  ...params
3887
3905
  }),
3888
- listSiteContextTopics: (organizationId, siteId, query, params = {}) => this.request({
3889
- path: `/orgs/${organizationId}/sites/${siteId}/context-topics`,
3906
+ listSiteTopics: (organizationId, siteId, params = {}) => this.request({
3907
+ path: `/orgs/${organizationId}/sites/${siteId}/topics`,
3890
3908
  method: "GET",
3891
- query,
3892
3909
  secure: true,
3893
3910
  format: "json",
3894
3911
  ...params
3895
3912
  }),
3896
- getSiteContextTopicById: (organizationId, siteId, siteContextTopicId, params = {}) => this.request({
3897
- path: `/orgs/${organizationId}/sites/${siteId}/context-topics/${siteContextTopicId}`,
3913
+ getSiteTopicById: (organizationId, siteId, siteTopicId, params = {}) => this.request({
3914
+ path: `/orgs/${organizationId}/sites/${siteId}/topics/${siteTopicId}`,
3898
3915
  method: "GET",
3899
3916
  secure: true,
3900
3917
  format: "json",
3901
3918
  ...params
3902
3919
  }),
3903
- updateSiteContextTopicById: (organizationId, siteId, siteContextTopicId, data, params = {}) => this.request({
3904
- path: `/orgs/${organizationId}/sites/${siteId}/context-topics/${siteContextTopicId}`,
3920
+ updateSiteTopicById: (organizationId, siteId, siteTopicId, data, params = {}) => this.request({
3921
+ path: `/orgs/${organizationId}/sites/${siteId}/topics/${siteTopicId}`,
3905
3922
  method: "PATCH",
3906
3923
  body: data,
3907
3924
  secure: true,
@@ -4121,6 +4138,15 @@ var Api = class extends HttpClient {
4121
4138
  format: "json",
4122
4139
  ...params
4123
4140
  }),
4141
+ bulkUpsertSiteRedirects: (organizationId, siteId, data, params = {}) => this.request({
4142
+ path: `/orgs/${organizationId}/sites/${siteId}/redirects`,
4143
+ method: "PUT",
4144
+ body: data,
4145
+ secure: true,
4146
+ type: "application/json" /* Json */,
4147
+ format: "json",
4148
+ ...params
4149
+ }),
4124
4150
  listSiteRedirects: (organizationId, siteId, query, params = {}) => this.request({
4125
4151
  path: `/orgs/${organizationId}/sites/${siteId}/redirects`,
4126
4152
  method: "GET",
@@ -4414,7 +4440,9 @@ var SITE_SPACE_PATH_MIN_LENGTH = 1;
4414
4440
  var SITE_SECTION_GROUP_TITLE_MAX_LENGTH = 100;
4415
4441
  var SITE_SECTION_GROUP_TITLE_MIN_LENGTH = 1;
4416
4442
  var TEAM_MEMBER_ROLE_ENUM = ["owner", "member"];
4417
- var BILLING_SWITCH_ACTION_ENUM = ["trial", "upgrade", "upgrade_passive", "downgrade", "undo_cancel", "switch_interval"];
4443
+ var BILLING_COUPON_MAX_LENGTH = 500;
4444
+ var BILLING_COUPON_MIN_LENGTH = 1;
4445
+ var BILLING_SWITCH_ACTION_ENUM = ["trial", "upgrade", "upgrade_passive", "downgrade", "switch_interval"];
4418
4446
  var BILLING_METER_ENUM = ["ai_responses", "ai_agent_responses", "translation_words"];
4419
4447
  var SAMLPROVIDER_LABEL_MAX_LENGTH = 30;
4420
4448
  var SAMLPROVIDER_LABEL_MIN_LENGTH = 1;
@@ -4463,6 +4491,7 @@ var CONTEXT_RECORD_DESCRIPTION_MAX_LENGTH = 512;
4463
4491
  var CONTEXT_CONNECTION_LABEL_MAX_LENGTH = 128;
4464
4492
  var CONTEXT_CONNECTION_LABEL_MIN_LENGTH = 0;
4465
4493
  var CONTEXT_CONNECTION_STATUS_ENUM = ["pending", "syncing", "succeeded", "failed"];
4494
+ var SITE_QUESTION_TYPE_ENUM = ["exploring", "how-to", "troubleshooting", "reference", "unknown"];
4466
4495
  var SITE_QUESTION_ANSWER_RESOLUTION_ENUM = ["no", "partially", "yes"];
4467
4496
  var SITE_QUESTION_ANSWER_CONFIDENCE_ENUM = ["low", "medium", "high"];
4468
4497
  var SITE_QUESTION_ANSWER_RELEVANCE_ENUM = ["relevant", "spam", "off-topic", "unclear"];
@@ -4480,7 +4509,7 @@ var SITE_INSIGHTS_VISITOR_BOT_ENUM = ["unknown", "googlebot", "bingbot", "duckdu
4480
4509
  var SITE_INSIGHTS_QUERY_OPERATOR_ENUM = ["in", "notIn", "greaterThan", "greaterThanOrEqual", "lessThan", "lessThanOrEqual"];
4481
4510
  var SITE_INSIGHTS_QUERY_RANGE_PRESET_ENUM = ["lastYear", "last3Months", "last30Days", "last7Days", "last24Hours"];
4482
4511
  var SITE_REDIRECT_SOURCE_PATH_MAX_LENGTH = 512;
4483
- var SITE_REDIRECT_SOURCE_PATH_PATTERN = "^\\/(?:[A-Za-z0-9\\-._~]|%[0-9A-Fa-f]{2})+(?:\\/(?:[A-Za-z0-9\\-._~]|%[0-9A-Fa-f]{2})+)*$";
4512
+ var SITE_REDIRECT_SOURCE_PATH_PATTERN = "^\\/(?!\\*)(?!.*\\*.+)(?:[A-Za-z0-9\\-._~]|%[0-9A-Fa-f]{2})+(?:\\/(?:[A-Za-z0-9\\-._~]|%[0-9A-Fa-f]{2})+)*(?:\\/\\*|\\*)?$";
4484
4513
  var SITE_MCP_SERVER_NAME_MAX_LENGTH = 100;
4485
4514
  var SITE_MCP_SERVER_NAME_MIN_LENGTH = 1;
4486
4515
  var CUSTOM_HOSTNAME_DNS_STATUS_ENUM = ["dns_passed", "dns_wrong_cname", "dns_no_cname", "dns_cloudflare_proxied", "dns_wrong_caa"];
@@ -4581,6 +4610,8 @@ var GitBookAPI = class extends Api {
4581
4610
  APITOKEN_LABEL_MAX_LENGTH,
4582
4611
  AgentStatus,
4583
4612
  Api,
4613
+ BILLING_COUPON_MAX_LENGTH,
4614
+ BILLING_COUPON_MIN_LENGTH,
4584
4615
  BILLING_INTERVAL_ENUM,
4585
4616
  BILLING_METER_ENUM,
4586
4617
  BILLING_PRODUCT_ENUM,
@@ -4799,6 +4830,7 @@ var GitBookAPI = class extends Api {
4799
4830
  SITE_QUESTION_ANSWER_RELEVANCE_ENUM,
4800
4831
  SITE_QUESTION_ANSWER_RESOLUTION_ENUM,
4801
4832
  SITE_QUESTION_ANSWER_SOURCE_TYPE_ENUM,
4833
+ SITE_QUESTION_TYPE_ENUM,
4802
4834
  SITE_REDIRECT_SOURCE_PATH_MAX_LENGTH,
4803
4835
  SITE_REDIRECT_SOURCE_PATH_PATTERN,
4804
4836
  SITE_SECTION_DESCRIPTION_MAX_LENGTH,
@@ -4844,6 +4876,7 @@ var GitBookAPI = class extends Api {
4844
4876
  SiteQuestionAnswerRelevance,
4845
4877
  SiteQuestionAnswerResolution,
4846
4878
  SiteQuestionAnswerSourceType,
4879
+ SiteQuestionType,
4847
4880
  SiteSocialAccountPlatform,
4848
4881
  SiteType,
4849
4882
  SiteVisibility,