@gitbook/api 0.192.0 → 0.193.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 +66 -2
- package/dist/index.cjs +3 -2
- package/dist/index.js +3 -2
- package/package.json +1 -1
- package/spec/openapi.json +203 -3
- package/spec/openapi.yaml +139 -3
package/dist/client.d.ts
CHANGED
|
@@ -1137,6 +1137,14 @@ export type ContentKitInlineElement = ContentKitText | ContentKitImage | Content
|
|
|
1137
1137
|
export type ContentKitDescendantElement = ContentKitButton | ContentKitTextInput | ContentKitHStack | ContentKitVStack | ContentKitBox | ContentKitDivider | ContentKitWebFrame | ContentKitCodeBlock | ContentKitMarkdown | ContentKitCard | ContentKitImage | ContentKitInput | ContentKitSelect | ContentKitSwitch | ContentKitCheckbox | ContentKitRadio | ContentKitText | ContentKitHint | ContentKitLink | ContentKitStepperStep;
|
|
1138
1138
|
/** Any event that can be received from GitBook. */
|
|
1139
1139
|
export type Event = InstallationSetupEvent | InstallationDeletedEvent | SpaceInstallationSetupEvent | SpaceInstallationDeletedEvent | SiteInstallationSetupEvent | SiteInstallationDeletedEvent | SiteViewEvent | SpaceContentUpdatedEvent | SpaceGitSyncCompletedEvent | SpaceGitSyncStartedEvent | SpaceVisibilityUpdatedEvent | TaskEvent | FetchEvent | FetchPublishedScriptEvent | FetchVisitorAuthenticationEvent | UIRenderEvent | ContentComputeDocumentEvent | ContentComputeRevisionEvent | PageFeedbackEvent;
|
|
1140
|
+
/** An outcome of a content change. */
|
|
1141
|
+
export type ChangeRequestContentUpdateChange = ({
|
|
1142
|
+
object: "created_page";
|
|
1143
|
+
} & ChangeRequestContentUpdateInsertedPage) | ({
|
|
1144
|
+
object: "updated_page";
|
|
1145
|
+
} & ChangeRequestContentUpdateUpdatedPage) | ({
|
|
1146
|
+
object: "deleted_page";
|
|
1147
|
+
} & ChangeRequestContentUpdateDeletedPage);
|
|
1140
1148
|
export type ChangeRequestContentChange = ({
|
|
1141
1149
|
operation: "update_page";
|
|
1142
1150
|
} & ChangeRequestContentChangeUpdatePage) | ({
|
|
@@ -3311,6 +3319,8 @@ export interface RevisionPageUpdate {
|
|
|
3311
3319
|
* @minLength 1
|
|
3312
3320
|
*/
|
|
3313
3321
|
title?: string;
|
|
3322
|
+
/** Slug of the page in its parent, used to build the page's path. When omitted, the slug is derived from the title. The slug must be unique among the page's siblings; any collision is rejected. */
|
|
3323
|
+
slug?: RevisionPageSlug;
|
|
3314
3324
|
/** Emoji of the page. Set to an empty string to remove it. */
|
|
3315
3325
|
emoji?: Emoji;
|
|
3316
3326
|
/** Icon of the page. Set to an empty string to remove it. */
|
|
@@ -3350,6 +3360,8 @@ export type ChangeRequestContentChangeInsertPage = RevisionPageUpdate & {
|
|
|
3350
3360
|
* @min 0
|
|
3351
3361
|
*/
|
|
3352
3362
|
at?: number;
|
|
3363
|
+
/** Temporary local reference for the page, used only for the lifetime of this request and never persisted. Other pages inserted in the same batch can link to this page by its ref (e.g. `[Page](./<ref>.md)`), which resolves to the page's ID at apply time — regardless of operation order or the page's eventual slug. A ref must be unique within the batch and must not collide with an existing page's path. */
|
|
3364
|
+
ref?: string;
|
|
3353
3365
|
/** Document for the new page. When provided as markdown, its frontmatter is read to set the page metadata. */
|
|
3354
3366
|
document: Document;
|
|
3355
3367
|
};
|
|
@@ -3375,6 +3387,46 @@ export interface ChangeRequestContentChangeRevertPage {
|
|
|
3375
3387
|
/** Keys of the specific blocks to revert within the page's document, as they appear in the page's document. If omitted, the whole page is reverted. */
|
|
3376
3388
|
block?: string[];
|
|
3377
3389
|
}
|
|
3390
|
+
export interface ChangeRequestContentUpdatePageRef {
|
|
3391
|
+
/** Type of Object, always equals to "page". */
|
|
3392
|
+
object: "page";
|
|
3393
|
+
/** Unique identifier of the page. */
|
|
3394
|
+
id: string;
|
|
3395
|
+
urls: {
|
|
3396
|
+
/** API URL to fetch the page's full, normalized content. */
|
|
3397
|
+
location: URL;
|
|
3398
|
+
};
|
|
3399
|
+
}
|
|
3400
|
+
/** A page created by the operation with its resolved ID, ref as passed by the caller, and a URL to fetch its content. */
|
|
3401
|
+
export interface ChangeRequestContentUpdateInsertedPage {
|
|
3402
|
+
/** Type of Object, always equals to "created_page". */
|
|
3403
|
+
object: "created_page";
|
|
3404
|
+
/** The batch-local `ref` provided on the insert operation, echoed so the caller can map their reference to the created page's ID. Absent when the operation had no ref. */
|
|
3405
|
+
ref?: string;
|
|
3406
|
+
/** Reference to the created page, with a URL to fetch its normalized content. */
|
|
3407
|
+
page: ChangeRequestContentUpdatePageRef;
|
|
3408
|
+
}
|
|
3409
|
+
/** A page updated by the operation, with a URL to fetch its content. */
|
|
3410
|
+
export interface ChangeRequestContentUpdateUpdatedPage {
|
|
3411
|
+
/** Type of Object, always equals to "updated_page". */
|
|
3412
|
+
object: "updated_page";
|
|
3413
|
+
/** Reference to the updated page, with a URL to fetch its normalized content. */
|
|
3414
|
+
page: ChangeRequestContentUpdatePageRef;
|
|
3415
|
+
}
|
|
3416
|
+
/** A page deleted by the batch. Only its ID is returned, as it no longer has content. */
|
|
3417
|
+
export interface ChangeRequestContentUpdateDeletedPage {
|
|
3418
|
+
/** Type of Object, always equals to "deleted_page". */
|
|
3419
|
+
object: "deleted_page";
|
|
3420
|
+
/** ID of the deleted page. */
|
|
3421
|
+
page: string;
|
|
3422
|
+
}
|
|
3423
|
+
/** The result of applying a batch of content changes. */
|
|
3424
|
+
export interface ChangeRequestContentUpdate {
|
|
3425
|
+
/** The change request after the batch was applied. */
|
|
3426
|
+
changeRequest: ChangeRequest;
|
|
3427
|
+
/** One entry per affected page (deduplicated), in the order the pages were first touched by the batch. */
|
|
3428
|
+
changes: ChangeRequestContentUpdateChange[];
|
|
3429
|
+
}
|
|
3378
3430
|
export interface ChangedRevisionPage {
|
|
3379
3431
|
id: string;
|
|
3380
3432
|
type: RevisionPageType;
|
|
@@ -5079,6 +5131,8 @@ export interface SiteSpace {
|
|
|
5079
5131
|
default?: boolean;
|
|
5080
5132
|
/** Conditional expression used to evaluate whether the site space should be shown to the site's visitor. */
|
|
5081
5133
|
condition?: Expression;
|
|
5134
|
+
/** Custom home page within the space, rendered at the site space's path root instead of the space's default landing page. */
|
|
5135
|
+
pageId?: string | null;
|
|
5082
5136
|
/** Whether the site space is draft and not live. */
|
|
5083
5137
|
draft: boolean;
|
|
5084
5138
|
/** Whether the space has advanced customization feature enabled */
|
|
@@ -10930,7 +10984,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
10930
10984
|
computed?: boolean;
|
|
10931
10985
|
}, params?: RequestParams) => Promise<HttpResponse<Revision, any>>;
|
|
10932
10986
|
/**
|
|
10933
|
-
* @description Applies an ordered array of content changes (up to 50) to the change request atomically, creating a single new revision. Changes are applied sequentially; if any single change is invalid the entire batch is rejected and no revision is created. Use this to create, update, move, or delete pages within a change request before merging to live. This is the primary way to programmatically author content in a change request. When page content is provided as markdown, links to other pages are resolved against the change request's current page tree. You can link a page by: - Page ID — `/pages/<pageId>` (also `/pages/<pageId>#anchor`). - Page slug path — `/pages/<slug>` for a top-level page, or `/pages/<parent-slug>/<slug>` for a nested page (e.g. `/pages/guides/getting-started`). - Markdown file path — the path the page would have in Git: `/pages/<slug>.md` for a page, or `/pages/<slug>/README.md` for a page that has child pages. The space's root page is `/pages/README.md`. - Relative markdown link — resolved against the page being edited, e.g. `./sibling.md`, `../other.md`, or `../README.md` (the parent page). Folder-style links without an extension (e.g. `./section`) resolve to that folder's page. External URLs (`https://…`) are kept as-is. A link that does not match any page in the change request is left as plain text rather than causing the request to fail.
|
|
10987
|
+
* @description Applies an ordered array of content changes (up to 50) to the change request atomically, creating a single new revision. Changes are applied sequentially; if any single change is invalid the entire batch is rejected and no revision is created. Use this to create, update, move, or delete pages within a change request before merging to live. This is the primary way to programmatically author content in a change request. When page content is provided as markdown, links to other pages are resolved against the change request's current page tree. You can link a page by: - Page ID — `/pages/<pageId>` (also `/pages/<pageId>#anchor`). - Page slug path — `/pages/<slug>` for a top-level page, or `/pages/<parent-slug>/<slug>` for a nested page (e.g. `/pages/guides/getting-started`). - Markdown file path — the path the page would have in Git: `/pages/<slug>.md` for a page, or `/pages/<slug>/README.md` for a page that has child pages. The space's root page is `/pages/README.md`. - Relative markdown link — resolved against the page being edited, e.g. `./sibling.md`, `../other.md`, or `../README.md` (the parent page). Folder-style links without an extension (e.g. `./section`) resolve to that folder's page. External URLs (`https://…`) are kept as-is. A link that does not match any page in the change request is left as plain text rather than causing the request to fail. GitBook normalizes submitted content, so the stored page may differ from what was sent. To help callers reconcile local state with the stored result, the response can list each created and modified page with its resolved ID and a `urls.location` to fetch the page's persisted content. **Response shape (`compat`)** — this endpoint is changing what it returns: - `compat=true` (current default) returns the updated change request, matching the endpoint's original behavior. - `compat=false` returns the updated change request **and** the list of affected pages (see the response schema). The default is `true` for now to preserve backwards compatibility, but **will switch to `false` in a future release**, at which point the affected-page list is always included. You should pass `compat=false` if you want the new behavior today and avoid unexpected errors when the default flips in the future.
|
|
10934
10988
|
*
|
|
10935
10989
|
* @tags change-request-content
|
|
10936
10990
|
* @name UpdateChangeRequestContent
|
|
@@ -10944,7 +10998,13 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
10944
10998
|
* @minItems 1
|
|
10945
10999
|
*/
|
|
10946
11000
|
changes: ChangeRequestContentChange[];
|
|
10947
|
-
},
|
|
11001
|
+
}, query?: {
|
|
11002
|
+
/**
|
|
11003
|
+
* When `true`, the updated change request is returned. When `false`, the updated change request and the list of affected pages are returned.
|
|
11004
|
+
* @default true
|
|
11005
|
+
*/
|
|
11006
|
+
compat?: boolean;
|
|
11007
|
+
}, params?: RequestParams) => Promise<HttpResponse<ChangeRequest | ChangeRequestContentUpdate, {
|
|
10948
11008
|
error: {
|
|
10949
11009
|
/** @format int32 */
|
|
10950
11010
|
code: 404;
|
|
@@ -14511,6 +14571,8 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
14511
14571
|
* @default false
|
|
14512
14572
|
*/
|
|
14513
14573
|
draft?: boolean;
|
|
14574
|
+
/** Custom home page within the space, rendered at the site space's path root instead of the space's default landing page. */
|
|
14575
|
+
pageId?: string | null;
|
|
14514
14576
|
}, params?: RequestParams) => Promise<HttpResponse<SiteSpace, any>>;
|
|
14515
14577
|
/**
|
|
14516
14578
|
* @description Returns a paginated list of site spaces — the links between a site and its content source spaces. Each site space can be a language variant or content version within a section. Use the default filter to retrieve only the primary site space, or omit it to get all linked spaces including drafts.
|
|
@@ -15429,6 +15491,8 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
15429
15491
|
path?: SiteSpacePath;
|
|
15430
15492
|
/** Conditional expression used to evaluate whether the site space should be shown to the site's visitor (should evaluate to a boolean). If not set, the condition will remain unchanged. If set to null, the condition will be removed. */
|
|
15431
15493
|
condition?: Expression | null;
|
|
15494
|
+
/** Custom home page within the space, rendered at the site space's path root instead of the space's default landing page. If not set, the page will remain unchanged unless spaceId is changed, in which case the custom home page will be removed. If set to null, the custom home page will be removed. */
|
|
15495
|
+
pageId?: string | null;
|
|
15432
15496
|
/** The content that this site space points to. If not set, the space will remain unchanged. */
|
|
15433
15497
|
spaceId?: string;
|
|
15434
15498
|
/** Whether the site space is hidden. If true, the site space will not be shown in the site's navigation. If not set, the hidden state will remain unchanged. If set to false, the site space will be shown in site navigation. */
|
package/dist/index.cjs
CHANGED
|
@@ -528,7 +528,7 @@ module.exports = __toCommonJS(src_exports);
|
|
|
528
528
|
|
|
529
529
|
// package.json
|
|
530
530
|
var name = "@gitbook/api";
|
|
531
|
-
var version = "0.
|
|
531
|
+
var version = "0.193.0";
|
|
532
532
|
|
|
533
533
|
// src/client.ts
|
|
534
534
|
var import_event_iterator = __toESM(require_node(), 1);
|
|
@@ -2380,9 +2380,10 @@ var Api = class extends HttpClient {
|
|
|
2380
2380
|
format: "json",
|
|
2381
2381
|
...params
|
|
2382
2382
|
}),
|
|
2383
|
-
updateChangeRequestContent: (spaceId, changeRequestId, data, params = {}) => this.request({
|
|
2383
|
+
updateChangeRequestContent: (spaceId, changeRequestId, data, query, params = {}) => this.request({
|
|
2384
2384
|
path: `/spaces/${spaceId}/change-requests/${changeRequestId}/content`,
|
|
2385
2385
|
method: "POST",
|
|
2386
|
+
query,
|
|
2386
2387
|
body: data,
|
|
2387
2388
|
secure: true,
|
|
2388
2389
|
type: "application/json" /* Json */,
|
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.
|
|
175
|
+
var version = "0.193.0";
|
|
176
176
|
|
|
177
177
|
// src/client.ts
|
|
178
178
|
var import_event_iterator = __toESM(require_node(), 1);
|
|
@@ -2024,9 +2024,10 @@ var Api = class extends HttpClient {
|
|
|
2024
2024
|
format: "json",
|
|
2025
2025
|
...params
|
|
2026
2026
|
}),
|
|
2027
|
-
updateChangeRequestContent: (spaceId, changeRequestId, data, params = {}) => this.request({
|
|
2027
|
+
updateChangeRequestContent: (spaceId, changeRequestId, data, query, params = {}) => this.request({
|
|
2028
2028
|
path: `/spaces/${spaceId}/change-requests/${changeRequestId}/content`,
|
|
2029
2029
|
method: "POST",
|
|
2030
|
+
query,
|
|
2030
2031
|
body: data,
|
|
2031
2032
|
secure: true,
|
|
2032
2033
|
type: "application/json" /* Json */,
|
package/package.json
CHANGED
package/spec/openapi.json
CHANGED
|
@@ -3867,7 +3867,7 @@
|
|
|
3867
3867
|
"post": {
|
|
3868
3868
|
"operationId": "updateChangeRequestContent",
|
|
3869
3869
|
"summary": "Apply a batch of content changes to a change request",
|
|
3870
|
-
"description": "Applies an ordered array of content changes (up to 50) to the change request atomically, creating a single new revision. Changes are applied sequentially; if any single change is invalid the entire batch is rejected and no revision is created. Use this to create, update, move, or delete pages within a change request before merging to live. This is the primary way to programmatically author content in a change request.\
|
|
3870
|
+
"description": "Applies an ordered array of content changes (up to 50) to the change request atomically, creating a single new revision. Changes are applied sequentially; if any single change is invalid the entire batch is rejected and no revision is created. Use this to create, update, move, or delete pages within a change request before merging to live. This is the primary way to programmatically author content in a change request.\nWhen page content is provided as markdown, links to other pages are resolved against the change request's current page tree. You can link a page by:\n- Page ID — `/pages/<pageId>` (also `/pages/<pageId>#anchor`).\n- Page slug path — `/pages/<slug>` for a top-level page, or `/pages/<parent-slug>/<slug>`\n for a nested page (e.g. `/pages/guides/getting-started`).\n\n- Markdown file path — the path the page would have in Git: `/pages/<slug>.md` for a page,\n or `/pages/<slug>/README.md` for a page that has child pages. The space's root page is\n `/pages/README.md`.\n\n- Relative markdown link — resolved against the page being edited, e.g. `./sibling.md`,\n `../other.md`, or `../README.md` (the parent page). Folder-style links without an\n extension (e.g. `./section`) resolve to that folder's page.\n\nExternal URLs (`https://…`) are kept as-is. A link that does not match any page in the change request is left as plain text rather than causing the request to fail.\nGitBook normalizes submitted content, so the stored page may differ from what was sent. To help callers reconcile local state with the stored result, the response can list each created and modified page with its resolved ID and a `urls.location` to fetch the page's persisted content.\n\n**Response shape (`compat`)** — this endpoint is changing what it returns:\n- `compat=true` (current default) returns the updated change request, matching the endpoint's\n original behavior.\n\n- `compat=false` returns the updated change request **and** the list of affected pages (see\n the response schema).\n\nThe default is `true` for now to preserve backwards compatibility, but **will switch to `false` in a future release**, at which point the affected-page list is always included. You should pass `compat=false` if you want the new behavior today and avoid unexpected errors when the default flips in the future.",
|
|
3871
3871
|
"x-gitbook-mcp": true,
|
|
3872
3872
|
"tags": [
|
|
3873
3873
|
"change-request-content"
|
|
@@ -3888,6 +3888,15 @@
|
|
|
3888
3888
|
},
|
|
3889
3889
|
{
|
|
3890
3890
|
"$ref": "#/components/parameters/changeRequestId"
|
|
3891
|
+
},
|
|
3892
|
+
{
|
|
3893
|
+
"name": "compat",
|
|
3894
|
+
"in": "query",
|
|
3895
|
+
"description": "When `true`, the updated change request is returned. When `false`, the updated change request and the list of affected pages are returned.",
|
|
3896
|
+
"schema": {
|
|
3897
|
+
"type": "boolean",
|
|
3898
|
+
"default": true
|
|
3899
|
+
}
|
|
3891
3900
|
}
|
|
3892
3901
|
],
|
|
3893
3902
|
"requestBody": {
|
|
@@ -3919,7 +3928,15 @@
|
|
|
3919
3928
|
"content": {
|
|
3920
3929
|
"application/json": {
|
|
3921
3930
|
"schema": {
|
|
3922
|
-
"
|
|
3931
|
+
"description": "The change request when `compat=true` (default), or the change request plus the list of affected pages when `compat=false`.",
|
|
3932
|
+
"oneOf": [
|
|
3933
|
+
{
|
|
3934
|
+
"$ref": "#/components/schemas/ChangeRequest"
|
|
3935
|
+
},
|
|
3936
|
+
{
|
|
3937
|
+
"$ref": "#/components/schemas/ChangeRequestContentUpdate"
|
|
3938
|
+
}
|
|
3939
|
+
]
|
|
3923
3940
|
}
|
|
3924
3941
|
}
|
|
3925
3942
|
}
|
|
@@ -13897,6 +13914,17 @@
|
|
|
13897
13914
|
"type": "boolean",
|
|
13898
13915
|
"default": false,
|
|
13899
13916
|
"description": "Whether the site space should be created as draft. Defaults to false."
|
|
13917
|
+
},
|
|
13918
|
+
"pageId": {
|
|
13919
|
+
"oneOf": [
|
|
13920
|
+
{
|
|
13921
|
+
"type": "string"
|
|
13922
|
+
},
|
|
13923
|
+
{
|
|
13924
|
+
"type": "null"
|
|
13925
|
+
}
|
|
13926
|
+
],
|
|
13927
|
+
"description": "Custom home page within the space, rendered at the site space's path root instead of the space's default landing page."
|
|
13900
13928
|
}
|
|
13901
13929
|
},
|
|
13902
13930
|
"required": [
|
|
@@ -17282,6 +17310,17 @@
|
|
|
17282
17310
|
}
|
|
17283
17311
|
]
|
|
17284
17312
|
},
|
|
17313
|
+
"pageId": {
|
|
17314
|
+
"description": "Custom home page within the space, rendered at the site space's path root instead of the space's default landing page. If not set, the page will remain unchanged unless spaceId is changed, in which case the custom home page will be removed. If set to null, the custom home page will be removed.",
|
|
17315
|
+
"oneOf": [
|
|
17316
|
+
{
|
|
17317
|
+
"type": "string"
|
|
17318
|
+
},
|
|
17319
|
+
{
|
|
17320
|
+
"type": "null"
|
|
17321
|
+
}
|
|
17322
|
+
]
|
|
17323
|
+
},
|
|
17285
17324
|
"spaceId": {
|
|
17286
17325
|
"type": "string",
|
|
17287
17326
|
"description": "The content that this site space points to. If not set, the space will remain unchanged."
|
|
@@ -30703,6 +30742,10 @@
|
|
|
30703
30742
|
"minLength": 1,
|
|
30704
30743
|
"description": "Title of the page."
|
|
30705
30744
|
},
|
|
30745
|
+
"slug": {
|
|
30746
|
+
"description": "Slug of the page in its parent, used to build the page's path. When omitted, the slug is derived from the title. The slug must be unique among the page's siblings; any collision is rejected.",
|
|
30747
|
+
"$ref": "#/components/schemas/RevisionPageSlug"
|
|
30748
|
+
},
|
|
30706
30749
|
"emoji": {
|
|
30707
30750
|
"description": "Emoji of the page. Set to an empty string to remove it.",
|
|
30708
30751
|
"$ref": "#/components/schemas/Emoji"
|
|
@@ -30781,7 +30824,6 @@
|
|
|
30781
30824
|
"type": "object",
|
|
30782
30825
|
"required": [
|
|
30783
30826
|
"operation",
|
|
30784
|
-
"title",
|
|
30785
30827
|
"document"
|
|
30786
30828
|
],
|
|
30787
30829
|
"properties": {
|
|
@@ -30800,6 +30842,10 @@
|
|
|
30800
30842
|
"minimum": 0,
|
|
30801
30843
|
"description": "Zero-based index to insert the page at among its siblings. If omitted, the page is appended at the end."
|
|
30802
30844
|
},
|
|
30845
|
+
"ref": {
|
|
30846
|
+
"type": "string",
|
|
30847
|
+
"description": "Temporary local reference for the page, used only for the lifetime of this request and never persisted. Other pages inserted in the same batch can link to this page by its ref (e.g. `[Page](./<ref>.md)`), which resolves to the page's ID at apply time — regardless of operation order or the page's eventual slug. A ref must be unique within the batch and must not collide with an existing page's path."
|
|
30848
|
+
},
|
|
30803
30849
|
"document": {
|
|
30804
30850
|
"description": "Document for the new page. When provided as markdown, its frontmatter is read to set the page metadata.",
|
|
30805
30851
|
"$ref": "#/components/schemas/Document"
|
|
@@ -30899,6 +30945,149 @@
|
|
|
30899
30945
|
}
|
|
30900
30946
|
}
|
|
30901
30947
|
},
|
|
30948
|
+
"ChangeRequestContentUpdatePageRef": {
|
|
30949
|
+
"type": "object",
|
|
30950
|
+
"required": [
|
|
30951
|
+
"object",
|
|
30952
|
+
"id",
|
|
30953
|
+
"urls"
|
|
30954
|
+
],
|
|
30955
|
+
"properties": {
|
|
30956
|
+
"object": {
|
|
30957
|
+
"type": "string",
|
|
30958
|
+
"description": "Type of Object, always equals to \"page\".",
|
|
30959
|
+
"enum": [
|
|
30960
|
+
"page"
|
|
30961
|
+
]
|
|
30962
|
+
},
|
|
30963
|
+
"id": {
|
|
30964
|
+
"type": "string",
|
|
30965
|
+
"description": "Unique identifier of the page."
|
|
30966
|
+
},
|
|
30967
|
+
"urls": {
|
|
30968
|
+
"type": "object",
|
|
30969
|
+
"required": [
|
|
30970
|
+
"location"
|
|
30971
|
+
],
|
|
30972
|
+
"properties": {
|
|
30973
|
+
"location": {
|
|
30974
|
+
"description": "API URL to fetch the page's full, normalized content.",
|
|
30975
|
+
"$ref": "#/components/schemas/URL"
|
|
30976
|
+
}
|
|
30977
|
+
}
|
|
30978
|
+
}
|
|
30979
|
+
}
|
|
30980
|
+
},
|
|
30981
|
+
"ChangeRequestContentUpdateInsertedPage": {
|
|
30982
|
+
"type": "object",
|
|
30983
|
+
"description": "A page created by the operation with its resolved ID, ref as passed by the caller, and a URL to fetch its content.",
|
|
30984
|
+
"required": [
|
|
30985
|
+
"object",
|
|
30986
|
+
"page"
|
|
30987
|
+
],
|
|
30988
|
+
"properties": {
|
|
30989
|
+
"object": {
|
|
30990
|
+
"type": "string",
|
|
30991
|
+
"description": "Type of Object, always equals to \"created_page\".",
|
|
30992
|
+
"enum": [
|
|
30993
|
+
"created_page"
|
|
30994
|
+
]
|
|
30995
|
+
},
|
|
30996
|
+
"ref": {
|
|
30997
|
+
"type": "string",
|
|
30998
|
+
"description": "The batch-local `ref` provided on the insert operation, echoed so the caller can map their reference to the created page's ID. Absent when the operation had no ref."
|
|
30999
|
+
},
|
|
31000
|
+
"page": {
|
|
31001
|
+
"description": "Reference to the created page, with a URL to fetch its normalized content.",
|
|
31002
|
+
"$ref": "#/components/schemas/ChangeRequestContentUpdatePageRef"
|
|
31003
|
+
}
|
|
31004
|
+
}
|
|
31005
|
+
},
|
|
31006
|
+
"ChangeRequestContentUpdateUpdatedPage": {
|
|
31007
|
+
"type": "object",
|
|
31008
|
+
"description": "A page updated by the operation, with a URL to fetch its content.",
|
|
31009
|
+
"required": [
|
|
31010
|
+
"object",
|
|
31011
|
+
"page"
|
|
31012
|
+
],
|
|
31013
|
+
"properties": {
|
|
31014
|
+
"object": {
|
|
31015
|
+
"type": "string",
|
|
31016
|
+
"description": "Type of Object, always equals to \"updated_page\".",
|
|
31017
|
+
"enum": [
|
|
31018
|
+
"updated_page"
|
|
31019
|
+
]
|
|
31020
|
+
},
|
|
31021
|
+
"page": {
|
|
31022
|
+
"description": "Reference to the updated page, with a URL to fetch its normalized content.",
|
|
31023
|
+
"$ref": "#/components/schemas/ChangeRequestContentUpdatePageRef"
|
|
31024
|
+
}
|
|
31025
|
+
}
|
|
31026
|
+
},
|
|
31027
|
+
"ChangeRequestContentUpdateDeletedPage": {
|
|
31028
|
+
"type": "object",
|
|
31029
|
+
"description": "A page deleted by the batch. Only its ID is returned, as it no longer has content.",
|
|
31030
|
+
"required": [
|
|
31031
|
+
"object",
|
|
31032
|
+
"page"
|
|
31033
|
+
],
|
|
31034
|
+
"properties": {
|
|
31035
|
+
"object": {
|
|
31036
|
+
"type": "string",
|
|
31037
|
+
"description": "Type of Object, always equals to \"deleted_page\".",
|
|
31038
|
+
"enum": [
|
|
31039
|
+
"deleted_page"
|
|
31040
|
+
]
|
|
31041
|
+
},
|
|
31042
|
+
"page": {
|
|
31043
|
+
"type": "string",
|
|
31044
|
+
"description": "ID of the deleted page."
|
|
31045
|
+
}
|
|
31046
|
+
}
|
|
31047
|
+
},
|
|
31048
|
+
"ChangeRequestContentUpdateChange": {
|
|
31049
|
+
"description": "An outcome of a content change.",
|
|
31050
|
+
"oneOf": [
|
|
31051
|
+
{
|
|
31052
|
+
"$ref": "#/components/schemas/ChangeRequestContentUpdateInsertedPage"
|
|
31053
|
+
},
|
|
31054
|
+
{
|
|
31055
|
+
"$ref": "#/components/schemas/ChangeRequestContentUpdateUpdatedPage"
|
|
31056
|
+
},
|
|
31057
|
+
{
|
|
31058
|
+
"$ref": "#/components/schemas/ChangeRequestContentUpdateDeletedPage"
|
|
31059
|
+
}
|
|
31060
|
+
],
|
|
31061
|
+
"discriminator": {
|
|
31062
|
+
"propertyName": "object",
|
|
31063
|
+
"mapping": {
|
|
31064
|
+
"created_page": "#/components/schemas/ChangeRequestContentUpdateInsertedPage",
|
|
31065
|
+
"updated_page": "#/components/schemas/ChangeRequestContentUpdateUpdatedPage",
|
|
31066
|
+
"deleted_page": "#/components/schemas/ChangeRequestContentUpdateDeletedPage"
|
|
31067
|
+
}
|
|
31068
|
+
}
|
|
31069
|
+
},
|
|
31070
|
+
"ChangeRequestContentUpdate": {
|
|
31071
|
+
"type": "object",
|
|
31072
|
+
"description": "The result of applying a batch of content changes.",
|
|
31073
|
+
"required": [
|
|
31074
|
+
"changeRequest",
|
|
31075
|
+
"changes"
|
|
31076
|
+
],
|
|
31077
|
+
"properties": {
|
|
31078
|
+
"changeRequest": {
|
|
31079
|
+
"description": "The change request after the batch was applied.",
|
|
31080
|
+
"$ref": "#/components/schemas/ChangeRequest"
|
|
31081
|
+
},
|
|
31082
|
+
"changes": {
|
|
31083
|
+
"type": "array",
|
|
31084
|
+
"description": "One entry per affected page (deduplicated), in the order the pages were first touched by the batch.",
|
|
31085
|
+
"items": {
|
|
31086
|
+
"$ref": "#/components/schemas/ChangeRequestContentUpdateChange"
|
|
31087
|
+
}
|
|
31088
|
+
}
|
|
31089
|
+
}
|
|
31090
|
+
},
|
|
30902
31091
|
"RevisionPageType": {
|
|
30903
31092
|
"type": "string",
|
|
30904
31093
|
"enum": [
|
|
@@ -36405,6 +36594,17 @@
|
|
|
36405
36594
|
"description": "Conditional expression used to evaluate whether the site space should be shown to the site's visitor.",
|
|
36406
36595
|
"$ref": "#/components/schemas/Expression"
|
|
36407
36596
|
},
|
|
36597
|
+
"pageId": {
|
|
36598
|
+
"oneOf": [
|
|
36599
|
+
{
|
|
36600
|
+
"type": "string"
|
|
36601
|
+
},
|
|
36602
|
+
{
|
|
36603
|
+
"type": "null"
|
|
36604
|
+
}
|
|
36605
|
+
],
|
|
36606
|
+
"description": "Custom home page within the space, rendered at the site space's path root instead of the space's default landing page."
|
|
36607
|
+
},
|
|
36408
36608
|
"draft": {
|
|
36409
36609
|
"type": "boolean",
|
|
36410
36610
|
"description": "Whether the site space is draft and not live."
|
package/spec/openapi.yaml
CHANGED
|
@@ -2375,7 +2375,6 @@ paths:
|
|
|
2375
2375
|
summary: Apply a batch of content changes to a change request
|
|
2376
2376
|
description: |-
|
|
2377
2377
|
Applies an ordered array of content changes (up to 50) to the change request atomically, creating a single new revision. Changes are applied sequentially; if any single change is invalid the entire batch is rejected and no revision is created. Use this to create, update, move, or delete pages within a change request before merging to live. This is the primary way to programmatically author content in a change request.
|
|
2378
|
-
|
|
2379
2378
|
When page content is provided as markdown, links to other pages are resolved against the change request's current page tree. You can link a page by:
|
|
2380
2379
|
- Page ID — `/pages/<pageId>` (also `/pages/<pageId>#anchor`).
|
|
2381
2380
|
- Page slug path — `/pages/<slug>` for a top-level page, or `/pages/<parent-slug>/<slug>`
|
|
@@ -2390,6 +2389,16 @@ paths:
|
|
|
2390
2389
|
extension (e.g. `./section`) resolve to that folder's page.
|
|
2391
2390
|
|
|
2392
2391
|
External URLs (`https://…`) are kept as-is. A link that does not match any page in the change request is left as plain text rather than causing the request to fail.
|
|
2392
|
+
GitBook normalizes submitted content, so the stored page may differ from what was sent. To help callers reconcile local state with the stored result, the response can list each created and modified page with its resolved ID and a `urls.location` to fetch the page's persisted content.
|
|
2393
|
+
|
|
2394
|
+
**Response shape (`compat`)** — this endpoint is changing what it returns:
|
|
2395
|
+
- `compat=true` (current default) returns the updated change request, matching the endpoint's
|
|
2396
|
+
original behavior.
|
|
2397
|
+
|
|
2398
|
+
- `compat=false` returns the updated change request **and** the list of affected pages (see
|
|
2399
|
+
the response schema).
|
|
2400
|
+
|
|
2401
|
+
The default is `true` for now to preserve backwards compatibility, but **will switch to `false` in a future release**, at which point the affected-page list is always included. You should pass `compat=false` if you want the new behavior today and avoid unexpected errors when the default flips in the future.
|
|
2393
2402
|
x-gitbook-mcp: true
|
|
2394
2403
|
tags:
|
|
2395
2404
|
- change-request-content
|
|
@@ -2400,6 +2409,12 @@ paths:
|
|
|
2400
2409
|
parameters:
|
|
2401
2410
|
- $ref: "#/components/parameters/spaceId"
|
|
2402
2411
|
- $ref: "#/components/parameters/changeRequestId"
|
|
2412
|
+
- name: compat
|
|
2413
|
+
in: query
|
|
2414
|
+
description: When `true`, the updated change request is returned. When `false`, the updated change request and the list of affected pages are returned.
|
|
2415
|
+
schema:
|
|
2416
|
+
type: boolean
|
|
2417
|
+
default: true
|
|
2403
2418
|
requestBody:
|
|
2404
2419
|
required: true
|
|
2405
2420
|
content:
|
|
@@ -2421,7 +2436,10 @@ paths:
|
|
|
2421
2436
|
content:
|
|
2422
2437
|
application/json:
|
|
2423
2438
|
schema:
|
|
2424
|
-
|
|
2439
|
+
description: The change request when `compat=true` (default), or the change request plus the list of affected pages when `compat=false`.
|
|
2440
|
+
oneOf:
|
|
2441
|
+
- $ref: "#/components/schemas/ChangeRequest"
|
|
2442
|
+
- $ref: "#/components/schemas/ChangeRequestContentUpdate"
|
|
2425
2443
|
"404":
|
|
2426
2444
|
description: The change request could not be found.
|
|
2427
2445
|
$ref: "#/components/responses/NotFoundError"
|
|
@@ -7870,6 +7888,11 @@ paths:
|
|
|
7870
7888
|
type: boolean
|
|
7871
7889
|
default: false
|
|
7872
7890
|
description: Whether the site space should be created as draft. Defaults to false.
|
|
7891
|
+
pageId:
|
|
7892
|
+
oneOf:
|
|
7893
|
+
- type: string
|
|
7894
|
+
- type: "null"
|
|
7895
|
+
description: Custom home page within the space, rendered at the site space's path root instead of the space's default landing page.
|
|
7873
7896
|
required:
|
|
7874
7897
|
- spaceId
|
|
7875
7898
|
responses:
|
|
@@ -9694,6 +9717,11 @@ paths:
|
|
|
9694
9717
|
oneOf:
|
|
9695
9718
|
- $ref: "#/components/schemas/Expression"
|
|
9696
9719
|
- type: "null"
|
|
9720
|
+
pageId:
|
|
9721
|
+
description: Custom home page within the space, rendered at the site space's path root instead of the space's default landing page. If not set, the page will remain unchanged unless spaceId is changed, in which case the custom home page will be removed. If set to null, the custom home page will be removed.
|
|
9722
|
+
oneOf:
|
|
9723
|
+
- type: string
|
|
9724
|
+
- type: "null"
|
|
9697
9725
|
spaceId:
|
|
9698
9726
|
type: string
|
|
9699
9727
|
description: The content that this site space points to. If not set, the space will remain unchanged.
|
|
@@ -18115,6 +18143,9 @@ components:
|
|
|
18115
18143
|
type: string
|
|
18116
18144
|
minLength: 1
|
|
18117
18145
|
description: Title of the page.
|
|
18146
|
+
slug:
|
|
18147
|
+
description: Slug of the page in its parent, used to build the page's path. When omitted, the slug is derived from the title. The slug must be unique among the page's siblings; any collision is rejected.
|
|
18148
|
+
$ref: "#/components/schemas/RevisionPageSlug"
|
|
18118
18149
|
emoji:
|
|
18119
18150
|
description: Emoji of the page. Set to an empty string to remove it.
|
|
18120
18151
|
$ref: "#/components/schemas/Emoji"
|
|
@@ -18170,7 +18201,6 @@ components:
|
|
|
18170
18201
|
- type: object
|
|
18171
18202
|
required:
|
|
18172
18203
|
- operation
|
|
18173
|
-
- title
|
|
18174
18204
|
- document
|
|
18175
18205
|
properties:
|
|
18176
18206
|
operation:
|
|
@@ -18184,6 +18214,9 @@ components:
|
|
|
18184
18214
|
type: integer
|
|
18185
18215
|
minimum: 0
|
|
18186
18216
|
description: Zero-based index to insert the page at among its siblings. If omitted, the page is appended at the end.
|
|
18217
|
+
ref:
|
|
18218
|
+
type: string
|
|
18219
|
+
description: Temporary local reference for the page, used only for the lifetime of this request and never persisted. Other pages inserted in the same batch can link to this page by its ref (e.g. `[Page](./<ref>.md)`), which resolves to the page's ID at apply time — regardless of operation order or the page's eventual slug. A ref must be unique within the batch and must not collide with an existing page's path.
|
|
18187
18220
|
document:
|
|
18188
18221
|
description: Document for the new page. When provided as markdown, its frontmatter is read to set the page metadata.
|
|
18189
18222
|
$ref: "#/components/schemas/Document"
|
|
@@ -18250,6 +18283,104 @@ components:
|
|
|
18250
18283
|
insert_page: "#/components/schemas/ChangeRequestContentChangeInsertPage"
|
|
18251
18284
|
delete_page: "#/components/schemas/ChangeRequestContentChangeDeletePage"
|
|
18252
18285
|
revert_page: "#/components/schemas/ChangeRequestContentChangeRevertPage"
|
|
18286
|
+
ChangeRequestContentUpdatePageRef:
|
|
18287
|
+
type: object
|
|
18288
|
+
required:
|
|
18289
|
+
- object
|
|
18290
|
+
- id
|
|
18291
|
+
- urls
|
|
18292
|
+
properties:
|
|
18293
|
+
object:
|
|
18294
|
+
type: string
|
|
18295
|
+
description: Type of Object, always equals to "page".
|
|
18296
|
+
enum:
|
|
18297
|
+
- page
|
|
18298
|
+
id:
|
|
18299
|
+
type: string
|
|
18300
|
+
description: Unique identifier of the page.
|
|
18301
|
+
urls:
|
|
18302
|
+
type: object
|
|
18303
|
+
required:
|
|
18304
|
+
- location
|
|
18305
|
+
properties:
|
|
18306
|
+
location:
|
|
18307
|
+
description: API URL to fetch the page's full, normalized content.
|
|
18308
|
+
$ref: "#/components/schemas/URL"
|
|
18309
|
+
ChangeRequestContentUpdateInsertedPage:
|
|
18310
|
+
type: object
|
|
18311
|
+
description: A page created by the operation with its resolved ID, ref as passed by the caller, and a URL to fetch its content.
|
|
18312
|
+
required:
|
|
18313
|
+
- object
|
|
18314
|
+
- page
|
|
18315
|
+
properties:
|
|
18316
|
+
object:
|
|
18317
|
+
type: string
|
|
18318
|
+
description: Type of Object, always equals to "created_page".
|
|
18319
|
+
enum:
|
|
18320
|
+
- created_page
|
|
18321
|
+
ref:
|
|
18322
|
+
type: string
|
|
18323
|
+
description: The batch-local `ref` provided on the insert operation, echoed so the caller can map their reference to the created page's ID. Absent when the operation had no ref.
|
|
18324
|
+
page:
|
|
18325
|
+
description: Reference to the created page, with a URL to fetch its normalized content.
|
|
18326
|
+
$ref: "#/components/schemas/ChangeRequestContentUpdatePageRef"
|
|
18327
|
+
ChangeRequestContentUpdateUpdatedPage:
|
|
18328
|
+
type: object
|
|
18329
|
+
description: A page updated by the operation, with a URL to fetch its content.
|
|
18330
|
+
required:
|
|
18331
|
+
- object
|
|
18332
|
+
- page
|
|
18333
|
+
properties:
|
|
18334
|
+
object:
|
|
18335
|
+
type: string
|
|
18336
|
+
description: Type of Object, always equals to "updated_page".
|
|
18337
|
+
enum:
|
|
18338
|
+
- updated_page
|
|
18339
|
+
page:
|
|
18340
|
+
description: Reference to the updated page, with a URL to fetch its normalized content.
|
|
18341
|
+
$ref: "#/components/schemas/ChangeRequestContentUpdatePageRef"
|
|
18342
|
+
ChangeRequestContentUpdateDeletedPage:
|
|
18343
|
+
type: object
|
|
18344
|
+
description: A page deleted by the batch. Only its ID is returned, as it no longer has content.
|
|
18345
|
+
required:
|
|
18346
|
+
- object
|
|
18347
|
+
- page
|
|
18348
|
+
properties:
|
|
18349
|
+
object:
|
|
18350
|
+
type: string
|
|
18351
|
+
description: Type of Object, always equals to "deleted_page".
|
|
18352
|
+
enum:
|
|
18353
|
+
- deleted_page
|
|
18354
|
+
page:
|
|
18355
|
+
type: string
|
|
18356
|
+
description: ID of the deleted page.
|
|
18357
|
+
ChangeRequestContentUpdateChange:
|
|
18358
|
+
description: An outcome of a content change.
|
|
18359
|
+
oneOf:
|
|
18360
|
+
- $ref: "#/components/schemas/ChangeRequestContentUpdateInsertedPage"
|
|
18361
|
+
- $ref: "#/components/schemas/ChangeRequestContentUpdateUpdatedPage"
|
|
18362
|
+
- $ref: "#/components/schemas/ChangeRequestContentUpdateDeletedPage"
|
|
18363
|
+
discriminator:
|
|
18364
|
+
propertyName: object
|
|
18365
|
+
mapping:
|
|
18366
|
+
created_page: "#/components/schemas/ChangeRequestContentUpdateInsertedPage"
|
|
18367
|
+
updated_page: "#/components/schemas/ChangeRequestContentUpdateUpdatedPage"
|
|
18368
|
+
deleted_page: "#/components/schemas/ChangeRequestContentUpdateDeletedPage"
|
|
18369
|
+
ChangeRequestContentUpdate:
|
|
18370
|
+
type: object
|
|
18371
|
+
description: The result of applying a batch of content changes.
|
|
18372
|
+
required:
|
|
18373
|
+
- changeRequest
|
|
18374
|
+
- changes
|
|
18375
|
+
properties:
|
|
18376
|
+
changeRequest:
|
|
18377
|
+
description: The change request after the batch was applied.
|
|
18378
|
+
$ref: "#/components/schemas/ChangeRequest"
|
|
18379
|
+
changes:
|
|
18380
|
+
type: array
|
|
18381
|
+
description: One entry per affected page (deduplicated), in the order the pages were first touched by the batch.
|
|
18382
|
+
items:
|
|
18383
|
+
$ref: "#/components/schemas/ChangeRequestContentUpdateChange"
|
|
18253
18384
|
RevisionPageType:
|
|
18254
18385
|
type: string
|
|
18255
18386
|
enum:
|
|
@@ -21919,6 +22050,11 @@ components:
|
|
|
21919
22050
|
condition:
|
|
21920
22051
|
description: Conditional expression used to evaluate whether the site space should be shown to the site's visitor.
|
|
21921
22052
|
$ref: "#/components/schemas/Expression"
|
|
22053
|
+
pageId:
|
|
22054
|
+
oneOf:
|
|
22055
|
+
- type: string
|
|
22056
|
+
- type: "null"
|
|
22057
|
+
description: Custom home page within the space, rendered at the site space's path root instead of the space's default landing page.
|
|
21922
22058
|
draft:
|
|
21923
22059
|
type: boolean
|
|
21924
22060
|
description: Whether the site space is draft and not live.
|