@gitbook/api 0.166.0 → 0.167.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.
@@ -1,5 +1,6 @@
1
1
  export declare const APITOKEN_LABEL_MAX_LENGTH = 50;
2
2
  export declare const URL_MAX_LENGTH = 2048;
3
+ export declare const ENTITY_ID_PATTERN = "^[a-zA-Z0-9_-]+$";
3
4
  export declare const SPACE_TITLE_MAX_LENGTH = 50;
4
5
  export declare const EMOJI_MAX_LENGTH = 50;
5
6
  export declare const CONTENT_VISIBILITY_ENUM: ["public", "unlisted", "share-link", "visitor-auth", "in-collection", "private"];
@@ -142,10 +143,11 @@ export declare const SITE_ISSUE_STATUS_ENUM: ["open", "done", "canceled"];
142
143
  export declare const SITE_ISSUE_TYPE_ENUM: ["content-outdated", "incoherence", "content-gap", "other"];
143
144
  export declare const SITE_ISSUE_PRIORITY_ENUM: ["low", "medium", "high"];
144
145
  export declare const SITE_ISSUE_TITLE_MAX_LENGTH = 256;
146
+ export declare const SITE_QUESTION_TYPE_ENUM: ["exploring", "how-to", "troubleshooting", "reference", "unknown"];
145
147
  export declare const CONTEXT_CONNECTION_LABEL_MAX_LENGTH = 128;
146
148
  export declare const CONTEXT_CONNECTION_LABEL_MIN_LENGTH = 0;
147
149
  export declare const CONTEXT_CONNECTION_STATUS_ENUM: ["pending", "syncing", "succeeded", "failed"];
148
- export declare const SITE_QUESTION_TYPE_ENUM: ["exploring", "how-to", "troubleshooting", "reference", "unknown"];
150
+ export declare const CONTEXT_SEARCH_BOOST_ENUM: ["x0.8", "x1.0", "x1.2"];
149
151
  export declare const SITE_QUESTION_ANSWER_RESOLUTION_ENUM: ["no", "partially", "yes"];
150
152
  export declare const SITE_QUESTION_ANSWER_RELEVANCE_ENUM: ["relevant", "spam", "off-topic", "unclear"];
151
153
  export declare const SITE_QUESTION_ANSWER_HELPFULNESS_ENUM: ["low", "medium", "high"];
package/dist/index.cjs CHANGED
@@ -231,6 +231,7 @@ __export(src_exports, {
231
231
  CONTEXT_RECORD_TITLE_MAX_LENGTH: () => CONTEXT_RECORD_TITLE_MAX_LENGTH,
232
232
  CONTEXT_RECORD_TITLE_MIN_LENGTH: () => CONTEXT_RECORD_TITLE_MIN_LENGTH,
233
233
  CONTEXT_RECORD_TYPE_ENUM: () => CONTEXT_RECORD_TYPE_ENUM,
234
+ CONTEXT_SEARCH_BOOST_ENUM: () => CONTEXT_SEARCH_BOOST_ENUM,
234
235
  CUSTOMIZATION_AIMODE_ENUM: () => CUSTOMIZATION_AIMODE_ENUM,
235
236
  CUSTOMIZATION_ANNOUNCEMENT_MESSAGE_MAX_LENGTH: () => CUSTOMIZATION_ANNOUNCEMENT_MESSAGE_MAX_LENGTH,
236
237
  CUSTOMIZATION_ANNOUNCEMENT_MESSAGE_MIN_LENGTH: () => CUSTOMIZATION_ANNOUNCEMENT_MESSAGE_MIN_LENGTH,
@@ -269,6 +270,7 @@ __export(src_exports, {
269
270
  ContentVisibility: () => ContentVisibility,
270
271
  ContextConnectionStatus: () => ContextConnectionStatus,
271
272
  ContextRecordType: () => ContextRecordType,
273
+ ContextSearchBoost: () => ContextSearchBoost,
272
274
  CustomHostnameDnsStatus: () => CustomHostnameDnsStatus,
273
275
  CustomHostnameErrorStatus: () => CustomHostnameErrorStatus,
274
276
  CustomHostnameSslStatus: () => CustomHostnameSslStatus,
@@ -291,6 +293,7 @@ __export(src_exports, {
291
293
  DOCUMENT_TEXT_COLOR_ENUM: () => DOCUMENT_TEXT_COLOR_ENUM,
292
294
  DocumentTextColor: () => DocumentTextColor,
293
295
  EMOJI_MAX_LENGTH: () => EMOJI_MAX_LENGTH,
296
+ ENTITY_ID_PATTERN: () => ENTITY_ID_PATTERN,
294
297
  EXPRESSION_MAX_LENGTH: () => EXPRESSION_MAX_LENGTH,
295
298
  EXPRESSION_MIN_LENGTH: () => EXPRESSION_MIN_LENGTH,
296
299
  FONT_FAMILY_MAX_LENGTH: () => FONT_FAMILY_MAX_LENGTH,
@@ -483,7 +486,7 @@ module.exports = __toCommonJS(src_exports);
483
486
 
484
487
  // package.json
485
488
  var name = "@gitbook/api";
486
- var version = "0.166.0";
489
+ var version = "0.167.0";
487
490
 
488
491
  // src/client.ts
489
492
  var import_event_iterator = __toESM(require_node(), 1);
@@ -862,6 +865,19 @@ var SiteQuestionAnswerResolution = /* @__PURE__ */ ((SiteQuestionAnswerResolutio
862
865
  SiteQuestionAnswerResolution2["Yes"] = "yes";
863
866
  return SiteQuestionAnswerResolution2;
864
867
  })(SiteQuestionAnswerResolution || {});
868
+ var ContextSearchBoost = /* @__PURE__ */ ((ContextSearchBoost2) => {
869
+ ContextSearchBoost2["X08"] = "x0.8";
870
+ ContextSearchBoost2["X10"] = "x1.0";
871
+ ContextSearchBoost2["X12"] = "x1.2";
872
+ return ContextSearchBoost2;
873
+ })(ContextSearchBoost || {});
874
+ var ContextConnectionStatus = /* @__PURE__ */ ((ContextConnectionStatus2) => {
875
+ ContextConnectionStatus2["Pending"] = "pending";
876
+ ContextConnectionStatus2["Syncing"] = "syncing";
877
+ ContextConnectionStatus2["Succeeded"] = "succeeded";
878
+ ContextConnectionStatus2["Failed"] = "failed";
879
+ return ContextConnectionStatus2;
880
+ })(ContextConnectionStatus || {});
865
881
  var SiteQuestionType = /* @__PURE__ */ ((SiteQuestionType2) => {
866
882
  SiteQuestionType2["Exploring"] = "exploring";
867
883
  SiteQuestionType2["HowTo"] = "how-to";
@@ -870,13 +886,6 @@ var SiteQuestionType = /* @__PURE__ */ ((SiteQuestionType2) => {
870
886
  SiteQuestionType2["Unknown"] = "unknown";
871
887
  return SiteQuestionType2;
872
888
  })(SiteQuestionType || {});
873
- var ContextConnectionStatus = /* @__PURE__ */ ((ContextConnectionStatus2) => {
874
- ContextConnectionStatus2["Pending"] = "pending";
875
- ContextConnectionStatus2["Syncing"] = "syncing";
876
- ContextConnectionStatus2["Succeeded"] = "succeeded";
877
- ContextConnectionStatus2["Failed"] = "failed";
878
- return ContextConnectionStatus2;
879
- })(ContextConnectionStatus || {});
880
889
  var SiteIssuePriority = /* @__PURE__ */ ((SiteIssuePriority2) => {
881
890
  SiteIssuePriority2["Low"] = "low";
882
891
  SiteIssuePriority2["Medium"] = "medium";
@@ -3839,6 +3848,53 @@ var Api = class extends HttpClient {
3839
3848
  format: "json",
3840
3849
  ...params
3841
3850
  }),
3851
+ updateSiteIssueById: (organizationId, siteId, siteIssueId, data, params = {}) => this.request({
3852
+ path: `/orgs/${organizationId}/sites/${siteId}/issues/${siteIssueId}`,
3853
+ method: "PATCH",
3854
+ body: data,
3855
+ secure: true,
3856
+ type: "application/json" /* Json */,
3857
+ format: "json",
3858
+ ...params
3859
+ }),
3860
+ listChangeRequestsForSiteIssue: (organizationId, siteId, siteIssueId, query, params = {}) => this.request({
3861
+ path: `/orgs/${organizationId}/sites/${siteId}/issues/${siteIssueId}/change-requests`,
3862
+ method: "GET",
3863
+ query,
3864
+ secure: true,
3865
+ format: "json",
3866
+ ...params
3867
+ }),
3868
+ triggerChangeRequestsForSiteIssue: (organizationId, siteId, siteIssueId, params = {}) => this.request({
3869
+ path: `/orgs/${organizationId}/sites/${siteId}/issues/${siteIssueId}/change-requests`,
3870
+ method: "POST",
3871
+ secure: true,
3872
+ ...params
3873
+ }),
3874
+ listPagesForSiteIssue: (organizationId, siteId, siteIssueId, query, params = {}) => this.request({
3875
+ path: `/orgs/${organizationId}/sites/${siteId}/issues/${siteIssueId}/pages`,
3876
+ method: "GET",
3877
+ query,
3878
+ secure: true,
3879
+ format: "json",
3880
+ ...params
3881
+ }),
3882
+ listQuestionsForSiteIssue: (organizationId, siteId, siteIssueId, query, params = {}) => this.request({
3883
+ path: `/orgs/${organizationId}/sites/${siteId}/issues/${siteIssueId}/questions`,
3884
+ method: "GET",
3885
+ query,
3886
+ secure: true,
3887
+ format: "json",
3888
+ ...params
3889
+ }),
3890
+ listRecordsForSiteIssue: (organizationId, siteId, siteIssueId, query, params = {}) => this.request({
3891
+ path: `/orgs/${organizationId}/sites/${siteId}/issues/${siteIssueId}/records`,
3892
+ method: "GET",
3893
+ query,
3894
+ secure: true,
3895
+ format: "json",
3896
+ ...params
3897
+ }),
3842
3898
  listSiteContextConnections: (organizationId, siteId, query, params = {}) => this.request({
3843
3899
  path: `/orgs/${organizationId}/sites/${siteId}/context-connections`,
3844
3900
  method: "GET",
@@ -4374,6 +4430,7 @@ var GitBookAPIError = class extends Error {
4374
4430
  // src/constants.ts
4375
4431
  var APITOKEN_LABEL_MAX_LENGTH = 50;
4376
4432
  var URL_MAX_LENGTH = 2048;
4433
+ var ENTITY_ID_PATTERN = "^[a-zA-Z0-9_-]+$";
4377
4434
  var SPACE_TITLE_MAX_LENGTH = 50;
4378
4435
  var EMOJI_MAX_LENGTH = 50;
4379
4436
  var CONTENT_VISIBILITY_ENUM = ["public", "unlisted", "share-link", "visitor-auth", "in-collection", "private"];
@@ -4516,10 +4573,11 @@ var SITE_ISSUE_STATUS_ENUM = ["open", "done", "canceled"];
4516
4573
  var SITE_ISSUE_TYPE_ENUM = ["content-outdated", "incoherence", "content-gap", "other"];
4517
4574
  var SITE_ISSUE_PRIORITY_ENUM = ["low", "medium", "high"];
4518
4575
  var SITE_ISSUE_TITLE_MAX_LENGTH = 256;
4576
+ var SITE_QUESTION_TYPE_ENUM = ["exploring", "how-to", "troubleshooting", "reference", "unknown"];
4519
4577
  var CONTEXT_CONNECTION_LABEL_MAX_LENGTH = 128;
4520
4578
  var CONTEXT_CONNECTION_LABEL_MIN_LENGTH = 0;
4521
4579
  var CONTEXT_CONNECTION_STATUS_ENUM = ["pending", "syncing", "succeeded", "failed"];
4522
- var SITE_QUESTION_TYPE_ENUM = ["exploring", "how-to", "troubleshooting", "reference", "unknown"];
4580
+ var CONTEXT_SEARCH_BOOST_ENUM = ["x0.8", "x1.0", "x1.2"];
4523
4581
  var SITE_QUESTION_ANSWER_RESOLUTION_ENUM = ["no", "partially", "yes"];
4524
4582
  var SITE_QUESTION_ANSWER_RELEVANCE_ENUM = ["relevant", "spam", "off-topic", "unclear"];
4525
4583
  var SITE_QUESTION_ANSWER_HELPFULNESS_ENUM = ["low", "medium", "high"];
@@ -4681,6 +4739,7 @@ var GitBookAPI = class extends Api {
4681
4739
  CONTEXT_RECORD_TITLE_MAX_LENGTH,
4682
4740
  CONTEXT_RECORD_TITLE_MIN_LENGTH,
4683
4741
  CONTEXT_RECORD_TYPE_ENUM,
4742
+ CONTEXT_SEARCH_BOOST_ENUM,
4684
4743
  CUSTOMIZATION_AIMODE_ENUM,
4685
4744
  CUSTOMIZATION_ANNOUNCEMENT_MESSAGE_MAX_LENGTH,
4686
4745
  CUSTOMIZATION_ANNOUNCEMENT_MESSAGE_MIN_LENGTH,
@@ -4719,6 +4778,7 @@ var GitBookAPI = class extends Api {
4719
4778
  ContentVisibility,
4720
4779
  ContextConnectionStatus,
4721
4780
  ContextRecordType,
4781
+ ContextSearchBoost,
4722
4782
  CustomHostnameDnsStatus,
4723
4783
  CustomHostnameErrorStatus,
4724
4784
  CustomHostnameSslStatus,
@@ -4741,6 +4801,7 @@ var GitBookAPI = class extends Api {
4741
4801
  DOCUMENT_TEXT_COLOR_ENUM,
4742
4802
  DocumentTextColor,
4743
4803
  EMOJI_MAX_LENGTH,
4804
+ ENTITY_ID_PATTERN,
4744
4805
  EXPRESSION_MAX_LENGTH,
4745
4806
  EXPRESSION_MIN_LENGTH,
4746
4807
  FONT_FAMILY_MAX_LENGTH,
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.166.0";
175
+ var version = "0.167.0";
176
176
 
177
177
  // src/client.ts
178
178
  var import_event_iterator = __toESM(require_node(), 1);
@@ -551,6 +551,19 @@ var SiteQuestionAnswerResolution = /* @__PURE__ */ ((SiteQuestionAnswerResolutio
551
551
  SiteQuestionAnswerResolution2["Yes"] = "yes";
552
552
  return SiteQuestionAnswerResolution2;
553
553
  })(SiteQuestionAnswerResolution || {});
554
+ var ContextSearchBoost = /* @__PURE__ */ ((ContextSearchBoost2) => {
555
+ ContextSearchBoost2["X08"] = "x0.8";
556
+ ContextSearchBoost2["X10"] = "x1.0";
557
+ ContextSearchBoost2["X12"] = "x1.2";
558
+ return ContextSearchBoost2;
559
+ })(ContextSearchBoost || {});
560
+ var ContextConnectionStatus = /* @__PURE__ */ ((ContextConnectionStatus2) => {
561
+ ContextConnectionStatus2["Pending"] = "pending";
562
+ ContextConnectionStatus2["Syncing"] = "syncing";
563
+ ContextConnectionStatus2["Succeeded"] = "succeeded";
564
+ ContextConnectionStatus2["Failed"] = "failed";
565
+ return ContextConnectionStatus2;
566
+ })(ContextConnectionStatus || {});
554
567
  var SiteQuestionType = /* @__PURE__ */ ((SiteQuestionType2) => {
555
568
  SiteQuestionType2["Exploring"] = "exploring";
556
569
  SiteQuestionType2["HowTo"] = "how-to";
@@ -559,13 +572,6 @@ var SiteQuestionType = /* @__PURE__ */ ((SiteQuestionType2) => {
559
572
  SiteQuestionType2["Unknown"] = "unknown";
560
573
  return SiteQuestionType2;
561
574
  })(SiteQuestionType || {});
562
- var ContextConnectionStatus = /* @__PURE__ */ ((ContextConnectionStatus2) => {
563
- ContextConnectionStatus2["Pending"] = "pending";
564
- ContextConnectionStatus2["Syncing"] = "syncing";
565
- ContextConnectionStatus2["Succeeded"] = "succeeded";
566
- ContextConnectionStatus2["Failed"] = "failed";
567
- return ContextConnectionStatus2;
568
- })(ContextConnectionStatus || {});
569
575
  var SiteIssuePriority = /* @__PURE__ */ ((SiteIssuePriority2) => {
570
576
  SiteIssuePriority2["Low"] = "low";
571
577
  SiteIssuePriority2["Medium"] = "medium";
@@ -3528,6 +3534,53 @@ var Api = class extends HttpClient {
3528
3534
  format: "json",
3529
3535
  ...params
3530
3536
  }),
3537
+ updateSiteIssueById: (organizationId, siteId, siteIssueId, data, params = {}) => this.request({
3538
+ path: `/orgs/${organizationId}/sites/${siteId}/issues/${siteIssueId}`,
3539
+ method: "PATCH",
3540
+ body: data,
3541
+ secure: true,
3542
+ type: "application/json" /* Json */,
3543
+ format: "json",
3544
+ ...params
3545
+ }),
3546
+ listChangeRequestsForSiteIssue: (organizationId, siteId, siteIssueId, query, params = {}) => this.request({
3547
+ path: `/orgs/${organizationId}/sites/${siteId}/issues/${siteIssueId}/change-requests`,
3548
+ method: "GET",
3549
+ query,
3550
+ secure: true,
3551
+ format: "json",
3552
+ ...params
3553
+ }),
3554
+ triggerChangeRequestsForSiteIssue: (organizationId, siteId, siteIssueId, params = {}) => this.request({
3555
+ path: `/orgs/${organizationId}/sites/${siteId}/issues/${siteIssueId}/change-requests`,
3556
+ method: "POST",
3557
+ secure: true,
3558
+ ...params
3559
+ }),
3560
+ listPagesForSiteIssue: (organizationId, siteId, siteIssueId, query, params = {}) => this.request({
3561
+ path: `/orgs/${organizationId}/sites/${siteId}/issues/${siteIssueId}/pages`,
3562
+ method: "GET",
3563
+ query,
3564
+ secure: true,
3565
+ format: "json",
3566
+ ...params
3567
+ }),
3568
+ listQuestionsForSiteIssue: (organizationId, siteId, siteIssueId, query, params = {}) => this.request({
3569
+ path: `/orgs/${organizationId}/sites/${siteId}/issues/${siteIssueId}/questions`,
3570
+ method: "GET",
3571
+ query,
3572
+ secure: true,
3573
+ format: "json",
3574
+ ...params
3575
+ }),
3576
+ listRecordsForSiteIssue: (organizationId, siteId, siteIssueId, query, params = {}) => this.request({
3577
+ path: `/orgs/${organizationId}/sites/${siteId}/issues/${siteIssueId}/records`,
3578
+ method: "GET",
3579
+ query,
3580
+ secure: true,
3581
+ format: "json",
3582
+ ...params
3583
+ }),
3531
3584
  listSiteContextConnections: (organizationId, siteId, query, params = {}) => this.request({
3532
3585
  path: `/orgs/${organizationId}/sites/${siteId}/context-connections`,
3533
3586
  method: "GET",
@@ -4063,6 +4116,7 @@ var GitBookAPIError = class extends Error {
4063
4116
  // src/constants.ts
4064
4117
  var APITOKEN_LABEL_MAX_LENGTH = 50;
4065
4118
  var URL_MAX_LENGTH = 2048;
4119
+ var ENTITY_ID_PATTERN = "^[a-zA-Z0-9_-]+$";
4066
4120
  var SPACE_TITLE_MAX_LENGTH = 50;
4067
4121
  var EMOJI_MAX_LENGTH = 50;
4068
4122
  var CONTENT_VISIBILITY_ENUM = ["public", "unlisted", "share-link", "visitor-auth", "in-collection", "private"];
@@ -4205,10 +4259,11 @@ var SITE_ISSUE_STATUS_ENUM = ["open", "done", "canceled"];
4205
4259
  var SITE_ISSUE_TYPE_ENUM = ["content-outdated", "incoherence", "content-gap", "other"];
4206
4260
  var SITE_ISSUE_PRIORITY_ENUM = ["low", "medium", "high"];
4207
4261
  var SITE_ISSUE_TITLE_MAX_LENGTH = 256;
4262
+ var SITE_QUESTION_TYPE_ENUM = ["exploring", "how-to", "troubleshooting", "reference", "unknown"];
4208
4263
  var CONTEXT_CONNECTION_LABEL_MAX_LENGTH = 128;
4209
4264
  var CONTEXT_CONNECTION_LABEL_MIN_LENGTH = 0;
4210
4265
  var CONTEXT_CONNECTION_STATUS_ENUM = ["pending", "syncing", "succeeded", "failed"];
4211
- var SITE_QUESTION_TYPE_ENUM = ["exploring", "how-to", "troubleshooting", "reference", "unknown"];
4266
+ var CONTEXT_SEARCH_BOOST_ENUM = ["x0.8", "x1.0", "x1.2"];
4212
4267
  var SITE_QUESTION_ANSWER_RESOLUTION_ENUM = ["no", "partially", "yes"];
4213
4268
  var SITE_QUESTION_ANSWER_RELEVANCE_ENUM = ["relevant", "spam", "off-topic", "unclear"];
4214
4269
  var SITE_QUESTION_ANSWER_HELPFULNESS_ENUM = ["low", "medium", "high"];
@@ -4369,6 +4424,7 @@ export {
4369
4424
  CONTEXT_RECORD_TITLE_MAX_LENGTH,
4370
4425
  CONTEXT_RECORD_TITLE_MIN_LENGTH,
4371
4426
  CONTEXT_RECORD_TYPE_ENUM,
4427
+ CONTEXT_SEARCH_BOOST_ENUM,
4372
4428
  CUSTOMIZATION_AIMODE_ENUM,
4373
4429
  CUSTOMIZATION_ANNOUNCEMENT_MESSAGE_MAX_LENGTH,
4374
4430
  CUSTOMIZATION_ANNOUNCEMENT_MESSAGE_MIN_LENGTH,
@@ -4407,6 +4463,7 @@ export {
4407
4463
  ContentVisibility,
4408
4464
  ContextConnectionStatus,
4409
4465
  ContextRecordType,
4466
+ ContextSearchBoost,
4410
4467
  CustomHostnameDnsStatus,
4411
4468
  CustomHostnameErrorStatus,
4412
4469
  CustomHostnameSslStatus,
@@ -4429,6 +4486,7 @@ export {
4429
4486
  DOCUMENT_TEXT_COLOR_ENUM,
4430
4487
  DocumentTextColor,
4431
4488
  EMOJI_MAX_LENGTH,
4489
+ ENTITY_ID_PATTERN,
4432
4490
  EXPRESSION_MAX_LENGTH,
4433
4491
  EXPRESSION_MIN_LENGTH,
4434
4492
  FONT_FAMILY_MAX_LENGTH,
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.166.0",
7
+ "version": "0.167.0",
8
8
  "sideEffects": false,
9
9
  "files": [
10
10
  "README.md",