@gitbook/api 0.82.0 → 0.84.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/spec/openapi.yaml CHANGED
@@ -760,7 +760,7 @@ paths:
760
760
  "/spaces/{spaceId}/permissions":
761
761
  post:
762
762
  operationId: inviteToSpace
763
- summary: Invite to a space (only teams supported for now)
763
+ summary: Invite to a space
764
764
  tags:
765
765
  - spaces
766
766
  security:
@@ -771,7 +771,7 @@ paths:
771
771
  "204":
772
772
  description: OK
773
773
  "404":
774
- description: No team with the provided Id
774
+ description: No team or user with the provided Id
775
775
  $ref: "#/components/responses/NotFoundError"
776
776
  default:
777
777
  $ref: "#/components/responses/UnexpectedError"
@@ -780,7 +780,7 @@ paths:
780
780
  content:
781
781
  application/json:
782
782
  schema:
783
- $ref: "#/components/schemas/InviteEmailsUsersTeamsToSpace"
783
+ $ref: "#/components/schemas/InviteUsersAndTeams"
784
784
  "/spaces/{spaceId}/permissions/teams/{teamId}":
785
785
  delete:
786
786
  operationId: removeTeamFromSpace
@@ -3246,6 +3246,30 @@ paths:
3246
3246
  $ref: "#/components/responses/PreconditionFailedError"
3247
3247
  default:
3248
3248
  $ref: "#/components/responses/UnexpectedError"
3249
+ "/collections/{collectionId}/permissions":
3250
+ post:
3251
+ operationId: inviteToCollection
3252
+ summary: Invite to a collection
3253
+ tags:
3254
+ - collections
3255
+ security:
3256
+ - user: []
3257
+ parameters:
3258
+ - $ref: "#/components/parameters/collectionId"
3259
+ responses:
3260
+ "204":
3261
+ description: OK
3262
+ "404":
3263
+ description: No team or user with the provided Id
3264
+ $ref: "#/components/responses/NotFoundError"
3265
+ default:
3266
+ $ref: "#/components/responses/UnexpectedError"
3267
+ requestBody:
3268
+ required: true
3269
+ content:
3270
+ application/json:
3271
+ schema:
3272
+ $ref: "#/components/schemas/InviteUsersAndTeams"
3249
3273
  "/collections/{collectionId}/permissions/aggregate":
3250
3274
  get:
3251
3275
  operationId: listPermissionsAggregateInCollection
@@ -4367,8 +4391,16 @@ paths:
4367
4391
  parameters:
4368
4392
  - $ref: "#/components/parameters/organizationId"
4369
4393
  responses:
4370
- "204":
4371
- description: Organization member has been updated.
4394
+ "200":
4395
+ description: Organization member has been updated. Optionally returns a JWT token to attach to the user.
4396
+ content:
4397
+ application/json:
4398
+ schema:
4399
+ type: object
4400
+ properties:
4401
+ gitbookVisitorClaims:
4402
+ description: A JTW token containing the claims to attach to this user.
4403
+ type: string
4372
4404
  default:
4373
4405
  $ref: "#/components/responses/UnexpectedError"
4374
4406
  "/orgs/{organizationId}/members/{userId}/sso":
@@ -6583,6 +6615,16 @@ paths:
6583
6615
  defaultSiteSection:
6584
6616
  type: string
6585
6617
  description: ID of the site-section to be used as the default.
6618
+ proxy:
6619
+ description: |
6620
+ Configure a proxy URL for a site. For example, you can use it to host the site on a subdirectory of your domain like `https://company.com/docs`.
6621
+ Use `null` to remove the proxy.
6622
+ oneOf:
6623
+ - $ref: "#/components/schemas/SiteProxy"
6624
+ - type: string
6625
+ nullable: true
6626
+ enum:
6627
+ - null
6586
6628
  responses:
6587
6629
  "200":
6588
6630
  description: OK
@@ -8082,6 +8124,7 @@ paths:
8082
8124
  operationId: trackViewInSiteById
8083
8125
  summary: Track a page view in a site
8084
8126
  description: Track a page view in a site.
8127
+ deprecated: true
8085
8128
  tags:
8086
8129
  - analytics
8087
8130
  - sites
@@ -8099,6 +8142,34 @@ paths:
8099
8142
  application/json:
8100
8143
  schema:
8101
8144
  $ref: "#/components/schemas/SiteTrackPageView"
8145
+ "/orgs/{organizationId}/sites/{siteId}/insights/events":
8146
+ post:
8147
+ operationId: trackEventsInSiteById
8148
+ summary: Track events in a site.
8149
+ description: Track events in a site.
8150
+ tags:
8151
+ - sites
8152
+ parameters:
8153
+ - $ref: "#/components/parameters/organizationId"
8154
+ - $ref: "#/components/parameters/siteId"
8155
+ responses:
8156
+ "204":
8157
+ description: Events have been tracked.
8158
+ default:
8159
+ $ref: "#/components/responses/UnexpectedError"
8160
+ requestBody:
8161
+ required: true
8162
+ content:
8163
+ application/json:
8164
+ schema:
8165
+ type: object
8166
+ properties:
8167
+ events:
8168
+ type: array
8169
+ items:
8170
+ $ref: "#/components/schemas/SiteInsightsEvent"
8171
+ required:
8172
+ - events
8102
8173
  "/orgs/{organizationId}/sites/{siteId}/insights/ads":
8103
8174
  get:
8104
8175
  operationId: getAdsInsightsForSiteById
@@ -8721,6 +8792,13 @@ paths:
8721
8792
  description: JWT token generated for a visitor auth session
8722
8793
  schema:
8723
8794
  type: string
8795
+ - name: redirectOnError
8796
+ in: query
8797
+ required: false
8798
+ description: When true redirects the user to the authentication/fallback URL if the visitor auth token is invalid
8799
+ schema:
8800
+ type: boolean
8801
+ default: false
8724
8802
  responses:
8725
8803
  "200":
8726
8804
  description: OK
@@ -12218,19 +12296,34 @@ components:
12218
12296
  - visitor
12219
12297
  - url
12220
12298
  - referrer
12221
- InviteEmailsUsersTeamsToSpace:
12299
+ InviteUsersAndTeams:
12222
12300
  type: object
12223
12301
  properties:
12224
- teams:
12225
- type: array
12226
- items:
12227
- type: string
12228
- description: The ID of the team to be invited
12229
12302
  role:
12230
- description: Role to set on the team.
12303
+ description: Role to set.
12231
12304
  $ref: "#/components/schemas/MemberRoleOrGuest"
12305
+ anyOf:
12306
+ - type: object
12307
+ properties:
12308
+ teams:
12309
+ type: array
12310
+ minItems: 1
12311
+ items:
12312
+ type: string
12313
+ description: The ID of the team to be invited
12314
+ required:
12315
+ - teams
12316
+ - type: object
12317
+ properties:
12318
+ users:
12319
+ type: array
12320
+ minItems: 1
12321
+ items:
12322
+ type: string
12323
+ description: The ID of the user to be invited
12324
+ required:
12325
+ - users
12232
12326
  required:
12233
- - teams
12234
12327
  - role
12235
12328
  RevisionPageGroup:
12236
12329
  allOf:
@@ -15475,7 +15568,6 @@ components:
15475
15568
  - visitor
15476
15569
  - url
15477
15570
  - referrer
15478
- - spaceId
15479
15571
  SpaceContentUpdatedEvent:
15480
15572
  allOf:
15481
15573
  - $ref: "#/components/schemas/SpaceEvent"
@@ -16822,11 +16914,17 @@ components:
16822
16914
  type: string
16823
16915
  description: Custom hostname for the site, for e.g. docs.mycompany.com
16824
16916
  pattern: ^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?[.]){2,}[a-z0-9][a-z0-9-]{0,61}[a-z0-9]$
16917
+ maxLength: 512
16825
16918
  SiteBasename:
16826
16919
  type: string
16827
16920
  description: Basename for the site. For e.g. api
16828
16921
  minLength: 1
16829
16922
  maxLength: 100
16923
+ SiteProxy:
16924
+ type: string
16925
+ description: Proxy URL for the site, for e.g. company.com/docs or www.company.com/developer/docs etc.
16926
+ pattern: ^([\w-]+\.)*[\w-]+\.[a-zA-Z]{2,}(\/[\w-]+)+$
16927
+ maxLength: 512
16830
16928
  SiteVisibility:
16831
16929
  type: string
16832
16930
  description: |
@@ -16922,6 +17020,8 @@ components:
16922
17020
  $ref: "#/components/schemas/SiteHostname"
16923
17021
  basename:
16924
17022
  $ref: "#/components/schemas/SiteBasename"
17023
+ proxy:
17024
+ $ref: "#/components/schemas/SiteProxy"
16925
17025
  visibility:
16926
17026
  $ref: "#/components/schemas/SiteVisibility"
16927
17027
  published:
@@ -18672,6 +18772,211 @@ components:
18672
18772
  type: string
18673
18773
  required:
18674
18774
  - siteSpaceId
18775
+ SiteInsightsEventSession:
18776
+ type: object
18777
+ description: Analytics info on the GitBook's site session.
18778
+ properties:
18779
+ visitorId:
18780
+ type: string
18781
+ description: GitBook's unique identifier of the visitor.
18782
+ sessionId:
18783
+ type: string
18784
+ description: GitBook's unique identifier of the visitor's session.
18785
+ cookies:
18786
+ type: object
18787
+ description: The visitors cookies.
18788
+ additionalProperties:
18789
+ type: string
18790
+ ip:
18791
+ type: string
18792
+ description: |
18793
+ IP address of the visitor.
18794
+ If not defined, it'll default to the IP executing the request.
18795
+ userAgent:
18796
+ type: string
18797
+ description: |
18798
+ User-agent of the visitor.
18799
+ https://developer.mozilla.org/en-US/docs/Web/API/Navigator/userAgent
18800
+ language:
18801
+ type: string
18802
+ nullable: true
18803
+ description: |
18804
+ Language of the visitor.
18805
+ https://developer.mozilla.org/en-US/docs/Web/API/Navigator/language
18806
+ referrer:
18807
+ description: Referrer of the sesion
18808
+ oneOf:
18809
+ - type: string
18810
+ nullable: true
18811
+ enum:
18812
+ - null
18813
+ - $ref: "#/components/schemas/URL"
18814
+ required:
18815
+ - visitorId
18816
+ - sessionId
18817
+ - cookies
18818
+ - userAgent
18819
+ - language
18820
+ - referrer
18821
+ SiteInsightsEventLocation:
18822
+ type: object
18823
+ description: Location of the event.
18824
+ properties:
18825
+ url:
18826
+ description: URL of the location.
18827
+ $ref: "#/components/schemas/URL"
18828
+ siteSection:
18829
+ type: string
18830
+ description: ID of the concerned site section.
18831
+ nullable: true
18832
+ siteSpace:
18833
+ type: string
18834
+ description: ID of the concerned site space.
18835
+ nullable: true
18836
+ siteShareKey:
18837
+ type: string
18838
+ description: ID of the concerned site share key.
18839
+ nullable: true
18840
+ space:
18841
+ type: string
18842
+ description: ID of the concerned space.
18843
+ nullable: true
18844
+ revision:
18845
+ type: string
18846
+ description: ID of the concerned revision.
18847
+ nullable: true
18848
+ page:
18849
+ type: string
18850
+ description: ID of the concerned page.
18851
+ nullable: true
18852
+ required:
18853
+ - url
18854
+ - siteSection
18855
+ - siteSpace
18856
+ - siteShareKey
18857
+ - page
18858
+ - space
18859
+ - revision
18860
+ SiteInsightsEventBase:
18861
+ type: object
18862
+ properties:
18863
+ session:
18864
+ $ref: "#/components/schemas/SiteInsightsEventSession"
18865
+ location:
18866
+ $ref: "#/components/schemas/SiteInsightsEventLocation"
18867
+ timestamp:
18868
+ description: Optional timestamp of the event. If not provided, the current timestamp will be used.
18869
+ $ref: "#/components/schemas/Timestamp"
18870
+ required:
18871
+ - session
18872
+ - location
18873
+ SiteInsightsEventPageView:
18874
+ allOf:
18875
+ - $ref: "#/components/schemas/SiteInsightsEventBase"
18876
+ - type: object
18877
+ properties:
18878
+ type:
18879
+ type: string
18880
+ enum:
18881
+ - page_view
18882
+ required:
18883
+ - type
18884
+ SiteInsightsEventSearchOpen:
18885
+ allOf:
18886
+ - $ref: "#/components/schemas/SiteInsightsEventBase"
18887
+ - type: object
18888
+ properties:
18889
+ type:
18890
+ type: string
18891
+ enum:
18892
+ - search_open
18893
+ required:
18894
+ - type
18895
+ SiteInsightsEventSearchTypeQuery:
18896
+ allOf:
18897
+ - $ref: "#/components/schemas/SiteInsightsEventBase"
18898
+ - type: object
18899
+ properties:
18900
+ type:
18901
+ type: string
18902
+ enum:
18903
+ - search_type_query
18904
+ query:
18905
+ type: string
18906
+ description: Query of the search.
18907
+ required:
18908
+ - type
18909
+ - query
18910
+ SiteInsightsEventSearchOpenResult:
18911
+ allOf:
18912
+ - $ref: "#/components/schemas/SiteInsightsEventBase"
18913
+ - type: object
18914
+ properties:
18915
+ type:
18916
+ type: string
18917
+ enum:
18918
+ - search_open_result
18919
+ query:
18920
+ type: string
18921
+ description: Query of the search.
18922
+ result:
18923
+ type: object
18924
+ properties:
18925
+ spaceId:
18926
+ type: string
18927
+ description: ID of the concerned space.
18928
+ pageId:
18929
+ type: string
18930
+ description: ID of the concerned page.
18931
+ required:
18932
+ - spaceId
18933
+ - pageId
18934
+ required:
18935
+ - type
18936
+ - query
18937
+ - result
18938
+ SiteInsightsEventPagePostFeedback:
18939
+ allOf:
18940
+ - $ref: "#/components/schemas/SiteInsightsEventBase"
18941
+ - type: object
18942
+ properties:
18943
+ type:
18944
+ type: string
18945
+ enum:
18946
+ - page_post_feedback
18947
+ feedback:
18948
+ type: object
18949
+ properties:
18950
+ rating:
18951
+ $ref: "#/components/schemas/PageFeedbackRating"
18952
+ required:
18953
+ - rating
18954
+ required:
18955
+ - type
18956
+ - feedback
18957
+ SiteInsightsEventAskQuestion:
18958
+ allOf:
18959
+ - $ref: "#/components/schemas/SiteInsightsEventBase"
18960
+ - type: object
18961
+ properties:
18962
+ type:
18963
+ type: string
18964
+ enum:
18965
+ - ask_question
18966
+ query:
18967
+ type: string
18968
+ description: Question being asked.
18969
+ required:
18970
+ - type
18971
+ - query
18972
+ SiteInsightsEvent:
18973
+ oneOf:
18974
+ - $ref: "#/components/schemas/SiteInsightsEventPageView"
18975
+ - $ref: "#/components/schemas/SiteInsightsEventSearchOpen"
18976
+ - $ref: "#/components/schemas/SiteInsightsEventSearchTypeQuery"
18977
+ - $ref: "#/components/schemas/SiteInsightsEventSearchOpenResult"
18978
+ - $ref: "#/components/schemas/SiteInsightsEventPagePostFeedback"
18979
+ - $ref: "#/components/schemas/SiteInsightsEventAskQuestion"
18675
18980
  InsightsInterval:
18676
18981
  type: string
18677
18982
  description: The interval for grouping the results