@gitbook/api 0.59.0 → 0.60.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 CHANGED
@@ -3714,11 +3714,32 @@ export declare enum SiteVisibility {
3714
3714
  ShareLink = "share-link",
3715
3715
  VisitorAuth = "visitor-auth"
3716
3716
  }
3717
- /** The configuration for serving ads in the site */
3718
- export interface SiteAdsConfig {
3717
+ /** Topic of the content */
3718
+ export declare enum SiteAdsTopic {
3719
+ Webdev = "webdev",
3720
+ Crypto = "crypto"
3721
+ }
3722
+ export declare type SiteAds = {
3723
+ status: 'pending';
3724
+ /** True if the user can submit the site for review. */
3725
+ submittable: boolean;
3726
+ } | {
3727
+ status: 'in-review';
3728
+ /** Topic of the content */
3729
+ topic: SiteAdsTopic;
3730
+ /** The email address linked to the Ads partner account */
3731
+ accountEmail: string;
3732
+ } | {
3733
+ status: 'rejected';
3734
+ } | {
3735
+ status: 'live' | 'disabled';
3736
+ /** Topic of the content */
3737
+ topic: SiteAdsTopic;
3719
3738
  /** The ad network zone ID */
3720
- zone: string;
3721
- }
3739
+ zoneId: string;
3740
+ /** The email address linked to the Ads partner account */
3741
+ accountEmail: string;
3742
+ };
3722
3743
  export interface Site {
3723
3744
  object: 'site';
3724
3745
  /** Unique identifier of the site */
@@ -3744,8 +3765,7 @@ export interface Site {
3744
3765
  siteSpaces: number;
3745
3766
  /** @format date-time */
3746
3767
  createdAt: string;
3747
- /** The configuration for serving ads in the site */
3748
- ads?: SiteAdsConfig;
3768
+ ads?: SiteAds;
3749
3769
  /** URLs associated with the object */
3750
3770
  urls: {
3751
3771
  /**
@@ -4643,6 +4663,14 @@ export interface CustomHostnameChannel {
4643
4663
  }
4644
4664
  /** Channel to subscribe to for API updates. */
4645
4665
  export declare type SubscriptionChannel = SpaceInfoChannel | SpaceGitInfoChannel | SpacePublishingAuthChannel | SpacePublishingCustomizationChannel | SpaceCustomFieldsChannel | SpaceBrokenLinksChannel | BackofficeUserInfoChannel | SpaceIntegrationsChannel | OrganizationCustomFieldsChannel | UserAPITokensChannel | UserOrganizationsChannel | UserProfileChannel | ChangeRequestChannel | ChangeRequestsChannel | ChangeRequestReviewsChannel | ChangeRequestBrokenLinksChannel | CollectionChannel | CollectionPublishingCustomizationChannel | OrganizationInfoChannel | OrganizationMembersChannel | OrganizationMemberChannel | OrganizationTeamsChannel | OrganizationTeamChannel | OrganizationTeamMembersChannel | OrganizationTeamMemberChannel | OrganizationSpacesChannel | OrganizationCollectionsChannel | OrganizationCapturesChannel | OrganizationContentAuditsChannel | OrganizationIntegrationsChannel | OrganizationInstallationsChannel | OrganizationSitesChannel | OrganizationExperimentalFeaturesChannel | OrganizationSyncedBlockChannel | CommentsChannel | CommentInfoChannel | CommentReplyInfoChannel | CommentRepliesChannel | IntegrationChannel | IntegrationInstallationChannel | IntegrationSpaceInstallationChannel | IntegrationSpaceInstallationsChannel | IntegrationSiteInstallationChannel | IntegrationSiteInstallationsChannel | SiteChannel | SiteCustomizationChannel | SiteIntegrationsChannel | SiteSpaceChannel | SiteSpaceCustomizationChannel | SiteSpacesChannel | SitePublishingAuthChannel | SiteShareLinksChannel | SiteShareLinkChannel | CustomHostnameChannel;
4666
+ /** The status of ads on the site */
4667
+ export declare enum SiteAdsStatus {
4668
+ Pending = "pending",
4669
+ InReview = "in-review",
4670
+ Live = "live",
4671
+ Rejected = "rejected",
4672
+ Disabled = "disabled"
4673
+ }
4646
4674
  export interface Seat {
4647
4675
  object: 'seat';
4648
4676
  /** The unique ID of the organization */
@@ -9150,6 +9178,20 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
9150
9178
  * @secure
9151
9179
  */
9152
9180
  trackViewInSiteById: (organizationId: string, siteId: string, data: SiteTrackPageView, params?: RequestParams) => Promise<HttpResponse<void, Error>>;
9181
+ /**
9182
+ * No description
9183
+ *
9184
+ * @tags sites
9185
+ * @name UpdateSiteAdsById
9186
+ * @summary Enable, disable, or submit for review Ads on a site.
9187
+ * @request POST:/orgs/{organizationId}/sites/{siteId}/ads
9188
+ * @secure
9189
+ */
9190
+ updateSiteAdsById: (organizationId: string, siteId: string, data?: {
9191
+ status?: 'in-review' | 'disabled';
9192
+ /** Topic of the content */
9193
+ topic?: SiteAdsTopic;
9194
+ }, params?: RequestParams) => Promise<HttpResponse<void, Error>>;
9153
9195
  };
9154
9196
  customHostnames: {
9155
9197
  /**
@@ -9231,6 +9273,53 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
9231
9273
  };
9232
9274
  }>>;
9233
9275
  };
9276
+ ads: {
9277
+ /**
9278
+ * No description
9279
+ *
9280
+ * @tags ads
9281
+ * @name AdsListSites
9282
+ * @summary List all the sites with ads configured
9283
+ * @request GET:/ads/sites
9284
+ * @secure
9285
+ */
9286
+ adsListSites: (query?: {
9287
+ /** Identifier of the page results to fetch. */
9288
+ page?: string;
9289
+ /**
9290
+ * The number of results per page
9291
+ * @min 0
9292
+ * @max 1000
9293
+ */
9294
+ limit?: number;
9295
+ }, params?: RequestParams) => Promise<HttpResponse<List & {
9296
+ items: {
9297
+ id: string;
9298
+ url: string;
9299
+ ads: SiteAds;
9300
+ }[];
9301
+ }, Error>>;
9302
+ /**
9303
+ * No description
9304
+ *
9305
+ * @tags ads
9306
+ * @name AdsUpdateSite
9307
+ * @summary Update the Ads configuration for a site
9308
+ * @request PATCH:/ads/sites/{siteId}
9309
+ * @secure
9310
+ */
9311
+ adsUpdateSite: (siteId: string, data: {
9312
+ status: 'live';
9313
+ /** ID of the zone */
9314
+ zoneId: string;
9315
+ /** ID to fetch reporting data */
9316
+ reportingId: string;
9317
+ } | {
9318
+ status: 'rejected';
9319
+ } | {
9320
+ status: 'pending';
9321
+ }, params?: RequestParams) => Promise<HttpResponse<void, Error>>;
9322
+ };
9234
9323
  internal: {
9235
9324
  /**
9236
9325
  * No description
package/dist/index.cjs CHANGED
@@ -229,6 +229,8 @@ __export(src_exports, {
229
229
  RevisionPageLayoutPreset: () => RevisionPageLayoutPreset,
230
230
  RevisionPageType: () => RevisionPageType,
231
231
  RevisionSemanticChangeType: () => RevisionSemanticChangeType,
232
+ SiteAdsStatus: () => SiteAdsStatus,
233
+ SiteAdsTopic: () => SiteAdsTopic,
232
234
  SiteType: () => SiteType,
233
235
  SiteVisibility: () => SiteVisibility,
234
236
  SpaceBlockReason: () => SpaceBlockReason,
@@ -239,7 +241,7 @@ module.exports = __toCommonJS(src_exports);
239
241
 
240
242
  // package.json
241
243
  var name = "@gitbook/api";
242
- var version = "0.59.0";
244
+ var version = "0.60.0";
243
245
 
244
246
  // src/client.ts
245
247
  var import_event_iterator = __toESM(require_node(), 1);
@@ -670,6 +672,11 @@ var SiteVisibility = /* @__PURE__ */ ((SiteVisibility2) => {
670
672
  SiteVisibility2["VisitorAuth"] = "visitor-auth";
671
673
  return SiteVisibility2;
672
674
  })(SiteVisibility || {});
675
+ var SiteAdsTopic = /* @__PURE__ */ ((SiteAdsTopic2) => {
676
+ SiteAdsTopic2["Webdev"] = "webdev";
677
+ SiteAdsTopic2["Crypto"] = "crypto";
678
+ return SiteAdsTopic2;
679
+ })(SiteAdsTopic || {});
673
680
  var CustomizationIconsStyle = /* @__PURE__ */ ((CustomizationIconsStyle2) => {
674
681
  CustomizationIconsStyle2["Regular"] = "regular";
675
682
  CustomizationIconsStyle2["Solid"] = "solid";
@@ -755,6 +762,14 @@ var APIIntegrationScope = /* @__PURE__ */ ((APIIntegrationScope2) => {
755
762
  APIIntegrationScope2["IntegrationInstallationUpdate"] = "integration:installation:update";
756
763
  return APIIntegrationScope2;
757
764
  })(APIIntegrationScope || {});
765
+ var SiteAdsStatus = /* @__PURE__ */ ((SiteAdsStatus2) => {
766
+ SiteAdsStatus2["Pending"] = "pending";
767
+ SiteAdsStatus2["InReview"] = "in-review";
768
+ SiteAdsStatus2["Live"] = "live";
769
+ SiteAdsStatus2["Rejected"] = "rejected";
770
+ SiteAdsStatus2["Disabled"] = "disabled";
771
+ return SiteAdsStatus2;
772
+ })(SiteAdsStatus || {});
758
773
  var ContentType = /* @__PURE__ */ ((ContentType2) => {
759
774
  ContentType2["Json"] = "application/json";
760
775
  ContentType2["FormData"] = "multipart/form-data";
@@ -3065,6 +3080,14 @@ var Api = class extends HttpClient {
3065
3080
  secure: true,
3066
3081
  type: "application/json" /* Json */,
3067
3082
  ...params
3083
+ }),
3084
+ updateSiteAdsById: (organizationId, siteId, data, params = {}) => this.request({
3085
+ path: `/orgs/${organizationId}/sites/${siteId}/ads`,
3086
+ method: "POST",
3087
+ body: data,
3088
+ secure: true,
3089
+ type: "application/json" /* Json */,
3090
+ ...params
3068
3091
  })
3069
3092
  };
3070
3093
  this.customHostnames = {
@@ -3105,6 +3128,24 @@ var Api = class extends HttpClient {
3105
3128
  ...params
3106
3129
  })
3107
3130
  };
3131
+ this.ads = {
3132
+ adsListSites: (query, params = {}) => this.request({
3133
+ path: `/ads/sites`,
3134
+ method: "GET",
3135
+ query,
3136
+ secure: true,
3137
+ format: "json",
3138
+ ...params
3139
+ }),
3140
+ adsUpdateSite: (siteId, data, params = {}) => this.request({
3141
+ path: `/ads/sites/${siteId}`,
3142
+ method: "PATCH",
3143
+ body: data,
3144
+ secure: true,
3145
+ type: "application/json" /* Json */,
3146
+ ...params
3147
+ })
3148
+ };
3108
3149
  this.internal = {
3109
3150
  generateHiveAccessToken: (data, params = {}) => this.request({
3110
3151
  path: `/internal/hive/token`,
@@ -3269,6 +3310,8 @@ var GitBookAPI = class extends Api {
3269
3310
  RevisionPageLayoutPreset,
3270
3311
  RevisionPageType,
3271
3312
  RevisionSemanticChangeType,
3313
+ SiteAdsStatus,
3314
+ SiteAdsTopic,
3272
3315
  SiteType,
3273
3316
  SiteVisibility,
3274
3317
  SpaceBlockReason,
package/dist/index.js CHANGED
@@ -172,7 +172,7 @@ var require_node = __commonJS({
172
172
 
173
173
  // package.json
174
174
  var name = "@gitbook/api";
175
- var version = "0.59.0";
175
+ var version = "0.60.0";
176
176
 
177
177
  // src/client.ts
178
178
  var import_event_iterator = __toESM(require_node(), 1);
@@ -603,6 +603,11 @@ var SiteVisibility = /* @__PURE__ */ ((SiteVisibility2) => {
603
603
  SiteVisibility2["VisitorAuth"] = "visitor-auth";
604
604
  return SiteVisibility2;
605
605
  })(SiteVisibility || {});
606
+ var SiteAdsTopic = /* @__PURE__ */ ((SiteAdsTopic2) => {
607
+ SiteAdsTopic2["Webdev"] = "webdev";
608
+ SiteAdsTopic2["Crypto"] = "crypto";
609
+ return SiteAdsTopic2;
610
+ })(SiteAdsTopic || {});
606
611
  var CustomizationIconsStyle = /* @__PURE__ */ ((CustomizationIconsStyle2) => {
607
612
  CustomizationIconsStyle2["Regular"] = "regular";
608
613
  CustomizationIconsStyle2["Solid"] = "solid";
@@ -688,6 +693,14 @@ var APIIntegrationScope = /* @__PURE__ */ ((APIIntegrationScope2) => {
688
693
  APIIntegrationScope2["IntegrationInstallationUpdate"] = "integration:installation:update";
689
694
  return APIIntegrationScope2;
690
695
  })(APIIntegrationScope || {});
696
+ var SiteAdsStatus = /* @__PURE__ */ ((SiteAdsStatus2) => {
697
+ SiteAdsStatus2["Pending"] = "pending";
698
+ SiteAdsStatus2["InReview"] = "in-review";
699
+ SiteAdsStatus2["Live"] = "live";
700
+ SiteAdsStatus2["Rejected"] = "rejected";
701
+ SiteAdsStatus2["Disabled"] = "disabled";
702
+ return SiteAdsStatus2;
703
+ })(SiteAdsStatus || {});
691
704
  var ContentType = /* @__PURE__ */ ((ContentType2) => {
692
705
  ContentType2["Json"] = "application/json";
693
706
  ContentType2["FormData"] = "multipart/form-data";
@@ -2998,6 +3011,14 @@ var Api = class extends HttpClient {
2998
3011
  secure: true,
2999
3012
  type: "application/json" /* Json */,
3000
3013
  ...params
3014
+ }),
3015
+ updateSiteAdsById: (organizationId, siteId, data, params = {}) => this.request({
3016
+ path: `/orgs/${organizationId}/sites/${siteId}/ads`,
3017
+ method: "POST",
3018
+ body: data,
3019
+ secure: true,
3020
+ type: "application/json" /* Json */,
3021
+ ...params
3001
3022
  })
3002
3023
  };
3003
3024
  this.customHostnames = {
@@ -3038,6 +3059,24 @@ var Api = class extends HttpClient {
3038
3059
  ...params
3039
3060
  })
3040
3061
  };
3062
+ this.ads = {
3063
+ adsListSites: (query, params = {}) => this.request({
3064
+ path: `/ads/sites`,
3065
+ method: "GET",
3066
+ query,
3067
+ secure: true,
3068
+ format: "json",
3069
+ ...params
3070
+ }),
3071
+ adsUpdateSite: (siteId, data, params = {}) => this.request({
3072
+ path: `/ads/sites/${siteId}`,
3073
+ method: "PATCH",
3074
+ body: data,
3075
+ secure: true,
3076
+ type: "application/json" /* Json */,
3077
+ ...params
3078
+ })
3079
+ };
3041
3080
  this.internal = {
3042
3081
  generateHiveAccessToken: (data, params = {}) => this.request({
3043
3082
  path: `/internal/hive/token`,
@@ -3201,6 +3240,8 @@ export {
3201
3240
  RevisionPageLayoutPreset,
3202
3241
  RevisionPageType,
3203
3242
  RevisionSemanticChangeType,
3243
+ SiteAdsStatus,
3244
+ SiteAdsTopic,
3204
3245
  SiteType,
3205
3246
  SiteVisibility,
3206
3247
  SpaceBlockReason,
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "main": "./dist/index.cjs",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
- "version": "0.59.0",
7
+ "version": "0.60.0",
8
8
  "sideEffects": false,
9
9
  "files": [
10
10
  "README.md",
package/spec/openapi.json CHANGED
@@ -13534,6 +13534,58 @@
13534
13534
  }
13535
13535
  }
13536
13536
  },
13537
+ "/orgs/{organizationId}/sites/{siteId}/ads": {
13538
+ "post": {
13539
+ "operationId": "updateSiteAdsById",
13540
+ "summary": "Enable, disable, or submit for review Ads on a site.",
13541
+ "tags": [
13542
+ "sites"
13543
+ ],
13544
+ "security": [
13545
+ {
13546
+ "user": []
13547
+ }
13548
+ ],
13549
+ "parameters": [
13550
+ {
13551
+ "$ref": "#/components/parameters/organizationId"
13552
+ },
13553
+ {
13554
+ "$ref": "#/components/parameters/siteId"
13555
+ }
13556
+ ],
13557
+ "requestBody": {
13558
+ "required": false,
13559
+ "content": {
13560
+ "application/json": {
13561
+ "schema": {
13562
+ "type": "object",
13563
+ "properties": {
13564
+ "status": {
13565
+ "type": "string",
13566
+ "enum": [
13567
+ "in-review",
13568
+ "disabled"
13569
+ ]
13570
+ },
13571
+ "topic": {
13572
+ "$ref": "#/components/schemas/SiteAdsTopic"
13573
+ }
13574
+ }
13575
+ }
13576
+ }
13577
+ }
13578
+ },
13579
+ "responses": {
13580
+ "204": {
13581
+ "description": "OK"
13582
+ },
13583
+ "default": {
13584
+ "$ref": "#/components/responses/UnexpectedError"
13585
+ }
13586
+ }
13587
+ }
13588
+ },
13537
13589
  "/custom-hostnames/{hostname}": {
13538
13590
  "get": {
13539
13591
  "operationId": "getCustomHostname",
@@ -13769,6 +13821,168 @@
13769
13821
  }
13770
13822
  }
13771
13823
  },
13824
+ "/ads/sites": {
13825
+ "get": {
13826
+ "operationId": "adsListSites",
13827
+ "summary": "List all the sites with ads configured",
13828
+ "tags": [
13829
+ "ads"
13830
+ ],
13831
+ "parameters": [
13832
+ {
13833
+ "$ref": "#/components/parameters/listPage"
13834
+ },
13835
+ {
13836
+ "$ref": "#/components/parameters/listLimit"
13837
+ },
13838
+ {
13839
+ "$ref": "#/components/parameters/xGitBookPartnerKey"
13840
+ }
13841
+ ],
13842
+ "responses": {
13843
+ "200": {
13844
+ "description": "OK",
13845
+ "content": {
13846
+ "application/json": {
13847
+ "schema": {
13848
+ "allOf": [
13849
+ {
13850
+ "$ref": "#/components/schemas/List"
13851
+ },
13852
+ {
13853
+ "type": "object",
13854
+ "required": [
13855
+ "items"
13856
+ ],
13857
+ "properties": {
13858
+ "items": {
13859
+ "type": "array",
13860
+ "items": {
13861
+ "type": "object",
13862
+ "required": [
13863
+ "id",
13864
+ "ads",
13865
+ "url"
13866
+ ],
13867
+ "properties": {
13868
+ "id": {
13869
+ "type": "string"
13870
+ },
13871
+ "url": {
13872
+ "type": "string"
13873
+ },
13874
+ "ads": {
13875
+ "$ref": "#/components/schemas/SiteAds"
13876
+ }
13877
+ }
13878
+ }
13879
+ }
13880
+ }
13881
+ }
13882
+ ]
13883
+ }
13884
+ }
13885
+ }
13886
+ },
13887
+ "default": {
13888
+ "$ref": "#/components/responses/UnexpectedError"
13889
+ }
13890
+ }
13891
+ }
13892
+ },
13893
+ "/ads/sites/{siteId}": {
13894
+ "patch": {
13895
+ "operationId": "adsUpdateSite",
13896
+ "summary": "Update the Ads configuration for a site",
13897
+ "tags": [
13898
+ "ads"
13899
+ ],
13900
+ "security": [
13901
+ {
13902
+ "user": []
13903
+ }
13904
+ ],
13905
+ "parameters": [
13906
+ {
13907
+ "$ref": "#/components/parameters/siteId"
13908
+ },
13909
+ {
13910
+ "$ref": "#/components/parameters/xGitBookPartnerKey"
13911
+ }
13912
+ ],
13913
+ "requestBody": {
13914
+ "required": true,
13915
+ "content": {
13916
+ "application/json": {
13917
+ "schema": {
13918
+ "oneOf": [
13919
+ {
13920
+ "type": "object",
13921
+ "required": [
13922
+ "status",
13923
+ "zoneId",
13924
+ "reportingId"
13925
+ ],
13926
+ "properties": {
13927
+ "status": {
13928
+ "type": "string",
13929
+ "enum": [
13930
+ "live"
13931
+ ]
13932
+ },
13933
+ "zoneId": {
13934
+ "type": "string",
13935
+ "description": "ID of the zone"
13936
+ },
13937
+ "reportingId": {
13938
+ "type": "string",
13939
+ "description": "ID to fetch reporting data"
13940
+ }
13941
+ }
13942
+ },
13943
+ {
13944
+ "type": "object",
13945
+ "required": [
13946
+ "status"
13947
+ ],
13948
+ "properties": {
13949
+ "status": {
13950
+ "type": "string",
13951
+ "enum": [
13952
+ "rejected"
13953
+ ]
13954
+ }
13955
+ }
13956
+ },
13957
+ {
13958
+ "type": "object",
13959
+ "required": [
13960
+ "status"
13961
+ ],
13962
+ "properties": {
13963
+ "status": {
13964
+ "type": "string",
13965
+ "enum": [
13966
+ "pending"
13967
+ ]
13968
+ }
13969
+ }
13970
+ }
13971
+ ]
13972
+ }
13973
+ }
13974
+ }
13975
+ },
13976
+ "responses": {
13977
+ "204": {
13978
+ "description": "OK"
13979
+ },
13980
+ "default": {
13981
+ "$ref": "#/components/responses/UnexpectedError"
13982
+ }
13983
+ }
13984
+ }
13985
+ },
13772
13986
  "/internal/hive/token": {
13773
13987
  "post": {
13774
13988
  "operationId": "generateHiveAccessToken",
@@ -14375,6 +14589,14 @@
14375
14589
  "type": "string"
14376
14590
  }
14377
14591
  },
14592
+ "xGitBookPartnerKey": {
14593
+ "in": "header",
14594
+ "name": "X-GitBook-Partner-Key",
14595
+ "schema": {
14596
+ "type": "string"
14597
+ },
14598
+ "required": true
14599
+ },
14378
14600
  "pageFormat": {
14379
14601
  "$ref": "#/components/parameters/documentFormat"
14380
14602
  },
@@ -26459,17 +26681,101 @@
26459
26681
  "visitor-auth"
26460
26682
  ]
26461
26683
  },
26462
- "SiteAdsConfig": {
26463
- "type": "object",
26464
- "description": "The configuration for serving ads in the site",
26465
- "properties": {
26466
- "zone": {
26467
- "type": "string",
26468
- "description": "The ad network zone ID"
26684
+ "SiteAdsTopic": {
26685
+ "type": "string",
26686
+ "description": "Topic of the content",
26687
+ "enum": [
26688
+ "webdev",
26689
+ "crypto"
26690
+ ]
26691
+ },
26692
+ "SiteAds": {
26693
+ "oneOf": [
26694
+ {
26695
+ "type": "object",
26696
+ "required": [
26697
+ "status",
26698
+ "submittable"
26699
+ ],
26700
+ "properties": {
26701
+ "status": {
26702
+ "type": "string",
26703
+ "enum": [
26704
+ "pending"
26705
+ ]
26706
+ },
26707
+ "submittable": {
26708
+ "type": "boolean",
26709
+ "description": "True if the user can submit the site for review."
26710
+ }
26711
+ }
26712
+ },
26713
+ {
26714
+ "type": "object",
26715
+ "required": [
26716
+ "status",
26717
+ "topic",
26718
+ "accountEmail"
26719
+ ],
26720
+ "properties": {
26721
+ "status": {
26722
+ "type": "string",
26723
+ "enum": [
26724
+ "in-review"
26725
+ ]
26726
+ },
26727
+ "topic": {
26728
+ "$ref": "#/components/schemas/SiteAdsTopic"
26729
+ },
26730
+ "accountEmail": {
26731
+ "type": "string",
26732
+ "description": "The email address linked to the Ads partner account"
26733
+ }
26734
+ }
26735
+ },
26736
+ {
26737
+ "type": "object",
26738
+ "required": [
26739
+ "status"
26740
+ ],
26741
+ "properties": {
26742
+ "status": {
26743
+ "type": "string",
26744
+ "enum": [
26745
+ "rejected"
26746
+ ]
26747
+ }
26748
+ }
26749
+ },
26750
+ {
26751
+ "type": "object",
26752
+ "required": [
26753
+ "status",
26754
+ "topic",
26755
+ "zoneId",
26756
+ "accountEmail"
26757
+ ],
26758
+ "properties": {
26759
+ "status": {
26760
+ "type": "string",
26761
+ "enum": [
26762
+ "live",
26763
+ "disabled"
26764
+ ]
26765
+ },
26766
+ "topic": {
26767
+ "$ref": "#/components/schemas/SiteAdsTopic"
26768
+ },
26769
+ "zoneId": {
26770
+ "type": "string",
26771
+ "description": "The ad network zone ID"
26772
+ },
26773
+ "accountEmail": {
26774
+ "type": "string",
26775
+ "description": "The email address linked to the Ads partner account"
26776
+ }
26777
+ }
26469
26778
  }
26470
- },
26471
- "required": [
26472
- "zone"
26473
26779
  ]
26474
26780
  },
26475
26781
  "Site": {
@@ -26512,7 +26818,7 @@
26512
26818
  "format": "date-time"
26513
26819
  },
26514
26820
  "ads": {
26515
- "$ref": "#/components/schemas/SiteAdsConfig"
26821
+ "$ref": "#/components/schemas/SiteAds"
26516
26822
  },
26517
26823
  "urls": {
26518
26824
  "type": "object",
@@ -29774,6 +30080,17 @@
29774
30080
  "propertyName": "channel"
29775
30081
  }
29776
30082
  },
30083
+ "SiteAdsStatus": {
30084
+ "type": "string",
30085
+ "description": "The status of ads on the site",
30086
+ "enum": [
30087
+ "pending",
30088
+ "in-review",
30089
+ "live",
30090
+ "rejected",
30091
+ "disabled"
30092
+ ]
30093
+ },
29777
30094
  "Seat": {
29778
30095
  "type": "object",
29779
30096
  "properties": {
package/spec/openapi.yaml CHANGED
@@ -7544,6 +7544,36 @@ paths:
7544
7544
  application/json:
7545
7545
  schema:
7546
7546
  $ref: "#/components/schemas/SiteTrackPageView"
7547
+ "/orgs/{organizationId}/sites/{siteId}/ads":
7548
+ post:
7549
+ operationId: updateSiteAdsById
7550
+ summary: Enable, disable, or submit for review Ads on a site.
7551
+ tags:
7552
+ - sites
7553
+ security:
7554
+ - user: []
7555
+ parameters:
7556
+ - $ref: "#/components/parameters/organizationId"
7557
+ - $ref: "#/components/parameters/siteId"
7558
+ requestBody:
7559
+ required: false
7560
+ content:
7561
+ application/json:
7562
+ schema:
7563
+ type: object
7564
+ properties:
7565
+ status:
7566
+ type: string
7567
+ enum:
7568
+ - in-review
7569
+ - disabled
7570
+ topic:
7571
+ $ref: "#/components/schemas/SiteAdsTopic"
7572
+ responses:
7573
+ "204":
7574
+ description: OK
7575
+ default:
7576
+ $ref: "#/components/responses/UnexpectedError"
7547
7577
  "/custom-hostnames/{hostname}":
7548
7578
  get:
7549
7579
  operationId: getCustomHostname
@@ -7675,6 +7705,99 @@ paths:
7675
7705
  $ref: "#/components/responses/ConflictError"
7676
7706
  default:
7677
7707
  $ref: "#/components/responses/UnexpectedError"
7708
+ /ads/sites:
7709
+ get:
7710
+ operationId: adsListSites
7711
+ summary: List all the sites with ads configured
7712
+ tags:
7713
+ - ads
7714
+ parameters:
7715
+ - $ref: "#/components/parameters/listPage"
7716
+ - $ref: "#/components/parameters/listLimit"
7717
+ - $ref: "#/components/parameters/xGitBookPartnerKey"
7718
+ responses:
7719
+ "200":
7720
+ description: OK
7721
+ content:
7722
+ application/json:
7723
+ schema:
7724
+ allOf:
7725
+ - $ref: "#/components/schemas/List"
7726
+ - type: object
7727
+ required:
7728
+ - items
7729
+ properties:
7730
+ items:
7731
+ type: array
7732
+ items:
7733
+ type: object
7734
+ required:
7735
+ - id
7736
+ - ads
7737
+ - url
7738
+ properties:
7739
+ id:
7740
+ type: string
7741
+ url:
7742
+ type: string
7743
+ ads:
7744
+ $ref: "#/components/schemas/SiteAds"
7745
+ default:
7746
+ $ref: "#/components/responses/UnexpectedError"
7747
+ "/ads/sites/{siteId}":
7748
+ patch:
7749
+ operationId: adsUpdateSite
7750
+ summary: Update the Ads configuration for a site
7751
+ tags:
7752
+ - ads
7753
+ security:
7754
+ - user: []
7755
+ parameters:
7756
+ - $ref: "#/components/parameters/siteId"
7757
+ - $ref: "#/components/parameters/xGitBookPartnerKey"
7758
+ requestBody:
7759
+ required: true
7760
+ content:
7761
+ application/json:
7762
+ schema:
7763
+ oneOf:
7764
+ - type: object
7765
+ required:
7766
+ - status
7767
+ - zoneId
7768
+ - reportingId
7769
+ properties:
7770
+ status:
7771
+ type: string
7772
+ enum:
7773
+ - live
7774
+ zoneId:
7775
+ type: string
7776
+ description: ID of the zone
7777
+ reportingId:
7778
+ type: string
7779
+ description: ID to fetch reporting data
7780
+ - type: object
7781
+ required:
7782
+ - status
7783
+ properties:
7784
+ status:
7785
+ type: string
7786
+ enum:
7787
+ - rejected
7788
+ - type: object
7789
+ required:
7790
+ - status
7791
+ properties:
7792
+ status:
7793
+ type: string
7794
+ enum:
7795
+ - pending
7796
+ responses:
7797
+ "204":
7798
+ description: OK
7799
+ default:
7800
+ $ref: "#/components/responses/UnexpectedError"
7678
7801
  /internal/hive/token:
7679
7802
  post:
7680
7803
  operationId: generateHiveAccessToken
@@ -8105,6 +8228,12 @@ components:
8105
8228
  description: The custom hostname, for example "docs.gitbook.com"
8106
8229
  schema:
8107
8230
  type: string
8231
+ xGitBookPartnerKey:
8232
+ in: header
8233
+ name: X-GitBook-Partner-Key
8234
+ schema:
8235
+ type: string
8236
+ required: true
8108
8237
  pageFormat:
8109
8238
  $ref: "#/components/parameters/documentFormat"
8110
8239
  commentStatus:
@@ -16091,15 +16220,69 @@ components:
16091
16220
  - unlisted
16092
16221
  - share-link
16093
16222
  - visitor-auth
16094
- SiteAdsConfig:
16095
- type: object
16096
- description: The configuration for serving ads in the site
16097
- properties:
16098
- zone:
16099
- type: string
16100
- description: The ad network zone ID
16101
- required:
16102
- - zone
16223
+ SiteAdsTopic:
16224
+ type: string
16225
+ description: Topic of the content
16226
+ enum:
16227
+ - webdev
16228
+ - crypto
16229
+ SiteAds:
16230
+ oneOf:
16231
+ - type: object
16232
+ required:
16233
+ - status
16234
+ - submittable
16235
+ properties:
16236
+ status:
16237
+ type: string
16238
+ enum:
16239
+ - pending
16240
+ submittable:
16241
+ type: boolean
16242
+ description: True if the user can submit the site for review.
16243
+ - type: object
16244
+ required:
16245
+ - status
16246
+ - topic
16247
+ - accountEmail
16248
+ properties:
16249
+ status:
16250
+ type: string
16251
+ enum:
16252
+ - in-review
16253
+ topic:
16254
+ $ref: "#/components/schemas/SiteAdsTopic"
16255
+ accountEmail:
16256
+ type: string
16257
+ description: The email address linked to the Ads partner account
16258
+ - type: object
16259
+ required:
16260
+ - status
16261
+ properties:
16262
+ status:
16263
+ type: string
16264
+ enum:
16265
+ - rejected
16266
+ - type: object
16267
+ required:
16268
+ - status
16269
+ - topic
16270
+ - zoneId
16271
+ - accountEmail
16272
+ properties:
16273
+ status:
16274
+ type: string
16275
+ enum:
16276
+ - live
16277
+ - disabled
16278
+ topic:
16279
+ $ref: "#/components/schemas/SiteAdsTopic"
16280
+ zoneId:
16281
+ type: string
16282
+ description: The ad network zone ID
16283
+ accountEmail:
16284
+ type: string
16285
+ description: The email address linked to the Ads partner account
16103
16286
  Site:
16104
16287
  type: object
16105
16288
  properties:
@@ -16129,7 +16312,7 @@ components:
16129
16312
  type: string
16130
16313
  format: date-time
16131
16314
  ads:
16132
- $ref: "#/components/schemas/SiteAdsConfig"
16315
+ $ref: "#/components/schemas/SiteAds"
16133
16316
  urls:
16134
16317
  type: object
16135
16318
  description: URLs associated with the object
@@ -18245,6 +18428,15 @@ components:
18245
18428
  - $ref: "#/components/schemas/CustomHostnameChannel"
18246
18429
  discriminator:
18247
18430
  propertyName: channel
18431
+ SiteAdsStatus:
18432
+ type: string
18433
+ description: The status of ads on the site
18434
+ enum:
18435
+ - pending
18436
+ - in-review
18437
+ - live
18438
+ - rejected
18439
+ - disabled
18248
18440
  Seat:
18249
18441
  type: object
18250
18442
  properties: