@gitbook/api 0.10.0 → 0.11.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 +21 -2
- package/dist/index.cjs +13 -0
- package/dist/index.js +12 -0
- package/package.json +1 -1
- package/spec/openapi.json +60 -5
- package/spec/openapi.yaml +39 -3
package/dist/client.d.ts
CHANGED
|
@@ -67,6 +67,8 @@ export interface RequestPublishIntegration {
|
|
|
67
67
|
summary?: IntegrationSummary;
|
|
68
68
|
previewImages?: string[];
|
|
69
69
|
visibility?: IntegrationVisibility;
|
|
70
|
+
/** Allowed installation target for the integration. If not specified, the integration can be installed at `all` targets (org, spaces etc) */
|
|
71
|
+
target?: IntegrationTarget;
|
|
70
72
|
/** Permissions that should be granted to the integration */
|
|
71
73
|
scopes: IntegrationScopes;
|
|
72
74
|
/** Categories for which the integration is listed in the marketplace */
|
|
@@ -804,6 +806,7 @@ export interface Capture {
|
|
|
804
806
|
/** URLs associated with the object */
|
|
805
807
|
urls: {
|
|
806
808
|
location: string;
|
|
809
|
+
app: string;
|
|
807
810
|
};
|
|
808
811
|
}
|
|
809
812
|
/**
|
|
@@ -1047,7 +1050,8 @@ export declare type SearchAIAnswerSource = {
|
|
|
1047
1050
|
sections: string[];
|
|
1048
1051
|
} | {
|
|
1049
1052
|
type: 'entity';
|
|
1050
|
-
|
|
1053
|
+
entityId: string;
|
|
1054
|
+
entityType: EntityType;
|
|
1051
1055
|
integration?: string;
|
|
1052
1056
|
} | {
|
|
1053
1057
|
type: 'capture';
|
|
@@ -1398,6 +1402,10 @@ export interface IntegrationEnvironment {
|
|
|
1398
1402
|
installation?: string;
|
|
1399
1403
|
};
|
|
1400
1404
|
}
|
|
1405
|
+
export declare enum IntegrationTarget {
|
|
1406
|
+
Organization = "organization",
|
|
1407
|
+
All = "all"
|
|
1408
|
+
}
|
|
1401
1409
|
export declare type IntegrationInstallationTarget = OrganizationTarget;
|
|
1402
1410
|
/**
|
|
1403
1411
|
* Configuration of the integration at the account level
|
|
@@ -1465,6 +1473,7 @@ export interface UpsertEntity {
|
|
|
1465
1473
|
export declare type Entity = UpsertEntity & {
|
|
1466
1474
|
id: string;
|
|
1467
1475
|
type: EntityType;
|
|
1476
|
+
entityType: EntityType;
|
|
1468
1477
|
urls: {
|
|
1469
1478
|
location: string;
|
|
1470
1479
|
};
|
|
@@ -4628,7 +4637,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
4628
4637
|
*/
|
|
4629
4638
|
getEntity: (organizationId: string, entityType: EntityType, entityId: EntityId, params?: RequestParams) => Promise<HttpResponse<Entity, Error>>;
|
|
4630
4639
|
/**
|
|
4631
|
-
* @description List captures in an organization.
|
|
4640
|
+
* @description List captures in an organization, newest first.
|
|
4632
4641
|
*
|
|
4633
4642
|
* @tags organizations
|
|
4634
4643
|
* @name ListCaptures
|
|
@@ -4670,6 +4679,16 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
4670
4679
|
getCapture: (organizationId: string, captureId: string, query?: {
|
|
4671
4680
|
format?: 'document' | 'markdown';
|
|
4672
4681
|
}, params?: RequestParams) => Promise<HttpResponse<Capture, Error>>;
|
|
4682
|
+
/**
|
|
4683
|
+
* No description
|
|
4684
|
+
*
|
|
4685
|
+
* @tags organizations
|
|
4686
|
+
* @name DeleteCapture
|
|
4687
|
+
* @summary Delete a capture by its ID
|
|
4688
|
+
* @request DELETE:/orgs/{organizationId}/captures/{captureId}
|
|
4689
|
+
* @secure
|
|
4690
|
+
*/
|
|
4691
|
+
deleteCapture: (organizationId: string, captureId: string, params?: RequestParams) => Promise<HttpResponse<void, Error>>;
|
|
4673
4692
|
/**
|
|
4674
4693
|
* No description
|
|
4675
4694
|
*
|
package/dist/index.cjs
CHANGED
|
@@ -43,6 +43,7 @@ __export(src_exports, {
|
|
|
43
43
|
IntegrationInstallationSpaceSelection: () => IntegrationInstallationSpaceSelection,
|
|
44
44
|
IntegrationInstallationStatus: () => IntegrationInstallationStatus,
|
|
45
45
|
IntegrationScope: () => IntegrationScope,
|
|
46
|
+
IntegrationTarget: () => IntegrationTarget,
|
|
46
47
|
IntegrationVisibility: () => IntegrationVisibility,
|
|
47
48
|
MemberRole: () => MemberRole,
|
|
48
49
|
OrganizationCommunityType: () => OrganizationCommunityType,
|
|
@@ -207,6 +208,11 @@ var IntegrationInstallationStatus = /* @__PURE__ */ ((IntegrationInstallationSta
|
|
|
207
208
|
IntegrationInstallationStatus2["Paused"] = "paused";
|
|
208
209
|
return IntegrationInstallationStatus2;
|
|
209
210
|
})(IntegrationInstallationStatus || {});
|
|
211
|
+
var IntegrationTarget = /* @__PURE__ */ ((IntegrationTarget2) => {
|
|
212
|
+
IntegrationTarget2["Organization"] = "organization";
|
|
213
|
+
IntegrationTarget2["All"] = "all";
|
|
214
|
+
return IntegrationTarget2;
|
|
215
|
+
})(IntegrationTarget || {});
|
|
210
216
|
var BillingInterval = /* @__PURE__ */ ((BillingInterval2) => {
|
|
211
217
|
BillingInterval2["Monthly"] = "monthly";
|
|
212
218
|
BillingInterval2["Yearly"] = "yearly";
|
|
@@ -1721,6 +1727,12 @@ var Api = class extends HttpClient {
|
|
|
1721
1727
|
format: "json",
|
|
1722
1728
|
...params
|
|
1723
1729
|
}),
|
|
1730
|
+
deleteCapture: (organizationId, captureId, params = {}) => this.request({
|
|
1731
|
+
path: `/orgs/${organizationId}/captures/${captureId}`,
|
|
1732
|
+
method: "DELETE",
|
|
1733
|
+
secure: true,
|
|
1734
|
+
...params
|
|
1735
|
+
}),
|
|
1724
1736
|
addEventsToCapture: (organizationId, captureId, data, params = {}) => this.request({
|
|
1725
1737
|
path: `/orgs/${organizationId}/captures/${captureId}/events`,
|
|
1726
1738
|
method: "POST",
|
|
@@ -1855,6 +1867,7 @@ var GitBookAPI = class extends Api {
|
|
|
1855
1867
|
IntegrationInstallationSpaceSelection,
|
|
1856
1868
|
IntegrationInstallationStatus,
|
|
1857
1869
|
IntegrationScope,
|
|
1870
|
+
IntegrationTarget,
|
|
1858
1871
|
IntegrationVisibility,
|
|
1859
1872
|
MemberRole,
|
|
1860
1873
|
OrganizationCommunityType,
|
package/dist/index.js
CHANGED
|
@@ -149,6 +149,11 @@ var IntegrationInstallationStatus = /* @__PURE__ */ ((IntegrationInstallationSta
|
|
|
149
149
|
IntegrationInstallationStatus2["Paused"] = "paused";
|
|
150
150
|
return IntegrationInstallationStatus2;
|
|
151
151
|
})(IntegrationInstallationStatus || {});
|
|
152
|
+
var IntegrationTarget = /* @__PURE__ */ ((IntegrationTarget2) => {
|
|
153
|
+
IntegrationTarget2["Organization"] = "organization";
|
|
154
|
+
IntegrationTarget2["All"] = "all";
|
|
155
|
+
return IntegrationTarget2;
|
|
156
|
+
})(IntegrationTarget || {});
|
|
152
157
|
var BillingInterval = /* @__PURE__ */ ((BillingInterval2) => {
|
|
153
158
|
BillingInterval2["Monthly"] = "monthly";
|
|
154
159
|
BillingInterval2["Yearly"] = "yearly";
|
|
@@ -1663,6 +1668,12 @@ var Api = class extends HttpClient {
|
|
|
1663
1668
|
format: "json",
|
|
1664
1669
|
...params
|
|
1665
1670
|
}),
|
|
1671
|
+
deleteCapture: (organizationId, captureId, params = {}) => this.request({
|
|
1672
|
+
path: `/orgs/${organizationId}/captures/${captureId}`,
|
|
1673
|
+
method: "DELETE",
|
|
1674
|
+
secure: true,
|
|
1675
|
+
...params
|
|
1676
|
+
}),
|
|
1666
1677
|
addEventsToCapture: (organizationId, captureId, data, params = {}) => this.request({
|
|
1667
1678
|
path: `/orgs/${organizationId}/captures/${captureId}/events`,
|
|
1668
1679
|
method: "POST",
|
|
@@ -1796,6 +1807,7 @@ export {
|
|
|
1796
1807
|
IntegrationInstallationSpaceSelection,
|
|
1797
1808
|
IntegrationInstallationStatus,
|
|
1798
1809
|
IntegrationScope,
|
|
1810
|
+
IntegrationTarget,
|
|
1799
1811
|
IntegrationVisibility,
|
|
1800
1812
|
MemberRole,
|
|
1801
1813
|
OrganizationCommunityType,
|
package/package.json
CHANGED
package/spec/openapi.json
CHANGED
|
@@ -467,6 +467,10 @@
|
|
|
467
467
|
"visibility": {
|
|
468
468
|
"$ref": "#/components/schemas/IntegrationVisibility"
|
|
469
469
|
},
|
|
470
|
+
"target": {
|
|
471
|
+
"description": "Allowed installation target for the integration. If not specified, the integration can be installed at `all` targets (org, spaces etc)",
|
|
472
|
+
"$ref": "#/components/schemas/IntegrationTarget"
|
|
473
|
+
},
|
|
470
474
|
"scopes": {
|
|
471
475
|
"$ref": "#/components/schemas/IntegrationScopes"
|
|
472
476
|
},
|
|
@@ -2468,10 +2472,16 @@
|
|
|
2468
2472
|
"type": "string",
|
|
2469
2473
|
"description": "URL of the capture in the API",
|
|
2470
2474
|
"format": "uri"
|
|
2475
|
+
},
|
|
2476
|
+
"app": {
|
|
2477
|
+
"type": "string",
|
|
2478
|
+
"description": "URL of the capture in the app",
|
|
2479
|
+
"format": "uri"
|
|
2471
2480
|
}
|
|
2472
2481
|
},
|
|
2473
2482
|
"required": [
|
|
2474
|
-
"location"
|
|
2483
|
+
"location",
|
|
2484
|
+
"app"
|
|
2475
2485
|
]
|
|
2476
2486
|
}
|
|
2477
2487
|
},
|
|
@@ -3317,18 +3327,22 @@
|
|
|
3317
3327
|
"entity"
|
|
3318
3328
|
]
|
|
3319
3329
|
},
|
|
3320
|
-
"
|
|
3330
|
+
"entityId": {
|
|
3321
3331
|
"type": "string",
|
|
3322
3332
|
"description": "ID of the entity"
|
|
3323
3333
|
},
|
|
3334
|
+
"entityType": {
|
|
3335
|
+
"$ref": "#/components/schemas/EntityType"
|
|
3336
|
+
},
|
|
3324
3337
|
"integration": {
|
|
3325
3338
|
"description": "The name of the integration that manages this entity. If undefined, this entity is not managed by an integration.",
|
|
3326
3339
|
"type": "string"
|
|
3327
3340
|
}
|
|
3328
3341
|
},
|
|
3329
3342
|
"required": [
|
|
3330
|
-
"
|
|
3331
|
-
"
|
|
3343
|
+
"type",
|
|
3344
|
+
"entityId",
|
|
3345
|
+
"entityType"
|
|
3332
3346
|
]
|
|
3333
3347
|
},
|
|
3334
3348
|
{
|
|
@@ -4252,6 +4266,13 @@
|
|
|
4252
4266
|
"secrets"
|
|
4253
4267
|
]
|
|
4254
4268
|
},
|
|
4269
|
+
"IntegrationTarget": {
|
|
4270
|
+
"type": "string",
|
|
4271
|
+
"enum": [
|
|
4272
|
+
"organization",
|
|
4273
|
+
"all"
|
|
4274
|
+
]
|
|
4275
|
+
},
|
|
4255
4276
|
"IntegrationInstallationTarget": {
|
|
4256
4277
|
"oneOf": [
|
|
4257
4278
|
{
|
|
@@ -4455,6 +4476,11 @@
|
|
|
4455
4476
|
"description": "Unique ID for the entity in GitBook"
|
|
4456
4477
|
},
|
|
4457
4478
|
"type": {
|
|
4479
|
+
"deprecated": true,
|
|
4480
|
+
"description": "Type of an entity. Deprecated, use entityType.",
|
|
4481
|
+
"$ref": "#/components/schemas/EntityType"
|
|
4482
|
+
},
|
|
4483
|
+
"entityType": {
|
|
4458
4484
|
"$ref": "#/components/schemas/EntityType"
|
|
4459
4485
|
},
|
|
4460
4486
|
"urls": {
|
|
@@ -4475,6 +4501,7 @@
|
|
|
4475
4501
|
"required": [
|
|
4476
4502
|
"id",
|
|
4477
4503
|
"type",
|
|
4504
|
+
"entityType",
|
|
4478
4505
|
"urls"
|
|
4479
4506
|
]
|
|
4480
4507
|
}
|
|
@@ -15848,7 +15875,7 @@
|
|
|
15848
15875
|
"get": {
|
|
15849
15876
|
"operationId": "listCaptures",
|
|
15850
15877
|
"summary": "List captures",
|
|
15851
|
-
"description": "List captures in an organization.\n",
|
|
15878
|
+
"description": "List captures in an organization, newest first.\n",
|
|
15852
15879
|
"tags": [
|
|
15853
15880
|
"organizations"
|
|
15854
15881
|
],
|
|
@@ -16013,6 +16040,34 @@
|
|
|
16013
16040
|
"$ref": "#/components/responses/UnexpectedError"
|
|
16014
16041
|
}
|
|
16015
16042
|
}
|
|
16043
|
+
},
|
|
16044
|
+
"delete": {
|
|
16045
|
+
"operationId": "deleteCapture",
|
|
16046
|
+
"summary": "Delete a capture by its ID",
|
|
16047
|
+
"tags": [
|
|
16048
|
+
"organizations"
|
|
16049
|
+
],
|
|
16050
|
+
"security": [
|
|
16051
|
+
{
|
|
16052
|
+
"user": []
|
|
16053
|
+
}
|
|
16054
|
+
],
|
|
16055
|
+
"parameters": [
|
|
16056
|
+
{
|
|
16057
|
+
"$ref": "#/components/parameters/organizationId"
|
|
16058
|
+
},
|
|
16059
|
+
{
|
|
16060
|
+
"$ref": "#/components/parameters/captureId"
|
|
16061
|
+
}
|
|
16062
|
+
],
|
|
16063
|
+
"responses": {
|
|
16064
|
+
"200": {
|
|
16065
|
+
"description": "OK"
|
|
16066
|
+
},
|
|
16067
|
+
"default": {
|
|
16068
|
+
"$ref": "#/components/responses/UnexpectedError"
|
|
16069
|
+
}
|
|
16070
|
+
}
|
|
16016
16071
|
}
|
|
16017
16072
|
},
|
|
16018
16073
|
"/orgs/{organizationId}/captures/{captureId}/events": {
|
package/spec/openapi.yaml
CHANGED
|
@@ -336,6 +336,9 @@ components:
|
|
|
336
336
|
description: Base64 content of the image
|
|
337
337
|
visibility:
|
|
338
338
|
$ref: "#/components/schemas/IntegrationVisibility"
|
|
339
|
+
target:
|
|
340
|
+
description: Allowed installation target for the integration. If not specified, the integration can be installed at `all` targets (org, spaces etc)
|
|
341
|
+
$ref: "#/components/schemas/IntegrationTarget"
|
|
339
342
|
scopes:
|
|
340
343
|
$ref: "#/components/schemas/IntegrationScopes"
|
|
341
344
|
categories:
|
|
@@ -1736,8 +1739,13 @@ components:
|
|
|
1736
1739
|
type: string
|
|
1737
1740
|
description: URL of the capture in the API
|
|
1738
1741
|
format: uri
|
|
1742
|
+
app:
|
|
1743
|
+
type: string
|
|
1744
|
+
description: URL of the capture in the app
|
|
1745
|
+
format: uri
|
|
1739
1746
|
required:
|
|
1740
1747
|
- location
|
|
1748
|
+
- app
|
|
1741
1749
|
required:
|
|
1742
1750
|
- object
|
|
1743
1751
|
- id
|
|
@@ -2295,15 +2303,18 @@ components:
|
|
|
2295
2303
|
type: string
|
|
2296
2304
|
enum:
|
|
2297
2305
|
- entity
|
|
2298
|
-
|
|
2306
|
+
entityId:
|
|
2299
2307
|
type: string
|
|
2300
2308
|
description: ID of the entity
|
|
2309
|
+
entityType:
|
|
2310
|
+
$ref: "#/components/schemas/EntityType"
|
|
2301
2311
|
integration:
|
|
2302
2312
|
description: The name of the integration that manages this entity. If undefined, this entity is not managed by an integration.
|
|
2303
2313
|
type: string
|
|
2304
2314
|
required:
|
|
2305
|
-
- id
|
|
2306
2315
|
- type
|
|
2316
|
+
- entityId
|
|
2317
|
+
- entityType
|
|
2307
2318
|
- type: object
|
|
2308
2319
|
properties:
|
|
2309
2320
|
type:
|
|
@@ -2953,6 +2964,11 @@ components:
|
|
|
2953
2964
|
- apiTokens
|
|
2954
2965
|
- integration
|
|
2955
2966
|
- secrets
|
|
2967
|
+
IntegrationTarget:
|
|
2968
|
+
type: string
|
|
2969
|
+
enum:
|
|
2970
|
+
- organization
|
|
2971
|
+
- all
|
|
2956
2972
|
IntegrationInstallationTarget:
|
|
2957
2973
|
oneOf:
|
|
2958
2974
|
- $ref: "#/components/schemas/OrganizationTarget"
|
|
@@ -3084,6 +3100,10 @@ components:
|
|
|
3084
3100
|
type: string
|
|
3085
3101
|
description: Unique ID for the entity in GitBook
|
|
3086
3102
|
type:
|
|
3103
|
+
deprecated: true
|
|
3104
|
+
description: Type of an entity. Deprecated, use entityType.
|
|
3105
|
+
$ref: "#/components/schemas/EntityType"
|
|
3106
|
+
entityType:
|
|
3087
3107
|
$ref: "#/components/schemas/EntityType"
|
|
3088
3108
|
urls:
|
|
3089
3109
|
type: object
|
|
@@ -3098,6 +3118,7 @@ components:
|
|
|
3098
3118
|
required:
|
|
3099
3119
|
- id
|
|
3100
3120
|
- type
|
|
3121
|
+
- entityType
|
|
3101
3122
|
- urls
|
|
3102
3123
|
EntityType:
|
|
3103
3124
|
type: string
|
|
@@ -9763,7 +9784,7 @@ paths:
|
|
|
9763
9784
|
operationId: listCaptures
|
|
9764
9785
|
summary: List captures
|
|
9765
9786
|
description: |
|
|
9766
|
-
List captures in an organization.
|
|
9787
|
+
List captures in an organization, newest first.
|
|
9767
9788
|
tags:
|
|
9768
9789
|
- organizations
|
|
9769
9790
|
security:
|
|
@@ -9854,6 +9875,21 @@ paths:
|
|
|
9854
9875
|
$ref: "#/components/schemas/Capture"
|
|
9855
9876
|
default:
|
|
9856
9877
|
$ref: "#/components/responses/UnexpectedError"
|
|
9878
|
+
delete:
|
|
9879
|
+
operationId: deleteCapture
|
|
9880
|
+
summary: Delete a capture by its ID
|
|
9881
|
+
tags:
|
|
9882
|
+
- organizations
|
|
9883
|
+
security:
|
|
9884
|
+
- user: []
|
|
9885
|
+
parameters:
|
|
9886
|
+
- $ref: "#/components/parameters/organizationId"
|
|
9887
|
+
- $ref: "#/components/parameters/captureId"
|
|
9888
|
+
responses:
|
|
9889
|
+
"200":
|
|
9890
|
+
description: OK
|
|
9891
|
+
default:
|
|
9892
|
+
$ref: "#/components/responses/UnexpectedError"
|
|
9857
9893
|
"/orgs/{organizationId}/captures/{captureId}/events":
|
|
9858
9894
|
post:
|
|
9859
9895
|
operationId: addEventsToCapture
|