@gitbook/api 0.11.0 → 0.12.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
@@ -50,20 +50,11 @@ __export(src_exports, {
50
50
  OrganizationType: () => OrganizationType,
51
51
  OrganizationUseCase: () => OrganizationUseCase,
52
52
  PurgeCDNCacheContextType: () => PurgeCDNCacheContextType,
53
- SpaceRelationType: () => SpaceRelationType,
54
- SpaceType: () => SpaceType,
55
- TeamMemberRole: () => TeamMemberRole,
56
- UserPreferencesTheme: () => UserPreferencesTheme
53
+ TeamMemberRole: () => TeamMemberRole
57
54
  });
58
55
  module.exports = __toCommonJS(src_exports);
59
56
 
60
57
  // src/client.ts
61
- var UserPreferencesTheme = /* @__PURE__ */ ((UserPreferencesTheme2) => {
62
- UserPreferencesTheme2["Light"] = "light";
63
- UserPreferencesTheme2["Dark"] = "dark";
64
- UserPreferencesTheme2["Default"] = "default";
65
- return UserPreferencesTheme2;
66
- })(UserPreferencesTheme || {});
67
58
  var ContentVisibility = /* @__PURE__ */ ((ContentVisibility2) => {
68
59
  ContentVisibility2["Public"] = "public";
69
60
  ContentVisibility2["Unlisted"] = "unlisted";
@@ -73,23 +64,6 @@ var ContentVisibility = /* @__PURE__ */ ((ContentVisibility2) => {
73
64
  ContentVisibility2["Private"] = "private";
74
65
  return ContentVisibility2;
75
66
  })(ContentVisibility || {});
76
- var SpaceType = /* @__PURE__ */ ((SpaceType2) => {
77
- SpaceType2["Application"] = "application";
78
- SpaceType2["Website"] = "website";
79
- SpaceType2["Service"] = "service";
80
- SpaceType2["Library"] = "library";
81
- SpaceType2["CloudResource"] = "cloud-resource";
82
- SpaceType2["Database"] = "database";
83
- SpaceType2["Other"] = "other";
84
- return SpaceType2;
85
- })(SpaceType || {});
86
- var SpaceRelationType = /* @__PURE__ */ ((SpaceRelationType2) => {
87
- SpaceRelationType2["DependsOn"] = "dependsOn";
88
- SpaceRelationType2["DependencyOf"] = "dependencyOf";
89
- SpaceRelationType2["PartOf"] = "partOf";
90
- SpaceRelationType2["HasPart"] = "hasPart";
91
- return SpaceRelationType2;
92
- })(SpaceRelationType || {});
93
67
  var ImportContentSource = /* @__PURE__ */ ((ImportContentSource2) => {
94
68
  ImportContentSource2["Website"] = "website";
95
69
  ImportContentSource2["Docx"] = "docx";
@@ -141,8 +115,8 @@ var MemberRole = /* @__PURE__ */ ((MemberRole2) => {
141
115
  return MemberRole2;
142
116
  })(MemberRole || {});
143
117
  var TeamMemberRole = /* @__PURE__ */ ((TeamMemberRole2) => {
144
- TeamMemberRole2["Admin"] = "admin";
145
- TeamMemberRole2["Participant"] = "participant";
118
+ TeamMemberRole2["Owner"] = "owner";
119
+ TeamMemberRole2["Member"] = "member";
146
120
  return TeamMemberRole2;
147
121
  })(TeamMemberRole || {});
148
122
  var ChangeRequestStatus = /* @__PURE__ */ ((ChangeRequestStatus2) => {
@@ -189,10 +163,11 @@ var IntegrationInstallationSpaceSelection = /* @__PURE__ */ ((IntegrationInstall
189
163
  })(IntegrationInstallationSpaceSelection || {});
190
164
  var IntegrationCategory = /* @__PURE__ */ ((IntegrationCategory2) => {
191
165
  IntegrationCategory2["Analytics"] = "analytics";
166
+ IntegrationCategory2["Captures"] = "captures";
192
167
  IntegrationCategory2["Collaboration"] = "collaboration";
193
- IntegrationCategory2["Marketing"] = "marketing";
194
168
  IntegrationCategory2["Content"] = "content";
195
169
  IntegrationCategory2["Gitsync"] = "gitsync";
170
+ IntegrationCategory2["Marketing"] = "marketing";
196
171
  IntegrationCategory2["Other"] = "other";
197
172
  return IntegrationCategory2;
198
173
  })(IntegrationCategory || {});
@@ -487,22 +462,6 @@ var Api = class extends HttpClient {
487
462
  secure: true,
488
463
  format: "json",
489
464
  ...params
490
- }),
491
- getPreferencesForAuthenticatedUser: (params = {}) => this.request({
492
- path: `/user/preferences`,
493
- method: "GET",
494
- secure: true,
495
- format: "json",
496
- ...params
497
- }),
498
- updatePreferencesForAuthenticatedUser: (data, params = {}) => this.request({
499
- path: `/user/preferences`,
500
- method: "PATCH",
501
- body: data,
502
- secure: true,
503
- type: "application/json" /* Json */,
504
- format: "json",
505
- ...params
506
465
  })
507
466
  };
508
467
  this.users = {
@@ -1030,36 +989,6 @@ var Api = class extends HttpClient {
1030
989
  ...params
1031
990
  }
1032
991
  ),
1033
- listSpaceRelations: (spaceId, query, params = {}) => this.request({
1034
- path: `/spaces/${spaceId}/relations`,
1035
- method: "GET",
1036
- query,
1037
- secure: true,
1038
- format: "json",
1039
- ...params
1040
- }),
1041
- createSpaceRelation: (spaceId, data, params = {}) => this.request({
1042
- path: `/spaces/${spaceId}/relations`,
1043
- method: "POST",
1044
- body: data,
1045
- secure: true,
1046
- type: "application/json" /* Json */,
1047
- format: "json",
1048
- ...params
1049
- }),
1050
- getSpaceRelation: (spaceId, targetSpaceId, params = {}) => this.request({
1051
- path: `/spaces/${spaceId}/relations/${targetSpaceId}`,
1052
- method: "GET",
1053
- secure: true,
1054
- format: "json",
1055
- ...params
1056
- }),
1057
- deleteSpaceRelation: (spaceId, targetSpaceId, params = {}) => this.request({
1058
- path: `/spaces/${spaceId}/relations/${targetSpaceId}`,
1059
- method: "DELETE",
1060
- secure: true,
1061
- ...params
1062
- }),
1063
992
  getSpaceCustomFields: (spaceId, params = {}) => this.request({
1064
993
  path: `/spaces/${spaceId}/custom-fields`,
1065
994
  method: "GET",
@@ -1265,6 +1194,14 @@ var Api = class extends HttpClient {
1265
1194
  format: "json",
1266
1195
  ...params
1267
1196
  }),
1197
+ listIntegrationInstallationSpaces: (integrationName, installationId, query, params = {}) => this.request({
1198
+ path: `/integrations/${integrationName}/installations/${installationId}/spaces`,
1199
+ method: "GET",
1200
+ query,
1201
+ secure: true,
1202
+ format: "json",
1203
+ ...params
1204
+ }),
1268
1205
  installIntegrationOnSpace: (integrationName, installationId, data, params = {}) => this.request({
1269
1206
  path: `/integrations/${integrationName}/installations/${installationId}/spaces`,
1270
1207
  method: "POST",
@@ -1603,53 +1540,22 @@ var Api = class extends HttpClient {
1603
1540
  secure: true,
1604
1541
  ...params
1605
1542
  }),
1606
- listSpaceRelationsInOrganization: (organizationId, query, params = {}) => this.request({
1607
- path: `/orgs/${organizationId}/space-relations`,
1543
+ listOrganizationIntegrations: (organizationId, query, params = {}) => this.request({
1544
+ path: `/orgs/${organizationId}/integrations`,
1608
1545
  method: "GET",
1609
1546
  query,
1610
1547
  secure: true,
1611
1548
  format: "json",
1612
1549
  ...params
1613
1550
  }),
1614
- listEnvironments: (organizationId, query, params = {}) => this.request({
1615
- path: `/orgs/${organizationId}/environments`,
1551
+ listOrganizationInstallations: (organizationId, query, params = {}) => this.request({
1552
+ path: `/orgs/${organizationId}/installations`,
1616
1553
  method: "GET",
1617
1554
  query,
1618
1555
  secure: true,
1619
1556
  format: "json",
1620
1557
  ...params
1621
1558
  }),
1622
- createEnvironment: (organizationId, data, params = {}) => this.request({
1623
- path: `/orgs/${organizationId}/environments`,
1624
- method: "POST",
1625
- body: data,
1626
- secure: true,
1627
- type: "application/json" /* Json */,
1628
- format: "json",
1629
- ...params
1630
- }),
1631
- getEnvironmentByName: (organizationId, environmentName, params = {}) => this.request({
1632
- path: `/orgs/${organizationId}/environments/${environmentName}`,
1633
- method: "GET",
1634
- secure: true,
1635
- format: "json",
1636
- ...params
1637
- }),
1638
- updateEnvironment: (organizationId, environmentName, data, params = {}) => this.request({
1639
- path: `/orgs/${organizationId}/environments/${environmentName}`,
1640
- method: "PATCH",
1641
- body: data,
1642
- secure: true,
1643
- type: "application/json" /* Json */,
1644
- format: "json",
1645
- ...params
1646
- }),
1647
- deleteEnvironment: (organizationId, environmentName, params = {}) => this.request({
1648
- path: `/orgs/${organizationId}/environments/${environmentName}`,
1649
- method: "DELETE",
1650
- secure: true,
1651
- ...params
1652
- }),
1653
1559
  listEntitySchemas: (organizationId, query, params = {}) => this.request({
1654
1560
  path: `/orgs/${organizationId}/schemas`,
1655
1561
  method: "GET",
@@ -1733,6 +1639,15 @@ var Api = class extends HttpClient {
1733
1639
  secure: true,
1734
1640
  ...params
1735
1641
  }),
1642
+ updateCapture: (organizationId, captureId, data, params = {}) => this.request({
1643
+ path: `/orgs/${organizationId}/captures/${captureId}`,
1644
+ method: "PUT",
1645
+ body: data,
1646
+ secure: true,
1647
+ type: "application/json" /* Json */,
1648
+ format: "json",
1649
+ ...params
1650
+ }),
1736
1651
  addEventsToCapture: (organizationId, captureId, data, params = {}) => this.request({
1737
1652
  path: `/orgs/${organizationId}/captures/${captureId}/events`,
1738
1653
  method: "POST",
@@ -1780,6 +1695,14 @@ var Api = class extends HttpClient {
1780
1695
  secure: true,
1781
1696
  format: "json",
1782
1697
  ...params
1698
+ }),
1699
+ getEmbedByUrl: (query, params = {}) => this.request({
1700
+ path: `/urls/embed`,
1701
+ method: "GET",
1702
+ query,
1703
+ secure: true,
1704
+ format: "json",
1705
+ ...params
1783
1706
  })
1784
1707
  };
1785
1708
  }
@@ -1874,8 +1797,5 @@ var GitBookAPI = class extends Api {
1874
1797
  OrganizationType,
1875
1798
  OrganizationUseCase,
1876
1799
  PurgeCDNCacheContextType,
1877
- SpaceRelationType,
1878
- SpaceType,
1879
- TeamMemberRole,
1880
- UserPreferencesTheme
1800
+ TeamMemberRole
1881
1801
  });
package/dist/index.js CHANGED
@@ -1,10 +1,4 @@
1
1
  // src/client.ts
2
- var UserPreferencesTheme = /* @__PURE__ */ ((UserPreferencesTheme2) => {
3
- UserPreferencesTheme2["Light"] = "light";
4
- UserPreferencesTheme2["Dark"] = "dark";
5
- UserPreferencesTheme2["Default"] = "default";
6
- return UserPreferencesTheme2;
7
- })(UserPreferencesTheme || {});
8
2
  var ContentVisibility = /* @__PURE__ */ ((ContentVisibility2) => {
9
3
  ContentVisibility2["Public"] = "public";
10
4
  ContentVisibility2["Unlisted"] = "unlisted";
@@ -14,23 +8,6 @@ var ContentVisibility = /* @__PURE__ */ ((ContentVisibility2) => {
14
8
  ContentVisibility2["Private"] = "private";
15
9
  return ContentVisibility2;
16
10
  })(ContentVisibility || {});
17
- var SpaceType = /* @__PURE__ */ ((SpaceType2) => {
18
- SpaceType2["Application"] = "application";
19
- SpaceType2["Website"] = "website";
20
- SpaceType2["Service"] = "service";
21
- SpaceType2["Library"] = "library";
22
- SpaceType2["CloudResource"] = "cloud-resource";
23
- SpaceType2["Database"] = "database";
24
- SpaceType2["Other"] = "other";
25
- return SpaceType2;
26
- })(SpaceType || {});
27
- var SpaceRelationType = /* @__PURE__ */ ((SpaceRelationType2) => {
28
- SpaceRelationType2["DependsOn"] = "dependsOn";
29
- SpaceRelationType2["DependencyOf"] = "dependencyOf";
30
- SpaceRelationType2["PartOf"] = "partOf";
31
- SpaceRelationType2["HasPart"] = "hasPart";
32
- return SpaceRelationType2;
33
- })(SpaceRelationType || {});
34
11
  var ImportContentSource = /* @__PURE__ */ ((ImportContentSource2) => {
35
12
  ImportContentSource2["Website"] = "website";
36
13
  ImportContentSource2["Docx"] = "docx";
@@ -82,8 +59,8 @@ var MemberRole = /* @__PURE__ */ ((MemberRole2) => {
82
59
  return MemberRole2;
83
60
  })(MemberRole || {});
84
61
  var TeamMemberRole = /* @__PURE__ */ ((TeamMemberRole2) => {
85
- TeamMemberRole2["Admin"] = "admin";
86
- TeamMemberRole2["Participant"] = "participant";
62
+ TeamMemberRole2["Owner"] = "owner";
63
+ TeamMemberRole2["Member"] = "member";
87
64
  return TeamMemberRole2;
88
65
  })(TeamMemberRole || {});
89
66
  var ChangeRequestStatus = /* @__PURE__ */ ((ChangeRequestStatus2) => {
@@ -130,10 +107,11 @@ var IntegrationInstallationSpaceSelection = /* @__PURE__ */ ((IntegrationInstall
130
107
  })(IntegrationInstallationSpaceSelection || {});
131
108
  var IntegrationCategory = /* @__PURE__ */ ((IntegrationCategory2) => {
132
109
  IntegrationCategory2["Analytics"] = "analytics";
110
+ IntegrationCategory2["Captures"] = "captures";
133
111
  IntegrationCategory2["Collaboration"] = "collaboration";
134
- IntegrationCategory2["Marketing"] = "marketing";
135
112
  IntegrationCategory2["Content"] = "content";
136
113
  IntegrationCategory2["Gitsync"] = "gitsync";
114
+ IntegrationCategory2["Marketing"] = "marketing";
137
115
  IntegrationCategory2["Other"] = "other";
138
116
  return IntegrationCategory2;
139
117
  })(IntegrationCategory || {});
@@ -428,22 +406,6 @@ var Api = class extends HttpClient {
428
406
  secure: true,
429
407
  format: "json",
430
408
  ...params
431
- }),
432
- getPreferencesForAuthenticatedUser: (params = {}) => this.request({
433
- path: `/user/preferences`,
434
- method: "GET",
435
- secure: true,
436
- format: "json",
437
- ...params
438
- }),
439
- updatePreferencesForAuthenticatedUser: (data, params = {}) => this.request({
440
- path: `/user/preferences`,
441
- method: "PATCH",
442
- body: data,
443
- secure: true,
444
- type: "application/json" /* Json */,
445
- format: "json",
446
- ...params
447
409
  })
448
410
  };
449
411
  this.users = {
@@ -971,36 +933,6 @@ var Api = class extends HttpClient {
971
933
  ...params
972
934
  }
973
935
  ),
974
- listSpaceRelations: (spaceId, query, params = {}) => this.request({
975
- path: `/spaces/${spaceId}/relations`,
976
- method: "GET",
977
- query,
978
- secure: true,
979
- format: "json",
980
- ...params
981
- }),
982
- createSpaceRelation: (spaceId, data, params = {}) => this.request({
983
- path: `/spaces/${spaceId}/relations`,
984
- method: "POST",
985
- body: data,
986
- secure: true,
987
- type: "application/json" /* Json */,
988
- format: "json",
989
- ...params
990
- }),
991
- getSpaceRelation: (spaceId, targetSpaceId, params = {}) => this.request({
992
- path: `/spaces/${spaceId}/relations/${targetSpaceId}`,
993
- method: "GET",
994
- secure: true,
995
- format: "json",
996
- ...params
997
- }),
998
- deleteSpaceRelation: (spaceId, targetSpaceId, params = {}) => this.request({
999
- path: `/spaces/${spaceId}/relations/${targetSpaceId}`,
1000
- method: "DELETE",
1001
- secure: true,
1002
- ...params
1003
- }),
1004
936
  getSpaceCustomFields: (spaceId, params = {}) => this.request({
1005
937
  path: `/spaces/${spaceId}/custom-fields`,
1006
938
  method: "GET",
@@ -1206,6 +1138,14 @@ var Api = class extends HttpClient {
1206
1138
  format: "json",
1207
1139
  ...params
1208
1140
  }),
1141
+ listIntegrationInstallationSpaces: (integrationName, installationId, query, params = {}) => this.request({
1142
+ path: `/integrations/${integrationName}/installations/${installationId}/spaces`,
1143
+ method: "GET",
1144
+ query,
1145
+ secure: true,
1146
+ format: "json",
1147
+ ...params
1148
+ }),
1209
1149
  installIntegrationOnSpace: (integrationName, installationId, data, params = {}) => this.request({
1210
1150
  path: `/integrations/${integrationName}/installations/${installationId}/spaces`,
1211
1151
  method: "POST",
@@ -1544,53 +1484,22 @@ var Api = class extends HttpClient {
1544
1484
  secure: true,
1545
1485
  ...params
1546
1486
  }),
1547
- listSpaceRelationsInOrganization: (organizationId, query, params = {}) => this.request({
1548
- path: `/orgs/${organizationId}/space-relations`,
1487
+ listOrganizationIntegrations: (organizationId, query, params = {}) => this.request({
1488
+ path: `/orgs/${organizationId}/integrations`,
1549
1489
  method: "GET",
1550
1490
  query,
1551
1491
  secure: true,
1552
1492
  format: "json",
1553
1493
  ...params
1554
1494
  }),
1555
- listEnvironments: (organizationId, query, params = {}) => this.request({
1556
- path: `/orgs/${organizationId}/environments`,
1495
+ listOrganizationInstallations: (organizationId, query, params = {}) => this.request({
1496
+ path: `/orgs/${organizationId}/installations`,
1557
1497
  method: "GET",
1558
1498
  query,
1559
1499
  secure: true,
1560
1500
  format: "json",
1561
1501
  ...params
1562
1502
  }),
1563
- createEnvironment: (organizationId, data, params = {}) => this.request({
1564
- path: `/orgs/${organizationId}/environments`,
1565
- method: "POST",
1566
- body: data,
1567
- secure: true,
1568
- type: "application/json" /* Json */,
1569
- format: "json",
1570
- ...params
1571
- }),
1572
- getEnvironmentByName: (organizationId, environmentName, params = {}) => this.request({
1573
- path: `/orgs/${organizationId}/environments/${environmentName}`,
1574
- method: "GET",
1575
- secure: true,
1576
- format: "json",
1577
- ...params
1578
- }),
1579
- updateEnvironment: (organizationId, environmentName, data, params = {}) => this.request({
1580
- path: `/orgs/${organizationId}/environments/${environmentName}`,
1581
- method: "PATCH",
1582
- body: data,
1583
- secure: true,
1584
- type: "application/json" /* Json */,
1585
- format: "json",
1586
- ...params
1587
- }),
1588
- deleteEnvironment: (organizationId, environmentName, params = {}) => this.request({
1589
- path: `/orgs/${organizationId}/environments/${environmentName}`,
1590
- method: "DELETE",
1591
- secure: true,
1592
- ...params
1593
- }),
1594
1503
  listEntitySchemas: (organizationId, query, params = {}) => this.request({
1595
1504
  path: `/orgs/${organizationId}/schemas`,
1596
1505
  method: "GET",
@@ -1674,6 +1583,15 @@ var Api = class extends HttpClient {
1674
1583
  secure: true,
1675
1584
  ...params
1676
1585
  }),
1586
+ updateCapture: (organizationId, captureId, data, params = {}) => this.request({
1587
+ path: `/orgs/${organizationId}/captures/${captureId}`,
1588
+ method: "PUT",
1589
+ body: data,
1590
+ secure: true,
1591
+ type: "application/json" /* Json */,
1592
+ format: "json",
1593
+ ...params
1594
+ }),
1677
1595
  addEventsToCapture: (organizationId, captureId, data, params = {}) => this.request({
1678
1596
  path: `/orgs/${organizationId}/captures/${captureId}/events`,
1679
1597
  method: "POST",
@@ -1721,6 +1639,14 @@ var Api = class extends HttpClient {
1721
1639
  secure: true,
1722
1640
  format: "json",
1723
1641
  ...params
1642
+ }),
1643
+ getEmbedByUrl: (query, params = {}) => this.request({
1644
+ path: `/urls/embed`,
1645
+ method: "GET",
1646
+ query,
1647
+ secure: true,
1648
+ format: "json",
1649
+ ...params
1724
1650
  })
1725
1651
  };
1726
1652
  }
@@ -1814,8 +1740,5 @@ export {
1814
1740
  OrganizationType,
1815
1741
  OrganizationUseCase,
1816
1742
  PurgeCDNCacheContextType,
1817
- SpaceRelationType,
1818
- SpaceType,
1819
- TeamMemberRole,
1820
- UserPreferencesTheme
1743
+ TeamMemberRole
1821
1744
  };
package/package.json CHANGED
@@ -4,9 +4,10 @@
4
4
  "main": "./dist/index.cjs",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
- "version": "0.11.0",
7
+ "version": "0.12.0",
8
8
  "sideEffects": false,
9
9
  "files": [
10
+ "README.md",
10
11
  "spec/**",
11
12
  "dist/**"
12
13
  ],