@gitbook/api 0.63.0 → 0.64.1

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/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.63.0";
175
+ var version = "0.64.1";
176
176
 
177
177
  // src/client.ts
178
178
  var import_event_iterator = __toESM(require_node(), 1);
@@ -430,17 +430,17 @@ var IntegrationCategory = /* @__PURE__ */ ((IntegrationCategory2) => {
430
430
  IntegrationCategory2["Other"] = "other";
431
431
  return IntegrationCategory2;
432
432
  })(IntegrationCategory || {});
433
- var ChangeRequestReviewStatus = /* @__PURE__ */ ((ChangeRequestReviewStatus2) => {
434
- ChangeRequestReviewStatus2["ChangesRequested"] = "changes-requested";
435
- ChangeRequestReviewStatus2["Approved"] = "approved";
436
- return ChangeRequestReviewStatus2;
437
- })(ChangeRequestReviewStatus || {});
438
433
  var ContentReferenceStatus = /* @__PURE__ */ ((ContentReferenceStatus2) => {
439
434
  ContentReferenceStatus2["Ok"] = "ok";
440
435
  ContentReferenceStatus2["Broken"] = "broken";
441
436
  ContentReferenceStatus2["InApp"] = "in-app";
442
437
  return ContentReferenceStatus2;
443
438
  })(ContentReferenceStatus || {});
439
+ var ChangeRequestReviewStatus = /* @__PURE__ */ ((ChangeRequestReviewStatus2) => {
440
+ ChangeRequestReviewStatus2["ChangesRequested"] = "changes-requested";
441
+ ChangeRequestReviewStatus2["Approved"] = "approved";
442
+ return ChangeRequestReviewStatus2;
443
+ })(ChangeRequestReviewStatus || {});
444
444
  var RevisionPageType = /* @__PURE__ */ ((RevisionPageType2) => {
445
445
  RevisionPageType2["Document"] = "document";
446
446
  RevisionPageType2["Group"] = "group";
@@ -583,7 +583,7 @@ var BillingInterval = /* @__PURE__ */ ((BillingInterval2) => {
583
583
  var SiteType = /* @__PURE__ */ ((SiteType2) => {
584
584
  SiteType2["Basic"] = "basic";
585
585
  SiteType2["Premium"] = "premium";
586
- SiteType2["Audience"] = "audience";
586
+ SiteType2["Ultimate"] = "ultimate";
587
587
  SiteType2["LegacyBasic"] = "legacy-basic";
588
588
  SiteType2["LegacyPremium"] = "legacy-premium";
589
589
  return SiteType2;
@@ -709,163 +709,26 @@ var ContentType = /* @__PURE__ */ ((ContentType2) => {
709
709
  return ContentType2;
710
710
  })(ContentType || {});
711
711
  var HttpClient = class {
712
+ baseUrl = "{host}/v1";
713
+ securityData = null;
714
+ securityWorker;
715
+ abortControllers = /* @__PURE__ */ new Map();
716
+ customFetch = (...fetchParams) => fetch(...fetchParams);
717
+ baseApiParams = {
718
+ credentials: "same-origin",
719
+ headers: {},
720
+ redirect: "follow",
721
+ referrerPolicy: "no-referrer"
722
+ };
712
723
  constructor(apiConfig = {}) {
713
- this.baseUrl = "{host}/v1";
714
- this.securityData = null;
715
- this.abortControllers = /* @__PURE__ */ new Map();
716
- this.customFetch = (...fetchParams) => fetch(...fetchParams);
717
- this.baseApiParams = {
718
- credentials: "same-origin",
719
- headers: {},
720
- redirect: "follow",
721
- referrerPolicy: "no-referrer"
722
- };
723
- this.setSecurityData = (data) => {
724
- this.securityData = data;
725
- };
726
- this.contentFormatters = {
727
- ["application/json" /* Json */]: (input) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input,
728
- ["text/plain" /* Text */]: (input) => input !== null && typeof input !== "string" ? JSON.stringify(input) : input,
729
- ["multipart/form-data" /* FormData */]: (input) => Object.keys(input || {}).reduce((formData, key) => {
730
- const property = input[key];
731
- formData.append(
732
- key,
733
- property instanceof Blob ? property : typeof property === "object" && property !== null ? JSON.stringify(property) : `${property}`
734
- );
735
- return formData;
736
- }, new FormData()),
737
- ["application/x-www-form-urlencoded" /* UrlEncoded */]: (input) => this.toQueryString(input)
738
- };
739
- this.createAbortSignal = (cancelToken) => {
740
- if (this.abortControllers.has(cancelToken)) {
741
- const abortController2 = this.abortControllers.get(cancelToken);
742
- if (abortController2) {
743
- return abortController2.signal;
744
- }
745
- return void 0;
746
- }
747
- const abortController = new AbortController();
748
- this.abortControllers.set(cancelToken, abortController);
749
- return abortController.signal;
750
- };
751
- this.abortRequest = (cancelToken) => {
752
- const abortController = this.abortControllers.get(cancelToken);
753
- if (abortController) {
754
- abortController.abort();
755
- this.abortControllers.delete(cancelToken);
756
- }
757
- };
758
- this.request = async ({
759
- body,
760
- secure,
761
- path,
762
- type,
763
- query,
764
- format,
765
- baseUrl,
766
- cancelToken,
767
- ...params
768
- }) => {
769
- const secureParams = (typeof secure === "boolean" ? secure : this.baseApiParams.secure) && this.securityWorker && await this.securityWorker(this.securityData) || {};
770
- const requestParams = this.mergeRequestParams(params, secureParams);
771
- const queryString = query && this.toQueryString(query);
772
- const payloadFormatter = this.contentFormatters[type || "application/json" /* Json */];
773
- const responseFormat = format || requestParams.format;
774
- return this.customFetch(
775
- `${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`,
776
- {
777
- ...requestParams,
778
- headers: {
779
- ...requestParams.headers || {},
780
- ...type && type !== "multipart/form-data" /* FormData */ ? { "Content-Type": type } : {}
781
- },
782
- signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null,
783
- body: typeof body === "undefined" || body === null ? null : payloadFormatter(body)
784
- }
785
- ).then(async (response) => {
786
- const r = response;
787
- r.data = null;
788
- r.error = null;
789
- const data = !responseFormat ? r : await response[responseFormat]().then((data2) => {
790
- if (r.ok) {
791
- r.data = data2;
792
- } else {
793
- throw new Error(`${response.status} ${response.statusText}`);
794
- }
795
- return r;
796
- });
797
- if (cancelToken) {
798
- this.abortControllers.delete(cancelToken);
799
- }
800
- if (!response.ok)
801
- throw new Error(`${response.status} ${response.statusText}`);
802
- return data;
803
- });
804
- };
805
- this.streamRequest = function({
806
- path,
807
- baseUrl,
808
- cancelToken,
809
- secure,
810
- ...params
811
- }) {
812
- return new import_event_iterator.EventIterator((queue) => {
813
- (async () => {
814
- const secureParams = (typeof secure === "boolean" ? secure : this.baseApiParams.secure) && this.securityWorker && await this.securityWorker(this.securityData) || {};
815
- const { query: requestQuery, ...requestParams } = this.mergeRequestParams(
816
- params,
817
- secureParams
818
- );
819
- const queryString = requestQuery ? this.toQueryString(requestQuery) : void 0;
820
- const response = await this.customFetch(
821
- `${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`,
822
- {
823
- ...requestParams,
824
- signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal
825
- }
826
- );
827
- if (!response.ok) {
828
- throw new Error(`${response.status} ${response.statusText}`);
829
- return;
830
- }
831
- const reader = response.body.getReader();
832
- const stop = () => {
833
- reader.cancel();
834
- queue.stop();
835
- };
836
- const parser = createParser((event) => {
837
- if (event.type === "event") {
838
- if (event.data === "done") {
839
- stop();
840
- } else {
841
- const data = JSON.parse(event.data);
842
- queue.push(data);
843
- }
844
- }
845
- });
846
- const decoder = new TextDecoder();
847
- while (true) {
848
- const { done, value } = await reader.read();
849
- if (value) {
850
- parser.feed(decoder.decode(value));
851
- }
852
- if (done) {
853
- break;
854
- }
855
- }
856
- stop();
857
- })().catch((error) => {
858
- queue.fail(error);
859
- });
860
- });
861
- };
862
724
  Object.assign(this, apiConfig);
863
725
  }
726
+ setSecurityData = (data) => {
727
+ this.securityData = data;
728
+ };
864
729
  encodeQueryParam(key, value) {
865
730
  const encodedKey = encodeURIComponent(key);
866
- return `${encodedKey}=${encodeURIComponent(
867
- typeof value === "number" ? value : `${value}`
868
- )}`;
731
+ return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`;
869
732
  }
870
733
  addQueryParam(query, key) {
871
734
  return this.encodeQueryParam(key, query[key]);
@@ -885,6 +748,19 @@ var HttpClient = class {
885
748
  const queryString = this.toQueryString(rawQuery);
886
749
  return queryString ? `?${queryString}` : "";
887
750
  }
751
+ contentFormatters = {
752
+ ["application/json" /* Json */]: (input) => input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input,
753
+ ["text/plain" /* Text */]: (input) => input !== null && typeof input !== "string" ? JSON.stringify(input) : input,
754
+ ["multipart/form-data" /* FormData */]: (input) => Object.keys(input || {}).reduce((formData, key) => {
755
+ const property = input[key];
756
+ formData.append(
757
+ key,
758
+ property instanceof Blob ? property : typeof property === "object" && property !== null ? JSON.stringify(property) : `${property}`
759
+ );
760
+ return formData;
761
+ }, new FormData()),
762
+ ["application/x-www-form-urlencoded" /* UrlEncoded */]: (input) => this.toQueryString(input)
763
+ };
888
764
  mergeRequestParams(params1, params2) {
889
765
  return {
890
766
  ...this.baseApiParams,
@@ -897,2255 +773,2441 @@ var HttpClient = class {
897
773
  }
898
774
  };
899
775
  }
776
+ createAbortSignal = (cancelToken) => {
777
+ if (this.abortControllers.has(cancelToken)) {
778
+ const abortController2 = this.abortControllers.get(cancelToken);
779
+ if (abortController2) {
780
+ return abortController2.signal;
781
+ }
782
+ return void 0;
783
+ }
784
+ const abortController = new AbortController();
785
+ this.abortControllers.set(cancelToken, abortController);
786
+ return abortController.signal;
787
+ };
788
+ abortRequest = (cancelToken) => {
789
+ const abortController = this.abortControllers.get(cancelToken);
790
+ if (abortController) {
791
+ abortController.abort();
792
+ this.abortControllers.delete(cancelToken);
793
+ }
794
+ };
795
+ request = async ({
796
+ body,
797
+ secure,
798
+ path,
799
+ type,
800
+ query,
801
+ format,
802
+ baseUrl,
803
+ cancelToken,
804
+ ...params
805
+ }) => {
806
+ const secureParams = (typeof secure === "boolean" ? secure : this.baseApiParams.secure) && this.securityWorker && await this.securityWorker(this.securityData) || {};
807
+ const requestParams = this.mergeRequestParams(params, secureParams);
808
+ const queryString = query && this.toQueryString(query);
809
+ const payloadFormatter = this.contentFormatters[type || "application/json" /* Json */];
810
+ const responseFormat = format || requestParams.format;
811
+ return this.customFetch(
812
+ `${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`,
813
+ {
814
+ ...requestParams,
815
+ headers: {
816
+ ...requestParams.headers || {},
817
+ ...type && type !== "multipart/form-data" /* FormData */ ? { "Content-Type": type } : {}
818
+ },
819
+ signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null,
820
+ body: typeof body === "undefined" || body === null ? null : payloadFormatter(body)
821
+ }
822
+ ).then(async (response) => {
823
+ const r = response;
824
+ r.data = null;
825
+ r.error = null;
826
+ const data = !responseFormat ? r : await response[responseFormat]().then((data2) => {
827
+ if (r.ok) {
828
+ r.data = data2;
829
+ } else {
830
+ throw new Error(`${response.status} ${response.statusText}`);
831
+ }
832
+ return r;
833
+ });
834
+ if (cancelToken) {
835
+ this.abortControllers.delete(cancelToken);
836
+ }
837
+ if (!response.ok)
838
+ throw new Error(`${response.status} ${response.statusText}`);
839
+ return data;
840
+ });
841
+ };
842
+ streamRequest = ({
843
+ path,
844
+ baseUrl,
845
+ cancelToken,
846
+ secure,
847
+ ...params
848
+ }) => {
849
+ return new import_event_iterator.EventIterator((queue) => {
850
+ (async () => {
851
+ const secureParams = (typeof secure === "boolean" ? secure : this.baseApiParams.secure) && this.securityWorker && await this.securityWorker(this.securityData) || {};
852
+ const requestQuery = params.query;
853
+ const requestParams = this.mergeRequestParams(params, secureParams);
854
+ const queryString = requestQuery ? this.toQueryString(requestQuery) : void 0;
855
+ const response = await this.customFetch(
856
+ `${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`,
857
+ {
858
+ ...requestParams,
859
+ signal: cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal
860
+ }
861
+ );
862
+ if (!response.ok) {
863
+ throw new Error(`${response.status} ${response.statusText}`);
864
+ }
865
+ if (!response.body) {
866
+ throw new Error("Response body is empty");
867
+ }
868
+ const reader = response.body.getReader();
869
+ const stop = () => {
870
+ reader.cancel();
871
+ queue.stop();
872
+ };
873
+ const parser = createParser((event) => {
874
+ if (event.type === "event") {
875
+ if (event.data === "done") {
876
+ stop();
877
+ } else {
878
+ const data = JSON.parse(event.data);
879
+ queue.push(data);
880
+ }
881
+ }
882
+ });
883
+ const decoder = new TextDecoder();
884
+ while (true) {
885
+ const { done, value } = await reader.read();
886
+ if (value) {
887
+ parser.feed(decoder.decode(value));
888
+ }
889
+ if (done) {
890
+ break;
891
+ }
892
+ }
893
+ stop();
894
+ })().catch((error) => {
895
+ queue.fail(error);
896
+ });
897
+ });
898
+ };
900
899
  };
901
900
  var Api = class extends HttpClient {
902
- constructor() {
903
- super(...arguments);
904
- this.getApiInformation = (params = {}) => this.request({
905
- path: `/`,
901
+ getApiInformation = (params = {}) => this.request({
902
+ path: `/`,
903
+ method: "GET",
904
+ secure: true,
905
+ format: "json",
906
+ ...params
907
+ });
908
+ search = {
909
+ searchContent: (query, params = {}) => this.request({
910
+ path: `/search`,
906
911
  method: "GET",
912
+ query,
907
913
  secure: true,
908
914
  format: "json",
909
915
  ...params
910
- });
911
- this.search = {
912
- searchContent: (query, params = {}) => this.request({
913
- path: `/search`,
914
- method: "GET",
915
- query,
916
- secure: true,
917
- format: "json",
918
- ...params
919
- }),
920
- askQueryWithGet: (query, params = {}) => this.request({
921
- path: `/search/ask`,
922
- method: "GET",
923
- query,
924
- secure: true,
925
- format: "json",
926
- ...params
927
- }),
928
- askQuery: (data, query, params = {}) => this.request({
929
- path: `/search/ask`,
930
- method: "POST",
931
- query,
932
- body: data,
933
- secure: true,
934
- type: "application/json" /* Json */,
935
- format: "json",
936
- ...params
937
- }),
938
- getRecommendedQuestions: (data, params = {}) => this.request({
939
- path: `/search/questions`,
940
- method: "POST",
941
- body: data,
942
- secure: true,
943
- type: "application/json" /* Json */,
944
- format: "json",
945
- ...params
946
- })
947
- };
948
- this.user = {
949
- getAuthenticatedUser: (params = {}) => this.request({
950
- path: `/user`,
951
- method: "GET",
952
- secure: true,
953
- format: "json",
954
- ...params
955
- })
956
- };
957
- this.users = {
958
- getUserById: (userId, params = {}) => this.request({
959
- path: `/users/${userId}`,
960
- method: "GET",
961
- secure: true,
962
- format: "json",
963
- ...params
964
- })
965
- };
966
- this.spaces = {
967
- getSpaceById: (spaceId, query, params = {}) => this.request({
968
- path: `/spaces/${spaceId}`,
969
- method: "GET",
970
- query,
971
- secure: true,
972
- format: "json",
973
- ...params
974
- }),
975
- updateSpaceById: (spaceId, data, params = {}) => this.request({
976
- path: `/spaces/${spaceId}`,
977
- method: "PATCH",
978
- body: data,
979
- secure: true,
980
- type: "application/json" /* Json */,
981
- format: "json",
982
- ...params
983
- }),
984
- deleteSpaceById: (spaceId, params = {}) => this.request({
985
- path: `/spaces/${spaceId}`,
986
- method: "DELETE",
987
- secure: true,
988
- ...params
989
- }),
990
- duplicateSpace: (spaceId, params = {}) => this.request({
991
- path: `/spaces/${spaceId}/duplicate`,
992
- method: "POST",
993
- secure: true,
994
- format: "json",
995
- ...params
996
- }),
997
- restoreSpace: (spaceId, params = {}) => this.request({
998
- path: `/spaces/${spaceId}/restore`,
999
- method: "POST",
1000
- secure: true,
1001
- format: "json",
1002
- ...params
1003
- }),
1004
- moveSpace: (spaceId, data, params = {}) => this.request({
1005
- path: `/spaces/${spaceId}/move`,
1006
- method: "POST",
1007
- body: data,
1008
- secure: true,
1009
- type: "application/json" /* Json */,
1010
- format: "json",
1011
- ...params
1012
- }),
1013
- transferSpace: (spaceId, data, params = {}) => this.request({
1014
- path: `/spaces/${spaceId}/transfer`,
1015
- method: "POST",
1016
- body: data,
1017
- secure: true,
1018
- type: "application/json" /* Json */,
1019
- format: "json",
1020
- ...params
1021
- }),
1022
- getEmbedByUrlInSpace: (spaceId, query, params = {}) => this.request({
1023
- path: `/spaces/${spaceId}/embed`,
1024
- method: "GET",
1025
- query,
1026
- secure: true,
1027
- format: "json",
1028
- ...params
1029
- }),
1030
- searchSpaceContent: (spaceId, query, params = {}) => this.request({
1031
- path: `/spaces/${spaceId}/search`,
1032
- method: "GET",
1033
- query,
1034
- secure: true,
1035
- format: "json",
1036
- ...params
1037
- }),
1038
- askQueryInSpaceWithGet: (spaceId, query, params = {}) => this.request({
1039
- path: `/spaces/${spaceId}/search/ask`,
1040
- method: "GET",
1041
- query,
1042
- secure: true,
1043
- format: "json",
1044
- ...params
1045
- }),
1046
- askQueryInSpace: (spaceId, data, query, params = {}) => this.request({
1047
- path: `/spaces/${spaceId}/search/ask`,
1048
- method: "POST",
1049
- query,
1050
- body: data,
1051
- secure: true,
1052
- type: "application/json" /* Json */,
1053
- format: "json",
1054
- ...params
1055
- }),
1056
- streamAskInSpace: (spaceId, query, params = {}) => this.streamRequest({
1057
- path: `/spaces/${spaceId}/search/ask/stream`,
1058
- method: "GET",
1059
- query,
1060
- secure: true,
1061
- ...params
1062
- }),
1063
- getRecommendedQuestionsInSpace: (spaceId, params = {}) => this.request({
1064
- path: `/spaces/${spaceId}/search/questions`,
1065
- method: "GET",
1066
- secure: true,
1067
- format: "json",
1068
- ...params
1069
- }),
1070
- streamRecommendedQuestionsInSpace: (spaceId, params = {}) => this.streamRequest({
1071
- path: `/spaces/${spaceId}/search/questions/stream`,
1072
- method: "GET",
1073
- secure: true,
1074
- ...params
1075
- }),
1076
- importGitRepository: (spaceId, data, params = {}) => this.request({
1077
- path: `/spaces/${spaceId}/git/import`,
1078
- method: "POST",
1079
- body: data,
1080
- secure: true,
1081
- type: "application/json" /* Json */,
1082
- ...params
1083
- }),
1084
- exportToGitRepository: (spaceId, data, params = {}) => this.request({
1085
- path: `/spaces/${spaceId}/git/export`,
1086
- method: "POST",
1087
- body: data,
1088
- secure: true,
1089
- type: "application/json" /* Json */,
1090
- ...params
1091
- }),
1092
- syncGitRepository: (spaceId, data, params = {}) => this.request({
1093
- path: `/spaces/${spaceId}/git/sync`,
1094
- method: "POST",
1095
- body: data,
1096
- secure: true,
1097
- type: "application/json" /* Json */,
1098
- ...params
1099
- }),
1100
- getSpaceGitInfo: (spaceId, params = {}) => this.request({
1101
- path: `/spaces/${spaceId}/git/info`,
1102
- method: "GET",
1103
- secure: true,
1104
- format: "json",
1105
- ...params
1106
- }),
1107
- getContentAnalyticsForSpaceById: (spaceId, params = {}) => this.request({
1108
- path: `/spaces/${spaceId}/insights/content`,
1109
- method: "GET",
1110
- secure: true,
1111
- format: "json",
1112
- ...params
1113
- }),
1114
- getSearchAnalyticsForSpaceById: (spaceId, query, params = {}) => this.request({
1115
- path: `/spaces/${spaceId}/insights/search`,
1116
- method: "GET",
1117
- query,
1118
- secure: true,
1119
- format: "json",
1120
- ...params
1121
- }),
1122
- getTrafficAnalyticsForSpaceById: (spaceId, query, params = {}) => this.request({
1123
- path: `/spaces/${spaceId}/insights/traffic`,
1124
- method: "GET",
1125
- query,
1126
- secure: true,
1127
- format: "json",
1128
- ...params
1129
- }),
1130
- trackViewInSpaceById: (spaceId, data, params = {}) => this.request({
1131
- path: `/spaces/${spaceId}/insights/track_view`,
1132
- method: "POST",
1133
- body: data,
1134
- secure: true,
1135
- type: "application/json" /* Json */,
1136
- ...params
1137
- }),
1138
- inviteToSpace: (spaceId, data, params = {}) => this.request({
1139
- path: `/spaces/${spaceId}/permissions`,
1140
- method: "POST",
1141
- body: data,
1142
- secure: true,
1143
- type: "application/json" /* Json */,
1144
- ...params
1145
- }),
1146
- removeTeamFromSpace: (spaceId, teamId, params = {}) => this.request({
1147
- path: `/spaces/${spaceId}/permissions/teams/${teamId}`,
1148
- method: "DELETE",
1149
- secure: true,
1150
- ...params
1151
- }),
1152
- getCurrentRevision: (spaceId, query, params = {}) => this.request({
1153
- path: `/spaces/${spaceId}/content`,
1154
- method: "GET",
1155
- query,
1156
- secure: true,
1157
- format: "json",
1158
- ...params
1159
- }),
1160
- importContent: (spaceId, data, params = {}) => this.request({
1161
- path: `/spaces/${spaceId}/content/import`,
1162
- method: "POST",
1163
- body: data,
1164
- secure: true,
1165
- type: "application/json" /* Json */,
1166
- format: "json",
1167
- ...params
1168
- }),
1169
- listPages: (spaceId, query, params = {}) => this.request({
1170
- path: `/spaces/${spaceId}/content/pages`,
1171
- method: "GET",
1172
- query,
1173
- secure: true,
1174
- format: "json",
1175
- ...params
1176
- }),
1177
- listFiles: (spaceId, query, params = {}) => this.request({
1178
- path: `/spaces/${spaceId}/content/files`,
1179
- method: "GET",
1180
- query,
1181
- secure: true,
1182
- format: "json",
1183
- ...params
1184
- }),
1185
- getFileById: (spaceId, fileId, query, params = {}) => this.request({
1186
- path: `/spaces/${spaceId}/content/files/${fileId}`,
1187
- method: "GET",
1188
- query,
1189
- secure: true,
1190
- format: "json",
1191
- ...params
1192
- }),
1193
- listSpaceFileBacklinks: (spaceId, fileId, query, params = {}) => this.request({
1194
- path: `/spaces/${spaceId}/content/files/${fileId}/backlinks`,
1195
- method: "GET",
1196
- query,
1197
- secure: true,
1198
- format: "json",
1199
- ...params
1200
- }),
1201
- getPageById: (spaceId, pageId, query, params = {}) => this.request({
1202
- path: `/spaces/${spaceId}/content/page/${pageId}`,
1203
- method: "GET",
1204
- query,
1205
- secure: true,
1206
- format: "json",
1207
- ...params
1208
- }),
1209
- listSpacePageBacklinks: (spaceId, pageId, query, params = {}) => this.request({
1210
- path: `/spaces/${spaceId}/content/pages/${pageId}/backlinks`,
1211
- method: "GET",
1212
- query,
1213
- secure: true,
1214
- format: "json",
1215
- ...params
1216
- }),
1217
- importContentInPageById: (spaceId, pageId, data, params = {}) => this.request({
1218
- path: `/spaces/${spaceId}/content/page/${pageId}/import`,
1219
- method: "POST",
1220
- body: data,
1221
- secure: true,
1222
- type: "application/json" /* Json */,
1223
- format: "json",
1224
- ...params
1225
- }),
1226
- getPageByPath: (spaceId, pagePath, query, params = {}) => this.request({
1227
- path: `/spaces/${spaceId}/content/path/${pagePath}`,
1228
- method: "GET",
1229
- query,
1230
- secure: true,
1231
- format: "json",
1232
- ...params
1233
- }),
1234
- getDocumentById: (spaceId, documentId, query, params = {}) => this.request({
1235
- path: `/spaces/${spaceId}/documents/${documentId}`,
1236
- method: "GET",
1237
- query,
1238
- secure: true,
1239
- format: "json",
1240
- ...params
1241
- }),
1242
- createChangeRequest: (spaceId, data, params = {}) => this.request({
1243
- path: `/spaces/${spaceId}/change-requests`,
1244
- method: "POST",
1245
- body: data,
1246
- secure: true,
1247
- type: "application/json" /* Json */,
1248
- format: "json",
1249
- ...params
1250
- }),
1251
- listChangeRequestsForSpace: (spaceId, query, params = {}) => this.request({
1252
- path: `/spaces/${spaceId}/change-requests`,
1253
- method: "GET",
1254
- query,
1255
- secure: true,
1256
- format: "json",
1257
- ...params
1258
- }),
1259
- getChangeRequestById: (spaceId, changeRequestId, params = {}) => this.request({
1260
- path: `/spaces/${spaceId}/change-requests/${changeRequestId}`,
1261
- method: "GET",
1262
- secure: true,
1263
- format: "json",
1264
- ...params
1265
- }),
1266
- updateChangeRequestById: (spaceId, changeRequestId, data, params = {}) => this.request({
1267
- path: `/spaces/${spaceId}/change-requests/${changeRequestId}`,
1268
- method: "PATCH",
1269
- body: data,
1270
- secure: true,
1271
- type: "application/json" /* Json */,
1272
- format: "json",
1273
- ...params
1274
- }),
1275
- mergeChangeRequest: (spaceId, changeRequestId, params = {}) => this.request({
1276
- path: `/spaces/${spaceId}/change-requests/${changeRequestId}/merge`,
1277
- method: "POST",
1278
- secure: true,
1279
- format: "json",
1280
- ...params
1281
- }),
1282
- updateChangeRequest: (spaceId, changeRequestId, params = {}) => this.request({
1283
- path: `/spaces/${spaceId}/change-requests/${changeRequestId}/update`,
1284
- method: "POST",
1285
- secure: true,
1286
- format: "json",
1287
- ...params
1288
- }),
1289
- getReviewsByChangeRequestId: (spaceId, changeRequestId, query, params = {}) => this.request({
1290
- path: `/spaces/${spaceId}/change-requests/${changeRequestId}/reviews`,
1291
- method: "GET",
1292
- query,
1293
- secure: true,
1294
- format: "json",
1295
- ...params
1296
- }),
1297
- submitChangeRequestReview: (spaceId, changeRequestId, data, params = {}) => this.request({
1298
- path: `/spaces/${spaceId}/change-requests/${changeRequestId}/reviews`,
1299
- method: "POST",
1300
- body: data,
1301
- secure: true,
1302
- type: "application/json" /* Json */,
1303
- format: "json",
1304
- ...params
1305
- }),
1306
- getRequestedReviewersByChangeRequestId: (spaceId, changeRequestId, query, params = {}) => this.request({
1307
- path: `/spaces/${spaceId}/change-requests/${changeRequestId}/requested-reviewers`,
1308
- method: "GET",
1309
- query,
1310
- secure: true,
1311
- format: "json",
1312
- ...params
1313
- }),
1314
- requestReviewersForChangeRequest: (spaceId, changeRequestId, data, params = {}) => this.request({
1315
- path: `/spaces/${spaceId}/change-requests/${changeRequestId}/requested-reviewers`,
1316
- method: "POST",
1317
- body: data,
1318
- secure: true,
1319
- type: "application/json" /* Json */,
1320
- format: "json",
1321
- ...params
1322
- }),
1323
- listChangeRequestLinks: (spaceId, changeRequestId, query, params = {}) => this.request({
1324
- path: `/spaces/${spaceId}/change-requests/${changeRequestId}/links`,
1325
- method: "GET",
1326
- query,
1327
- secure: true,
1328
- format: "json",
1329
- ...params
1330
- }),
1331
- listCommentsInChangeRequest: (spaceId, changeRequestId, query, params = {}) => this.request({
1332
- path: `/spaces/${spaceId}/change-requests/${changeRequestId}/comments`,
1333
- method: "GET",
1334
- query,
1335
- secure: true,
1336
- format: "json",
1337
- ...params
1338
- }),
1339
- postCommentInChangeRequest: (spaceId, changeRequestId, data, params = {}) => this.request({
1340
- path: `/spaces/${spaceId}/change-requests/${changeRequestId}/comments`,
1341
- method: "POST",
1342
- body: data,
1343
- secure: true,
1344
- type: "application/json" /* Json */,
1345
- format: "json",
1346
- ...params
1347
- }),
1348
- getCommentInChangeRequest: (spaceId, changeRequestId, commentId, query, params = {}) => this.request({
1349
- path: `/spaces/${spaceId}/change-requests/${changeRequestId}/comments/${commentId}`,
1350
- method: "GET",
1351
- query,
1352
- secure: true,
1353
- format: "json",
1354
- ...params
1355
- }),
1356
- deleteCommentInChangeRequest: (spaceId, changeRequestId, commentId, params = {}) => this.request({
1357
- path: `/spaces/${spaceId}/change-requests/${changeRequestId}/comments/${commentId}`,
1358
- method: "DELETE",
1359
- secure: true,
1360
- ...params
1361
- }),
1362
- updateCommentInChangeRequest: (spaceId, changeRequestId, commentId, data, params = {}) => this.request({
1363
- path: `/spaces/${spaceId}/change-requests/${changeRequestId}/comments/${commentId}`,
1364
- method: "PUT",
1365
- body: data,
1366
- secure: true,
1367
- type: "application/json" /* Json */,
1368
- format: "json",
1369
- ...params
1370
- }),
1371
- listCommentRepliesInChangeRequest: (spaceId, changeRequestId, commentId, query, params = {}) => this.request({
1372
- path: `/spaces/${spaceId}/change-requests/${changeRequestId}/comments/${commentId}/replies`,
1373
- method: "GET",
1374
- query,
1375
- secure: true,
1376
- format: "json",
1377
- ...params
1378
- }),
1379
- postCommentReplyInChangeRequest: (spaceId, changeRequestId, commentId, data, query, params = {}) => this.request({
1380
- path: `/spaces/${spaceId}/change-requests/${changeRequestId}/comments/${commentId}/replies`,
1381
- method: "POST",
1382
- query,
1383
- body: data,
1384
- secure: true,
1385
- type: "application/json" /* Json */,
1386
- format: "json",
1387
- ...params
1388
- }),
1389
- getCommentReplyInChangeRequest: (spaceId, changeRequestId, commentId, commentReplyId, query, params = {}) => this.request({
1390
- path: `/spaces/${spaceId}/change-requests/${changeRequestId}/comments/${commentId}/replies/${commentReplyId}`,
1391
- method: "GET",
1392
- query,
1393
- secure: true,
1394
- format: "json",
1395
- ...params
1396
- }),
1397
- updateCommentReplyInChangeRequest: (spaceId, changeRequestId, commentId, commentReplyId, data, params = {}) => this.request({
1398
- path: `/spaces/${spaceId}/change-requests/${changeRequestId}/comments/${commentId}/replies/${commentReplyId}`,
1399
- method: "PUT",
1400
- body: data,
1401
- secure: true,
1402
- type: "application/json" /* Json */,
1403
- format: "json",
1404
- ...params
1405
- }),
1406
- deleteCommentReplyInChangeRequest: (spaceId, changeRequestId, commentId, commentReplyId, params = {}) => this.request({
1407
- path: `/spaces/${spaceId}/change-requests/${changeRequestId}/comments/${commentId}/replies/${commentReplyId}`,
1408
- method: "DELETE",
1409
- secure: true,
1410
- ...params
1411
- }),
1412
- getContributorsByChangeRequestId: (spaceId, changeRequestId, params = {}) => this.request({
1413
- path: `/spaces/${spaceId}/change-requests/${changeRequestId}/contributors`,
1414
- method: "GET",
1415
- secure: true,
1416
- format: "json",
1417
- ...params
1418
- }),
1419
- getRevisionOfChangeRequestById: (spaceId, changeRequestId, query, params = {}) => this.request({
1420
- path: `/spaces/${spaceId}/change-requests/${changeRequestId}/content`,
1421
- method: "GET",
1422
- query,
1423
- secure: true,
1424
- format: "json",
1425
- ...params
1426
- }),
1427
- importContentInChangeRequest: (spaceId, changeRequestId, data, params = {}) => this.request({
1428
- path: `/spaces/${spaceId}/change-requests/${changeRequestId}/content/import`,
1429
- method: "POST",
1430
- body: data,
1431
- secure: true,
1432
- type: "application/json" /* Json */,
1433
- format: "json",
1434
- ...params
1435
- }),
1436
- listPagesInChangeRequest: (spaceId, changeRequestId, query, params = {}) => this.request({
1437
- path: `/spaces/${spaceId}/change-requests/${changeRequestId}/content/pages`,
1438
- method: "GET",
1439
- query,
1440
- secure: true,
1441
- format: "json",
1442
- ...params
1443
- }),
1444
- listFilesInChangeRequestById: (spaceId, changeRequestId, query, params = {}) => this.request({
1445
- path: `/spaces/${spaceId}/change-requests/${changeRequestId}/content/files`,
1446
- method: "GET",
1447
- query,
1448
- secure: true,
1449
- format: "json",
1450
- ...params
1451
- }),
1452
- getFileInChangeRequestById: (spaceId, changeRequestId, fileId, query, params = {}) => this.request({
1453
- path: `/spaces/${spaceId}/change-requests/${changeRequestId}/content/files/${fileId}`,
1454
- method: "GET",
1455
- query,
1456
- secure: true,
1457
- format: "json",
1458
- ...params
1459
- }),
1460
- listChangeRequestFileBacklinks: (spaceId, changeRequestId, fileId, query, params = {}) => this.request({
1461
- path: `/spaces/${spaceId}/change-requests/${changeRequestId}/content/files/${fileId}/backlinks`,
1462
- method: "GET",
1463
- query,
1464
- secure: true,
1465
- format: "json",
1466
- ...params
1467
- }),
1468
- getPageInChangeRequestById: (spaceId, changeRequestId, pageId, query, params = {}) => this.request({
1469
- path: `/spaces/${spaceId}/change-requests/${changeRequestId}/content/page/${pageId}`,
1470
- method: "GET",
1471
- query,
1472
- secure: true,
1473
- format: "json",
1474
- ...params
1475
- }),
1476
- listChangeRequestPageBacklinks: (spaceId, changeRequestId, pageId, query, params = {}) => this.request({
1477
- path: `/spaces/${spaceId}/change-requests/${changeRequestId}/content/page/${pageId}/backlinks`,
1478
- method: "GET",
1479
- query,
1480
- secure: true,
1481
- format: "json",
1482
- ...params
1483
- }),
1484
- importContentInChangeRequestPageById: (spaceId, changeRequestId, pageId, data, params = {}) => this.request({
1485
- path: `/spaces/${spaceId}/change-requests/${changeRequestId}/content/page/${pageId}/import`,
1486
- method: "POST",
1487
- body: data,
1488
- secure: true,
1489
- type: "application/json" /* Json */,
1490
- format: "json",
1491
- ...params
1492
- }),
1493
- getPageInChangeRequestByPath: (spaceId, changeRequestId, pagePath, query, params = {}) => this.request({
1494
- path: `/spaces/${spaceId}/change-requests/${changeRequestId}/content/path/${pagePath}`,
1495
- method: "GET",
1496
- query,
1497
- secure: true,
1498
- format: "json",
1499
- ...params
1500
- }),
1501
- touchContentInChangeRequest: (spaceId, changeRequestId, data, params = {}) => this.request({
1502
- path: `/spaces/${spaceId}/change-requests/${changeRequestId}/touched-content`,
1503
- method: "POST",
1504
- body: data,
1505
- secure: true,
1506
- type: "application/json" /* Json */,
1507
- format: "json",
1508
- ...params
1509
- }),
1510
- getChangeRequestPdf: (spaceId, changeRequestId, query, params = {}) => this.request({
1511
- path: `/spaces/${spaceId}/change-requests/${changeRequestId}/pdf`,
1512
- method: "GET",
1513
- query,
1514
- secure: true,
1515
- format: "json",
1516
- ...params
1517
- }),
1518
- getRevisionById: (spaceId, revisionId, query, params = {}) => this.request({
1519
- path: `/spaces/${spaceId}/revisions/${revisionId}`,
1520
- method: "GET",
1521
- query,
1522
- secure: true,
1523
- format: "json",
1524
- ...params
1525
- }),
1526
- getRevisionSemanticChanges: (spaceId, revisionId, query, params = {}) => this.request({
1527
- path: `/spaces/${spaceId}/revisions/${revisionId}/changes`,
1528
- method: "GET",
1529
- query,
1530
- secure: true,
1531
- format: "json",
1532
- ...params
1533
- }),
1534
- listPagesInRevisionById: (spaceId, revisionId, query, params = {}) => this.request({
1535
- path: `/spaces/${spaceId}/revisions/${revisionId}/pages`,
1536
- method: "GET",
1537
- query,
1538
- secure: true,
1539
- format: "json",
1540
- ...params
1541
- }),
1542
- listFilesInRevisionById: (spaceId, revisionId, query, params = {}) => this.request({
1543
- path: `/spaces/${spaceId}/revisions/${revisionId}/files`,
1544
- method: "GET",
1545
- query,
1546
- secure: true,
1547
- format: "json",
1548
- ...params
1549
- }),
1550
- getFileInRevisionById: (spaceId, revisionId, fileId, query, params = {}) => this.request({
1551
- path: `/spaces/${spaceId}/revisions/${revisionId}/files/${fileId}`,
1552
- method: "GET",
1553
- query,
1554
- secure: true,
1555
- format: "json",
1556
- ...params
1557
- }),
1558
- getPageInRevisionById: (spaceId, revisionId, pageId, query, params = {}) => this.request({
1559
- path: `/spaces/${spaceId}/revisions/${revisionId}/page/${pageId}`,
1560
- method: "GET",
1561
- query,
1562
- secure: true,
1563
- format: "json",
1564
- ...params
1565
- }),
1566
- getPageInRevisionByPath: (spaceId, revisionId, pagePath, query, params = {}) => this.request({
1567
- path: `/spaces/${spaceId}/revisions/${revisionId}/path/${pagePath}`,
1568
- method: "GET",
1569
- query,
1570
- secure: true,
1571
- format: "json",
1572
- ...params
1573
- }),
1574
- listCommentsInSpace: (spaceId, query, params = {}) => this.request({
1575
- path: `/spaces/${spaceId}/comments`,
1576
- method: "GET",
1577
- query,
1578
- secure: true,
1579
- format: "json",
1580
- ...params
1581
- }),
1582
- postCommentInSpace: (spaceId, data, params = {}) => this.request({
1583
- path: `/spaces/${spaceId}/comments`,
1584
- method: "POST",
1585
- body: data,
1586
- secure: true,
1587
- type: "application/json" /* Json */,
1588
- format: "json",
1589
- ...params
1590
- }),
1591
- getCommentInSpace: (spaceId, commentId, query, params = {}) => this.request({
1592
- path: `/spaces/${spaceId}/comments/${commentId}`,
1593
- method: "GET",
1594
- query,
1595
- secure: true,
1596
- format: "json",
1597
- ...params
1598
- }),
1599
- deleteCommentInSpace: (spaceId, commentId, params = {}) => this.request({
1600
- path: `/spaces/${spaceId}/comments/${commentId}`,
1601
- method: "DELETE",
1602
- secure: true,
1603
- ...params
1604
- }),
1605
- updateCommentInSpace: (spaceId, commentId, data, params = {}) => this.request({
1606
- path: `/spaces/${spaceId}/comments/${commentId}`,
1607
- method: "PUT",
1608
- body: data,
1609
- secure: true,
1610
- type: "application/json" /* Json */,
1611
- format: "json",
1612
- ...params
1613
- }),
1614
- listCommentRepliesInSpace: (spaceId, commentId, query, params = {}) => this.request({
1615
- path: `/spaces/${spaceId}/comments/${commentId}/replies`,
1616
- method: "GET",
1617
- query,
1618
- secure: true,
1619
- format: "json",
1620
- ...params
1621
- }),
1622
- postCommentReplyInSpace: (spaceId, commentId, data, params = {}) => this.request({
1623
- path: `/spaces/${spaceId}/comments/${commentId}/replies`,
1624
- method: "POST",
1625
- body: data,
1626
- secure: true,
1627
- type: "application/json" /* Json */,
1628
- format: "json",
1629
- ...params
1630
- }),
1631
- getCommentReplyInSpace: (spaceId, commentId, commentReplyId, query, params = {}) => this.request({
1632
- path: `/spaces/${spaceId}/comments/${commentId}/replies/${commentReplyId}`,
1633
- method: "GET",
1634
- query,
1635
- secure: true,
1636
- format: "json",
1637
- ...params
1638
- }),
1639
- updateCommentReplyInSpace: (spaceId, commentId, commentReplyId, data, params = {}) => this.request({
1640
- path: `/spaces/${spaceId}/comments/${commentId}/replies/${commentReplyId}`,
1641
- method: "PUT",
1642
- body: data,
1643
- secure: true,
1644
- type: "application/json" /* Json */,
1645
- format: "json",
1646
- ...params
1647
- }),
1648
- deleteCommentReplyInSpace: (spaceId, commentId, commentReplyId, params = {}) => this.request({
1649
- path: `/spaces/${spaceId}/comments/${commentId}/replies/${commentReplyId}`,
1650
- method: "DELETE",
1651
- secure: true,
1652
- ...params
1653
- }),
1654
- listPermissionsAggregateInSpace: (spaceId, query, params = {}) => this.request({
1655
- path: `/spaces/${spaceId}/permissions/aggregate`,
1656
- method: "GET",
1657
- query,
1658
- secure: true,
1659
- format: "json",
1660
- ...params
1661
- }),
1662
- getSpacePublishingCustomizationById: (spaceId, params = {}) => this.request({
1663
- path: `/spaces/${spaceId}/publishing/customization`,
1664
- method: "GET",
1665
- secure: true,
1666
- format: "json",
1667
- ...params
1668
- }),
1669
- updateSpacePublishingCustomizationById: (spaceId, data, params = {}) => this.request({
1670
- path: `/spaces/${spaceId}/publishing/customization`,
1671
- method: "PUT",
1672
- body: data,
1673
- secure: true,
1674
- type: "application/json" /* Json */,
1675
- format: "json",
1676
- ...params
1677
- }),
1678
- listSpaceIntegrations: (spaceId, query, params = {}) => this.request({
1679
- path: `/spaces/${spaceId}/integrations`,
1680
- method: "GET",
1681
- query,
1682
- secure: true,
1683
- format: "json",
1684
- ...params
1685
- }),
1686
- listSpaceIntegrationsBlocks: (spaceId, params = {}) => this.request({
1687
- path: `/spaces/${spaceId}/integration-blocks`,
1688
- method: "GET",
1689
- secure: true,
1690
- format: "json",
1691
- ...params
1692
- }),
1693
- listSpaceIntegrationScripts: (spaceId, params = {}) => this.request({
1694
- path: `/spaces/${spaceId}/integration-scripts`,
1695
- method: "GET",
1696
- secure: true,
1697
- format: "json",
1698
- ...params
1699
- }),
1700
- getSpaceCustomFields: (spaceId, params = {}) => this.request({
1701
- path: `/spaces/${spaceId}/custom-fields`,
1702
- method: "GET",
1703
- secure: true,
1704
- format: "json",
1705
- ...params
1706
- }),
1707
- updateSpaceCustomFields: (spaceId, data, params = {}) => this.request({
1708
- path: `/spaces/${spaceId}/custom-fields`,
1709
- method: "PATCH",
1710
- body: data,
1711
- secure: true,
1712
- type: "application/json" /* Json */,
1713
- ...params
1714
- }),
1715
- getPageFeedback: (spaceId, pageId, visitorId, params = {}) => this.request({
1716
- path: `/spaces/${spaceId}/pages/${pageId}/feedbacks/${visitorId}`,
1717
- method: "GET",
1718
- secure: true,
1719
- format: "json",
1720
- ...params
1721
- }),
1722
- createPageFeedback: (spaceId, pageId, visitorId, data, params = {}) => this.request({
1723
- path: `/spaces/${spaceId}/pages/${pageId}/feedbacks/${visitorId}`,
1724
- method: "PUT",
1725
- body: data,
1726
- secure: true,
1727
- type: "application/json" /* Json */,
1728
- format: "json",
1729
- ...params
1730
- }),
1731
- getSpacePdf: (spaceId, query, params = {}) => this.request({
1732
- path: `/spaces/${spaceId}/pdf`,
1733
- method: "GET",
1734
- query,
1735
- secure: true,
1736
- format: "json",
1737
- ...params
1738
- }),
1739
- createSpaceShareLink: (spaceId, data, params = {}) => this.request({
1740
- path: `/spaces/${spaceId}/share-links`,
1741
- method: "POST",
1742
- body: data,
1743
- secure: true,
1744
- type: "application/json" /* Json */,
1745
- format: "json",
1746
- ...params
1747
- }),
1748
- updateSpaceShareLinkById: (spaceId, shareLinkId, data, params = {}) => this.request({
1749
- path: `/spaces/${spaceId}/share-links/${shareLinkId}`,
1750
- method: "PATCH",
1751
- body: data,
1752
- secure: true,
1753
- type: "application/json" /* Json */,
1754
- format: "json",
1755
- ...params
1756
- }),
1757
- deleteSpaceShareLinkById: (spaceId, shareLinkId, params = {}) => this.request({
1758
- path: `/spaces/${spaceId}/share-links/${shareLinkId}`,
1759
- method: "DELETE",
1760
- secure: true,
1761
- ...params
1762
- }),
1763
- listSpaceLinks: (spaceId, query, params = {}) => this.request({
1764
- path: `/spaces/${spaceId}/links`,
1765
- method: "GET",
1766
- query,
1767
- secure: true,
1768
- format: "json",
1769
- ...params
1770
- })
1771
- };
1772
- this.collections = {
1773
- getCollectionById: (collectionId, params = {}) => this.request({
1774
- path: `/collections/${collectionId}`,
1775
- method: "GET",
1776
- secure: true,
1777
- format: "json",
1778
- ...params
1779
- }),
1780
- updateCollectionById: (collectionId, data, params = {}) => this.request({
1781
- path: `/collections/${collectionId}`,
1782
- method: "PATCH",
1783
- body: data,
1784
- secure: true,
1785
- type: "application/json" /* Json */,
1786
- format: "json",
1787
- ...params
1788
- }),
1789
- deleteCollectionById: (collectionId, params = {}) => this.request({
1790
- path: `/collections/${collectionId}`,
1791
- method: "DELETE",
1792
- secure: true,
1793
- ...params
1794
- }),
1795
- listSpacesInCollectionById: (collectionId, query, params = {}) => this.request({
1796
- path: `/collections/${collectionId}/spaces`,
1797
- method: "GET",
1798
- query,
1799
- secure: true,
1800
- format: "json",
1801
- ...params
1802
- }),
1803
- moveCollection: (collectionId, data, params = {}) => this.request({
1804
- path: `/collections/${collectionId}/move`,
1805
- method: "POST",
1806
- body: data,
1807
- secure: true,
1808
- type: "application/json" /* Json */,
1809
- format: "json",
1810
- ...params
1811
- }),
1812
- transferCollection: (collectionId, data, params = {}) => this.request({
1813
- path: `/collections/${collectionId}/transfer`,
1814
- method: "POST",
1815
- body: data,
1816
- secure: true,
1817
- type: "application/json" /* Json */,
1818
- format: "json",
1819
- ...params
1820
- }),
1821
- listPermissionsAggregateInCollection: (collectionId, query, params = {}) => this.request({
1822
- path: `/collections/${collectionId}/permissions/aggregate`,
1823
- method: "GET",
1824
- query,
1825
- secure: true,
1826
- format: "json",
1827
- ...params
1828
- }),
1829
- getCollectionPublishingCustomizationById: (collectionId, params = {}) => this.request({
1830
- path: `/collections/${collectionId}/publishing/customization`,
1831
- method: "GET",
1832
- secure: true,
1833
- format: "json",
1834
- ...params
1835
- }),
1836
- updateCollectionPublishingCustomizationById: (collectionId, data, params = {}) => this.request({
1837
- path: `/collections/${collectionId}/publishing/customization`,
1838
- method: "PUT",
1839
- body: data,
1840
- secure: true,
1841
- type: "application/json" /* Json */,
1842
- format: "json",
1843
- ...params
1844
- }),
1845
- createCollectionShareLink: (collectionId, data, params = {}) => this.request({
1846
- path: `/collections/${collectionId}/share-links`,
1847
- method: "POST",
1848
- body: data,
1849
- secure: true,
1850
- type: "application/json" /* Json */,
1851
- format: "json",
1852
- ...params
1853
- }),
1854
- updateCollectionShareLinkById: (collectionId, shareLinkId, data, params = {}) => this.request({
1855
- path: `/collections/${collectionId}/share-links/${shareLinkId}`,
1856
- method: "PATCH",
1857
- body: data,
1858
- secure: true,
1859
- type: "application/json" /* Json */,
1860
- format: "json",
1861
- ...params
1862
- }),
1863
- deleteCollectionShareLinkById: (collectionId, shareLinkId, params = {}) => this.request({
1864
- path: `/collections/${collectionId}/share-links/${shareLinkId}`,
1865
- method: "DELETE",
1866
- secure: true,
1867
- ...params
1868
- })
1869
- };
1870
- this.integrations = {
1871
- listIntegrations: (query, params = {}) => this.request({
1872
- path: `/integrations`,
1873
- method: "GET",
1874
- query,
1875
- secure: true,
1876
- format: "json",
1877
- ...params
1878
- }),
1879
- getIntegrationByName: (integrationName, params = {}) => this.request({
1880
- path: `/integrations/${integrationName}`,
1881
- method: "GET",
1882
- secure: true,
1883
- format: "json",
1884
- ...params
1885
- }),
1886
- publishIntegration: (integrationName, data, params = {}) => this.request({
1887
- path: `/integrations/${integrationName}`,
1888
- method: "POST",
1889
- body: data,
1890
- secure: true,
1891
- type: "application/json" /* Json */,
1892
- format: "json",
1893
- ...params
1894
- }),
1895
- unpublishIntegration: (integrationName, params = {}) => this.request({
1896
- path: `/integrations/${integrationName}`,
1897
- method: "DELETE",
1898
- secure: true,
1899
- ...params
1900
- }),
1901
- listIntegrationInstallations: (integrationName, query, params = {}) => this.request({
1902
- path: `/integrations/${integrationName}/installations`,
1903
- method: "GET",
1904
- query,
1905
- secure: true,
1906
- format: "json",
1907
- ...params
1908
- }),
1909
- installIntegration: (integrationName, data, params = {}) => this.request({
1910
- path: `/integrations/${integrationName}/installations`,
1911
- method: "POST",
1912
- body: data,
1913
- secure: true,
1914
- type: "application/json" /* Json */,
1915
- format: "json",
1916
- ...params
1917
- }),
1918
- listIntegrationEvents: (integrationName, query, params = {}) => this.request({
1919
- path: `/integrations/${integrationName}/events`,
1920
- method: "GET",
1921
- query,
1922
- secure: true,
1923
- format: "json",
1924
- ...params
1925
- }),
1926
- getIntegrationEvent: (integrationName, eventId, params = {}) => this.request({
1927
- path: `/integrations/${integrationName}/events/${eventId}`,
1928
- method: "GET",
1929
- secure: true,
1930
- format: "json",
1931
- ...params
1932
- }),
1933
- listIntegrationSpaceInstallations: (integrationName, query, params = {}) => this.request({
1934
- path: `/integrations/${integrationName}/spaces`,
1935
- method: "GET",
1936
- query,
1937
- secure: true,
1938
- format: "json",
1939
- ...params
1940
- }),
1941
- updateIntegrationDevSpace: (integrationName, spaceId, data, params = {}) => this.request({
1942
- path: `/integrations/${integrationName}/spaces/${spaceId}/dev`,
1943
- method: "PUT",
1944
- body: data,
1945
- secure: true,
1946
- type: "application/json" /* Json */,
1947
- ...params
1948
- }),
1949
- removeIntegrationDevSpace: (integrationName, spaceId, params = {}) => this.request({
1950
- path: `/integrations/${integrationName}/spaces/${spaceId}/dev`,
1951
- method: "DELETE",
1952
- secure: true,
1953
- ...params
1954
- }),
1955
- renderIntegrationUiWithGet: (integrationName, query, params = {}) => this.request({
1956
- path: `/integrations/${integrationName}/render`,
1957
- method: "GET",
1958
- query,
1959
- secure: true,
1960
- format: "json",
1961
- ...params
1962
- }),
1963
- renderIntegrationUiWithPost: (integrationName, data, params = {}) => this.request({
1964
- path: `/integrations/${integrationName}/render`,
1965
- method: "POST",
1966
- body: data,
1967
- secure: true,
1968
- type: "application/json" /* Json */,
1969
- format: "json",
1970
- ...params
1971
- }),
1972
- queueIntegrationTask: (integrationName, data, params = {}) => this.request({
1973
- path: `/integrations/${integrationName}/tasks`,
1974
- method: "POST",
1975
- body: data,
1976
- secure: true,
1977
- type: "application/json" /* Json */,
1978
- ...params
1979
- }),
1980
- getIntegrationInstallationById: (integrationName, installationId, params = {}) => this.request({
1981
- path: `/integrations/${integrationName}/installations/${installationId}`,
1982
- method: "GET",
1983
- secure: true,
1984
- format: "json",
1985
- ...params
1986
- }),
1987
- updateIntegrationInstallation: (integrationName, installationId, data, params = {}) => this.request({
1988
- path: `/integrations/${integrationName}/installations/${installationId}`,
1989
- method: "PATCH",
1990
- body: data,
1991
- secure: true,
1992
- type: "application/json" /* Json */,
1993
- format: "json",
1994
- ...params
1995
- }),
1996
- uninstallIntegration: (integrationName, installationId, params = {}) => this.request({
1997
- path: `/integrations/${integrationName}/installations/${installationId}`,
1998
- method: "DELETE",
1999
- secure: true,
2000
- ...params
2001
- }),
2002
- createIntegrationInstallationToken: (integrationName, installationId, params = {}) => this.request({
2003
- path: `/integrations/${integrationName}/installations/${installationId}/tokens`,
2004
- method: "POST",
2005
- secure: true,
2006
- format: "json",
2007
- ...params
2008
- }),
2009
- listIntegrationInstallationSpaces: (integrationName, installationId, query, params = {}) => this.request({
2010
- path: `/integrations/${integrationName}/installations/${installationId}/spaces`,
2011
- method: "GET",
2012
- query,
2013
- secure: true,
2014
- format: "json",
2015
- ...params
2016
- }),
2017
- installIntegrationOnSpace: (integrationName, installationId, data, params = {}) => this.request({
2018
- path: `/integrations/${integrationName}/installations/${installationId}/spaces`,
2019
- method: "POST",
2020
- body: data,
2021
- secure: true,
2022
- type: "application/json" /* Json */,
2023
- format: "json",
2024
- ...params
2025
- }),
2026
- getIntegrationSpaceInstallation: (integrationName, installationId, spaceId, params = {}) => this.request({
2027
- path: `/integrations/${integrationName}/installations/${installationId}/spaces/${spaceId}`,
2028
- method: "GET",
2029
- secure: true,
2030
- format: "json",
2031
- ...params
2032
- }),
2033
- updateIntegrationSpaceInstallation: (integrationName, installationId, spaceId, data, params = {}) => this.request({
2034
- path: `/integrations/${integrationName}/installations/${installationId}/spaces/${spaceId}`,
2035
- method: "PATCH",
2036
- body: data,
2037
- secure: true,
2038
- type: "application/json" /* Json */,
2039
- format: "json",
2040
- ...params
2041
- }),
2042
- uninstallIntegrationFromSpace: (integrationName, installationId, spaceId, params = {}) => this.request({
2043
- path: `/integrations/${integrationName}/installations/${installationId}/spaces/${spaceId}`,
2044
- method: "DELETE",
2045
- secure: true,
2046
- ...params
2047
- }),
2048
- listIntegrationInstallationSites: (integrationName, installationId, query, params = {}) => this.request({
2049
- path: `/integrations/${integrationName}/installations/${installationId}/sites`,
2050
- method: "GET",
2051
- query,
2052
- secure: true,
2053
- format: "json",
2054
- ...params
2055
- }),
2056
- installIntegrationOnSite: (integrationName, installationId, data, params = {}) => this.request({
2057
- path: `/integrations/${integrationName}/installations/${installationId}/sites`,
2058
- method: "POST",
2059
- body: data,
2060
- secure: true,
2061
- type: "application/json" /* Json */,
2062
- format: "json",
2063
- ...params
2064
- }),
2065
- getIntegrationSiteInstallation: (integrationName, installationId, siteId, params = {}) => this.request({
2066
- path: `/integrations/${integrationName}/installations/${installationId}/sites/${siteId}`,
2067
- method: "GET",
2068
- secure: true,
2069
- format: "json",
2070
- ...params
2071
- }),
2072
- updateIntegrationSiteInstallation: (integrationName, installationId, siteId, data, params = {}) => this.request({
2073
- path: `/integrations/${integrationName}/installations/${installationId}/sites/${siteId}`,
2074
- method: "PATCH",
2075
- body: data,
2076
- secure: true,
2077
- type: "application/json" /* Json */,
2078
- format: "json",
2079
- ...params
2080
- }),
2081
- uninstallIntegrationFromSite: (integrationName, installationId, siteId, params = {}) => this.request({
2082
- path: `/integrations/${integrationName}/installations/${installationId}/sites/${siteId}`,
2083
- method: "DELETE",
2084
- secure: true,
2085
- ...params
2086
- })
2087
- };
2088
- this.orgs = {
2089
- listOrganizationsForAuthenticatedUser: (query, params = {}) => this.request({
2090
- path: `/orgs`,
2091
- method: "GET",
2092
- query,
2093
- secure: true,
2094
- format: "json",
2095
- ...params
2096
- }),
2097
- createOrganization: (data, params = {}) => this.request({
2098
- path: `/orgs`,
2099
- method: "POST",
2100
- body: data,
2101
- secure: true,
2102
- type: "application/json" /* Json */,
2103
- format: "json",
2104
- ...params
2105
- }),
2106
- getOrganizationById: (organizationId, params = {}) => this.request({
2107
- path: `/orgs/${organizationId}`,
2108
- method: "GET",
2109
- secure: true,
2110
- format: "json",
2111
- ...params
2112
- }),
2113
- deleteOrganizationById: (organizationId, params = {}) => this.request({
2114
- path: `/orgs/${organizationId}`,
2115
- method: "DELETE",
2116
- secure: true,
2117
- ...params
2118
- }),
2119
- updateOrganizationById: (organizationId, data, params = {}) => this.request({
2120
- path: `/orgs/${organizationId}`,
2121
- method: "PATCH",
2122
- body: data,
2123
- secure: true,
2124
- type: "application/json" /* Json */,
2125
- format: "json",
2126
- ...params
2127
- }),
2128
- listMembersInOrganizationById: (organizationId, query, params = {}) => this.request({
2129
- path: `/orgs/${organizationId}/members`,
2130
- method: "GET",
2131
- query,
2132
- secure: true,
2133
- format: "json",
2134
- ...params
2135
- }),
2136
- getMemberInOrganizationById: (organizationId, userId, params = {}) => this.request({
2137
- path: `/orgs/${organizationId}/members/${userId}`,
2138
- method: "GET",
2139
- secure: true,
2140
- format: "json",
2141
- ...params
2142
- }),
2143
- updateMemberInOrganizationById: (organizationId, userId, data, params = {}) => this.request({
2144
- path: `/orgs/${organizationId}/members/${userId}`,
2145
- method: "PATCH",
2146
- body: data,
2147
- secure: true,
2148
- type: "application/json" /* Json */,
2149
- format: "json",
2150
- ...params
2151
- }),
2152
- removeMemberFromOrganizationById: (organizationId, userId, params = {}) => this.request({
2153
- path: `/orgs/${organizationId}/members/${userId}`,
2154
- method: "DELETE",
2155
- secure: true,
2156
- ...params
2157
- }),
2158
- updateOrganizationMemberLastSeenAt: (organizationId, params = {}) => this.request({
2159
- path: `/orgs/${organizationId}/ping`,
2160
- method: "POST",
2161
- secure: true,
2162
- ...params
2163
- }),
2164
- setUserAsSsoMemberForOrganization: (organizationId, userId, params = {}) => this.request({
2165
- path: `/orgs/${organizationId}/members/${userId}/sso`,
2166
- method: "POST",
2167
- secure: true,
2168
- format: "json",
2169
- ...params
2170
- }),
2171
- listSpacesForOrganizationMember: (organizationId, userId, query, params = {}) => this.request({
2172
- path: `/orgs/${organizationId}/members/${userId}/spaces`,
2173
- method: "GET",
2174
- query,
2175
- secure: true,
2176
- format: "json",
2177
- ...params
2178
- }),
2179
- listTeamsForOrganizationMember: (organizationId, userId, query, params = {}) => this.request({
2180
- path: `/orgs/${organizationId}/members/${userId}/teams`,
2181
- method: "GET",
2182
- query,
2183
- secure: true,
2184
- format: "json",
2185
- ...params
2186
- }),
2187
- listTeamsInOrganizationById: (organizationId, query, params = {}) => this.request({
2188
- path: `/orgs/${organizationId}/teams`,
2189
- method: "GET",
2190
- query,
2191
- secure: true,
2192
- format: "json",
2193
- ...params
2194
- }),
2195
- createOrganizationTeam: (organizationId, data, params = {}) => this.request({
2196
- path: `/orgs/${organizationId}/teams`,
2197
- method: "PUT",
2198
- body: data,
2199
- secure: true,
2200
- type: "application/json" /* Json */,
2201
- format: "json",
2202
- ...params
2203
- }),
2204
- getTeamInOrganizationById: (organizationId, teamId, params = {}) => this.request({
2205
- path: `/orgs/${organizationId}/teams/${teamId}`,
2206
- method: "GET",
2207
- secure: true,
2208
- format: "json",
2209
- ...params
2210
- }),
2211
- updateTeamInOrganizationById: (organizationId, teamId, data, params = {}) => this.request({
2212
- path: `/orgs/${organizationId}/teams/${teamId}`,
2213
- method: "PATCH",
2214
- body: data,
2215
- secure: true,
2216
- type: "application/json" /* Json */,
2217
- format: "json",
2218
- ...params
2219
- }),
2220
- removeTeamFromOrganizationById: (organizationId, teamId, params = {}) => this.request({
2221
- path: `/orgs/${organizationId}/teams/${teamId}`,
2222
- method: "DELETE",
2223
- secure: true,
2224
- ...params
2225
- }),
2226
- updateMembersInOrganizationTeam: (organizationId, teamId, data, params = {}) => this.request({
2227
- path: `/orgs/${organizationId}/teams/${teamId}/members`,
2228
- method: "PUT",
2229
- body: data,
2230
- secure: true,
2231
- type: "application/json" /* Json */,
2232
- ...params
2233
- }),
2234
- listTeamMembersInOrganizationById: (organizationId, teamId, query, params = {}) => this.request({
2235
- path: `/orgs/${organizationId}/teams/${teamId}/members`,
2236
- method: "GET",
2237
- query,
2238
- secure: true,
2239
- format: "json",
2240
- ...params
2241
- }),
2242
- addMemberToOrganizationTeamById: (organizationId, teamId, userId, data, params = {}) => this.request({
2243
- path: `/orgs/${organizationId}/teams/${teamId}/members/${userId}`,
2244
- method: "PUT",
2245
- body: data,
2246
- secure: true,
2247
- type: "application/json" /* Json */,
2248
- ...params
2249
- }),
2250
- deleteMemberFromOrganizationTeamById: (organizationId, teamId, userId, params = {}) => this.request({
2251
- path: `/orgs/${organizationId}/teams/${teamId}/members/${userId}`,
2252
- method: "DELETE",
2253
- secure: true,
2254
- ...params
2255
- }),
2256
- inviteUsersToOrganization: (organizationId, data, params = {}) => this.request({
2257
- path: `/orgs/${organizationId}/invites`,
2258
- method: "POST",
2259
- body: data,
2260
- secure: true,
2261
- type: "application/json" /* Json */,
2262
- format: "json",
2263
- ...params
2264
- }),
2265
- joinOrganizationWithInvite: (organizationId, inviteId, params = {}) => this.request({
2266
- path: `/orgs/${organizationId}/invites/${inviteId}`,
2267
- method: "POST",
2268
- secure: true,
2269
- format: "json",
2270
- ...params
2271
- }),
2272
- createOrganizationInvite: (organizationId, data, params = {}) => this.request({
2273
- path: `/orgs/${organizationId}/link-invites`,
2274
- method: "POST",
2275
- body: data,
2276
- secure: true,
2277
- type: "application/json" /* Json */,
2278
- format: "json",
2279
- ...params
2280
- }),
2281
- updateOrganizationInviteById: (organizationId, inviteId, data, params = {}) => this.request({
2282
- path: `/orgs/${organizationId}/link-invites/${inviteId}`,
2283
- method: "PATCH",
2284
- body: data,
2285
- secure: true,
2286
- type: "application/json" /* Json */,
2287
- format: "json",
2288
- ...params
2289
- }),
2290
- deleteOrganizationInviteById: (organizationId, inviteId, params = {}) => this.request({
2291
- path: `/orgs/${organizationId}/link-invites/${inviteId}`,
2292
- method: "DELETE",
2293
- secure: true,
2294
- ...params
2295
- }),
2296
- upgradeOrganizationPlan: (organizationId, data, params = {}) => this.request({
2297
- path: `/orgs/${organizationId}/billing`,
2298
- method: "POST",
2299
- body: data,
2300
- secure: true,
2301
- type: "application/json" /* Json */,
2302
- format: "json",
2303
- ...params
2304
- }),
2305
- getOrganizationBillingPortal: (organizationId, params = {}) => this.request({
2306
- path: `/orgs/${organizationId}/billing`,
2307
- method: "GET",
2308
- secure: true,
2309
- format: "json",
2310
- ...params
2311
- }),
2312
- previewBillingInvoice: (organizationId, query, params = {}) => this.request({
2313
- path: `/orgs/${organizationId}/billing/preview`,
2314
- method: "GET",
2315
- query,
2316
- secure: true,
2317
- format: "json",
2318
- ...params
2319
- }),
2320
- requestOrganizationUpgrade: (organizationId, params = {}) => this.request({
2321
- path: `/orgs/${organizationId}/request_upgrade`,
2322
- method: "POST",
2323
- secure: true,
2324
- format: "json",
2325
- ...params
2326
- }),
2327
- searchOrganizationContent: (organizationId, query, params = {}) => this.request({
2328
- path: `/orgs/${organizationId}/search`,
2329
- method: "GET",
2330
- query,
2331
- secure: true,
2332
- format: "json",
2333
- ...params
2334
- }),
2335
- listSpacesInOrganizationById: (organizationId, query, params = {}) => this.request({
2336
- path: `/orgs/${organizationId}/spaces`,
2337
- method: "GET",
2338
- query,
2339
- secure: true,
2340
- format: "json",
2341
- ...params
2342
- }),
2343
- createSpace: (organizationId, data, params = {}) => this.request({
2344
- path: `/orgs/${organizationId}/spaces`,
2345
- method: "POST",
2346
- body: data,
2347
- secure: true,
2348
- type: "application/json" /* Json */,
2349
- format: "json",
2350
- ...params
2351
- }),
2352
- listSpacesWithGitSyncInOrganizationById: (organizationId, query, params = {}) => this.request({
2353
- path: `/orgs/${organizationId}/spaces/gitsync`,
2354
- method: "GET",
2355
- query,
2356
- secure: true,
2357
- format: "json",
2358
- ...params
2359
- }),
2360
- listCollectionsInOrganizationById: (organizationId, query, params = {}) => this.request({
2361
- path: `/orgs/${organizationId}/collections`,
2362
- method: "GET",
2363
- query,
2364
- secure: true,
2365
- format: "json",
2366
- ...params
2367
- }),
2368
- createCollection: (organizationId, data, params = {}) => this.request({
2369
- path: `/orgs/${organizationId}/collections`,
2370
- method: "POST",
2371
- body: data,
2372
- secure: true,
2373
- type: "application/json" /* Json */,
2374
- format: "json",
2375
- ...params
2376
- }),
2377
- listOrganizationCustomFields: (organizationId, query, params = {}) => this.request({
2378
- path: `/orgs/${organizationId}/custom-fields`,
2379
- method: "GET",
2380
- query,
2381
- secure: true,
2382
- format: "json",
2383
- ...params
2384
- }),
2385
- createOrganizationCustomField: (organizationId, data, params = {}) => this.request({
2386
- path: `/orgs/${organizationId}/custom-fields`,
2387
- method: "POST",
2388
- body: data,
2389
- secure: true,
2390
- type: "application/json" /* Json */,
2391
- format: "json",
2392
- ...params
2393
- }),
2394
- getOrganizationCustomFieldByName: (organizationId, fieldName, params = {}) => this.request({
2395
- path: `/orgs/${organizationId}/custom-fields/${fieldName}`,
2396
- method: "GET",
2397
- secure: true,
2398
- format: "json",
2399
- ...params
2400
- }),
2401
- updateOrganizationCustomField: (organizationId, fieldName, data, params = {}) => this.request({
2402
- path: `/orgs/${organizationId}/custom-fields/${fieldName}`,
2403
- method: "PATCH",
2404
- body: data,
2405
- secure: true,
2406
- type: "application/json" /* Json */,
2407
- format: "json",
2408
- ...params
2409
- }),
2410
- deleteOrganizationCustomField: (organizationId, fieldName, params = {}) => this.request({
2411
- path: `/orgs/${organizationId}/custom-fields/${fieldName}`,
2412
- method: "DELETE",
2413
- secure: true,
2414
- ...params
2415
- }),
2416
- listOrganizationIntegrations: (organizationId, query, params = {}) => this.request({
2417
- path: `/orgs/${organizationId}/integrations`,
2418
- method: "GET",
2419
- query,
2420
- secure: true,
2421
- format: "json",
2422
- ...params
2423
- }),
2424
- getOrganizationIntegrationStatus: (organizationId, integrationName, params = {}) => this.request({
2425
- path: `/orgs/${organizationId}/integrations/${integrationName}/installation_status`,
2426
- method: "GET",
2427
- secure: true,
2428
- format: "json",
2429
- ...params
2430
- }),
2431
- listOrganizationInstallations: (organizationId, query, params = {}) => this.request({
2432
- path: `/orgs/${organizationId}/installations`,
2433
- method: "GET",
2434
- query,
2435
- secure: true,
2436
- format: "json",
2437
- ...params
2438
- }),
2439
- listOrganizationIntegrationsStatus: (organizationId, query, params = {}) => this.request({
2440
- path: `/orgs/${organizationId}/integrations/installations-status`,
2441
- method: "GET",
2442
- query,
2443
- secure: true,
2444
- format: "json",
2445
- ...params
2446
- }),
2447
- listOrgExperimentalFeatures: (organizationId, params = {}) => this.request({
2448
- path: `/orgs/${organizationId}/experiments`,
2449
- method: "GET",
2450
- secure: true,
2451
- format: "json",
2452
- ...params
2453
- }),
2454
- updateOrgExperimentalFeatures: (organizationId, data, params = {}) => this.request({
2455
- path: `/orgs/${organizationId}/experiments`,
2456
- method: "POST",
2457
- body: data,
2458
- secure: true,
2459
- type: "application/json" /* Json */,
2460
- ...params
2461
- }),
2462
- listSamlProvidersInOrganizationById: (organizationId, query, params = {}) => this.request({
2463
- path: `/orgs/${organizationId}/saml`,
2464
- method: "GET",
2465
- query,
2466
- secure: true,
2467
- format: "json",
2468
- ...params
2469
- }),
2470
- createOrganizationSamlProvider: (organizationId, data, params = {}) => this.request({
2471
- path: `/orgs/${organizationId}/saml`,
2472
- method: "POST",
2473
- body: data,
2474
- secure: true,
2475
- type: "application/json" /* Json */,
2476
- format: "json",
2477
- ...params
2478
- }),
2479
- getOrganizationSamlProviderById: (organizationId, samlProviderId, params = {}) => this.request({
2480
- path: `/orgs/${organizationId}/saml/${samlProviderId}`,
2481
- method: "GET",
2482
- secure: true,
2483
- format: "json",
2484
- ...params
2485
- }),
2486
- updateOrganizationSamlProvider: (organizationId, samlProviderId, data, params = {}) => this.request({
2487
- path: `/orgs/${organizationId}/saml/${samlProviderId}`,
2488
- method: "PATCH",
2489
- body: data,
2490
- secure: true,
2491
- type: "application/json" /* Json */,
2492
- format: "json",
2493
- ...params
2494
- }),
2495
- deleteOrganizationSamlProvider: (organizationId, samlProviderId, params = {}) => this.request({
2496
- path: `/orgs/${organizationId}/saml/${samlProviderId}`,
2497
- method: "DELETE",
2498
- secure: true,
2499
- ...params
2500
- }),
2501
- getUsageForOrganizationById: (organizationId, params = {}) => this.request({
2502
- path: `/orgs/${organizationId}/usage`,
2503
- method: "GET",
2504
- secure: true,
2505
- format: "json",
2506
- ...params
2507
- }),
2508
- getCollectionsUsageForOrganizationById: (organizationId, params = {}) => this.request({
2509
- path: `/orgs/${organizationId}/usage/collections`,
2510
- method: "GET",
2511
- secure: true,
2512
- format: "json",
2513
- ...params
2514
- }),
2515
- getSpacesUsageForOrganizationById: (organizationId, params = {}) => this.request({
2516
- path: `/orgs/${organizationId}/usage/spaces`,
2517
- method: "GET",
2518
- secure: true,
2519
- format: "json",
2520
- ...params
2521
- }),
2522
- getSitesUsageForOrganizationById: (organizationId, params = {}) => this.request({
2523
- path: `/orgs/${organizationId}/usage/sites`,
2524
- method: "GET",
2525
- secure: true,
2526
- format: "json",
2527
- ...params
2528
- }),
2529
- getTeamsUsageForOrganizationById: (organizationId, params = {}) => this.request({
2530
- path: `/orgs/${organizationId}/usage/teams`,
2531
- method: "GET",
2532
- secure: true,
2533
- format: "json",
2534
- ...params
2535
- }),
2536
- getMembersUsageForOrganizationById: (organizationId, params = {}) => this.request({
2537
- path: `/orgs/${organizationId}/usage/members`,
2538
- method: "GET",
2539
- secure: true,
2540
- format: "json",
2541
- ...params
2542
- }),
2543
- getTeamMembersUsageForOrganizationById: (organizationId, params = {}) => this.request({
2544
- path: `/orgs/${organizationId}/usage/team-members`,
2545
- method: "GET",
2546
- secure: true,
2547
- format: "json",
2548
- ...params
2549
- }),
2550
- listCaptures: (organizationId, query, params = {}) => this.request({
2551
- path: `/orgs/${organizationId}/captures`,
2552
- method: "GET",
2553
- query,
2554
- secure: true,
2555
- format: "json",
2556
- ...params
2557
- }),
2558
- startCapture: (organizationId, data, params = {}) => this.request({
2559
- path: `/orgs/${organizationId}/captures`,
2560
- method: "POST",
2561
- body: data,
2562
- secure: true,
2563
- type: "application/json" /* Json */,
2564
- format: "json",
2565
- ...params
2566
- }),
2567
- getCapture: (organizationId, captureId, query, params = {}) => this.request({
2568
- path: `/orgs/${organizationId}/captures/${captureId}`,
2569
- method: "GET",
2570
- query,
2571
- secure: true,
2572
- format: "json",
2573
- ...params
2574
- }),
2575
- addEventsToCapture: (organizationId, captureId, data, params = {}) => this.request({
2576
- path: `/orgs/${organizationId}/captures/${captureId}/events`,
2577
- method: "POST",
2578
- body: data,
2579
- secure: true,
2580
- type: "application/json" /* Json */,
2581
- ...params
2582
- }),
2583
- stopCapture: (organizationId, captureId, data, query, params = {}) => this.request({
2584
- path: `/orgs/${organizationId}/captures/${captureId}/stop`,
2585
- method: "POST",
2586
- query,
2587
- body: data,
2588
- secure: true,
2589
- type: "application/json" /* Json */,
2590
- format: "json",
2591
- ...params
2592
- }),
2593
- listSnippets: (organizationId, query, params = {}) => this.request({
2594
- path: `/orgs/${organizationId}/snippets`,
2595
- method: "GET",
2596
- query,
2597
- secure: true,
2598
- format: "json",
2599
- ...params
2600
- }),
2601
- createSnippet: (organizationId, data, params = {}) => this.request({
2602
- path: `/orgs/${organizationId}/snippets`,
2603
- method: "POST",
2604
- body: data,
2605
- secure: true,
2606
- type: "application/json" /* Json */,
2607
- format: "json",
2608
- ...params
2609
- }),
2610
- getSnippet: (organizationId, snippetId, params = {}) => this.request({
2611
- path: `/orgs/${organizationId}/snippets/${snippetId}`,
2612
- method: "GET",
2613
- secure: true,
2614
- format: "json",
2615
- ...params
2616
- }),
2617
- deleteSnippet: (organizationId, snippetId, params = {}) => this.request({
2618
- path: `/orgs/${organizationId}/snippets/${snippetId}`,
2619
- method: "DELETE",
2620
- secure: true,
2621
- ...params
2622
- }),
2623
- updateSnippet: (organizationId, snippetId, data, params = {}) => this.request({
2624
- path: `/orgs/${organizationId}/snippets/${snippetId}`,
2625
- method: "PUT",
2626
- body: data,
2627
- secure: true,
2628
- type: "application/json" /* Json */,
2629
- format: "json",
2630
- ...params
2631
- }),
2632
- moveSnippet: (organizationId, snippetId, data, params = {}) => this.request({
2633
- path: `/orgs/${organizationId}/snippets/${snippetId}/move`,
2634
- method: "POST",
2635
- body: data,
2636
- secure: true,
2637
- type: "application/json" /* Json */,
2638
- format: "json",
2639
- ...params
2640
- }),
2641
- getSnippetSuggestedLocations: (organizationId, snippetId, query, params = {}) => this.request({
2642
- path: `/orgs/${organizationId}/snippets/${snippetId}/move`,
2643
- method: "GET",
2644
- query,
2645
- secure: true,
2646
- format: "json",
2647
- ...params
2648
- }),
2649
- listSyncedBlocks: (organizationId, query, params = {}) => this.request({
2650
- path: `/orgs/${organizationId}/synced-blocks`,
2651
- method: "GET",
2652
- query,
2653
- secure: true,
2654
- format: "json",
2655
- ...params
2656
- }),
2657
- createSyncedBlock: (organizationId, data, params = {}) => this.request({
2658
- path: `/orgs/${organizationId}/synced-blocks`,
2659
- method: "POST",
2660
- body: data,
2661
- secure: true,
2662
- type: "application/json" /* Json */,
2663
- format: "json",
2664
- ...params
2665
- }),
2666
- getSyncedBlock: (organizationId, syncedBlockId, params = {}) => this.request({
2667
- path: `/orgs/${organizationId}/synced-blocks/${syncedBlockId}`,
2668
- method: "GET",
2669
- secure: true,
2670
- format: "json",
2671
- ...params
2672
- }),
2673
- updateSyncedBlock: (organizationId, syncedBlockId, data, params = {}) => this.request({
2674
- path: `/orgs/${organizationId}/synced-blocks/${syncedBlockId}`,
2675
- method: "PUT",
2676
- body: data,
2677
- secure: true,
2678
- type: "application/json" /* Json */,
2679
- ...params
2680
- }),
2681
- getSyncedBlockContent: (organizationId, syncedBlockId, params = {}) => this.request({
2682
- path: `/orgs/${organizationId}/synced-blocks/${syncedBlockId}/content`,
2683
- method: "GET",
2684
- secure: true,
2685
- format: "json",
2686
- ...params
2687
- }),
2688
- listSyncedBlockBacklinks: (organizationId, syncedBlockId, query, params = {}) => this.request({
2689
- path: `/orgs/${organizationId}/synced-blocks/${syncedBlockId}/backlinks`,
2690
- method: "GET",
2691
- query,
2692
- secure: true,
2693
- format: "json",
2694
- ...params
2695
- }),
2696
- listSyncedBlockSpaces: (organizationId, syncedBlockId, query, params = {}) => this.request({
2697
- path: `/orgs/${organizationId}/synced-blocks/${syncedBlockId}/usage/spaces`,
2698
- method: "GET",
2699
- query,
2700
- secure: true,
2701
- format: "json",
2702
- ...params
2703
- }),
2704
- askInOrganization: (organizationId, data, query, params = {}) => this.request({
2705
- path: `/orgs/${organizationId}/ask`,
2706
- method: "POST",
2707
- query,
2708
- body: data,
2709
- secure: true,
2710
- type: "application/json" /* Json */,
2711
- format: "json",
2712
- ...params
2713
- }),
2714
- getRecommendedQuestionsInOrganization: (organizationId, params = {}) => this.request({
2715
- path: `/orgs/${organizationId}/ask/questions`,
2716
- method: "GET",
2717
- secure: true,
2718
- format: "json",
2719
- ...params
2720
- }),
2721
- streamRecommendedQuestionsInOrganization: (organizationId, params = {}) => this.streamRequest({
2722
- path: `/orgs/${organizationId}/ask/questions/stream`,
2723
- method: "GET",
2724
- secure: true,
2725
- ...params
2726
- }),
2727
- streamAskInOrganization: (organizationId, query, params = {}) => this.streamRequest({
2728
- path: `/orgs/${organizationId}/ask/stream`,
2729
- method: "GET",
2730
- query,
2731
- secure: true,
2732
- ...params
2733
- }),
2734
- listSites: (organizationId, query, params = {}) => this.request({
2735
- path: `/orgs/${organizationId}/sites`,
2736
- method: "GET",
2737
- query,
2738
- secure: true,
2739
- format: "json",
2740
- ...params
2741
- }),
2742
- createSite: (organizationId, data, params = {}) => this.request({
2743
- path: `/orgs/${organizationId}/sites`,
2744
- method: "POST",
2745
- body: data,
2746
- secure: true,
2747
- type: "application/json" /* Json */,
2748
- format: "json",
2749
- ...params
2750
- }),
2751
- previewSitePublishCheckout: (organizationId, query, params = {}) => this.request({
2752
- path: `/orgs/${organizationId}/sites/publishing/checkout`,
2753
- method: "GET",
2754
- query,
2755
- secure: true,
2756
- format: "json",
2757
- ...params
2758
- }),
2759
- getSiteById: (organizationId, siteId, params = {}) => this.request({
2760
- path: `/orgs/${organizationId}/sites/${siteId}`,
2761
- method: "GET",
2762
- secure: true,
2763
- format: "json",
2764
- ...params
2765
- }),
2766
- updateSiteById: (organizationId, siteId, data, params = {}) => this.request({
2767
- path: `/orgs/${organizationId}/sites/${siteId}`,
2768
- method: "PATCH",
2769
- body: data,
2770
- secure: true,
2771
- type: "application/json" /* Json */,
2772
- format: "json",
2773
- ...params
2774
- }),
2775
- deleteSiteById: (organizationId, siteId, params = {}) => this.request({
2776
- path: `/orgs/${organizationId}/sites/${siteId}`,
2777
- method: "DELETE",
2778
- secure: true,
2779
- ...params
2780
- }),
2781
- publishSite: (organizationId, siteId, params = {}) => this.request({
2782
- path: `/orgs/${organizationId}/sites/${siteId}/publish`,
2783
- method: "POST",
2784
- secure: true,
2785
- format: "json",
2786
- ...params
2787
- }),
2788
- unpublishSite: (organizationId, siteId, params = {}) => this.request({
2789
- path: `/orgs/${organizationId}/sites/${siteId}/unpublish`,
2790
- method: "POST",
2791
- secure: true,
2792
- format: "json",
2793
- ...params
2794
- }),
2795
- listSiteShareLinks: (organizationId, siteId, query, params = {}) => this.request({
2796
- path: `/orgs/${organizationId}/sites/${siteId}/share-links`,
2797
- method: "GET",
2798
- query,
2799
- secure: true,
2800
- format: "json",
2801
- ...params
2802
- }),
2803
- createSiteShareLink: (organizationId, siteId, data, params = {}) => this.request({
2804
- path: `/orgs/${organizationId}/sites/${siteId}/share-links`,
2805
- method: "POST",
2806
- body: data,
2807
- secure: true,
2808
- type: "application/json" /* Json */,
2809
- format: "json",
2810
- ...params
2811
- }),
2812
- updateSiteShareLinkById: (organizationId, siteId, shareLinkId, data, params = {}) => this.request({
2813
- path: `/orgs/${organizationId}/sites/${siteId}/share-links/${shareLinkId}`,
2814
- method: "PATCH",
2815
- body: data,
2816
- secure: true,
2817
- type: "application/json" /* Json */,
2818
- format: "json",
2819
- ...params
2820
- }),
2821
- deleteSiteShareLinkById: (organizationId, siteId, shareLinkId, params = {}) => this.request({
2822
- path: `/orgs/${organizationId}/sites/${siteId}/share-links/${shareLinkId}`,
2823
- method: "DELETE",
2824
- secure: true,
2825
- ...params
2826
- }),
2827
- updateSitePlan: (organizationId, siteId, data, query, params = {}) => this.request({
2828
- path: `/orgs/${organizationId}/sites/${siteId}/plan`,
2829
- method: "POST",
2830
- query,
2831
- body: data,
2832
- secure: true,
2833
- type: "application/json" /* Json */,
2834
- format: "json",
2835
- ...params
2836
- }),
2837
- previewSitePlanUpdate: (organizationId, siteId, query, params = {}) => this.request({
2838
- path: `/orgs/${organizationId}/sites/${siteId}/plan`,
2839
- method: "GET",
2840
- query,
2841
- secure: true,
2842
- format: "json",
2843
- ...params
2844
- }),
2845
- getSitePublishingAuthById: (organizationId, siteId, params = {}) => this.request({
2846
- path: `/orgs/${organizationId}/sites/${siteId}/publishing/auth`,
2847
- method: "GET",
2848
- secure: true,
2849
- format: "json",
2850
- ...params
2851
- }),
2852
- updateSitePublishingAuthById: (organizationId, siteId, data, params = {}) => this.request({
2853
- path: `/orgs/${organizationId}/sites/${siteId}/publishing/auth`,
2854
- method: "PATCH",
2855
- body: data,
2856
- secure: true,
2857
- type: "application/json" /* Json */,
2858
- format: "json",
2859
- ...params
2860
- }),
2861
- regenerateSitePublishingAuthById: (organizationId, siteId, params = {}) => this.request({
2862
- path: `/orgs/${organizationId}/sites/${siteId}/publishing/auth/regenerate`,
2863
- method: "POST",
2864
- secure: true,
2865
- format: "json",
2866
- ...params
2867
- }),
2868
- getSitePublishingPreviewById: (organizationId, siteId, query, params = {}) => this.request({
2869
- path: `/orgs/${organizationId}/sites/${siteId}/publishing/preview`,
2870
- method: "GET",
2871
- query,
2872
- secure: true,
2873
- format: "json",
2874
- ...params
2875
- }),
2876
- getSiteCustomizationById: (organizationId, siteId, query, params = {}) => this.request({
2877
- path: `/orgs/${organizationId}/sites/${siteId}/customization`,
2878
- method: "GET",
2879
- query,
2880
- secure: true,
2881
- format: "json",
2882
- ...params
2883
- }),
2884
- updateSiteCustomizationById: (organizationId, siteId, data, params = {}) => this.request({
2885
- path: `/orgs/${organizationId}/sites/${siteId}/customization`,
2886
- method: "PUT",
2887
- body: data,
2888
- secure: true,
2889
- type: "application/json" /* Json */,
2890
- format: "json",
2891
- ...params
2892
- }),
2893
- getSiteRawCustomizationById: (organizationId, siteId, params = {}) => this.request({
2894
- path: `/orgs/${organizationId}/sites/${siteId}/customization/raw`,
2895
- method: "GET",
2896
- secure: true,
2897
- format: "json",
2898
- ...params
2899
- }),
2900
- listSiteIntegrationScripts: (organizationId, siteId, params = {}) => this.request({
2901
- path: `/orgs/${organizationId}/sites/${siteId}/integration-scripts`,
2902
- method: "GET",
2903
- secure: true,
2904
- format: "json",
2905
- ...params
2906
- }),
2907
- listSiteIntegrations: (organizationId, siteId, query, params = {}) => this.request({
2908
- path: `/orgs/${organizationId}/sites/${siteId}/integrations`,
2909
- method: "GET",
2910
- query,
2911
- secure: true,
2912
- format: "json",
2913
- ...params
2914
- }),
2915
- addSpaceToSite: (organizationId, siteId, data, params = {}) => this.request({
2916
- path: `/orgs/${organizationId}/sites/${siteId}/site-spaces`,
2917
- method: "POST",
2918
- body: data,
2919
- secure: true,
2920
- type: "application/json" /* Json */,
2921
- format: "json",
2922
- ...params
2923
- }),
2924
- listSiteSpaces: (organizationId, siteId, query, params = {}) => this.request({
2925
- path: `/orgs/${organizationId}/sites/${siteId}/site-spaces`,
2926
- method: "GET",
2927
- query,
2928
- secure: true,
2929
- format: "json",
2930
- ...params
2931
- }),
2932
- searchSiteContent: (organizationId, siteId, data, query, params = {}) => this.request({
2933
- path: `/orgs/${organizationId}/sites/${siteId}/search`,
2934
- method: "POST",
2935
- query,
2936
- body: data,
2937
- secure: true,
2938
- type: "application/json" /* Json */,
2939
- format: "json",
2940
- ...params
2941
- }),
2942
- updateSiteSpaceById: (organizationId, siteId, siteSpaceId, data, params = {}) => this.request({
2943
- path: `/orgs/${organizationId}/sites/${siteId}/site-spaces/${siteSpaceId}`,
2944
- method: "PATCH",
2945
- body: data,
2946
- secure: true,
2947
- type: "application/json" /* Json */,
2948
- format: "json",
2949
- ...params
2950
- }),
2951
- deleteSiteSpaceById: (organizationId, siteId, siteSpaceId, params = {}) => this.request({
2952
- path: `/orgs/${organizationId}/sites/${siteId}/site-spaces/${siteSpaceId}`,
2953
- method: "DELETE",
2954
- secure: true,
2955
- ...params
2956
- }),
2957
- getSiteSpaceCustomizationById: (organizationId, siteId, siteSpaceId, query, params = {}) => this.request({
2958
- path: `/orgs/${organizationId}/sites/${siteId}/site-spaces/${siteSpaceId}/customization`,
2959
- method: "GET",
2960
- query,
2961
- secure: true,
2962
- format: "json",
2963
- ...params
2964
- }),
2965
- overrideSiteSpaceCustomizationById: (organizationId, siteId, siteSpaceId, data, params = {}) => this.request({
2966
- path: `/orgs/${organizationId}/sites/${siteId}/site-spaces/${siteSpaceId}/customization`,
2967
- method: "PATCH",
2968
- body: data,
2969
- secure: true,
2970
- type: "application/json" /* Json */,
2971
- format: "json",
2972
- ...params
2973
- }),
2974
- getSiteSpaceRawCustomizationById: (organizationId, siteId, siteSpaceId, params = {}) => this.request({
2975
- path: `/orgs/${organizationId}/sites/${siteId}/site-spaces/${siteSpaceId}/customization/raw`,
2976
- method: "GET",
2977
- secure: true,
2978
- format: "json",
2979
- ...params
2980
- }),
2981
- getContentAnalyticsForSiteSpaceById: (organizationId, siteId, siteSpaceId, params = {}) => this.request({
2982
- path: `/orgs/${organizationId}/sites/${siteId}/site-spaces/${siteSpaceId}/insights/content`,
2983
- method: "GET",
2984
- secure: true,
2985
- format: "json",
2986
- ...params
2987
- }),
2988
- createSitesPageFeedback: (organizationId, siteId, siteSpaceId, pageId, visitorId, data, params = {}) => this.request({
2989
- path: `/orgs/${organizationId}/sites/${siteId}/site-spaces/${siteSpaceId}/insights/pages/${pageId}/feedbacks/${visitorId}`,
2990
- method: "PUT",
2991
- body: data,
2992
- secure: true,
2993
- type: "application/json" /* Json */,
2994
- format: "json",
2995
- ...params
2996
- }),
2997
- moveSiteSpace: (organizationId, siteId, siteSpaceId, data, params = {}) => this.request({
2998
- path: `/orgs/${organizationId}/sites/${siteId}/site-spaces/${siteSpaceId}/move`,
2999
- method: "POST",
3000
- body: data,
3001
- secure: true,
3002
- type: "application/json" /* Json */,
3003
- format: "json",
3004
- ...params
3005
- }),
3006
- listPermissionsAggregateInSite: (organizationId, siteId, query, params = {}) => this.request({
3007
- path: `/orgs/${organizationId}/sites/${siteId}/permissions/aggregate`,
3008
- method: "GET",
3009
- query,
3010
- secure: true,
3011
- format: "json",
3012
- ...params
3013
- }),
3014
- trackViewInSiteById: (organizationId, siteId, data, params = {}) => this.request({
3015
- path: `/orgs/${organizationId}/sites/${siteId}/insights/track_view`,
3016
- method: "POST",
3017
- body: data,
3018
- secure: true,
3019
- type: "application/json" /* Json */,
3020
- ...params
3021
- }),
3022
- getSearchAnalyticsForSiteById: (organizationId, siteId, data, params = {}) => this.request({
3023
- path: `/orgs/${organizationId}/sites/${siteId}/insights/search`,
3024
- method: "POST",
3025
- body: data,
3026
- secure: true,
3027
- type: "application/json" /* Json */,
3028
- format: "json",
3029
- ...params
3030
- }),
3031
- updateSiteAdsById: (organizationId, siteId, data, params = {}) => this.request({
3032
- path: `/orgs/${organizationId}/sites/${siteId}/ads`,
3033
- method: "POST",
3034
- body: data,
3035
- secure: true,
3036
- type: "application/json" /* Json */,
3037
- ...params
3038
- }),
3039
- getSiteAdsStatsById: (organizationId, siteId, params = {}) => this.request({
3040
- path: `/orgs/${organizationId}/sites/${siteId}/ads/stats`,
3041
- method: "POST",
3042
- secure: true,
3043
- format: "json",
3044
- ...params
3045
- })
3046
- };
3047
- this.customHostnames = {
3048
- getCustomHostname: (hostname, params = {}) => this.request({
3049
- path: `/custom-hostnames/${hostname}`,
3050
- method: "GET",
3051
- secure: true,
3052
- format: "json",
3053
- ...params
3054
- }),
3055
- setupCustomHostname: (hostname, data, params = {}) => this.request({
3056
- path: `/custom-hostnames/${hostname}`,
3057
- method: "POST",
3058
- body: data,
3059
- secure: true,
3060
- type: "application/json" /* Json */,
3061
- format: "json",
3062
- ...params
3063
- }),
3064
- dnsRevalidateCustomHostname: (hostname, params = {}) => this.request({
3065
- path: `/custom-hostnames/${hostname}`,
3066
- method: "PATCH",
3067
- secure: true,
3068
- ...params
3069
- }),
3070
- removeCustomHostname: (hostname, params = {}) => this.request({
3071
- path: `/custom-hostnames/${hostname}`,
3072
- method: "DELETE",
3073
- secure: true,
3074
- ...params
3075
- }),
3076
- testCustomHostname: (hostname, data, params = {}) => this.request({
3077
- path: `/custom-hostnames/${hostname}/test`,
3078
- method: "POST",
3079
- body: data,
3080
- secure: true,
3081
- type: "application/json" /* Json */,
3082
- ...params
3083
- })
3084
- };
3085
- this.ads = {
3086
- adsListSites: (query, params = {}) => this.request({
3087
- path: `/ads/sites`,
3088
- method: "GET",
3089
- query,
3090
- secure: true,
3091
- format: "json",
3092
- ...params
3093
- }),
3094
- adsUpdateSite: (siteId, data, params = {}) => this.request({
3095
- path: `/ads/sites/${siteId}`,
3096
- method: "PATCH",
3097
- body: data,
3098
- secure: true,
3099
- type: "application/json" /* Json */,
3100
- ...params
3101
- })
3102
- };
3103
- this.internal = {
3104
- generateHiveAccessToken: (data, params = {}) => this.request({
3105
- path: `/internal/hive/token`,
3106
- method: "POST",
3107
- body: data,
3108
- secure: true,
3109
- type: "application/json" /* Json */,
3110
- format: "json",
3111
- ...params
3112
- })
3113
- };
3114
- this.urls = {
3115
- getContentByUrl: (query, params = {}) => this.request({
3116
- path: `/urls/content`,
3117
- method: "GET",
3118
- query,
3119
- secure: true,
3120
- format: "json",
3121
- ...params
3122
- }),
3123
- getEmbedByUrl: (query, params = {}) => this.request({
3124
- path: `/urls/embed`,
3125
- method: "GET",
3126
- query,
3127
- secure: true,
3128
- format: "json",
3129
- ...params
3130
- }),
3131
- getPublishedContentByUrl: (query, params = {}) => this.request({
3132
- path: `/urls/published`,
3133
- method: "GET",
3134
- query,
3135
- secure: true,
3136
- format: "json",
3137
- ...params
3138
- })
3139
- };
3140
- }
916
+ }),
917
+ askQueryWithGet: (query, params = {}) => this.request({
918
+ path: `/search/ask`,
919
+ method: "GET",
920
+ query,
921
+ secure: true,
922
+ format: "json",
923
+ ...params
924
+ }),
925
+ askQuery: (data, query, params = {}) => this.request({
926
+ path: `/search/ask`,
927
+ method: "POST",
928
+ query,
929
+ body: data,
930
+ secure: true,
931
+ type: "application/json" /* Json */,
932
+ format: "json",
933
+ ...params
934
+ }),
935
+ getRecommendedQuestions: (data, params = {}) => this.request({
936
+ path: `/search/questions`,
937
+ method: "POST",
938
+ body: data,
939
+ secure: true,
940
+ type: "application/json" /* Json */,
941
+ format: "json",
942
+ ...params
943
+ })
944
+ };
945
+ user = {
946
+ getAuthenticatedUser: (params = {}) => this.request({
947
+ path: `/user`,
948
+ method: "GET",
949
+ secure: true,
950
+ format: "json",
951
+ ...params
952
+ })
953
+ };
954
+ users = {
955
+ getUserById: (userId, params = {}) => this.request({
956
+ path: `/users/${userId}`,
957
+ method: "GET",
958
+ secure: true,
959
+ format: "json",
960
+ ...params
961
+ })
962
+ };
963
+ spaces = {
964
+ getSpaceById: (spaceId, query, params = {}) => this.request({
965
+ path: `/spaces/${spaceId}`,
966
+ method: "GET",
967
+ query,
968
+ secure: true,
969
+ format: "json",
970
+ ...params
971
+ }),
972
+ updateSpaceById: (spaceId, data, params = {}) => this.request({
973
+ path: `/spaces/${spaceId}`,
974
+ method: "PATCH",
975
+ body: data,
976
+ secure: true,
977
+ type: "application/json" /* Json */,
978
+ format: "json",
979
+ ...params
980
+ }),
981
+ deleteSpaceById: (spaceId, params = {}) => this.request({
982
+ path: `/spaces/${spaceId}`,
983
+ method: "DELETE",
984
+ secure: true,
985
+ ...params
986
+ }),
987
+ duplicateSpace: (spaceId, params = {}) => this.request({
988
+ path: `/spaces/${spaceId}/duplicate`,
989
+ method: "POST",
990
+ secure: true,
991
+ format: "json",
992
+ ...params
993
+ }),
994
+ restoreSpace: (spaceId, params = {}) => this.request({
995
+ path: `/spaces/${spaceId}/restore`,
996
+ method: "POST",
997
+ secure: true,
998
+ format: "json",
999
+ ...params
1000
+ }),
1001
+ moveSpace: (spaceId, data, params = {}) => this.request({
1002
+ path: `/spaces/${spaceId}/move`,
1003
+ method: "POST",
1004
+ body: data,
1005
+ secure: true,
1006
+ type: "application/json" /* Json */,
1007
+ format: "json",
1008
+ ...params
1009
+ }),
1010
+ transferSpace: (spaceId, data, params = {}) => this.request({
1011
+ path: `/spaces/${spaceId}/transfer`,
1012
+ method: "POST",
1013
+ body: data,
1014
+ secure: true,
1015
+ type: "application/json" /* Json */,
1016
+ format: "json",
1017
+ ...params
1018
+ }),
1019
+ getEmbedByUrlInSpace: (spaceId, query, params = {}) => this.request({
1020
+ path: `/spaces/${spaceId}/embed`,
1021
+ method: "GET",
1022
+ query,
1023
+ secure: true,
1024
+ format: "json",
1025
+ ...params
1026
+ }),
1027
+ searchSpaceContent: (spaceId, query, params = {}) => this.request({
1028
+ path: `/spaces/${spaceId}/search`,
1029
+ method: "GET",
1030
+ query,
1031
+ secure: true,
1032
+ format: "json",
1033
+ ...params
1034
+ }),
1035
+ askQueryInSpaceWithGet: (spaceId, query, params = {}) => this.request({
1036
+ path: `/spaces/${spaceId}/search/ask`,
1037
+ method: "GET",
1038
+ query,
1039
+ secure: true,
1040
+ format: "json",
1041
+ ...params
1042
+ }),
1043
+ askQueryInSpace: (spaceId, data, query, params = {}) => this.request({
1044
+ path: `/spaces/${spaceId}/search/ask`,
1045
+ method: "POST",
1046
+ query,
1047
+ body: data,
1048
+ secure: true,
1049
+ type: "application/json" /* Json */,
1050
+ format: "json",
1051
+ ...params
1052
+ }),
1053
+ streamAskInSpace: (spaceId, query, params = {}) => this.streamRequest({
1054
+ path: `/spaces/${spaceId}/search/ask/stream`,
1055
+ method: "GET",
1056
+ query,
1057
+ secure: true,
1058
+ ...params
1059
+ }),
1060
+ getRecommendedQuestionsInSpace: (spaceId, params = {}) => this.request({
1061
+ path: `/spaces/${spaceId}/search/questions`,
1062
+ method: "GET",
1063
+ secure: true,
1064
+ format: "json",
1065
+ ...params
1066
+ }),
1067
+ streamRecommendedQuestionsInSpace: (spaceId, params = {}) => this.streamRequest({
1068
+ path: `/spaces/${spaceId}/search/questions/stream`,
1069
+ method: "GET",
1070
+ secure: true,
1071
+ ...params
1072
+ }),
1073
+ importGitRepository: (spaceId, data, params = {}) => this.request({
1074
+ path: `/spaces/${spaceId}/git/import`,
1075
+ method: "POST",
1076
+ body: data,
1077
+ secure: true,
1078
+ type: "application/json" /* Json */,
1079
+ ...params
1080
+ }),
1081
+ exportToGitRepository: (spaceId, data, params = {}) => this.request({
1082
+ path: `/spaces/${spaceId}/git/export`,
1083
+ method: "POST",
1084
+ body: data,
1085
+ secure: true,
1086
+ type: "application/json" /* Json */,
1087
+ ...params
1088
+ }),
1089
+ syncGitRepository: (spaceId, data, params = {}) => this.request({
1090
+ path: `/spaces/${spaceId}/git/sync`,
1091
+ method: "POST",
1092
+ body: data,
1093
+ secure: true,
1094
+ type: "application/json" /* Json */,
1095
+ ...params
1096
+ }),
1097
+ getSpaceGitInfo: (spaceId, params = {}) => this.request({
1098
+ path: `/spaces/${spaceId}/git/info`,
1099
+ method: "GET",
1100
+ secure: true,
1101
+ format: "json",
1102
+ ...params
1103
+ }),
1104
+ getContentAnalyticsForSpaceById: (spaceId, params = {}) => this.request({
1105
+ path: `/spaces/${spaceId}/insights/content`,
1106
+ method: "GET",
1107
+ secure: true,
1108
+ format: "json",
1109
+ ...params
1110
+ }),
1111
+ getSearchAnalyticsForSpaceById: (spaceId, query, params = {}) => this.request({
1112
+ path: `/spaces/${spaceId}/insights/search`,
1113
+ method: "GET",
1114
+ query,
1115
+ secure: true,
1116
+ format: "json",
1117
+ ...params
1118
+ }),
1119
+ getTrafficAnalyticsForSpaceById: (spaceId, query, params = {}) => this.request({
1120
+ path: `/spaces/${spaceId}/insights/traffic`,
1121
+ method: "GET",
1122
+ query,
1123
+ secure: true,
1124
+ format: "json",
1125
+ ...params
1126
+ }),
1127
+ trackViewInSpaceById: (spaceId, data, params = {}) => this.request({
1128
+ path: `/spaces/${spaceId}/insights/track_view`,
1129
+ method: "POST",
1130
+ body: data,
1131
+ secure: true,
1132
+ type: "application/json" /* Json */,
1133
+ ...params
1134
+ }),
1135
+ inviteToSpace: (spaceId, data, params = {}) => this.request({
1136
+ path: `/spaces/${spaceId}/permissions`,
1137
+ method: "POST",
1138
+ body: data,
1139
+ secure: true,
1140
+ type: "application/json" /* Json */,
1141
+ ...params
1142
+ }),
1143
+ removeTeamFromSpace: (spaceId, teamId, params = {}) => this.request({
1144
+ path: `/spaces/${spaceId}/permissions/teams/${teamId}`,
1145
+ method: "DELETE",
1146
+ secure: true,
1147
+ ...params
1148
+ }),
1149
+ getCurrentRevision: (spaceId, query, params = {}) => this.request({
1150
+ path: `/spaces/${spaceId}/content`,
1151
+ method: "GET",
1152
+ query,
1153
+ secure: true,
1154
+ format: "json",
1155
+ ...params
1156
+ }),
1157
+ importContent: (spaceId, data, params = {}) => this.request({
1158
+ path: `/spaces/${spaceId}/content/import`,
1159
+ method: "POST",
1160
+ body: data,
1161
+ secure: true,
1162
+ type: "application/json" /* Json */,
1163
+ format: "json",
1164
+ ...params
1165
+ }),
1166
+ listPages: (spaceId, query, params = {}) => this.request({
1167
+ path: `/spaces/${spaceId}/content/pages`,
1168
+ method: "GET",
1169
+ query,
1170
+ secure: true,
1171
+ format: "json",
1172
+ ...params
1173
+ }),
1174
+ listFiles: (spaceId, query, params = {}) => this.request({
1175
+ path: `/spaces/${spaceId}/content/files`,
1176
+ method: "GET",
1177
+ query,
1178
+ secure: true,
1179
+ format: "json",
1180
+ ...params
1181
+ }),
1182
+ getFileById: (spaceId, fileId, query, params = {}) => this.request({
1183
+ path: `/spaces/${spaceId}/content/files/${fileId}`,
1184
+ method: "GET",
1185
+ query,
1186
+ secure: true,
1187
+ format: "json",
1188
+ ...params
1189
+ }),
1190
+ listSpaceFileBacklinks: (spaceId, fileId, query, params = {}) => this.request({
1191
+ path: `/spaces/${spaceId}/content/files/${fileId}/backlinks`,
1192
+ method: "GET",
1193
+ query,
1194
+ secure: true,
1195
+ format: "json",
1196
+ ...params
1197
+ }),
1198
+ getPageById: (spaceId, pageId, query, params = {}) => this.request({
1199
+ path: `/spaces/${spaceId}/content/page/${pageId}`,
1200
+ method: "GET",
1201
+ query,
1202
+ secure: true,
1203
+ format: "json",
1204
+ ...params
1205
+ }),
1206
+ listPageLinksInSpace: (spaceId, pageId, query, params = {}) => this.request({
1207
+ path: `/spaces/${spaceId}/content/page/${pageId}/links`,
1208
+ method: "GET",
1209
+ query,
1210
+ secure: true,
1211
+ format: "json",
1212
+ ...params
1213
+ }),
1214
+ listSpacePageBacklinks: (spaceId, pageId, query, params = {}) => this.request({
1215
+ path: `/spaces/${spaceId}/content/page/${pageId}/backlinks`,
1216
+ method: "GET",
1217
+ query,
1218
+ secure: true,
1219
+ format: "json",
1220
+ ...params
1221
+ }),
1222
+ importContentInPageById: (spaceId, pageId, data, params = {}) => this.request({
1223
+ path: `/spaces/${spaceId}/content/page/${pageId}/import`,
1224
+ method: "POST",
1225
+ body: data,
1226
+ secure: true,
1227
+ type: "application/json" /* Json */,
1228
+ format: "json",
1229
+ ...params
1230
+ }),
1231
+ getPageByPath: (spaceId, pagePath, query, params = {}) => this.request({
1232
+ path: `/spaces/${spaceId}/content/path/${pagePath}`,
1233
+ method: "GET",
1234
+ query,
1235
+ secure: true,
1236
+ format: "json",
1237
+ ...params
1238
+ }),
1239
+ getDocumentById: (spaceId, documentId, query, params = {}) => this.request({
1240
+ path: `/spaces/${spaceId}/documents/${documentId}`,
1241
+ method: "GET",
1242
+ query,
1243
+ secure: true,
1244
+ format: "json",
1245
+ ...params
1246
+ }),
1247
+ createChangeRequest: (spaceId, data, params = {}) => this.request({
1248
+ path: `/spaces/${spaceId}/change-requests`,
1249
+ method: "POST",
1250
+ body: data,
1251
+ secure: true,
1252
+ type: "application/json" /* Json */,
1253
+ format: "json",
1254
+ ...params
1255
+ }),
1256
+ listChangeRequestsForSpace: (spaceId, query, params = {}) => this.request({
1257
+ path: `/spaces/${spaceId}/change-requests`,
1258
+ method: "GET",
1259
+ query,
1260
+ secure: true,
1261
+ format: "json",
1262
+ ...params
1263
+ }),
1264
+ getChangeRequestById: (spaceId, changeRequestId, params = {}) => this.request({
1265
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}`,
1266
+ method: "GET",
1267
+ secure: true,
1268
+ format: "json",
1269
+ ...params
1270
+ }),
1271
+ updateChangeRequestById: (spaceId, changeRequestId, data, params = {}) => this.request({
1272
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}`,
1273
+ method: "PATCH",
1274
+ body: data,
1275
+ secure: true,
1276
+ type: "application/json" /* Json */,
1277
+ format: "json",
1278
+ ...params
1279
+ }),
1280
+ mergeChangeRequest: (spaceId, changeRequestId, params = {}) => this.request({
1281
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}/merge`,
1282
+ method: "POST",
1283
+ secure: true,
1284
+ format: "json",
1285
+ ...params
1286
+ }),
1287
+ updateChangeRequest: (spaceId, changeRequestId, params = {}) => this.request({
1288
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}/update`,
1289
+ method: "POST",
1290
+ secure: true,
1291
+ format: "json",
1292
+ ...params
1293
+ }),
1294
+ getReviewsByChangeRequestId: (spaceId, changeRequestId, query, params = {}) => this.request({
1295
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}/reviews`,
1296
+ method: "GET",
1297
+ query,
1298
+ secure: true,
1299
+ format: "json",
1300
+ ...params
1301
+ }),
1302
+ submitChangeRequestReview: (spaceId, changeRequestId, data, params = {}) => this.request({
1303
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}/reviews`,
1304
+ method: "POST",
1305
+ body: data,
1306
+ secure: true,
1307
+ type: "application/json" /* Json */,
1308
+ format: "json",
1309
+ ...params
1310
+ }),
1311
+ getRequestedReviewersByChangeRequestId: (spaceId, changeRequestId, query, params = {}) => this.request({
1312
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}/requested-reviewers`,
1313
+ method: "GET",
1314
+ query,
1315
+ secure: true,
1316
+ format: "json",
1317
+ ...params
1318
+ }),
1319
+ requestReviewersForChangeRequest: (spaceId, changeRequestId, data, params = {}) => this.request({
1320
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}/requested-reviewers`,
1321
+ method: "POST",
1322
+ body: data,
1323
+ secure: true,
1324
+ type: "application/json" /* Json */,
1325
+ format: "json",
1326
+ ...params
1327
+ }),
1328
+ listChangeRequestLinks: (spaceId, changeRequestId, query, params = {}) => this.request({
1329
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}/links`,
1330
+ method: "GET",
1331
+ query,
1332
+ secure: true,
1333
+ format: "json",
1334
+ ...params
1335
+ }),
1336
+ listCommentsInChangeRequest: (spaceId, changeRequestId, query, params = {}) => this.request({
1337
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}/comments`,
1338
+ method: "GET",
1339
+ query,
1340
+ secure: true,
1341
+ format: "json",
1342
+ ...params
1343
+ }),
1344
+ postCommentInChangeRequest: (spaceId, changeRequestId, data, params = {}) => this.request({
1345
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}/comments`,
1346
+ method: "POST",
1347
+ body: data,
1348
+ secure: true,
1349
+ type: "application/json" /* Json */,
1350
+ format: "json",
1351
+ ...params
1352
+ }),
1353
+ getCommentInChangeRequest: (spaceId, changeRequestId, commentId, query, params = {}) => this.request({
1354
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}/comments/${commentId}`,
1355
+ method: "GET",
1356
+ query,
1357
+ secure: true,
1358
+ format: "json",
1359
+ ...params
1360
+ }),
1361
+ deleteCommentInChangeRequest: (spaceId, changeRequestId, commentId, params = {}) => this.request({
1362
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}/comments/${commentId}`,
1363
+ method: "DELETE",
1364
+ secure: true,
1365
+ ...params
1366
+ }),
1367
+ updateCommentInChangeRequest: (spaceId, changeRequestId, commentId, data, params = {}) => this.request({
1368
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}/comments/${commentId}`,
1369
+ method: "PUT",
1370
+ body: data,
1371
+ secure: true,
1372
+ type: "application/json" /* Json */,
1373
+ format: "json",
1374
+ ...params
1375
+ }),
1376
+ listCommentRepliesInChangeRequest: (spaceId, changeRequestId, commentId, query, params = {}) => this.request({
1377
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}/comments/${commentId}/replies`,
1378
+ method: "GET",
1379
+ query,
1380
+ secure: true,
1381
+ format: "json",
1382
+ ...params
1383
+ }),
1384
+ postCommentReplyInChangeRequest: (spaceId, changeRequestId, commentId, data, query, params = {}) => this.request({
1385
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}/comments/${commentId}/replies`,
1386
+ method: "POST",
1387
+ query,
1388
+ body: data,
1389
+ secure: true,
1390
+ type: "application/json" /* Json */,
1391
+ format: "json",
1392
+ ...params
1393
+ }),
1394
+ getCommentReplyInChangeRequest: (spaceId, changeRequestId, commentId, commentReplyId, query, params = {}) => this.request({
1395
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}/comments/${commentId}/replies/${commentReplyId}`,
1396
+ method: "GET",
1397
+ query,
1398
+ secure: true,
1399
+ format: "json",
1400
+ ...params
1401
+ }),
1402
+ updateCommentReplyInChangeRequest: (spaceId, changeRequestId, commentId, commentReplyId, data, params = {}) => this.request({
1403
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}/comments/${commentId}/replies/${commentReplyId}`,
1404
+ method: "PUT",
1405
+ body: data,
1406
+ secure: true,
1407
+ type: "application/json" /* Json */,
1408
+ format: "json",
1409
+ ...params
1410
+ }),
1411
+ deleteCommentReplyInChangeRequest: (spaceId, changeRequestId, commentId, commentReplyId, params = {}) => this.request({
1412
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}/comments/${commentId}/replies/${commentReplyId}`,
1413
+ method: "DELETE",
1414
+ secure: true,
1415
+ ...params
1416
+ }),
1417
+ getContributorsByChangeRequestId: (spaceId, changeRequestId, params = {}) => this.request({
1418
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}/contributors`,
1419
+ method: "GET",
1420
+ secure: true,
1421
+ format: "json",
1422
+ ...params
1423
+ }),
1424
+ getRevisionOfChangeRequestById: (spaceId, changeRequestId, query, params = {}) => this.request({
1425
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}/content`,
1426
+ method: "GET",
1427
+ query,
1428
+ secure: true,
1429
+ format: "json",
1430
+ ...params
1431
+ }),
1432
+ importContentInChangeRequest: (spaceId, changeRequestId, data, params = {}) => this.request({
1433
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}/content/import`,
1434
+ method: "POST",
1435
+ body: data,
1436
+ secure: true,
1437
+ type: "application/json" /* Json */,
1438
+ format: "json",
1439
+ ...params
1440
+ }),
1441
+ listPagesInChangeRequest: (spaceId, changeRequestId, query, params = {}) => this.request({
1442
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}/content/pages`,
1443
+ method: "GET",
1444
+ query,
1445
+ secure: true,
1446
+ format: "json",
1447
+ ...params
1448
+ }),
1449
+ listFilesInChangeRequestById: (spaceId, changeRequestId, query, params = {}) => this.request({
1450
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}/content/files`,
1451
+ method: "GET",
1452
+ query,
1453
+ secure: true,
1454
+ format: "json",
1455
+ ...params
1456
+ }),
1457
+ getFileInChangeRequestById: (spaceId, changeRequestId, fileId, query, params = {}) => this.request({
1458
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}/content/files/${fileId}`,
1459
+ method: "GET",
1460
+ query,
1461
+ secure: true,
1462
+ format: "json",
1463
+ ...params
1464
+ }),
1465
+ listChangeRequestFileBacklinks: (spaceId, changeRequestId, fileId, query, params = {}) => this.request({
1466
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}/content/files/${fileId}/backlinks`,
1467
+ method: "GET",
1468
+ query,
1469
+ secure: true,
1470
+ format: "json",
1471
+ ...params
1472
+ }),
1473
+ getPageInChangeRequestById: (spaceId, changeRequestId, pageId, query, params = {}) => this.request({
1474
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}/content/page/${pageId}`,
1475
+ method: "GET",
1476
+ query,
1477
+ secure: true,
1478
+ format: "json",
1479
+ ...params
1480
+ }),
1481
+ listPageLinksInChangeRequest: (spaceId, changeRequestId, pageId, query, params = {}) => this.request({
1482
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}/content/page/${pageId}/links`,
1483
+ method: "GET",
1484
+ query,
1485
+ secure: true,
1486
+ format: "json",
1487
+ ...params
1488
+ }),
1489
+ listChangeRequestPageBacklinks: (spaceId, changeRequestId, pageId, query, params = {}) => this.request({
1490
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}/content/page/${pageId}/backlinks`,
1491
+ method: "GET",
1492
+ query,
1493
+ secure: true,
1494
+ format: "json",
1495
+ ...params
1496
+ }),
1497
+ importContentInChangeRequestPageById: (spaceId, changeRequestId, pageId, data, params = {}) => this.request({
1498
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}/content/page/${pageId}/import`,
1499
+ method: "POST",
1500
+ body: data,
1501
+ secure: true,
1502
+ type: "application/json" /* Json */,
1503
+ format: "json",
1504
+ ...params
1505
+ }),
1506
+ getPageInChangeRequestByPath: (spaceId, changeRequestId, pagePath, query, params = {}) => this.request({
1507
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}/content/path/${pagePath}`,
1508
+ method: "GET",
1509
+ query,
1510
+ secure: true,
1511
+ format: "json",
1512
+ ...params
1513
+ }),
1514
+ touchContentInChangeRequest: (spaceId, changeRequestId, data, params = {}) => this.request({
1515
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}/touched-content`,
1516
+ method: "POST",
1517
+ body: data,
1518
+ secure: true,
1519
+ type: "application/json" /* Json */,
1520
+ format: "json",
1521
+ ...params
1522
+ }),
1523
+ getChangeRequestPdf: (spaceId, changeRequestId, query, params = {}) => this.request({
1524
+ path: `/spaces/${spaceId}/change-requests/${changeRequestId}/pdf`,
1525
+ method: "GET",
1526
+ query,
1527
+ secure: true,
1528
+ format: "json",
1529
+ ...params
1530
+ }),
1531
+ getRevisionById: (spaceId, revisionId, query, params = {}) => this.request({
1532
+ path: `/spaces/${spaceId}/revisions/${revisionId}`,
1533
+ method: "GET",
1534
+ query,
1535
+ secure: true,
1536
+ format: "json",
1537
+ ...params
1538
+ }),
1539
+ getRevisionSemanticChanges: (spaceId, revisionId, query, params = {}) => this.request({
1540
+ path: `/spaces/${spaceId}/revisions/${revisionId}/changes`,
1541
+ method: "GET",
1542
+ query,
1543
+ secure: true,
1544
+ format: "json",
1545
+ ...params
1546
+ }),
1547
+ listPagesInRevisionById: (spaceId, revisionId, query, params = {}) => this.request({
1548
+ path: `/spaces/${spaceId}/revisions/${revisionId}/pages`,
1549
+ method: "GET",
1550
+ query,
1551
+ secure: true,
1552
+ format: "json",
1553
+ ...params
1554
+ }),
1555
+ listFilesInRevisionById: (spaceId, revisionId, query, params = {}) => this.request({
1556
+ path: `/spaces/${spaceId}/revisions/${revisionId}/files`,
1557
+ method: "GET",
1558
+ query,
1559
+ secure: true,
1560
+ format: "json",
1561
+ ...params
1562
+ }),
1563
+ getFileInRevisionById: (spaceId, revisionId, fileId, query, params = {}) => this.request({
1564
+ path: `/spaces/${spaceId}/revisions/${revisionId}/files/${fileId}`,
1565
+ method: "GET",
1566
+ query,
1567
+ secure: true,
1568
+ format: "json",
1569
+ ...params
1570
+ }),
1571
+ getPageInRevisionById: (spaceId, revisionId, pageId, query, params = {}) => this.request({
1572
+ path: `/spaces/${spaceId}/revisions/${revisionId}/page/${pageId}`,
1573
+ method: "GET",
1574
+ query,
1575
+ secure: true,
1576
+ format: "json",
1577
+ ...params
1578
+ }),
1579
+ getPageInRevisionByPath: (spaceId, revisionId, pagePath, query, params = {}) => this.request({
1580
+ path: `/spaces/${spaceId}/revisions/${revisionId}/path/${pagePath}`,
1581
+ method: "GET",
1582
+ query,
1583
+ secure: true,
1584
+ format: "json",
1585
+ ...params
1586
+ }),
1587
+ listCommentsInSpace: (spaceId, query, params = {}) => this.request({
1588
+ path: `/spaces/${spaceId}/comments`,
1589
+ method: "GET",
1590
+ query,
1591
+ secure: true,
1592
+ format: "json",
1593
+ ...params
1594
+ }),
1595
+ postCommentInSpace: (spaceId, data, params = {}) => this.request({
1596
+ path: `/spaces/${spaceId}/comments`,
1597
+ method: "POST",
1598
+ body: data,
1599
+ secure: true,
1600
+ type: "application/json" /* Json */,
1601
+ format: "json",
1602
+ ...params
1603
+ }),
1604
+ getCommentInSpace: (spaceId, commentId, query, params = {}) => this.request({
1605
+ path: `/spaces/${spaceId}/comments/${commentId}`,
1606
+ method: "GET",
1607
+ query,
1608
+ secure: true,
1609
+ format: "json",
1610
+ ...params
1611
+ }),
1612
+ deleteCommentInSpace: (spaceId, commentId, params = {}) => this.request({
1613
+ path: `/spaces/${spaceId}/comments/${commentId}`,
1614
+ method: "DELETE",
1615
+ secure: true,
1616
+ ...params
1617
+ }),
1618
+ updateCommentInSpace: (spaceId, commentId, data, params = {}) => this.request({
1619
+ path: `/spaces/${spaceId}/comments/${commentId}`,
1620
+ method: "PUT",
1621
+ body: data,
1622
+ secure: true,
1623
+ type: "application/json" /* Json */,
1624
+ format: "json",
1625
+ ...params
1626
+ }),
1627
+ listCommentRepliesInSpace: (spaceId, commentId, query, params = {}) => this.request({
1628
+ path: `/spaces/${spaceId}/comments/${commentId}/replies`,
1629
+ method: "GET",
1630
+ query,
1631
+ secure: true,
1632
+ format: "json",
1633
+ ...params
1634
+ }),
1635
+ postCommentReplyInSpace: (spaceId, commentId, data, params = {}) => this.request({
1636
+ path: `/spaces/${spaceId}/comments/${commentId}/replies`,
1637
+ method: "POST",
1638
+ body: data,
1639
+ secure: true,
1640
+ type: "application/json" /* Json */,
1641
+ format: "json",
1642
+ ...params
1643
+ }),
1644
+ getCommentReplyInSpace: (spaceId, commentId, commentReplyId, query, params = {}) => this.request({
1645
+ path: `/spaces/${spaceId}/comments/${commentId}/replies/${commentReplyId}`,
1646
+ method: "GET",
1647
+ query,
1648
+ secure: true,
1649
+ format: "json",
1650
+ ...params
1651
+ }),
1652
+ updateCommentReplyInSpace: (spaceId, commentId, commentReplyId, data, params = {}) => this.request({
1653
+ path: `/spaces/${spaceId}/comments/${commentId}/replies/${commentReplyId}`,
1654
+ method: "PUT",
1655
+ body: data,
1656
+ secure: true,
1657
+ type: "application/json" /* Json */,
1658
+ format: "json",
1659
+ ...params
1660
+ }),
1661
+ deleteCommentReplyInSpace: (spaceId, commentId, commentReplyId, params = {}) => this.request({
1662
+ path: `/spaces/${spaceId}/comments/${commentId}/replies/${commentReplyId}`,
1663
+ method: "DELETE",
1664
+ secure: true,
1665
+ ...params
1666
+ }),
1667
+ listPermissionsAggregateInSpace: (spaceId, query, params = {}) => this.request({
1668
+ path: `/spaces/${spaceId}/permissions/aggregate`,
1669
+ method: "GET",
1670
+ query,
1671
+ secure: true,
1672
+ format: "json",
1673
+ ...params
1674
+ }),
1675
+ getSpacePublishingCustomizationById: (spaceId, params = {}) => this.request({
1676
+ path: `/spaces/${spaceId}/publishing/customization`,
1677
+ method: "GET",
1678
+ secure: true,
1679
+ format: "json",
1680
+ ...params
1681
+ }),
1682
+ updateSpacePublishingCustomizationById: (spaceId, data, params = {}) => this.request({
1683
+ path: `/spaces/${spaceId}/publishing/customization`,
1684
+ method: "PUT",
1685
+ body: data,
1686
+ secure: true,
1687
+ type: "application/json" /* Json */,
1688
+ format: "json",
1689
+ ...params
1690
+ }),
1691
+ listSpaceIntegrations: (spaceId, query, params = {}) => this.request({
1692
+ path: `/spaces/${spaceId}/integrations`,
1693
+ method: "GET",
1694
+ query,
1695
+ secure: true,
1696
+ format: "json",
1697
+ ...params
1698
+ }),
1699
+ listSpaceIntegrationsBlocks: (spaceId, params = {}) => this.request({
1700
+ path: `/spaces/${spaceId}/integration-blocks`,
1701
+ method: "GET",
1702
+ secure: true,
1703
+ format: "json",
1704
+ ...params
1705
+ }),
1706
+ listSpaceIntegrationScripts: (spaceId, params = {}) => this.request({
1707
+ path: `/spaces/${spaceId}/integration-scripts`,
1708
+ method: "GET",
1709
+ secure: true,
1710
+ format: "json",
1711
+ ...params
1712
+ }),
1713
+ getSpaceCustomFields: (spaceId, params = {}) => this.request({
1714
+ path: `/spaces/${spaceId}/custom-fields`,
1715
+ method: "GET",
1716
+ secure: true,
1717
+ format: "json",
1718
+ ...params
1719
+ }),
1720
+ updateSpaceCustomFields: (spaceId, data, params = {}) => this.request({
1721
+ path: `/spaces/${spaceId}/custom-fields`,
1722
+ method: "PATCH",
1723
+ body: data,
1724
+ secure: true,
1725
+ type: "application/json" /* Json */,
1726
+ ...params
1727
+ }),
1728
+ getPageFeedback: (spaceId, pageId, visitorId, params = {}) => this.request({
1729
+ path: `/spaces/${spaceId}/pages/${pageId}/feedbacks/${visitorId}`,
1730
+ method: "GET",
1731
+ secure: true,
1732
+ format: "json",
1733
+ ...params
1734
+ }),
1735
+ createPageFeedback: (spaceId, pageId, visitorId, data, params = {}) => this.request({
1736
+ path: `/spaces/${spaceId}/pages/${pageId}/feedbacks/${visitorId}`,
1737
+ method: "PUT",
1738
+ body: data,
1739
+ secure: true,
1740
+ type: "application/json" /* Json */,
1741
+ format: "json",
1742
+ ...params
1743
+ }),
1744
+ getSpacePdf: (spaceId, query, params = {}) => this.request({
1745
+ path: `/spaces/${spaceId}/pdf`,
1746
+ method: "GET",
1747
+ query,
1748
+ secure: true,
1749
+ format: "json",
1750
+ ...params
1751
+ }),
1752
+ createSpaceShareLink: (spaceId, data, params = {}) => this.request({
1753
+ path: `/spaces/${spaceId}/share-links`,
1754
+ method: "POST",
1755
+ body: data,
1756
+ secure: true,
1757
+ type: "application/json" /* Json */,
1758
+ format: "json",
1759
+ ...params
1760
+ }),
1761
+ updateSpaceShareLinkById: (spaceId, shareLinkId, data, params = {}) => this.request({
1762
+ path: `/spaces/${spaceId}/share-links/${shareLinkId}`,
1763
+ method: "PATCH",
1764
+ body: data,
1765
+ secure: true,
1766
+ type: "application/json" /* Json */,
1767
+ format: "json",
1768
+ ...params
1769
+ }),
1770
+ deleteSpaceShareLinkById: (spaceId, shareLinkId, params = {}) => this.request({
1771
+ path: `/spaces/${spaceId}/share-links/${shareLinkId}`,
1772
+ method: "DELETE",
1773
+ secure: true,
1774
+ ...params
1775
+ }),
1776
+ listSpaceLinks: (spaceId, query, params = {}) => this.request({
1777
+ path: `/spaces/${spaceId}/links`,
1778
+ method: "GET",
1779
+ query,
1780
+ secure: true,
1781
+ format: "json",
1782
+ ...params
1783
+ })
1784
+ };
1785
+ collections = {
1786
+ getCollectionById: (collectionId, params = {}) => this.request({
1787
+ path: `/collections/${collectionId}`,
1788
+ method: "GET",
1789
+ secure: true,
1790
+ format: "json",
1791
+ ...params
1792
+ }),
1793
+ updateCollectionById: (collectionId, data, params = {}) => this.request({
1794
+ path: `/collections/${collectionId}`,
1795
+ method: "PATCH",
1796
+ body: data,
1797
+ secure: true,
1798
+ type: "application/json" /* Json */,
1799
+ format: "json",
1800
+ ...params
1801
+ }),
1802
+ deleteCollectionById: (collectionId, params = {}) => this.request({
1803
+ path: `/collections/${collectionId}`,
1804
+ method: "DELETE",
1805
+ secure: true,
1806
+ ...params
1807
+ }),
1808
+ listSpacesInCollectionById: (collectionId, query, params = {}) => this.request({
1809
+ path: `/collections/${collectionId}/spaces`,
1810
+ method: "GET",
1811
+ query,
1812
+ secure: true,
1813
+ format: "json",
1814
+ ...params
1815
+ }),
1816
+ moveCollection: (collectionId, data, params = {}) => this.request({
1817
+ path: `/collections/${collectionId}/move`,
1818
+ method: "POST",
1819
+ body: data,
1820
+ secure: true,
1821
+ type: "application/json" /* Json */,
1822
+ format: "json",
1823
+ ...params
1824
+ }),
1825
+ transferCollection: (collectionId, data, params = {}) => this.request({
1826
+ path: `/collections/${collectionId}/transfer`,
1827
+ method: "POST",
1828
+ body: data,
1829
+ secure: true,
1830
+ type: "application/json" /* Json */,
1831
+ format: "json",
1832
+ ...params
1833
+ }),
1834
+ listPermissionsAggregateInCollection: (collectionId, query, params = {}) => this.request({
1835
+ path: `/collections/${collectionId}/permissions/aggregate`,
1836
+ method: "GET",
1837
+ query,
1838
+ secure: true,
1839
+ format: "json",
1840
+ ...params
1841
+ }),
1842
+ getCollectionPublishingCustomizationById: (collectionId, params = {}) => this.request({
1843
+ path: `/collections/${collectionId}/publishing/customization`,
1844
+ method: "GET",
1845
+ secure: true,
1846
+ format: "json",
1847
+ ...params
1848
+ }),
1849
+ updateCollectionPublishingCustomizationById: (collectionId, data, params = {}) => this.request({
1850
+ path: `/collections/${collectionId}/publishing/customization`,
1851
+ method: "PUT",
1852
+ body: data,
1853
+ secure: true,
1854
+ type: "application/json" /* Json */,
1855
+ format: "json",
1856
+ ...params
1857
+ }),
1858
+ createCollectionShareLink: (collectionId, data, params = {}) => this.request({
1859
+ path: `/collections/${collectionId}/share-links`,
1860
+ method: "POST",
1861
+ body: data,
1862
+ secure: true,
1863
+ type: "application/json" /* Json */,
1864
+ format: "json",
1865
+ ...params
1866
+ }),
1867
+ updateCollectionShareLinkById: (collectionId, shareLinkId, data, params = {}) => this.request({
1868
+ path: `/collections/${collectionId}/share-links/${shareLinkId}`,
1869
+ method: "PATCH",
1870
+ body: data,
1871
+ secure: true,
1872
+ type: "application/json" /* Json */,
1873
+ format: "json",
1874
+ ...params
1875
+ }),
1876
+ deleteCollectionShareLinkById: (collectionId, shareLinkId, params = {}) => this.request({
1877
+ path: `/collections/${collectionId}/share-links/${shareLinkId}`,
1878
+ method: "DELETE",
1879
+ secure: true,
1880
+ ...params
1881
+ })
1882
+ };
1883
+ integrations = {
1884
+ listIntegrations: (query, params = {}) => this.request({
1885
+ path: `/integrations`,
1886
+ method: "GET",
1887
+ query,
1888
+ secure: true,
1889
+ format: "json",
1890
+ ...params
1891
+ }),
1892
+ getIntegrationByName: (integrationName, params = {}) => this.request({
1893
+ path: `/integrations/${integrationName}`,
1894
+ method: "GET",
1895
+ secure: true,
1896
+ format: "json",
1897
+ ...params
1898
+ }),
1899
+ publishIntegration: (integrationName, data, params = {}) => this.request({
1900
+ path: `/integrations/${integrationName}`,
1901
+ method: "POST",
1902
+ body: data,
1903
+ secure: true,
1904
+ type: "application/json" /* Json */,
1905
+ format: "json",
1906
+ ...params
1907
+ }),
1908
+ unpublishIntegration: (integrationName, params = {}) => this.request({
1909
+ path: `/integrations/${integrationName}`,
1910
+ method: "DELETE",
1911
+ secure: true,
1912
+ ...params
1913
+ }),
1914
+ listIntegrationInstallations: (integrationName, query, params = {}) => this.request({
1915
+ path: `/integrations/${integrationName}/installations`,
1916
+ method: "GET",
1917
+ query,
1918
+ secure: true,
1919
+ format: "json",
1920
+ ...params
1921
+ }),
1922
+ installIntegration: (integrationName, data, params = {}) => this.request({
1923
+ path: `/integrations/${integrationName}/installations`,
1924
+ method: "POST",
1925
+ body: data,
1926
+ secure: true,
1927
+ type: "application/json" /* Json */,
1928
+ format: "json",
1929
+ ...params
1930
+ }),
1931
+ listIntegrationEvents: (integrationName, query, params = {}) => this.request({
1932
+ path: `/integrations/${integrationName}/events`,
1933
+ method: "GET",
1934
+ query,
1935
+ secure: true,
1936
+ format: "json",
1937
+ ...params
1938
+ }),
1939
+ getIntegrationEvent: (integrationName, eventId, params = {}) => this.request({
1940
+ path: `/integrations/${integrationName}/events/${eventId}`,
1941
+ method: "GET",
1942
+ secure: true,
1943
+ format: "json",
1944
+ ...params
1945
+ }),
1946
+ listIntegrationSpaceInstallations: (integrationName, query, params = {}) => this.request({
1947
+ path: `/integrations/${integrationName}/spaces`,
1948
+ method: "GET",
1949
+ query,
1950
+ secure: true,
1951
+ format: "json",
1952
+ ...params
1953
+ }),
1954
+ setIntegrationDevelopmentMode: (integrationName, data, params = {}) => this.request({
1955
+ path: `/integrations/${integrationName}/dev`,
1956
+ method: "PUT",
1957
+ body: data,
1958
+ secure: true,
1959
+ type: "application/json" /* Json */,
1960
+ ...params
1961
+ }),
1962
+ disableIntegrationDevelopmentMode: (integrationName, params = {}) => this.request({
1963
+ path: `/integrations/${integrationName}/dev`,
1964
+ method: "DELETE",
1965
+ secure: true,
1966
+ ...params
1967
+ }),
1968
+ renderIntegrationUiWithGet: (integrationName, query, params = {}) => this.request({
1969
+ path: `/integrations/${integrationName}/render`,
1970
+ method: "GET",
1971
+ query,
1972
+ secure: true,
1973
+ format: "json",
1974
+ ...params
1975
+ }),
1976
+ renderIntegrationUiWithPost: (integrationName, data, params = {}) => this.request({
1977
+ path: `/integrations/${integrationName}/render`,
1978
+ method: "POST",
1979
+ body: data,
1980
+ secure: true,
1981
+ type: "application/json" /* Json */,
1982
+ format: "json",
1983
+ ...params
1984
+ }),
1985
+ queueIntegrationTask: (integrationName, data, params = {}) => this.request({
1986
+ path: `/integrations/${integrationName}/tasks`,
1987
+ method: "POST",
1988
+ body: data,
1989
+ secure: true,
1990
+ type: "application/json" /* Json */,
1991
+ ...params
1992
+ }),
1993
+ getIntegrationInstallationById: (integrationName, installationId, params = {}) => this.request({
1994
+ path: `/integrations/${integrationName}/installations/${installationId}`,
1995
+ method: "GET",
1996
+ secure: true,
1997
+ format: "json",
1998
+ ...params
1999
+ }),
2000
+ updateIntegrationInstallation: (integrationName, installationId, data, params = {}) => this.request({
2001
+ path: `/integrations/${integrationName}/installations/${installationId}`,
2002
+ method: "PATCH",
2003
+ body: data,
2004
+ secure: true,
2005
+ type: "application/json" /* Json */,
2006
+ format: "json",
2007
+ ...params
2008
+ }),
2009
+ uninstallIntegration: (integrationName, installationId, params = {}) => this.request({
2010
+ path: `/integrations/${integrationName}/installations/${installationId}`,
2011
+ method: "DELETE",
2012
+ secure: true,
2013
+ ...params
2014
+ }),
2015
+ createIntegrationInstallationToken: (integrationName, installationId, params = {}) => this.request({
2016
+ path: `/integrations/${integrationName}/installations/${installationId}/tokens`,
2017
+ method: "POST",
2018
+ secure: true,
2019
+ format: "json",
2020
+ ...params
2021
+ }),
2022
+ listIntegrationInstallationSpaces: (integrationName, installationId, query, params = {}) => this.request({
2023
+ path: `/integrations/${integrationName}/installations/${installationId}/spaces`,
2024
+ method: "GET",
2025
+ query,
2026
+ secure: true,
2027
+ format: "json",
2028
+ ...params
2029
+ }),
2030
+ installIntegrationOnSpace: (integrationName, installationId, data, params = {}) => this.request({
2031
+ path: `/integrations/${integrationName}/installations/${installationId}/spaces`,
2032
+ method: "POST",
2033
+ body: data,
2034
+ secure: true,
2035
+ type: "application/json" /* Json */,
2036
+ format: "json",
2037
+ ...params
2038
+ }),
2039
+ getIntegrationSpaceInstallation: (integrationName, installationId, spaceId, params = {}) => this.request({
2040
+ path: `/integrations/${integrationName}/installations/${installationId}/spaces/${spaceId}`,
2041
+ method: "GET",
2042
+ secure: true,
2043
+ format: "json",
2044
+ ...params
2045
+ }),
2046
+ updateIntegrationSpaceInstallation: (integrationName, installationId, spaceId, data, params = {}) => this.request({
2047
+ path: `/integrations/${integrationName}/installations/${installationId}/spaces/${spaceId}`,
2048
+ method: "PATCH",
2049
+ body: data,
2050
+ secure: true,
2051
+ type: "application/json" /* Json */,
2052
+ format: "json",
2053
+ ...params
2054
+ }),
2055
+ uninstallIntegrationFromSpace: (integrationName, installationId, spaceId, params = {}) => this.request({
2056
+ path: `/integrations/${integrationName}/installations/${installationId}/spaces/${spaceId}`,
2057
+ method: "DELETE",
2058
+ secure: true,
2059
+ ...params
2060
+ }),
2061
+ listIntegrationInstallationSites: (integrationName, installationId, query, params = {}) => this.request({
2062
+ path: `/integrations/${integrationName}/installations/${installationId}/sites`,
2063
+ method: "GET",
2064
+ query,
2065
+ secure: true,
2066
+ format: "json",
2067
+ ...params
2068
+ }),
2069
+ installIntegrationOnSite: (integrationName, installationId, data, params = {}) => this.request({
2070
+ path: `/integrations/${integrationName}/installations/${installationId}/sites`,
2071
+ method: "POST",
2072
+ body: data,
2073
+ secure: true,
2074
+ type: "application/json" /* Json */,
2075
+ format: "json",
2076
+ ...params
2077
+ }),
2078
+ getIntegrationSiteInstallation: (integrationName, installationId, siteId, params = {}) => this.request({
2079
+ path: `/integrations/${integrationName}/installations/${installationId}/sites/${siteId}`,
2080
+ method: "GET",
2081
+ secure: true,
2082
+ format: "json",
2083
+ ...params
2084
+ }),
2085
+ updateIntegrationSiteInstallation: (integrationName, installationId, siteId, data, params = {}) => this.request({
2086
+ path: `/integrations/${integrationName}/installations/${installationId}/sites/${siteId}`,
2087
+ method: "PATCH",
2088
+ body: data,
2089
+ secure: true,
2090
+ type: "application/json" /* Json */,
2091
+ format: "json",
2092
+ ...params
2093
+ }),
2094
+ uninstallIntegrationFromSite: (integrationName, installationId, siteId, params = {}) => this.request({
2095
+ path: `/integrations/${integrationName}/installations/${installationId}/sites/${siteId}`,
2096
+ method: "DELETE",
2097
+ secure: true,
2098
+ ...params
2099
+ })
2100
+ };
2101
+ orgs = {
2102
+ listOrganizationsForAuthenticatedUser: (query, params = {}) => this.request({
2103
+ path: `/orgs`,
2104
+ method: "GET",
2105
+ query,
2106
+ secure: true,
2107
+ format: "json",
2108
+ ...params
2109
+ }),
2110
+ createOrganization: (data, params = {}) => this.request({
2111
+ path: `/orgs`,
2112
+ method: "POST",
2113
+ body: data,
2114
+ secure: true,
2115
+ type: "application/json" /* Json */,
2116
+ format: "json",
2117
+ ...params
2118
+ }),
2119
+ getOrganizationById: (organizationId, params = {}) => this.request({
2120
+ path: `/orgs/${organizationId}`,
2121
+ method: "GET",
2122
+ secure: true,
2123
+ format: "json",
2124
+ ...params
2125
+ }),
2126
+ deleteOrganizationById: (organizationId, params = {}) => this.request({
2127
+ path: `/orgs/${organizationId}`,
2128
+ method: "DELETE",
2129
+ secure: true,
2130
+ ...params
2131
+ }),
2132
+ updateOrganizationById: (organizationId, data, params = {}) => this.request({
2133
+ path: `/orgs/${organizationId}`,
2134
+ method: "PATCH",
2135
+ body: data,
2136
+ secure: true,
2137
+ type: "application/json" /* Json */,
2138
+ format: "json",
2139
+ ...params
2140
+ }),
2141
+ listMembersInOrganizationById: (organizationId, query, params = {}) => this.request({
2142
+ path: `/orgs/${organizationId}/members`,
2143
+ method: "GET",
2144
+ query,
2145
+ secure: true,
2146
+ format: "json",
2147
+ ...params
2148
+ }),
2149
+ getMemberInOrganizationById: (organizationId, userId, params = {}) => this.request({
2150
+ path: `/orgs/${organizationId}/members/${userId}`,
2151
+ method: "GET",
2152
+ secure: true,
2153
+ format: "json",
2154
+ ...params
2155
+ }),
2156
+ updateMemberInOrganizationById: (organizationId, userId, data, params = {}) => this.request({
2157
+ path: `/orgs/${organizationId}/members/${userId}`,
2158
+ method: "PATCH",
2159
+ body: data,
2160
+ secure: true,
2161
+ type: "application/json" /* Json */,
2162
+ format: "json",
2163
+ ...params
2164
+ }),
2165
+ removeMemberFromOrganizationById: (organizationId, userId, params = {}) => this.request({
2166
+ path: `/orgs/${organizationId}/members/${userId}`,
2167
+ method: "DELETE",
2168
+ secure: true,
2169
+ ...params
2170
+ }),
2171
+ updateOrganizationMemberLastSeenAt: (organizationId, params = {}) => this.request({
2172
+ path: `/orgs/${organizationId}/ping`,
2173
+ method: "POST",
2174
+ secure: true,
2175
+ ...params
2176
+ }),
2177
+ setUserAsSsoMemberForOrganization: (organizationId, userId, params = {}) => this.request({
2178
+ path: `/orgs/${organizationId}/members/${userId}/sso`,
2179
+ method: "POST",
2180
+ secure: true,
2181
+ format: "json",
2182
+ ...params
2183
+ }),
2184
+ listSpacesForOrganizationMember: (organizationId, userId, query, params = {}) => this.request({
2185
+ path: `/orgs/${organizationId}/members/${userId}/spaces`,
2186
+ method: "GET",
2187
+ query,
2188
+ secure: true,
2189
+ format: "json",
2190
+ ...params
2191
+ }),
2192
+ listTeamsForOrganizationMember: (organizationId, userId, query, params = {}) => this.request({
2193
+ path: `/orgs/${organizationId}/members/${userId}/teams`,
2194
+ method: "GET",
2195
+ query,
2196
+ secure: true,
2197
+ format: "json",
2198
+ ...params
2199
+ }),
2200
+ listTeamsInOrganizationById: (organizationId, query, params = {}) => this.request({
2201
+ path: `/orgs/${organizationId}/teams`,
2202
+ method: "GET",
2203
+ query,
2204
+ secure: true,
2205
+ format: "json",
2206
+ ...params
2207
+ }),
2208
+ createOrganizationTeam: (organizationId, data, params = {}) => this.request({
2209
+ path: `/orgs/${organizationId}/teams`,
2210
+ method: "PUT",
2211
+ body: data,
2212
+ secure: true,
2213
+ type: "application/json" /* Json */,
2214
+ format: "json",
2215
+ ...params
2216
+ }),
2217
+ getTeamInOrganizationById: (organizationId, teamId, params = {}) => this.request({
2218
+ path: `/orgs/${organizationId}/teams/${teamId}`,
2219
+ method: "GET",
2220
+ secure: true,
2221
+ format: "json",
2222
+ ...params
2223
+ }),
2224
+ updateTeamInOrganizationById: (organizationId, teamId, data, params = {}) => this.request({
2225
+ path: `/orgs/${organizationId}/teams/${teamId}`,
2226
+ method: "PATCH",
2227
+ body: data,
2228
+ secure: true,
2229
+ type: "application/json" /* Json */,
2230
+ format: "json",
2231
+ ...params
2232
+ }),
2233
+ removeTeamFromOrganizationById: (organizationId, teamId, params = {}) => this.request({
2234
+ path: `/orgs/${organizationId}/teams/${teamId}`,
2235
+ method: "DELETE",
2236
+ secure: true,
2237
+ ...params
2238
+ }),
2239
+ updateMembersInOrganizationTeam: (organizationId, teamId, data, params = {}) => this.request({
2240
+ path: `/orgs/${organizationId}/teams/${teamId}/members`,
2241
+ method: "PUT",
2242
+ body: data,
2243
+ secure: true,
2244
+ type: "application/json" /* Json */,
2245
+ ...params
2246
+ }),
2247
+ listTeamMembersInOrganizationById: (organizationId, teamId, query, params = {}) => this.request({
2248
+ path: `/orgs/${organizationId}/teams/${teamId}/members`,
2249
+ method: "GET",
2250
+ query,
2251
+ secure: true,
2252
+ format: "json",
2253
+ ...params
2254
+ }),
2255
+ addMemberToOrganizationTeamById: (organizationId, teamId, userId, data, params = {}) => this.request({
2256
+ path: `/orgs/${organizationId}/teams/${teamId}/members/${userId}`,
2257
+ method: "PUT",
2258
+ body: data,
2259
+ secure: true,
2260
+ type: "application/json" /* Json */,
2261
+ ...params
2262
+ }),
2263
+ deleteMemberFromOrganizationTeamById: (organizationId, teamId, userId, params = {}) => this.request({
2264
+ path: `/orgs/${organizationId}/teams/${teamId}/members/${userId}`,
2265
+ method: "DELETE",
2266
+ secure: true,
2267
+ ...params
2268
+ }),
2269
+ inviteUsersToOrganization: (organizationId, data, params = {}) => this.request({
2270
+ path: `/orgs/${organizationId}/invites`,
2271
+ method: "POST",
2272
+ body: data,
2273
+ secure: true,
2274
+ type: "application/json" /* Json */,
2275
+ format: "json",
2276
+ ...params
2277
+ }),
2278
+ joinOrganizationWithInvite: (organizationId, inviteId, params = {}) => this.request({
2279
+ path: `/orgs/${organizationId}/invites/${inviteId}`,
2280
+ method: "POST",
2281
+ secure: true,
2282
+ format: "json",
2283
+ ...params
2284
+ }),
2285
+ createOrganizationInvite: (organizationId, data, params = {}) => this.request({
2286
+ path: `/orgs/${organizationId}/link-invites`,
2287
+ method: "POST",
2288
+ body: data,
2289
+ secure: true,
2290
+ type: "application/json" /* Json */,
2291
+ format: "json",
2292
+ ...params
2293
+ }),
2294
+ updateOrganizationInviteById: (organizationId, inviteId, data, params = {}) => this.request({
2295
+ path: `/orgs/${organizationId}/link-invites/${inviteId}`,
2296
+ method: "PATCH",
2297
+ body: data,
2298
+ secure: true,
2299
+ type: "application/json" /* Json */,
2300
+ format: "json",
2301
+ ...params
2302
+ }),
2303
+ deleteOrganizationInviteById: (organizationId, inviteId, params = {}) => this.request({
2304
+ path: `/orgs/${organizationId}/link-invites/${inviteId}`,
2305
+ method: "DELETE",
2306
+ secure: true,
2307
+ ...params
2308
+ }),
2309
+ upgradeOrganizationPlan: (organizationId, data, query, params = {}) => this.request({
2310
+ path: `/orgs/${organizationId}/billing`,
2311
+ method: "POST",
2312
+ query,
2313
+ body: data,
2314
+ secure: true,
2315
+ type: "application/json" /* Json */,
2316
+ format: "json",
2317
+ ...params
2318
+ }),
2319
+ getOrganizationBillingPortal: (organizationId, params = {}) => this.request({
2320
+ path: `/orgs/${organizationId}/billing`,
2321
+ method: "GET",
2322
+ secure: true,
2323
+ format: "json",
2324
+ ...params
2325
+ }),
2326
+ previewBillingInvoice: (organizationId, query, params = {}) => this.request({
2327
+ path: `/orgs/${organizationId}/billing/preview`,
2328
+ method: "GET",
2329
+ query,
2330
+ secure: true,
2331
+ format: "json",
2332
+ ...params
2333
+ }),
2334
+ requestOrganizationUpgrade: (organizationId, params = {}) => this.request({
2335
+ path: `/orgs/${organizationId}/request_upgrade`,
2336
+ method: "POST",
2337
+ secure: true,
2338
+ format: "json",
2339
+ ...params
2340
+ }),
2341
+ searchOrganizationContent: (organizationId, query, params = {}) => this.request({
2342
+ path: `/orgs/${organizationId}/search`,
2343
+ method: "GET",
2344
+ query,
2345
+ secure: true,
2346
+ format: "json",
2347
+ ...params
2348
+ }),
2349
+ listSpacesInOrganizationById: (organizationId, query, params = {}) => this.request({
2350
+ path: `/orgs/${organizationId}/spaces`,
2351
+ method: "GET",
2352
+ query,
2353
+ secure: true,
2354
+ format: "json",
2355
+ ...params
2356
+ }),
2357
+ createSpace: (organizationId, data, params = {}) => this.request({
2358
+ path: `/orgs/${organizationId}/spaces`,
2359
+ method: "POST",
2360
+ body: data,
2361
+ secure: true,
2362
+ type: "application/json" /* Json */,
2363
+ format: "json",
2364
+ ...params
2365
+ }),
2366
+ listSpacesWithGitSyncInOrganizationById: (organizationId, query, params = {}) => this.request({
2367
+ path: `/orgs/${organizationId}/spaces/gitsync`,
2368
+ method: "GET",
2369
+ query,
2370
+ secure: true,
2371
+ format: "json",
2372
+ ...params
2373
+ }),
2374
+ listCollectionsInOrganizationById: (organizationId, query, params = {}) => this.request({
2375
+ path: `/orgs/${organizationId}/collections`,
2376
+ method: "GET",
2377
+ query,
2378
+ secure: true,
2379
+ format: "json",
2380
+ ...params
2381
+ }),
2382
+ createCollection: (organizationId, data, params = {}) => this.request({
2383
+ path: `/orgs/${organizationId}/collections`,
2384
+ method: "POST",
2385
+ body: data,
2386
+ secure: true,
2387
+ type: "application/json" /* Json */,
2388
+ format: "json",
2389
+ ...params
2390
+ }),
2391
+ listOrganizationCustomFields: (organizationId, query, params = {}) => this.request({
2392
+ path: `/orgs/${organizationId}/custom-fields`,
2393
+ method: "GET",
2394
+ query,
2395
+ secure: true,
2396
+ format: "json",
2397
+ ...params
2398
+ }),
2399
+ createOrganizationCustomField: (organizationId, data, params = {}) => this.request({
2400
+ path: `/orgs/${organizationId}/custom-fields`,
2401
+ method: "POST",
2402
+ body: data,
2403
+ secure: true,
2404
+ type: "application/json" /* Json */,
2405
+ format: "json",
2406
+ ...params
2407
+ }),
2408
+ getOrganizationCustomFieldByName: (organizationId, fieldName, params = {}) => this.request({
2409
+ path: `/orgs/${organizationId}/custom-fields/${fieldName}`,
2410
+ method: "GET",
2411
+ secure: true,
2412
+ format: "json",
2413
+ ...params
2414
+ }),
2415
+ updateOrganizationCustomField: (organizationId, fieldName, data, params = {}) => this.request({
2416
+ path: `/orgs/${organizationId}/custom-fields/${fieldName}`,
2417
+ method: "PATCH",
2418
+ body: data,
2419
+ secure: true,
2420
+ type: "application/json" /* Json */,
2421
+ format: "json",
2422
+ ...params
2423
+ }),
2424
+ deleteOrganizationCustomField: (organizationId, fieldName, params = {}) => this.request({
2425
+ path: `/orgs/${organizationId}/custom-fields/${fieldName}`,
2426
+ method: "DELETE",
2427
+ secure: true,
2428
+ ...params
2429
+ }),
2430
+ listOrganizationIntegrations: (organizationId, query, params = {}) => this.request({
2431
+ path: `/orgs/${organizationId}/integrations`,
2432
+ method: "GET",
2433
+ query,
2434
+ secure: true,
2435
+ format: "json",
2436
+ ...params
2437
+ }),
2438
+ getOrganizationIntegrationStatus: (organizationId, integrationName, params = {}) => this.request({
2439
+ path: `/orgs/${organizationId}/integrations/${integrationName}/installation_status`,
2440
+ method: "GET",
2441
+ secure: true,
2442
+ format: "json",
2443
+ ...params
2444
+ }),
2445
+ listOrganizationInstallations: (organizationId, query, params = {}) => this.request({
2446
+ path: `/orgs/${organizationId}/installations`,
2447
+ method: "GET",
2448
+ query,
2449
+ secure: true,
2450
+ format: "json",
2451
+ ...params
2452
+ }),
2453
+ listOrganizationIntegrationsStatus: (organizationId, query, params = {}) => this.request({
2454
+ path: `/orgs/${organizationId}/integrations/installations-status`,
2455
+ method: "GET",
2456
+ query,
2457
+ secure: true,
2458
+ format: "json",
2459
+ ...params
2460
+ }),
2461
+ listOrgExperimentalFeatures: (organizationId, params = {}) => this.request({
2462
+ path: `/orgs/${organizationId}/experiments`,
2463
+ method: "GET",
2464
+ secure: true,
2465
+ format: "json",
2466
+ ...params
2467
+ }),
2468
+ updateOrgExperimentalFeatures: (organizationId, data, params = {}) => this.request({
2469
+ path: `/orgs/${organizationId}/experiments`,
2470
+ method: "POST",
2471
+ body: data,
2472
+ secure: true,
2473
+ type: "application/json" /* Json */,
2474
+ ...params
2475
+ }),
2476
+ listSamlProvidersInOrganizationById: (organizationId, query, params = {}) => this.request({
2477
+ path: `/orgs/${organizationId}/saml`,
2478
+ method: "GET",
2479
+ query,
2480
+ secure: true,
2481
+ format: "json",
2482
+ ...params
2483
+ }),
2484
+ createOrganizationSamlProvider: (organizationId, data, params = {}) => this.request({
2485
+ path: `/orgs/${organizationId}/saml`,
2486
+ method: "POST",
2487
+ body: data,
2488
+ secure: true,
2489
+ type: "application/json" /* Json */,
2490
+ format: "json",
2491
+ ...params
2492
+ }),
2493
+ getOrganizationSamlProviderById: (organizationId, samlProviderId, params = {}) => this.request({
2494
+ path: `/orgs/${organizationId}/saml/${samlProviderId}`,
2495
+ method: "GET",
2496
+ secure: true,
2497
+ format: "json",
2498
+ ...params
2499
+ }),
2500
+ updateOrganizationSamlProvider: (organizationId, samlProviderId, data, params = {}) => this.request({
2501
+ path: `/orgs/${organizationId}/saml/${samlProviderId}`,
2502
+ method: "PATCH",
2503
+ body: data,
2504
+ secure: true,
2505
+ type: "application/json" /* Json */,
2506
+ format: "json",
2507
+ ...params
2508
+ }),
2509
+ deleteOrganizationSamlProvider: (organizationId, samlProviderId, params = {}) => this.request({
2510
+ path: `/orgs/${organizationId}/saml/${samlProviderId}`,
2511
+ method: "DELETE",
2512
+ secure: true,
2513
+ ...params
2514
+ }),
2515
+ getUsageForOrganizationById: (organizationId, params = {}) => this.request({
2516
+ path: `/orgs/${organizationId}/usage`,
2517
+ method: "GET",
2518
+ secure: true,
2519
+ format: "json",
2520
+ ...params
2521
+ }),
2522
+ getCollectionsUsageForOrganizationById: (organizationId, params = {}) => this.request({
2523
+ path: `/orgs/${organizationId}/usage/collections`,
2524
+ method: "GET",
2525
+ secure: true,
2526
+ format: "json",
2527
+ ...params
2528
+ }),
2529
+ getSpacesUsageForOrganizationById: (organizationId, params = {}) => this.request({
2530
+ path: `/orgs/${organizationId}/usage/spaces`,
2531
+ method: "GET",
2532
+ secure: true,
2533
+ format: "json",
2534
+ ...params
2535
+ }),
2536
+ getSitesUsageForOrganizationById: (organizationId, params = {}) => this.request({
2537
+ path: `/orgs/${organizationId}/usage/sites`,
2538
+ method: "GET",
2539
+ secure: true,
2540
+ format: "json",
2541
+ ...params
2542
+ }),
2543
+ getTeamsUsageForOrganizationById: (organizationId, params = {}) => this.request({
2544
+ path: `/orgs/${organizationId}/usage/teams`,
2545
+ method: "GET",
2546
+ secure: true,
2547
+ format: "json",
2548
+ ...params
2549
+ }),
2550
+ getMembersUsageForOrganizationById: (organizationId, params = {}) => this.request({
2551
+ path: `/orgs/${organizationId}/usage/members`,
2552
+ method: "GET",
2553
+ secure: true,
2554
+ format: "json",
2555
+ ...params
2556
+ }),
2557
+ getTeamMembersUsageForOrganizationById: (organizationId, params = {}) => this.request({
2558
+ path: `/orgs/${organizationId}/usage/team-members`,
2559
+ method: "GET",
2560
+ secure: true,
2561
+ format: "json",
2562
+ ...params
2563
+ }),
2564
+ listCaptures: (organizationId, query, params = {}) => this.request({
2565
+ path: `/orgs/${organizationId}/captures`,
2566
+ method: "GET",
2567
+ query,
2568
+ secure: true,
2569
+ format: "json",
2570
+ ...params
2571
+ }),
2572
+ startCapture: (organizationId, data, params = {}) => this.request({
2573
+ path: `/orgs/${organizationId}/captures`,
2574
+ method: "POST",
2575
+ body: data,
2576
+ secure: true,
2577
+ type: "application/json" /* Json */,
2578
+ format: "json",
2579
+ ...params
2580
+ }),
2581
+ getCapture: (organizationId, captureId, query, params = {}) => this.request({
2582
+ path: `/orgs/${organizationId}/captures/${captureId}`,
2583
+ method: "GET",
2584
+ query,
2585
+ secure: true,
2586
+ format: "json",
2587
+ ...params
2588
+ }),
2589
+ addEventsToCapture: (organizationId, captureId, data, params = {}) => this.request({
2590
+ path: `/orgs/${organizationId}/captures/${captureId}/events`,
2591
+ method: "POST",
2592
+ body: data,
2593
+ secure: true,
2594
+ type: "application/json" /* Json */,
2595
+ ...params
2596
+ }),
2597
+ stopCapture: (organizationId, captureId, data, query, params = {}) => this.request({
2598
+ path: `/orgs/${organizationId}/captures/${captureId}/stop`,
2599
+ method: "POST",
2600
+ query,
2601
+ body: data,
2602
+ secure: true,
2603
+ type: "application/json" /* Json */,
2604
+ format: "json",
2605
+ ...params
2606
+ }),
2607
+ listSnippets: (organizationId, query, params = {}) => this.request({
2608
+ path: `/orgs/${organizationId}/snippets`,
2609
+ method: "GET",
2610
+ query,
2611
+ secure: true,
2612
+ format: "json",
2613
+ ...params
2614
+ }),
2615
+ createSnippet: (organizationId, data, params = {}) => this.request({
2616
+ path: `/orgs/${organizationId}/snippets`,
2617
+ method: "POST",
2618
+ body: data,
2619
+ secure: true,
2620
+ type: "application/json" /* Json */,
2621
+ format: "json",
2622
+ ...params
2623
+ }),
2624
+ getSnippet: (organizationId, snippetId, params = {}) => this.request({
2625
+ path: `/orgs/${organizationId}/snippets/${snippetId}`,
2626
+ method: "GET",
2627
+ secure: true,
2628
+ format: "json",
2629
+ ...params
2630
+ }),
2631
+ deleteSnippet: (organizationId, snippetId, params = {}) => this.request({
2632
+ path: `/orgs/${organizationId}/snippets/${snippetId}`,
2633
+ method: "DELETE",
2634
+ secure: true,
2635
+ ...params
2636
+ }),
2637
+ updateSnippet: (organizationId, snippetId, data, params = {}) => this.request({
2638
+ path: `/orgs/${organizationId}/snippets/${snippetId}`,
2639
+ method: "PUT",
2640
+ body: data,
2641
+ secure: true,
2642
+ type: "application/json" /* Json */,
2643
+ format: "json",
2644
+ ...params
2645
+ }),
2646
+ moveSnippet: (organizationId, snippetId, data, params = {}) => this.request({
2647
+ path: `/orgs/${organizationId}/snippets/${snippetId}/move`,
2648
+ method: "POST",
2649
+ body: data,
2650
+ secure: true,
2651
+ type: "application/json" /* Json */,
2652
+ format: "json",
2653
+ ...params
2654
+ }),
2655
+ getSnippetSuggestedLocations: (organizationId, snippetId, query, params = {}) => this.request({
2656
+ path: `/orgs/${organizationId}/snippets/${snippetId}/move`,
2657
+ method: "GET",
2658
+ query,
2659
+ secure: true,
2660
+ format: "json",
2661
+ ...params
2662
+ }),
2663
+ listSyncedBlocks: (organizationId, query, params = {}) => this.request({
2664
+ path: `/orgs/${organizationId}/synced-blocks`,
2665
+ method: "GET",
2666
+ query,
2667
+ secure: true,
2668
+ format: "json",
2669
+ ...params
2670
+ }),
2671
+ createSyncedBlock: (organizationId, data, params = {}) => this.request({
2672
+ path: `/orgs/${organizationId}/synced-blocks`,
2673
+ method: "POST",
2674
+ body: data,
2675
+ secure: true,
2676
+ type: "application/json" /* Json */,
2677
+ format: "json",
2678
+ ...params
2679
+ }),
2680
+ getSyncedBlock: (organizationId, syncedBlockId, params = {}) => this.request({
2681
+ path: `/orgs/${organizationId}/synced-blocks/${syncedBlockId}`,
2682
+ method: "GET",
2683
+ secure: true,
2684
+ format: "json",
2685
+ ...params
2686
+ }),
2687
+ updateSyncedBlock: (organizationId, syncedBlockId, data, params = {}) => this.request({
2688
+ path: `/orgs/${organizationId}/synced-blocks/${syncedBlockId}`,
2689
+ method: "PATCH",
2690
+ body: data,
2691
+ secure: true,
2692
+ type: "application/json" /* Json */,
2693
+ ...params
2694
+ }),
2695
+ deleteSyncedBlock: (organizationId, syncedBlockId, params = {}) => this.request({
2696
+ path: `/orgs/${organizationId}/synced-blocks/${syncedBlockId}`,
2697
+ method: "DELETE",
2698
+ secure: true,
2699
+ ...params
2700
+ }),
2701
+ getSyncedBlockContent: (organizationId, syncedBlockId, params = {}) => this.request({
2702
+ path: `/orgs/${organizationId}/synced-blocks/${syncedBlockId}/content`,
2703
+ method: "GET",
2704
+ secure: true,
2705
+ format: "json",
2706
+ ...params
2707
+ }),
2708
+ listSyncedBlockBacklinks: (organizationId, syncedBlockId, query, params = {}) => this.request({
2709
+ path: `/orgs/${organizationId}/synced-blocks/${syncedBlockId}/backlinks`,
2710
+ method: "GET",
2711
+ query,
2712
+ secure: true,
2713
+ format: "json",
2714
+ ...params
2715
+ }),
2716
+ listSyncedBlockSpaces: (organizationId, syncedBlockId, query, params = {}) => this.request({
2717
+ path: `/orgs/${organizationId}/synced-blocks/${syncedBlockId}/usage/spaces`,
2718
+ method: "GET",
2719
+ query,
2720
+ secure: true,
2721
+ format: "json",
2722
+ ...params
2723
+ }),
2724
+ askInOrganization: (organizationId, data, query, params = {}) => this.request({
2725
+ path: `/orgs/${organizationId}/ask`,
2726
+ method: "POST",
2727
+ query,
2728
+ body: data,
2729
+ secure: true,
2730
+ type: "application/json" /* Json */,
2731
+ format: "json",
2732
+ ...params
2733
+ }),
2734
+ getRecommendedQuestionsInOrganization: (organizationId, params = {}) => this.request({
2735
+ path: `/orgs/${organizationId}/ask/questions`,
2736
+ method: "GET",
2737
+ secure: true,
2738
+ format: "json",
2739
+ ...params
2740
+ }),
2741
+ streamRecommendedQuestionsInOrganization: (organizationId, params = {}) => this.streamRequest({
2742
+ path: `/orgs/${organizationId}/ask/questions/stream`,
2743
+ method: "GET",
2744
+ secure: true,
2745
+ ...params
2746
+ }),
2747
+ streamAskInOrganization: (organizationId, query, params = {}) => this.streamRequest({
2748
+ path: `/orgs/${organizationId}/ask/stream`,
2749
+ method: "GET",
2750
+ query,
2751
+ secure: true,
2752
+ ...params
2753
+ }),
2754
+ listSites: (organizationId, query, params = {}) => this.request({
2755
+ path: `/orgs/${organizationId}/sites`,
2756
+ method: "GET",
2757
+ query,
2758
+ secure: true,
2759
+ format: "json",
2760
+ ...params
2761
+ }),
2762
+ createSite: (organizationId, data, params = {}) => this.request({
2763
+ path: `/orgs/${organizationId}/sites`,
2764
+ method: "POST",
2765
+ body: data,
2766
+ secure: true,
2767
+ type: "application/json" /* Json */,
2768
+ format: "json",
2769
+ ...params
2770
+ }),
2771
+ previewSitePublishCheckout: (organizationId, query, params = {}) => this.request({
2772
+ path: `/orgs/${organizationId}/sites/publishing/checkout`,
2773
+ method: "GET",
2774
+ query,
2775
+ secure: true,
2776
+ format: "json",
2777
+ ...params
2778
+ }),
2779
+ getSiteById: (organizationId, siteId, params = {}) => this.request({
2780
+ path: `/orgs/${organizationId}/sites/${siteId}`,
2781
+ method: "GET",
2782
+ secure: true,
2783
+ format: "json",
2784
+ ...params
2785
+ }),
2786
+ updateSiteById: (organizationId, siteId, data, params = {}) => this.request({
2787
+ path: `/orgs/${organizationId}/sites/${siteId}`,
2788
+ method: "PATCH",
2789
+ body: data,
2790
+ secure: true,
2791
+ type: "application/json" /* Json */,
2792
+ format: "json",
2793
+ ...params
2794
+ }),
2795
+ deleteSiteById: (organizationId, siteId, params = {}) => this.request({
2796
+ path: `/orgs/${organizationId}/sites/${siteId}`,
2797
+ method: "DELETE",
2798
+ secure: true,
2799
+ ...params
2800
+ }),
2801
+ publishSite: (organizationId, siteId, params = {}) => this.request({
2802
+ path: `/orgs/${organizationId}/sites/${siteId}/publish`,
2803
+ method: "POST",
2804
+ secure: true,
2805
+ format: "json",
2806
+ ...params
2807
+ }),
2808
+ unpublishSite: (organizationId, siteId, params = {}) => this.request({
2809
+ path: `/orgs/${organizationId}/sites/${siteId}/unpublish`,
2810
+ method: "POST",
2811
+ secure: true,
2812
+ format: "json",
2813
+ ...params
2814
+ }),
2815
+ listSiteShareLinks: (organizationId, siteId, query, params = {}) => this.request({
2816
+ path: `/orgs/${organizationId}/sites/${siteId}/share-links`,
2817
+ method: "GET",
2818
+ query,
2819
+ secure: true,
2820
+ format: "json",
2821
+ ...params
2822
+ }),
2823
+ createSiteShareLink: (organizationId, siteId, data, params = {}) => this.request({
2824
+ path: `/orgs/${organizationId}/sites/${siteId}/share-links`,
2825
+ method: "POST",
2826
+ body: data,
2827
+ secure: true,
2828
+ type: "application/json" /* Json */,
2829
+ format: "json",
2830
+ ...params
2831
+ }),
2832
+ updateSiteShareLinkById: (organizationId, siteId, shareLinkId, data, params = {}) => this.request({
2833
+ path: `/orgs/${organizationId}/sites/${siteId}/share-links/${shareLinkId}`,
2834
+ method: "PATCH",
2835
+ body: data,
2836
+ secure: true,
2837
+ type: "application/json" /* Json */,
2838
+ format: "json",
2839
+ ...params
2840
+ }),
2841
+ deleteSiteShareLinkById: (organizationId, siteId, shareLinkId, params = {}) => this.request({
2842
+ path: `/orgs/${organizationId}/sites/${siteId}/share-links/${shareLinkId}`,
2843
+ method: "DELETE",
2844
+ secure: true,
2845
+ ...params
2846
+ }),
2847
+ getSiteStructure: (organizationId, siteId, query, params = {}) => this.request({
2848
+ path: `/orgs/${organizationId}/sites/${siteId}/structure`,
2849
+ method: "GET",
2850
+ query,
2851
+ secure: true,
2852
+ format: "json",
2853
+ ...params
2854
+ }),
2855
+ updateSitePlan: (organizationId, siteId, data, query, params = {}) => this.request({
2856
+ path: `/orgs/${organizationId}/sites/${siteId}/plan`,
2857
+ method: "POST",
2858
+ query,
2859
+ body: data,
2860
+ secure: true,
2861
+ type: "application/json" /* Json */,
2862
+ format: "json",
2863
+ ...params
2864
+ }),
2865
+ previewSitePlanUpdate: (organizationId, siteId, query, params = {}) => this.request({
2866
+ path: `/orgs/${organizationId}/sites/${siteId}/plan`,
2867
+ method: "GET",
2868
+ query,
2869
+ secure: true,
2870
+ format: "json",
2871
+ ...params
2872
+ }),
2873
+ getSitePublishingAuthById: (organizationId, siteId, params = {}) => this.request({
2874
+ path: `/orgs/${organizationId}/sites/${siteId}/publishing/auth`,
2875
+ method: "GET",
2876
+ secure: true,
2877
+ format: "json",
2878
+ ...params
2879
+ }),
2880
+ updateSitePublishingAuthById: (organizationId, siteId, data, params = {}) => this.request({
2881
+ path: `/orgs/${organizationId}/sites/${siteId}/publishing/auth`,
2882
+ method: "PATCH",
2883
+ body: data,
2884
+ secure: true,
2885
+ type: "application/json" /* Json */,
2886
+ format: "json",
2887
+ ...params
2888
+ }),
2889
+ regenerateSitePublishingAuthById: (organizationId, siteId, params = {}) => this.request({
2890
+ path: `/orgs/${organizationId}/sites/${siteId}/publishing/auth/regenerate`,
2891
+ method: "POST",
2892
+ secure: true,
2893
+ format: "json",
2894
+ ...params
2895
+ }),
2896
+ getSitePublishingPreviewById: (organizationId, siteId, query, params = {}) => this.request({
2897
+ path: `/orgs/${organizationId}/sites/${siteId}/publishing/preview`,
2898
+ method: "GET",
2899
+ query,
2900
+ secure: true,
2901
+ format: "json",
2902
+ ...params
2903
+ }),
2904
+ getSiteCustomizationById: (organizationId, siteId, query, params = {}) => this.request({
2905
+ path: `/orgs/${organizationId}/sites/${siteId}/customization`,
2906
+ method: "GET",
2907
+ query,
2908
+ secure: true,
2909
+ format: "json",
2910
+ ...params
2911
+ }),
2912
+ updateSiteCustomizationById: (organizationId, siteId, data, params = {}) => this.request({
2913
+ path: `/orgs/${organizationId}/sites/${siteId}/customization`,
2914
+ method: "PUT",
2915
+ body: data,
2916
+ secure: true,
2917
+ type: "application/json" /* Json */,
2918
+ format: "json",
2919
+ ...params
2920
+ }),
2921
+ getSiteRawCustomizationById: (organizationId, siteId, params = {}) => this.request({
2922
+ path: `/orgs/${organizationId}/sites/${siteId}/customization/raw`,
2923
+ method: "GET",
2924
+ secure: true,
2925
+ format: "json",
2926
+ ...params
2927
+ }),
2928
+ listSiteIntegrationScripts: (organizationId, siteId, params = {}) => this.request({
2929
+ path: `/orgs/${organizationId}/sites/${siteId}/integration-scripts`,
2930
+ method: "GET",
2931
+ secure: true,
2932
+ format: "json",
2933
+ ...params
2934
+ }),
2935
+ listSiteIntegrations: (organizationId, siteId, query, params = {}) => this.request({
2936
+ path: `/orgs/${organizationId}/sites/${siteId}/integrations`,
2937
+ method: "GET",
2938
+ query,
2939
+ secure: true,
2940
+ format: "json",
2941
+ ...params
2942
+ }),
2943
+ addSpaceToSite: (organizationId, siteId, data, params = {}) => this.request({
2944
+ path: `/orgs/${organizationId}/sites/${siteId}/site-spaces`,
2945
+ method: "POST",
2946
+ body: data,
2947
+ secure: true,
2948
+ type: "application/json" /* Json */,
2949
+ format: "json",
2950
+ ...params
2951
+ }),
2952
+ listSiteSpaces: (organizationId, siteId, query, params = {}) => this.request({
2953
+ path: `/orgs/${organizationId}/sites/${siteId}/site-spaces`,
2954
+ method: "GET",
2955
+ query,
2956
+ secure: true,
2957
+ format: "json",
2958
+ ...params
2959
+ }),
2960
+ addSectionToSite: (organizationId, siteId, data, params = {}) => this.request({
2961
+ path: `/orgs/${organizationId}/sites/${siteId}/sections`,
2962
+ method: "POST",
2963
+ body: data,
2964
+ secure: true,
2965
+ type: "application/json" /* Json */,
2966
+ format: "json",
2967
+ ...params
2968
+ }),
2969
+ listSiteSections: (organizationId, siteId, query, params = {}) => this.request({
2970
+ path: `/orgs/${organizationId}/sites/${siteId}/sections`,
2971
+ method: "GET",
2972
+ query,
2973
+ secure: true,
2974
+ format: "json",
2975
+ ...params
2976
+ }),
2977
+ updateSiteSectionById: (organizationId, siteId, siteSectionId, data, params = {}) => this.request({
2978
+ path: `/orgs/${organizationId}/sites/${siteId}/sections/${siteSectionId}`,
2979
+ method: "PATCH",
2980
+ body: data,
2981
+ secure: true,
2982
+ type: "application/json" /* Json */,
2983
+ format: "json",
2984
+ ...params
2985
+ }),
2986
+ deleteSiteSectionById: (organizationId, siteId, siteSectionId, params = {}) => this.request({
2987
+ path: `/orgs/${organizationId}/sites/${siteId}/sections/${siteSectionId}`,
2988
+ method: "DELETE",
2989
+ secure: true,
2990
+ ...params
2991
+ }),
2992
+ searchSiteContent: (organizationId, siteId, data, query, params = {}) => this.request({
2993
+ path: `/orgs/${organizationId}/sites/${siteId}/search`,
2994
+ method: "POST",
2995
+ query,
2996
+ body: data,
2997
+ secure: true,
2998
+ type: "application/json" /* Json */,
2999
+ format: "json",
3000
+ ...params
3001
+ }),
3002
+ updateSiteSpaceById: (organizationId, siteId, siteSpaceId, data, params = {}) => this.request({
3003
+ path: `/orgs/${organizationId}/sites/${siteId}/site-spaces/${siteSpaceId}`,
3004
+ method: "PATCH",
3005
+ body: data,
3006
+ secure: true,
3007
+ type: "application/json" /* Json */,
3008
+ format: "json",
3009
+ ...params
3010
+ }),
3011
+ deleteSiteSpaceById: (organizationId, siteId, siteSpaceId, params = {}) => this.request({
3012
+ path: `/orgs/${organizationId}/sites/${siteId}/site-spaces/${siteSpaceId}`,
3013
+ method: "DELETE",
3014
+ secure: true,
3015
+ ...params
3016
+ }),
3017
+ getSiteSpaceCustomizationById: (organizationId, siteId, siteSpaceId, query, params = {}) => this.request({
3018
+ path: `/orgs/${organizationId}/sites/${siteId}/site-spaces/${siteSpaceId}/customization`,
3019
+ method: "GET",
3020
+ query,
3021
+ secure: true,
3022
+ format: "json",
3023
+ ...params
3024
+ }),
3025
+ overrideSiteSpaceCustomizationById: (organizationId, siteId, siteSpaceId, data, params = {}) => this.request({
3026
+ path: `/orgs/${organizationId}/sites/${siteId}/site-spaces/${siteSpaceId}/customization`,
3027
+ method: "PATCH",
3028
+ body: data,
3029
+ secure: true,
3030
+ type: "application/json" /* Json */,
3031
+ format: "json",
3032
+ ...params
3033
+ }),
3034
+ getSiteSpaceRawCustomizationById: (organizationId, siteId, siteSpaceId, params = {}) => this.request({
3035
+ path: `/orgs/${organizationId}/sites/${siteId}/site-spaces/${siteSpaceId}/customization/raw`,
3036
+ method: "GET",
3037
+ secure: true,
3038
+ format: "json",
3039
+ ...params
3040
+ }),
3041
+ getContentAnalyticsForSiteSpaceById: (organizationId, siteId, siteSpaceId, query, params = {}) => this.request({
3042
+ path: `/orgs/${organizationId}/sites/${siteId}/site-spaces/${siteSpaceId}/insights/content`,
3043
+ method: "GET",
3044
+ query,
3045
+ secure: true,
3046
+ format: "json",
3047
+ ...params
3048
+ }),
3049
+ createSitesPageFeedback: (organizationId, siteId, siteSpaceId, pageId, visitorId, data, params = {}) => this.request({
3050
+ path: `/orgs/${organizationId}/sites/${siteId}/site-spaces/${siteSpaceId}/insights/pages/${pageId}/feedbacks/${visitorId}`,
3051
+ method: "PUT",
3052
+ body: data,
3053
+ secure: true,
3054
+ type: "application/json" /* Json */,
3055
+ format: "json",
3056
+ ...params
3057
+ }),
3058
+ moveSiteSpace: (organizationId, siteId, siteSpaceId, data, params = {}) => this.request({
3059
+ path: `/orgs/${organizationId}/sites/${siteId}/site-spaces/${siteSpaceId}/move`,
3060
+ method: "POST",
3061
+ body: data,
3062
+ secure: true,
3063
+ type: "application/json" /* Json */,
3064
+ format: "json",
3065
+ ...params
3066
+ }),
3067
+ listPermissionsAggregateInSite: (organizationId, siteId, query, params = {}) => this.request({
3068
+ path: `/orgs/${organizationId}/sites/${siteId}/permissions/aggregate`,
3069
+ method: "GET",
3070
+ query,
3071
+ secure: true,
3072
+ format: "json",
3073
+ ...params
3074
+ }),
3075
+ trackViewInSiteById: (organizationId, siteId, data, params = {}) => this.request({
3076
+ path: `/orgs/${organizationId}/sites/${siteId}/insights/track_view`,
3077
+ method: "POST",
3078
+ body: data,
3079
+ secure: true,
3080
+ type: "application/json" /* Json */,
3081
+ ...params
3082
+ }),
3083
+ getSearchAnalyticsForSiteById: (organizationId, siteId, query, params = {}) => this.request({
3084
+ path: `/orgs/${organizationId}/sites/${siteId}/insights/search`,
3085
+ method: "GET",
3086
+ query,
3087
+ secure: true,
3088
+ format: "json",
3089
+ ...params
3090
+ }),
3091
+ updateSiteAdsById: (organizationId, siteId, data, params = {}) => this.request({
3092
+ path: `/orgs/${organizationId}/sites/${siteId}/ads`,
3093
+ method: "POST",
3094
+ body: data,
3095
+ secure: true,
3096
+ type: "application/json" /* Json */,
3097
+ ...params
3098
+ }),
3099
+ getSiteAdsStatsById: (organizationId, siteId, params = {}) => this.request({
3100
+ path: `/orgs/${organizationId}/sites/${siteId}/ads/stats`,
3101
+ method: "POST",
3102
+ secure: true,
3103
+ format: "json",
3104
+ ...params
3105
+ })
3106
+ };
3107
+ customHostnames = {
3108
+ getCustomHostname: (hostname, params = {}) => this.request({
3109
+ path: `/custom-hostnames/${hostname}`,
3110
+ method: "GET",
3111
+ secure: true,
3112
+ format: "json",
3113
+ ...params
3114
+ }),
3115
+ setupCustomHostname: (hostname, data, params = {}) => this.request({
3116
+ path: `/custom-hostnames/${hostname}`,
3117
+ method: "POST",
3118
+ body: data,
3119
+ secure: true,
3120
+ type: "application/json" /* Json */,
3121
+ format: "json",
3122
+ ...params
3123
+ }),
3124
+ dnsRevalidateCustomHostname: (hostname, params = {}) => this.request({
3125
+ path: `/custom-hostnames/${hostname}`,
3126
+ method: "PATCH",
3127
+ secure: true,
3128
+ ...params
3129
+ }),
3130
+ removeCustomHostname: (hostname, params = {}) => this.request({
3131
+ path: `/custom-hostnames/${hostname}`,
3132
+ method: "DELETE",
3133
+ secure: true,
3134
+ ...params
3135
+ }),
3136
+ testCustomHostname: (hostname, data, params = {}) => this.request({
3137
+ path: `/custom-hostnames/${hostname}/test`,
3138
+ method: "POST",
3139
+ body: data,
3140
+ secure: true,
3141
+ type: "application/json" /* Json */,
3142
+ ...params
3143
+ })
3144
+ };
3145
+ ads = {
3146
+ adsListSites: (query, params = {}) => this.request({
3147
+ path: `/ads/sites`,
3148
+ method: "GET",
3149
+ query,
3150
+ secure: true,
3151
+ format: "json",
3152
+ ...params
3153
+ }),
3154
+ adsUpdateSite: (siteId, data, params = {}) => this.request({
3155
+ path: `/ads/sites/${siteId}`,
3156
+ method: "PATCH",
3157
+ body: data,
3158
+ secure: true,
3159
+ type: "application/json" /* Json */,
3160
+ ...params
3161
+ })
3162
+ };
3163
+ internal = {
3164
+ generateHiveAccessToken: (data, params = {}) => this.request({
3165
+ path: `/internal/hive/token`,
3166
+ method: "POST",
3167
+ body: data,
3168
+ secure: true,
3169
+ type: "application/json" /* Json */,
3170
+ format: "json",
3171
+ ...params
3172
+ })
3173
+ };
3174
+ urls = {
3175
+ getContentByUrl: (query, params = {}) => this.request({
3176
+ path: `/urls/content`,
3177
+ method: "GET",
3178
+ query,
3179
+ secure: true,
3180
+ format: "json",
3181
+ ...params
3182
+ }),
3183
+ getEmbedByUrl: (query, params = {}) => this.request({
3184
+ path: `/urls/embed`,
3185
+ method: "GET",
3186
+ query,
3187
+ secure: true,
3188
+ format: "json",
3189
+ ...params
3190
+ }),
3191
+ getPublishedContentByUrl: (query, params = {}) => this.request({
3192
+ path: `/urls/published`,
3193
+ method: "GET",
3194
+ query,
3195
+ secure: true,
3196
+ format: "json",
3197
+ ...params
3198
+ })
3199
+ };
3141
3200
  };
3142
3201
 
3143
3202
  // src/GitBookAPIError.ts
3144
3203
  var GitBookAPIError = class extends Error {
3204
+ response;
3205
+ name = "GitBookAPIError";
3206
+ code;
3207
+ errorMessage;
3145
3208
  constructor(errorMessage, response) {
3146
3209
  const message = `GitBook API failed with [${response.status}] ${response.url}: ${errorMessage}`;
3147
3210
  super(message);
3148
- this.name = "GitBookAPIError";
3149
3211
  this.response = response;
3150
3212
  this.code = response.status;
3151
3213
  this.errorMessage = errorMessage;
@@ -3155,6 +3217,9 @@ var GitBookAPIError = class extends Error {
3155
3217
  // src/index.ts
3156
3218
  var GITBOOK_DEFAULT_ENDPOINT = "https://api.gitbook.com";
3157
3219
  var GitBookAPI = class extends Api {
3220
+ endpoint;
3221
+ authToken;
3222
+ userAgent;
3158
3223
  constructor(options = {}) {
3159
3224
  const {
3160
3225
  endpoint = GITBOOK_DEFAULT_ENDPOINT,
@@ -3164,7 +3229,7 @@ var GitBookAPI = class extends Api {
3164
3229
  super({
3165
3230
  baseUrl: `${endpoint}/v1`,
3166
3231
  securityWorker: (securityData) => {
3167
- if (securityData.authToken) {
3232
+ if (securityData && securityData.authToken) {
3168
3233
  return {
3169
3234
  headers: {
3170
3235
  Authorization: `Bearer ${securityData.authToken}`,
@@ -3175,10 +3240,10 @@ var GitBookAPI = class extends Api {
3175
3240
  return {};
3176
3241
  },
3177
3242
  customFetch: async (input, init) => {
3178
- if ("credentials" in init) {
3243
+ if (init && "credentials" in init) {
3179
3244
  delete init.credentials;
3180
3245
  }
3181
- if ("referrerPolicy" in init) {
3246
+ if (init && "referrerPolicy" in init) {
3182
3247
  delete init.referrerPolicy;
3183
3248
  }
3184
3249
  const response = await fetch(input, init);