@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.json CHANGED
@@ -387,13 +387,13 @@
387
387
  "type": "string",
388
388
  "pattern": "^#(?:[0-9a-fA-F]{3}){1,2}$"
389
389
  },
390
- "Date": {
390
+ "Timestamp": {
391
391
  "type": "string",
392
- "format": "date"
392
+ "format": "date-time"
393
393
  },
394
394
  "Emoji": {
395
395
  "type": "string",
396
- "maxLength": 20,
396
+ "maxLength": 50,
397
397
  "description": "Unicode codepoint or character of the emoji",
398
398
  "example": "🎉"
399
399
  },
@@ -419,7 +419,7 @@
419
419
  "$ref": "#/components/schemas/User"
420
420
  },
421
421
  "reactedAt": {
422
- "$ref": "#/components/schemas/Date"
422
+ "$ref": "#/components/schemas/Timestamp"
423
423
  }
424
424
  },
425
425
  "required": [
@@ -463,9 +463,17 @@
463
463
  "type": "string"
464
464
  }
465
465
  },
466
+ "ip": {
467
+ "type": "string",
468
+ "description": "IP address of the visitor.\nIf undefined, it'll default to the IP executing the request.\n"
469
+ },
466
470
  "userAgent": {
467
471
  "type": "string",
468
- "description": "User-agent of the visitor."
472
+ "description": "User-agent of the visitor.\nhttps://developer.mozilla.org/en-US/docs/Web/API/Navigator/userAgent\n"
473
+ },
474
+ "language": {
475
+ "type": "string",
476
+ "description": "Language of the visitor.\nhttps://developer.mozilla.org/en-US/docs/Web/API/Navigator/language\n"
469
477
  }
470
478
  },
471
479
  "required": [
@@ -484,7 +492,6 @@
484
492
  }
485
493
  },
486
494
  "required": [
487
- "pageId",
488
495
  "visitor",
489
496
  "url",
490
497
  "referrer"
@@ -680,6 +687,10 @@
680
687
  "type": "string",
681
688
  "description": "Path to a root directory for the project in the repository."
682
689
  },
690
+ "timestamp": {
691
+ "description": "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.\n",
692
+ "$ref": "#/components/schemas/Timestamp"
693
+ },
683
694
  "force": {
684
695
  "type": "boolean"
685
696
  },
@@ -728,6 +739,10 @@
728
739
  "type": "string",
729
740
  "description": "Path to a root directory for the project in the repository."
730
741
  },
742
+ "timestamp": {
743
+ "description": "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.\n",
744
+ "$ref": "#/components/schemas/Timestamp"
745
+ },
731
746
  "force": {
732
747
  "type": "boolean"
733
748
  },
@@ -989,7 +1004,7 @@
989
1004
  "description": "The API token name."
990
1005
  },
991
1006
  "createdAt": {
992
- "$ref": "#/components/schemas/Date",
1007
+ "$ref": "#/components/schemas/Timestamp",
993
1008
  "description": "The API token creation date."
994
1009
  }
995
1010
  },
@@ -1056,7 +1071,7 @@
1056
1071
  "description": "Contributor towards content.",
1057
1072
  "properties": {
1058
1073
  "updatedAt": {
1059
- "$ref": "#/components/schemas/Date"
1074
+ "$ref": "#/components/schemas/Timestamp"
1060
1075
  },
1061
1076
  "count": {
1062
1077
  "type": "integer"
@@ -1203,11 +1218,11 @@
1203
1218
  },
1204
1219
  "postedAt": {
1205
1220
  "description": "When the comment was posted.",
1206
- "$ref": "#/components/schemas/Date"
1221
+ "$ref": "#/components/schemas/Timestamp"
1207
1222
  },
1208
1223
  "editedAt": {
1209
1224
  "description": "Date when the comment was edited, if it has been edited.",
1210
- "$ref": "#/components/schemas/Date"
1225
+ "$ref": "#/components/schemas/Timestamp"
1211
1226
  },
1212
1227
  "reactions": {
1213
1228
  "description": "Any emoji reactions to the comment.",
@@ -1328,7 +1343,7 @@
1328
1343
  },
1329
1344
  "resolvedAt": {
1330
1345
  "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.",
1331
- "$ref": "#/components/schemas/Date"
1346
+ "$ref": "#/components/schemas/Timestamp"
1332
1347
  },
1333
1348
  "resolvedBy": {
1334
1349
  "description": "If the comment has been resolved, the user who resolved it. If this field is not defined, the comment is not resolved.",
@@ -1378,11 +1393,11 @@
1378
1393
  "$ref": "#/components/schemas/User"
1379
1394
  },
1380
1395
  "postedAt": {
1381
- "$ref": "#/components/schemas/Date"
1396
+ "$ref": "#/components/schemas/Timestamp"
1382
1397
  },
1383
1398
  "editedAt": {
1384
1399
  "description": "Date when the reply was edited, if it has been edited.",
1385
- "$ref": "#/components/schemas/Date"
1400
+ "$ref": "#/components/schemas/Timestamp"
1386
1401
  },
1387
1402
  "reactions": {
1388
1403
  "$ref": "#/components/schemas/EmojiReactions"
@@ -4132,6 +4147,9 @@
4132
4147
  },
4133
4148
  {
4134
4149
  "$ref": "#/components/schemas/ContentRefSpace"
4150
+ },
4151
+ {
4152
+ "$ref": "#/components/schemas/ContentRefSnippet"
4135
4153
  }
4136
4154
  ]
4137
4155
  },
@@ -4273,6 +4291,28 @@
4273
4291
  "space"
4274
4292
  ]
4275
4293
  },
4294
+ "ContentRefSnippet": {
4295
+ "type": "object",
4296
+ "properties": {
4297
+ "kind": {
4298
+ "type": "string",
4299
+ "enum": [
4300
+ "snippet"
4301
+ ]
4302
+ },
4303
+ "snippet": {
4304
+ "type": "string"
4305
+ },
4306
+ "organization": {
4307
+ "type": "string"
4308
+ }
4309
+ },
4310
+ "required": [
4311
+ "kind",
4312
+ "snippet",
4313
+ "organization"
4314
+ ]
4315
+ },
4276
4316
  "Space": {
4277
4317
  "type": "object",
4278
4318
  "properties": {
@@ -4288,22 +4328,26 @@
4288
4328
  "description": "Unique identifier for the space"
4289
4329
  },
4290
4330
  "title": {
4291
- "type": "string",
4292
- "description": "Title of the space",
4293
- "minLength": 0,
4294
- "maxLength": 100
4331
+ "$ref": "#/components/schemas/SpaceTitle"
4332
+ },
4333
+ "emoji": {
4334
+ "description": "An emoji for this space. It'll match the emoji shown in the GitBook app.",
4335
+ "$ref": "#/components/schemas/Emoji"
4295
4336
  },
4296
4337
  "visibility": {
4297
4338
  "$ref": "#/components/schemas/ContentVisibility"
4298
4339
  },
4299
4340
  "createdAt": {
4300
- "$ref": "#/components/schemas/Date"
4341
+ "$ref": "#/components/schemas/Timestamp"
4301
4342
  },
4302
4343
  "updatedAt": {
4303
- "$ref": "#/components/schemas/Date"
4344
+ "$ref": "#/components/schemas/Timestamp"
4304
4345
  },
4305
4346
  "deletedAt": {
4306
- "$ref": "#/components/schemas/Date"
4347
+ "$ref": "#/components/schemas/Timestamp"
4348
+ },
4349
+ "editMode": {
4350
+ "$ref": "#/components/schemas/SpaceEditMode"
4307
4351
  },
4308
4352
  "urls": {
4309
4353
  "type": "object",
@@ -4328,6 +4372,11 @@
4328
4372
  "type": "string",
4329
4373
  "description": "URL of the public version of the space. Only defined when visibility is \"public\".",
4330
4374
  "format": "uri"
4375
+ },
4376
+ "icon": {
4377
+ "deprecated": true,
4378
+ "description": "URL of the icon of this space, if defined. Deprecated, prefer using emojis for spaces instead of icons.",
4379
+ "$ref": "#/components/schemas/URL"
4331
4380
  }
4332
4381
  },
4333
4382
  "required": [
@@ -4352,6 +4401,7 @@
4352
4401
  "id",
4353
4402
  "type",
4354
4403
  "title",
4404
+ "emoji",
4355
4405
  "organization",
4356
4406
  "visibility",
4357
4407
  "createdAt",
@@ -4359,6 +4409,20 @@
4359
4409
  "urls"
4360
4410
  ]
4361
4411
  },
4412
+ "SpaceEditMode": {
4413
+ "type": "string",
4414
+ "description": "Determines how a Space can be edited.\n* `live`: Users can directly edit the space\n* `locked`: All edits are locked for this space.\n",
4415
+ "enum": [
4416
+ "live",
4417
+ "locked"
4418
+ ]
4419
+ },
4420
+ "SpaceTitle": {
4421
+ "type": "string",
4422
+ "description": "Title of the space",
4423
+ "minLength": 1,
4424
+ "maxLength": 50
4425
+ },
4362
4426
  "RevisionBase": {
4363
4427
  "type": "object",
4364
4428
  "properties": {
@@ -4392,6 +4456,10 @@
4392
4456
  "$ref": "#/components/schemas/RevisionFile"
4393
4457
  }
4394
4458
  },
4459
+ "createdAt": {
4460
+ "description": "When the revision was created.",
4461
+ "$ref": "#/components/schemas/Timestamp"
4462
+ },
4395
4463
  "git": {
4396
4464
  "description": "Metadata about a potential associated git commit.",
4397
4465
  "$ref": "#/components/schemas/GitSyncCommit"
@@ -4426,7 +4494,8 @@
4426
4494
  "parents",
4427
4495
  "pages",
4428
4496
  "files",
4429
- "urls"
4497
+ "urls",
4498
+ "createdAt"
4430
4499
  ]
4431
4500
  },
4432
4501
  "RevisionTypeMerge": {
@@ -4568,13 +4637,17 @@
4568
4637
  "type": "string",
4569
4638
  "maxLength": 100
4570
4639
  },
4640
+ "emoji": {
4641
+ "description": "Emoji of the page, if one has been set.",
4642
+ "$ref": "#/components/schemas/Emoji"
4643
+ },
4571
4644
  "createdAt": {
4572
4645
  "description": "When the page was first created. Only present if page has been edited at least once.",
4573
- "$ref": "#/components/schemas/Date"
4646
+ "$ref": "#/components/schemas/Timestamp"
4574
4647
  },
4575
4648
  "updatedAt": {
4576
4649
  "description": "When the page was last edited. Only present if page has been edited at least once.",
4577
- "$ref": "#/components/schemas/Date"
4650
+ "$ref": "#/components/schemas/Timestamp"
4578
4651
  }
4579
4652
  },
4580
4653
  "required": [
@@ -5380,7 +5453,7 @@
5380
5453
  },
5381
5454
  "updatedAt": {
5382
5455
  "description": "When the Git provider details were last updated",
5383
- "$ref": "#/components/schemas/Date"
5456
+ "$ref": "#/components/schemas/Timestamp"
5384
5457
  }
5385
5458
  }
5386
5459
  },
@@ -5391,11 +5464,11 @@
5391
5464
  "$ref": "#/components/schemas/GitSyncOperationState"
5392
5465
  },
5393
5466
  "startedAt": {
5394
- "$ref": "#/components/schemas/Date"
5467
+ "$ref": "#/components/schemas/Timestamp"
5395
5468
  },
5396
5469
  "completedAt": {
5397
5470
  "description": "Date when the operation was successful (when state is `success`)",
5398
- "$ref": "#/components/schemas/Date"
5471
+ "$ref": "#/components/schemas/Timestamp"
5399
5472
  },
5400
5473
  "error": {
5401
5474
  "type": "string",
@@ -5403,8 +5476,7 @@
5403
5476
  }
5404
5477
  },
5405
5478
  "required": [
5406
- "state",
5407
- "startedAt"
5479
+ "state"
5408
5480
  ]
5409
5481
  },
5410
5482
  "GitSyncOperationState": {
@@ -5671,11 +5743,11 @@
5671
5743
  },
5672
5744
  "joinedAt": {
5673
5745
  "description": "Date at which the user joined the organization.",
5674
- "$ref": "#/components/schemas/Date"
5746
+ "$ref": "#/components/schemas/Timestamp"
5675
5747
  },
5676
5748
  "lastSeenAt": {
5677
5749
  "description": "Date at which the user was last seen active in the organization.",
5678
- "$ref": "#/components/schemas/Date"
5750
+ "$ref": "#/components/schemas/Timestamp"
5679
5751
  },
5680
5752
  "sso": {
5681
5753
  "type": "boolean",
@@ -5727,7 +5799,7 @@
5727
5799
  },
5728
5800
  "createdAt": {
5729
5801
  "description": "Date at which the team was created.",
5730
- "$ref": "#/components/schemas/Date"
5802
+ "$ref": "#/components/schemas/Timestamp"
5731
5803
  }
5732
5804
  },
5733
5805
  "required": [
@@ -6171,6 +6243,10 @@
6171
6243
  "type": "string",
6172
6244
  "description": "Unique identifier for the snippet"
6173
6245
  },
6246
+ "organization": {
6247
+ "type": "string",
6248
+ "description": "ID of the organization owning this snippet"
6249
+ },
6174
6250
  "createdAt": {
6175
6251
  "type": "string",
6176
6252
  "format": "date-time"
@@ -6251,6 +6327,7 @@
6251
6327
  },
6252
6328
  "required": [
6253
6329
  "id",
6330
+ "organization",
6254
6331
  "source",
6255
6332
  "createdAt",
6256
6333
  "archived",
@@ -6301,7 +6378,7 @@
6301
6378
  },
6302
6379
  "createdAt": {
6303
6380
  "description": "The date at which the relation was created",
6304
- "$ref": "#/components/schemas/Date"
6381
+ "$ref": "#/components/schemas/Timestamp"
6305
6382
  }
6306
6383
  },
6307
6384
  "required": [
@@ -6404,10 +6481,10 @@
6404
6481
  "$ref": "#/components/schemas/User"
6405
6482
  },
6406
6483
  "createdAt": {
6407
- "$ref": "#/components/schemas/Date"
6484
+ "$ref": "#/components/schemas/Timestamp"
6408
6485
  },
6409
6486
  "updatedAt": {
6410
- "$ref": "#/components/schemas/Date"
6487
+ "$ref": "#/components/schemas/Timestamp"
6411
6488
  },
6412
6489
  "urls": {
6413
6490
  "type": "object",
@@ -6479,10 +6556,10 @@
6479
6556
  "$ref": "#/components/schemas/Comment"
6480
6557
  },
6481
6558
  "createdAt": {
6482
- "$ref": "#/components/schemas/Date"
6559
+ "$ref": "#/components/schemas/Timestamp"
6483
6560
  },
6484
6561
  "updatedAt": {
6485
- "$ref": "#/components/schemas/Date"
6562
+ "$ref": "#/components/schemas/Timestamp"
6486
6563
  }
6487
6564
  },
6488
6565
  "required": [
@@ -6525,7 +6602,7 @@
6525
6602
  "$ref": "#/components/schemas/User"
6526
6603
  },
6527
6604
  "createdAt": {
6528
- "$ref": "#/components/schemas/Date"
6605
+ "$ref": "#/components/schemas/Timestamp"
6529
6606
  }
6530
6607
  },
6531
6608
  "required": [
@@ -7437,7 +7514,8 @@
7437
7514
  "space:metadata:write",
7438
7515
  "space:script:inject",
7439
7516
  "space:script:cookies",
7440
- "space:git:sync"
7517
+ "space:git:sync",
7518
+ "space:visitor:auth"
7441
7519
  ]
7442
7520
  },
7443
7521
  "IntegrationCategories": {
@@ -7551,7 +7629,7 @@
7551
7629
  "description": "Unique ID of the integration installation."
7552
7630
  },
7553
7631
  "createdAt": {
7554
- "$ref": "#/components/schemas/Date"
7632
+ "$ref": "#/components/schemas/Timestamp"
7555
7633
  },
7556
7634
  "payload": {
7557
7635
  "$ref": "#/components/schemas/Event"
@@ -7581,7 +7659,7 @@
7581
7659
  "type": "string"
7582
7660
  },
7583
7661
  "timestamp": {
7584
- "$ref": "#/components/schemas/Date"
7662
+ "$ref": "#/components/schemas/Timestamp"
7585
7663
  },
7586
7664
  "level": {
7587
7665
  "description": "The level of the log entry.",
@@ -7805,10 +7883,10 @@
7805
7883
  "$ref": "#/components/schemas/IntegrationInstallationConfiguration"
7806
7884
  },
7807
7885
  "createdAt": {
7808
- "$ref": "#/components/schemas/Date"
7886
+ "$ref": "#/components/schemas/Timestamp"
7809
7887
  },
7810
7888
  "updatedAt": {
7811
- "$ref": "#/components/schemas/Date"
7889
+ "$ref": "#/components/schemas/Timestamp"
7812
7890
  },
7813
7891
  "urls": {
7814
7892
  "type": "object",
@@ -8580,6 +8658,9 @@
8580
8658
  {
8581
8659
  "$ref": "#/components/schemas/FetchPublishedScriptEvent"
8582
8660
  },
8661
+ {
8662
+ "$ref": "#/components/schemas/FetchVisitorAuthenticationEvent"
8663
+ },
8583
8664
  {
8584
8665
  "$ref": "#/components/schemas/UIRenderEvent"
8585
8666
  }
@@ -8804,6 +8885,10 @@
8804
8885
  "ip": {
8805
8886
  "type": "string",
8806
8887
  "description": "IP address of the visitor."
8888
+ },
8889
+ "language": {
8890
+ "type": "string",
8891
+ "description": "Language of the visitor."
8807
8892
  }
8808
8893
  },
8809
8894
  "required": [
@@ -9056,6 +9141,31 @@
9056
9141
  }
9057
9142
  ]
9058
9143
  },
9144
+ "FetchVisitorAuthenticationEvent": {
9145
+ "allOf": [
9146
+ {
9147
+ "$ref": "#/components/schemas/SpaceEvent"
9148
+ },
9149
+ {
9150
+ "type": "object",
9151
+ "description": "Common properties for all events related to visitor authentication from an installation",
9152
+ "properties": {
9153
+ "type": {
9154
+ "type": "string",
9155
+ "enum": [
9156
+ "fetch_visitor_authentication"
9157
+ ]
9158
+ },
9159
+ "location": {
9160
+ "type": "string"
9161
+ }
9162
+ },
9163
+ "required": [
9164
+ "type"
9165
+ ]
9166
+ }
9167
+ ]
9168
+ },
9059
9169
  "UIRenderEvent": {
9060
9170
  "allOf": [
9061
9171
  {
@@ -9252,10 +9362,10 @@
9252
9362
  "type": "number"
9253
9363
  },
9254
9364
  "periodStart": {
9255
- "$ref": "#/components/schemas/Date"
9365
+ "$ref": "#/components/schemas/Timestamp"
9256
9366
  },
9257
9367
  "periodEnd": {
9258
- "$ref": "#/components/schemas/Date"
9368
+ "$ref": "#/components/schemas/Timestamp"
9259
9369
  }
9260
9370
  },
9261
9371
  "required": [
@@ -9545,7 +9655,7 @@
9545
9655
  "description": "All the permissions of a user",
9546
9656
  "properties": {
9547
9657
  "updatedAt": {
9548
- "$ref": "#/components/schemas/Date"
9658
+ "$ref": "#/components/schemas/Timestamp"
9549
9659
  },
9550
9660
  "searchKey": {
9551
9661
  "type": "string"
@@ -12061,10 +12171,10 @@
12061
12171
  "$ref": "#/components/schemas/CustomFieldOptions"
12062
12172
  },
12063
12173
  "createdAt": {
12064
- "$ref": "#/components/schemas/Date"
12174
+ "$ref": "#/components/schemas/Timestamp"
12065
12175
  },
12066
12176
  "updatedAt": {
12067
- "$ref": "#/components/schemas/Date"
12177
+ "$ref": "#/components/schemas/Timestamp"
12068
12178
  },
12069
12179
  "urls": {
12070
12180
  "type": "object",
@@ -12619,7 +12729,7 @@
12619
12729
  "$ref": "#/components/schemas/PageFeedbackRating"
12620
12730
  },
12621
12731
  "createdAt": {
12622
- "$ref": "#/components/schemas/Date"
12732
+ "$ref": "#/components/schemas/Timestamp"
12623
12733
  },
12624
12734
  "revision": {
12625
12735
  "type": "string",
@@ -13090,6 +13200,12 @@
13090
13200
  "schema": {
13091
13201
  "type": "object",
13092
13202
  "properties": {
13203
+ "editMode": {
13204
+ "$ref": "#/components/schemas/SpaceEditMode"
13205
+ },
13206
+ "title": {
13207
+ "$ref": "#/components/schemas/SpaceTitle"
13208
+ },
13093
13209
  "visibility": {
13094
13210
  "$ref": "#/components/schemas/ContentVisibility"
13095
13211
  }
@@ -16801,6 +16917,65 @@
16801
16917
  }
16802
16918
  }
16803
16919
  },
16920
+ "/spaces/{spaceId}/pdf": {
16921
+ "get": {
16922
+ "operationId": "getSpacePDF",
16923
+ "summary": "Generate a URL to export the content of the space as a PDF.",
16924
+ "tags": [
16925
+ "spaces"
16926
+ ],
16927
+ "security": [
16928
+ {
16929
+ "user": []
16930
+ }
16931
+ ],
16932
+ "parameters": [
16933
+ {
16934
+ "$ref": "#/components/parameters/spaceId"
16935
+ },
16936
+ {
16937
+ "in": "query",
16938
+ "name": "only",
16939
+ "description": "Generate a PDF only for the provided page.",
16940
+ "schema": {
16941
+ "type": "boolean"
16942
+ }
16943
+ },
16944
+ {
16945
+ "in": "query",
16946
+ "name": "page",
16947
+ "description": "ID of a specific page to generate a PDF for.",
16948
+ "schema": {
16949
+ "type": "string"
16950
+ }
16951
+ }
16952
+ ],
16953
+ "responses": {
16954
+ "200": {
16955
+ "description": "URL of the PDF",
16956
+ "content": {
16957
+ "application/json": {
16958
+ "schema": {
16959
+ "type": "object",
16960
+ "properties": {
16961
+ "url": {
16962
+ "description": "Temporary URL to print the content. The URL will work for 1h.",
16963
+ "$ref": "#/components/schemas/URL"
16964
+ }
16965
+ },
16966
+ "required": [
16967
+ "url"
16968
+ ]
16969
+ }
16970
+ }
16971
+ }
16972
+ },
16973
+ "default": {
16974
+ "$ref": "#/components/responses/UnexpectedError"
16975
+ }
16976
+ }
16977
+ }
16978
+ },
16804
16979
  "/collections/{collectionId}": {
16805
16980
  "get": {
16806
16981
  "operationId": "getCollectionById",
@@ -21578,6 +21753,14 @@
21578
21753
  "schema": {
21579
21754
  "type": "string"
21580
21755
  }
21756
+ },
21757
+ {
21758
+ "name": "search",
21759
+ "in": "query",
21760
+ "description": "If specified, only locations matching the search query will be returned.",
21761
+ "schema": {
21762
+ "type": "string"
21763
+ }
21581
21764
  }
21582
21765
  ],
21583
21766
  "responses": {