@gitbook/api 0.208.0 → 0.209.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 +722 -464
- package/dist/constants.d.ts +4 -2
- package/dist/index.cjs +165 -64
- package/dist/index.js +163 -64
- package/package.json +1 -1
- package/spec/openapi.json +3176 -2654
- package/spec/openapi.yaml +6287 -5923
package/dist/client.d.ts
CHANGED
|
@@ -313,6 +313,11 @@ export declare enum SiteInsightsLinkPosition {
|
|
|
313
313
|
Sidebar = "sidebar",
|
|
314
314
|
Content = "content"
|
|
315
315
|
}
|
|
316
|
+
export declare enum PageFeedbackRating {
|
|
317
|
+
Bad = "bad",
|
|
318
|
+
Ok = "ok",
|
|
319
|
+
Good = "good"
|
|
320
|
+
}
|
|
316
321
|
/** How a page's markdown was requested. `page-action` means a reader used the site's page-actions menu — its copy or view-as-markdown action — rather than a client fetching the URL directly. */
|
|
317
322
|
export declare enum SiteInsightsMarkdownSource {
|
|
318
323
|
PageAction = "page-action"
|
|
@@ -341,6 +346,8 @@ export declare enum SiteSettingsScanTopics {
|
|
|
341
346
|
* - `suggest-fixes` drafts fixes for approval and applies none.
|
|
342
347
|
* - `fix-clear-matches` applies the clearest fixes and drafts the less certain ones for approval.
|
|
343
348
|
* - `fix-close-matches` applies the clear and the close fixes.
|
|
349
|
+
* At every level, GitBook drafts change requests that fix broken links to other sites, and never
|
|
350
|
+
* merges them.
|
|
344
351
|
*/
|
|
345
352
|
export declare enum SiteSettingsBrokenLinksAutonomyLevel {
|
|
346
353
|
SuggestFixes = "suggest-fixes",
|
|
@@ -1042,11 +1049,6 @@ export declare enum SiteType {
|
|
|
1042
1049
|
Ultimate = "ultimate",
|
|
1043
1050
|
Sponsored = "sponsored"
|
|
1044
1051
|
}
|
|
1045
|
-
export declare enum PageFeedbackRating {
|
|
1046
|
-
Bad = "bad",
|
|
1047
|
-
Ok = "ok",
|
|
1048
|
-
Good = "good"
|
|
1049
|
-
}
|
|
1050
1052
|
/** Describe whether all sites have been selected or there's a selection involved */
|
|
1051
1053
|
export declare enum IntegrationInstallationSiteSelection {
|
|
1052
1054
|
All = "all",
|
|
@@ -1162,11 +1164,13 @@ export declare enum IntegrationTarget {
|
|
|
1162
1164
|
* "billing": The organization's plan has reached its maximum number of members.
|
|
1163
1165
|
* "scim": The member was deactivated by the organization's identity provider.
|
|
1164
1166
|
* "admin": An organization admin disabled the member.
|
|
1167
|
+
* "gitbook": GitBook blocked the organization.
|
|
1165
1168
|
*/
|
|
1166
1169
|
export declare enum MemberDisabledReason {
|
|
1167
1170
|
Billing = "billing",
|
|
1168
1171
|
Scim = "scim",
|
|
1169
|
-
Admin = "admin"
|
|
1172
|
+
Admin = "admin",
|
|
1173
|
+
Gitbook = "gitbook"
|
|
1170
1174
|
}
|
|
1171
1175
|
/** The core layout presets for a page. */
|
|
1172
1176
|
export declare enum RevisionPageLayoutPreset {
|
|
@@ -1416,6 +1420,8 @@ export type FeatureUpgradeRequirement = {
|
|
|
1416
1420
|
*/
|
|
1417
1421
|
url: string;
|
|
1418
1422
|
};
|
|
1423
|
+
/** Any event that can be received from GitBook. */
|
|
1424
|
+
export type Event = InstallationSetupEvent | InstallationDeletedEvent | SpaceInstallationSetupEvent | SpaceInstallationDeletedEvent | SiteInstallationSetupEvent | SiteInstallationDeletedEvent | SiteViewEvent | SpaceContentUpdatedEvent | SpaceGitSyncCompletedEvent | SpaceGitSyncStartedEvent | SpaceVisibilityUpdatedEvent | TaskEvent | FetchEvent | FetchPublishedScriptEvent | FetchVisitorAuthenticationEvent | UIRenderEvent | ContentComputeDocumentEvent | ContentComputeRevisionEvent | PageFeedbackEvent;
|
|
1419
1425
|
/** An absolute reference to content in GitBook. */
|
|
1420
1426
|
export type ContentLocation = ContentLocationFile | ContentLocationURL | ContentLocationPage | ContentLocationUser | ContentLocationCollection | ContentLocationSpace | ContentLocationReusableContent | ContentLocationOpenAPI;
|
|
1421
1427
|
export type PublishedContentRedirect = {
|
|
@@ -1455,8 +1461,6 @@ export type ContentKitRootElement = ContentKitBlock | ContentKitModal | ContentK
|
|
|
1455
1461
|
export type ContentKitInlineElement = ContentKitText | ContentKitImage | ContentKitLink;
|
|
1456
1462
|
/** Any element that can be used as children. */
|
|
1457
1463
|
export type ContentKitDescendantElement = ContentKitButton | ContentKitTextInput | ContentKitHStack | ContentKitVStack | ContentKitBox | ContentKitDivider | ContentKitWebFrame | ContentKitCodeBlock | ContentKitMarkdown | ContentKitCard | ContentKitImage | ContentKitInput | ContentKitSelect | ContentKitSwitch | ContentKitCheckbox | ContentKitRadio | ContentKitText | ContentKitHint | ContentKitLink | ContentKitStepperStep;
|
|
1458
|
-
/** Any event that can be received from GitBook. */
|
|
1459
|
-
export type Event = InstallationSetupEvent | InstallationDeletedEvent | SpaceInstallationSetupEvent | SpaceInstallationDeletedEvent | SiteInstallationSetupEvent | SiteInstallationDeletedEvent | SiteViewEvent | SpaceContentUpdatedEvent | SpaceGitSyncCompletedEvent | SpaceGitSyncStartedEvent | SpaceVisibilityUpdatedEvent | TaskEvent | FetchEvent | FetchPublishedScriptEvent | FetchVisitorAuthenticationEvent | UIRenderEvent | ContentComputeDocumentEvent | ContentComputeRevisionEvent | PageFeedbackEvent;
|
|
1460
1464
|
/** An outcome of a content change. */
|
|
1461
1465
|
export type ChangeRequestContentUpdateChange = ({
|
|
1462
1466
|
object: "created_page";
|
|
@@ -1487,7 +1491,15 @@ export type ChangeRequestContentChange = ({
|
|
|
1487
1491
|
operation: "insert_variables";
|
|
1488
1492
|
} & ChangeRequestContentChangeInsertVariables) | ({
|
|
1489
1493
|
operation: "update_variable";
|
|
1490
|
-
} & ChangeRequestContentChangeUpdateVariable)
|
|
1494
|
+
} & ChangeRequestContentChangeUpdateVariable) | ({
|
|
1495
|
+
operation: "delete_variable";
|
|
1496
|
+
} & ChangeRequestContentChangeDeleteVariable) | ({
|
|
1497
|
+
operation: "insert_tags";
|
|
1498
|
+
} & ChangeRequestContentChangeInsertTags) | ({
|
|
1499
|
+
operation: "update_tag";
|
|
1500
|
+
} & ChangeRequestContentChangeUpdateTag) | ({
|
|
1501
|
+
operation: "delete_tag";
|
|
1502
|
+
} & ChangeRequestContentChangeDeleteTag);
|
|
1491
1503
|
export type Revision = RevisionTypeEdits | RevisionTypeMerge | RevisionTypeRollback | RevisionTypeUpdate | RevisionTypeComputed;
|
|
1492
1504
|
export type RevisionPage = RevisionPageDocument | RevisionPageGroup | RevisionPageLink | RevisionPageComputed;
|
|
1493
1505
|
export interface ApiInformation {
|
|
@@ -1555,6 +1567,10 @@ export interface UserAPIToken {
|
|
|
1555
1567
|
label: APITokenLabel;
|
|
1556
1568
|
/** The API token creation date. */
|
|
1557
1569
|
createdAt: Timestamp;
|
|
1570
|
+
/** Whether the API token can no longer be used to authenticate, because it was revoked or has expired. */
|
|
1571
|
+
revoked: boolean;
|
|
1572
|
+
/** When the API token stops authenticating. Absent for a token that never expires. */
|
|
1573
|
+
expiresAt?: Timestamp;
|
|
1558
1574
|
}
|
|
1559
1575
|
/** The API token details, including the token itself. */
|
|
1560
1576
|
export type UserAPITokenExtended = UserAPIToken & {
|
|
@@ -3886,6 +3902,8 @@ export interface RevisionPageUpdate {
|
|
|
3886
3902
|
noRobotsIndex?: boolean;
|
|
3887
3903
|
/** Adaptive-content condition controlling whether the page is shown to a visitor. Set to an empty string to remove the condition. */
|
|
3888
3904
|
condition?: string;
|
|
3905
|
+
/** Page variables, referenced in the page's content as `page.vars.<name>`. They are separate from space variables (`space.vars.<name>`). The object replaces all of the page's variables: set it to `{}` to remove them, or omit it to leave them unchanged. In a markdown document, the `vars` frontmatter sets them too. Names follow the same rules as space variables. Document pages only. */
|
|
3906
|
+
variables?: Variables;
|
|
3889
3907
|
}
|
|
3890
3908
|
/**
|
|
3891
3909
|
* Update an existing page. Its document and/or its metadata (title, icon, description, visibility, adaptive-content condition) can be changed, and it can be moved to a new parent and/or position with `into`/`at`.
|
|
@@ -3946,7 +3964,10 @@ export interface ChangeRequestContentChangeRevertPage {
|
|
|
3946
3964
|
operation: "revert_page";
|
|
3947
3965
|
/** ID of the page to revert. */
|
|
3948
3966
|
page: string;
|
|
3949
|
-
/**
|
|
3967
|
+
/**
|
|
3968
|
+
* ID of the revision to revert the page to. If omitted, the change request's base revision is used.
|
|
3969
|
+
* @pattern ^[a-zA-Z0-9_-]+$
|
|
3970
|
+
*/
|
|
3950
3971
|
revision?: string;
|
|
3951
3972
|
/** 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. */
|
|
3952
3973
|
block?: string[];
|
|
@@ -4062,11 +4083,13 @@ export interface ChangeRequestContentChangeDeleteReusableContent {
|
|
|
4062
4083
|
*/
|
|
4063
4084
|
export type VariableName = string;
|
|
4064
4085
|
/**
|
|
4065
|
-
* Create space variables in the change request (Git Sync's `.gitbook/vars.yaml`). Content references one as an expression, `<code class="expression">space.vars.<name></code>` in markdown, which renders the variable's value.
|
|
4086
|
+
* Create space variables in the change request (Git Sync's `.gitbook/vars.yaml`), or with `page`, variables of that page. Content references one as an expression, `<code class="expression">space.vars.<name></code>` (or `page.vars.<name>` on that page) in markdown, which renders the variable's value. To replace all of a page's variables at once, set the page's `variables` or its `vars` frontmatter instead.
|
|
4066
4087
|
* @example {"operation":"insert_variables","variables":[{"name":"version","value":"2.0"}]}
|
|
4067
4088
|
*/
|
|
4068
4089
|
export interface ChangeRequestContentChangeInsertVariables {
|
|
4069
4090
|
operation: "insert_variables";
|
|
4091
|
+
/** ID of a document page to add the variables to, as its own variables (`page.vars.<name>`). Omit to add space variables. */
|
|
4092
|
+
page?: string;
|
|
4070
4093
|
/**
|
|
4071
4094
|
* @maxItems 50
|
|
4072
4095
|
* @minItems 1
|
|
@@ -4079,16 +4102,81 @@ export interface ChangeRequestContentChangeInsertVariables {
|
|
|
4079
4102
|
}[];
|
|
4080
4103
|
}
|
|
4081
4104
|
/**
|
|
4082
|
-
* Change the value of an existing space variable. Every expression referencing it shows the new value.
|
|
4105
|
+
* Change the value of an existing space variable, or with `page`, of one of that page's own variables without resending the others. Every expression referencing it shows the new value.
|
|
4083
4106
|
* @example {"operation":"update_variable","variable":"version","value":"2.1"}
|
|
4084
4107
|
*/
|
|
4085
4108
|
export interface ChangeRequestContentChangeUpdateVariable {
|
|
4086
4109
|
operation: "update_variable";
|
|
4110
|
+
/** ID of a document page whose own variable (`page.vars.<name>`) to update. Omit to update a space variable. */
|
|
4111
|
+
page?: string;
|
|
4087
4112
|
/** Name of the variable to update. */
|
|
4088
4113
|
variable: VariableName;
|
|
4089
4114
|
/** New value of the variable. */
|
|
4090
4115
|
value: VariableValue;
|
|
4091
4116
|
}
|
|
4117
|
+
/**
|
|
4118
|
+
* Delete an existing space variable from the change request, or with `page`, one of that page's own variables. Expressions referencing it are kept in pages, as in the editor.
|
|
4119
|
+
* @example {"operation":"delete_variable","variable":"version"}
|
|
4120
|
+
*/
|
|
4121
|
+
export interface ChangeRequestContentChangeDeleteVariable {
|
|
4122
|
+
operation: "delete_variable";
|
|
4123
|
+
/** ID of a document page whose own variable (`page.vars.<name>`) to delete. Omit to delete a space variable. */
|
|
4124
|
+
page?: string;
|
|
4125
|
+
/** Name of the variable to delete. */
|
|
4126
|
+
variable: VariableName;
|
|
4127
|
+
}
|
|
4128
|
+
/**
|
|
4129
|
+
* Display label of a tag.
|
|
4130
|
+
* @minLength 1
|
|
4131
|
+
* @maxLength 50
|
|
4132
|
+
*/
|
|
4133
|
+
export type RevisionTagLabel = string;
|
|
4134
|
+
/** Create flat tags in array order. The batch is rejected atomically if any tag is invalid. */
|
|
4135
|
+
export interface ChangeRequestContentChangeInsertTags {
|
|
4136
|
+
operation: "insert_tags";
|
|
4137
|
+
/**
|
|
4138
|
+
* @maxItems 50
|
|
4139
|
+
* @minItems 1
|
|
4140
|
+
*/
|
|
4141
|
+
tags: {
|
|
4142
|
+
/**
|
|
4143
|
+
* Stable tag identifier; generated from the label when omitted.
|
|
4144
|
+
* @minLength 1
|
|
4145
|
+
*/
|
|
4146
|
+
slug?: string;
|
|
4147
|
+
/** Display label of a tag. */
|
|
4148
|
+
label: RevisionTagLabel;
|
|
4149
|
+
/** Allowed color tokens for color marks (text and background; background reuses this enum). Named colors are fixed palette keys. `$*` tokens are semantic: resolved from the published sites customization when rendering; authors may still persist them in content when valid. */
|
|
4150
|
+
color?: DocumentTextColor;
|
|
4151
|
+
/** Name of the icon */
|
|
4152
|
+
icon?: Icon;
|
|
4153
|
+
/** Unicode codepoint or character of the emoji */
|
|
4154
|
+
emoji?: Emoji;
|
|
4155
|
+
}[];
|
|
4156
|
+
}
|
|
4157
|
+
/** Rename or restyle an existing tag. The slug is immutable. */
|
|
4158
|
+
export interface ChangeRequestContentChangeUpdateTag {
|
|
4159
|
+
operation: "update_tag";
|
|
4160
|
+
/**
|
|
4161
|
+
* Slug of the tag to update.
|
|
4162
|
+
* @minLength 1
|
|
4163
|
+
*/
|
|
4164
|
+
tag: string;
|
|
4165
|
+
/** Display label of a tag. */
|
|
4166
|
+
label?: RevisionTagLabel;
|
|
4167
|
+
/** Allowed color tokens for color marks (text and background; background reuses this enum). Named colors are fixed palette keys. `$*` tokens are semantic: resolved from the published sites customization when rendering; authors may still persist them in content when valid. */
|
|
4168
|
+
color?: DocumentTextColor;
|
|
4169
|
+
/** Icon to set. Null removes the icon; omission preserves it. */
|
|
4170
|
+
icon?: Icon | null;
|
|
4171
|
+
/** Emoji to set. Null removes the emoji; omission preserves it. */
|
|
4172
|
+
emoji?: Emoji | null;
|
|
4173
|
+
}
|
|
4174
|
+
/** Delete an existing tag definition. Page and block references remain in content but stop resolving. */
|
|
4175
|
+
export interface ChangeRequestContentChangeDeleteTag {
|
|
4176
|
+
operation: "delete_tag";
|
|
4177
|
+
/** @minLength 1 */
|
|
4178
|
+
tag: string;
|
|
4179
|
+
}
|
|
4092
4180
|
export interface ChangeRequestContentUpdatePageRef {
|
|
4093
4181
|
/** Type of Object, always equals to "page". */
|
|
4094
4182
|
object: "page";
|
|
@@ -4285,46 +4373,13 @@ export interface RevisionSemanticChangeTagDeleted {
|
|
|
4285
4373
|
}
|
|
4286
4374
|
export interface RevisionTagChangeAttributes {
|
|
4287
4375
|
label?: ChangeAttributeString;
|
|
4288
|
-
group?: ChangeAttributeString;
|
|
4289
|
-
parent?: ChangeAttributeString;
|
|
4290
4376
|
}
|
|
4291
4377
|
export interface RevisionSemanticChangeTagEdited {
|
|
4292
4378
|
type: "tag_edited";
|
|
4293
4379
|
tag: ChangedRevisionTag;
|
|
4294
4380
|
attributes: RevisionTagChangeAttributes;
|
|
4295
4381
|
}
|
|
4296
|
-
|
|
4297
|
-
export interface RevisionTagGroup {
|
|
4298
|
-
/** Immutable group identifier, unique within the revision. */
|
|
4299
|
-
slug: string;
|
|
4300
|
-
/** Display name of the group. */
|
|
4301
|
-
label: string;
|
|
4302
|
-
/** Parent group slug. Omitted for root groups. */
|
|
4303
|
-
parent?: string;
|
|
4304
|
-
/** Lexicographic sibling sort key. Break ties using the slug. */
|
|
4305
|
-
orderIndex: string;
|
|
4306
|
-
}
|
|
4307
|
-
export interface RevisionSemanticChangeTagGroupCreated {
|
|
4308
|
-
type: "tag_group_created";
|
|
4309
|
-
/** A space-scoped group of tags in this revision. Groups may contain other groups. */
|
|
4310
|
-
tagGroup: RevisionTagGroup;
|
|
4311
|
-
}
|
|
4312
|
-
export interface RevisionSemanticChangeTagGroupEdited {
|
|
4313
|
-
type: "tag_group_edited";
|
|
4314
|
-
/** A space-scoped group of tags in this revision. Groups may contain other groups. */
|
|
4315
|
-
tagGroup: RevisionTagGroup;
|
|
4316
|
-
attributes: {
|
|
4317
|
-
label?: ChangeAttributeString;
|
|
4318
|
-
parent?: ChangeAttributeString;
|
|
4319
|
-
orderIndex?: ChangeAttributeString;
|
|
4320
|
-
};
|
|
4321
|
-
}
|
|
4322
|
-
export interface RevisionSemanticChangeTagGroupDeleted {
|
|
4323
|
-
type: "tag_group_deleted";
|
|
4324
|
-
/** A space-scoped group of tags in this revision. Groups may contain other groups. */
|
|
4325
|
-
tagGroup: RevisionTagGroup;
|
|
4326
|
-
}
|
|
4327
|
-
export type RevisionSemanticChange = RevisionSemanticChangePageCreated | RevisionSemanticChangePageEdited | RevisionSemanticChangePageDeleted | RevisionSemanticChangePageMoved | RevisionSemanticChangeFileCreated | RevisionSemanticChangeFileEdited | RevisionSemanticChangeFileDeleted | RevisionSemanticChangeVariablesEdited | RevisionSemanticChangeReusableContentCreated | RevisionSemanticChangeReusableContentDeleted | RevisionSemanticChangeReusableContentEdited | RevisionSemanticChangeTagCreated | RevisionSemanticChangeTagDeleted | RevisionSemanticChangeTagEdited | RevisionSemanticChangeTagGroupCreated | RevisionSemanticChangeTagGroupEdited | RevisionSemanticChangeTagGroupDeleted;
|
|
4382
|
+
export type RevisionSemanticChange = RevisionSemanticChangePageCreated | RevisionSemanticChangePageEdited | RevisionSemanticChangePageDeleted | RevisionSemanticChangePageMoved | RevisionSemanticChangeFileCreated | RevisionSemanticChangeFileEdited | RevisionSemanticChangeFileDeleted | RevisionSemanticChangeVariablesEdited | RevisionSemanticChangeReusableContentCreated | RevisionSemanticChangeReusableContentDeleted | RevisionSemanticChangeReusableContentEdited | RevisionSemanticChangeTagCreated | RevisionSemanticChangeTagDeleted | RevisionSemanticChangeTagEdited;
|
|
4328
4383
|
export interface RevisionSemanticChanges {
|
|
4329
4384
|
/** The change request object that initiated the changes in the case of a merge revision. */
|
|
4330
4385
|
mergedFrom?: ChangeRequest;
|
|
@@ -4614,6 +4669,7 @@ export type OrganizationSupportCost = {
|
|
|
4614
4669
|
* @maxLength 255
|
|
4615
4670
|
*/
|
|
4616
4671
|
export type BlockReason = string;
|
|
4672
|
+
/** Non-members of the organization only receive `object`, `id`, `title`, `sso`, `inviteLinks`, `urls`, `blocked` and `permissions`. */
|
|
4617
4673
|
export interface Organization {
|
|
4618
4674
|
/** Type of Object, always equals to "organization" */
|
|
4619
4675
|
object: "organization";
|
|
@@ -4621,11 +4677,11 @@ export interface Organization {
|
|
|
4621
4677
|
id: string;
|
|
4622
4678
|
/** Name of the organization */
|
|
4623
4679
|
title: OrganizationTitle;
|
|
4624
|
-
createdAt
|
|
4625
|
-
emailDomains
|
|
4680
|
+
createdAt?: Timestamp;
|
|
4681
|
+
emailDomains?: OrganizationEmailDomains;
|
|
4626
4682
|
/** Default hostname for the organization's public content, e.g. <org-hostname>.gitbook.io */
|
|
4627
4683
|
hostname?: OrganizationHostname;
|
|
4628
|
-
type
|
|
4684
|
+
type?: OrganizationType;
|
|
4629
4685
|
useCase?: OrganizationUseCase;
|
|
4630
4686
|
communityType?: OrganizationCommunityType;
|
|
4631
4687
|
/** The role of a member in an organization, null for guests */
|
|
@@ -4647,10 +4703,10 @@ export interface Organization {
|
|
|
4647
4703
|
/** Whether audit logs can currently be accessed for this organization. */
|
|
4648
4704
|
auditLogs?: boolean;
|
|
4649
4705
|
/** Name of the product */
|
|
4650
|
-
plan
|
|
4706
|
+
plan?: BillingProduct;
|
|
4651
4707
|
/** Billing details, only available for org members. */
|
|
4652
4708
|
billing?: OrganizationBilling;
|
|
4653
|
-
mergeRules
|
|
4709
|
+
mergeRules?: MergeRulesStandaloneConfiguration;
|
|
4654
4710
|
/** Support cost set by the organization, only available for org members. */
|
|
4655
4711
|
supportCost?: OrganizationSupportCost;
|
|
4656
4712
|
/** URLs associated with the object */
|
|
@@ -4668,7 +4724,7 @@ export interface Organization {
|
|
|
4668
4724
|
/** URL of the logo of this organization, if defined. */
|
|
4669
4725
|
logo?: URL;
|
|
4670
4726
|
};
|
|
4671
|
-
trial
|
|
4727
|
+
trial?: {
|
|
4672
4728
|
/** - notapplicable, no trial can be started for this organization. - none, no trial has been started yet. - active, trial is active. - ended, the trial has ended and the user has choosen to stay on the free plan or has upgraded to a paid plan. - expired, the trial has ended but the user hasn't deciced yet what to do. */
|
|
4673
4729
|
status: BillingTrialStatus;
|
|
4674
4730
|
/** Number of trials the organization has consumed. */
|
|
@@ -4784,6 +4840,7 @@ export interface Integration {
|
|
|
4784
4840
|
configurations?: IntegrationConfigurations;
|
|
4785
4841
|
/** External urls configured by the developer of the integration */
|
|
4786
4842
|
externalLinks: IntegrationExternalLinks;
|
|
4843
|
+
/** Non-members of the organization only receive `object`, `id`, `title`, `sso`, `inviteLinks`, `urls`, `blocked` and `permissions`. */
|
|
4787
4844
|
owner: Organization;
|
|
4788
4845
|
/** URLs associated with the object */
|
|
4789
4846
|
urls: {
|
|
@@ -4930,7 +4987,7 @@ export interface PublishIntegration {
|
|
|
4930
4987
|
*/
|
|
4931
4988
|
contentSecurityPolicy?: IntegrationContentSecurityPolicy;
|
|
4932
4989
|
}
|
|
4933
|
-
/** Configuration of the integration
|
|
4990
|
+
/** Configuration of the integration. For user authentication, oauth_credentials is returned as a boolean indicating whether a connection is configured. When replacing the configuration, send true to preserve the existing connection, or omit the field to clear it. Only the integration or the matching installation can read or set the OAuth credentials. */
|
|
4934
4991
|
export type IntegrationInstallationConfiguration = Record<string, any>;
|
|
4935
4992
|
/**
|
|
4936
4993
|
* External IDs assigned by the integration.
|
|
@@ -4956,7 +5013,7 @@ export interface IntegrationInstallation {
|
|
|
4956
5013
|
site_selection: IntegrationInstallationSiteSelection;
|
|
4957
5014
|
/** Count of spaces, the installation is managing */
|
|
4958
5015
|
spaces: number;
|
|
4959
|
-
/** Configuration of the integration
|
|
5016
|
+
/** Configuration of the integration. For user authentication, oauth_credentials is returned as a boolean indicating whether a connection is configured. When replacing the configuration, send true to preserve the existing connection, or omit the field to clear it. Only the integration or the matching installation can read or set the OAuth credentials. */
|
|
4960
5017
|
configuration: IntegrationInstallationConfiguration;
|
|
4961
5018
|
createdAt: Timestamp;
|
|
4962
5019
|
updatedAt: Timestamp;
|
|
@@ -4990,318 +5047,18 @@ export interface IntegrationInstallation {
|
|
|
4990
5047
|
/** Network configuration for the installation */
|
|
4991
5048
|
network?: IntegrationNetwork;
|
|
4992
5049
|
}
|
|
4993
|
-
/**
|
|
4994
|
-
export interface
|
|
4995
|
-
/**
|
|
5050
|
+
/** Safe diagnostic metadata for an integration event. This is not the event delivered to the integration. Configuration snapshots, request bodies and headers, URLs, visitor data, task and UI payloads, provider responses and arbitrary custom fields are omitted. */
|
|
5051
|
+
export interface IntegrationEventDiagnosticPayload {
|
|
5052
|
+
/** Event type, or unknown for an unrecognized or malformed historical payload. */
|
|
5053
|
+
type: "installation_setup" | "installation_deleted" | "space_installation_setup" | "space_installation_deleted" | "site_installation_setup" | "site_installation_deleted" | "site_view" | "space_content_updated" | "space_gitsync_completed" | "space_gitsync_started" | "space_visibility_updated" | "task" | "fetch" | "fetch_published_script" | "fetch_visitor_authentication" | "ui_render" | "content_compute_document" | "content_compute_revision" | "page_feedback" | "unknown";
|
|
4996
5054
|
eventId: string;
|
|
4997
|
-
/** Type of the event. */
|
|
4998
|
-
type: string;
|
|
4999
|
-
}
|
|
5000
|
-
/** Common properties for all events related to an installation */
|
|
5001
|
-
export type InstallationEvent = BaseEvent & {
|
|
5002
|
-
/** ID of the integration installation */
|
|
5003
|
-
installationId: string;
|
|
5004
|
-
};
|
|
5005
|
-
/** Event received when integration has been installed or updated. */
|
|
5006
|
-
export type InstallationSetupEvent = InstallationEvent & {
|
|
5007
|
-
type: "installation_setup";
|
|
5008
|
-
status: IntegrationInstallationStatus;
|
|
5009
|
-
/** The state of the installation at the account level before it was updated. */
|
|
5010
|
-
previous?: {
|
|
5011
|
-
status: IntegrationInstallationStatus;
|
|
5012
|
-
/** The previous configuration of the installation at the account level. */
|
|
5013
|
-
configuration?: object;
|
|
5014
|
-
};
|
|
5015
|
-
};
|
|
5016
|
-
/** Event received when integration has been uninstalled from an organization. */
|
|
5017
|
-
export type InstallationDeletedEvent = InstallationEvent & {
|
|
5018
|
-
type: "installation_deleted";
|
|
5019
|
-
/** The state of the installation before it was deleted. */
|
|
5020
|
-
previous: {
|
|
5021
|
-
/** The previous configuration of the installation. */
|
|
5022
|
-
configuration?: object;
|
|
5023
|
-
};
|
|
5024
|
-
};
|
|
5025
|
-
/** Common properties for all events related to a specific space. */
|
|
5026
|
-
export type SpaceEvent = InstallationEvent & {
|
|
5027
|
-
/** ID of the space */
|
|
5028
|
-
spaceId: string;
|
|
5029
|
-
};
|
|
5030
|
-
/** Event received when integration has been installed or updated on a space. */
|
|
5031
|
-
export type SpaceInstallationSetupEvent = SpaceEvent & {
|
|
5032
|
-
type: "space_installation_setup";
|
|
5033
|
-
status: IntegrationInstallationStatus;
|
|
5034
|
-
/** The state of the Space installation before it was updated. */
|
|
5035
|
-
previous?: {
|
|
5036
|
-
status: IntegrationInstallationStatus;
|
|
5037
|
-
/** The previous configuration of the Space installation. */
|
|
5038
|
-
configuration?: object;
|
|
5039
|
-
};
|
|
5040
|
-
};
|
|
5041
|
-
/** Event received when integration has been uninstalled from a space. */
|
|
5042
|
-
export type SpaceInstallationDeletedEvent = SpaceEvent & {
|
|
5043
|
-
type: "space_installation_deleted";
|
|
5044
|
-
/** The state of the Space installation before it was deleted. */
|
|
5045
|
-
previous: {
|
|
5046
|
-
/** The previous configuration of the Space installation. */
|
|
5047
|
-
configuration?: object;
|
|
5048
|
-
};
|
|
5049
|
-
};
|
|
5050
|
-
/** Common properties for all events related to a specific site. */
|
|
5051
|
-
export type SiteEvent = InstallationEvent & {
|
|
5052
|
-
/** ID of the site */
|
|
5053
|
-
siteId: string;
|
|
5054
|
-
};
|
|
5055
|
-
/** Event received when integration has been installed or updated on a site. */
|
|
5056
|
-
export type SiteInstallationSetupEvent = SiteEvent & {
|
|
5057
|
-
type: "site_installation_setup";
|
|
5058
|
-
status: IntegrationInstallationStatus;
|
|
5059
|
-
/** The state of the site installation before it was updated. */
|
|
5060
|
-
previous?: {
|
|
5061
|
-
status: IntegrationInstallationStatus;
|
|
5062
|
-
/** The previous configuration of the site installation. */
|
|
5063
|
-
configuration?: object;
|
|
5064
|
-
};
|
|
5065
|
-
};
|
|
5066
|
-
/** Event received when integration has been uninstalled from a site. */
|
|
5067
|
-
export type SiteInstallationDeletedEvent = SiteEvent & {
|
|
5068
|
-
type: "site_installation_deleted";
|
|
5069
|
-
/** The state of the site installation before it was deleted. */
|
|
5070
|
-
previous: {
|
|
5071
|
-
/** The previous configuration of the site installation. */
|
|
5072
|
-
configuration?: object;
|
|
5073
|
-
};
|
|
5074
|
-
};
|
|
5075
|
-
/** Analytics info on the GitBook's content visitor. */
|
|
5076
|
-
export interface EventVisitor {
|
|
5077
|
-
/** GitBook's unique identifier of the visitor. */
|
|
5078
|
-
anonymousId: string;
|
|
5079
|
-
/** The visitors cookies. */
|
|
5080
|
-
cookies: Record<string, string>;
|
|
5081
|
-
/** User-agent of the visitor. */
|
|
5082
|
-
userAgent: string;
|
|
5083
|
-
/** IP address of the visitor. */
|
|
5084
|
-
ip: string;
|
|
5085
|
-
/** Language of the visitor. */
|
|
5086
|
-
language?: string;
|
|
5087
|
-
}
|
|
5088
|
-
/** Event received when a page has been visited on a site. */
|
|
5089
|
-
export type SiteViewEvent = SiteEvent & {
|
|
5090
|
-
type: "site_view";
|
|
5091
|
-
/**
|
|
5092
|
-
* Unique identifier of the visited space in the site.
|
|
5093
|
-
* @deprecated
|
|
5094
|
-
*/
|
|
5095
|
-
spaceId?: string;
|
|
5096
|
-
/** The site-space that was viewed */
|
|
5097
|
-
siteSpaceId?: string;
|
|
5098
|
-
/** Unique identifier of the visited page. */
|
|
5099
|
-
pageId?: string;
|
|
5100
|
-
/** Analytics info on the GitBook's content visitor. */
|
|
5101
|
-
visitor: EventVisitor;
|
|
5102
|
-
/** The GitBook content's URL visited (including URL params). */
|
|
5103
|
-
url: string;
|
|
5104
|
-
/** The URL of referrer that linked to the page. */
|
|
5105
|
-
referrer: string;
|
|
5106
|
-
};
|
|
5107
|
-
/** Event when the primary content of a space has been updated. */
|
|
5108
|
-
export type SpaceContentUpdatedEvent = SpaceEvent & {
|
|
5109
|
-
type: "space_content_updated";
|
|
5110
|
-
/** Unique identifier of the new content revision */
|
|
5111
|
-
revisionId: string;
|
|
5112
|
-
/** Users who updated the content */
|
|
5113
|
-
updatedBy: User[];
|
|
5114
|
-
};
|
|
5115
|
-
/** Event when a GitSync operation has been completed. */
|
|
5116
|
-
export type SpaceGitSyncCompletedEvent = SpaceEvent & {
|
|
5117
|
-
type: "space_gitsync_completed";
|
|
5118
|
-
state: "success" | "failure";
|
|
5119
|
-
/** Unique identifier of the new content revision */
|
|
5120
|
-
revisionId: string;
|
|
5121
|
-
/** Unique identifier for the commit (sha) */
|
|
5122
|
-
commitId: string;
|
|
5123
|
-
};
|
|
5124
|
-
/** Event when a GitSync operation has been started. */
|
|
5125
|
-
export type SpaceGitSyncStartedEvent = SpaceEvent & {
|
|
5126
|
-
type: "space_gitsync_started";
|
|
5127
|
-
/** Unique identifier of the new content revision */
|
|
5128
|
-
revisionId: string;
|
|
5129
|
-
/** Unique identifier for the commit (sha) */
|
|
5130
|
-
commitId: string;
|
|
5131
|
-
};
|
|
5132
|
-
/** Event when the visibility of the space has been changed. */
|
|
5133
|
-
export type SpaceVisibilityUpdatedEvent = SpaceEvent & {
|
|
5134
|
-
type: "space_visibility_updated";
|
|
5135
|
-
/**
|
|
5136
|
-
* * `public`: Anyone can access the content, and the content is indexed by search engines.
|
|
5137
|
-
* * `unlisted`: Anyone can access the content, and the content is not indexed by search engines
|
|
5138
|
-
* * `share-link`: Anyone with a secret token in the url can access the content.
|
|
5139
|
-
* * `visitor-auth`: Anyone authenticated through a JWT token can access the content.
|
|
5140
|
-
* * `in-collection`: Anyone who can access the parent collection can access the content.
|
|
5141
|
-
* Only available for spaces in a collection.
|
|
5142
|
-
* * `private`: Authorized members can access the content.
|
|
5143
|
-
*/
|
|
5144
|
-
previousVisibility: ContentVisibility;
|
|
5145
|
-
/**
|
|
5146
|
-
* * `public`: Anyone can access the content, and the content is indexed by search engines.
|
|
5147
|
-
* * `unlisted`: Anyone can access the content, and the content is not indexed by search engines
|
|
5148
|
-
* * `share-link`: Anyone with a secret token in the url can access the content.
|
|
5149
|
-
* * `visitor-auth`: Anyone authenticated through a JWT token can access the content.
|
|
5150
|
-
* * `in-collection`: Anyone who can access the parent collection can access the content.
|
|
5151
|
-
* Only available for spaces in a collection.
|
|
5152
|
-
* * `private`: Authorized members can access the content.
|
|
5153
|
-
*/
|
|
5154
|
-
visibility: ContentVisibility;
|
|
5155
|
-
};
|
|
5156
|
-
/** Event representing a background task trigger for an integration. */
|
|
5157
|
-
export type TaskEvent = BaseEvent & {
|
|
5158
|
-
type: "task";
|
|
5159
|
-
/** Payload associated with the integration task. */
|
|
5160
|
-
task: object;
|
|
5161
|
-
};
|
|
5162
|
-
export interface FetchRequest {
|
|
5163
|
-
method: "post" | "get" | "put" | "delete";
|
|
5164
|
-
url: string;
|
|
5165
|
-
headers: Record<string, string>;
|
|
5166
|
-
}
|
|
5167
|
-
/** Event representing an incoming HTTP request. */
|
|
5168
|
-
export type FetchEvent = BaseEvent & {
|
|
5169
|
-
/** The space ID, if requests are specific to a single space */
|
|
5170
|
-
spaceId?: string;
|
|
5171
|
-
/** The site ID, if requests are specific to a single site */
|
|
5172
|
-
siteId?: string;
|
|
5173
|
-
/** The installation ID, if requests are specific to a single installation */
|
|
5174
5055
|
installationId?: string;
|
|
5175
|
-
|
|
5176
|
-
/** The user's ID. */
|
|
5177
|
-
userId: string;
|
|
5178
|
-
};
|
|
5179
|
-
type: "fetch";
|
|
5180
|
-
request: FetchRequest;
|
|
5181
|
-
};
|
|
5182
|
-
/** Common properties for all events related to fetching a published script from an installation */
|
|
5183
|
-
export type FetchPublishedScriptEvent = SiteEvent & {
|
|
5184
|
-
type: "fetch_published_script";
|
|
5185
|
-
};
|
|
5186
|
-
/** Common properties for all events related to authenticated access from an installation */
|
|
5187
|
-
export type FetchVisitorAuthenticationEvent = SiteEvent & {
|
|
5188
|
-
type: "fetch_visitor_authentication";
|
|
5189
|
-
location?: string;
|
|
5190
|
-
/** Whitelisted search parameters from the visitor authentication request. */
|
|
5191
|
-
searchParams?: Record<string, string>;
|
|
5192
|
-
/** Whitelisted cookies from the visitor authentication request. */
|
|
5193
|
-
cookies?: Record<string, string>;
|
|
5194
|
-
/** The visitor authentication action to resolve. If omitted, integrations resolve to the existing login redirect. */
|
|
5195
|
-
action?: "logout";
|
|
5196
|
-
};
|
|
5197
|
-
/** Common properties for ContentKit context. */
|
|
5198
|
-
export interface ContentKitContextBase {
|
|
5199
|
-
theme: "dark" | "light";
|
|
5200
|
-
}
|
|
5201
|
-
/** Context while rendering in an account installation's configuration. */
|
|
5202
|
-
export type ContentKitContextConfigurationAccount = ContentKitContextBase & {
|
|
5203
|
-
type: "configuration_account";
|
|
5204
|
-
/** ID of the organization the account installation configuration is in. */
|
|
5205
|
-
organizationId: string;
|
|
5206
|
-
};
|
|
5207
|
-
/** Context while rendering in a space-installation's configuration. */
|
|
5208
|
-
export type ContentKitContextConfigurationSpace = ContentKitContextBase & {
|
|
5209
|
-
type: "configuration_space";
|
|
5210
|
-
/** ID of the space the space-installation configuration is in. */
|
|
5211
|
-
spaceId: string;
|
|
5212
|
-
};
|
|
5213
|
-
/** Context while rendering in a site-installation's configuration. */
|
|
5214
|
-
export type ContentKitContextConfigurationSite = ContentKitContextBase & {
|
|
5215
|
-
type: "configuration_site";
|
|
5216
|
-
/** ID of the site the site-installation configuration is in. */
|
|
5217
|
-
siteId: string;
|
|
5218
|
-
};
|
|
5219
|
-
/** Context while rendering the configuration flow of a content source. */
|
|
5220
|
-
export type ContentKitContextConfigurationContentSource = ContentKitContextBase & {
|
|
5221
|
-
type: "configuration_contentsource";
|
|
5222
|
-
/** ID of the organization the content source installation configuration is in. */
|
|
5223
|
-
organizationId: string;
|
|
5224
|
-
/** Optional ID of the space the content source installation configuration is in. */
|
|
5225
|
-
spaceId?: string;
|
|
5226
|
-
};
|
|
5227
|
-
/** Context while rendering in a document. */
|
|
5228
|
-
export type ContentKitContextDocument = ContentKitContextBase & {
|
|
5229
|
-
type: "document";
|
|
5230
|
-
/** ID of the space content the document is in. */
|
|
5231
|
-
spaceId: string;
|
|
5232
|
-
editable: boolean;
|
|
5233
|
-
};
|
|
5234
|
-
/** Object representing the context in which a ContentKit component is rendered. */
|
|
5235
|
-
export type ContentKitContext = ContentKitContextConfigurationAccount | ContentKitContextConfigurationSpace | ContentKitContextConfigurationSite | ContentKitContextConfigurationContentSource | ContentKitContextDocument;
|
|
5236
|
-
/** Event generated when rendering a UI */
|
|
5237
|
-
export type UIRenderEvent = (SpaceEvent | SiteEvent | InstallationEvent) & {
|
|
5238
|
-
auth?: {
|
|
5239
|
-
/** The user's ID. */
|
|
5240
|
-
userId: string;
|
|
5241
|
-
};
|
|
5242
|
-
type: "ui_render";
|
|
5243
|
-
componentId: string;
|
|
5244
|
-
/** Properties to render the UI. */
|
|
5245
|
-
props: object;
|
|
5246
|
-
/** State of the UI. */
|
|
5247
|
-
state?: object;
|
|
5248
|
-
/** Object representing the context in which a ContentKit component is rendered. */
|
|
5249
|
-
context: ContentKitContext;
|
|
5250
|
-
action?: object;
|
|
5251
|
-
};
|
|
5252
|
-
/** Generic event when computing the content of a space */
|
|
5253
|
-
export type ContentComputeEvent = SpaceEvent & {
|
|
5254
|
-
sourceId: string;
|
|
5255
|
-
/** Properties passed to the rendering. */
|
|
5256
|
-
props: PlainObject;
|
|
5257
|
-
/** Dependencies of the computation. */
|
|
5258
|
-
dependencies: Record<string, ComputedContentDependencyResolved>;
|
|
5259
|
-
};
|
|
5260
|
-
/**
|
|
5261
|
-
* Event generated when computing the document of a pages.
|
|
5262
|
-
* The integration should respond with a `Document`.
|
|
5263
|
-
*/
|
|
5264
|
-
export type ContentComputeDocumentEvent = ContentComputeEvent & {
|
|
5265
|
-
type: "content_compute_document";
|
|
5266
|
-
};
|
|
5267
|
-
/**
|
|
5268
|
-
* Event generated when computing revision in a content.
|
|
5269
|
-
* The integration should respond with an array of pages and files.
|
|
5270
|
-
*/
|
|
5271
|
-
export type ContentComputeRevisionEvent = ContentComputeEvent & {
|
|
5272
|
-
type: "content_compute_revision";
|
|
5273
|
-
};
|
|
5274
|
-
/** Event received when feedback has been submitted on a page. */
|
|
5275
|
-
export type PageFeedbackEvent = BaseEvent & {
|
|
5276
|
-
type: "page_feedback";
|
|
5277
|
-
/** ID of the integration installation */
|
|
5278
|
-
installationId: string;
|
|
5279
|
-
/**
|
|
5280
|
-
* Unique identifier of the space in the site.
|
|
5281
|
-
* @deprecated
|
|
5282
|
-
*/
|
|
5056
|
+
siteId?: string;
|
|
5283
5057
|
spaceId?: string;
|
|
5284
|
-
/** Unique identifier of the site. */
|
|
5285
|
-
siteId: string;
|
|
5286
|
-
/** Unique identifier of the page where feedback was submitted. */
|
|
5287
5058
|
pageId?: string;
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
/**
|
|
5292
|
-
* Optional comment provided with the feedback.
|
|
5293
|
-
* @minLength 1
|
|
5294
|
-
* @maxLength 512
|
|
5295
|
-
*/
|
|
5296
|
-
comment?: string;
|
|
5297
|
-
};
|
|
5298
|
-
/** Analytics info on the GitBook's content visitor. */
|
|
5299
|
-
visitor: EventVisitor;
|
|
5300
|
-
/** The GitBook content's URL where feedback was submitted. */
|
|
5301
|
-
url: string;
|
|
5302
|
-
/** The URL of referrer that linked to the page. */
|
|
5303
|
-
referrer: string;
|
|
5304
|
-
};
|
|
5059
|
+
revisionId?: string;
|
|
5060
|
+
}
|
|
5061
|
+
/** Diagnostic metadata for a delivered event, including historical records. The payload is intentionally limited to event type and identifiers; it is not the full runtime event. Events and configuration delivered to the integration runtime are unaffected. */
|
|
5305
5062
|
export interface IntegrationEvent {
|
|
5306
5063
|
/** Unique ID of the event. */
|
|
5307
5064
|
id: string;
|
|
@@ -5310,8 +5067,18 @@ export interface IntegrationEvent {
|
|
|
5310
5067
|
/** Unique ID of the integration installation. */
|
|
5311
5068
|
installationId?: string;
|
|
5312
5069
|
createdAt: Timestamp;
|
|
5313
|
-
/**
|
|
5314
|
-
payload:
|
|
5070
|
+
/** Safe diagnostic metadata for an integration event. This is not the event delivered to the integration. Configuration snapshots, request bodies and headers, URLs, visitor data, task and UI payloads, provider responses and arbitrary custom fields are omitted. */
|
|
5071
|
+
payload: IntegrationEventDiagnosticPayload;
|
|
5072
|
+
/** Correlation ID of the integration execution. */
|
|
5073
|
+
rayId?: string;
|
|
5074
|
+
/**
|
|
5075
|
+
* HTTP status of the integration execution, when available.
|
|
5076
|
+
* @min 100
|
|
5077
|
+
* @max 599
|
|
5078
|
+
*/
|
|
5079
|
+
statusCode?: number;
|
|
5080
|
+
/** Stable failure category. Raw error messages are never returned. */
|
|
5081
|
+
errorCategory?: "http_error" | "execution_error";
|
|
5315
5082
|
/** Status of the event. */
|
|
5316
5083
|
status: "success" | "failed";
|
|
5317
5084
|
}
|
|
@@ -5322,8 +5089,19 @@ export interface IntegrationEventLog {
|
|
|
5322
5089
|
/** The level of the log entry. */
|
|
5323
5090
|
level?: "debug" | "info" | "warn" | "error";
|
|
5324
5091
|
}
|
|
5092
|
+
/** Safe execution metadata. Worker log and exception text are suppressed. */
|
|
5325
5093
|
export interface IntegrationEventTrace {
|
|
5094
|
+
/** Always empty until a safe diagnostic log format is available. */
|
|
5326
5095
|
logs: IntegrationEventLog[];
|
|
5096
|
+
/** Correlation ID of the integration execution. */
|
|
5097
|
+
rayId?: string;
|
|
5098
|
+
createdAt?: Timestamp;
|
|
5099
|
+
outcome?: "ok" | "exception" | "exceededCpu" | "exceededMemory" | "canceled" | "unknown";
|
|
5100
|
+
/**
|
|
5101
|
+
* @min 100
|
|
5102
|
+
* @max 599
|
|
5103
|
+
*/
|
|
5104
|
+
statusCode?: number;
|
|
5327
5105
|
}
|
|
5328
5106
|
/** Base properties of an installation of an integration on a site or space. */
|
|
5329
5107
|
export interface IntegrationContentInstallationBase {
|
|
@@ -5332,7 +5110,7 @@ export interface IntegrationContentInstallationBase {
|
|
|
5332
5110
|
/** ID of the integration installation */
|
|
5333
5111
|
installation: string;
|
|
5334
5112
|
status: IntegrationInstallationStatus;
|
|
5335
|
-
/** Configuration
|
|
5113
|
+
/** Configuration for this site or space. For user authentication, oauth_credentials is returned as a boolean connection indicator. Send true when saving to preserve the connection, or omit the field to clear it. Only the integration or the matching installation can read or set OAuth credentials. */
|
|
5336
5114
|
configuration: object;
|
|
5337
5115
|
/** External IDs assigned by the integration. */
|
|
5338
5116
|
externalIds: IntegrationInstallationExternalIds;
|
|
@@ -5858,6 +5636,45 @@ export interface ContentKitRenderOutputComplete {
|
|
|
5858
5636
|
}
|
|
5859
5637
|
/** Output of the integration when rendering a UI. */
|
|
5860
5638
|
export type ContentKitRenderOutput = ContentKitRenderOutputElement | ContentKitRenderOutputComplete;
|
|
5639
|
+
/** Common properties for ContentKit context. */
|
|
5640
|
+
export interface ContentKitContextBase {
|
|
5641
|
+
theme: "dark" | "light";
|
|
5642
|
+
}
|
|
5643
|
+
/** Context while rendering in an account installation's configuration. */
|
|
5644
|
+
export type ContentKitContextConfigurationAccount = ContentKitContextBase & {
|
|
5645
|
+
type: "configuration_account";
|
|
5646
|
+
/** ID of the organization the account installation configuration is in. */
|
|
5647
|
+
organizationId: string;
|
|
5648
|
+
};
|
|
5649
|
+
/** Context while rendering in a space-installation's configuration. */
|
|
5650
|
+
export type ContentKitContextConfigurationSpace = ContentKitContextBase & {
|
|
5651
|
+
type: "configuration_space";
|
|
5652
|
+
/** ID of the space the space-installation configuration is in. */
|
|
5653
|
+
spaceId: string;
|
|
5654
|
+
};
|
|
5655
|
+
/** Context while rendering in a site-installation's configuration. */
|
|
5656
|
+
export type ContentKitContextConfigurationSite = ContentKitContextBase & {
|
|
5657
|
+
type: "configuration_site";
|
|
5658
|
+
/** ID of the site the site-installation configuration is in. */
|
|
5659
|
+
siteId: string;
|
|
5660
|
+
};
|
|
5661
|
+
/** Context while rendering the configuration flow of a content source. */
|
|
5662
|
+
export type ContentKitContextConfigurationContentSource = ContentKitContextBase & {
|
|
5663
|
+
type: "configuration_contentsource";
|
|
5664
|
+
/** ID of the organization the content source installation configuration is in. */
|
|
5665
|
+
organizationId: string;
|
|
5666
|
+
/** Optional ID of the space the content source installation configuration is in. */
|
|
5667
|
+
spaceId?: string;
|
|
5668
|
+
};
|
|
5669
|
+
/** Context while rendering in a document. */
|
|
5670
|
+
export type ContentKitContextDocument = ContentKitContextBase & {
|
|
5671
|
+
type: "document";
|
|
5672
|
+
/** ID of the space content the document is in. */
|
|
5673
|
+
spaceId: string;
|
|
5674
|
+
editable: boolean;
|
|
5675
|
+
};
|
|
5676
|
+
/** Object representing the context in which a ContentKit component is rendered. */
|
|
5677
|
+
export type ContentKitContext = ContentKitContextConfigurationAccount | ContentKitContextConfigurationSpace | ContentKitContextConfigurationSite | ContentKitContextConfigurationContentSource | ContentKitContextDocument;
|
|
5861
5678
|
export interface RenderIntegrationUI {
|
|
5862
5679
|
/** ID of the component to render in the integration. */
|
|
5863
5680
|
componentId: string;
|
|
@@ -5873,24 +5690,83 @@ export interface RenderIntegrationUI {
|
|
|
5873
5690
|
export interface UpdateIntegrationInstallation {
|
|
5874
5691
|
/** External IDs assigned by the integration. */
|
|
5875
5692
|
externalIds?: IntegrationInstallationExternalIds;
|
|
5876
|
-
/** Configuration of the integration
|
|
5693
|
+
/** Configuration of the integration. For user authentication, oauth_credentials is returned as a boolean indicating whether a connection is configured. When replacing the configuration, send true to preserve the existing connection, or omit the field to clear it. Only the integration or the matching installation can read or set the OAuth credentials. */
|
|
5877
5694
|
configuration?: IntegrationInstallationConfiguration;
|
|
5878
5695
|
/** Describe whether all spaces have been selected or there's a selection involved */
|
|
5879
5696
|
space_selection?: IntegrationInstallationSpaceSelection;
|
|
5880
5697
|
/** Describe whether all sites have been selected or there's a selection involved */
|
|
5881
5698
|
site_selection?: IntegrationInstallationSiteSelection;
|
|
5699
|
+
/** ID of a consumed OAuth transaction for this exact target, authorizing a credential write. Single use. */
|
|
5700
|
+
oauthTransaction?: string;
|
|
5701
|
+
}
|
|
5702
|
+
/** At most one of `spaceId` and `siteId` can be set. */
|
|
5703
|
+
export interface CreateIntegrationOAuthTransaction {
|
|
5704
|
+
/** Connect this space installation instead of the installation. */
|
|
5705
|
+
spaceId?: string;
|
|
5706
|
+
/** Connect this site installation instead of the installation. */
|
|
5707
|
+
siteId?: string;
|
|
5708
|
+
}
|
|
5709
|
+
export interface IntegrationOAuthTransactionStart {
|
|
5710
|
+
object: "integration-oauth-transaction-start";
|
|
5711
|
+
/** Opaque ID of the transaction, sent as the OAuth `state`. */
|
|
5712
|
+
id: string;
|
|
5713
|
+
expiresAt: Timestamp;
|
|
5714
|
+
/**
|
|
5715
|
+
* URL to open in the browser completing the flow: the target's `/oauth` route with `gitbook_oauth_transaction` and `gitbook_oauth_code_challenge`. Holds no secret.
|
|
5716
|
+
* @format uri
|
|
5717
|
+
*/
|
|
5718
|
+
startURL: string;
|
|
5719
|
+
}
|
|
5720
|
+
export interface ConsumeIntegrationOAuthTransaction {
|
|
5721
|
+
/** The exact `redirect_uri` sent to the provider's authorize and token endpoints. */
|
|
5722
|
+
redirectUri: string;
|
|
5723
|
+
/** The authorization code received on the callback. */
|
|
5724
|
+
code: string;
|
|
5725
|
+
}
|
|
5726
|
+
export interface IntegrationOAuthTransaction {
|
|
5727
|
+
object: "integration-oauth-transaction";
|
|
5728
|
+
id: string;
|
|
5729
|
+
/** ID of the organization of the installation. */
|
|
5730
|
+
organization: string;
|
|
5731
|
+
/** ID of the installation the credentials must be written to. */
|
|
5732
|
+
installation: string;
|
|
5733
|
+
/** ID of the space whose installation the credentials must be written to. */
|
|
5734
|
+
space?: string;
|
|
5735
|
+
/** ID of the site whose installation the credentials must be written to. */
|
|
5736
|
+
site?: string;
|
|
5737
|
+
/** PKCE code verifier, to send as `code_verifier` when exchanging the code. */
|
|
5738
|
+
codeVerifier: string;
|
|
5739
|
+
/** The validated redirect URI. */
|
|
5740
|
+
redirectUri: string;
|
|
5741
|
+
grantExpiresAt: Timestamp;
|
|
5742
|
+
}
|
|
5743
|
+
export interface ConfirmIntegrationOAuthTransaction {
|
|
5744
|
+
/** The one-time key from the confirm page's URL fragment. */
|
|
5745
|
+
key: string;
|
|
5746
|
+
}
|
|
5747
|
+
export interface IntegrationOAuthTransactionConfirmation {
|
|
5748
|
+
object: "integration-oauth-transaction-confirmation";
|
|
5749
|
+
/**
|
|
5750
|
+
* Callback URL to return the browser to, on the integrations host.
|
|
5751
|
+
* @format uri
|
|
5752
|
+
*/
|
|
5753
|
+
callbackURL: string;
|
|
5882
5754
|
}
|
|
5883
5755
|
export interface UpdateIntegrationSpaceInstallation {
|
|
5884
5756
|
/** External IDs assigned by the integration. */
|
|
5885
5757
|
externalIds?: IntegrationInstallationExternalIds;
|
|
5886
|
-
/** Configuration of the integration
|
|
5758
|
+
/** Configuration of the integration. For user authentication, oauth_credentials is returned as a boolean indicating whether a connection is configured. When replacing the configuration, send true to preserve the existing connection, or omit the field to clear it. Only the integration or the matching installation can read or set the OAuth credentials. */
|
|
5887
5759
|
configuration?: IntegrationInstallationConfiguration;
|
|
5760
|
+
/** ID of a consumed OAuth transaction for this exact target, authorizing a credential write. Single use. */
|
|
5761
|
+
oauthTransaction?: string;
|
|
5888
5762
|
}
|
|
5889
5763
|
export interface UpdateIntegrationSiteInstallation {
|
|
5890
5764
|
/** External IDs assigned by the integration. */
|
|
5891
5765
|
externalIds?: IntegrationInstallationExternalIds;
|
|
5892
|
-
/** Configuration of the integration
|
|
5766
|
+
/** Configuration of the integration. For user authentication, oauth_credentials is returned as a boolean indicating whether a connection is configured. When replacing the configuration, send true to preserve the existing connection, or omit the field to clear it. Only the integration or the matching installation can read or set the OAuth credentials. */
|
|
5893
5767
|
configuration?: IntegrationInstallationConfiguration;
|
|
5768
|
+
/** ID of a consumed OAuth transaction for this exact target, authorizing a credential write. Single use. */
|
|
5769
|
+
oauthTransaction?: string;
|
|
5894
5770
|
}
|
|
5895
5771
|
/** Preferences collected from the user during site onboarding, used to tailor recommendations and to apply their initial setup choices. */
|
|
5896
5772
|
export interface SiteOnboardingPreferences {
|
|
@@ -9467,6 +9343,8 @@ export interface AIMessage {
|
|
|
9467
9343
|
}
|
|
9468
9344
|
export type SiteQuestionAnswerWithResponse = SiteQuestionAnswer & {
|
|
9469
9345
|
response: AIMessage;
|
|
9346
|
+
/** Claims of the site visitor who asked, as recorded by site insights. Absent when the visitor sent no claims. */
|
|
9347
|
+
visitorClaims?: PlainObject;
|
|
9470
9348
|
};
|
|
9471
9349
|
export type SiteSpaceCustomizationSettings = SiteCustomizationSettings & {
|
|
9472
9350
|
/** Indicates whether the site customization settings have been overridden. */
|
|
@@ -9704,6 +9582,8 @@ export interface SiteSettingsBrokenLinks {
|
|
|
9704
9582
|
* - `suggest-fixes` drafts fixes for approval and applies none.
|
|
9705
9583
|
* - `fix-clear-matches` applies the clearest fixes and drafts the less certain ones for approval.
|
|
9706
9584
|
* - `fix-close-matches` applies the clear and the close fixes.
|
|
9585
|
+
* At every level, GitBook drafts change requests that fix broken links to other sites, and never
|
|
9586
|
+
* merges them.
|
|
9707
9587
|
*/
|
|
9708
9588
|
autonomyLevel: SiteSettingsBrokenLinksAutonomyLevel;
|
|
9709
9589
|
}
|
|
@@ -10723,6 +10603,22 @@ export interface SiteVisitorPayload {
|
|
|
10723
10603
|
country?: string;
|
|
10724
10604
|
unsignedClaims?: PlainObject;
|
|
10725
10605
|
}
|
|
10606
|
+
/** JSON schema describing the expected attributes of an Adaptive site schema. */
|
|
10607
|
+
export interface SiteAdaptiveJSONSchema {
|
|
10608
|
+
$schema?: "http://json-schema.org/draft-07/schema#";
|
|
10609
|
+
type: "object";
|
|
10610
|
+
properties: {
|
|
10611
|
+
/** Unsigned claims of the site visitor. */
|
|
10612
|
+
unsigned?: {
|
|
10613
|
+
type: "object";
|
|
10614
|
+
description: "Unsigned claims of the site visitor.";
|
|
10615
|
+
properties: Record<string, SiteAdaptiveJSONSchemaClaimsProperties>;
|
|
10616
|
+
additionalProperties: false;
|
|
10617
|
+
};
|
|
10618
|
+
[key: string]: any;
|
|
10619
|
+
};
|
|
10620
|
+
additionalProperties: false;
|
|
10621
|
+
}
|
|
10726
10622
|
/** GitHub repository that can be selected for Git Sync. */
|
|
10727
10623
|
export interface GitSyncGitHubRepository {
|
|
10728
10624
|
id: number;
|
|
@@ -10839,6 +10735,7 @@ export interface ContentLocationChangeRequestContext {
|
|
|
10839
10735
|
}
|
|
10840
10736
|
export interface ContentLocationFile {
|
|
10841
10737
|
kind: "file";
|
|
10738
|
+
/** Non-members of the organization only receive `object`, `id`, `title`, `sso`, `inviteLinks`, `urls`, `blocked` and `permissions`. */
|
|
10842
10739
|
organization: Organization;
|
|
10843
10740
|
space: Space;
|
|
10844
10741
|
versionContext?: ContentLocationRevisionContext | ContentLocationChangeRequestContext;
|
|
@@ -10860,6 +10757,7 @@ export interface ContentLocationPageNode {
|
|
|
10860
10757
|
}
|
|
10861
10758
|
export interface ContentLocationPage {
|
|
10862
10759
|
kind: "page";
|
|
10760
|
+
/** Non-members of the organization only receive `object`, `id`, `title`, `sso`, `inviteLinks`, `urls`, `blocked` and `permissions`. */
|
|
10863
10761
|
organization: Organization;
|
|
10864
10762
|
page: RevisionPage;
|
|
10865
10763
|
space: Space;
|
|
@@ -10872,16 +10770,19 @@ export interface ContentLocationUser {
|
|
|
10872
10770
|
}
|
|
10873
10771
|
export interface ContentLocationCollection {
|
|
10874
10772
|
kind: "collection";
|
|
10773
|
+
/** Non-members of the organization only receive `object`, `id`, `title`, `sso`, `inviteLinks`, `urls`, `blocked` and `permissions`. */
|
|
10875
10774
|
organization: Organization;
|
|
10876
10775
|
collection: Collection;
|
|
10877
10776
|
}
|
|
10878
10777
|
export interface ContentLocationSpace {
|
|
10879
10778
|
kind: "space";
|
|
10779
|
+
/** Non-members of the organization only receive `object`, `id`, `title`, `sso`, `inviteLinks`, `urls`, `blocked` and `permissions`. */
|
|
10880
10780
|
organization: Organization;
|
|
10881
10781
|
space: Space;
|
|
10882
10782
|
}
|
|
10883
10783
|
export interface ContentLocationReusableContent {
|
|
10884
10784
|
kind: "reusable-content";
|
|
10785
|
+
/** Non-members of the organization only receive `object`, `id`, `title`, `sso`, `inviteLinks`, `urls`, `blocked` and `permissions`. */
|
|
10885
10786
|
organization: Organization;
|
|
10886
10787
|
space: Space;
|
|
10887
10788
|
versionContext?: ContentLocationRevisionContext | ContentLocationChangeRequestContext;
|
|
@@ -10889,6 +10790,7 @@ export interface ContentLocationReusableContent {
|
|
|
10889
10790
|
}
|
|
10890
10791
|
export interface ContentLocationOpenAPI {
|
|
10891
10792
|
kind: "openapi";
|
|
10793
|
+
/** Non-members of the organization only receive `object`, `id`, `title`, `sso`, `inviteLinks`, `urls`, `blocked` and `permissions`. */
|
|
10892
10794
|
organization: Organization;
|
|
10893
10795
|
openAPISpec: OpenAPISpec;
|
|
10894
10796
|
}
|
|
@@ -11434,63 +11336,336 @@ export interface GitSyncSiteConfig {
|
|
|
11434
11336
|
*/
|
|
11435
11337
|
structure: GitSyncSiteStructure;
|
|
11436
11338
|
};
|
|
11437
|
-
}
|
|
11438
|
-
export type IntegrationEnvironmentSpaceInstallation = IntegrationContentInstallationBase & {
|
|
11439
|
-
/** The space the integration is installed on. */
|
|
11440
|
-
space: string;
|
|
11339
|
+
}
|
|
11340
|
+
export type IntegrationEnvironmentSpaceInstallation = IntegrationContentInstallationBase & {
|
|
11341
|
+
/** The space the integration is installed on. */
|
|
11342
|
+
space: string;
|
|
11343
|
+
};
|
|
11344
|
+
export type IntegrationEnvironmentSiteInstallation = IntegrationContentInstallationBase & {
|
|
11345
|
+
/** The site the integration is installed on. */
|
|
11346
|
+
site: string;
|
|
11347
|
+
};
|
|
11348
|
+
/** Runtime environment provided during the execution of integration's code. */
|
|
11349
|
+
export interface IntegrationEnvironment {
|
|
11350
|
+
/**
|
|
11351
|
+
* Authentication token to use with the HTTP API. Depending on the context, the token might be representing the installation or the integration.
|
|
11352
|
+
* @deprecated
|
|
11353
|
+
*/
|
|
11354
|
+
authToken?: string;
|
|
11355
|
+
integration: Integration;
|
|
11356
|
+
/** Installation of an integration on an account */
|
|
11357
|
+
installation?: IntegrationInstallation;
|
|
11358
|
+
spaceInstallation?: IntegrationEnvironmentSpaceInstallation;
|
|
11359
|
+
siteInstallation?: IntegrationEnvironmentSiteInstallation;
|
|
11360
|
+
/** Secrets stored on the integration and passed at runtime. */
|
|
11361
|
+
secrets: IntegrationSecrets;
|
|
11362
|
+
/**
|
|
11363
|
+
* Secret that can be used to verify the authenticity of incoming HTTP requests to the integration.
|
|
11364
|
+
* @deprecated
|
|
11365
|
+
*/
|
|
11366
|
+
signingSecret?: string;
|
|
11367
|
+
signingSecrets: {
|
|
11368
|
+
/** Secret that can be used to verify the authenticity of incoming HTTP requests to the integration. */
|
|
11369
|
+
integration: string;
|
|
11370
|
+
/** Secret that can be used to verify the authenticity of incoming HTTP requests to the installation. */
|
|
11371
|
+
installation?: string;
|
|
11372
|
+
/** Secret that can be used to verify the authenticity of incoming HTTP requests to the space installation. */
|
|
11373
|
+
spaceInstallation?: string;
|
|
11374
|
+
/** Secret that can be used to verify the authenticity of incoming HTTP requests to the site installation. */
|
|
11375
|
+
siteInstallation?: string;
|
|
11376
|
+
};
|
|
11377
|
+
/** URL of the HTTP API */
|
|
11378
|
+
apiEndpoint: string;
|
|
11379
|
+
apiTokens: {
|
|
11380
|
+
/** API authentication token representing the integration. */
|
|
11381
|
+
integration: string;
|
|
11382
|
+
/** API authentication token representing the current installation. */
|
|
11383
|
+
installation?: string;
|
|
11384
|
+
};
|
|
11385
|
+
/** Network configuration for the integration environment */
|
|
11386
|
+
network?: IntegrationNetwork;
|
|
11387
|
+
}
|
|
11388
|
+
export interface SpaceIntegrationScript {
|
|
11389
|
+
/** Script URL to load. */
|
|
11390
|
+
script: URL;
|
|
11391
|
+
/** Content Security Policy to secure the loading of this script. */
|
|
11392
|
+
contentSecurityPolicy?: string;
|
|
11393
|
+
/** If true, the script will potentially load use cookies and visitors should be aware. */
|
|
11394
|
+
cookies: boolean;
|
|
11395
|
+
}
|
|
11396
|
+
/** Common properties for all events. */
|
|
11397
|
+
export interface BaseEvent {
|
|
11398
|
+
/** Unique identifier for the event. */
|
|
11399
|
+
eventId: string;
|
|
11400
|
+
/** Type of the event. */
|
|
11401
|
+
type: string;
|
|
11402
|
+
}
|
|
11403
|
+
/** Common properties for all events related to an installation */
|
|
11404
|
+
export type InstallationEvent = BaseEvent & {
|
|
11405
|
+
/** ID of the integration installation */
|
|
11406
|
+
installationId: string;
|
|
11407
|
+
};
|
|
11408
|
+
/** Event received when integration has been installed or updated. */
|
|
11409
|
+
export type InstallationSetupEvent = InstallationEvent & {
|
|
11410
|
+
type: "installation_setup";
|
|
11411
|
+
status: IntegrationInstallationStatus;
|
|
11412
|
+
/** The state of the installation at the account level before it was updated. */
|
|
11413
|
+
previous?: {
|
|
11414
|
+
status: IntegrationInstallationStatus;
|
|
11415
|
+
/** The previous configuration of the installation at the account level. */
|
|
11416
|
+
configuration?: object;
|
|
11417
|
+
};
|
|
11418
|
+
};
|
|
11419
|
+
/** Event received when integration has been uninstalled from an organization. */
|
|
11420
|
+
export type InstallationDeletedEvent = InstallationEvent & {
|
|
11421
|
+
type: "installation_deleted";
|
|
11422
|
+
/** The state of the installation before it was deleted. */
|
|
11423
|
+
previous: {
|
|
11424
|
+
/** The previous configuration of the installation. */
|
|
11425
|
+
configuration?: object;
|
|
11426
|
+
};
|
|
11427
|
+
};
|
|
11428
|
+
/** Common properties for all events related to a specific space. */
|
|
11429
|
+
export type SpaceEvent = InstallationEvent & {
|
|
11430
|
+
/** ID of the space */
|
|
11431
|
+
spaceId: string;
|
|
11432
|
+
};
|
|
11433
|
+
/** Event received when integration has been installed or updated on a space. */
|
|
11434
|
+
export type SpaceInstallationSetupEvent = SpaceEvent & {
|
|
11435
|
+
type: "space_installation_setup";
|
|
11436
|
+
status: IntegrationInstallationStatus;
|
|
11437
|
+
/** The state of the Space installation before it was updated. */
|
|
11438
|
+
previous?: {
|
|
11439
|
+
status: IntegrationInstallationStatus;
|
|
11440
|
+
/** The previous configuration of the Space installation. */
|
|
11441
|
+
configuration?: object;
|
|
11442
|
+
};
|
|
11443
|
+
};
|
|
11444
|
+
/** Event received when integration has been uninstalled from a space. */
|
|
11445
|
+
export type SpaceInstallationDeletedEvent = SpaceEvent & {
|
|
11446
|
+
type: "space_installation_deleted";
|
|
11447
|
+
/** The state of the Space installation before it was deleted. */
|
|
11448
|
+
previous: {
|
|
11449
|
+
/** The previous configuration of the Space installation. */
|
|
11450
|
+
configuration?: object;
|
|
11451
|
+
};
|
|
11452
|
+
};
|
|
11453
|
+
/** Common properties for all events related to a specific site. */
|
|
11454
|
+
export type SiteEvent = InstallationEvent & {
|
|
11455
|
+
/** ID of the site */
|
|
11456
|
+
siteId: string;
|
|
11457
|
+
};
|
|
11458
|
+
/** Event received when integration has been installed or updated on a site. */
|
|
11459
|
+
export type SiteInstallationSetupEvent = SiteEvent & {
|
|
11460
|
+
type: "site_installation_setup";
|
|
11461
|
+
status: IntegrationInstallationStatus;
|
|
11462
|
+
/** The state of the site installation before it was updated. */
|
|
11463
|
+
previous?: {
|
|
11464
|
+
status: IntegrationInstallationStatus;
|
|
11465
|
+
/** The previous configuration of the site installation. */
|
|
11466
|
+
configuration?: object;
|
|
11467
|
+
};
|
|
11468
|
+
};
|
|
11469
|
+
/** Event received when integration has been uninstalled from a site. */
|
|
11470
|
+
export type SiteInstallationDeletedEvent = SiteEvent & {
|
|
11471
|
+
type: "site_installation_deleted";
|
|
11472
|
+
/** The state of the site installation before it was deleted. */
|
|
11473
|
+
previous: {
|
|
11474
|
+
/** The previous configuration of the site installation. */
|
|
11475
|
+
configuration?: object;
|
|
11476
|
+
};
|
|
11477
|
+
};
|
|
11478
|
+
/** Analytics info on the GitBook's content visitor. */
|
|
11479
|
+
export interface EventVisitor {
|
|
11480
|
+
/** GitBook's unique identifier of the visitor. */
|
|
11481
|
+
anonymousId: string;
|
|
11482
|
+
/** The visitors cookies. */
|
|
11483
|
+
cookies: Record<string, string>;
|
|
11484
|
+
/** User-agent of the visitor. */
|
|
11485
|
+
userAgent: string;
|
|
11486
|
+
/** IP address of the visitor. */
|
|
11487
|
+
ip: string;
|
|
11488
|
+
/** Language of the visitor. */
|
|
11489
|
+
language?: string;
|
|
11490
|
+
}
|
|
11491
|
+
/** Event received when a page has been visited on a site. */
|
|
11492
|
+
export type SiteViewEvent = SiteEvent & {
|
|
11493
|
+
type: "site_view";
|
|
11494
|
+
/**
|
|
11495
|
+
* Unique identifier of the visited space in the site.
|
|
11496
|
+
* @deprecated
|
|
11497
|
+
*/
|
|
11498
|
+
spaceId?: string;
|
|
11499
|
+
/** The site-space that was viewed */
|
|
11500
|
+
siteSpaceId?: string;
|
|
11501
|
+
/** Unique identifier of the visited page. */
|
|
11502
|
+
pageId?: string;
|
|
11503
|
+
/** Analytics info on the GitBook's content visitor. */
|
|
11504
|
+
visitor: EventVisitor;
|
|
11505
|
+
/** The GitBook content's URL visited (including URL params). */
|
|
11506
|
+
url: string;
|
|
11507
|
+
/** The URL of referrer that linked to the page. */
|
|
11508
|
+
referrer: string;
|
|
11509
|
+
};
|
|
11510
|
+
/** Event when the primary content of a space has been updated. */
|
|
11511
|
+
export type SpaceContentUpdatedEvent = SpaceEvent & {
|
|
11512
|
+
type: "space_content_updated";
|
|
11513
|
+
/** Unique identifier of the new content revision */
|
|
11514
|
+
revisionId: string;
|
|
11515
|
+
/** Users who updated the content */
|
|
11516
|
+
updatedBy: User[];
|
|
11517
|
+
};
|
|
11518
|
+
/** Event when a GitSync operation has been completed. */
|
|
11519
|
+
export type SpaceGitSyncCompletedEvent = SpaceEvent & {
|
|
11520
|
+
type: "space_gitsync_completed";
|
|
11521
|
+
state: "success" | "failure";
|
|
11522
|
+
/** Unique identifier of the new content revision */
|
|
11523
|
+
revisionId: string;
|
|
11524
|
+
/** Unique identifier for the commit (sha) */
|
|
11525
|
+
commitId: string;
|
|
11526
|
+
};
|
|
11527
|
+
/** Event when a GitSync operation has been started. */
|
|
11528
|
+
export type SpaceGitSyncStartedEvent = SpaceEvent & {
|
|
11529
|
+
type: "space_gitsync_started";
|
|
11530
|
+
/** Unique identifier of the new content revision */
|
|
11531
|
+
revisionId: string;
|
|
11532
|
+
/** Unique identifier for the commit (sha) */
|
|
11533
|
+
commitId: string;
|
|
11534
|
+
};
|
|
11535
|
+
/** Event when the visibility of the space has been changed. */
|
|
11536
|
+
export type SpaceVisibilityUpdatedEvent = SpaceEvent & {
|
|
11537
|
+
type: "space_visibility_updated";
|
|
11538
|
+
/**
|
|
11539
|
+
* * `public`: Anyone can access the content, and the content is indexed by search engines.
|
|
11540
|
+
* * `unlisted`: Anyone can access the content, and the content is not indexed by search engines
|
|
11541
|
+
* * `share-link`: Anyone with a secret token in the url can access the content.
|
|
11542
|
+
* * `visitor-auth`: Anyone authenticated through a JWT token can access the content.
|
|
11543
|
+
* * `in-collection`: Anyone who can access the parent collection can access the content.
|
|
11544
|
+
* Only available for spaces in a collection.
|
|
11545
|
+
* * `private`: Authorized members can access the content.
|
|
11546
|
+
*/
|
|
11547
|
+
previousVisibility: ContentVisibility;
|
|
11548
|
+
/**
|
|
11549
|
+
* * `public`: Anyone can access the content, and the content is indexed by search engines.
|
|
11550
|
+
* * `unlisted`: Anyone can access the content, and the content is not indexed by search engines
|
|
11551
|
+
* * `share-link`: Anyone with a secret token in the url can access the content.
|
|
11552
|
+
* * `visitor-auth`: Anyone authenticated through a JWT token can access the content.
|
|
11553
|
+
* * `in-collection`: Anyone who can access the parent collection can access the content.
|
|
11554
|
+
* Only available for spaces in a collection.
|
|
11555
|
+
* * `private`: Authorized members can access the content.
|
|
11556
|
+
*/
|
|
11557
|
+
visibility: ContentVisibility;
|
|
11558
|
+
};
|
|
11559
|
+
/** Event representing a background task trigger for an integration. */
|
|
11560
|
+
export type TaskEvent = BaseEvent & {
|
|
11561
|
+
type: "task";
|
|
11562
|
+
/** Payload associated with the integration task. */
|
|
11563
|
+
task: object;
|
|
11564
|
+
};
|
|
11565
|
+
export interface FetchRequest {
|
|
11566
|
+
method: "post" | "get" | "put" | "delete";
|
|
11567
|
+
url: string;
|
|
11568
|
+
headers: Record<string, string>;
|
|
11569
|
+
}
|
|
11570
|
+
/** Event representing an incoming HTTP request. */
|
|
11571
|
+
export type FetchEvent = BaseEvent & {
|
|
11572
|
+
/** The space ID, if requests are specific to a single space */
|
|
11573
|
+
spaceId?: string;
|
|
11574
|
+
/** The site ID, if requests are specific to a single site */
|
|
11575
|
+
siteId?: string;
|
|
11576
|
+
/** The installation ID, if requests are specific to a single installation */
|
|
11577
|
+
installationId?: string;
|
|
11578
|
+
auth?: {
|
|
11579
|
+
/** The user's ID. */
|
|
11580
|
+
userId: string;
|
|
11581
|
+
};
|
|
11582
|
+
type: "fetch";
|
|
11583
|
+
request: FetchRequest;
|
|
11441
11584
|
};
|
|
11442
|
-
|
|
11443
|
-
|
|
11444
|
-
|
|
11585
|
+
/** Common properties for all events related to fetching a published script from an installation */
|
|
11586
|
+
export type FetchPublishedScriptEvent = SiteEvent & {
|
|
11587
|
+
type: "fetch_published_script";
|
|
11445
11588
|
};
|
|
11446
|
-
/**
|
|
11447
|
-
export
|
|
11448
|
-
|
|
11449
|
-
|
|
11450
|
-
|
|
11451
|
-
|
|
11452
|
-
|
|
11453
|
-
|
|
11454
|
-
/**
|
|
11455
|
-
|
|
11456
|
-
|
|
11457
|
-
|
|
11458
|
-
|
|
11459
|
-
|
|
11589
|
+
/** Common properties for all events related to authenticated access from an installation */
|
|
11590
|
+
export type FetchVisitorAuthenticationEvent = SiteEvent & {
|
|
11591
|
+
type: "fetch_visitor_authentication";
|
|
11592
|
+
location?: string;
|
|
11593
|
+
/** Whitelisted search parameters from the visitor authentication request. */
|
|
11594
|
+
searchParams?: Record<string, string>;
|
|
11595
|
+
/** Whitelisted cookies from the visitor authentication request. */
|
|
11596
|
+
cookies?: Record<string, string>;
|
|
11597
|
+
/** The visitor authentication action to resolve. If omitted, integrations resolve to the existing login redirect. */
|
|
11598
|
+
action?: "logout";
|
|
11599
|
+
};
|
|
11600
|
+
/** Event generated when rendering a UI */
|
|
11601
|
+
export type UIRenderEvent = (SpaceEvent | SiteEvent | InstallationEvent) & {
|
|
11602
|
+
auth?: {
|
|
11603
|
+
/** The user's ID. */
|
|
11604
|
+
userId: string;
|
|
11605
|
+
};
|
|
11606
|
+
type: "ui_render";
|
|
11607
|
+
componentId: string;
|
|
11608
|
+
/** Properties to render the UI. */
|
|
11609
|
+
props: object;
|
|
11610
|
+
/** State of the UI. */
|
|
11611
|
+
state?: object;
|
|
11612
|
+
/** Object representing the context in which a ContentKit component is rendered. */
|
|
11613
|
+
context: ContentKitContext;
|
|
11614
|
+
action?: object;
|
|
11615
|
+
};
|
|
11616
|
+
/** Generic event when computing the content of a space */
|
|
11617
|
+
export type ContentComputeEvent = SpaceEvent & {
|
|
11618
|
+
sourceId: string;
|
|
11619
|
+
/** Properties passed to the rendering. */
|
|
11620
|
+
props: PlainObject;
|
|
11621
|
+
/** Dependencies of the computation. */
|
|
11622
|
+
dependencies: Record<string, ComputedContentDependencyResolved>;
|
|
11623
|
+
};
|
|
11624
|
+
/**
|
|
11625
|
+
* Event generated when computing the document of a pages.
|
|
11626
|
+
* The integration should respond with a `Document`.
|
|
11627
|
+
*/
|
|
11628
|
+
export type ContentComputeDocumentEvent = ContentComputeEvent & {
|
|
11629
|
+
type: "content_compute_document";
|
|
11630
|
+
};
|
|
11631
|
+
/**
|
|
11632
|
+
* Event generated when computing revision in a content.
|
|
11633
|
+
* The integration should respond with an array of pages and files.
|
|
11634
|
+
*/
|
|
11635
|
+
export type ContentComputeRevisionEvent = ContentComputeEvent & {
|
|
11636
|
+
type: "content_compute_revision";
|
|
11637
|
+
};
|
|
11638
|
+
/** Event received when feedback has been submitted on a page. */
|
|
11639
|
+
export type PageFeedbackEvent = BaseEvent & {
|
|
11640
|
+
type: "page_feedback";
|
|
11641
|
+
/** ID of the integration installation */
|
|
11642
|
+
installationId: string;
|
|
11460
11643
|
/**
|
|
11461
|
-
*
|
|
11644
|
+
* Unique identifier of the space in the site.
|
|
11462
11645
|
* @deprecated
|
|
11463
11646
|
*/
|
|
11464
|
-
|
|
11465
|
-
|
|
11466
|
-
|
|
11467
|
-
|
|
11468
|
-
|
|
11469
|
-
|
|
11470
|
-
|
|
11471
|
-
|
|
11472
|
-
/**
|
|
11473
|
-
|
|
11474
|
-
|
|
11475
|
-
|
|
11476
|
-
|
|
11477
|
-
|
|
11478
|
-
/** API authentication token representing the integration. */
|
|
11479
|
-
integration: string;
|
|
11480
|
-
/** API authentication token representing the current installation. */
|
|
11481
|
-
installation?: string;
|
|
11647
|
+
spaceId?: string;
|
|
11648
|
+
/** Unique identifier of the site. */
|
|
11649
|
+
siteId: string;
|
|
11650
|
+
/** Unique identifier of the page where feedback was submitted. */
|
|
11651
|
+
pageId?: string;
|
|
11652
|
+
/** The feedback data submitted by the visitor. */
|
|
11653
|
+
feedback: {
|
|
11654
|
+
rating: PageFeedbackRating;
|
|
11655
|
+
/**
|
|
11656
|
+
* Optional comment provided with the feedback.
|
|
11657
|
+
* @minLength 1
|
|
11658
|
+
* @maxLength 512
|
|
11659
|
+
*/
|
|
11660
|
+
comment?: string;
|
|
11482
11661
|
};
|
|
11483
|
-
/**
|
|
11484
|
-
|
|
11485
|
-
|
|
11486
|
-
|
|
11487
|
-
/**
|
|
11488
|
-
|
|
11489
|
-
|
|
11490
|
-
contentSecurityPolicy?: string;
|
|
11491
|
-
/** If true, the script will potentially load use cookies and visitors should be aware. */
|
|
11492
|
-
cookies: boolean;
|
|
11493
|
-
}
|
|
11662
|
+
/** Analytics info on the GitBook's content visitor. */
|
|
11663
|
+
visitor: EventVisitor;
|
|
11664
|
+
/** The GitBook content's URL where feedback was submitted. */
|
|
11665
|
+
url: string;
|
|
11666
|
+
/** The URL of referrer that linked to the page. */
|
|
11667
|
+
referrer: string;
|
|
11668
|
+
};
|
|
11494
11669
|
/** Response expected for an event of type `content_compute_document`. */
|
|
11495
11670
|
export interface ContentComputeDocumentEventResponse {
|
|
11496
11671
|
document: Document;
|
|
@@ -11912,22 +12087,6 @@ export interface APIChannelMutationData {
|
|
|
11912
12087
|
executionId: string;
|
|
11913
12088
|
};
|
|
11914
12089
|
}
|
|
11915
|
-
/** JSON schema describing the expected attributes of an Adaptive site schema. */
|
|
11916
|
-
export interface SiteAdaptiveJSONSchema {
|
|
11917
|
-
$schema?: "http://json-schema.org/draft-07/schema#";
|
|
11918
|
-
type: "object";
|
|
11919
|
-
properties: {
|
|
11920
|
-
/** Unsigned claims of the site visitor. */
|
|
11921
|
-
unsigned?: {
|
|
11922
|
-
type: "object";
|
|
11923
|
-
description: "Unsigned claims of the site visitor.";
|
|
11924
|
-
properties: Record<string, SiteAdaptiveJSONSchemaClaimsProperties>;
|
|
11925
|
-
additionalProperties: false;
|
|
11926
|
-
};
|
|
11927
|
-
[key: string]: any;
|
|
11928
|
-
};
|
|
11929
|
-
additionalProperties: false;
|
|
11930
|
-
}
|
|
11931
12090
|
export type SiteAdaptiveDeterministicJSONSchemaClaimsProperties = SiteAdaptiveDeterministicJSONSchemaPrimitives | {
|
|
11932
12091
|
type: "object";
|
|
11933
12092
|
description: string;
|
|
@@ -12077,6 +12236,9 @@ export type RequestPublishIntegration = PublishIntegration;
|
|
|
12077
12236
|
export type RequestUpdateIntegrationInstallation = UpdateIntegrationInstallation;
|
|
12078
12237
|
export type RequestUpdateIntegrationSpaceInstallation = UpdateIntegrationSpaceInstallation;
|
|
12079
12238
|
export type RequestUpdateIntegrationSiteInstallation = UpdateIntegrationSiteInstallation;
|
|
12239
|
+
export type RequestCreateIntegrationOAuthTransaction = CreateIntegrationOAuthTransaction;
|
|
12240
|
+
export type RequestConsumeIntegrationOAuthTransaction = ConsumeIntegrationOAuthTransaction;
|
|
12241
|
+
export type RequestConfirmIntegrationOAuthTransaction = ConfirmIntegrationOAuthTransaction;
|
|
12080
12242
|
export type RequestUpgradeOrganizationBilling = UpgradeOrganizationBilling;
|
|
12081
12243
|
export type RequestInviteUsersToOrganization = InviteUsersToOrganization;
|
|
12082
12244
|
export type RequestImportGitRepository = ImportGitRepository;
|
|
@@ -13364,7 +13526,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
13364
13526
|
computed?: boolean;
|
|
13365
13527
|
}, params?: RequestParams) => Promise<HttpResponse<Revision, any>>;
|
|
13366
13528
|
/**
|
|
13367
|
-
* @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, rename, 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. **Renaming a page** — `update_page` can change a page's `title` and/or its `slug` (the path segment used to build its URL within its current parent). Both fields are independent: to rename only the title without changing the URL, set `title` and omit `slug`; to change the URL without changing the title, set `slug` and omit `title`. **Moving a page** — `update_page` can also change a page's parent and/or its position among siblings with `into`/`at`. Set `into` to the new parent's page ID, or `null` to move the page to the root of the tree; omit `into` to leave the parent unchanged. Set `at` to place the page at a specific zero-based index among its new siblings; omit it to leave the position unchanged (when the parent isn't changing) or append at the end (when it is). A page cannot be moved under itself or one of its own descendants. `insert_page`'s `into`/`at` remain the way to place a **new** page at creation time. To put an image or attachment in a page, upload it with an `insert_files` change. Give the file a `ref` and a page inserted in the same batch can reference it as `` or `[File](./<ref>)`, which resolves to the file's ID at apply time regardless of operation order. Uploaded files are also listed as `insertedFiles` when `compat=false`, and a file already in the change request can be referenced directly as `/files/<fileId>`. Inline `data:` URIs in markdown are not ingested and large image blocks are dropped, so upload the bytes with `insert_files` instead. **Reusable content** (snippets shared by several pages, Git Sync's `.gitbook/includes/`) is created with `insert_reusable_contents`, changed with `update_reusable_content` and removed with `delete_reusable_content`. A page includes one in markdown as `{% include "/reusable-content/<reusableContentId>" %}`; give a new one a `ref` and a page in the same batch can include it as `{% include "./<ref>" %}`, regardless of operation order. Created reusable contents are listed as `insertedReusableContents` when `compat=false`. An update keeps the ID, so every page including it shows the change. Deleting one leaves the includes in pages unresolved, as in the editor: remove them from those pages too. Reusable content cannot include other reusable content, so an include in its document is dropped. Unlike a link, an include that matches no reusable content of the change request (or of the batch) rejects the batch, since dropping it would remove it from the page silently. **Variables** (space variables, Git Sync's `.gitbook/vars.yaml`) are created with `insert_variables` and
|
|
13529
|
+
* @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, rename, 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. **Renaming a page** — `update_page` can change a page's `title` and/or its `slug` (the path segment used to build its URL within its current parent). Both fields are independent: to rename only the title without changing the URL, set `title` and omit `slug`; to change the URL without changing the title, set `slug` and omit `title`. **Moving a page** — `update_page` can also change a page's parent and/or its position among siblings with `into`/`at`. Set `into` to the new parent's page ID, or `null` to move the page to the root of the tree; omit `into` to leave the parent unchanged. Set `at` to place the page at a specific zero-based index among its new siblings; omit it to leave the position unchanged (when the parent isn't changing) or append at the end (when it is). A page cannot be moved under itself or one of its own descendants. `insert_page`'s `into`/`at` remain the way to place a **new** page at creation time. **Tags**: create flat tag definitions with `insert_tags` and a `tags` array of 1-50 entries, edit their label or appearance with `update_tag`, and remove definitions with `delete_tag`. Slugs are immutable and generated from the label when omitted on insertion. Operations apply in order, so later updates or deletions can target newly inserted tags. Set `icon` or `emoji` to `null` to clear that field; omission preserves it. A non-null icon takes precedence over a non-null emoji. Deleting a tag leaves references in content unresolved. For example: `{"changes":[{"operation":"insert_tags","tags":[{"label":"Beta"}]}, {"operation":"update_tag","tag":"beta","color":"blue"}]}`. To put an image or attachment in a page, upload it with an `insert_files` change. Give the file a `ref` and a page inserted in the same batch can reference it as `` or `[File](./<ref>)`, which resolves to the file's ID at apply time regardless of operation order. Uploaded files are also listed as `insertedFiles` when `compat=false`, and a file already in the change request can be referenced directly as `/files/<fileId>`. Inline `data:` URIs in markdown are not ingested and large image blocks are dropped, so upload the bytes with `insert_files` instead. **Reusable content** (snippets shared by several pages, Git Sync's `.gitbook/includes/`) is created with `insert_reusable_contents`, changed with `update_reusable_content` and removed with `delete_reusable_content`. A page includes one in markdown as `{% include "/reusable-content/<reusableContentId>" %}`; give a new one a `ref` and a page in the same batch can include it as `{% include "./<ref>" %}`, regardless of operation order. Created reusable contents are listed as `insertedReusableContents` when `compat=false`. An update keeps the ID, so every page including it shows the change. Deleting one leaves the includes in pages unresolved, as in the editor: remove them from those pages too. Reusable content cannot include other reusable content, so an include in its document is dropped. Unlike a link, an include that matches no reusable content of the change request (or of the batch) rejects the batch, since dropping it would remove it from the page silently. **Variables** (space variables, Git Sync's `.gitbook/vars.yaml`) are created with `insert_variables`, changed with `update_variable` and removed with `delete_variable`. A variable is identified by its name, which content references as an expression: `<code class="expression">space.vars.<name></code>` in markdown. Inserting a name the change request already uses, or updating or deleting one it does not, rejects the batch. Deleting a variable keeps the expressions referencing it, as in the editor: remove them from those pages too. A page's own variables (`page.vars.<name>`) are set with `insert_page`/`update_page`'s `variables`, or the `vars` frontmatter of a markdown document, which replace all of that page's variables. To change one of them without resending the rest, give `insert_variables`, `update_variable` or `delete_variable` a `page`; the same rules apply to that page's variables. **Publishing an OpenAPI spec** — an OpenAPI spec belongs to the organization (see `createOpenAPISpec`) and appears in a space only through a page that renders it. Insert that page with an `insert_computed_page` change: `{ "operation": "insert_computed_page", "title": "API reference", "computed": { "type": "builtin:openapi", "props": { "models": true }, "dependencies": { "spec": { "ref": { "kind": "openapi", "spec": "<spec slug>" } } } } }`. GitBook replaces that page, at its position, with the API reference: one page per tag (or per operation with `"grouping": "by-operation"` in `props`), plus a models page when `models` is true, regenerated whenever the spec changes. Use `into` to nest the reference under an existing page. Do not recreate a spec with `insert_page`: `openapi-operation` blocks in a document only render the operations they name. 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. For change requests with frequent concurrent edits, consider `expectedRevision` to protect against overwriting changes made since your read. If the branch has changed since the supplied revision, the batch is rejected with HTTP 409 and none of the submitted changes are applied. **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.
|
|
13368
13530
|
*
|
|
13369
13531
|
* @tags change-request-content
|
|
13370
13532
|
* @name UpdateChangeRequestContent
|
|
@@ -14554,7 +14716,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
14554
14716
|
};
|
|
14555
14717
|
}>>;
|
|
14556
14718
|
/**
|
|
14557
|
-
*
|
|
14719
|
+
* @description Publishes integration code and configuration. GitBook-owned integrations in production require a controlled deployment and cannot be created, updated or transferred through this operation.
|
|
14558
14720
|
*
|
|
14559
14721
|
* @tags integrations
|
|
14560
14722
|
* @name PublishIntegration
|
|
@@ -14563,6 +14725,12 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
14563
14725
|
* @secure
|
|
14564
14726
|
*/
|
|
14565
14727
|
publishIntegration: (integrationName: string, data: PublishIntegration, params?: RequestParams) => Promise<HttpResponse<Integration, {
|
|
14728
|
+
error: {
|
|
14729
|
+
/** @format int32 */
|
|
14730
|
+
code: 403;
|
|
14731
|
+
message: string;
|
|
14732
|
+
};
|
|
14733
|
+
} | {
|
|
14566
14734
|
error: {
|
|
14567
14735
|
/** @format int32 */
|
|
14568
14736
|
code: 404;
|
|
@@ -14570,7 +14738,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
14570
14738
|
};
|
|
14571
14739
|
}>>;
|
|
14572
14740
|
/**
|
|
14573
|
-
*
|
|
14741
|
+
* @description Removes an integration. GitBook-owned production integrations require a controlled deployment and cannot be removed through this operation.
|
|
14574
14742
|
*
|
|
14575
14743
|
* @tags integrations
|
|
14576
14744
|
* @name UnpublishIntegration
|
|
@@ -14578,7 +14746,13 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
14578
14746
|
* @request DELETE:/integrations/{integrationName}
|
|
14579
14747
|
* @secure
|
|
14580
14748
|
*/
|
|
14581
|
-
unpublishIntegration: (integrationName: string, params?: RequestParams) => Promise<HttpResponse<void,
|
|
14749
|
+
unpublishIntegration: (integrationName: string, params?: RequestParams) => Promise<HttpResponse<void, {
|
|
14750
|
+
error: {
|
|
14751
|
+
/** @format int32 */
|
|
14752
|
+
code: 403;
|
|
14753
|
+
message: string;
|
|
14754
|
+
};
|
|
14755
|
+
}>>;
|
|
14582
14756
|
/**
|
|
14583
14757
|
* No description
|
|
14584
14758
|
*
|
|
@@ -14649,7 +14823,9 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
14649
14823
|
* @secure
|
|
14650
14824
|
*/
|
|
14651
14825
|
getIntegrationEvent: (integrationName: string, eventId: string, params?: RequestParams) => Promise<HttpResponse<{
|
|
14826
|
+
/** Diagnostic metadata for a delivered event, including historical records. The payload is intentionally limited to event type and identifiers; it is not the full runtime event. Events and configuration delivered to the integration runtime are unaffected. */
|
|
14652
14827
|
event: IntegrationEvent;
|
|
14828
|
+
/** Safe execution metadata. Worker log and exception text are suppressed. */
|
|
14653
14829
|
trace?: IntegrationEventTrace;
|
|
14654
14830
|
}, {
|
|
14655
14831
|
error: {
|
|
@@ -14715,7 +14891,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
14715
14891
|
items: IntegrationSiteInstallation[];
|
|
14716
14892
|
}, any>>;
|
|
14717
14893
|
/**
|
|
14718
|
-
*
|
|
14894
|
+
* @description Enables a development tunnel. GitBook-owned production integrations cannot enable development mode; previously configured tunnels are ignored when dispatching their events.
|
|
14719
14895
|
*
|
|
14720
14896
|
* @tags integrations
|
|
14721
14897
|
* @name SetIntegrationDevelopmentMode
|
|
@@ -14736,6 +14912,12 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
14736
14912
|
*/
|
|
14737
14913
|
all?: boolean;
|
|
14738
14914
|
}, params?: RequestParams) => Promise<HttpResponse<void, {
|
|
14915
|
+
error: {
|
|
14916
|
+
/** @format int32 */
|
|
14917
|
+
code: 403;
|
|
14918
|
+
message: string;
|
|
14919
|
+
};
|
|
14920
|
+
} | {
|
|
14739
14921
|
error: {
|
|
14740
14922
|
/** @format int32 */
|
|
14741
14923
|
code: 404;
|
|
@@ -14801,7 +14983,7 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
14801
14983
|
};
|
|
14802
14984
|
}>>;
|
|
14803
14985
|
/**
|
|
14804
|
-
* @description Returns the organization-level installation of an integration, including its account configuration and how many spaces it manages.
|
|
14986
|
+
* @description Returns the organization-level installation of an integration, including its account configuration and how many spaces it manages. For user authentication, saved OAuth credentials are replaced with a boolean connection indicator.
|
|
14805
14987
|
*
|
|
14806
14988
|
* @tags integrations
|
|
14807
14989
|
* @name GetIntegrationInstallationById
|
|
@@ -14852,6 +15034,84 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
14852
15034
|
message: string;
|
|
14853
15035
|
};
|
|
14854
15036
|
}>>;
|
|
15037
|
+
/**
|
|
15038
|
+
* @description Creates a short-lived, single-use transaction binding an OAuth authorization flow to the authenticated user, the installation and an optional space or site installation. Open the returned `startURL` in the browser that will complete the flow.
|
|
15039
|
+
*
|
|
15040
|
+
* @tags integrations
|
|
15041
|
+
* @name CreateIntegrationOAuthTransaction
|
|
15042
|
+
* @summary Start an OAuth connection for an integration installation
|
|
15043
|
+
* @request POST:/integrations/{integrationName}/installations/{installationId}/oauth-transactions
|
|
15044
|
+
* @secure
|
|
15045
|
+
*/
|
|
15046
|
+
createIntegrationOAuthTransaction: (integrationName: string, installationId: string, data?: CreateIntegrationOAuthTransaction, params?: RequestParams) => Promise<HttpResponse<IntegrationOAuthTransactionStart, {
|
|
15047
|
+
error: {
|
|
15048
|
+
/** @format int32 */
|
|
15049
|
+
code: 400;
|
|
15050
|
+
message: string;
|
|
15051
|
+
};
|
|
15052
|
+
} | {
|
|
15053
|
+
error: {
|
|
15054
|
+
/** @format int32 */
|
|
15055
|
+
code: 403;
|
|
15056
|
+
message: string;
|
|
15057
|
+
};
|
|
15058
|
+
} | {
|
|
15059
|
+
error: {
|
|
15060
|
+
/** @format int32 */
|
|
15061
|
+
code: 404;
|
|
15062
|
+
message: string;
|
|
15063
|
+
};
|
|
15064
|
+
}>>;
|
|
15065
|
+
/**
|
|
15066
|
+
* @description Consumes the OAuth transaction whose ID was received as the `state` of an OAuth callback. A transaction can be consumed once, by the integration that it was created for, and only with the authorization code that the user who started the connection confirmed in GitBook. Returns the installation the credentials must be written to, the PKCE code verifier, and a single-use grant to pass as `oauthTransaction` when writing the credentials.
|
|
15067
|
+
*
|
|
15068
|
+
* @tags integrations
|
|
15069
|
+
* @name ConsumeIntegrationOAuthTransaction
|
|
15070
|
+
* @summary Consume an integration OAuth transaction
|
|
15071
|
+
* @request POST:/integrations/{integrationName}/oauth-transactions/{transactionId}/consume
|
|
15072
|
+
* @secure
|
|
15073
|
+
*/
|
|
15074
|
+
consumeIntegrationOAuthTransaction: (integrationName: string, transactionId: string, data: ConsumeIntegrationOAuthTransaction, params?: RequestParams) => Promise<HttpResponse<IntegrationOAuthTransaction, {
|
|
15075
|
+
error: {
|
|
15076
|
+
/** @format int32 */
|
|
15077
|
+
code: 403;
|
|
15078
|
+
message: string;
|
|
15079
|
+
};
|
|
15080
|
+
} | {
|
|
15081
|
+
error: {
|
|
15082
|
+
/** @format int32 */
|
|
15083
|
+
code: 404;
|
|
15084
|
+
message: string;
|
|
15085
|
+
};
|
|
15086
|
+
}>>;
|
|
15087
|
+
/**
|
|
15088
|
+
* @description Confirms, as the user who created the transaction, the provider callback GitBook intercepted for it. Returns the callback URL to send the browser back to.
|
|
15089
|
+
*
|
|
15090
|
+
* @tags integrations
|
|
15091
|
+
* @name ConfirmIntegrationOAuthTransaction
|
|
15092
|
+
* @summary Confirm the callback of an integration OAuth transaction
|
|
15093
|
+
* @request POST:/integrations/{integrationName}/oauth-transactions/{transactionId}/confirm
|
|
15094
|
+
* @secure
|
|
15095
|
+
*/
|
|
15096
|
+
confirmIntegrationOAuthTransaction: (integrationName: string, transactionId: string, data: ConfirmIntegrationOAuthTransaction, params?: RequestParams) => Promise<HttpResponse<IntegrationOAuthTransactionConfirmation, {
|
|
15097
|
+
error: {
|
|
15098
|
+
/** @format int32 */
|
|
15099
|
+
code: 403;
|
|
15100
|
+
message: string;
|
|
15101
|
+
};
|
|
15102
|
+
} | {
|
|
15103
|
+
error: {
|
|
15104
|
+
/** @format int32 */
|
|
15105
|
+
code: 404;
|
|
15106
|
+
message: string;
|
|
15107
|
+
};
|
|
15108
|
+
} | {
|
|
15109
|
+
error: {
|
|
15110
|
+
/** @format int32 */
|
|
15111
|
+
code: 409;
|
|
15112
|
+
message: string;
|
|
15113
|
+
};
|
|
15114
|
+
}>>;
|
|
14855
15115
|
/**
|
|
14856
15116
|
* @description Returns a paginated list of the spaces an installation is enabled on, with the configuration of the integration for each of them. Pass extended to get the full space object instead of its ID.
|
|
14857
15117
|
*
|
|
@@ -15069,9 +15329,17 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
15069
15329
|
* @max 1000
|
|
15070
15330
|
*/
|
|
15071
15331
|
limit?: number;
|
|
15332
|
+
/** The property to sort the list by. With `lastSeenAt`, only the organizations the user has opened are returned, most recently opened first. It returns at most `limit` items with no next page, and cannot be combined with `page`, because the order changes every time the user opens an organization. */
|
|
15333
|
+
sort?: "lastSeenAt";
|
|
15072
15334
|
}, params?: RequestParams) => Promise<HttpResponse<List & {
|
|
15073
15335
|
items: Organization[];
|
|
15074
|
-
},
|
|
15336
|
+
}, {
|
|
15337
|
+
error: {
|
|
15338
|
+
/** @format int32 */
|
|
15339
|
+
code: 400;
|
|
15340
|
+
message: string;
|
|
15341
|
+
};
|
|
15342
|
+
}>>;
|
|
15075
15343
|
/**
|
|
15076
15344
|
* No description
|
|
15077
15345
|
*
|
|
@@ -18114,26 +18382,6 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
18114
18382
|
* @secure
|
|
18115
18383
|
*/
|
|
18116
18384
|
getSiteFindingById: (organizationId: EntityId, siteId: string, siteFindingId: string, params?: RequestParams) => Promise<HttpResponse<SiteFinding, any>>;
|
|
18117
|
-
/**
|
|
18118
|
-
* @description Changes the status of a documentation issue found by GitBook's AI. Refuses `broken-link` findings, whose status follows the redirects at their path. Deprecated in favour of `applySiteFindingAction`, which applies one of the `actions` a finding lists: `mark-resolved`, `ignore`, `reopen` or `restore`.
|
|
18119
|
-
*
|
|
18120
|
-
* @tags site-context
|
|
18121
|
-
* @name UpdateSiteFindingById
|
|
18122
|
-
* @summary Resolve, dismiss, or reopen a documentation issue. (Deprecated) use applySiteFindingAction instead.
|
|
18123
|
-
* @request PATCH:/orgs/{organizationId}/sites/{siteId}/findings/{siteFindingId}
|
|
18124
|
-
* @deprecated
|
|
18125
|
-
* @secure
|
|
18126
|
-
*/
|
|
18127
|
-
updateSiteFindingById: (organizationId: EntityId, siteId: string, siteFindingId: string, data: {
|
|
18128
|
-
/**
|
|
18129
|
-
* Status of a site finding.
|
|
18130
|
-
* - `candidate` is a finding that has been raised but not yet confirmed. Typically these are not shown to users.
|
|
18131
|
-
* - `open` is a finding that has been surfaced to users and is still under investigation.
|
|
18132
|
-
* - `done` is a finding that has been resolved and is no longer under investigation.
|
|
18133
|
-
* - `canceled` is a finding that has been canceled and is no longer under investigation.
|
|
18134
|
-
*/
|
|
18135
|
-
status: SiteFindingStatus;
|
|
18136
|
-
}, params?: RequestParams) => Promise<HttpResponse<SiteFinding, any>>;
|
|
18137
18385
|
/**
|
|
18138
18386
|
* @description Lists the change requests created to fix a documentation issue. Use this to check whether an issue already has a pending or merged fix before triggering a new one.
|
|
18139
18387
|
*
|
|
@@ -18413,6 +18661,8 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
18413
18661
|
channelType?: SiteChannelType[];
|
|
18414
18662
|
/** Filter by whether a person or an AI agent asked the question. */
|
|
18415
18663
|
visitorType?: SiteQuestionVisitorType[];
|
|
18664
|
+
/** Filter to answers that cited one of these pages as a source, each given as `{spaceId}/{pageId}`. */
|
|
18665
|
+
citedPage?: string[];
|
|
18416
18666
|
/** Filter stats by answer resolution. */
|
|
18417
18667
|
answered?: SiteQuestionAnswerResolution[];
|
|
18418
18668
|
}, params?: RequestParams) => Promise<HttpResponse<{
|
|
@@ -18472,6 +18722,10 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
18472
18722
|
channelType?: SiteChannelType[];
|
|
18473
18723
|
/** Filter by whether a person or an AI agent asked the question. */
|
|
18474
18724
|
visitorType?: SiteQuestionVisitorType[];
|
|
18725
|
+
/** Filter to answers that cited one of these pages as a source, each given as `{spaceId}/{pageId}`. */
|
|
18726
|
+
citedPage?: string[];
|
|
18727
|
+
/** Filter questions whose text contains this value. */
|
|
18728
|
+
search?: string;
|
|
18475
18729
|
/** Filter questions by answer resolution. */
|
|
18476
18730
|
answered?: SiteQuestionAnswerResolution[];
|
|
18477
18731
|
/** Filter questions by associated site topic IDs. */
|
|
@@ -18572,6 +18826,8 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
18572
18826
|
channelType?: SiteChannelType[];
|
|
18573
18827
|
/** Filter by whether a person or an AI agent asked the question. */
|
|
18574
18828
|
visitorType?: SiteQuestionVisitorType[];
|
|
18829
|
+
/** Filter to answers that cited one of these pages as a source, each given as `{spaceId}/{pageId}`. */
|
|
18830
|
+
citedPage?: string[];
|
|
18575
18831
|
/** Filter stats by answer resolution. */
|
|
18576
18832
|
answered?: SiteQuestionAnswerResolution[];
|
|
18577
18833
|
}, params?: RequestParams) => Promise<HttpResponse<SiteQuestionStats, any>>;
|
|
@@ -18599,6 +18855,8 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
18599
18855
|
channelType?: SiteChannelType[];
|
|
18600
18856
|
/** Filter by whether a person or an AI agent asked the question. */
|
|
18601
18857
|
visitorType?: SiteQuestionVisitorType[];
|
|
18858
|
+
/** Filter to answers that cited one of these pages as a source, each given as `{spaceId}/{pageId}`. */
|
|
18859
|
+
citedPage?: string[];
|
|
18602
18860
|
/** Filter answers by resolution. */
|
|
18603
18861
|
answered?: SiteQuestionAnswerResolution[];
|
|
18604
18862
|
}, params?: RequestParams) => Promise<HttpResponse<SiteQuestionTimeline, any>>;
|
|
@@ -18789,8 +19047,8 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
|
|
|
18789
19047
|
warningColor?: CustomizationThemedColor | null;
|
|
18790
19048
|
/** Used for destructive actions or raising attention to critical information. Set to null to reset the override. */
|
|
18791
19049
|
dangerColor?: CustomizationThemedColor | null;
|
|
18792
|
-
/** The tint will color the site’s UI beyond links and buttons, such as header, sidebar and background. By default, the tint colour is the same as your Primary colour, but you can set a custom one too. */
|
|
18793
|
-
tint?: CustomizationTint | null;
|
|
19050
|
+
/** The tint will color the site’s UI beyond links and buttons, such as header, sidebar and background. By default, the tint colour is the same as your Primary colour, but you can set a custom one too. Set to false to remove the tint from this site space, or to null to reset the override. */
|
|
19051
|
+
tint?: CustomizationTint | false | null;
|
|
18794
19052
|
/** The style of the corners to use. Set to null to reset the override. */
|
|
18795
19053
|
corners?: CustomizationCorners | null;
|
|
18796
19054
|
/** The depth of elements on the site. Set to null to reset the override. */
|