@gitbook/api 0.147.0 → 0.148.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
@@ -1277,7 +1277,7 @@ export interface DocumentBlockStepperStep {
1277
1277
  object: 'block';
1278
1278
  type: 'stepper-step';
1279
1279
  key?: string;
1280
- nodes: (DocumentBlocksEssentials | DocumentBlockContentRef | DocumentBlockCode | DocumentBlockEmbed | DocumentBlockFile | DocumentBlockImages | DocumentBlockDrawing | DocumentBlockHint | DocumentBlockQuote | DocumentBlockMath | DocumentBlockIntegration)[];
1280
+ nodes: (DocumentBlocksEssentials | DocumentBlockContentRef | DocumentBlockCode | DocumentBlockEmbed | DocumentBlockFile | DocumentBlockImages | DocumentBlockDrawing | DocumentBlockHint | DocumentBlockQuote | DocumentBlockMath | DocumentBlockIntegration | DocumentBlockExpandable)[];
1281
1281
  data: {
1282
1282
  icon?: string;
1283
1283
  };
@@ -1295,7 +1295,7 @@ export interface DocumentBlockColumn {
1295
1295
  object: 'block';
1296
1296
  type: 'column';
1297
1297
  key?: string;
1298
- nodes: (DocumentBlocksEssentials | DocumentBlockImages | DocumentBlockCode | DocumentBlockHint | DocumentBlockContentRef | DocumentBlockDrawing | DocumentBlockEmbed | DocumentBlockFile | DocumentBlockIntegration | DocumentBlockMath | DocumentBlockQuote | DocumentBlockTable)[];
1298
+ nodes: (DocumentBlocksEssentials | DocumentBlockImages | DocumentBlockCode | DocumentBlockHint | DocumentBlockContentRef | DocumentBlockDrawing | DocumentBlockEmbed | DocumentBlockFile | DocumentBlockIntegration | DocumentBlockMath | DocumentBlockQuote | DocumentBlockTable | DocumentBlockExpandable)[];
1299
1299
  isVoid?: false;
1300
1300
  data: {
1301
1301
  width?: Length;
@@ -1939,11 +1939,6 @@ export interface Organization {
1939
1939
  /** A short description giving context on the reason for the block. */
1940
1940
  reason: BlockReason;
1941
1941
  };
1942
- /**
1943
- * Deprecated. Always true. All organizations are on new trials.
1944
- * @deprecated
1945
- */
1946
- internal_isOnNewTrial?: true;
1947
1942
  internal_billingMigration?: {
1948
1943
  /** When we will upgrade the organization onto new pricing, if they haven't already. */
1949
1944
  deadline?: Timestamp;
@@ -4590,16 +4585,6 @@ export interface ConversationsIssuesCluster {
4590
4585
  issues: number;
4591
4586
  /** The number of conversations in the conversations issues cluster */
4592
4587
  conversations: number;
4593
- /** The number of tasks in the conversations issues cluster */
4594
- tasksTotal: number;
4595
- /** The number of tasks in the backlog in the conversations issues cluster */
4596
- tasksBacklog: number;
4597
- /** The number of tasks done in the conversations issues cluster */
4598
- tasksStarted: number;
4599
- /** The number of tasks completed in the conversations issues cluster */
4600
- tasksCompleted: number;
4601
- /** The number of tasks canceled in the conversations issues cluster */
4602
- tasksCancelled: number;
4603
4588
  };
4604
4589
  /** URLs associated with the conversations issues cluster */
4605
4590
  urls: {
@@ -4608,11 +4593,6 @@ export interface ConversationsIssuesCluster {
4608
4593
  * @format uri
4609
4594
  */
4610
4595
  location: string;
4611
- /**
4612
- * URL of the conversations issues cluster in the application
4613
- * @format uri
4614
- */
4615
- app: string;
4616
4596
  };
4617
4597
  }
4618
4598
  /** Integration source */
@@ -4695,24 +4675,16 @@ export interface ConversationIssue {
4695
4675
  };
4696
4676
  }
4697
4677
  /** State and settings of the agent */
4698
- export interface AgentsSetupState {
4678
+ export interface AgentSetupState {
4699
4679
  /** The email address of the agent. Emails can be forwarded to it to ingest conversations. */
4700
4680
  email: string;
4701
4681
  /** The stats of the agent. */
4702
4682
  stats: {
4703
- /** The number of tasks in the backlog. */
4704
- backlogTasks: number;
4705
- /** The number of tasks in progress. */
4706
- startedTasks: number;
4707
- /** The number of tasks that have been completed. */
4708
- completedTasks: number;
4709
- /** The number of tasks that have been canceled. */
4710
- canceledTasks: number;
4711
4683
  /** The number of conversations the agent has indexed. */
4712
4684
  conversations: number;
4713
4685
  /** The number of issues the agent has indexed. */
4714
4686
  issues: number;
4715
- /** The number of issues clusters the agent has indexed. */
4687
+ /** The number of issue clusters the agent has indexed. */
4716
4688
  issuesClusters: number;
4717
4689
  sources: Record<string, number>;
4718
4690
  };
@@ -4732,46 +4704,6 @@ export interface OrganizationAgentInstructions {
4732
4704
  location: string;
4733
4705
  };
4734
4706
  }
4735
- /** The status of the agent task. - `backlog`: The task has not been started yet, a human should review its specification. - `started`: The task is open, a change request is associated with it. - `completed`: The task is completed. - `canceled`: The task has been canceled by a human. */
4736
- export declare enum AgentTaskStatus {
4737
- Backlog = "backlog",
4738
- Started = "started",
4739
- Completed = "completed",
4740
- Canceled = "canceled"
4741
- }
4742
- export interface AgentTask {
4743
- object: 'agent-task';
4744
- /** The ID of the agent task */
4745
- id: string;
4746
- /** The title of the agent task */
4747
- title: string;
4748
- /** The description of the agent task */
4749
- description: string;
4750
- instructions: JSONDocument;
4751
- /** The status of the agent task. - `backlog`: The task has not been started yet, a human should review its specification. - `started`: The task is open, a change request is associated with it. - `completed`: The task is completed. - `canceled`: The task has been canceled by a human. */
4752
- status: AgentTaskStatus;
4753
- createdAt: Timestamp;
4754
- updatedAt: Timestamp;
4755
- /** ID of the cluster the agent task is associated with. */
4756
- cluster?: string;
4757
- /** ID of the space the agent task will act on. */
4758
- space: string;
4759
- /** ID of the change request the agent task is associated with. */
4760
- changeRequest?: string;
4761
- /** URLs associated with the agent task */
4762
- urls: {
4763
- /**
4764
- * URL of the agent task in the API
4765
- * @format uri
4766
- */
4767
- location: string;
4768
- /**
4769
- * URL of the agent task in the application
4770
- * @format uri
4771
- */
4772
- app: string;
4773
- };
4774
- }
4775
4707
  export declare enum TranslationStatus {
4776
4708
  Pending = "pending",
4777
4709
  Running = "running",
@@ -4941,6 +4873,10 @@ export type ContentImportSource = {
4941
4873
  url: URL;
4942
4874
  } | {
4943
4875
  type: 'file';
4876
+ /**
4877
+ * Files to import
4878
+ * @maxItems 50
4879
+ */
4944
4880
  files: string[];
4945
4881
  };
4946
4882
  export interface ContentImportTarget {
@@ -4960,12 +4896,16 @@ export interface ContentImportRun {
4960
4896
  completedAt?: Timestamp;
4961
4897
  /** Status of the import */
4962
4898
  status: 'pending' | 'in-progress' | 'completed' | 'failed' | 'cancelled';
4963
- /** Imported pages */
4899
+ /** Pages included in the import */
4964
4900
  pages?: {
4965
4901
  /** ID of page */
4966
4902
  id: string;
4967
4903
  /** Source URL where the page has been imported from */
4968
4904
  sourceURL?: string;
4905
+ /** Type of page */
4906
+ type: 'page' | 'folder';
4907
+ /** Status of the page */
4908
+ status: 'complete' | 'pending';
4969
4909
  }[];
4970
4910
  }
4971
4911
  /** A response to a request to preview the publishing of a site. It indicates whether the operation can proceed immediately, requires checkout, if a trial is available or if a trial extension is available. */
@@ -6977,6 +6917,15 @@ export interface ContentComputeRevisionEventResponse {
6977
6917
  pages?: InputPage[];
6978
6918
  files?: InputFile[];
6979
6919
  }
6920
+ export declare enum BillingStatus {
6921
+ Trialing = "trialing",
6922
+ Active = "active",
6923
+ PastDue = "past_due",
6924
+ IncompleteExpired = "incomplete_expired",
6925
+ Canceled = "canceled",
6926
+ Unpaid = "unpaid",
6927
+ Paused = "paused"
6928
+ }
6980
6929
  export declare enum APIIntegrationScope {
6981
6930
  IntegrationRead = "integration:read",
6982
6931
  IntegrationUpdate = "integration:update",
@@ -7327,26 +7276,12 @@ export interface TranslationRunChannel {
7327
7276
  channel: 'translation-run';
7328
7277
  translation: string;
7329
7278
  }
7330
- /** Subscription channel for an agent task. */
7331
- export interface AgentTaskChannel {
7332
- channel: 'agent-task';
7333
- /** The ID of the organization. */
7334
- organization: string;
7335
- /** The ID of the agent task. */
7336
- agentTask: string;
7337
- }
7338
- /** Subscription channel for agent tasks. */
7339
- export interface AgentTasksChannel {
7340
- channel: 'agent-tasks';
7341
- /** The ID of the organization. */
7342
- organization: string;
7343
- }
7344
7279
  export interface ImportRunChannel {
7345
7280
  channel: 'import-run';
7346
7281
  runId: string;
7347
7282
  }
7348
7283
  /** Channel to subscribe to for realtime updates. */
7349
- export type SubscriptionChannel = SpaceInfoChannel | SpaceContentChannel | SpaceGitInfoChannel | SpacePublishingAuthChannel | SpacePublishingCustomizationChannel | SpaceContentRefsChannel | SpaceIntegrationsChannel | UserAPITokensChannel | UserOrganizationsChannel | UserProfileChannel | ChangeRequestChannel | ChangeRequestsChannel | ChangeRequestReviewsChannel | ChangeRequestContentRefsChannel | CollectionChannel | CollectionPublishingCustomizationChannel | OrganizationInfoChannel | OrganizationInviteLinksChannel | OrganizationMembersChannel | OrganizationMemberChannel | OrganizationSAMLChannel | OrganizationTeamsChannel | OrganizationTeamChannel | OrganizationTeamMembersChannel | OrganizationTeamMemberChannel | OrganizationSpacesChannel | OrganizationCollectionsChannel | OrganizationIntegrationsChannel | OrganizationInstallationsChannel | OrganizationSitesChannel | OrganizationAIIndexationChannel | OrganizationOpenAPISpecsChannel | OrganizationTranslationsChannel | OrganizationTranslationsGlossaryChannel | OrganizationCustomFontsChannel | OrganizationAgentInstructionsChannel | OrganizationChangeRequestsChannel | SpaceCommentsChannel | ChangeRequestCommentsChannel | CommentInfoChannel | CommentRepliesChannel | IntegrationChannel | IntegrationInstallationChannel | IntegrationSpaceInstallationChannel | IntegrationSpaceInstallationsChannel | IntegrationSiteInstallationChannel | IntegrationSiteInstallationsChannel | PublishedContentSiteChannel | SiteRedirectsChannel | SiteChannel | SiteCustomizationChannel | SiteIntegrationsChannel | SiteSpaceChannel | SiteSpaceCustomizationChannel | SiteStructureChannel | SiteAdaptiveSchemaChannel | SitePublishingAuthChannel | SiteShareLinksChannel | SiteShareLinkChannel | SiteMcpServersChannel | SiteMcpServerChannel | SiteSectionChannel | CustomHostnameChannel | GitSyncOperationChannel | OpenAPISpecChannel | SubdomainChannel | TranslationChannel | TranslationRunChannel | AgentTaskChannel | AgentTasksChannel | ImportRunChannel;
7284
+ export type SubscriptionChannel = SpaceInfoChannel | SpaceContentChannel | SpaceGitInfoChannel | SpacePublishingAuthChannel | SpacePublishingCustomizationChannel | SpaceContentRefsChannel | SpaceIntegrationsChannel | UserAPITokensChannel | UserOrganizationsChannel | UserProfileChannel | ChangeRequestChannel | ChangeRequestsChannel | ChangeRequestReviewsChannel | ChangeRequestContentRefsChannel | CollectionChannel | CollectionPublishingCustomizationChannel | OrganizationInfoChannel | OrganizationInviteLinksChannel | OrganizationMembersChannel | OrganizationMemberChannel | OrganizationSAMLChannel | OrganizationTeamsChannel | OrganizationTeamChannel | OrganizationTeamMembersChannel | OrganizationTeamMemberChannel | OrganizationSpacesChannel | OrganizationCollectionsChannel | OrganizationIntegrationsChannel | OrganizationInstallationsChannel | OrganizationSitesChannel | OrganizationAIIndexationChannel | OrganizationOpenAPISpecsChannel | OrganizationTranslationsChannel | OrganizationTranslationsGlossaryChannel | OrganizationCustomFontsChannel | OrganizationAgentInstructionsChannel | OrganizationChangeRequestsChannel | SpaceCommentsChannel | ChangeRequestCommentsChannel | CommentInfoChannel | CommentRepliesChannel | IntegrationChannel | IntegrationInstallationChannel | IntegrationSpaceInstallationChannel | IntegrationSpaceInstallationsChannel | IntegrationSiteInstallationChannel | IntegrationSiteInstallationsChannel | PublishedContentSiteChannel | SiteRedirectsChannel | SiteChannel | SiteCustomizationChannel | SiteIntegrationsChannel | SiteSpaceChannel | SiteSpaceCustomizationChannel | SiteStructureChannel | SiteAdaptiveSchemaChannel | SitePublishingAuthChannel | SiteShareLinksChannel | SiteShareLinkChannel | SiteMcpServersChannel | SiteMcpServerChannel | SiteSectionChannel | CustomHostnameChannel | GitSyncOperationChannel | OpenAPISpecChannel | SubdomainChannel | TranslationChannel | TranslationRunChannel | ImportRunChannel;
7350
7285
  export interface TranslationRunChannelData {
7351
7286
  channel: 'translation-run';
7352
7287
  data: {
@@ -7505,6 +7440,7 @@ export type SpaceVisitorAuthIntegrationBackend = VisitorAuthIntegrationBackend;
7505
7440
  export type UserPermissions = Index;
7506
7441
  export type SiteRedirectDestinationSpace = SiteRedirectDestinationSiteSpace;
7507
7442
  export type OpenAPISpecSourceURL = URL;
7443
+ export type AgentsSetupState = AgentSetupState;
7508
7444
  import { EventIterator } from 'event-iterator';
7509
7445
  export type QueryParamsType = Record<string | number, any>;
7510
7446
  export type ResponseFormat = keyof Omit<Body, 'body' | 'bodyUsed'>;
@@ -8335,13 +8271,10 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8335
8271
  createChangeRequest: (spaceId: string, data: {
8336
8272
  /** Subject of the change-request */
8337
8273
  subject?: string;
8338
- } & (Record<string, any> | ({
8339
- /** ID of the agent task to implement */
8340
- agentTaskId: string;
8341
- } | {
8342
8274
  /** Template to apply to the change request */
8343
- template: ApplySpaceTemplate;
8344
- })), params?: RequestParams) => Promise<HttpResponse<ChangeRequest, any>>;
8275
+ template?: ApplySpaceTemplate;
8276
+ [key: string]: any;
8277
+ }, params?: RequestParams) => Promise<HttpResponse<ChangeRequest, any>>;
8345
8278
  /**
8346
8279
  * No description
8347
8280
  *
@@ -11495,9 +11428,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
11495
11428
  */
11496
11429
  order?: "asc" | "desc";
11497
11430
  /** @default "updatedAt" */
11498
- orderBy?: "updatedAt" | "issues" | "conversations" | "tasksTotal" | "tasksBacklog" | "tasksStarted";
11499
- /** Filter by status */
11500
- status?: "pending" | "analysing";
11431
+ orderBy?: "updatedAt" | "issues" | "conversations";
11501
11432
  }, params?: RequestParams) => Promise<HttpResponse<List & {
11502
11433
  items: ConversationsIssuesCluster[];
11503
11434
  }, {
@@ -11626,7 +11557,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
11626
11557
  * @request GET:/orgs/{organizationId}/agents-setup
11627
11558
  * @secure
11628
11559
  */
11629
- getAgentSetupState: (organizationId: string, params?: RequestParams) => Promise<HttpResponse<AgentsSetupState, any>>;
11560
+ getAgentSetupState: (organizationId: string, params?: RequestParams) => Promise<HttpResponse<AgentSetupState, any>>;
11630
11561
  /**
11631
11562
  * No description
11632
11563
  *
@@ -11650,67 +11581,6 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
11650
11581
  /** Document describing the Docs agent instructions. */
11651
11582
  instructions: JSONDocument;
11652
11583
  }, params?: RequestParams) => Promise<HttpResponse<OrganizationAgentInstructions, any>>;
11653
- /**
11654
- * No description
11655
- *
11656
- * @tags agents
11657
- * @name ListAgentTasks
11658
- * @summary List agent tasks
11659
- * @request GET:/orgs/{organizationId}/agent-tasks
11660
- * @secure
11661
- */
11662
- listAgentTasks: (organizationId: string, query?: {
11663
- /** Identifier of the page results to fetch. */
11664
- page?: string;
11665
- /**
11666
- * The number of results per page
11667
- * @min 0
11668
- * @max 1000
11669
- */
11670
- limit?: number;
11671
- /** The ID of the conversations issues cluster to filter the agent tasks by */
11672
- cluster?: string;
11673
- /** The ID of the space to filter the agent tasks by */
11674
- space?: string;
11675
- /** The statuses of the agent tasks to filter by */
11676
- status?: AgentTaskStatus[];
11677
- }, params?: RequestParams) => Promise<HttpResponse<List & {
11678
- items: AgentTask[];
11679
- }, {
11680
- error: {
11681
- /** @format int32 */
11682
- code: 404;
11683
- message: string;
11684
- };
11685
- }>>;
11686
- /**
11687
- * No description
11688
- *
11689
- * @tags agents
11690
- * @name GetAgentTask
11691
- * @summary Get an agent task by its identifier
11692
- * @request GET:/orgs/{organizationId}/agent-tasks/{agentTaskId}
11693
- * @secure
11694
- */
11695
- getAgentTask: (organizationId: string, agentTaskId: string, params?: RequestParams) => Promise<HttpResponse<AgentTask, {
11696
- error: {
11697
- /** @format int32 */
11698
- code: 404;
11699
- message: string;
11700
- };
11701
- }>>;
11702
- /**
11703
- * No description
11704
- *
11705
- * @tags agents
11706
- * @name UpdateAgentTask
11707
- * @summary Update an agent task by its identifier
11708
- * @request PATCH:/orgs/{organizationId}/agent-tasks/{agentTaskId}
11709
- * @secure
11710
- */
11711
- updateAgentTask: (organizationId: string, agentTaskId: string, data: {
11712
- status: "backlog" | "started" | "canceled";
11713
- }, params?: RequestParams) => Promise<HttpResponse<AgentTask, any>>;
11714
11584
  /**
11715
11585
  * No description
11716
11586
  *
@@ -13022,7 +12892,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
13022
12892
  /**
13023
12893
  * @description Generate an AI response in a conversation.
13024
12894
  *
13025
- * @tags sites
12895
+ * @tags site-ai
13026
12896
  * @name StreamAiResponseInSite
13027
12897
  * @summary Generate an AI response in a site
13028
12898
  * @request POST:/orgs/{organizationId}/sites/{siteId}/ai/response
@@ -13042,7 +12912,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
13042
12912
  /**
13043
12913
  * @description Experimental operation to get an existing AI response in a site.
13044
12914
  *
13045
- * @tags sites
12915
+ * @tags site-ai
13046
12916
  * @name StreamExistingAiResponseInSite
13047
12917
  * @summary Get an existing AI response in a site
13048
12918
  * @request GET:/orgs/{organizationId}/sites/{siteId}/ai/response/{responseId}
@@ -13274,6 +13144,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
13274
13144
  startImportRun: (organizationId: string, data: {
13275
13145
  source: ContentImportSource;
13276
13146
  target: ContentImportTarget;
13147
+ /**
13148
+ * Enhance the imported content with AI
13149
+ * @default true
13150
+ */
13151
+ enhance?: boolean;
13277
13152
  }, params?: RequestParams) => Promise<HttpResponse<ContentImportRun, {
13278
13153
  error: {
13279
13154
  /** @format int32 */
@@ -94,7 +94,6 @@ export declare const SAMLPROVIDER_LABEL_MIN_LENGTH = 1;
94
94
  export declare const SAMLPROVIDER_ENTITY_ID_MAX_LENGTH = 1024;
95
95
  export declare const SAMLPROVIDER_CERTIFICATE_MAX_LENGTH = 10000;
96
96
  export declare const SAMLPROVIDER_STATUS_ENUM: ["active", "pending"];
97
- export declare const AGENT_TASK_STATUS_ENUM: ["backlog", "started", "completed", "canceled"];
98
97
  export declare const TRANSLATION_STATUS_ENUM: ["pending", "running", "completed"];
99
98
  export declare const STORAGE_UPLOAD_KIND_ENUM: ["customization_font", "import_file"];
100
99
  export declare const FONT_FAMILY_MAX_LENGTH = 50;
@@ -152,6 +151,7 @@ export declare const REVISION_SEMANTIC_CHANGE_TYPE_ENUM: ["page_created", "page_
152
151
  export declare const GIT_SYNC_OPERATION_STATE_ENUM: ["running", "failure", "success"];
153
152
  export declare const GIT_SYNC_OPERATION_DIRECTION_ENUM: ["export", "import"];
154
153
  export declare const GIT_SYNC_OPERATION_STAGE_ENUM: ["repo_fetch", "config_check", "content_process", "finalize"];
154
+ export declare const BILLING_STATUS_ENUM: ["trialing", "active", "past_due", "incomplete_expired", "canceled", "unpaid", "paused"];
155
155
  export declare const APIINTEGRATION_SCOPE_ENUM: ["integration:read", "integration:update", "integration:installation:read", "integration:installation:update"];
156
156
  export declare const SITE_ADS_STATUS_ENUM: ["pending", "in-review", "live", "rejected", "disabled"];
157
157
  export declare const AIMESSAGE_ROLE_ENUM: ["user", "assistant", "developer"];
package/dist/index.cjs CHANGED
@@ -180,7 +180,6 @@ var require_node = __commonJS({
180
180
  var src_exports = {};
181
181
  __export(src_exports, {
182
182
  AGENT_STATUS_ENUM: () => AGENT_STATUS_ENUM,
183
- AGENT_TASK_STATUS_ENUM: () => AGENT_TASK_STATUS_ENUM,
184
183
  AIMESSAGE_ROLE_ENUM: () => AIMESSAGE_ROLE_ENUM,
185
184
  AIMODEL_ENUM: () => AIMODEL_ENUM,
186
185
  AIMessageRole: () => AIMessageRole,
@@ -189,11 +188,11 @@ __export(src_exports, {
189
188
  APIIntegrationScope: () => APIIntegrationScope,
190
189
  APITOKEN_LABEL_MAX_LENGTH: () => APITOKEN_LABEL_MAX_LENGTH,
191
190
  AgentStatus: () => AgentStatus,
192
- AgentTaskStatus: () => AgentTaskStatus,
193
191
  Api: () => Api,
194
192
  BILLING_INTERVAL_ENUM: () => BILLING_INTERVAL_ENUM,
195
193
  BILLING_METER_ENUM: () => BILLING_METER_ENUM,
196
194
  BILLING_PRODUCT_ENUM: () => BILLING_PRODUCT_ENUM,
195
+ BILLING_STATUS_ENUM: () => BILLING_STATUS_ENUM,
197
196
  BILLING_SWITCH_ACTION_ENUM: () => BILLING_SWITCH_ACTION_ENUM,
198
197
  BILLING_TRIAL_STATUS_ENUM: () => BILLING_TRIAL_STATUS_ENUM,
199
198
  BLOCK_REASON_MAX_LENGTH: () => BLOCK_REASON_MAX_LENGTH,
@@ -202,6 +201,7 @@ __export(src_exports, {
202
201
  BillingInterval: () => BillingInterval,
203
202
  BillingMeter: () => BillingMeter,
204
203
  BillingProduct: () => BillingProduct,
204
+ BillingStatus: () => BillingStatus,
205
205
  BillingSwitchAction: () => BillingSwitchAction,
206
206
  BillingTrialStatus: () => BillingTrialStatus,
207
207
  BlockSource: () => BlockSource,
@@ -441,23 +441,24 @@ module.exports = __toCommonJS(src_exports);
441
441
 
442
442
  // package.json
443
443
  var name = "@gitbook/api";
444
- var version = "0.147.0";
444
+ var version = "0.148.0";
445
445
 
446
446
  // src/client.ts
447
447
  var import_event_iterator = __toESM(require_node(), 1);
448
448
 
449
449
  // ../../node_modules/eventsource-parser/dist/index.js
450
- var __defProp2 = Object.defineProperty;
451
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
452
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key != "symbol" ? key + "" : key, value);
453
450
  var ParseError = class extends Error {
454
451
  constructor(message, options) {
455
- super(message), __publicField(this, "type"), __publicField(this, "field"), __publicField(this, "value"), __publicField(this, "line"), this.name = "ParseError", this.type = options.type, this.field = options.field, this.value = options.value, this.line = options.line;
452
+ super(message), this.name = "ParseError", this.type = options.type, this.field = options.field, this.value = options.value, this.line = options.line;
456
453
  }
457
454
  };
458
455
  function noop(_arg) {
459
456
  }
460
457
  function createParser(callbacks) {
458
+ if (typeof callbacks == "function")
459
+ throw new TypeError(
460
+ "`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?"
461
+ );
461
462
  const { onEvent = noop, onError = noop, onRetry = noop, onComment } = callbacks;
462
463
  let incompleteLine = "", isFirstChunk = true, id, data = "", eventType = "";
463
464
  function feed(newChunk) {
@@ -523,19 +524,25 @@ function createParser(callbacks) {
523
524
  }), id = void 0, data = "", eventType = "";
524
525
  }
525
526
  function reset(options = {}) {
526
- incompleteLine && options.consume && parseLine(incompleteLine), id = void 0, data = "", eventType = "", incompleteLine = "";
527
+ incompleteLine && options.consume && parseLine(incompleteLine), isFirstChunk = true, id = void 0, data = "", eventType = "", incompleteLine = "";
527
528
  }
528
529
  return { feed, reset };
529
530
  }
530
531
  function splitLines(chunk) {
531
532
  const lines = [];
532
- let incompleteLine = "";
533
- const totalLength = chunk.length;
534
- for (let i = 0; i < totalLength; i++) {
535
- const char = chunk[i];
536
- char === "\r" && chunk[i + 1] === `
537
- ` ? (lines.push(incompleteLine), incompleteLine = "", i++) : char === "\r" || char === `
538
- ` ? (lines.push(incompleteLine), incompleteLine = "") : incompleteLine += char;
533
+ let incompleteLine = "", searchIndex = 0;
534
+ for (; searchIndex < chunk.length; ) {
535
+ const crIndex = chunk.indexOf("\r", searchIndex), lfIndex = chunk.indexOf(`
536
+ `, searchIndex);
537
+ let lineEnd = -1;
538
+ 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) {
539
+ incompleteLine = chunk.slice(searchIndex);
540
+ break;
541
+ } else {
542
+ const line = chunk.slice(searchIndex, lineEnd);
543
+ lines.push(line), searchIndex = lineEnd + 1, chunk[searchIndex - 1] === "\r" && chunk[searchIndex] === `
544
+ ` && searchIndex++;
545
+ }
539
546
  }
540
547
  return [lines, incompleteLine];
541
548
  }
@@ -955,13 +962,6 @@ var SAMLProviderStatus = /* @__PURE__ */ ((SAMLProviderStatus2) => {
955
962
  SAMLProviderStatus2["Pending"] = "pending";
956
963
  return SAMLProviderStatus2;
957
964
  })(SAMLProviderStatus || {});
958
- var AgentTaskStatus = /* @__PURE__ */ ((AgentTaskStatus2) => {
959
- AgentTaskStatus2["Backlog"] = "backlog";
960
- AgentTaskStatus2["Started"] = "started";
961
- AgentTaskStatus2["Completed"] = "completed";
962
- AgentTaskStatus2["Canceled"] = "canceled";
963
- return AgentTaskStatus2;
964
- })(AgentTaskStatus || {});
965
965
  var TranslationStatus = /* @__PURE__ */ ((TranslationStatus2) => {
966
966
  TranslationStatus2["Pending"] = "pending";
967
967
  TranslationStatus2["Running"] = "running";
@@ -1273,6 +1273,16 @@ var GitSyncOperationStage = /* @__PURE__ */ ((GitSyncOperationStage2) => {
1273
1273
  GitSyncOperationStage2["Finalize"] = "finalize";
1274
1274
  return GitSyncOperationStage2;
1275
1275
  })(GitSyncOperationStage || {});
1276
+ var BillingStatus = /* @__PURE__ */ ((BillingStatus2) => {
1277
+ BillingStatus2["Trialing"] = "trialing";
1278
+ BillingStatus2["Active"] = "active";
1279
+ BillingStatus2["PastDue"] = "past_due";
1280
+ BillingStatus2["IncompleteExpired"] = "incomplete_expired";
1281
+ BillingStatus2["Canceled"] = "canceled";
1282
+ BillingStatus2["Unpaid"] = "unpaid";
1283
+ BillingStatus2["Paused"] = "paused";
1284
+ return BillingStatus2;
1285
+ })(BillingStatus || {});
1276
1286
  var APIIntegrationScope = /* @__PURE__ */ ((APIIntegrationScope2) => {
1277
1287
  APIIntegrationScope2["IntegrationRead"] = "integration:read";
1278
1288
  APIIntegrationScope2["IntegrationUpdate"] = "integration:update";
@@ -3192,30 +3202,6 @@ var Api = class extends HttpClient {
3192
3202
  format: "json",
3193
3203
  ...params
3194
3204
  }),
3195
- listAgentTasks: (organizationId, query, params = {}) => this.request({
3196
- path: `/orgs/${organizationId}/agent-tasks`,
3197
- method: "GET",
3198
- query,
3199
- secure: true,
3200
- format: "json",
3201
- ...params
3202
- }),
3203
- getAgentTask: (organizationId, agentTaskId, params = {}) => this.request({
3204
- path: `/orgs/${organizationId}/agent-tasks/${agentTaskId}`,
3205
- method: "GET",
3206
- secure: true,
3207
- format: "json",
3208
- ...params
3209
- }),
3210
- updateAgentTask: (organizationId, agentTaskId, data, params = {}) => this.request({
3211
- path: `/orgs/${organizationId}/agent-tasks/${agentTaskId}`,
3212
- method: "PATCH",
3213
- body: data,
3214
- secure: true,
3215
- type: "application/json" /* Json */,
3216
- format: "json",
3217
- ...params
3218
- }),
3219
3205
  listTranslations: (organizationId, query, params = {}) => this.request({
3220
3206
  path: `/orgs/${organizationId}/translations`,
3221
3207
  method: "GET",
@@ -4072,7 +4058,6 @@ var SAMLPROVIDER_LABEL_MIN_LENGTH = 1;
4072
4058
  var SAMLPROVIDER_ENTITY_ID_MAX_LENGTH = 1024;
4073
4059
  var SAMLPROVIDER_CERTIFICATE_MAX_LENGTH = 1e4;
4074
4060
  var SAMLPROVIDER_STATUS_ENUM = ["active", "pending"];
4075
- var AGENT_TASK_STATUS_ENUM = ["backlog", "started", "completed", "canceled"];
4076
4061
  var TRANSLATION_STATUS_ENUM = ["pending", "running", "completed"];
4077
4062
  var STORAGE_UPLOAD_KIND_ENUM = ["customization_font", "import_file"];
4078
4063
  var FONT_FAMILY_MAX_LENGTH = 50;
@@ -4130,6 +4115,7 @@ var REVISION_SEMANTIC_CHANGE_TYPE_ENUM = ["page_created", "page_edited", "page_d
4130
4115
  var GIT_SYNC_OPERATION_STATE_ENUM = ["running", "failure", "success"];
4131
4116
  var GIT_SYNC_OPERATION_DIRECTION_ENUM = ["export", "import"];
4132
4117
  var GIT_SYNC_OPERATION_STAGE_ENUM = ["repo_fetch", "config_check", "content_process", "finalize"];
4118
+ var BILLING_STATUS_ENUM = ["trialing", "active", "past_due", "incomplete_expired", "canceled", "unpaid", "paused"];
4133
4119
  var APIINTEGRATION_SCOPE_ENUM = ["integration:read", "integration:update", "integration:installation:read", "integration:installation:update"];
4134
4120
  var SITE_ADS_STATUS_ENUM = ["pending", "in-review", "live", "rejected", "disabled"];
4135
4121
  var AIMESSAGE_ROLE_ENUM = ["user", "assistant", "developer"];
@@ -4205,7 +4191,6 @@ var GitBookAPI = class extends Api {
4205
4191
  // Annotate the CommonJS export names for ESM import in node:
4206
4192
  0 && (module.exports = {
4207
4193
  AGENT_STATUS_ENUM,
4208
- AGENT_TASK_STATUS_ENUM,
4209
4194
  AIMESSAGE_ROLE_ENUM,
4210
4195
  AIMODEL_ENUM,
4211
4196
  AIMessageRole,
@@ -4214,11 +4199,11 @@ var GitBookAPI = class extends Api {
4214
4199
  APIIntegrationScope,
4215
4200
  APITOKEN_LABEL_MAX_LENGTH,
4216
4201
  AgentStatus,
4217
- AgentTaskStatus,
4218
4202
  Api,
4219
4203
  BILLING_INTERVAL_ENUM,
4220
4204
  BILLING_METER_ENUM,
4221
4205
  BILLING_PRODUCT_ENUM,
4206
+ BILLING_STATUS_ENUM,
4222
4207
  BILLING_SWITCH_ACTION_ENUM,
4223
4208
  BILLING_TRIAL_STATUS_ENUM,
4224
4209
  BLOCK_REASON_MAX_LENGTH,
@@ -4227,6 +4212,7 @@ var GitBookAPI = class extends Api {
4227
4212
  BillingInterval,
4228
4213
  BillingMeter,
4229
4214
  BillingProduct,
4215
+ BillingStatus,
4230
4216
  BillingSwitchAction,
4231
4217
  BillingTrialStatus,
4232
4218
  BlockSource,