@gitbook/api 0.14.0 → 0.16.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/index.cjs CHANGED
@@ -55,6 +55,10 @@ __export(src_exports, {
55
55
  OrganizationType: () => OrganizationType,
56
56
  OrganizationUseCase: () => OrganizationUseCase,
57
57
  PurgeCDNCacheContextType: () => PurgeCDNCacheContextType,
58
+ RevisionPageLayoutOptionsCoverSize: () => RevisionPageLayoutOptionsCoverSize,
59
+ RevisionPageLayoutPreset: () => RevisionPageLayoutPreset,
60
+ RevisionPageType: () => RevisionPageType,
61
+ RevisionSemanticChangeType: () => RevisionSemanticChangeType,
58
62
  TeamMemberRole: () => TeamMemberRole
59
63
  });
60
64
  module.exports = __toCommonJS(src_exports);
@@ -69,6 +73,23 @@ var ContentVisibility = /* @__PURE__ */ ((ContentVisibility2) => {
69
73
  ContentVisibility2["Private"] = "private";
70
74
  return ContentVisibility2;
71
75
  })(ContentVisibility || {});
76
+ var RevisionPageLayoutOptionsCoverSize = /* @__PURE__ */ ((RevisionPageLayoutOptionsCoverSize2) => {
77
+ RevisionPageLayoutOptionsCoverSize2["Hero"] = "hero";
78
+ RevisionPageLayoutOptionsCoverSize2["Full"] = "full";
79
+ return RevisionPageLayoutOptionsCoverSize2;
80
+ })(RevisionPageLayoutOptionsCoverSize || {});
81
+ var RevisionPageLayoutPreset = /* @__PURE__ */ ((RevisionPageLayoutPreset2) => {
82
+ RevisionPageLayoutPreset2["Docs"] = "docs";
83
+ RevisionPageLayoutPreset2["Editorial"] = "editorial";
84
+ RevisionPageLayoutPreset2["Landing"] = "landing";
85
+ return RevisionPageLayoutPreset2;
86
+ })(RevisionPageLayoutPreset || {});
87
+ var RevisionPageType = /* @__PURE__ */ ((RevisionPageType2) => {
88
+ RevisionPageType2["Document"] = "document";
89
+ RevisionPageType2["Group"] = "group";
90
+ RevisionPageType2["Link"] = "link";
91
+ return RevisionPageType2;
92
+ })(RevisionPageType || {});
72
93
  var ImportContentSource = /* @__PURE__ */ ((ImportContentSource2) => {
73
94
  ImportContentSource2["Website"] = "website";
74
95
  ImportContentSource2["Docx"] = "docx";
@@ -84,6 +105,17 @@ var ImportContentSource = /* @__PURE__ */ ((ImportContentSource2) => {
84
105
  ImportContentSource2["OpenApi"] = "open-api";
85
106
  return ImportContentSource2;
86
107
  })(ImportContentSource || {});
108
+ var RevisionSemanticChangeType = /* @__PURE__ */ ((RevisionSemanticChangeType2) => {
109
+ RevisionSemanticChangeType2["PageCreated"] = "page_created";
110
+ RevisionSemanticChangeType2["PageEdited"] = "page_edited";
111
+ RevisionSemanticChangeType2["PageDeleted"] = "page_deleted";
112
+ RevisionSemanticChangeType2["PageMoved"] = "page_moved";
113
+ RevisionSemanticChangeType2["FileCreated"] = "file_created";
114
+ RevisionSemanticChangeType2["FileEdited"] = "file_edited";
115
+ RevisionSemanticChangeType2["FileDeleted"] = "file_deleted";
116
+ RevisionSemanticChangeType2["CustomFieldsEdited"] = "custom_fields_edited";
117
+ return RevisionSemanticChangeType2;
118
+ })(RevisionSemanticChangeType || {});
87
119
  var GitSyncOperationState = /* @__PURE__ */ ((GitSyncOperationState2) => {
88
120
  GitSyncOperationState2["Running"] = "running";
89
121
  GitSyncOperationState2["Failure"] = "failure";
@@ -150,6 +182,7 @@ var AnalyticsTrafficInterval = /* @__PURE__ */ ((AnalyticsTrafficInterval2) => {
150
182
  })(AnalyticsTrafficInterval || {});
151
183
  var IntegrationScope = /* @__PURE__ */ ((IntegrationScope2) => {
152
184
  IntegrationScope2["EntitiesWrite"] = "entities:write";
185
+ IntegrationScope2["SnippetsRead"] = "snippets:read";
153
186
  IntegrationScope2["CaptureWrite"] = "capture:write";
154
187
  IntegrationScope2["SpaceViewsRead"] = "space:views:read";
155
188
  IntegrationScope2["SpaceContentRead"] = "space:content:read";
@@ -654,11 +687,26 @@ var Api = class extends HttpClient {
654
687
  format: "json",
655
688
  ...params
656
689
  }),
690
+ listPages: (spaceId, params = {}) => this.request({
691
+ path: `/spaces/${spaceId}/content/pages`,
692
+ method: "GET",
693
+ secure: true,
694
+ format: "json",
695
+ ...params
696
+ }),
657
697
  listFiles: (spaceId, query, params = {}) => this.request({
658
698
  path: `/spaces/${spaceId}/content/files`,
659
699
  method: "GET",
660
700
  query,
661
701
  secure: true,
702
+ format: "json",
703
+ ...params
704
+ }),
705
+ getFileById: (spaceId, fileId, params = {}) => this.request({
706
+ path: `/spaces/${spaceId}/content/files/${fileId}`,
707
+ method: "GET",
708
+ secure: true,
709
+ format: "json",
662
710
  ...params
663
711
  }),
664
712
  getPageById: (spaceId, pageId, query, params = {}) => this.request({
@@ -862,11 +910,26 @@ var Api = class extends HttpClient {
862
910
  format: "json",
863
911
  ...params
864
912
  }),
913
+ listPagesInChangeRequest: (spaceId, changeRequestId, params = {}) => this.request({
914
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}/content/pages`,
915
+ method: "GET",
916
+ secure: true,
917
+ format: "json",
918
+ ...params
919
+ }),
865
920
  listFilesInChangeRequestById: (spaceId, changeRequestId, query, params = {}) => this.request({
866
921
  path: `/spaces/${spaceId}/change-requests/${changeRequestId}/content/files`,
867
922
  method: "GET",
868
923
  query,
869
924
  secure: true,
925
+ format: "json",
926
+ ...params
927
+ }),
928
+ getFileInChangeRequestById: (spaceId, changeRequestId, fileId, params = {}) => this.request({
929
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}/content/files/${fileId}`,
930
+ method: "GET",
931
+ secure: true,
932
+ format: "json",
870
933
  ...params
871
934
  }),
872
935
  getPageInChangeRequestById: (spaceId, changeRequestId, pageId, query, params = {}) => this.request({
@@ -901,11 +964,34 @@ var Api = class extends HttpClient {
901
964
  format: "json",
902
965
  ...params
903
966
  }),
967
+ getRevisionSemanticChanges: (spaceId, revisionId, query, params = {}) => this.request({
968
+ path: `/spaces/${spaceId}/revisions/${revisionId}/changes`,
969
+ method: "GET",
970
+ query,
971
+ secure: true,
972
+ format: "json",
973
+ ...params
974
+ }),
975
+ listPagesInRevisionById: (spaceId, revisionId, params = {}) => this.request({
976
+ path: `/spaces/${spaceId}/revisions/${revisionId}/pages`,
977
+ method: "GET",
978
+ secure: true,
979
+ format: "json",
980
+ ...params
981
+ }),
904
982
  listFilesInRevisionById: (spaceId, revisionId, query, params = {}) => this.request({
905
983
  path: `/spaces/${spaceId}/revisions/${revisionId}/files`,
906
984
  method: "GET",
907
985
  query,
908
986
  secure: true,
987
+ format: "json",
988
+ ...params
989
+ }),
990
+ getFileInRevisionById: (spaceId, revisionId, fileId, params = {}) => this.request({
991
+ path: `/spaces/${spaceId}/revisions/${revisionId}/files/${fileId}`,
992
+ method: "GET",
993
+ secure: true,
994
+ format: "json",
909
995
  ...params
910
996
  }),
911
997
  getPageInRevisionById: (spaceId, revisionId, pageId, query, params = {}) => this.request({
@@ -1755,6 +1841,46 @@ var Api = class extends HttpClient {
1755
1841
  format: "json",
1756
1842
  ...params
1757
1843
  }),
1844
+ listSnippets: (organizationId, query, params = {}) => this.request({
1845
+ path: `/orgs/${organizationId}/snippets`,
1846
+ method: "GET",
1847
+ query,
1848
+ secure: true,
1849
+ format: "json",
1850
+ ...params
1851
+ }),
1852
+ createSnippet: (organizationId, data, params = {}) => this.request({
1853
+ path: `/orgs/${organizationId}/snippets`,
1854
+ method: "POST",
1855
+ body: data,
1856
+ secure: true,
1857
+ type: "application/json" /* Json */,
1858
+ format: "json",
1859
+ ...params
1860
+ }),
1861
+ getSnippet: (organizationId, snippetId, query, params = {}) => this.request({
1862
+ path: `/orgs/${organizationId}/snippets/${snippetId}`,
1863
+ method: "GET",
1864
+ query,
1865
+ secure: true,
1866
+ format: "json",
1867
+ ...params
1868
+ }),
1869
+ deleteSnippet: (organizationId, snippetId, params = {}) => this.request({
1870
+ path: `/orgs/${organizationId}/snippets/${snippetId}`,
1871
+ method: "DELETE",
1872
+ secure: true,
1873
+ ...params
1874
+ }),
1875
+ updateSnippet: (organizationId, snippetId, data, params = {}) => this.request({
1876
+ path: `/orgs/${organizationId}/snippets/${snippetId}`,
1877
+ method: "PUT",
1878
+ body: data,
1879
+ secure: true,
1880
+ type: "application/json" /* Json */,
1881
+ format: "json",
1882
+ ...params
1883
+ }),
1758
1884
  askInOrganization: (organizationId, data, params = {}) => this.request({
1759
1885
  path: `/orgs/${organizationId}/ask`,
1760
1886
  method: "POST",
@@ -1763,6 +1889,31 @@ var Api = class extends HttpClient {
1763
1889
  type: "application/json" /* Json */,
1764
1890
  format: "json",
1765
1891
  ...params
1892
+ }),
1893
+ listContentAuditRelations: (organizationId, query, params = {}) => this.request({
1894
+ path: `/orgs/${organizationId}/insights/audit-relations`,
1895
+ method: "GET",
1896
+ query,
1897
+ secure: true,
1898
+ format: "json",
1899
+ ...params
1900
+ }),
1901
+ updateContentAuditRelationStatusById: (organizationId, relationId, data, params = {}) => this.request({
1902
+ path: `/orgs/${organizationId}/insights/audit-relations/${relationId}`,
1903
+ method: "PATCH",
1904
+ body: data,
1905
+ secure: true,
1906
+ type: "application/json" /* Json */,
1907
+ format: "json",
1908
+ ...params
1909
+ }),
1910
+ getContentAuditSourceContentById: (organizationId, sourceId, query, params = {}) => this.request({
1911
+ path: `/orgs/${organizationId}/insights/audit-sources/${sourceId}/content`,
1912
+ method: "GET",
1913
+ query,
1914
+ secure: true,
1915
+ format: "json",
1916
+ ...params
1766
1917
  })
1767
1918
  };
1768
1919
  this.internal = {
@@ -1792,6 +1943,14 @@ var Api = class extends HttpClient {
1792
1943
  secure: true,
1793
1944
  format: "json",
1794
1945
  ...params
1946
+ }),
1947
+ getPublishedContentByUrl: (query, params = {}) => this.request({
1948
+ path: `/urls/published`,
1949
+ method: "GET",
1950
+ query,
1951
+ secure: true,
1952
+ format: "json",
1953
+ ...params
1795
1954
  })
1796
1955
  };
1797
1956
  }
@@ -1891,5 +2050,9 @@ var GitBookAPI = class extends Api {
1891
2050
  OrganizationType,
1892
2051
  OrganizationUseCase,
1893
2052
  PurgeCDNCacheContextType,
2053
+ RevisionPageLayoutOptionsCoverSize,
2054
+ RevisionPageLayoutPreset,
2055
+ RevisionPageType,
2056
+ RevisionSemanticChangeType,
1894
2057
  TeamMemberRole
1895
2058
  });
package/dist/index.js CHANGED
@@ -8,6 +8,23 @@ var ContentVisibility = /* @__PURE__ */ ((ContentVisibility2) => {
8
8
  ContentVisibility2["Private"] = "private";
9
9
  return ContentVisibility2;
10
10
  })(ContentVisibility || {});
11
+ var RevisionPageLayoutOptionsCoverSize = /* @__PURE__ */ ((RevisionPageLayoutOptionsCoverSize2) => {
12
+ RevisionPageLayoutOptionsCoverSize2["Hero"] = "hero";
13
+ RevisionPageLayoutOptionsCoverSize2["Full"] = "full";
14
+ return RevisionPageLayoutOptionsCoverSize2;
15
+ })(RevisionPageLayoutOptionsCoverSize || {});
16
+ var RevisionPageLayoutPreset = /* @__PURE__ */ ((RevisionPageLayoutPreset2) => {
17
+ RevisionPageLayoutPreset2["Docs"] = "docs";
18
+ RevisionPageLayoutPreset2["Editorial"] = "editorial";
19
+ RevisionPageLayoutPreset2["Landing"] = "landing";
20
+ return RevisionPageLayoutPreset2;
21
+ })(RevisionPageLayoutPreset || {});
22
+ var RevisionPageType = /* @__PURE__ */ ((RevisionPageType2) => {
23
+ RevisionPageType2["Document"] = "document";
24
+ RevisionPageType2["Group"] = "group";
25
+ RevisionPageType2["Link"] = "link";
26
+ return RevisionPageType2;
27
+ })(RevisionPageType || {});
11
28
  var ImportContentSource = /* @__PURE__ */ ((ImportContentSource2) => {
12
29
  ImportContentSource2["Website"] = "website";
13
30
  ImportContentSource2["Docx"] = "docx";
@@ -23,6 +40,17 @@ var ImportContentSource = /* @__PURE__ */ ((ImportContentSource2) => {
23
40
  ImportContentSource2["OpenApi"] = "open-api";
24
41
  return ImportContentSource2;
25
42
  })(ImportContentSource || {});
43
+ var RevisionSemanticChangeType = /* @__PURE__ */ ((RevisionSemanticChangeType2) => {
44
+ RevisionSemanticChangeType2["PageCreated"] = "page_created";
45
+ RevisionSemanticChangeType2["PageEdited"] = "page_edited";
46
+ RevisionSemanticChangeType2["PageDeleted"] = "page_deleted";
47
+ RevisionSemanticChangeType2["PageMoved"] = "page_moved";
48
+ RevisionSemanticChangeType2["FileCreated"] = "file_created";
49
+ RevisionSemanticChangeType2["FileEdited"] = "file_edited";
50
+ RevisionSemanticChangeType2["FileDeleted"] = "file_deleted";
51
+ RevisionSemanticChangeType2["CustomFieldsEdited"] = "custom_fields_edited";
52
+ return RevisionSemanticChangeType2;
53
+ })(RevisionSemanticChangeType || {});
26
54
  var GitSyncOperationState = /* @__PURE__ */ ((GitSyncOperationState2) => {
27
55
  GitSyncOperationState2["Running"] = "running";
28
56
  GitSyncOperationState2["Failure"] = "failure";
@@ -89,6 +117,7 @@ var AnalyticsTrafficInterval = /* @__PURE__ */ ((AnalyticsTrafficInterval2) => {
89
117
  })(AnalyticsTrafficInterval || {});
90
118
  var IntegrationScope = /* @__PURE__ */ ((IntegrationScope2) => {
91
119
  IntegrationScope2["EntitiesWrite"] = "entities:write";
120
+ IntegrationScope2["SnippetsRead"] = "snippets:read";
92
121
  IntegrationScope2["CaptureWrite"] = "capture:write";
93
122
  IntegrationScope2["SpaceViewsRead"] = "space:views:read";
94
123
  IntegrationScope2["SpaceContentRead"] = "space:content:read";
@@ -593,11 +622,26 @@ var Api = class extends HttpClient {
593
622
  format: "json",
594
623
  ...params
595
624
  }),
625
+ listPages: (spaceId, params = {}) => this.request({
626
+ path: `/spaces/${spaceId}/content/pages`,
627
+ method: "GET",
628
+ secure: true,
629
+ format: "json",
630
+ ...params
631
+ }),
596
632
  listFiles: (spaceId, query, params = {}) => this.request({
597
633
  path: `/spaces/${spaceId}/content/files`,
598
634
  method: "GET",
599
635
  query,
600
636
  secure: true,
637
+ format: "json",
638
+ ...params
639
+ }),
640
+ getFileById: (spaceId, fileId, params = {}) => this.request({
641
+ path: `/spaces/${spaceId}/content/files/${fileId}`,
642
+ method: "GET",
643
+ secure: true,
644
+ format: "json",
601
645
  ...params
602
646
  }),
603
647
  getPageById: (spaceId, pageId, query, params = {}) => this.request({
@@ -801,11 +845,26 @@ var Api = class extends HttpClient {
801
845
  format: "json",
802
846
  ...params
803
847
  }),
848
+ listPagesInChangeRequest: (spaceId, changeRequestId, params = {}) => this.request({
849
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}/content/pages`,
850
+ method: "GET",
851
+ secure: true,
852
+ format: "json",
853
+ ...params
854
+ }),
804
855
  listFilesInChangeRequestById: (spaceId, changeRequestId, query, params = {}) => this.request({
805
856
  path: `/spaces/${spaceId}/change-requests/${changeRequestId}/content/files`,
806
857
  method: "GET",
807
858
  query,
808
859
  secure: true,
860
+ format: "json",
861
+ ...params
862
+ }),
863
+ getFileInChangeRequestById: (spaceId, changeRequestId, fileId, params = {}) => this.request({
864
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}/content/files/${fileId}`,
865
+ method: "GET",
866
+ secure: true,
867
+ format: "json",
809
868
  ...params
810
869
  }),
811
870
  getPageInChangeRequestById: (spaceId, changeRequestId, pageId, query, params = {}) => this.request({
@@ -840,11 +899,34 @@ var Api = class extends HttpClient {
840
899
  format: "json",
841
900
  ...params
842
901
  }),
902
+ getRevisionSemanticChanges: (spaceId, revisionId, query, params = {}) => this.request({
903
+ path: `/spaces/${spaceId}/revisions/${revisionId}/changes`,
904
+ method: "GET",
905
+ query,
906
+ secure: true,
907
+ format: "json",
908
+ ...params
909
+ }),
910
+ listPagesInRevisionById: (spaceId, revisionId, params = {}) => this.request({
911
+ path: `/spaces/${spaceId}/revisions/${revisionId}/pages`,
912
+ method: "GET",
913
+ secure: true,
914
+ format: "json",
915
+ ...params
916
+ }),
843
917
  listFilesInRevisionById: (spaceId, revisionId, query, params = {}) => this.request({
844
918
  path: `/spaces/${spaceId}/revisions/${revisionId}/files`,
845
919
  method: "GET",
846
920
  query,
847
921
  secure: true,
922
+ format: "json",
923
+ ...params
924
+ }),
925
+ getFileInRevisionById: (spaceId, revisionId, fileId, params = {}) => this.request({
926
+ path: `/spaces/${spaceId}/revisions/${revisionId}/files/${fileId}`,
927
+ method: "GET",
928
+ secure: true,
929
+ format: "json",
848
930
  ...params
849
931
  }),
850
932
  getPageInRevisionById: (spaceId, revisionId, pageId, query, params = {}) => this.request({
@@ -1694,6 +1776,46 @@ var Api = class extends HttpClient {
1694
1776
  format: "json",
1695
1777
  ...params
1696
1778
  }),
1779
+ listSnippets: (organizationId, query, params = {}) => this.request({
1780
+ path: `/orgs/${organizationId}/snippets`,
1781
+ method: "GET",
1782
+ query,
1783
+ secure: true,
1784
+ format: "json",
1785
+ ...params
1786
+ }),
1787
+ createSnippet: (organizationId, data, params = {}) => this.request({
1788
+ path: `/orgs/${organizationId}/snippets`,
1789
+ method: "POST",
1790
+ body: data,
1791
+ secure: true,
1792
+ type: "application/json" /* Json */,
1793
+ format: "json",
1794
+ ...params
1795
+ }),
1796
+ getSnippet: (organizationId, snippetId, query, params = {}) => this.request({
1797
+ path: `/orgs/${organizationId}/snippets/${snippetId}`,
1798
+ method: "GET",
1799
+ query,
1800
+ secure: true,
1801
+ format: "json",
1802
+ ...params
1803
+ }),
1804
+ deleteSnippet: (organizationId, snippetId, params = {}) => this.request({
1805
+ path: `/orgs/${organizationId}/snippets/${snippetId}`,
1806
+ method: "DELETE",
1807
+ secure: true,
1808
+ ...params
1809
+ }),
1810
+ updateSnippet: (organizationId, snippetId, data, params = {}) => this.request({
1811
+ path: `/orgs/${organizationId}/snippets/${snippetId}`,
1812
+ method: "PUT",
1813
+ body: data,
1814
+ secure: true,
1815
+ type: "application/json" /* Json */,
1816
+ format: "json",
1817
+ ...params
1818
+ }),
1697
1819
  askInOrganization: (organizationId, data, params = {}) => this.request({
1698
1820
  path: `/orgs/${organizationId}/ask`,
1699
1821
  method: "POST",
@@ -1702,6 +1824,31 @@ var Api = class extends HttpClient {
1702
1824
  type: "application/json" /* Json */,
1703
1825
  format: "json",
1704
1826
  ...params
1827
+ }),
1828
+ listContentAuditRelations: (organizationId, query, params = {}) => this.request({
1829
+ path: `/orgs/${organizationId}/insights/audit-relations`,
1830
+ method: "GET",
1831
+ query,
1832
+ secure: true,
1833
+ format: "json",
1834
+ ...params
1835
+ }),
1836
+ updateContentAuditRelationStatusById: (organizationId, relationId, data, params = {}) => this.request({
1837
+ path: `/orgs/${organizationId}/insights/audit-relations/${relationId}`,
1838
+ method: "PATCH",
1839
+ body: data,
1840
+ secure: true,
1841
+ type: "application/json" /* Json */,
1842
+ format: "json",
1843
+ ...params
1844
+ }),
1845
+ getContentAuditSourceContentById: (organizationId, sourceId, query, params = {}) => this.request({
1846
+ path: `/orgs/${organizationId}/insights/audit-sources/${sourceId}/content`,
1847
+ method: "GET",
1848
+ query,
1849
+ secure: true,
1850
+ format: "json",
1851
+ ...params
1705
1852
  })
1706
1853
  };
1707
1854
  this.internal = {
@@ -1731,6 +1878,14 @@ var Api = class extends HttpClient {
1731
1878
  secure: true,
1732
1879
  format: "json",
1733
1880
  ...params
1881
+ }),
1882
+ getPublishedContentByUrl: (query, params = {}) => this.request({
1883
+ path: `/urls/published`,
1884
+ method: "GET",
1885
+ query,
1886
+ secure: true,
1887
+ format: "json",
1888
+ ...params
1734
1889
  })
1735
1890
  };
1736
1891
  }
@@ -1829,5 +1984,9 @@ export {
1829
1984
  OrganizationType,
1830
1985
  OrganizationUseCase,
1831
1986
  PurgeCDNCacheContextType,
1987
+ RevisionPageLayoutOptionsCoverSize,
1988
+ RevisionPageLayoutPreset,
1989
+ RevisionPageType,
1990
+ RevisionSemanticChangeType,
1832
1991
  TeamMemberRole
1833
1992
  };
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.14.0",
7
+ "version": "0.16.0",
8
8
  "sideEffects": false,
9
9
  "files": [
10
10
  "README.md",