@gitbook/api 0.200.0 → 0.202.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
@@ -741,6 +741,30 @@ export declare enum SAMLProviderStatus {
741
741
  Active = "active",
742
742
  Pending = "pending"
743
743
  }
744
+ /** An organization feature used for plan access and upgrade prompts. */
745
+ export declare enum OrganizationFeature {
746
+ MaxMembers = "max-members",
747
+ AiLens = "ai-lens",
748
+ PdfExport = "pdf-export",
749
+ AiWriting = "ai-writing",
750
+ ReusableContent = "reusable-content",
751
+ Translations = "translations",
752
+ MembersAdvancedRoles = "members-advanced-roles",
753
+ MembersTeams = "members-teams",
754
+ MembersTeamOwners = "members-team-owners",
755
+ SecuritySaml = "security-saml",
756
+ ChangeRequestsMergeRules = "change-requests-merge-rules"
757
+ }
758
+ /**
759
+ * UTC calendar interval for AI usage, with weeks starting on Monday.
760
+ * @default "day"
761
+ */
762
+ export declare enum AIUsageInterval {
763
+ Day = "day",
764
+ Week = "week",
765
+ Month = "month",
766
+ Year = "year"
767
+ }
744
768
  export declare enum BillingSwitchAction {
745
769
  Trial = "trial",
746
770
  Upgrade = "upgrade",
@@ -2577,6 +2601,8 @@ export interface DocumentBlockTabsItem {
2577
2601
  title?: string;
2578
2602
  /** Name of the icon */
2579
2603
  icon?: Icon;
2604
+ /** Stable identifier for this tab's selection, shared with every tab and button targeting the same slug. It is slugified before matching, so casing and spacing need not be exact. Omit it — or send an empty value, which counts as omitted — to derive one from the title, which is what makes same-named tabs across a site select together. A value that slugifies to nothing, such as emoji alone, also falls back to the title. */
2605
+ slug?: string;
2580
2606
  };
2581
2607
  meta?: {
2582
2608
  /** Unique ID to be used in an URL for the block. */
@@ -2996,6 +3022,8 @@ export interface RevisionPageLayoutOptions {
2996
3022
  tags: boolean;
2997
3023
  /** Should the page actions be visible on the page? */
2998
3024
  actions: boolean;
3025
+ /** Should the anchor links on headings and other linkable blocks be visible? */
3026
+ anchors: boolean;
2999
3027
  }
3000
3028
  export interface RevisionPageDocumentCover {
3001
3029
  /** Content reference pointing to the source image. */
@@ -3195,7 +3223,7 @@ export type ChangeRequestSubject = string;
3195
3223
  export type ChangeRequestLinkTitle = string;
3196
3224
  /** External link associated with a change request. */
3197
3225
  export interface ChangeRequestLinkInput {
3198
- /** The ID of an existing link, as served on the change request. Pass it back to update that link; omit it to add a new one. Links created before links were stored individually have no ID and are matched on their URL instead. */
3226
+ /** The ID of an existing link, as served on the change request. Pass it back to update that link, or omit it to add a new one. */
3199
3227
  id?: string;
3200
3228
  ref: ContentRefURL;
3201
3229
  /** Optional title to display for the link. */
@@ -3225,8 +3253,8 @@ export type ChangeRequestLinkExpanded = {
3225
3253
  state: "error";
3226
3254
  };
3227
3255
  export type ChangeRequestLink = ChangeRequestLinkInput & {
3228
- /** The ID of the link. Absent on links not yet stored relationally. */
3229
- id?: string;
3256
+ /** The ID of the link. */
3257
+ id: string;
3230
3258
  /** External ticket data resolved for this link by a configured connector. */
3231
3259
  expanded?: ChangeRequestLinkExpanded;
3232
3260
  };
@@ -3274,7 +3302,7 @@ export interface ChangeRequest {
3274
3302
  /** ID of the site finding associated with the change request, when applicable. */
3275
3303
  finding?: string;
3276
3304
  };
3277
- /** Style guide check run that opened the change request, when it came from one. */
3305
+ /** Style guide check that opened the change request, when it came from one. A check can be run again on the change request already open on a space, rather than opening a second one, so several checks can share a change request. */
3278
3306
  styleguide?: {
3279
3307
  /** ID of the site the style guide belongs to. */
3280
3308
  site: string;
@@ -3282,6 +3310,8 @@ export interface ChangeRequest {
3282
3310
  run: string;
3283
3311
  /** Number of pages the check changed, recorded when it finished. Absent while it is still running, or when it never completed. */
3284
3312
  changedPages?: number;
3313
+ /** When the most recent style guide check on the change request finished. Later edits from anyone else do not move it. Absent while the first one is still running. */
3314
+ checkedAt?: Timestamp;
3285
3315
  };
3286
3316
  /** If true, the change request is not up-to-date with latest changes in the main content. */
3287
3317
  outdated: boolean;
@@ -5982,6 +6012,54 @@ export interface BillingInvoicePreview {
5982
6012
  amount: number;
5983
6013
  }[];
5984
6014
  }
6015
+ /** The AI credits of the current billing period, grouped the ways the billing screens display them. */
6016
+ export interface Credits {
6017
+ /** Credits granted across every grant. */
6018
+ grantedCredits: number;
6019
+ /** Credits spent by the usage metered so far. */
6020
+ usedCredits: number;
6021
+ /** Credits still available across every grant. */
6022
+ remainingCredits: number;
6023
+ /** Part of the metered AI usage paid by credits rather than billed, as a positive amount. */
6024
+ coveredAmount: number;
6025
+ /** The credits the organization pays for. */
6026
+ paid: BillingCreditsTotals;
6027
+ /** The credits included at no extra cost, from the bundle, sites and rollover. */
6028
+ free: BillingCreditsTotals;
6029
+ /** The credits of the monthly bundle, both paid and bonus. */
6030
+ bundle: BillingCreditsTotals;
6031
+ }
6032
+ /** AI credits available for the current AI billing period. Empty when the organization is not billed for AI usage. */
6033
+ export type CreditGrants = {
6034
+ /** 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. */
6035
+ type: "paid" | "bonus" | "site" | "rollover";
6036
+ /** Credits the grant was created with. */
6037
+ grantedCredits: number;
6038
+ /** Credits of the grant spent by the usage metered so far. */
6039
+ usedCredits: number;
6040
+ /** Credits of the grant still available. */
6041
+ remainingCredits: number;
6042
+ /** For a `site` grant, the published sites the credits come from. */
6043
+ sites?: {
6044
+ /** The type of the site */
6045
+ siteType: SiteType;
6046
+ /** How many sites of this type are published. */
6047
+ count: number;
6048
+ /** Credits included with one site of this type. */
6049
+ creditsPerSite: number;
6050
+ /** Credits these sites contribute to the grant. */
6051
+ grantedCredits: number;
6052
+ }[];
6053
+ }[];
6054
+ /** Credit balance after an accepted bundle change, including grants pending webhook synchronization. */
6055
+ export interface BillingCreditBalance {
6056
+ /** The AI credit bundle to top up every month */
6057
+ creditsBundle: BillingCreditsBundle;
6058
+ /** The AI credits of the current billing period, grouped the ways the billing screens display them. */
6059
+ credits: Credits;
6060
+ /** AI credits available for the current AI billing period. Empty when the organization is not billed for AI usage. */
6061
+ creditGrants: CreditGrants;
6062
+ }
5985
6063
  export type BillingUpgrade = {
5986
6064
  result: "checkout";
5987
6065
  /** Stripe payment session ID */
@@ -5991,6 +6069,8 @@ export type BillingUpgrade = {
5991
6069
  invoice: BillingInvoicePreview;
5992
6070
  } | {
5993
6071
  result: "upgraded";
6072
+ /** Credit balance after an accepted bundle change, including grants pending webhook synchronization. */
6073
+ creditBalance?: BillingCreditBalance;
5994
6074
  } | {
5995
6075
  result: "downgraded";
5996
6076
  } | {
@@ -6028,6 +6108,35 @@ export interface BillingPortal {
6028
6108
  /** URL to the billing portal for an organization */
6029
6109
  url: string;
6030
6110
  }
6111
+ export interface OrganizationAIUsage {
6112
+ /**
6113
+ * Inclusive start of the queried range.
6114
+ * @format date-time
6115
+ */
6116
+ from: string;
6117
+ /**
6118
+ * Exclusive end of the queried range, capped at the current instant.
6119
+ * @format date-time
6120
+ */
6121
+ to: string;
6122
+ /** Chronological calendar buckets. Edge buckets include only the requested dates. */
6123
+ periods: {
6124
+ /**
6125
+ * UTC date at the start of this calendar bucket.
6126
+ * @format date
6127
+ */
6128
+ date: string;
6129
+ /** Total credits used in this bucket. */
6130
+ credits: number;
6131
+ features: {
6132
+ /** AI feature category with recorded credit usage. */
6133
+ feature: string;
6134
+ credits: number;
6135
+ /** Percentage of this bucket's total credits (0 to 100). */
6136
+ creditsPercent: number;
6137
+ }[];
6138
+ }[];
6139
+ }
6031
6140
  /** Usage metrics for a billing meter */
6032
6141
  export interface BillingMeterUsage {
6033
6142
  /** Total usage for the current billing period */
@@ -6438,7 +6547,7 @@ export interface Translation {
6438
6547
  stats: {
6439
6548
  /** Total number of times the translation has been run */
6440
6549
  runs: number;
6441
- /** Total number of words translated */
6550
+ /** Total number of words counted toward translation usage over all runs */
6442
6551
  totalWords: number;
6443
6552
  /** Total number of unique pages translated */
6444
6553
  totalPages: number;
@@ -6448,7 +6557,7 @@ export interface Translation {
6448
6557
  latestRunDuration: number;
6449
6558
  /** Number of unique pages translated in the latest run */
6450
6559
  latestPages: number;
6451
- /** Number of words translated in the latest run */
6560
+ /** Number of words counted toward translation usage in the latest run */
6452
6561
  latestWords: number;
6453
6562
  };
6454
6563
  permissions: {
@@ -6969,7 +7078,7 @@ export interface SiteCustomizationSettingsBase {
6969
7078
  footer: {
6970
7079
  logo?: CustomizationThemedURL;
6971
7080
  groups: CustomizationFooterGroup[];
6972
- /** @maxLength 300 */
7081
+ /** @maxLength 512 */
6973
7082
  copyright?: string;
6974
7083
  };
6975
7084
  announcement?: CustomizationAnnouncement;
@@ -7214,6 +7323,11 @@ export interface AgentFeedbackReportedBy {
7214
7323
  * @maxLength 512
7215
7324
  */
7216
7325
  userAgent?: string;
7326
+ /**
7327
+ * Identifier the surface gave the agent for the call being reported, used to find that call in the surface's own logs. Not an identifier of this report.
7328
+ * @maxLength 100
7329
+ */
7330
+ correlationId?: string;
7217
7331
  /**
7218
7332
  * Whether the user explicitly asked the agent to submit this feedback.
7219
7333
  * @default false
@@ -9087,6 +9201,7 @@ export type SiteInsightsQueryEventsValues = {
9087
9201
  values: SiteInsightsDisplayContext[];
9088
9202
  } | {
9089
9203
  column: "page";
9204
+ /** Pages to match. `null` matches events that resolved to no page, which for `page_view` events is a 404 (a broken URL). */
9090
9205
  values: (null | {
9091
9206
  page: string | null;
9092
9207
  space: string;
@@ -9880,7 +9995,15 @@ export interface GitSyncSpaceOperation {
9880
9995
  * creating a new revision.
9881
9996
  */
9882
9997
  stage: GitSyncOperationStage;
9998
+ /**
9999
+ * Always `0`. Task-level progress is no longer tracked; read `stage` instead.
10000
+ * @deprecated
10001
+ */
9883
10002
  dispatchedTasks: number;
10003
+ /**
10004
+ * Always `0`. Task-level progress is no longer tracked; read `stage` instead.
10005
+ * @deprecated
10006
+ */
9884
10007
  completedTasks: number;
9885
10008
  /** Date when the operation was started */
9886
10009
  startedAt: Timestamp;
@@ -11578,6 +11701,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
11578
11701
  * @default true
11579
11702
  */
11580
11703
  metadata?: boolean;
11704
+ /**
11705
+ * If `true` is passed, mutable Git metadata may be served from a cache.
11706
+ * @default false
11707
+ */
11708
+ cachedMetadata?: boolean;
11581
11709
  /**
11582
11710
  * If `false` is passed, content will not be computed
11583
11711
  * @default true
@@ -12571,6 +12699,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
12571
12699
  * @default true
12572
12700
  */
12573
12701
  metadata?: boolean;
12702
+ /**
12703
+ * If `true` is passed, mutable Git metadata may be served from a cache.
12704
+ * @default false
12705
+ */
12706
+ cachedMetadata?: boolean;
12574
12707
  /**
12575
12708
  * If `false` is passed, content will not be computed
12576
12709
  * @default true
@@ -12627,6 +12760,11 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
12627
12760
  * @default true
12628
12761
  */
12629
12762
  metadata?: boolean;
12763
+ /**
12764
+ * If `true` is passed, mutable Git metadata may be served from a cache.
12765
+ * @default false
12766
+ */
12767
+ cachedMetadata?: boolean;
12630
12768
  /**
12631
12769
  * If `false` is passed, content will not be computed
12632
12770
  * @default true
@@ -14394,6 +14532,29 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
14394
14532
  message: string;
14395
14533
  };
14396
14534
  }>>;
14535
+ /**
14536
+ * @description Returns recorded AI usage for an organization. Calendar buckets use UTC; weeks start on Monday. Requires organization administrator permissions.
14537
+ *
14538
+ * @tags billing
14539
+ * @name GetOrganizationAiUsage
14540
+ * @summary Get AI credit usage by AI feature and time period
14541
+ * @request GET:/orgs/{organizationId}/billing/ai-usage
14542
+ * @secure
14543
+ */
14544
+ getOrganizationAiUsage: (organizationId: EntityId, query: {
14545
+ /**
14546
+ * Inclusive start timestamp. Cannot be older than two years from now.
14547
+ * @format date-time
14548
+ */
14549
+ from: string;
14550
+ /**
14551
+ * Exclusive end timestamp.
14552
+ * @format date-time
14553
+ */
14554
+ to: string;
14555
+ /** Calendar interval used to aggregate usage. */
14556
+ interval?: AIUsageInterval;
14557
+ }, params?: RequestParams) => Promise<HttpResponse<OrganizationAIUsage, any>>;
14397
14558
  /**
14398
14559
  * No description
14399
14560
  *
@@ -17110,7 +17271,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
17110
17271
  groups?: any[] | null;
17111
17272
  /**
17112
17273
  * The copyright text that is displayed in the footer. Set to null to reset the override.
17113
- * @maxLength 300
17274
+ * @maxLength 512
17114
17275
  */
17115
17276
  copyright?: string | null;
17116
17277
  };
@@ -17514,7 +17675,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
17514
17675
  };
17515
17676
  }>>;
17516
17677
  /**
17517
- * @description Starts a style guide check: GitBook Agent reviews the given spaces against the site's style guide and proposes fixes. One draft change request is opened per space, each marked as belonging to the returned run. Fails if the site has no style guide.
17678
+ * @description Starts a style guide check: GitBook Agent reviews the given spaces against the site's style guide and proposes fixes. A space with no check open gets a new draft change request marked as belonging to the returned run; one whose check is still open has it taken over instead, so it stays marked with the run that opened it. Fails if the site has no style guide.
17518
17679
  *
17519
17680
  * @tags sites
17520
17681
  * @name CreateSiteStyleguideRun
@@ -17532,7 +17693,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
17532
17693
  }, params?: RequestParams) => Promise<HttpResponse<{
17533
17694
  /** A style guide check run: one time a user asked GitBook Agent to check a set of the site's spaces against the site's style guide, opening a change request for each. */
17534
17695
  run: SiteStyleguideRun;
17535
- /** The change requests opened by the run, one per space that could be started. */
17696
+ /** The change request each space's check runs in: opened by this run, or already open and taken over. One per space that could be started. */
17536
17697
  changeRequests: ChangeRequest[];
17537
17698
  }, {
17538
17699
  error: {
@@ -17575,7 +17736,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
17575
17736
  events: SiteInsightsEvent[];
17576
17737
  }, params?: RequestParams) => Promise<HttpResponse<void, any>>;
17577
17738
  /**
17578
- * @description Runs an aggregation query over a published site's Insights events, grouped and filtered over a time range. Use it to answer analytics questions about how visitors engage with a site's documentation.
17739
+ * @description Runs an aggregation query over a published site's Insights events, grouped and filtered over a time range. Use it to answer analytics questions about how visitors engage with a site's documentation: page views, visitors, searches, referrers, and broken URLs (404s). A 404 is a `page_view` or `search_open_result` event whose `page` is `null`, in the `site` display context; filter `eventPageNotFoundType` not in `conditional` to leave out 404s that adaptive content explains. Group by `datetime` for a trend over time and by `urlPath` for the top broken URLs.
17579
17740
  *
17580
17741
  * @tags site-insights
17581
17742
  * @name AggregateSiteEvents
@@ -100,6 +100,8 @@ export declare const BILLING_COUPON_MAX_LENGTH = 500;
100
100
  export declare const BILLING_COUPON_MIN_LENGTH = 1;
101
101
  export declare const BILLING_METER_ENUM: ["ai_responses", "ai_agent_responses", "translation_words"];
102
102
  export declare const BILLING_SWITCH_ACTION_ENUM: ["trial", "upgrade", "upgrade_passive", "downgrade", "switch_interval"];
103
+ export declare const AIUSAGE_INTERVAL_ENUM: ["day", "week", "month", "year"];
104
+ export declare const ORGANIZATION_FEATURE_ENUM: ["max-members", "ai-lens", "pdf-export", "ai-writing", "reusable-content", "translations", "members-advanced-roles", "members-teams", "members-team-owners", "security-saml", "change-requests-merge-rules"];
103
105
  export declare const SAMLPROVIDER_LABEL_MAX_LENGTH = 30;
104
106
  export declare const SAMLPROVIDER_LABEL_MIN_LENGTH = 1;
105
107
  export declare const SAMLPROVIDER_ENTITY_ID_MAX_LENGTH = 1024;
package/dist/index.cjs CHANGED
@@ -191,6 +191,8 @@ __export(src_exports, {
191
191
  AIMessageStepPhase: () => AIMessageStepPhase,
192
192
  AIMessageStepStartCondition: () => AIMessageStepStartCondition,
193
193
  AIModel: () => AIModel,
194
+ AIUSAGE_INTERVAL_ENUM: () => AIUSAGE_INTERVAL_ENUM,
195
+ AIUsageInterval: () => AIUsageInterval,
194
196
  APIINTEGRATION_SCOPE_ENUM: () => APIINTEGRATION_SCOPE_ENUM,
195
197
  APIIntegrationScope: () => APIIntegrationScope,
196
198
  APITOKEN_LABEL_MAX_LENGTH: () => APITOKEN_LABEL_MAX_LENGTH,
@@ -375,6 +377,7 @@ __export(src_exports, {
375
377
  OPEN_APISPEC_SLUG_PATTERN: () => OPEN_APISPEC_SLUG_PATTERN,
376
378
  OPEN_APISPEC_VISIBILITY_ENUM: () => OPEN_APISPEC_VISIBILITY_ENUM,
377
379
  ORGANIZATION_COMMUNITY_TYPE_ENUM: () => ORGANIZATION_COMMUNITY_TYPE_ENUM,
380
+ ORGANIZATION_FEATURE_ENUM: () => ORGANIZATION_FEATURE_ENUM,
378
381
  ORGANIZATION_HOSTNAME_MAX_LENGTH: () => ORGANIZATION_HOSTNAME_MAX_LENGTH,
379
382
  ORGANIZATION_HOSTNAME_MIN_LENGTH: () => ORGANIZATION_HOSTNAME_MIN_LENGTH,
380
383
  ORGANIZATION_TEAM_TITLE_MAX_LENGTH: () => ORGANIZATION_TEAM_TITLE_MAX_LENGTH,
@@ -388,6 +391,7 @@ __export(src_exports, {
388
391
  OpenAPISpecProcessingState: () => OpenAPISpecProcessingState,
389
392
  OpenAPISpecVisibility: () => OpenAPISpecVisibility,
390
393
  OrganizationCommunityType: () => OrganizationCommunityType,
394
+ OrganizationFeature: () => OrganizationFeature,
391
395
  OrganizationType: () => OrganizationType,
392
396
  OrganizationUseCase: () => OrganizationUseCase,
393
397
  PAGE_FEEDBACK_RATING_ENUM: () => PAGE_FEEDBACK_RATING_ENUM,
@@ -560,7 +564,7 @@ module.exports = __toCommonJS(src_exports);
560
564
 
561
565
  // package.json
562
566
  var name = "@gitbook/api";
563
- var version = "0.200.0";
567
+ var version = "0.202.0";
564
568
 
565
569
  // src/client.ts
566
570
  var import_event_iterator = __toESM(require_node(), 1);
@@ -1368,6 +1372,27 @@ var SAMLProviderStatus = /* @__PURE__ */ ((SAMLProviderStatus2) => {
1368
1372
  SAMLProviderStatus2["Pending"] = "pending";
1369
1373
  return SAMLProviderStatus2;
1370
1374
  })(SAMLProviderStatus || {});
1375
+ var OrganizationFeature = /* @__PURE__ */ ((OrganizationFeature2) => {
1376
+ OrganizationFeature2["MaxMembers"] = "max-members";
1377
+ OrganizationFeature2["AiLens"] = "ai-lens";
1378
+ OrganizationFeature2["PdfExport"] = "pdf-export";
1379
+ OrganizationFeature2["AiWriting"] = "ai-writing";
1380
+ OrganizationFeature2["ReusableContent"] = "reusable-content";
1381
+ OrganizationFeature2["Translations"] = "translations";
1382
+ OrganizationFeature2["MembersAdvancedRoles"] = "members-advanced-roles";
1383
+ OrganizationFeature2["MembersTeams"] = "members-teams";
1384
+ OrganizationFeature2["MembersTeamOwners"] = "members-team-owners";
1385
+ OrganizationFeature2["SecuritySaml"] = "security-saml";
1386
+ OrganizationFeature2["ChangeRequestsMergeRules"] = "change-requests-merge-rules";
1387
+ return OrganizationFeature2;
1388
+ })(OrganizationFeature || {});
1389
+ var AIUsageInterval = /* @__PURE__ */ ((AIUsageInterval2) => {
1390
+ AIUsageInterval2["Day"] = "day";
1391
+ AIUsageInterval2["Week"] = "week";
1392
+ AIUsageInterval2["Month"] = "month";
1393
+ AIUsageInterval2["Year"] = "year";
1394
+ return AIUsageInterval2;
1395
+ })(AIUsageInterval || {});
1371
1396
  var BillingSwitchAction = /* @__PURE__ */ ((BillingSwitchAction2) => {
1372
1397
  BillingSwitchAction2["Trial"] = "trial";
1373
1398
  BillingSwitchAction2["Upgrade"] = "upgrade";
@@ -3411,6 +3436,14 @@ var Api = class extends HttpClient {
3411
3436
  secure: true,
3412
3437
  ...params
3413
3438
  }),
3439
+ getOrganizationAiUsage: (organizationId, query, params = {}) => this.request({
3440
+ path: `/orgs/${organizationId}/billing/ai-usage`,
3441
+ method: "GET",
3442
+ query,
3443
+ secure: true,
3444
+ format: "json",
3445
+ ...params
3446
+ }),
3414
3447
  searchOrganizationContent: (organizationId, query, params = {}) => this.request({
3415
3448
  path: `/orgs/${organizationId}/search`,
3416
3449
  method: "GET",
@@ -5100,6 +5133,8 @@ var BILLING_COUPON_MAX_LENGTH = 500;
5100
5133
  var BILLING_COUPON_MIN_LENGTH = 1;
5101
5134
  var BILLING_METER_ENUM = ["ai_responses", "ai_agent_responses", "translation_words"];
5102
5135
  var BILLING_SWITCH_ACTION_ENUM = ["trial", "upgrade", "upgrade_passive", "downgrade", "switch_interval"];
5136
+ var AIUSAGE_INTERVAL_ENUM = ["day", "week", "month", "year"];
5137
+ var ORGANIZATION_FEATURE_ENUM = ["max-members", "ai-lens", "pdf-export", "ai-writing", "reusable-content", "translations", "members-advanced-roles", "members-teams", "members-team-owners", "security-saml", "change-requests-merge-rules"];
5103
5138
  var SAMLPROVIDER_LABEL_MAX_LENGTH = 30;
5104
5139
  var SAMLPROVIDER_LABEL_MIN_LENGTH = 1;
5105
5140
  var SAMLPROVIDER_ENTITY_ID_MAX_LENGTH = 1024;
@@ -5314,6 +5349,8 @@ var GitBookAPI = class extends Api {
5314
5349
  AIMessageStepPhase,
5315
5350
  AIMessageStepStartCondition,
5316
5351
  AIModel,
5352
+ AIUSAGE_INTERVAL_ENUM,
5353
+ AIUsageInterval,
5317
5354
  APIINTEGRATION_SCOPE_ENUM,
5318
5355
  APIIntegrationScope,
5319
5356
  APITOKEN_LABEL_MAX_LENGTH,
@@ -5498,6 +5535,7 @@ var GitBookAPI = class extends Api {
5498
5535
  OPEN_APISPEC_SLUG_PATTERN,
5499
5536
  OPEN_APISPEC_VISIBILITY_ENUM,
5500
5537
  ORGANIZATION_COMMUNITY_TYPE_ENUM,
5538
+ ORGANIZATION_FEATURE_ENUM,
5501
5539
  ORGANIZATION_HOSTNAME_MAX_LENGTH,
5502
5540
  ORGANIZATION_HOSTNAME_MIN_LENGTH,
5503
5541
  ORGANIZATION_TEAM_TITLE_MAX_LENGTH,
@@ -5511,6 +5549,7 @@ var GitBookAPI = class extends Api {
5511
5549
  OpenAPISpecProcessingState,
5512
5550
  OpenAPISpecVisibility,
5513
5551
  OrganizationCommunityType,
5552
+ OrganizationFeature,
5514
5553
  OrganizationType,
5515
5554
  OrganizationUseCase,
5516
5555
  PAGE_FEEDBACK_RATING_ENUM,
package/dist/index.js CHANGED
@@ -172,7 +172,7 @@ var require_node = __commonJS({
172
172
 
173
173
  // package.json
174
174
  var name = "@gitbook/api";
175
- var version = "0.200.0";
175
+ var version = "0.202.0";
176
176
 
177
177
  // src/client.ts
178
178
  var import_event_iterator = __toESM(require_node(), 1);
@@ -980,6 +980,27 @@ var SAMLProviderStatus = /* @__PURE__ */ ((SAMLProviderStatus2) => {
980
980
  SAMLProviderStatus2["Pending"] = "pending";
981
981
  return SAMLProviderStatus2;
982
982
  })(SAMLProviderStatus || {});
983
+ var OrganizationFeature = /* @__PURE__ */ ((OrganizationFeature2) => {
984
+ OrganizationFeature2["MaxMembers"] = "max-members";
985
+ OrganizationFeature2["AiLens"] = "ai-lens";
986
+ OrganizationFeature2["PdfExport"] = "pdf-export";
987
+ OrganizationFeature2["AiWriting"] = "ai-writing";
988
+ OrganizationFeature2["ReusableContent"] = "reusable-content";
989
+ OrganizationFeature2["Translations"] = "translations";
990
+ OrganizationFeature2["MembersAdvancedRoles"] = "members-advanced-roles";
991
+ OrganizationFeature2["MembersTeams"] = "members-teams";
992
+ OrganizationFeature2["MembersTeamOwners"] = "members-team-owners";
993
+ OrganizationFeature2["SecuritySaml"] = "security-saml";
994
+ OrganizationFeature2["ChangeRequestsMergeRules"] = "change-requests-merge-rules";
995
+ return OrganizationFeature2;
996
+ })(OrganizationFeature || {});
997
+ var AIUsageInterval = /* @__PURE__ */ ((AIUsageInterval2) => {
998
+ AIUsageInterval2["Day"] = "day";
999
+ AIUsageInterval2["Week"] = "week";
1000
+ AIUsageInterval2["Month"] = "month";
1001
+ AIUsageInterval2["Year"] = "year";
1002
+ return AIUsageInterval2;
1003
+ })(AIUsageInterval || {});
983
1004
  var BillingSwitchAction = /* @__PURE__ */ ((BillingSwitchAction2) => {
984
1005
  BillingSwitchAction2["Trial"] = "trial";
985
1006
  BillingSwitchAction2["Upgrade"] = "upgrade";
@@ -3023,6 +3044,14 @@ var Api = class extends HttpClient {
3023
3044
  secure: true,
3024
3045
  ...params
3025
3046
  }),
3047
+ getOrganizationAiUsage: (organizationId, query, params = {}) => this.request({
3048
+ path: `/orgs/${organizationId}/billing/ai-usage`,
3049
+ method: "GET",
3050
+ query,
3051
+ secure: true,
3052
+ format: "json",
3053
+ ...params
3054
+ }),
3026
3055
  searchOrganizationContent: (organizationId, query, params = {}) => this.request({
3027
3056
  path: `/orgs/${organizationId}/search`,
3028
3057
  method: "GET",
@@ -4712,6 +4741,8 @@ var BILLING_COUPON_MAX_LENGTH = 500;
4712
4741
  var BILLING_COUPON_MIN_LENGTH = 1;
4713
4742
  var BILLING_METER_ENUM = ["ai_responses", "ai_agent_responses", "translation_words"];
4714
4743
  var BILLING_SWITCH_ACTION_ENUM = ["trial", "upgrade", "upgrade_passive", "downgrade", "switch_interval"];
4744
+ var AIUSAGE_INTERVAL_ENUM = ["day", "week", "month", "year"];
4745
+ var ORGANIZATION_FEATURE_ENUM = ["max-members", "ai-lens", "pdf-export", "ai-writing", "reusable-content", "translations", "members-advanced-roles", "members-teams", "members-team-owners", "security-saml", "change-requests-merge-rules"];
4715
4746
  var SAMLPROVIDER_LABEL_MAX_LENGTH = 30;
4716
4747
  var SAMLPROVIDER_LABEL_MIN_LENGTH = 1;
4717
4748
  var SAMLPROVIDER_ENTITY_ID_MAX_LENGTH = 1024;
@@ -4925,6 +4956,8 @@ export {
4925
4956
  AIMessageStepPhase,
4926
4957
  AIMessageStepStartCondition,
4927
4958
  AIModel,
4959
+ AIUSAGE_INTERVAL_ENUM,
4960
+ AIUsageInterval,
4928
4961
  APIINTEGRATION_SCOPE_ENUM,
4929
4962
  APIIntegrationScope,
4930
4963
  APITOKEN_LABEL_MAX_LENGTH,
@@ -5109,6 +5142,7 @@ export {
5109
5142
  OPEN_APISPEC_SLUG_PATTERN,
5110
5143
  OPEN_APISPEC_VISIBILITY_ENUM,
5111
5144
  ORGANIZATION_COMMUNITY_TYPE_ENUM,
5145
+ ORGANIZATION_FEATURE_ENUM,
5112
5146
  ORGANIZATION_HOSTNAME_MAX_LENGTH,
5113
5147
  ORGANIZATION_HOSTNAME_MIN_LENGTH,
5114
5148
  ORGANIZATION_TEAM_TITLE_MAX_LENGTH,
@@ -5122,6 +5156,7 @@ export {
5122
5156
  OpenAPISpecProcessingState,
5123
5157
  OpenAPISpecVisibility,
5124
5158
  OrganizationCommunityType,
5159
+ OrganizationFeature,
5125
5160
  OrganizationType,
5126
5161
  OrganizationUseCase,
5127
5162
  PAGE_FEEDBACK_RATING_ENUM,
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "main": "./dist/index.cjs",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
- "version": "0.200.0",
7
+ "version": "0.202.0",
8
8
  "sideEffects": false,
9
9
  "files": [
10
10
  "README.md",