@gitbook/api 0.27.0 → 0.28.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
@@ -450,6 +450,21 @@ export declare type PublishedContentLookup = {
450
450
  /** Short-lived API token to fetch content related to the space in the context of the URL. */
451
451
  apiToken: string;
452
452
  };
453
+ export interface SpacePointer {
454
+ type: 'space';
455
+ /** Unique identifier for the space */
456
+ space: string;
457
+ }
458
+ export interface CollectionPointer {
459
+ type: 'collection';
460
+ /** Unique identifier for the collection */
461
+ collection: string;
462
+ }
463
+ /** Position at which to insert an item */
464
+ export interface ContentPosition {
465
+ before?: SpacePointer | CollectionPointer;
466
+ after?: SpacePointer | CollectionPointer;
467
+ }
453
468
  export declare type Document = MarkdownDocument | {
454
469
  document: JSONDocument;
455
470
  } | object;
@@ -459,7 +474,11 @@ export interface MarkdownDocument {
459
474
  }
460
475
  export interface JSONDocument {
461
476
  object: 'document';
462
- data: object;
477
+ data: {
478
+ /** The schema version of the document. If undefined, the document is considered to be of the latest schema version. */
479
+ schemaVersion?: number;
480
+ [key: string]: any;
481
+ };
463
482
  nodes: DocumentBlocksTopLevels[];
464
483
  }
465
484
  export declare type DocumentBlock = DocumentBlockParagraph | DocumentBlockHeading | DocumentBlockListOrdered | DocumentBlockListUnordered | DocumentBlockListTasks | DocumentBlockListItem | DocumentBlockDivider | DocumentBlockQuote | DocumentBlockHint | DocumentBlockImages | DocumentBlockImage | DocumentBlockFile | DocumentBlockDrawing | DocumentBlockEmbed | DocumentBlockCode | DocumentBlockCodeLine | DocumentBlockMath | DocumentBlockExpandable | DocumentBlockTabs | DocumentBlockTabsItem | DocumentBlockTable | DocumentBlockSwagger | DocumentBlockContentRef | DocumentBlockIntegration;
@@ -1421,6 +1440,10 @@ export interface Organization {
1421
1440
  type: OrganizationType;
1422
1441
  useCase?: OrganizationUseCase;
1423
1442
  communityType?: OrganizationCommunityType;
1443
+ /** The role of a member in an organization, null for guests */
1444
+ defaultRole?: MemberRoleOrGuest;
1445
+ /** The default content for the organization */
1446
+ defaultContent?: OrganizationDefaultContent;
1424
1447
  /** URLs associated with the object */
1425
1448
  urls: {
1426
1449
  /**
@@ -1555,6 +1578,8 @@ export interface OrganizationTeamMember {
1555
1578
  organization: OrganizationMember;
1556
1579
  team: TeamMember;
1557
1580
  }
1581
+ /** The default content for the organization */
1582
+ export declare type OrganizationDefaultContent = SpacePointer | CollectionPointer;
1558
1583
  export interface Capture {
1559
1584
  /** Unique identifier for the capture */
1560
1585
  id: string;
@@ -2013,8 +2038,7 @@ export interface AnalyticsContentPages {
2013
2038
  }
2014
2039
  /** Page entry in the content analytics. */
2015
2040
  export interface AnalyticsContentPage {
2016
- page: string;
2017
- title: string;
2041
+ page: RevisionPageDocument;
2018
2042
  pageViews: number;
2019
2043
  feedbacks?: {
2020
2044
  /** Score based on each rating (+1 for 'good', -0.5 for 'ok', -2 for 'bad'). */
@@ -2394,8 +2418,19 @@ export interface IntegrationEnvironment {
2394
2418
  spaceInstallation?: IntegrationSpaceInstallation;
2395
2419
  /** Secrets stored on the integration and passed at runtime. */
2396
2420
  secrets: IntegrationSecrets;
2397
- /** Secret that can be used to verify the authenticity of incoming HTTP requests to the integration. */
2421
+ /**
2422
+ * Secret that can be used to verify the authenticity of incoming HTTP requests to the integration.
2423
+ * @deprecated
2424
+ */
2398
2425
  signingSecret?: string;
2426
+ signingSecrets: {
2427
+ /** Secret that can be used to verify the authenticity of incoming HTTP requests to the integration. */
2428
+ integration: string;
2429
+ /** Secret that can be used to verify the authenticity of incoming HTTP requests to the installation. */
2430
+ installation?: string;
2431
+ /** Secret that can be used to verify the authenticity of incoming HTTP requests to the space installation. */
2432
+ spaceInstallation?: string;
2433
+ };
2399
2434
  /** URL of the HTTP API */
2400
2435
  apiEndpoint: string;
2401
2436
  apiTokens: {
@@ -3948,6 +3983,64 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
3948
3983
  * @secure
3949
3984
  */
3950
3985
  restoreSpace: (spaceId: string, params?: RequestParams) => Promise<HttpResponse<Space, Error>>;
3986
+ /**
3987
+ * No description
3988
+ *
3989
+ * @tags spaces
3990
+ * @name MoveSpace
3991
+ * @summary Move a space to a new position.
3992
+ * @request POST:/spaces/{spaceId}/move
3993
+ * @secure
3994
+ */
3995
+ moveSpace: (spaceId: string, data: {
3996
+ /** The unique id of the parent collection */
3997
+ parent?: string | null;
3998
+ /** Where to move the space. By default, it will be moved at the end. */
3999
+ position?: ContentPosition;
4000
+ }, params?: RequestParams) => Promise<HttpResponse<Space, Error | {
4001
+ error: {
4002
+ /** @format int32 */
4003
+ code: 400;
4004
+ message: string;
4005
+ };
4006
+ } | {
4007
+ error: {
4008
+ /** @format int32 */
4009
+ code: 404;
4010
+ message: string;
4011
+ };
4012
+ } | {
4013
+ error: {
4014
+ /** @format int32 */
4015
+ code: 409;
4016
+ message: string;
4017
+ };
4018
+ }>>;
4019
+ /**
4020
+ * No description
4021
+ *
4022
+ * @tags spaces
4023
+ * @name TransferSpace
4024
+ * @summary Transfer a space to another organization, collection or both.
4025
+ * @request POST:/spaces/{spaceId}/transfer
4026
+ * @secure
4027
+ */
4028
+ transferSpace: (spaceId: string, data: {
4029
+ /** The unique id of the target organization */
4030
+ organization: string;
4031
+ }, params?: RequestParams) => Promise<HttpResponse<Space, Error | {
4032
+ error: {
4033
+ /** @format int32 */
4034
+ code: 404;
4035
+ message: string;
4036
+ };
4037
+ } | {
4038
+ error: {
4039
+ /** @format int32 */
4040
+ code: 409;
4041
+ message: string;
4042
+ };
4043
+ }>>;
3951
4044
  /**
3952
4045
  * No description
3953
4046
  *
@@ -5047,6 +5140,64 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
5047
5140
  }, params?: RequestParams) => Promise<HttpResponse<List & {
5048
5141
  items: Space[];
5049
5142
  }, Error>>;
5143
+ /**
5144
+ * No description
5145
+ *
5146
+ * @tags collections
5147
+ * @name MoveCollection
5148
+ * @summary Move a collection to a new position.
5149
+ * @request POST:/collections/{collectionId}/move
5150
+ * @secure
5151
+ */
5152
+ moveCollection: (collectionId: string, data: {
5153
+ /** The unique id of the parent collection */
5154
+ parent?: string | null;
5155
+ /** Where to move the collection. By default, it will be moved at the end. */
5156
+ position?: ContentPosition;
5157
+ }, params?: RequestParams) => Promise<HttpResponse<Collection, Error | {
5158
+ error: {
5159
+ /** @format int32 */
5160
+ code: 400;
5161
+ message: string;
5162
+ };
5163
+ } | {
5164
+ error: {
5165
+ /** @format int32 */
5166
+ code: 404;
5167
+ message: string;
5168
+ };
5169
+ } | {
5170
+ error: {
5171
+ /** @format int32 */
5172
+ code: 409;
5173
+ message: string;
5174
+ };
5175
+ }>>;
5176
+ /**
5177
+ * No description
5178
+ *
5179
+ * @tags collections
5180
+ * @name TransferCollection
5181
+ * @summary Transfer a collection to another organization.
5182
+ * @request POST:/collections/{collectionId}/transfer
5183
+ * @secure
5184
+ */
5185
+ transferCollection: (collectionId: string, data: {
5186
+ /** The unique id of the target organization */
5187
+ organization: string;
5188
+ }, params?: RequestParams) => Promise<HttpResponse<Collection, Error | {
5189
+ error: {
5190
+ /** @format int32 */
5191
+ code: 404;
5192
+ message: string;
5193
+ };
5194
+ } | {
5195
+ error: {
5196
+ /** @format int32 */
5197
+ code: 409;
5198
+ message: string;
5199
+ };
5200
+ }>>;
5050
5201
  /**
5051
5202
  * No description
5052
5203
  *
@@ -5562,6 +5713,29 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
5562
5713
  message: string;
5563
5714
  };
5564
5715
  }>>;
5716
+ /**
5717
+ * No description
5718
+ *
5719
+ * @tags organizations
5720
+ * @name UpdateOrganizationById
5721
+ * @summary Update an organization by its ID
5722
+ * @request PATCH:/orgs/{organizationId}
5723
+ * @secure
5724
+ */
5725
+ updateOrganizationById: (organizationId: string, data: {
5726
+ /** Name of the organization */
5727
+ title?: OrganizationTitle;
5728
+ emailDomains?: OrganizationEmailDomains;
5729
+ /** The role of a member in an organization, null for guests */
5730
+ defaultRole?: MemberRoleOrGuest;
5731
+ defaultContent?: OrganizationDefaultContent | null;
5732
+ }, params?: RequestParams) => Promise<HttpResponse<Organization, Error | {
5733
+ error: {
5734
+ /** @format int32 */
5735
+ code: 400;
5736
+ message: string;
5737
+ };
5738
+ }>>;
5565
5739
  /**
5566
5740
  * @description Lists members for the specified organization.
5567
5741
  *
package/dist/index.cjs CHANGED
@@ -70,7 +70,7 @@ module.exports = __toCommonJS(src_exports);
70
70
 
71
71
  // package.json
72
72
  var name = "@gitbook/api";
73
- var version = "0.27.0";
73
+ var version = "0.28.0";
74
74
 
75
75
  // src/client.ts
76
76
  var ContentVisibility = /* @__PURE__ */ ((ContentVisibility2) => {
@@ -630,6 +630,24 @@ var Api = class extends HttpClient {
630
630
  format: "json",
631
631
  ...params
632
632
  }),
633
+ moveSpace: (spaceId, data, params = {}) => this.request({
634
+ path: `/spaces/${spaceId}/move`,
635
+ method: "POST",
636
+ body: data,
637
+ secure: true,
638
+ type: "application/json" /* Json */,
639
+ format: "json",
640
+ ...params
641
+ }),
642
+ transferSpace: (spaceId, data, params = {}) => this.request({
643
+ path: `/spaces/${spaceId}/transfer`,
644
+ method: "POST",
645
+ body: data,
646
+ secure: true,
647
+ type: "application/json" /* Json */,
648
+ format: "json",
649
+ ...params
650
+ }),
633
651
  searchSpaceContent: (spaceId, query, params = {}) => this.request({
634
652
  path: `/spaces/${spaceId}/search`,
635
653
  method: "GET",
@@ -1268,6 +1286,24 @@ var Api = class extends HttpClient {
1268
1286
  format: "json",
1269
1287
  ...params
1270
1288
  }),
1289
+ moveCollection: (collectionId, data, params = {}) => this.request({
1290
+ path: `/collections/${collectionId}/move`,
1291
+ method: "POST",
1292
+ body: data,
1293
+ secure: true,
1294
+ type: "application/json" /* Json */,
1295
+ format: "json",
1296
+ ...params
1297
+ }),
1298
+ transferCollection: (collectionId, data, params = {}) => this.request({
1299
+ path: `/collections/${collectionId}/transfer`,
1300
+ method: "POST",
1301
+ body: data,
1302
+ secure: true,
1303
+ type: "application/json" /* Json */,
1304
+ format: "json",
1305
+ ...params
1306
+ }),
1271
1307
  listPermissionsAggregateInCollection: (collectionId, query, params = {}) => this.request({
1272
1308
  path: `/collections/${collectionId}/permissions/aggregate`,
1273
1309
  method: "GET",
@@ -1519,6 +1555,15 @@ var Api = class extends HttpClient {
1519
1555
  secure: true,
1520
1556
  ...params
1521
1557
  }),
1558
+ updateOrganizationById: (organizationId, data, params = {}) => this.request({
1559
+ path: `/orgs/${organizationId}`,
1560
+ method: "PATCH",
1561
+ body: data,
1562
+ secure: true,
1563
+ type: "application/json" /* Json */,
1564
+ format: "json",
1565
+ ...params
1566
+ }),
1522
1567
  listMembersInOrganizationById: (organizationId, query, params = {}) => this.request({
1523
1568
  path: `/orgs/${organizationId}/members`,
1524
1569
  method: "GET",
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  // package.json
2
2
  var name = "@gitbook/api";
3
- var version = "0.27.0";
3
+ var version = "0.28.0";
4
4
 
5
5
  // src/client.ts
6
6
  var ContentVisibility = /* @__PURE__ */ ((ContentVisibility2) => {
@@ -560,6 +560,24 @@ var Api = class extends HttpClient {
560
560
  format: "json",
561
561
  ...params
562
562
  }),
563
+ moveSpace: (spaceId, data, params = {}) => this.request({
564
+ path: `/spaces/${spaceId}/move`,
565
+ method: "POST",
566
+ body: data,
567
+ secure: true,
568
+ type: "application/json" /* Json */,
569
+ format: "json",
570
+ ...params
571
+ }),
572
+ transferSpace: (spaceId, data, params = {}) => this.request({
573
+ path: `/spaces/${spaceId}/transfer`,
574
+ method: "POST",
575
+ body: data,
576
+ secure: true,
577
+ type: "application/json" /* Json */,
578
+ format: "json",
579
+ ...params
580
+ }),
563
581
  searchSpaceContent: (spaceId, query, params = {}) => this.request({
564
582
  path: `/spaces/${spaceId}/search`,
565
583
  method: "GET",
@@ -1198,6 +1216,24 @@ var Api = class extends HttpClient {
1198
1216
  format: "json",
1199
1217
  ...params
1200
1218
  }),
1219
+ moveCollection: (collectionId, data, params = {}) => this.request({
1220
+ path: `/collections/${collectionId}/move`,
1221
+ method: "POST",
1222
+ body: data,
1223
+ secure: true,
1224
+ type: "application/json" /* Json */,
1225
+ format: "json",
1226
+ ...params
1227
+ }),
1228
+ transferCollection: (collectionId, data, params = {}) => this.request({
1229
+ path: `/collections/${collectionId}/transfer`,
1230
+ method: "POST",
1231
+ body: data,
1232
+ secure: true,
1233
+ type: "application/json" /* Json */,
1234
+ format: "json",
1235
+ ...params
1236
+ }),
1201
1237
  listPermissionsAggregateInCollection: (collectionId, query, params = {}) => this.request({
1202
1238
  path: `/collections/${collectionId}/permissions/aggregate`,
1203
1239
  method: "GET",
@@ -1449,6 +1485,15 @@ var Api = class extends HttpClient {
1449
1485
  secure: true,
1450
1486
  ...params
1451
1487
  }),
1488
+ updateOrganizationById: (organizationId, data, params = {}) => this.request({
1489
+ path: `/orgs/${organizationId}`,
1490
+ method: "PATCH",
1491
+ body: data,
1492
+ secure: true,
1493
+ type: "application/json" /* Json */,
1494
+ format: "json",
1495
+ ...params
1496
+ }),
1452
1497
  listMembersInOrganizationById: (organizationId, query, params = {}) => this.request({
1453
1498
  path: `/orgs/${organizationId}/members`,
1454
1499
  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.27.0",
7
+ "version": "0.28.0",
8
8
  "sideEffects": false,
9
9
  "files": [
10
10
  "README.md",