@gitbook/api 0.56.0 → 0.57.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
@@ -634,28 +634,14 @@ export interface JSONDocument {
634
634
  export declare type Document = MarkdownDocument | {
635
635
  document: JSONDocument;
636
636
  } | object;
637
- /**
638
- * Type of an entity
639
- * @minLength 1
640
- * @maxLength 64
641
- */
642
- export declare type EntityType = string;
643
637
  export declare type SearchAIAnswerSource = {
644
- type: 'page' | 'entity' | 'capture';
638
+ type: 'page' | 'capture';
645
639
  } & ({
646
640
  type: 'page';
647
641
  page: string;
648
642
  revision: string;
649
643
  space: string;
650
644
  sections: string[];
651
- } | {
652
- type: 'entity';
653
- /** ID of the entity */
654
- entityId: string;
655
- /** Type of an entity */
656
- entityType: EntityType;
657
- /** The name of the integration that manages this entity. If undefined, this entity is not managed by an integration. */
658
- integration?: string;
659
645
  } | {
660
646
  type: 'capture';
661
647
  /** ID of the capture */
@@ -1583,7 +1569,6 @@ export declare enum IntegrationVisibility {
1583
1569
  Unlisted = "unlisted"
1584
1570
  }
1585
1571
  export declare enum IntegrationScope {
1586
- EntitiesWrite = "entities:write",
1587
1572
  SnippetsRead = "snippets:read",
1588
1573
  CaptureWrite = "capture:write",
1589
1574
  SpaceViewsRead = "space:views:read",
@@ -2482,59 +2467,6 @@ export declare type CustomizationCollectionSettings = CustomizationSettings & {
2482
2467
  };
2483
2468
  /** Secrets stored on the integration and passed at runtime. */
2484
2469
  export declare type IntegrationSecrets = Record<string, string>;
2485
- /** @maxLength 50 */
2486
- export declare type EntitySchemaTitle = string;
2487
- export declare type EntityPropertySchema = {
2488
- /** Name of the property in the object */
2489
- name: string;
2490
- /** Title displayed to the users */
2491
- title: string;
2492
- /** Description of the property */
2493
- description?: string;
2494
- /** If true, the property is no longer required and not taken into consideration */
2495
- deprecated?: boolean;
2496
- } & ({
2497
- type: 'text';
2498
- role?: 'title';
2499
- } | {
2500
- type: 'longtext';
2501
- role?: 'body';
2502
- } | {
2503
- type: 'url';
2504
- role?: 'target' | 'icon';
2505
- } | {
2506
- type: 'number';
2507
- } | {
2508
- type: 'boolean';
2509
- } | {
2510
- type: 'enum';
2511
- values: {
2512
- label: string;
2513
- value: string;
2514
- }[];
2515
- } | {
2516
- type: 'date';
2517
- } | {
2518
- type: 'user';
2519
- } | {
2520
- type: 'relation';
2521
- entity: {
2522
- /** Type of an entity */
2523
- type: EntityType;
2524
- };
2525
- });
2526
- /** Schema for a type of entities */
2527
- export interface EntityRawSchema {
2528
- /** Type of an entity */
2529
- type: EntityType;
2530
- /** Title of the entity type */
2531
- title: {
2532
- singular: EntitySchemaTitle;
2533
- plural: EntitySchemaTitle;
2534
- };
2535
- /** Ordered list of all properties stored in entities. */
2536
- properties: EntityPropertySchema[];
2537
- }
2538
2470
  export interface PublishIntegration {
2539
2471
  /**
2540
2472
  * Base64 content of the icon
@@ -2572,8 +2504,6 @@ export interface PublishIntegration {
2572
2504
  * headers when processing the script fetch event and the blocks fetch events.
2573
2505
  */
2574
2506
  contentSecurityPolicy?: IntegrationContentSecurityPolicy;
2575
- /** @maxItems 100 */
2576
- entities?: EntityRawSchema[];
2577
2507
  }
2578
2508
  export declare enum IntegrationInstallationStatus {
2579
2509
  Active = "active",
@@ -3593,55 +3523,6 @@ export interface OrganizationUsage {
3593
3523
  /** Team members usage metrics of an organization */
3594
3524
  teamMembers: OrganizationUsageTeamMembers;
3595
3525
  }
3596
- export declare type EntitySchema = EntityRawSchema & {
3597
- /** Count of entities created in this schema. */
3598
- entities: number;
3599
- /** Integration managing this schema. */
3600
- integration?: Integration;
3601
- /** URLs associated with the object */
3602
- urls: {
3603
- /**
3604
- * URL of the entity schema in the API
3605
- * @format uri
3606
- */
3607
- location: string;
3608
- };
3609
- };
3610
- /**
3611
- * Unique ID of the entity in the context of the integration's entity type
3612
- * @minLength 1
3613
- * @maxLength 256
3614
- */
3615
- export declare type EntityId = string;
3616
- /** Entity to create or update in an integration's installation. */
3617
- export interface UpsertEntity {
3618
- /** Unique ID of the entity in the context of the integration's entity type */
3619
- entityId: EntityId;
3620
- /** Map of values stored as properties on the entity */
3621
- properties: Record<string, string | number | boolean | {
3622
- entityId: string;
3623
- }>;
3624
- }
3625
- /** Entity created and managed by an integration, representing an external element. */
3626
- export declare type Entity = UpsertEntity & {
3627
- /** Unique ID for the entity in GitBook */
3628
- id: string;
3629
- /**
3630
- * Type of an entity. Deprecated, use entityType.
3631
- * @deprecated
3632
- */
3633
- type: EntityType;
3634
- /** Type of an entity */
3635
- entityType: EntityType;
3636
- /** URLs associated with the object */
3637
- urls: {
3638
- /**
3639
- * URL of the entity in the API
3640
- * @format uri
3641
- */
3642
- location: string;
3643
- };
3644
- };
3645
3526
  /**
3646
3527
  * Optional title describing the capture
3647
3528
  * @maxLength 100
@@ -3993,6 +3874,7 @@ export interface SiteSpace {
3993
3874
  /** Path to the space on the site */
3994
3875
  path: SiteSpacePath;
3995
3876
  space: Space;
3877
+ title: string;
3996
3878
  /** Whether this is the default space for the site */
3997
3879
  default?: boolean;
3998
3880
  /** Whether the space has advanced customization feature enabled */
@@ -4509,10 +4391,6 @@ export interface SpacePublishingCustomizationChannel {
4509
4391
  channel: 'space-publishing-customization';
4510
4392
  space: string;
4511
4393
  }
4512
- export interface SpaceEntitiesChannel {
4513
- channel: 'space-entities';
4514
- space: string;
4515
- }
4516
4394
  export interface SpaceCustomFieldsChannel {
4517
4395
  channel: 'space-customfields';
4518
4396
  space: string;
@@ -4615,17 +4493,6 @@ export interface OrganizationCollectionsChannel {
4615
4493
  channel: 'organization-collections';
4616
4494
  organization: string;
4617
4495
  }
4618
- /** Subscription channel for entities in an organization. */
4619
- export interface OrganizationEntitiesChannel {
4620
- channel: 'organization-entities';
4621
- organization: string;
4622
- entityType: string;
4623
- }
4624
- /** Subscription channel for all entity schemas in an organization. */
4625
- export interface OrganizationSchemasChannel {
4626
- channel: 'organization-schemas';
4627
- organization: string;
4628
- }
4629
4496
  export interface OrganizationCapturesChannel {
4630
4497
  channel: 'organization-captures';
4631
4498
  organization: string;
@@ -4757,7 +4624,7 @@ export interface CustomHostnameChannel {
4757
4624
  customHostname: string;
4758
4625
  }
4759
4626
  /** Channel to subscribe to for API updates. */
4760
- export declare type SubscriptionChannel = SpaceInfoChannel | SpaceGitInfoChannel | SpacePublishingAuthChannel | SpacePublishingCustomizationChannel | SpaceEntitiesChannel | SpaceCustomFieldsChannel | SpaceBrokenLinksChannel | BackofficeUserInfoChannel | SpaceIntegrationsChannel | OrganizationCustomFieldsChannel | UserAPITokensChannel | UserOrganizationsChannel | UserProfileChannel | ChangeRequestChannel | ChangeRequestsChannel | ChangeRequestReviewsChannel | ChangeRequestBrokenLinksChannel | CollectionChannel | CollectionPublishingCustomizationChannel | OrganizationInfoChannel | OrganizationMembersChannel | OrganizationMemberChannel | OrganizationTeamsChannel | OrganizationTeamChannel | OrganizationTeamMembersChannel | OrganizationTeamMemberChannel | OrganizationSpacesChannel | OrganizationCollectionsChannel | OrganizationEntitiesChannel | OrganizationSchemasChannel | OrganizationCapturesChannel | OrganizationContentAuditsChannel | OrganizationIntegrationsChannel | OrganizationInstallationsChannel | OrganizationSitesChannel | OrganizationExperimentalFeaturesChannel | OrganizationSyncedBlockChannel | CommentsChannel | CommentInfoChannel | CommentReplyInfoChannel | CommentRepliesChannel | IntegrationChannel | IntegrationInstallationChannel | IntegrationSpaceInstallationChannel | IntegrationSpaceInstallationsChannel | IntegrationSiteInstallationChannel | IntegrationSiteInstallationsChannel | SiteChannel | SiteCustomizationChannel | SiteIntegrationsChannel | SiteSpaceChannel | SiteSpaceCustomizationChannel | SiteSpacesChannel | SitePublishingAuthChannel | SiteShareLinksChannel | SiteShareLinkChannel | CustomHostnameChannel;
4627
+ export declare type SubscriptionChannel = SpaceInfoChannel | SpaceGitInfoChannel | SpacePublishingAuthChannel | SpacePublishingCustomizationChannel | SpaceCustomFieldsChannel | SpaceBrokenLinksChannel | BackofficeUserInfoChannel | SpaceIntegrationsChannel | OrganizationCustomFieldsChannel | UserAPITokensChannel | UserOrganizationsChannel | UserProfileChannel | ChangeRequestChannel | ChangeRequestsChannel | ChangeRequestReviewsChannel | ChangeRequestBrokenLinksChannel | CollectionChannel | CollectionPublishingCustomizationChannel | OrganizationInfoChannel | OrganizationMembersChannel | OrganizationMemberChannel | OrganizationTeamsChannel | OrganizationTeamChannel | OrganizationTeamMembersChannel | OrganizationTeamMemberChannel | OrganizationSpacesChannel | OrganizationCollectionsChannel | OrganizationCapturesChannel | OrganizationContentAuditsChannel | OrganizationIntegrationsChannel | OrganizationInstallationsChannel | OrganizationSitesChannel | OrganizationExperimentalFeaturesChannel | OrganizationSyncedBlockChannel | CommentsChannel | CommentInfoChannel | CommentReplyInfoChannel | CommentRepliesChannel | IntegrationChannel | IntegrationInstallationChannel | IntegrationSpaceInstallationChannel | IntegrationSpaceInstallationsChannel | IntegrationSiteInstallationChannel | IntegrationSiteInstallationsChannel | SiteChannel | SiteCustomizationChannel | SiteIntegrationsChannel | SiteSpaceChannel | SiteSpaceCustomizationChannel | SiteSpacesChannel | SitePublishingAuthChannel | SiteShareLinksChannel | SiteShareLinkChannel | CustomHostnameChannel;
4761
4628
  export interface Seat {
4762
4629
  object: 'seat';
4763
4630
  /** The unique ID of the organization */
@@ -8199,105 +8066,6 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8199
8066
  /** Team members usage metrics of an organization */
8200
8067
  teamMembers: OrganizationUsageTeamMembers;
8201
8068
  }, Error>>;
8202
- /**
8203
- * No description
8204
- *
8205
- * @tags organizations
8206
- * @name ListEntitySchemas
8207
- * @summary List the entity schemas in an organization.
8208
- * @request GET:/orgs/{organizationId}/schemas
8209
- * @secure
8210
- */
8211
- listEntitySchemas: (organizationId: string, query?: {
8212
- /** Identifier of the page results to fetch. */
8213
- page?: string;
8214
- /**
8215
- * The number of results per page
8216
- * @min 0
8217
- * @max 1000
8218
- */
8219
- limit?: number;
8220
- }, params?: RequestParams) => Promise<HttpResponse<List & {
8221
- items: EntitySchema[];
8222
- }, Error>>;
8223
- /**
8224
- * No description
8225
- *
8226
- * @tags organizations
8227
- * @name GetEntitySchema
8228
- * @summary Get an entity schema by its type.
8229
- * @request GET:/orgs/{organizationId}/schemas/{entityType}
8230
- * @secure
8231
- */
8232
- getEntitySchema: (organizationId: string, entityType: EntityType, params?: RequestParams) => Promise<HttpResponse<EntitySchema, Error>>;
8233
- /**
8234
- * No description
8235
- *
8236
- * @tags organizations
8237
- * @name SetEntitySchema
8238
- * @summary Create or update an entity schema.
8239
- * @request PUT:/orgs/{organizationId}/schemas/{entityType}
8240
- * @secure
8241
- */
8242
- setEntitySchema: (organizationId: string, entityType: EntityType, data: EntityRawSchema, params?: RequestParams) => Promise<HttpResponse<void, Error>>;
8243
- /**
8244
- * No description
8245
- *
8246
- * @tags organizations
8247
- * @name DeleteEntitySchema
8248
- * @summary Delete an entity schema.
8249
- * @request DELETE:/orgs/{organizationId}/schemas/{entityType}
8250
- * @secure
8251
- */
8252
- deleteEntitySchema: (organizationId: string, entityType: EntityType, params?: RequestParams) => Promise<HttpResponse<void, Error>>;
8253
- /**
8254
- * No description
8255
- *
8256
- * @tags organizations
8257
- * @name ListSchemaEntities
8258
- * @summary List entities in an organization for a given type.
8259
- * @request GET:/orgs/{organizationId}/schemas/{entityType}/entities
8260
- * @secure
8261
- */
8262
- listSchemaEntities: (organizationId: string, entityType: EntityType, query?: {
8263
- /** Identifier of the page results to fetch. */
8264
- page?: string;
8265
- /**
8266
- * The number of results per page
8267
- * @min 0
8268
- * @max 1000
8269
- */
8270
- limit?: number;
8271
- /** Query to filter entities with, ex: a == 'something' && b >= 10 */
8272
- query?: string;
8273
- }, params?: RequestParams) => Promise<HttpResponse<List & {
8274
- items: Entity[];
8275
- }, Error>>;
8276
- /**
8277
- * No description
8278
- *
8279
- * @tags organizations
8280
- * @name UpsertSchemaEntities
8281
- * @summary Update/Create/Delete entities in a schema.
8282
- * @request PUT:/orgs/{organizationId}/schemas/{entityType}/entities
8283
- * @secure
8284
- */
8285
- upsertSchemaEntities: (organizationId: string, entityType: EntityType, data: {
8286
- /** If true, all entities not listed in the requests will be deleted */
8287
- delete?: boolean | EntityId[];
8288
- /** Array of entities to create/update. */
8289
- entities?: UpsertEntity[];
8290
- }, params?: RequestParams) => Promise<HttpResponse<void, Error>>;
8291
- /**
8292
- * No description
8293
- *
8294
- * @tags organizations
8295
- * @name GetEntity
8296
- * @summary Get an entity using its ID.
8297
- * @request GET:/orgs/{organizationId}/schemas/{entityType}/entities/{entityId}
8298
- * @secure
8299
- */
8300
- getEntity: (organizationId: string, entityType: EntityType, entityId: EntityId, params?: RequestParams) => Promise<HttpResponse<Entity, Error>>;
8301
8069
  /**
8302
8070
  * @description List captures in an organization, newest first.
8303
8071
  *
@@ -8909,6 +8677,12 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8909
8677
  /** The app screen URL to bring the user back to after a canceled checkout. */
8910
8678
  cancelReturnURL?: string;
8911
8679
  }, params?: RequestParams) => Promise<HttpResponse<{
8680
+ /** User must checkout to complete the update. */
8681
+ type: 'checkout';
8682
+ /** Stripe payment session ID */
8683
+ sessionId: string;
8684
+ } | {
8685
+ /** User needs to go through the legacy update flow. */
8912
8686
  type: 'legacy-checkout';
8913
8687
  /** Stripe payment session ID */
8914
8688
  sessionId: string;
@@ -8931,12 +8705,9 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8931
8705
  }, params?: RequestParams) => Promise<HttpResponse<{
8932
8706
  /** User can go ahead with the update without any billing. */
8933
8707
  type: 'update';
8934
- downgrade?: object;
8935
8708
  } | {
8936
8709
  /** User must checkout to complete the update. */
8937
8710
  type: 'checkout';
8938
- /** Stripe payment session ID */
8939
- sessionId: string;
8940
8711
  } | {
8941
8712
  /** User cannot proceed with the update due to lack of permissions. */
8942
8713
  type: 'no-permissions';
package/dist/index.cjs CHANGED
@@ -238,7 +238,7 @@ module.exports = __toCommonJS(src_exports);
238
238
 
239
239
  // package.json
240
240
  var name = "@gitbook/api";
241
- var version = "0.56.0";
241
+ var version = "0.57.0";
242
242
 
243
243
  // src/client.ts
244
244
  var import_event_iterator = __toESM(require_node(), 1);
@@ -467,7 +467,6 @@ var IntegrationVisibility = /* @__PURE__ */ ((IntegrationVisibility2) => {
467
467
  return IntegrationVisibility2;
468
468
  })(IntegrationVisibility || {});
469
469
  var IntegrationScope = /* @__PURE__ */ ((IntegrationScope2) => {
470
- IntegrationScope2["EntitiesWrite"] = "entities:write";
471
470
  IntegrationScope2["SnippetsRead"] = "snippets:read";
472
471
  IntegrationScope2["CaptureWrite"] = "capture:write";
473
472
  IntegrationScope2["SpaceViewsRead"] = "space:views:read";
@@ -2570,58 +2569,6 @@ var Api = class extends HttpClient {
2570
2569
  format: "json",
2571
2570
  ...params
2572
2571
  }),
2573
- listEntitySchemas: (organizationId, query, params = {}) => this.request({
2574
- path: `/orgs/${organizationId}/schemas`,
2575
- method: "GET",
2576
- query,
2577
- secure: true,
2578
- format: "json",
2579
- ...params
2580
- }),
2581
- getEntitySchema: (organizationId, entityType, params = {}) => this.request({
2582
- path: `/orgs/${organizationId}/schemas/${entityType}`,
2583
- method: "GET",
2584
- secure: true,
2585
- format: "json",
2586
- ...params
2587
- }),
2588
- setEntitySchema: (organizationId, entityType, data, params = {}) => this.request({
2589
- path: `/orgs/${organizationId}/schemas/${entityType}`,
2590
- method: "PUT",
2591
- body: data,
2592
- secure: true,
2593
- type: "application/json" /* Json */,
2594
- ...params
2595
- }),
2596
- deleteEntitySchema: (organizationId, entityType, params = {}) => this.request({
2597
- path: `/orgs/${organizationId}/schemas/${entityType}`,
2598
- method: "DELETE",
2599
- secure: true,
2600
- ...params
2601
- }),
2602
- listSchemaEntities: (organizationId, entityType, query, params = {}) => this.request({
2603
- path: `/orgs/${organizationId}/schemas/${entityType}/entities`,
2604
- method: "GET",
2605
- query,
2606
- secure: true,
2607
- format: "json",
2608
- ...params
2609
- }),
2610
- upsertSchemaEntities: (organizationId, entityType, data, params = {}) => this.request({
2611
- path: `/orgs/${organizationId}/schemas/${entityType}/entities`,
2612
- method: "PUT",
2613
- body: data,
2614
- secure: true,
2615
- type: "application/json" /* Json */,
2616
- ...params
2617
- }),
2618
- getEntity: (organizationId, entityType, entityId, params = {}) => this.request({
2619
- path: `/orgs/${organizationId}/schemas/${entityType}/entities/${entityId}`,
2620
- method: "GET",
2621
- secure: true,
2622
- format: "json",
2623
- ...params
2624
- }),
2625
2572
  listCaptures: (organizationId, query, params = {}) => this.request({
2626
2573
  path: `/orgs/${organizationId}/captures`,
2627
2574
  method: "GET",
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.56.0";
175
+ var version = "0.57.0";
176
176
 
177
177
  // src/client.ts
178
178
  var import_event_iterator = __toESM(require_node(), 1);
@@ -401,7 +401,6 @@ var IntegrationVisibility = /* @__PURE__ */ ((IntegrationVisibility2) => {
401
401
  return IntegrationVisibility2;
402
402
  })(IntegrationVisibility || {});
403
403
  var IntegrationScope = /* @__PURE__ */ ((IntegrationScope2) => {
404
- IntegrationScope2["EntitiesWrite"] = "entities:write";
405
404
  IntegrationScope2["SnippetsRead"] = "snippets:read";
406
405
  IntegrationScope2["CaptureWrite"] = "capture:write";
407
406
  IntegrationScope2["SpaceViewsRead"] = "space:views:read";
@@ -2504,58 +2503,6 @@ var Api = class extends HttpClient {
2504
2503
  format: "json",
2505
2504
  ...params
2506
2505
  }),
2507
- listEntitySchemas: (organizationId, query, params = {}) => this.request({
2508
- path: `/orgs/${organizationId}/schemas`,
2509
- method: "GET",
2510
- query,
2511
- secure: true,
2512
- format: "json",
2513
- ...params
2514
- }),
2515
- getEntitySchema: (organizationId, entityType, params = {}) => this.request({
2516
- path: `/orgs/${organizationId}/schemas/${entityType}`,
2517
- method: "GET",
2518
- secure: true,
2519
- format: "json",
2520
- ...params
2521
- }),
2522
- setEntitySchema: (organizationId, entityType, data, params = {}) => this.request({
2523
- path: `/orgs/${organizationId}/schemas/${entityType}`,
2524
- method: "PUT",
2525
- body: data,
2526
- secure: true,
2527
- type: "application/json" /* Json */,
2528
- ...params
2529
- }),
2530
- deleteEntitySchema: (organizationId, entityType, params = {}) => this.request({
2531
- path: `/orgs/${organizationId}/schemas/${entityType}`,
2532
- method: "DELETE",
2533
- secure: true,
2534
- ...params
2535
- }),
2536
- listSchemaEntities: (organizationId, entityType, query, params = {}) => this.request({
2537
- path: `/orgs/${organizationId}/schemas/${entityType}/entities`,
2538
- method: "GET",
2539
- query,
2540
- secure: true,
2541
- format: "json",
2542
- ...params
2543
- }),
2544
- upsertSchemaEntities: (organizationId, entityType, data, params = {}) => this.request({
2545
- path: `/orgs/${organizationId}/schemas/${entityType}/entities`,
2546
- method: "PUT",
2547
- body: data,
2548
- secure: true,
2549
- type: "application/json" /* Json */,
2550
- ...params
2551
- }),
2552
- getEntity: (organizationId, entityType, entityId, params = {}) => this.request({
2553
- path: `/orgs/${organizationId}/schemas/${entityType}/entities/${entityId}`,
2554
- method: "GET",
2555
- secure: true,
2556
- format: "json",
2557
- ...params
2558
- }),
2559
2506
  listCaptures: (organizationId, query, params = {}) => this.request({
2560
2507
  path: `/orgs/${organizationId}/captures`,
2561
2508
  method: "GET",
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.56.0",
7
+ "version": "0.57.0",
8
8
  "sideEffects": false,
9
9
  "files": [
10
10
  "README.md",