@gitbook/api 0.42.0 → 0.43.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
@@ -2570,6 +2570,7 @@ export declare enum IntegrationScope {
2570
2570
  SpaceGitSync = "space:git:sync",
2571
2571
  SpaceVisitorAuth = "space:visitor:auth",
2572
2572
  SiteScriptInject = "site:script:inject",
2573
+ SiteScriptCookies = "site:script:cookies",
2573
2574
  SiteVisitorAuth = "site:visitor:auth"
2574
2575
  }
2575
2576
  /** A search string to filter integrations by name */
@@ -2895,6 +2896,14 @@ export interface SpaceIntegrationScript {
2895
2896
  /** If true, the script will potentially load use cookies and visitors should be aware. */
2896
2897
  cookies: boolean;
2897
2898
  }
2899
+ export interface SiteIntegrationScript {
2900
+ /** Script URL to load. */
2901
+ script: URL;
2902
+ /** Content Security Policy to secure the loading of this script. */
2903
+ contentSecurityPolicy?: string;
2904
+ /** If true, the script will potentially load use cookies and visitors should be aware. */
2905
+ cookies: boolean;
2906
+ }
2898
2907
  /** Entity to create or update in an integration's installation. */
2899
2908
  export interface UpsertEntity {
2900
2909
  /** Unique ID of the entity in the context of the integration's entity type */
@@ -8653,6 +8662,22 @@ export declare class Api<SecurityDataType extends unknown> extends HttpClient<Se
8653
8662
  message: string;
8654
8663
  };
8655
8664
  }>>;
8665
+ /**
8666
+ * No description
8667
+ *
8668
+ * @tags sites
8669
+ * @name ListSiteIntegrationScripts
8670
+ * @summary List the scripts to embed in published content for a site.
8671
+ * @request GET:/orgs/{organizationId}/sites/{siteId}/integration-scripts
8672
+ * @secure
8673
+ */
8674
+ listSiteIntegrationScripts: (organizationId: string, siteId: string, params?: RequestParams) => Promise<HttpResponse<SiteIntegrationScript[], Error | {
8675
+ error: {
8676
+ /** @format int32 */
8677
+ code: 400;
8678
+ message: string;
8679
+ };
8680
+ }>>;
8656
8681
  /**
8657
8682
  * No description
8658
8683
  *
package/dist/index.cjs CHANGED
@@ -239,7 +239,7 @@ module.exports = __toCommonJS(src_exports);
239
239
 
240
240
  // package.json
241
241
  var name = "@gitbook/api";
242
- var version = "0.42.0";
242
+ var version = "0.43.0";
243
243
 
244
244
  // src/client.ts
245
245
  var import_event_iterator = __toESM(require_node(), 1);
@@ -516,6 +516,7 @@ var IntegrationScope = /* @__PURE__ */ ((IntegrationScope2) => {
516
516
  IntegrationScope2["SpaceGitSync"] = "space:git:sync";
517
517
  IntegrationScope2["SpaceVisitorAuth"] = "space:visitor:auth";
518
518
  IntegrationScope2["SiteScriptInject"] = "site:script:inject";
519
+ IntegrationScope2["SiteScriptCookies"] = "site:script:cookies";
519
520
  IntegrationScope2["SiteVisitorAuth"] = "site:visitor:auth";
520
521
  return IntegrationScope2;
521
522
  })(IntegrationScope || {});
@@ -2888,6 +2889,13 @@ var Api = class extends HttpClient {
2888
2889
  format: "json",
2889
2890
  ...params
2890
2891
  }),
2892
+ listSiteIntegrationScripts: (organizationId, siteId, params = {}) => this.request({
2893
+ path: `/orgs/${organizationId}/sites/${siteId}/integration-scripts`,
2894
+ method: "GET",
2895
+ secure: true,
2896
+ format: "json",
2897
+ ...params
2898
+ }),
2891
2899
  addSpaceToSite: (organizationId, siteId, data, params = {}) => this.request({
2892
2900
  path: `/orgs/${organizationId}/sites/${siteId}/spaces`,
2893
2901
  method: "POST",
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.42.0";
175
+ var version = "0.43.0";
176
176
 
177
177
  // src/client.ts
178
178
  var import_event_iterator = __toESM(require_node(), 1);
@@ -449,6 +449,7 @@ var IntegrationScope = /* @__PURE__ */ ((IntegrationScope2) => {
449
449
  IntegrationScope2["SpaceGitSync"] = "space:git:sync";
450
450
  IntegrationScope2["SpaceVisitorAuth"] = "space:visitor:auth";
451
451
  IntegrationScope2["SiteScriptInject"] = "site:script:inject";
452
+ IntegrationScope2["SiteScriptCookies"] = "site:script:cookies";
452
453
  IntegrationScope2["SiteVisitorAuth"] = "site:visitor:auth";
453
454
  return IntegrationScope2;
454
455
  })(IntegrationScope || {});
@@ -2821,6 +2822,13 @@ var Api = class extends HttpClient {
2821
2822
  format: "json",
2822
2823
  ...params
2823
2824
  }),
2825
+ listSiteIntegrationScripts: (organizationId, siteId, params = {}) => this.request({
2826
+ path: `/orgs/${organizationId}/sites/${siteId}/integration-scripts`,
2827
+ method: "GET",
2828
+ secure: true,
2829
+ format: "json",
2830
+ ...params
2831
+ }),
2824
2832
  addSpaceToSite: (organizationId, siteId, data, params = {}) => this.request({
2825
2833
  path: `/orgs/${organizationId}/sites/${siteId}/spaces`,
2826
2834
  method: "POST",
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.42.0",
7
+ "version": "0.43.0",
8
8
  "sideEffects": false,
9
9
  "files": [
10
10
  "README.md",
package/spec/openapi.json CHANGED
@@ -8797,6 +8797,7 @@
8797
8797
  "space:git:sync",
8798
8798
  "space:visitor:auth",
8799
8799
  "site:script:inject",
8800
+ "site:script:cookies",
8800
8801
  "site:visitor:auth"
8801
8802
  ]
8802
8803
  },
@@ -9625,6 +9626,27 @@
9625
9626
  "cookies"
9626
9627
  ]
9627
9628
  },
9629
+ "SiteIntegrationScript": {
9630
+ "type": "object",
9631
+ "properties": {
9632
+ "script": {
9633
+ "description": "Script URL to load.",
9634
+ "$ref": "#/components/schemas/URL"
9635
+ },
9636
+ "contentSecurityPolicy": {
9637
+ "description": "Content Security Policy to secure the loading of this script.",
9638
+ "type": "string"
9639
+ },
9640
+ "cookies": {
9641
+ "type": "boolean",
9642
+ "description": "If true, the script will potentially load use cookies and visitors should be aware."
9643
+ }
9644
+ },
9645
+ "required": [
9646
+ "script",
9647
+ "cookies"
9648
+ ]
9649
+ },
9628
9650
  "UpsertEntity": {
9629
9651
  "type": "object",
9630
9652
  "description": "Entity to create or update in an integration's installation.",
@@ -28086,6 +28108,49 @@
28086
28108
  }
28087
28109
  }
28088
28110
  },
28111
+ "/orgs/{organizationId}/sites/{siteId}/integration-scripts": {
28112
+ "get": {
28113
+ "operationId": "listSiteIntegrationScripts",
28114
+ "summary": "List the scripts to embed in published content for a site.",
28115
+ "tags": [
28116
+ "sites"
28117
+ ],
28118
+ "security": [
28119
+ {
28120
+ "user": []
28121
+ }
28122
+ ],
28123
+ "parameters": [
28124
+ {
28125
+ "$ref": "#/components/parameters/organizationId"
28126
+ },
28127
+ {
28128
+ "$ref": "#/components/parameters/siteId"
28129
+ }
28130
+ ],
28131
+ "responses": {
28132
+ "200": {
28133
+ "description": "OK",
28134
+ "content": {
28135
+ "application/json": {
28136
+ "schema": {
28137
+ "type": "array",
28138
+ "items": {
28139
+ "$ref": "#/components/schemas/SiteIntegrationScript"
28140
+ }
28141
+ }
28142
+ }
28143
+ }
28144
+ },
28145
+ "400": {
28146
+ "$ref": "#/components/responses/BadRequestError"
28147
+ },
28148
+ "default": {
28149
+ "$ref": "#/components/responses/UnexpectedError"
28150
+ }
28151
+ }
28152
+ }
28153
+ },
28089
28154
  "/orgs/{organizationId}/sites/{siteId}/spaces": {
28090
28155
  "post": {
28091
28156
  "operationId": "addSpaceToSite",
package/spec/openapi.yaml CHANGED
@@ -5891,6 +5891,7 @@ components:
5891
5891
  - space:git:sync
5892
5892
  - space:visitor:auth
5893
5893
  - site:script:inject
5894
+ - site:script:cookies
5894
5895
  - site:visitor:auth
5895
5896
  IntegrationSearchQuery:
5896
5897
  name: search
@@ -6468,6 +6469,21 @@ components:
6468
6469
  required:
6469
6470
  - script
6470
6471
  - cookies
6472
+ SiteIntegrationScript:
6473
+ type: object
6474
+ properties:
6475
+ script:
6476
+ description: Script URL to load.
6477
+ $ref: "#/components/schemas/URL"
6478
+ contentSecurityPolicy:
6479
+ description: Content Security Policy to secure the loading of this script.
6480
+ type: string
6481
+ cookies:
6482
+ type: boolean
6483
+ description: If true, the script will potentially load use cookies and visitors should be aware.
6484
+ required:
6485
+ - script
6486
+ - cookies
6471
6487
  UpsertEntity:
6472
6488
  type: object
6473
6489
  description: Entity to create or update in an integration's installation.
@@ -17294,6 +17310,30 @@ paths:
17294
17310
  $ref: "#/components/responses/BadRequestError"
17295
17311
  default:
17296
17312
  $ref: "#/components/responses/UnexpectedError"
17313
+ "/orgs/{organizationId}/sites/{siteId}/integration-scripts":
17314
+ get:
17315
+ operationId: listSiteIntegrationScripts
17316
+ summary: List the scripts to embed in published content for a site.
17317
+ tags:
17318
+ - sites
17319
+ security:
17320
+ - user: []
17321
+ parameters:
17322
+ - $ref: "#/components/parameters/organizationId"
17323
+ - $ref: "#/components/parameters/siteId"
17324
+ responses:
17325
+ "200":
17326
+ description: OK
17327
+ content:
17328
+ application/json:
17329
+ schema:
17330
+ type: array
17331
+ items:
17332
+ $ref: "#/components/schemas/SiteIntegrationScript"
17333
+ "400":
17334
+ $ref: "#/components/responses/BadRequestError"
17335
+ default:
17336
+ $ref: "#/components/responses/UnexpectedError"
17297
17337
  "/orgs/{organizationId}/sites/{siteId}/spaces":
17298
17338
  post:
17299
17339
  operationId: addSpaceToSite