@gitbook/api 0.24.0 → 0.26.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
@@ -280,12 +280,12 @@ components:
280
280
  Color:
281
281
  type: string
282
282
  pattern: ^#(?:[0-9a-fA-F]{3}){1,2}$
283
- Date:
283
+ Timestamp:
284
284
  type: string
285
- format: date
285
+ format: date-time
286
286
  Emoji:
287
287
  type: string
288
- maxLength: 20
288
+ maxLength: 50
289
289
  description: Unicode codepoint or character of the emoji
290
290
  example: 🎉
291
291
  EmojiReaction:
@@ -307,7 +307,7 @@ components:
307
307
  user:
308
308
  $ref: "#/components/schemas/User"
309
309
  reactedAt:
310
- $ref: "#/components/schemas/Date"
310
+ $ref: "#/components/schemas/Timestamp"
311
311
  required:
312
312
  - user
313
313
  - reactedAt
@@ -337,9 +337,21 @@ components:
337
337
  description: The visitors cookies.
338
338
  additionalProperties:
339
339
  type: string
340
+ ip:
341
+ type: string
342
+ description: |
343
+ IP address of the visitor.
344
+ If undefined, it'll default to the IP executing the request.
340
345
  userAgent:
341
346
  type: string
342
- description: User-agent of the visitor.
347
+ description: |
348
+ User-agent of the visitor.
349
+ https://developer.mozilla.org/en-US/docs/Web/API/Navigator/userAgent
350
+ language:
351
+ type: string
352
+ description: |
353
+ Language of the visitor.
354
+ https://developer.mozilla.org/en-US/docs/Web/API/Navigator/language
343
355
  required:
344
356
  - anonymousId
345
357
  - cookies
@@ -351,7 +363,6 @@ components:
351
363
  type: string
352
364
  description: The URL of referrer that linked to the page.
353
365
  required:
354
- - pageId
355
366
  - visitor
356
367
  - url
357
368
  - referrer
@@ -489,6 +500,10 @@ components:
489
500
  repoProjectDirectory:
490
501
  type: string
491
502
  description: Path to a root directory for the project in the repository.
503
+ timestamp:
504
+ description: |
505
+ The timestamp of the event that triggered this import. It ensures that Git sync import and export operations are executed in the same order on GitBook and on the remote repository.
506
+ $ref: "#/components/schemas/Timestamp"
492
507
  force:
493
508
  type: boolean
494
509
  standalone:
@@ -524,6 +539,10 @@ components:
524
539
  repoProjectDirectory:
525
540
  type: string
526
541
  description: Path to a root directory for the project in the repository.
542
+ timestamp:
543
+ description: |
544
+ The timestamp of the event that triggered this export. It ensures that Git sync import and export operations are executed in the same order on GitBook and on the remote repository.
545
+ $ref: "#/components/schemas/Timestamp"
527
546
  force:
528
547
  type: boolean
529
548
  gitInfo:
@@ -709,7 +728,7 @@ components:
709
728
  type: string
710
729
  description: The API token name.
711
730
  createdAt:
712
- $ref: "#/components/schemas/Date"
731
+ $ref: "#/components/schemas/Timestamp"
713
732
  description: The API token creation date.
714
733
  required:
715
734
  - id
@@ -762,7 +781,7 @@ components:
762
781
  description: Contributor towards content.
763
782
  properties:
764
783
  updatedAt:
765
- $ref: "#/components/schemas/Date"
784
+ $ref: "#/components/schemas/Timestamp"
766
785
  count:
767
786
  type: integer
768
787
  user:
@@ -859,10 +878,10 @@ components:
859
878
  $ref: "#/components/schemas/User"
860
879
  postedAt:
861
880
  description: When the comment was posted.
862
- $ref: "#/components/schemas/Date"
881
+ $ref: "#/components/schemas/Timestamp"
863
882
  editedAt:
864
883
  description: Date when the comment was edited, if it has been edited.
865
- $ref: "#/components/schemas/Date"
884
+ $ref: "#/components/schemas/Timestamp"
866
885
  reactions:
867
886
  description: Any emoji reactions to the comment.
868
887
  $ref: "#/components/schemas/EmojiReactions"
@@ -946,7 +965,7 @@ components:
946
965
  - resolved
947
966
  resolvedAt:
948
967
  description: If the comment has been resolved, the date at which it was resolved. If this field is not defined, the comment is not resolved.
949
- $ref: "#/components/schemas/Date"
968
+ $ref: "#/components/schemas/Timestamp"
950
969
  resolvedBy:
951
970
  description: If the comment has been resolved, the user who resolved it. If this field is not defined, the comment is not resolved.
952
971
  $ref: "#/components/schemas/User"
@@ -977,10 +996,10 @@ components:
977
996
  postedBy:
978
997
  $ref: "#/components/schemas/User"
979
998
  postedAt:
980
- $ref: "#/components/schemas/Date"
999
+ $ref: "#/components/schemas/Timestamp"
981
1000
  editedAt:
982
1001
  description: Date when the reply was edited, if it has been edited.
983
- $ref: "#/components/schemas/Date"
1002
+ $ref: "#/components/schemas/Timestamp"
984
1003
  reactions:
985
1004
  $ref: "#/components/schemas/EmojiReactions"
986
1005
  body:
@@ -2691,6 +2710,7 @@ components:
2691
2710
  - $ref: "#/components/schemas/ContentRefUser"
2692
2711
  - $ref: "#/components/schemas/ContentRefCollection"
2693
2712
  - $ref: "#/components/schemas/ContentRefSpace"
2713
+ - $ref: "#/components/schemas/ContentRefSnippet"
2694
2714
  ContentRefURL:
2695
2715
  type: object
2696
2716
  properties:
@@ -2784,6 +2804,21 @@ components:
2784
2804
  required:
2785
2805
  - kind
2786
2806
  - space
2807
+ ContentRefSnippet:
2808
+ type: object
2809
+ properties:
2810
+ kind:
2811
+ type: string
2812
+ enum:
2813
+ - snippet
2814
+ snippet:
2815
+ type: string
2816
+ organization:
2817
+ type: string
2818
+ required:
2819
+ - kind
2820
+ - snippet
2821
+ - organization
2787
2822
  Space:
2788
2823
  type: object
2789
2824
  properties:
@@ -2796,18 +2831,20 @@ components:
2796
2831
  type: string
2797
2832
  description: Unique identifier for the space
2798
2833
  title:
2799
- type: string
2800
- description: Title of the space
2801
- minLength: 0
2802
- maxLength: 100
2834
+ $ref: "#/components/schemas/SpaceTitle"
2835
+ emoji:
2836
+ description: An emoji for this space. It'll match the emoji shown in the GitBook app.
2837
+ $ref: "#/components/schemas/Emoji"
2803
2838
  visibility:
2804
2839
  $ref: "#/components/schemas/ContentVisibility"
2805
2840
  createdAt:
2806
- $ref: "#/components/schemas/Date"
2841
+ $ref: "#/components/schemas/Timestamp"
2807
2842
  updatedAt:
2808
- $ref: "#/components/schemas/Date"
2843
+ $ref: "#/components/schemas/Timestamp"
2809
2844
  deletedAt:
2810
- $ref: "#/components/schemas/Date"
2845
+ $ref: "#/components/schemas/Timestamp"
2846
+ editMode:
2847
+ $ref: "#/components/schemas/SpaceEditMode"
2811
2848
  urls:
2812
2849
  type: object
2813
2850
  description: URLs associated with the object
@@ -2828,6 +2865,10 @@ components:
2828
2865
  type: string
2829
2866
  description: URL of the public version of the space. Only defined when visibility is "public".
2830
2867
  format: uri
2868
+ icon:
2869
+ deprecated: true
2870
+ description: URL of the icon of this space, if defined. Deprecated, prefer using emojis for spaces instead of icons.
2871
+ $ref: "#/components/schemas/URL"
2831
2872
  required:
2832
2873
  - app
2833
2874
  - location
@@ -2844,11 +2885,26 @@ components:
2844
2885
  - id
2845
2886
  - type
2846
2887
  - title
2888
+ - emoji
2847
2889
  - organization
2848
2890
  - visibility
2849
2891
  - createdAt
2850
2892
  - updatedAt
2851
2893
  - urls
2894
+ SpaceEditMode:
2895
+ type: string
2896
+ description: |
2897
+ Determines how a Space can be edited.
2898
+ * `live`: Users can directly edit the space
2899
+ * `locked`: All edits are locked for this space.
2900
+ enum:
2901
+ - live
2902
+ - locked
2903
+ SpaceTitle:
2904
+ type: string
2905
+ description: Title of the space
2906
+ minLength: 1
2907
+ maxLength: 50
2852
2908
  RevisionBase:
2853
2909
  type: object
2854
2910
  properties:
@@ -2873,6 +2929,9 @@ components:
2873
2929
  type: array
2874
2930
  items:
2875
2931
  $ref: "#/components/schemas/RevisionFile"
2932
+ createdAt:
2933
+ description: When the revision was created.
2934
+ $ref: "#/components/schemas/Timestamp"
2876
2935
  git:
2877
2936
  description: Metadata about a potential associated git commit.
2878
2937
  $ref: "#/components/schemas/GitSyncCommit"
@@ -2900,6 +2959,7 @@ components:
2900
2959
  - pages
2901
2960
  - files
2902
2961
  - urls
2962
+ - createdAt
2903
2963
  RevisionTypeMerge:
2904
2964
  allOf:
2905
2965
  - $ref: "#/components/schemas/RevisionBase"
@@ -2976,12 +3036,15 @@ components:
2976
3036
  description: Title of the page
2977
3037
  type: string
2978
3038
  maxLength: 100
3039
+ emoji:
3040
+ description: Emoji of the page, if one has been set.
3041
+ $ref: "#/components/schemas/Emoji"
2979
3042
  createdAt:
2980
3043
  description: When the page was first created. Only present if page has been edited at least once.
2981
- $ref: "#/components/schemas/Date"
3044
+ $ref: "#/components/schemas/Timestamp"
2982
3045
  updatedAt:
2983
3046
  description: When the page was last edited. Only present if page has been edited at least once.
2984
- $ref: "#/components/schemas/Date"
3047
+ $ref: "#/components/schemas/Timestamp"
2985
3048
  required:
2986
3049
  - id
2987
3050
  - title
@@ -3506,23 +3569,22 @@ components:
3506
3569
  description: The URL to the repository tree, used when rendering public content.
3507
3570
  updatedAt:
3508
3571
  description: When the Git provider details were last updated
3509
- $ref: "#/components/schemas/Date"
3572
+ $ref: "#/components/schemas/Timestamp"
3510
3573
  GitSyncOperation:
3511
3574
  type: object
3512
3575
  properties:
3513
3576
  state:
3514
3577
  $ref: "#/components/schemas/GitSyncOperationState"
3515
3578
  startedAt:
3516
- $ref: "#/components/schemas/Date"
3579
+ $ref: "#/components/schemas/Timestamp"
3517
3580
  completedAt:
3518
3581
  description: Date when the operation was successful (when state is `success`)
3519
- $ref: "#/components/schemas/Date"
3582
+ $ref: "#/components/schemas/Timestamp"
3520
3583
  error:
3521
3584
  type: string
3522
3585
  description: Error details, defined if state is `failure`.
3523
3586
  required:
3524
3587
  - state
3525
- - startedAt
3526
3588
  GitSyncOperationState:
3527
3589
  type: string
3528
3590
  description: |
@@ -3724,10 +3786,10 @@ components:
3724
3786
  description: Whatever the membership of this user is disabled and prevent them from accessing content.
3725
3787
  joinedAt:
3726
3788
  description: Date at which the user joined the organization.
3727
- $ref: "#/components/schemas/Date"
3789
+ $ref: "#/components/schemas/Timestamp"
3728
3790
  lastSeenAt:
3729
3791
  description: Date at which the user was last seen active in the organization.
3730
- $ref: "#/components/schemas/Date"
3792
+ $ref: "#/components/schemas/Timestamp"
3731
3793
  sso:
3732
3794
  type: boolean
3733
3795
  description: Whether the user can login with SSO.
@@ -3766,7 +3828,7 @@ components:
3766
3828
  description: Count of spaces this team has access to.
3767
3829
  createdAt:
3768
3830
  description: Date at which the team was created.
3769
- $ref: "#/components/schemas/Date"
3831
+ $ref: "#/components/schemas/Timestamp"
3770
3832
  required:
3771
3833
  - object
3772
3834
  - id
@@ -4047,6 +4109,9 @@ components:
4047
4109
  id:
4048
4110
  type: string
4049
4111
  description: Unique identifier for the snippet
4112
+ organization:
4113
+ type: string
4114
+ description: ID of the organization owning this snippet
4050
4115
  createdAt:
4051
4116
  type: string
4052
4117
  format: date-time
@@ -4103,6 +4168,7 @@ components:
4103
4168
  - app
4104
4169
  required:
4105
4170
  - id
4171
+ - organization
4106
4172
  - source
4107
4173
  - createdAt
4108
4174
  - archived
@@ -4139,7 +4205,7 @@ components:
4139
4205
  $ref: "#/components/schemas/ContentAuditRelationStatus"
4140
4206
  createdAt:
4141
4207
  description: The date at which the relation was created
4142
- $ref: "#/components/schemas/Date"
4208
+ $ref: "#/components/schemas/Timestamp"
4143
4209
  required:
4144
4210
  - id
4145
4211
  - sources
@@ -4211,9 +4277,9 @@ components:
4211
4277
  createdBy:
4212
4278
  $ref: "#/components/schemas/User"
4213
4279
  createdAt:
4214
- $ref: "#/components/schemas/Date"
4280
+ $ref: "#/components/schemas/Timestamp"
4215
4281
  updatedAt:
4216
- $ref: "#/components/schemas/Date"
4282
+ $ref: "#/components/schemas/Timestamp"
4217
4283
  urls:
4218
4284
  type: object
4219
4285
  description: URLs associated with the object
@@ -4267,9 +4333,9 @@ components:
4267
4333
  comment:
4268
4334
  $ref: "#/components/schemas/Comment"
4269
4335
  createdAt:
4270
- $ref: "#/components/schemas/Date"
4336
+ $ref: "#/components/schemas/Timestamp"
4271
4337
  updatedAt:
4272
- $ref: "#/components/schemas/Date"
4338
+ $ref: "#/components/schemas/Timestamp"
4273
4339
  required:
4274
4340
  - object
4275
4341
  - id
@@ -4301,7 +4367,7 @@ components:
4301
4367
  description: The user who made the request.
4302
4368
  $ref: "#/components/schemas/User"
4303
4369
  createdAt:
4304
- $ref: "#/components/schemas/Date"
4370
+ $ref: "#/components/schemas/Timestamp"
4305
4371
  required:
4306
4372
  - object
4307
4373
  - revision
@@ -4948,6 +5014,7 @@ components:
4948
5014
  - space:script:inject
4949
5015
  - space:script:cookies
4950
5016
  - space:git:sync
5017
+ - space:visitor:auth
4951
5018
  IntegrationCategories:
4952
5019
  type: array
4953
5020
  description: Categories for which the integration is listed in the marketplace
@@ -5028,7 +5095,7 @@ components:
5028
5095
  type: string
5029
5096
  description: Unique ID of the integration installation.
5030
5097
  createdAt:
5031
- $ref: "#/components/schemas/Date"
5098
+ $ref: "#/components/schemas/Timestamp"
5032
5099
  payload:
5033
5100
  $ref: "#/components/schemas/Event"
5034
5101
  status:
@@ -5050,7 +5117,7 @@ components:
5050
5117
  description: The message of the log entry.
5051
5118
  type: string
5052
5119
  timestamp:
5053
- $ref: "#/components/schemas/Date"
5120
+ $ref: "#/components/schemas/Timestamp"
5054
5121
  level:
5055
5122
  description: The level of the log entry.
5056
5123
  type: string
@@ -5194,9 +5261,9 @@ components:
5194
5261
  configuration:
5195
5262
  $ref: "#/components/schemas/IntegrationInstallationConfiguration"
5196
5263
  createdAt:
5197
- $ref: "#/components/schemas/Date"
5264
+ $ref: "#/components/schemas/Timestamp"
5198
5265
  updatedAt:
5199
- $ref: "#/components/schemas/Date"
5266
+ $ref: "#/components/schemas/Timestamp"
5200
5267
  urls:
5201
5268
  type: object
5202
5269
  description: URLs associated with the object
@@ -5701,6 +5768,7 @@ components:
5701
5768
  - $ref: "#/components/schemas/SpaceVisibilityUpdatedEvent"
5702
5769
  - $ref: "#/components/schemas/FetchEvent"
5703
5770
  - $ref: "#/components/schemas/FetchPublishedScriptEvent"
5771
+ - $ref: "#/components/schemas/FetchVisitorAuthenticationEvent"
5704
5772
  - $ref: "#/components/schemas/UIRenderEvent"
5705
5773
  discriminator:
5706
5774
  propertyName: type
@@ -5842,6 +5910,9 @@ components:
5842
5910
  ip:
5843
5911
  type: string
5844
5912
  description: IP address of the visitor.
5913
+ language:
5914
+ type: string
5915
+ description: Language of the visitor.
5845
5916
  required:
5846
5917
  - anonymousId
5847
5918
  - cookies
@@ -5999,6 +6070,20 @@ components:
5999
6070
  - fetch_published_script
6000
6071
  required:
6001
6072
  - type
6073
+ FetchVisitorAuthenticationEvent:
6074
+ allOf:
6075
+ - $ref: "#/components/schemas/SpaceEvent"
6076
+ - type: object
6077
+ description: Common properties for all events related to visitor authentication from an installation
6078
+ properties:
6079
+ type:
6080
+ type: string
6081
+ enum:
6082
+ - fetch_visitor_authentication
6083
+ location:
6084
+ type: string
6085
+ required:
6086
+ - type
6002
6087
  UIRenderEvent:
6003
6088
  allOf:
6004
6089
  - oneOf:
@@ -6129,9 +6214,9 @@ components:
6129
6214
  amount:
6130
6215
  type: number
6131
6216
  periodStart:
6132
- $ref: "#/components/schemas/Date"
6217
+ $ref: "#/components/schemas/Timestamp"
6133
6218
  periodEnd:
6134
- $ref: "#/components/schemas/Date"
6219
+ $ref: "#/components/schemas/Timestamp"
6135
6220
  required:
6136
6221
  - amount
6137
6222
  - description
@@ -6331,7 +6416,7 @@ components:
6331
6416
  description: All the permissions of a user
6332
6417
  properties:
6333
6418
  updatedAt:
6334
- $ref: "#/components/schemas/Date"
6419
+ $ref: "#/components/schemas/Timestamp"
6335
6420
  searchKey:
6336
6421
  type: string
6337
6422
  organizations:
@@ -7919,9 +8004,9 @@ components:
7919
8004
  options:
7920
8005
  $ref: "#/components/schemas/CustomFieldOptions"
7921
8006
  createdAt:
7922
- $ref: "#/components/schemas/Date"
8007
+ $ref: "#/components/schemas/Timestamp"
7923
8008
  updatedAt:
7924
- $ref: "#/components/schemas/Date"
8009
+ $ref: "#/components/schemas/Timestamp"
7925
8010
  urls:
7926
8011
  type: object
7927
8012
  description: URLs associated with the object
@@ -8299,7 +8384,7 @@ components:
8299
8384
  rating:
8300
8385
  $ref: "#/components/schemas/PageFeedbackRating"
8301
8386
  createdAt:
8302
- $ref: "#/components/schemas/Date"
8387
+ $ref: "#/components/schemas/Timestamp"
8303
8388
  revision:
8304
8389
  type: string
8305
8390
  description: ID of the revision when the rating was created
@@ -8587,6 +8672,10 @@ paths:
8587
8672
  schema:
8588
8673
  type: object
8589
8674
  properties:
8675
+ editMode:
8676
+ $ref: "#/components/schemas/SpaceEditMode"
8677
+ title:
8678
+ $ref: "#/components/schemas/SpaceTitle"
8590
8679
  visibility:
8591
8680
  $ref: "#/components/schemas/ContentVisibility"
8592
8681
  responses:
@@ -10600,6 +10689,41 @@ paths:
10600
10689
  $ref: "#/components/schemas/PageFeedback"
10601
10690
  default:
10602
10691
  $ref: "#/components/responses/UnexpectedError"
10692
+ "/spaces/{spaceId}/pdf":
10693
+ get:
10694
+ operationId: getSpacePDF
10695
+ summary: Generate a URL to export the content of the space as a PDF.
10696
+ tags:
10697
+ - spaces
10698
+ security:
10699
+ - user: []
10700
+ parameters:
10701
+ - $ref: "#/components/parameters/spaceId"
10702
+ - in: query
10703
+ name: only
10704
+ description: Generate a PDF only for the provided page.
10705
+ schema:
10706
+ type: boolean
10707
+ - in: query
10708
+ name: page
10709
+ description: ID of a specific page to generate a PDF for.
10710
+ schema:
10711
+ type: string
10712
+ responses:
10713
+ "200":
10714
+ description: URL of the PDF
10715
+ content:
10716
+ application/json:
10717
+ schema:
10718
+ type: object
10719
+ properties:
10720
+ url:
10721
+ description: Temporary URL to print the content. The URL will work for 1h.
10722
+ $ref: "#/components/schemas/URL"
10723
+ required:
10724
+ - url
10725
+ default:
10726
+ $ref: "#/components/responses/UnexpectedError"
10603
10727
  "/collections/{collectionId}":
10604
10728
  get:
10605
10729
  operationId: getCollectionById
@@ -13301,6 +13425,11 @@ paths:
13301
13425
  description: If specified, only locations under the given pageId will be returned. You must specify a spaceId too. If pageId is not specified, GitBook will suggest pages at the top level.
13302
13426
  schema:
13303
13427
  type: string
13428
+ - name: search
13429
+ in: query
13430
+ description: If specified, only locations matching the search query will be returned.
13431
+ schema:
13432
+ type: string
13304
13433
  responses:
13305
13434
  "200":
13306
13435
  description: A paginated list of suggested snippet locations.