@livechat/developer-studio-api 2.3.0 → 2.3.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.d.mts +219 -256
- package/dist/index.d.ts +219 -256
- package/dist/index.js +286 -294
- package/dist/index.mjs +286 -294
- package/package.json +4 -5
package/dist/index.js
CHANGED
|
@@ -128,70 +128,6 @@ module.exports = __toCommonJS(src_exports);
|
|
|
128
128
|
// src/apis/integrations/github/api.ts
|
|
129
129
|
var import_axios2 = __toESM(require("axios"));
|
|
130
130
|
|
|
131
|
-
// src/apis/integrations/github/instance.ts
|
|
132
|
-
var import_axios = __toESM(require("axios"));
|
|
133
|
-
|
|
134
|
-
// src/types/errors/api.ts
|
|
135
|
-
var UnauthorizeApiError = class extends Error {
|
|
136
|
-
constructor(source) {
|
|
137
|
-
super("Unauthorized API call");
|
|
138
|
-
this.source = source;
|
|
139
|
-
}
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
// src/apis/integrations/github/instance.ts
|
|
143
|
-
var githubClientInstance = import_axios.default.create({
|
|
144
|
-
baseURL: "https://api.github.com",
|
|
145
|
-
headers: {
|
|
146
|
-
["Accept"]: "application/vnd.github+json",
|
|
147
|
-
["Content-Type"]: "application/json"
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
githubClientInstance.interceptors.response.use(
|
|
151
|
-
(r) => r,
|
|
152
|
-
(error) => {
|
|
153
|
-
var _a;
|
|
154
|
-
if (import_axios.default.isAxiosError(error)) {
|
|
155
|
-
if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
|
|
156
|
-
error = new UnauthorizeApiError("github");
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
throw error;
|
|
160
|
-
}
|
|
161
|
-
);
|
|
162
|
-
function getGitHubClientAuthorization(req) {
|
|
163
|
-
return {
|
|
164
|
-
tokens: {
|
|
165
|
-
app: req.headers["github-app-token"],
|
|
166
|
-
oauth: req.headers["github-oauth-token"]
|
|
167
|
-
}
|
|
168
|
-
};
|
|
169
|
-
}
|
|
170
|
-
function getGithubClientRequestConfig(options = {}) {
|
|
171
|
-
const defaultAuthorization = githubClientInstance.defaults.headers["Authorization"];
|
|
172
|
-
const headers = {
|
|
173
|
-
authorization: defaultAuthorization != null ? defaultAuthorization : options.token ? `Bearer ${options.token}` : void 0
|
|
174
|
-
};
|
|
175
|
-
if (options.ensureAuthorizationToken && !headers.authorization) {
|
|
176
|
-
throw new UnauthorizeApiError("github");
|
|
177
|
-
}
|
|
178
|
-
return {
|
|
179
|
-
headers: __spreadValues({}, headers.authorization ? { Authorization: headers.authorization } : {})
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
function initGithubClientInstance(token) {
|
|
183
|
-
if (token) {
|
|
184
|
-
updateGithubClientInstance(token);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
function updateGithubClientInstance(token) {
|
|
188
|
-
if (token) {
|
|
189
|
-
githubClientInstance.defaults.headers["Authorization"] = `Bearer ${token}`;
|
|
190
|
-
} else {
|
|
191
|
-
delete githubClientInstance.defaults.headers["Authorization"];
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
|
|
195
131
|
// ../../private/config/src/integrations/github.ts
|
|
196
132
|
var GITHUB_CONFIG = {
|
|
197
133
|
url: "https://github.com/login/oauth/authorize",
|
|
@@ -287,6 +223,72 @@ var VERCEL_CONFIG = {
|
|
|
287
223
|
}
|
|
288
224
|
};
|
|
289
225
|
|
|
226
|
+
// src/apis/integrations/github/instance.ts
|
|
227
|
+
var import_axios = __toESM(require("axios"));
|
|
228
|
+
|
|
229
|
+
// src/types/errors/api.ts
|
|
230
|
+
var UnauthorizeApiError = class extends Error {
|
|
231
|
+
constructor(source) {
|
|
232
|
+
super("Unauthorized API call");
|
|
233
|
+
this.source = source;
|
|
234
|
+
}
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
// src/apis/integrations/github/instance.ts
|
|
238
|
+
var githubClientInstance = import_axios.default.create({
|
|
239
|
+
baseURL: "https://api.github.com",
|
|
240
|
+
headers: {
|
|
241
|
+
Accept: "application/vnd.github+json",
|
|
242
|
+
"Content-Type": "application/json"
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
githubClientInstance.interceptors.response.use(
|
|
246
|
+
(r) => r,
|
|
247
|
+
(error) => {
|
|
248
|
+
var _a;
|
|
249
|
+
if (import_axios.default.isAxiosError(error)) {
|
|
250
|
+
if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
|
|
251
|
+
throw new UnauthorizeApiError("github");
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
throw error;
|
|
255
|
+
}
|
|
256
|
+
);
|
|
257
|
+
function getGitHubClientAuthorization(req) {
|
|
258
|
+
return {
|
|
259
|
+
tokens: {
|
|
260
|
+
app: req.headers["github-app-token"],
|
|
261
|
+
oauth: req.headers["github-oauth-token"]
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
function getGithubClientRequestConfig(options = {}) {
|
|
266
|
+
const currentHeaders = githubClientInstance.defaults.headers;
|
|
267
|
+
const defaultAuthorization = currentHeaders.Authorization;
|
|
268
|
+
const headers = {
|
|
269
|
+
authorization: defaultAuthorization != null ? defaultAuthorization : options.token ? `Bearer ${options.token}` : void 0
|
|
270
|
+
};
|
|
271
|
+
if (options.ensureAuthorizationToken && !headers.authorization) {
|
|
272
|
+
throw new UnauthorizeApiError("github");
|
|
273
|
+
}
|
|
274
|
+
return {
|
|
275
|
+
headers: __spreadValues({}, headers.authorization ? { Authorization: headers.authorization } : {})
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
function initGithubClientInstance(token) {
|
|
279
|
+
if (token) {
|
|
280
|
+
updateGithubClientInstance(token);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
function updateGithubClientInstance(token) {
|
|
284
|
+
const headers = githubClientInstance.defaults.headers;
|
|
285
|
+
if (token) {
|
|
286
|
+
headers.Authorization = `Bearer ${token}`;
|
|
287
|
+
} else {
|
|
288
|
+
delete headers.Authorization;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
290
292
|
// src/apis/integrations/github/installation/api.ts
|
|
291
293
|
var gitHubInstallationApi = {
|
|
292
294
|
getInstallation(account, authorization) {
|
|
@@ -364,7 +366,7 @@ var gitHubRepositoryApi = {
|
|
|
364
366
|
})
|
|
365
367
|
);
|
|
366
368
|
const branch = response.data.find(
|
|
367
|
-
(
|
|
369
|
+
(innerBranch) => innerBranch.name === repositoryBranch
|
|
368
370
|
);
|
|
369
371
|
if (!branch) {
|
|
370
372
|
throw new Error("Branch not found");
|
|
@@ -480,18 +482,18 @@ var gitHubRepositoryApi = {
|
|
|
480
482
|
);
|
|
481
483
|
return response.data.content;
|
|
482
484
|
});
|
|
483
|
-
let seed
|
|
485
|
+
let seed;
|
|
484
486
|
try {
|
|
485
487
|
seed = yield this.getRepositorySeed(repositoryName, authorization);
|
|
486
488
|
} catch (e) {
|
|
487
489
|
}
|
|
488
|
-
return
|
|
490
|
+
return upsert(seed == null ? void 0 : seed.sha);
|
|
489
491
|
});
|
|
490
492
|
},
|
|
491
493
|
deleteRepository(repositoryName, authorization) {
|
|
492
494
|
return __async(this, null, function* () {
|
|
493
495
|
var _a;
|
|
494
|
-
return
|
|
496
|
+
return githubClientInstance.delete(
|
|
495
497
|
`/repos/${repositoryName}`,
|
|
496
498
|
getGithubClientRequestConfig({
|
|
497
499
|
token: (_a = authorization == null ? void 0 : authorization.tokens) == null ? void 0 : _a.app,
|
|
@@ -667,7 +669,7 @@ var gitHubApi = {
|
|
|
667
669
|
}
|
|
668
670
|
}
|
|
669
671
|
);
|
|
670
|
-
|
|
672
|
+
const params = new URLSearchParams(response.data);
|
|
671
673
|
return (_a = params.get("access_token")) != null ? _a : "";
|
|
672
674
|
});
|
|
673
675
|
}
|
|
@@ -678,7 +680,7 @@ var import_axios3 = __toESM(require("axios"));
|
|
|
678
680
|
var netlifyClientInstance = import_axios3.default.create({
|
|
679
681
|
baseURL: "https://api.netlify.com/api/v1",
|
|
680
682
|
headers: {
|
|
681
|
-
|
|
683
|
+
"Content-Type": "application/json"
|
|
682
684
|
}
|
|
683
685
|
});
|
|
684
686
|
netlifyClientInstance.interceptors.response.use(
|
|
@@ -687,7 +689,7 @@ netlifyClientInstance.interceptors.response.use(
|
|
|
687
689
|
var _a;
|
|
688
690
|
if (import_axios3.default.isAxiosError(error)) {
|
|
689
691
|
if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
|
|
690
|
-
|
|
692
|
+
throw new UnauthorizeApiError("netlify");
|
|
691
693
|
}
|
|
692
694
|
}
|
|
693
695
|
throw error;
|
|
@@ -699,7 +701,8 @@ function getNetlifyClientAuthorization(req) {
|
|
|
699
701
|
};
|
|
700
702
|
}
|
|
701
703
|
function getNetlifyClientConfig(options = {}) {
|
|
702
|
-
const
|
|
704
|
+
const currentHeaders = netlifyClientInstance.defaults.headers;
|
|
705
|
+
const defaultAuthorization = currentHeaders.Authorization;
|
|
703
706
|
const headers = {
|
|
704
707
|
authorization: defaultAuthorization != null ? defaultAuthorization : options.token ? `Bearer ${options.token}` : void 0
|
|
705
708
|
};
|
|
@@ -716,10 +719,11 @@ function initNetlifyClientInstance(token) {
|
|
|
716
719
|
}
|
|
717
720
|
}
|
|
718
721
|
function updateNetlifyClientInstance(token) {
|
|
722
|
+
const headers = netlifyClientInstance.defaults.headers;
|
|
719
723
|
if (token) {
|
|
720
|
-
|
|
724
|
+
headers.Authorization = `Bearer ${token}`;
|
|
721
725
|
} else {
|
|
722
|
-
delete
|
|
726
|
+
delete headers.Authorization;
|
|
723
727
|
}
|
|
724
728
|
}
|
|
725
729
|
|
|
@@ -738,14 +742,15 @@ var netlifyAccountApi = {
|
|
|
738
742
|
},
|
|
739
743
|
getAccountEnvs(accountId, siteId, authorization) {
|
|
740
744
|
return __async(this, null, function* () {
|
|
741
|
-
|
|
742
|
-
|
|
745
|
+
let targetAccountId = accountId;
|
|
746
|
+
if (!targetAccountId) {
|
|
747
|
+
targetAccountId = yield this.getAccount(authorization);
|
|
743
748
|
}
|
|
744
|
-
if (!
|
|
749
|
+
if (!targetAccountId) {
|
|
745
750
|
throw new Error("No account");
|
|
746
751
|
}
|
|
747
752
|
const { data: envs } = yield netlifyClientInstance.get(
|
|
748
|
-
`/accounts/${
|
|
753
|
+
`/accounts/${targetAccountId}/env?site_id=${siteId}&scope=all&context=all&level=all`,
|
|
749
754
|
getNetlifyClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
750
755
|
ensureAuthorizationToken: true
|
|
751
756
|
}))
|
|
@@ -755,14 +760,15 @@ var netlifyAccountApi = {
|
|
|
755
760
|
},
|
|
756
761
|
getAccountEnv(accountId, siteId, envKey, authorization) {
|
|
757
762
|
return __async(this, null, function* () {
|
|
758
|
-
|
|
759
|
-
|
|
763
|
+
let targetAccountId = accountId;
|
|
764
|
+
if (!targetAccountId) {
|
|
765
|
+
targetAccountId = yield this.getAccount(authorization);
|
|
760
766
|
}
|
|
761
|
-
if (!
|
|
767
|
+
if (!targetAccountId) {
|
|
762
768
|
throw new Error("No account");
|
|
763
769
|
}
|
|
764
770
|
const { data: envs } = yield netlifyClientInstance.get(
|
|
765
|
-
`/accounts/${
|
|
771
|
+
`/accounts/${targetAccountId}/env/${envKey}?site_id=${siteId}`,
|
|
766
772
|
getNetlifyClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
767
773
|
ensureAuthorizationToken: true
|
|
768
774
|
}))
|
|
@@ -772,25 +778,27 @@ var netlifyAccountApi = {
|
|
|
772
778
|
},
|
|
773
779
|
createAccountEnv(accountId, siteId, envName, envValue, envs, authorization) {
|
|
774
780
|
return __async(this, null, function* () {
|
|
775
|
-
|
|
776
|
-
|
|
781
|
+
let targetAccountId = accountId;
|
|
782
|
+
let targetEnvs = envs;
|
|
783
|
+
if (!targetAccountId) {
|
|
784
|
+
targetAccountId = yield this.getAccount(authorization);
|
|
777
785
|
}
|
|
778
|
-
if (!
|
|
786
|
+
if (!targetAccountId) {
|
|
779
787
|
throw new Error("No account");
|
|
780
788
|
}
|
|
781
|
-
if (!
|
|
789
|
+
if (!targetEnvs) {
|
|
782
790
|
const response = yield netlifyClientInstance.get(
|
|
783
|
-
`/accounts/${
|
|
791
|
+
`/accounts/${targetAccountId}/env?site_id=${siteId}&scope=all&context=all&level=all`,
|
|
784
792
|
getNetlifyClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
785
793
|
ensureAuthorizationToken: true
|
|
786
794
|
}))
|
|
787
795
|
);
|
|
788
|
-
|
|
796
|
+
targetEnvs = response.data;
|
|
789
797
|
}
|
|
790
|
-
const existingEnv =
|
|
798
|
+
const existingEnv = targetEnvs.find((env) => env.key === envName);
|
|
791
799
|
if (existingEnv) {
|
|
792
800
|
yield netlifyClientInstance.put(
|
|
793
|
-
`/accounts/${
|
|
801
|
+
`/accounts/${targetAccountId}/env/${existingEnv.key}?site_id=${siteId}`,
|
|
794
802
|
{
|
|
795
803
|
key: existingEnv.key,
|
|
796
804
|
scopes: ["builds", "functions", "runtime", "post_processing"],
|
|
@@ -802,7 +810,7 @@ var netlifyAccountApi = {
|
|
|
802
810
|
);
|
|
803
811
|
} else {
|
|
804
812
|
yield netlifyClientInstance.post(
|
|
805
|
-
`/accounts/${
|
|
813
|
+
`/accounts/${targetAccountId}/env?site_id=${siteId}`,
|
|
806
814
|
[
|
|
807
815
|
{
|
|
808
816
|
key: envName,
|
|
@@ -838,19 +846,19 @@ var netlifyAccountApi = {
|
|
|
838
846
|
},
|
|
839
847
|
removeAccountEnv(accountId, siteId, envKey, authorization) {
|
|
840
848
|
return __async(this, null, function* () {
|
|
841
|
-
|
|
842
|
-
|
|
849
|
+
let targetAccountId = accountId;
|
|
850
|
+
if (!targetAccountId) {
|
|
851
|
+
targetAccountId = yield this.getAccount(authorization);
|
|
843
852
|
}
|
|
844
853
|
if (!accountId) {
|
|
845
854
|
throw new Error("No account");
|
|
846
855
|
}
|
|
847
|
-
|
|
848
|
-
`/accounts/${
|
|
856
|
+
yield netlifyClientInstance.delete(
|
|
857
|
+
`/accounts/${targetAccountId}/env/${envKey}?site_id=${siteId}`,
|
|
849
858
|
getNetlifyClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
850
859
|
ensureAuthorizationToken: true
|
|
851
860
|
}))
|
|
852
861
|
);
|
|
853
|
-
return response.data;
|
|
854
862
|
});
|
|
855
863
|
}
|
|
856
864
|
};
|
|
@@ -860,7 +868,7 @@ var netlifyHookApi = {
|
|
|
860
868
|
addBuildHooks(siteId, authorization) {
|
|
861
869
|
return __async(this, null, function* () {
|
|
862
870
|
try {
|
|
863
|
-
netlifyClientInstance.post(
|
|
871
|
+
yield netlifyClientInstance.post(
|
|
864
872
|
"/hooks",
|
|
865
873
|
{
|
|
866
874
|
site_id: siteId,
|
|
@@ -877,7 +885,7 @@ var netlifyHookApi = {
|
|
|
877
885
|
} catch (e) {
|
|
878
886
|
}
|
|
879
887
|
try {
|
|
880
|
-
netlifyClientInstance.post(
|
|
888
|
+
yield netlifyClientInstance.post(
|
|
881
889
|
"/hooks",
|
|
882
890
|
{
|
|
883
891
|
site_id: siteId,
|
|
@@ -894,7 +902,7 @@ var netlifyHookApi = {
|
|
|
894
902
|
} catch (e) {
|
|
895
903
|
}
|
|
896
904
|
try {
|
|
897
|
-
netlifyClientInstance.post(
|
|
905
|
+
yield netlifyClientInstance.post(
|
|
898
906
|
"/hooks",
|
|
899
907
|
{
|
|
900
908
|
site_id: siteId,
|
|
@@ -963,7 +971,7 @@ var netlifySiteApi = {
|
|
|
963
971
|
}))
|
|
964
972
|
);
|
|
965
973
|
const deploy = deploys.filter(
|
|
966
|
-
(
|
|
974
|
+
(innerDeploy) => innerDeploy.context === "production"
|
|
967
975
|
)[0];
|
|
968
976
|
const { data: pluginRuns } = yield netlifyClientInstance.get(
|
|
969
977
|
`/deploys/${deploy.id}/plugin_runs`,
|
|
@@ -999,20 +1007,23 @@ var netlifySiteApi = {
|
|
|
999
1007
|
},
|
|
1000
1008
|
createSiteByInstallationId(name, repositoryFullName, target, installationId, branch, authorization) {
|
|
1001
1009
|
return __async(this, null, function* () {
|
|
1002
|
-
const config =
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1010
|
+
const config = (
|
|
1011
|
+
// eslint-disable-next-line no-nested-ternary -- fix me
|
|
1012
|
+
target === "nextjs" ? {
|
|
1013
|
+
plugins: ["@netlify/plugin-nextjs"],
|
|
1014
|
+
packages: [{ package: "@netlify/plugin-nextjs" }],
|
|
1015
|
+
dir: ".next",
|
|
1016
|
+
cmd: "npm run build"
|
|
1017
|
+
} : target === "node" ? {
|
|
1018
|
+
plugins: [],
|
|
1019
|
+
dir: "dist",
|
|
1020
|
+
cmd: "npm run build"
|
|
1021
|
+
} : {
|
|
1022
|
+
plugin: [],
|
|
1023
|
+
dir: ".",
|
|
1024
|
+
cmd: ""
|
|
1025
|
+
}
|
|
1026
|
+
);
|
|
1016
1027
|
const response = yield netlifyClientInstance.post(
|
|
1017
1028
|
`/sites`,
|
|
1018
1029
|
{
|
|
@@ -1043,19 +1054,22 @@ var netlifySiteApi = {
|
|
|
1043
1054
|
},
|
|
1044
1055
|
createSiteByDeployKey(name, repositoryFullName, target, deployKeyId, branch, authorization) {
|
|
1045
1056
|
return __async(this, null, function* () {
|
|
1046
|
-
const config =
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1057
|
+
const config = (
|
|
1058
|
+
// eslint-disable-next-line no-nested-ternary -- fix me
|
|
1059
|
+
target === "nextjs" ? {
|
|
1060
|
+
packages: [{ package: "@netlify/plugin-nextjs" }],
|
|
1061
|
+
dir: ".next",
|
|
1062
|
+
cmd: "npm run build"
|
|
1063
|
+
} : target === "node" ? {
|
|
1064
|
+
packages: [],
|
|
1065
|
+
dir: "dist",
|
|
1066
|
+
cmd: "npm run build"
|
|
1067
|
+
} : {
|
|
1068
|
+
packages: [],
|
|
1069
|
+
dir: ".",
|
|
1070
|
+
cmd: ""
|
|
1071
|
+
}
|
|
1072
|
+
);
|
|
1059
1073
|
const response = yield netlifyClientInstance.post(
|
|
1060
1074
|
`/sites`,
|
|
1061
1075
|
{
|
|
@@ -1084,13 +1098,12 @@ var netlifySiteApi = {
|
|
|
1084
1098
|
},
|
|
1085
1099
|
removeSite(siteId, authorization) {
|
|
1086
1100
|
return __async(this, null, function* () {
|
|
1087
|
-
|
|
1101
|
+
yield netlifyClientInstance.delete(
|
|
1088
1102
|
`/sites/${siteId}`,
|
|
1089
1103
|
getNetlifyClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
1090
1104
|
ensureAuthorizationToken: true
|
|
1091
1105
|
}))
|
|
1092
1106
|
);
|
|
1093
|
-
return response.data;
|
|
1094
1107
|
});
|
|
1095
1108
|
},
|
|
1096
1109
|
triggerSiteBuild(siteId, authorization) {
|
|
@@ -1203,14 +1216,12 @@ var netlifySiteApi = {
|
|
|
1203
1216
|
{
|
|
1204
1217
|
general_position: "footer",
|
|
1205
1218
|
title: "sentry",
|
|
1206
|
-
// eslint-disable-next-line no-useless-escape
|
|
1207
1219
|
general: `<script src='https://js.sentry-cdn.com/${projectKey}.min.js' crossorigin="anonymous"></script>`
|
|
1208
1220
|
},
|
|
1209
1221
|
getNetlifyClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
1210
1222
|
ensureAuthorizationToken: true
|
|
1211
1223
|
}))
|
|
1212
1224
|
);
|
|
1213
|
-
return;
|
|
1214
1225
|
});
|
|
1215
1226
|
}
|
|
1216
1227
|
};
|
|
@@ -1237,7 +1248,7 @@ planetScaleClientInstance.interceptors.response.use(
|
|
|
1237
1248
|
var _a;
|
|
1238
1249
|
if (import_axios4.default.isAxiosError(error)) {
|
|
1239
1250
|
if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
|
|
1240
|
-
|
|
1251
|
+
throw new UnauthorizeApiError("planetscale");
|
|
1241
1252
|
}
|
|
1242
1253
|
}
|
|
1243
1254
|
throw error;
|
|
@@ -1249,7 +1260,8 @@ function getPlanetScaleClientAuthorization(req) {
|
|
|
1249
1260
|
};
|
|
1250
1261
|
}
|
|
1251
1262
|
function getPlanetScaleClientConfig(options = {}) {
|
|
1252
|
-
const
|
|
1263
|
+
const currentHeaders = planetScaleClientInstance.defaults.headers;
|
|
1264
|
+
const defaultAuthorization = currentHeaders.Authorization;
|
|
1253
1265
|
const headers = {
|
|
1254
1266
|
authorization: defaultAuthorization != null ? defaultAuthorization : options.token ? `${options.token}` : void 0
|
|
1255
1267
|
};
|
|
@@ -1266,10 +1278,11 @@ function initPlanetScaleClientInstance(token) {
|
|
|
1266
1278
|
}
|
|
1267
1279
|
}
|
|
1268
1280
|
function updatePlanetScaleClientInstance(token) {
|
|
1281
|
+
const headers = planetScaleClientInstance.defaults.headers;
|
|
1269
1282
|
if (token) {
|
|
1270
|
-
|
|
1283
|
+
headers.Authorization = `${token}`;
|
|
1271
1284
|
} else {
|
|
1272
|
-
delete
|
|
1285
|
+
delete headers.Authorization;
|
|
1273
1286
|
}
|
|
1274
1287
|
}
|
|
1275
1288
|
|
|
@@ -1453,7 +1466,7 @@ var import_axios6 = __toESM(require("axios"));
|
|
|
1453
1466
|
var sentryClientInstance = import_axios6.default.create({
|
|
1454
1467
|
baseURL: "https://sentry.io/api/0/",
|
|
1455
1468
|
headers: {
|
|
1456
|
-
|
|
1469
|
+
"Content-Type": "application/json"
|
|
1457
1470
|
}
|
|
1458
1471
|
});
|
|
1459
1472
|
sentryClientInstance.interceptors.response.use(
|
|
@@ -1462,7 +1475,7 @@ sentryClientInstance.interceptors.response.use(
|
|
|
1462
1475
|
var _a;
|
|
1463
1476
|
if (import_axios6.default.isAxiosError(error)) {
|
|
1464
1477
|
if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
|
|
1465
|
-
|
|
1478
|
+
throw new UnauthorizeApiError("sentry");
|
|
1466
1479
|
}
|
|
1467
1480
|
}
|
|
1468
1481
|
throw error;
|
|
@@ -1474,7 +1487,8 @@ function getSentryClientAuthorization(req) {
|
|
|
1474
1487
|
};
|
|
1475
1488
|
}
|
|
1476
1489
|
function getSentryClientConfig(options = {}) {
|
|
1477
|
-
const
|
|
1490
|
+
const currentHeaders = sentryClientInstance.defaults.headers;
|
|
1491
|
+
const defaultAuthorization = currentHeaders.Authorization;
|
|
1478
1492
|
const headers = {
|
|
1479
1493
|
authorization: defaultAuthorization != null ? defaultAuthorization : options.token ? `Bearer ${options.token}` : void 0
|
|
1480
1494
|
};
|
|
@@ -1492,10 +1506,11 @@ function initSentryClientInstance(token) {
|
|
|
1492
1506
|
}
|
|
1493
1507
|
}
|
|
1494
1508
|
function updateSentryClientInstance(token) {
|
|
1509
|
+
const headers = sentryClientInstance.defaults.headers;
|
|
1495
1510
|
if (token) {
|
|
1496
|
-
|
|
1511
|
+
headers.Authorization = `Bearer ${token}`;
|
|
1497
1512
|
} else {
|
|
1498
|
-
delete
|
|
1513
|
+
delete headers.Authorization;
|
|
1499
1514
|
}
|
|
1500
1515
|
}
|
|
1501
1516
|
|
|
@@ -1628,7 +1643,7 @@ var sentryApi = {
|
|
|
1628
1643
|
},
|
|
1629
1644
|
createRepo(organizationSlug, projectId, repositoryFullName, repositoryBranch, githubIntegrationId, authorization) {
|
|
1630
1645
|
return __async(this, null, function* () {
|
|
1631
|
-
var _a, _b
|
|
1646
|
+
var _a, _b;
|
|
1632
1647
|
let repository;
|
|
1633
1648
|
try {
|
|
1634
1649
|
const response = yield sentryClientInstance.post(
|
|
@@ -1645,7 +1660,7 @@ var sentryApi = {
|
|
|
1645
1660
|
repository = response.data;
|
|
1646
1661
|
} catch (err) {
|
|
1647
1662
|
const error = err;
|
|
1648
|
-
if (((
|
|
1663
|
+
if (((_a = error.response) == null ? void 0 : _a.data.error_type) === "validation" || ((_b = error.response) == null ? void 0 : _b.data.error_type) === "unknown") {
|
|
1649
1664
|
throw error;
|
|
1650
1665
|
}
|
|
1651
1666
|
const response = yield sentryClientInstance.get(
|
|
@@ -1705,10 +1720,7 @@ var sentryApi = {
|
|
|
1705
1720
|
);
|
|
1706
1721
|
} catch (error) {
|
|
1707
1722
|
if (((_a = error.response) == null ? void 0 : _a.status) === 409) {
|
|
1708
|
-
return
|
|
1709
|
-
`${organizationSlug}/${name}`,
|
|
1710
|
-
authorization
|
|
1711
|
-
);
|
|
1723
|
+
return this.getProject(`${organizationSlug}/${name}`, authorization);
|
|
1712
1724
|
}
|
|
1713
1725
|
throw error;
|
|
1714
1726
|
}
|
|
@@ -1716,13 +1728,12 @@ var sentryApi = {
|
|
|
1716
1728
|
},
|
|
1717
1729
|
deleteProject(projectFullName, authorization) {
|
|
1718
1730
|
return __async(this, null, function* () {
|
|
1719
|
-
|
|
1731
|
+
yield sentryClientInstance.delete(
|
|
1720
1732
|
`/projects/${projectFullName}/`,
|
|
1721
1733
|
getSentryClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
1722
1734
|
ensureAuthorizationToken: true
|
|
1723
1735
|
}))
|
|
1724
1736
|
);
|
|
1725
|
-
return response.data;
|
|
1726
1737
|
});
|
|
1727
1738
|
}
|
|
1728
1739
|
};
|
|
@@ -1739,7 +1750,8 @@ function getTextClientAuthorization(req) {
|
|
|
1739
1750
|
};
|
|
1740
1751
|
}
|
|
1741
1752
|
function getTextClientConfig(option = {}) {
|
|
1742
|
-
const
|
|
1753
|
+
const currentHeaders = textClientInstance.defaults.headers;
|
|
1754
|
+
const defaultAuthorization = currentHeaders.Authorization;
|
|
1743
1755
|
const headers = {
|
|
1744
1756
|
authorization: defaultAuthorization != null ? defaultAuthorization : option.token ? `Bearer ${option.token}` : void 0
|
|
1745
1757
|
};
|
|
@@ -1748,19 +1760,20 @@ function getTextClientConfig(option = {}) {
|
|
|
1748
1760
|
};
|
|
1749
1761
|
}
|
|
1750
1762
|
function initTextClientInstance(baseUrl, token) {
|
|
1763
|
+
const headers = textClientInstance.defaults.headers;
|
|
1751
1764
|
if (baseUrl) {
|
|
1752
1765
|
textClientInstance.interceptors.request.use(
|
|
1753
|
-
(config) =>
|
|
1766
|
+
(config) => {
|
|
1754
1767
|
config.baseURL = baseUrl;
|
|
1755
1768
|
return config;
|
|
1756
|
-
}
|
|
1769
|
+
},
|
|
1757
1770
|
(error) => Promise.reject(error)
|
|
1758
1771
|
);
|
|
1759
1772
|
}
|
|
1760
1773
|
if (token) {
|
|
1761
|
-
|
|
1774
|
+
headers.Authorization = `Bearer ${token}`;
|
|
1762
1775
|
} else {
|
|
1763
|
-
delete
|
|
1776
|
+
delete headers.Authorization;
|
|
1764
1777
|
}
|
|
1765
1778
|
}
|
|
1766
1779
|
|
|
@@ -1801,12 +1814,11 @@ var textAppMonitoringEventsApi = {
|
|
|
1801
1814
|
upsertEvent(appId, event, authorization) {
|
|
1802
1815
|
return __async(this, null, function* () {
|
|
1803
1816
|
try {
|
|
1804
|
-
|
|
1817
|
+
yield textClientInstance.post(
|
|
1805
1818
|
`/app_monitoring/${appId}/events/${event.key}`,
|
|
1806
1819
|
event,
|
|
1807
1820
|
getTextClientConfig(authorization)
|
|
1808
1821
|
);
|
|
1809
|
-
return response.data;
|
|
1810
1822
|
} catch (error) {
|
|
1811
1823
|
if (error instanceof Error) {
|
|
1812
1824
|
throw new Error(`Couldn't upsert event. [${error.message}]`);
|
|
@@ -1818,11 +1830,10 @@ var textAppMonitoringEventsApi = {
|
|
|
1818
1830
|
deleteEvent(appId, eventKey, authorization) {
|
|
1819
1831
|
return __async(this, null, function* () {
|
|
1820
1832
|
try {
|
|
1821
|
-
|
|
1833
|
+
yield textClientInstance.delete(
|
|
1822
1834
|
`/app_monitoring/${appId}/events/${eventKey}`,
|
|
1823
1835
|
getTextClientConfig(authorization)
|
|
1824
1836
|
);
|
|
1825
|
-
return response.data;
|
|
1826
1837
|
} catch (error) {
|
|
1827
1838
|
if (error instanceof Error) {
|
|
1828
1839
|
throw new Error(`Couldn't delete event. [${error.message}]`);
|
|
@@ -1834,12 +1845,11 @@ var textAppMonitoringEventsApi = {
|
|
|
1834
1845
|
sendEvent(appId, data, authorization) {
|
|
1835
1846
|
return __async(this, null, function* () {
|
|
1836
1847
|
try {
|
|
1837
|
-
|
|
1848
|
+
yield textClientInstance.post(
|
|
1838
1849
|
`/app_monitoring/${appId}/events`,
|
|
1839
1850
|
data,
|
|
1840
1851
|
getTextClientConfig(authorization)
|
|
1841
1852
|
);
|
|
1842
|
-
return response.data;
|
|
1843
1853
|
} catch (error) {
|
|
1844
1854
|
if (error instanceof Error) {
|
|
1845
1855
|
throw new Error(`Couldn't send events. [${error.message}]`);
|
|
@@ -1857,7 +1867,9 @@ var textAppMonitoringEventsApi = {
|
|
|
1857
1867
|
search: (_b = payload.search) != null ? _b : ""
|
|
1858
1868
|
});
|
|
1859
1869
|
if (payload.type) {
|
|
1860
|
-
payload.type.forEach((type) =>
|
|
1870
|
+
payload.type.forEach((type) => {
|
|
1871
|
+
searchParams.append("type[]", type);
|
|
1872
|
+
});
|
|
1861
1873
|
}
|
|
1862
1874
|
const response = yield textClientInstance.get(
|
|
1863
1875
|
`/app_monitoring/${appId}/events?${searchParams.toString()}`,
|
|
@@ -1969,12 +1981,11 @@ var textAppMonitoringReportsApi = {
|
|
|
1969
1981
|
createCustomReport(appId, customReport, authorization) {
|
|
1970
1982
|
return __async(this, null, function* () {
|
|
1971
1983
|
try {
|
|
1972
|
-
|
|
1984
|
+
yield textClientInstance.post(
|
|
1973
1985
|
`/app_monitoring/${appId}/reports/custom`,
|
|
1974
1986
|
customReport,
|
|
1975
1987
|
getTextClientConfig(authorization)
|
|
1976
1988
|
);
|
|
1977
|
-
return response.data;
|
|
1978
1989
|
} catch (error) {
|
|
1979
1990
|
if (error instanceof Error) {
|
|
1980
1991
|
throw new Error(`Couldn't create custom report. [${error.message}]`);
|
|
@@ -1986,12 +1997,11 @@ var textAppMonitoringReportsApi = {
|
|
|
1986
1997
|
updateCustomReport(appId, customReport, authorization) {
|
|
1987
1998
|
return __async(this, null, function* () {
|
|
1988
1999
|
try {
|
|
1989
|
-
|
|
2000
|
+
yield textClientInstance.post(
|
|
1990
2001
|
`/app_monitoring/${appId}/reports/custom/${customReport.id}`,
|
|
1991
2002
|
customReport,
|
|
1992
2003
|
getTextClientConfig(authorization)
|
|
1993
2004
|
);
|
|
1994
|
-
return response.data;
|
|
1995
2005
|
} catch (error) {
|
|
1996
2006
|
if (error instanceof Error) {
|
|
1997
2007
|
throw new Error(`Couldn't update custom report. [${error.message}]`);
|
|
@@ -2003,11 +2013,10 @@ var textAppMonitoringReportsApi = {
|
|
|
2003
2013
|
deleteCustomReport(appId, customReportId, authorization) {
|
|
2004
2014
|
return __async(this, null, function* () {
|
|
2005
2015
|
try {
|
|
2006
|
-
|
|
2016
|
+
yield textClientInstance.delete(
|
|
2007
2017
|
`/app_monitoring/${appId}/reports/custom/${customReportId}`,
|
|
2008
2018
|
getTextClientConfig(authorization)
|
|
2009
2019
|
);
|
|
2010
|
-
return response.data;
|
|
2011
2020
|
} catch (error) {
|
|
2012
2021
|
if (error instanceof Error) {
|
|
2013
2022
|
throw new Error(`Couldn't delete custom report. [${error.message}]`);
|
|
@@ -2048,7 +2057,7 @@ vercelClientInstance.interceptors.response.use(
|
|
|
2048
2057
|
var _a;
|
|
2049
2058
|
if (import_axios8.default.isAxiosError(error)) {
|
|
2050
2059
|
if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
|
|
2051
|
-
|
|
2060
|
+
throw new UnauthorizeApiError("vercel");
|
|
2052
2061
|
}
|
|
2053
2062
|
}
|
|
2054
2063
|
throw error;
|
|
@@ -2060,7 +2069,8 @@ function getVercelClientAuthorization(req) {
|
|
|
2060
2069
|
};
|
|
2061
2070
|
}
|
|
2062
2071
|
function getVercelClientConfig(options = {}) {
|
|
2063
|
-
const
|
|
2072
|
+
const currentHeaders = vercelClientInstance.defaults.headers;
|
|
2073
|
+
const defaultAuthorization = currentHeaders.Authorization;
|
|
2064
2074
|
const headers = {
|
|
2065
2075
|
authorization: defaultAuthorization != null ? defaultAuthorization : options.token ? `Bearer ${options.token}` : void 0
|
|
2066
2076
|
};
|
|
@@ -2077,10 +2087,11 @@ function initVercelClientInstance(token) {
|
|
|
2077
2087
|
}
|
|
2078
2088
|
}
|
|
2079
2089
|
function updateVercelClientInstance(token) {
|
|
2090
|
+
const headers = vercelClientInstance.defaults.headers;
|
|
2080
2091
|
if (token) {
|
|
2081
|
-
|
|
2092
|
+
headers.Authorization = `Bearer ${token}`;
|
|
2082
2093
|
} else {
|
|
2083
|
-
delete
|
|
2094
|
+
delete headers.Authorization;
|
|
2084
2095
|
}
|
|
2085
2096
|
}
|
|
2086
2097
|
|
|
@@ -2123,7 +2134,7 @@ var vercelIntegrationApi = {
|
|
|
2123
2134
|
var _a;
|
|
2124
2135
|
try {
|
|
2125
2136
|
const response = yield vercelClientInstance.get(
|
|
2126
|
-
`/v1/integrations/search-repo?provider=github${repositoryName ?
|
|
2137
|
+
`/v1/integrations/search-repo?provider=github${repositoryName ? `&query=${repositoryName}` : ""}${namespaceId ? `&namespaceId=${namespaceId}` : ""}`,
|
|
2127
2138
|
getVercelClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
2128
2139
|
ensureAuthorizationToken: true
|
|
2129
2140
|
}))
|
|
@@ -2146,7 +2157,6 @@ var vercelIntegrationApi = {
|
|
|
2146
2157
|
},
|
|
2147
2158
|
isRepositoryAccessible(repositoryName, authorization) {
|
|
2148
2159
|
return __async(this, null, function* () {
|
|
2149
|
-
var _a;
|
|
2150
2160
|
try {
|
|
2151
2161
|
const namespaces = yield this.getGitNamespaces(authorization);
|
|
2152
2162
|
const accessibleNamespaceId = namespaces.length > 0 ? (yield Promise.all(
|
|
@@ -2155,9 +2165,9 @@ var vercelIntegrationApi = {
|
|
|
2155
2165
|
)
|
|
2156
2166
|
)).map(
|
|
2157
2167
|
(repositories) => repositories.repos.length > 0 ? repositories.namespaceId : void 0
|
|
2158
|
-
)[0] : (
|
|
2168
|
+
)[0] : (yield this.getGitRepos(repositoryName, void 0, authorization)).namespaceId;
|
|
2159
2169
|
return {
|
|
2160
|
-
isAccessible:
|
|
2170
|
+
isAccessible: Boolean(accessibleNamespaceId),
|
|
2161
2171
|
installationId: accessibleNamespaceId
|
|
2162
2172
|
};
|
|
2163
2173
|
} catch (err) {
|
|
@@ -2264,15 +2274,16 @@ var vercelProjectApi = {
|
|
|
2264
2274
|
getProjectEnvByKey(projectId, envKey, authorization) {
|
|
2265
2275
|
return __async(this, null, function* () {
|
|
2266
2276
|
const envs = yield this.getProjectEnvs(projectId, authorization);
|
|
2267
|
-
const env = envs.find((
|
|
2277
|
+
const env = envs.find((innerEnv) => envKey === innerEnv.key);
|
|
2268
2278
|
if (!env) {
|
|
2269
2279
|
return;
|
|
2270
2280
|
}
|
|
2271
|
-
return
|
|
2281
|
+
return this.getProjectEnv(projectId, env.id, authorization);
|
|
2272
2282
|
});
|
|
2273
2283
|
},
|
|
2274
|
-
createProjectEnv(projectId, key, value,
|
|
2284
|
+
createProjectEnv(projectId, key, value, projectEnvs, authorization) {
|
|
2275
2285
|
return __async(this, null, function* () {
|
|
2286
|
+
let envs = projectEnvs;
|
|
2276
2287
|
if (!envs) {
|
|
2277
2288
|
const response = yield vercelClientInstance.get(`/v9/projects/${projectId}/env`, getVercelClientConfig(authorization));
|
|
2278
2289
|
envs = response.data.envs;
|
|
@@ -2280,7 +2291,7 @@ var vercelProjectApi = {
|
|
|
2280
2291
|
const existingEnv = envs.find((env) => env.key === key);
|
|
2281
2292
|
if (existingEnv) {
|
|
2282
2293
|
const { data: editedEnv } = yield vercelClientInstance.patch(
|
|
2283
|
-
`/v9/projects/${projectId}/env/${existingEnv
|
|
2294
|
+
`/v9/projects/${projectId}/env/${existingEnv.id}`,
|
|
2284
2295
|
{
|
|
2285
2296
|
key,
|
|
2286
2297
|
value,
|
|
@@ -2292,32 +2303,30 @@ var vercelProjectApi = {
|
|
|
2292
2303
|
}))
|
|
2293
2304
|
);
|
|
2294
2305
|
return editedEnv;
|
|
2295
|
-
} else {
|
|
2296
|
-
const { data: createdEnv } = yield vercelClientInstance.post(
|
|
2297
|
-
`/v9/projects/${projectId}/env`,
|
|
2298
|
-
{
|
|
2299
|
-
key,
|
|
2300
|
-
value,
|
|
2301
|
-
type: "encrypted",
|
|
2302
|
-
target: ["production", "preview", "development"]
|
|
2303
|
-
},
|
|
2304
|
-
getVercelClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
2305
|
-
ensureAuthorizationToken: true
|
|
2306
|
-
}))
|
|
2307
|
-
);
|
|
2308
|
-
return createdEnv;
|
|
2309
2306
|
}
|
|
2307
|
+
const { data: createdEnv } = yield vercelClientInstance.post(
|
|
2308
|
+
`/v9/projects/${projectId}/env`,
|
|
2309
|
+
{
|
|
2310
|
+
key,
|
|
2311
|
+
value,
|
|
2312
|
+
type: "encrypted",
|
|
2313
|
+
target: ["production", "preview", "development"]
|
|
2314
|
+
},
|
|
2315
|
+
getVercelClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
2316
|
+
ensureAuthorizationToken: true
|
|
2317
|
+
}))
|
|
2318
|
+
);
|
|
2319
|
+
return createdEnv;
|
|
2310
2320
|
});
|
|
2311
2321
|
},
|
|
2312
2322
|
removeProjectEnv(projectId, envId, authorization) {
|
|
2313
2323
|
return __async(this, null, function* () {
|
|
2314
|
-
|
|
2324
|
+
yield vercelClientInstance.delete(
|
|
2315
2325
|
`/v9/projects/${projectId}/env/${envId}`,
|
|
2316
2326
|
getVercelClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
2317
2327
|
ensureAuthorizationToken: true
|
|
2318
2328
|
}))
|
|
2319
2329
|
);
|
|
2320
|
-
return response.data;
|
|
2321
2330
|
});
|
|
2322
2331
|
}
|
|
2323
2332
|
};
|
|
@@ -2335,15 +2344,11 @@ var vercelApi = {
|
|
|
2335
2344
|
client_secret: clientSecret,
|
|
2336
2345
|
redirect_uri: redirectUrl
|
|
2337
2346
|
});
|
|
2338
|
-
const response = yield import_axios9.default.post(
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
{
|
|
2342
|
-
headers: {
|
|
2343
|
-
"Content-Type": "application/x-www-form-urlencoded"
|
|
2344
|
-
}
|
|
2347
|
+
const response = yield import_axios9.default.post("https://api.vercel.com/v2/oauth/access_token", data, {
|
|
2348
|
+
headers: {
|
|
2349
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
2345
2350
|
}
|
|
2346
|
-
);
|
|
2351
|
+
});
|
|
2347
2352
|
return {
|
|
2348
2353
|
token: response.data.access_token,
|
|
2349
2354
|
installationId: response.data.installation_id,
|
|
@@ -2378,7 +2383,6 @@ var getRegion = (token) => {
|
|
|
2378
2383
|
if (supportedRegions.includes(region)) {
|
|
2379
2384
|
return region;
|
|
2380
2385
|
}
|
|
2381
|
-
return void 0;
|
|
2382
2386
|
};
|
|
2383
2387
|
var livechatClientInstance = import_axios10.default.create({
|
|
2384
2388
|
baseURL: "https://api.labs.livechatinc.com"
|
|
@@ -2389,7 +2393,8 @@ function getLiveChatClientAuthorization(req) {
|
|
|
2389
2393
|
};
|
|
2390
2394
|
}
|
|
2391
2395
|
function getLiveChatClientConfig(options = {}) {
|
|
2392
|
-
const
|
|
2396
|
+
const currentHeaders = livechatClientInstance.defaults.headers;
|
|
2397
|
+
const defaultAuthorization = currentHeaders.Authorization;
|
|
2393
2398
|
const headers = {
|
|
2394
2399
|
authorization: defaultAuthorization != null ? defaultAuthorization : options.token ? `Bearer ${options.token}` : void 0
|
|
2395
2400
|
};
|
|
@@ -2399,22 +2404,23 @@ function getLiveChatClientConfig(options = {}) {
|
|
|
2399
2404
|
}
|
|
2400
2405
|
function initLiveChatClientInstance(baseUrl, token) {
|
|
2401
2406
|
const region = token ? getRegion(token) : void 0;
|
|
2407
|
+
const headers = livechatClientInstance.defaults.headers;
|
|
2402
2408
|
if (baseUrl) {
|
|
2403
2409
|
livechatClientInstance.interceptors.request.use(
|
|
2404
|
-
(config) =>
|
|
2410
|
+
(config) => {
|
|
2405
2411
|
config.baseURL = baseUrl;
|
|
2406
2412
|
return config;
|
|
2407
|
-
}
|
|
2413
|
+
},
|
|
2408
2414
|
(error) => Promise.reject(error)
|
|
2409
2415
|
);
|
|
2410
2416
|
}
|
|
2411
2417
|
if (region) {
|
|
2412
|
-
|
|
2418
|
+
headers["X-Region"] = region;
|
|
2413
2419
|
}
|
|
2414
2420
|
if (token) {
|
|
2415
|
-
|
|
2421
|
+
headers.Authorization = `Bearer ${token}`;
|
|
2416
2422
|
} else {
|
|
2417
|
-
delete
|
|
2423
|
+
delete headers.Authorization;
|
|
2418
2424
|
}
|
|
2419
2425
|
}
|
|
2420
2426
|
|
|
@@ -2562,7 +2568,7 @@ var livechatPropertyApi = {
|
|
|
2562
2568
|
try {
|
|
2563
2569
|
const response = yield Promise.all(
|
|
2564
2570
|
properties.filter((property) => property.public_access).map((property) => __async(this, null, function* () {
|
|
2565
|
-
return
|
|
2571
|
+
return livechatClientInstance.post(
|
|
2566
2572
|
`/v3.3/configuration/action/publish_property`,
|
|
2567
2573
|
{
|
|
2568
2574
|
name: property.name,
|
|
@@ -2587,7 +2593,7 @@ var livechatPropertyApi = {
|
|
|
2587
2593
|
try {
|
|
2588
2594
|
const response = yield Promise.all(
|
|
2589
2595
|
properties.map((property) => __async(this, null, function* () {
|
|
2590
|
-
return
|
|
2596
|
+
return livechatClientInstance.post(
|
|
2591
2597
|
`/v3.3/configuration/action/register_property`,
|
|
2592
2598
|
{
|
|
2593
2599
|
name: property.name,
|
|
@@ -2618,7 +2624,7 @@ var livechatPropertyApi = {
|
|
|
2618
2624
|
yield Promise.all(
|
|
2619
2625
|
Object.keys(properties).map((property) => __async(this, null, function* () {
|
|
2620
2626
|
if (Object.keys(properties[property]).indexOf("public_access") <= 0) {
|
|
2621
|
-
return
|
|
2627
|
+
return livechatClientInstance.post(
|
|
2622
2628
|
`/v3.3/configuration/action/unregister_property`,
|
|
2623
2629
|
{
|
|
2624
2630
|
name: property,
|
|
@@ -2695,7 +2701,7 @@ var livechatWebhookApi = {
|
|
|
2695
2701
|
const { data: webhooks } = yield this.getWebhooks(clientId);
|
|
2696
2702
|
yield Promise.all(
|
|
2697
2703
|
webhooks.map((webhook) => __async(this, null, function* () {
|
|
2698
|
-
return
|
|
2704
|
+
return livechatClientInstance.post(
|
|
2699
2705
|
`/v3.5/configuration/action/unregister_webhook`,
|
|
2700
2706
|
{
|
|
2701
2707
|
id: webhook.id,
|
|
@@ -2718,10 +2724,10 @@ var livechatWebhookApi = {
|
|
|
2718
2724
|
registerWebhooks(webhooks) {
|
|
2719
2725
|
return __async(this, null, function* () {
|
|
2720
2726
|
try {
|
|
2721
|
-
yield this.unregisterWebhooks(webhooks[0]
|
|
2727
|
+
yield this.unregisterWebhooks(webhooks[0].owner_client_id);
|
|
2722
2728
|
yield Promise.all(
|
|
2723
2729
|
webhooks.map((webhook) => __async(this, null, function* () {
|
|
2724
|
-
return
|
|
2730
|
+
return livechatClientInstance.post(
|
|
2725
2731
|
`/v${webhook.api_version || "3.5"}/configuration/action/register_webhook`,
|
|
2726
2732
|
{
|
|
2727
2733
|
url: webhook.url,
|
|
@@ -2756,10 +2762,9 @@ var livechatWebhookApi = {
|
|
|
2756
2762
|
filters: webhook.filters
|
|
2757
2763
|
};
|
|
2758
2764
|
});
|
|
2759
|
-
const { data: verifiedWebhooks } = yield livechatClientInstance.post(
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
);
|
|
2765
|
+
const { data: verifiedWebhooks } = yield livechatClientInstance.post(`/v3.3/configuration/action/check_webhooks_migration`, [
|
|
2766
|
+
...webhooksToCheck
|
|
2767
|
+
]);
|
|
2763
2768
|
const updatedWebhooks = webhooks.map((webhook, index) => {
|
|
2764
2769
|
return __spreadProps(__spreadValues({}, webhook), {
|
|
2765
2770
|
action: verifiedWebhooks[index].action
|
|
@@ -3189,14 +3194,16 @@ function getPlatformDpsClientAuthorization(req) {
|
|
|
3189
3194
|
};
|
|
3190
3195
|
}
|
|
3191
3196
|
function getPlatformDpsAdminClientAuthorization() {
|
|
3192
|
-
|
|
3197
|
+
var _a, _b;
|
|
3198
|
+
const token = process.env.NEXT_PUBLIC_PLATFORM_ENV === "prod" ? (_a = process.env.PLATFORM_DPS_TOKEN_FOR_GITHUB) != null ? _a : "" : (_b = process.env.PLATFORM_DPS_TOKEN_FOR_GITHUB_LABS) != null ? _b : "";
|
|
3193
3199
|
return {
|
|
3194
|
-
token: btoa(
|
|
3200
|
+
token: btoa(`apps@livechatinc.com:${token}`),
|
|
3195
3201
|
tokenType: "Basic"
|
|
3196
3202
|
};
|
|
3197
3203
|
}
|
|
3198
3204
|
function getPlatformDpsClientConfig(options = {}) {
|
|
3199
|
-
const
|
|
3205
|
+
const currentHeaders = platformDpsClientInstance.defaults.headers;
|
|
3206
|
+
const defaultAuthorization = currentHeaders.Authorization;
|
|
3200
3207
|
const headers = {
|
|
3201
3208
|
authorization: defaultAuthorization != null ? defaultAuthorization : options.token ? `Bearer ${options.token}` : void 0
|
|
3202
3209
|
};
|
|
@@ -3205,19 +3212,20 @@ function getPlatformDpsClientConfig(options = {}) {
|
|
|
3205
3212
|
};
|
|
3206
3213
|
}
|
|
3207
3214
|
function initPlatformDpsClientInstance(baseUrl, token) {
|
|
3215
|
+
const headers = platformDpsClientInstance.defaults.headers;
|
|
3208
3216
|
if (baseUrl) {
|
|
3209
3217
|
platformDpsClientInstance.interceptors.request.use(
|
|
3210
|
-
(config) =>
|
|
3218
|
+
(config) => {
|
|
3211
3219
|
config.baseURL = baseUrl;
|
|
3212
3220
|
return config;
|
|
3213
|
-
}
|
|
3221
|
+
},
|
|
3214
3222
|
(error) => Promise.reject(error)
|
|
3215
3223
|
);
|
|
3216
3224
|
}
|
|
3217
3225
|
if (token) {
|
|
3218
|
-
|
|
3226
|
+
headers.Authorization = `Bearer ${token}`;
|
|
3219
3227
|
} else {
|
|
3220
|
-
delete
|
|
3228
|
+
delete headers.Authorization;
|
|
3221
3229
|
}
|
|
3222
3230
|
}
|
|
3223
3231
|
|
|
@@ -3622,17 +3630,16 @@ var platformDpsApplicationInfrastructureBlocksApi = {
|
|
|
3622
3630
|
},
|
|
3623
3631
|
updateBlocks(appId, payload, authorization) {
|
|
3624
3632
|
return __async(this, null, function* () {
|
|
3625
|
-
|
|
3633
|
+
yield platformDpsClientInstance.patch(
|
|
3626
3634
|
`/v2/applications/${appId}/infrastructure/blocks`,
|
|
3627
3635
|
payload,
|
|
3628
3636
|
getPlatformDpsClientConfig(authorization)
|
|
3629
3637
|
);
|
|
3630
|
-
return response.data;
|
|
3631
3638
|
});
|
|
3632
3639
|
},
|
|
3633
3640
|
updateRepository(appId, payload, authorization) {
|
|
3634
3641
|
return __async(this, null, function* () {
|
|
3635
|
-
|
|
3642
|
+
yield platformDpsClientInstance.patch(
|
|
3636
3643
|
`/v2/applications/${appId}/infrastructure/blocks`,
|
|
3637
3644
|
{
|
|
3638
3645
|
appId,
|
|
@@ -3642,13 +3649,12 @@ var platformDpsApplicationInfrastructureBlocksApi = {
|
|
|
3642
3649
|
},
|
|
3643
3650
|
getPlatformDpsClientConfig(authorization)
|
|
3644
3651
|
);
|
|
3645
|
-
return response.data;
|
|
3646
3652
|
});
|
|
3647
3653
|
},
|
|
3648
3654
|
updateDeployment(appId, payload, authorization) {
|
|
3649
3655
|
return __async(this, null, function* () {
|
|
3650
3656
|
const config = payload.customUrl ? { custom: { url: payload.customUrl } } : { custom: null };
|
|
3651
|
-
|
|
3657
|
+
yield platformDpsClientInstance.patch(
|
|
3652
3658
|
`/v2/applications/${appId}/infrastructure/blocks`,
|
|
3653
3659
|
{
|
|
3654
3660
|
appId,
|
|
@@ -3660,12 +3666,11 @@ var platformDpsApplicationInfrastructureBlocksApi = {
|
|
|
3660
3666
|
},
|
|
3661
3667
|
getPlatformDpsClientConfig(authorization)
|
|
3662
3668
|
);
|
|
3663
|
-
return response.data;
|
|
3664
3669
|
});
|
|
3665
3670
|
},
|
|
3666
3671
|
updateStorage(appId, payload, authorization) {
|
|
3667
3672
|
return __async(this, null, function* () {
|
|
3668
|
-
|
|
3673
|
+
yield platformDpsClientInstance.patch(
|
|
3669
3674
|
`/v2/applications/${appId}/infrastructure/blocks`,
|
|
3670
3675
|
{
|
|
3671
3676
|
appId,
|
|
@@ -3675,12 +3680,11 @@ var platformDpsApplicationInfrastructureBlocksApi = {
|
|
|
3675
3680
|
},
|
|
3676
3681
|
getPlatformDpsClientConfig(authorization)
|
|
3677
3682
|
);
|
|
3678
|
-
return response.data;
|
|
3679
3683
|
});
|
|
3680
3684
|
},
|
|
3681
3685
|
updateLogger(appId, payload, authorization) {
|
|
3682
3686
|
return __async(this, null, function* () {
|
|
3683
|
-
|
|
3687
|
+
yield platformDpsClientInstance.post(
|
|
3684
3688
|
`/v2/applications/${appId}/infrastructure/blocks`,
|
|
3685
3689
|
{
|
|
3686
3690
|
appId,
|
|
@@ -3690,7 +3694,6 @@ var platformDpsApplicationInfrastructureBlocksApi = {
|
|
|
3690
3694
|
},
|
|
3691
3695
|
getPlatformDpsClientConfig(authorization)
|
|
3692
3696
|
);
|
|
3693
|
-
return response.data;
|
|
3694
3697
|
});
|
|
3695
3698
|
}
|
|
3696
3699
|
};
|
|
@@ -4398,8 +4401,8 @@ var platformDpsDeveloperApi = {
|
|
|
4398
4401
|
return __async(this, null, function* () {
|
|
4399
4402
|
try {
|
|
4400
4403
|
const { startAt, endAt, size, page } = options;
|
|
4401
|
-
const withRange =
|
|
4402
|
-
const withPagination =
|
|
4404
|
+
const withRange = Boolean(startAt && endAt);
|
|
4405
|
+
const withPagination = Boolean(size && typeof page === "number");
|
|
4403
4406
|
let params = withRange || withPagination ? `?` : "";
|
|
4404
4407
|
if (withRange) {
|
|
4405
4408
|
params += `from=${startAt}&to=${endAt}`;
|
|
@@ -4579,7 +4582,7 @@ var dpsResearchDictionaryApi = {
|
|
|
4579
4582
|
try {
|
|
4580
4583
|
const params = new URLSearchParams(options);
|
|
4581
4584
|
const response = yield platformDpsClientInstance.get(
|
|
4582
|
-
`/v2/research/dictionary?${params}`,
|
|
4585
|
+
`/v2/research/dictionary?${params.toString()}`,
|
|
4583
4586
|
getPlatformDpsClientConfig(authorization)
|
|
4584
4587
|
);
|
|
4585
4588
|
return response.data;
|
|
@@ -4602,7 +4605,7 @@ var dpsResearchMarketplaceApi = {
|
|
|
4602
4605
|
try {
|
|
4603
4606
|
const params = new URLSearchParams(options);
|
|
4604
4607
|
const response = yield platformDpsClientInstance.get(
|
|
4605
|
-
`/v2/research/marketplace/apps?${params}`,
|
|
4608
|
+
`/v2/research/marketplace/apps?${params.toString()}`,
|
|
4606
4609
|
getPlatformDpsClientConfig(authorization)
|
|
4607
4610
|
);
|
|
4608
4611
|
return response.data;
|
|
@@ -4621,7 +4624,7 @@ var dpsResearchMarketplaceApi = {
|
|
|
4621
4624
|
try {
|
|
4622
4625
|
const params = new URLSearchParams(options);
|
|
4623
4626
|
const response = yield platformDpsClientInstance.get(
|
|
4624
|
-
`/v2/research/marketplace/views?${params}`,
|
|
4627
|
+
`/v2/research/marketplace/views?${params.toString()}`,
|
|
4625
4628
|
getPlatformDpsClientConfig(authorization)
|
|
4626
4629
|
);
|
|
4627
4630
|
return response.data;
|
|
@@ -4644,7 +4647,7 @@ var dpsResearchTrafficApi = {
|
|
|
4644
4647
|
try {
|
|
4645
4648
|
const params = new URLSearchParams(options);
|
|
4646
4649
|
const response = yield platformDpsClientInstance.get(
|
|
4647
|
-
`/v2/research/traffic/agents?${params}`,
|
|
4650
|
+
`/v2/research/traffic/agents?${params.toString()}`,
|
|
4648
4651
|
getPlatformDpsClientConfig(authorization)
|
|
4649
4652
|
);
|
|
4650
4653
|
return response.data;
|
|
@@ -4663,7 +4666,7 @@ var dpsResearchTrafficApi = {
|
|
|
4663
4666
|
try {
|
|
4664
4667
|
const params = new URLSearchParams(options);
|
|
4665
4668
|
const response = yield platformDpsClientInstance.get(
|
|
4666
|
-
`/v2/research/traffic/chats?${params}`,
|
|
4669
|
+
`/v2/research/traffic/chats?${params.toString()}`,
|
|
4667
4670
|
getPlatformDpsClientConfig(authorization)
|
|
4668
4671
|
);
|
|
4669
4672
|
return response.data;
|
|
@@ -4719,35 +4722,29 @@ var platformDpsUserApi = {
|
|
|
4719
4722
|
},
|
|
4720
4723
|
updateUserIntegrations(payload, authorization) {
|
|
4721
4724
|
return __async(this, null, function* () {
|
|
4722
|
-
|
|
4725
|
+
yield platformDpsClientInstance.patch(
|
|
4723
4726
|
`/v2/me/integrations`,
|
|
4724
4727
|
payload,
|
|
4725
4728
|
getPlatformDpsClientConfig(authorization)
|
|
4726
4729
|
);
|
|
4727
|
-
return response.data;
|
|
4728
4730
|
});
|
|
4729
4731
|
},
|
|
4730
4732
|
updateUserFeatures(payload, authorization) {
|
|
4731
4733
|
return __async(this, null, function* () {
|
|
4732
|
-
|
|
4734
|
+
yield platformDpsClientInstance.put(
|
|
4733
4735
|
"/v2/features",
|
|
4734
4736
|
payload,
|
|
4735
4737
|
getPlatformDpsClientConfig(authorization)
|
|
4736
4738
|
);
|
|
4737
|
-
return response.data;
|
|
4738
4739
|
});
|
|
4739
4740
|
},
|
|
4740
4741
|
removeUserGitHubIntegrationByInstallationId(installationId, authorization) {
|
|
4741
4742
|
return __async(this, null, function* () {
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4746
|
-
|
|
4747
|
-
}
|
|
4748
|
-
})
|
|
4749
|
-
);
|
|
4750
|
-
return response.data;
|
|
4743
|
+
yield platformDpsClientInstance.delete(`/v2/me/integrations/github`, __spreadProps(__spreadValues({}, getPlatformDpsClientConfig(authorization)), {
|
|
4744
|
+
data: {
|
|
4745
|
+
githubInstallationId: installationId
|
|
4746
|
+
}
|
|
4747
|
+
}));
|
|
4751
4748
|
});
|
|
4752
4749
|
},
|
|
4753
4750
|
updateUserNetlifyIntegration(userNetlifyIntegration, authorization) {
|
|
@@ -4801,8 +4798,11 @@ platformAdapterClientInstance.interceptors.response.use(
|
|
|
4801
4798
|
(error) => {
|
|
4802
4799
|
var _a;
|
|
4803
4800
|
if (import_axios13.default.isAxiosError(error)) {
|
|
4804
|
-
if (((_a = error.response) == null ? void 0 : _a.status) === 401
|
|
4805
|
-
|
|
4801
|
+
if (((_a = error.response) == null ? void 0 : _a.status) === 401) {
|
|
4802
|
+
const source = error.response.data.error.source;
|
|
4803
|
+
if (source) {
|
|
4804
|
+
throw new UnauthorizeApiError(source);
|
|
4805
|
+
}
|
|
4806
4806
|
}
|
|
4807
4807
|
}
|
|
4808
4808
|
throw error;
|
|
@@ -4810,19 +4810,20 @@ platformAdapterClientInstance.interceptors.response.use(
|
|
|
4810
4810
|
);
|
|
4811
4811
|
function getPlatformAdapterClientConfig(options = {}) {
|
|
4812
4812
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
|
|
4813
|
+
const currentHeaders = platformAdapterClientInstance.defaults.headers;
|
|
4813
4814
|
const headers = {
|
|
4814
4815
|
platform: {
|
|
4815
|
-
dps: (_b =
|
|
4816
|
+
dps: (_b = currentHeaders["platform-dps-token"]) != null ? _b : (_a = options.platform) == null ? void 0 : _a.dps
|
|
4816
4817
|
},
|
|
4817
4818
|
integrations: {
|
|
4818
4819
|
github: {
|
|
4819
|
-
app: (_d =
|
|
4820
|
-
oauth: (_f =
|
|
4820
|
+
app: (_d = currentHeaders["github-app-token"]) != null ? _d : (_c = options.github) == null ? void 0 : _c.app,
|
|
4821
|
+
oauth: (_f = currentHeaders["github-oauth-token"]) != null ? _f : (_e = options.github) == null ? void 0 : _e.oauth
|
|
4821
4822
|
},
|
|
4822
|
-
netlify: (_g =
|
|
4823
|
-
vercel: (_h =
|
|
4824
|
-
planetscale: (_i =
|
|
4825
|
-
sentry: (_j =
|
|
4823
|
+
netlify: (_g = currentHeaders["netlify-token"]) != null ? _g : options.netlify,
|
|
4824
|
+
vercel: (_h = currentHeaders["vercel-token"]) != null ? _h : options.vercel,
|
|
4825
|
+
planetscale: (_i = currentHeaders["planetscale-token"]) != null ? _i : options.planetscale,
|
|
4826
|
+
sentry: (_j = currentHeaders["sentry-token"]) != null ? _j : options.sentry
|
|
4826
4827
|
}
|
|
4827
4828
|
};
|
|
4828
4829
|
if (((_l = (_k = options.ensureAuthorizationToken) == null ? void 0 : _k.platform) == null ? void 0 : _l.dps) && !headers.platform.dps) {
|
|
@@ -4850,10 +4851,10 @@ function getPlatformAdapterClientConfig(options = {}) {
|
|
|
4850
4851
|
function initPlatformAdapterClientInstance(baseUrl, tokens) {
|
|
4851
4852
|
if (baseUrl) {
|
|
4852
4853
|
platformAdapterClientInstance.interceptors.request.use(
|
|
4853
|
-
(config) =>
|
|
4854
|
+
(config) => {
|
|
4854
4855
|
config.baseURL = baseUrl;
|
|
4855
4856
|
return config;
|
|
4856
|
-
}
|
|
4857
|
+
},
|
|
4857
4858
|
(error) => Promise.reject(error)
|
|
4858
4859
|
);
|
|
4859
4860
|
}
|
|
@@ -4863,26 +4864,27 @@ function initPlatformAdapterClientInstance(baseUrl, tokens) {
|
|
|
4863
4864
|
}
|
|
4864
4865
|
function updatePlatformAdapterClientInstance(tokens) {
|
|
4865
4866
|
var _a;
|
|
4867
|
+
const headers = platformAdapterClientInstance.defaults.headers;
|
|
4866
4868
|
if ((_a = tokens == null ? void 0 : tokens.platform) == null ? void 0 : _a.dps) {
|
|
4867
|
-
|
|
4869
|
+
headers["platform-dps-token"] = tokens.platform.dps;
|
|
4868
4870
|
}
|
|
4869
4871
|
if (tokens == null ? void 0 : tokens.github.app) {
|
|
4870
|
-
|
|
4872
|
+
headers["github-app-token"] = tokens.github.app;
|
|
4871
4873
|
}
|
|
4872
4874
|
if (tokens == null ? void 0 : tokens.github.oauth) {
|
|
4873
|
-
|
|
4875
|
+
headers["github-oauth-token"] = tokens.github.oauth;
|
|
4874
4876
|
}
|
|
4875
4877
|
if (tokens == null ? void 0 : tokens.netlify) {
|
|
4876
|
-
|
|
4878
|
+
headers["netlify-token"] = tokens.netlify;
|
|
4877
4879
|
}
|
|
4878
4880
|
if (tokens == null ? void 0 : tokens.vercel) {
|
|
4879
|
-
|
|
4881
|
+
headers["vercel-token"] = tokens.vercel;
|
|
4880
4882
|
}
|
|
4881
4883
|
if (tokens == null ? void 0 : tokens.planetscale) {
|
|
4882
|
-
|
|
4884
|
+
headers["planetscale-token"] = tokens.planetscale;
|
|
4883
4885
|
}
|
|
4884
4886
|
if (tokens == null ? void 0 : tokens.sentry) {
|
|
4885
|
-
|
|
4887
|
+
headers["sentry-token"] = tokens.sentry;
|
|
4886
4888
|
}
|
|
4887
4889
|
}
|
|
4888
4890
|
|
|
@@ -4921,7 +4923,7 @@ var platformAdapterAppDeploymentApi = {
|
|
|
4921
4923
|
},
|
|
4922
4924
|
unlink(payload, authorization) {
|
|
4923
4925
|
return __async(this, null, function* () {
|
|
4924
|
-
|
|
4926
|
+
yield platformAdapterClientInstance.post(
|
|
4925
4927
|
`/console/app/${payload.appId}/blocks/deployment/unlink`,
|
|
4926
4928
|
payload,
|
|
4927
4929
|
getPlatformAdapterClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
@@ -4932,12 +4934,11 @@ var platformAdapterAppDeploymentApi = {
|
|
|
4932
4934
|
}
|
|
4933
4935
|
}))
|
|
4934
4936
|
);
|
|
4935
|
-
return response.data;
|
|
4936
4937
|
});
|
|
4937
4938
|
},
|
|
4938
4939
|
installSentry(appId, authorization) {
|
|
4939
4940
|
return __async(this, null, function* () {
|
|
4940
|
-
|
|
4941
|
+
yield platformAdapterClientInstance.post(
|
|
4941
4942
|
`/console/app/${appId}/blocks/deployment/install/sentry`,
|
|
4942
4943
|
{},
|
|
4943
4944
|
getPlatformAdapterClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
@@ -4948,7 +4949,6 @@ var platformAdapterAppDeploymentApi = {
|
|
|
4948
4949
|
}
|
|
4949
4950
|
}))
|
|
4950
4951
|
);
|
|
4951
|
-
return response.data;
|
|
4952
4952
|
});
|
|
4953
4953
|
}
|
|
4954
4954
|
};
|
|
@@ -4966,22 +4966,20 @@ var platformAdapterAppSentryLoggerApi = {
|
|
|
4966
4966
|
},
|
|
4967
4967
|
link(payload, authorization) {
|
|
4968
4968
|
return __async(this, null, function* () {
|
|
4969
|
-
|
|
4969
|
+
yield platformAdapterClientInstance.post(
|
|
4970
4970
|
"/console/app/blocks/logger/providers/sentry/link",
|
|
4971
4971
|
payload,
|
|
4972
4972
|
getPlatformAdapterClientConfig(authorization)
|
|
4973
4973
|
);
|
|
4974
|
-
return response.data;
|
|
4975
4974
|
});
|
|
4976
4975
|
},
|
|
4977
4976
|
unlink(payload, authorization) {
|
|
4978
4977
|
return __async(this, null, function* () {
|
|
4979
|
-
|
|
4978
|
+
yield platformAdapterClientInstance.post(
|
|
4980
4979
|
"/console/app/blocks/logger/providers/sentry/unlink",
|
|
4981
4980
|
payload,
|
|
4982
4981
|
getPlatformAdapterClientConfig(authorization)
|
|
4983
4982
|
);
|
|
4984
|
-
return response.data;
|
|
4985
4983
|
});
|
|
4986
4984
|
},
|
|
4987
4985
|
reauthorizeSentryApp(userId, sentryInstallationId, sentryRefreshToken, authorization) {
|
|
@@ -5054,7 +5052,7 @@ var platformAdapterAppRepositoryApi = {
|
|
|
5054
5052
|
},
|
|
5055
5053
|
unlink(payload, authorization) {
|
|
5056
5054
|
return __async(this, null, function* () {
|
|
5057
|
-
|
|
5055
|
+
yield platformAdapterClientInstance.post(
|
|
5058
5056
|
`/console/app/${payload.appId}/blocks/repository/unlink`,
|
|
5059
5057
|
payload,
|
|
5060
5058
|
getPlatformAdapterClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
@@ -5065,7 +5063,6 @@ var platformAdapterAppRepositoryApi = {
|
|
|
5065
5063
|
}
|
|
5066
5064
|
}))
|
|
5067
5065
|
);
|
|
5068
|
-
return response.data;
|
|
5069
5066
|
});
|
|
5070
5067
|
},
|
|
5071
5068
|
seed(payload, authorization) {
|
|
@@ -5120,7 +5117,7 @@ var platformAdapterAppStorageApi = {
|
|
|
5120
5117
|
},
|
|
5121
5118
|
unlink(payload, authorization) {
|
|
5122
5119
|
return __async(this, null, function* () {
|
|
5123
|
-
|
|
5120
|
+
yield platformAdapterClientInstance.post(
|
|
5124
5121
|
`/console/app/${payload.appId}/blocks/storage/unlink`,
|
|
5125
5122
|
payload,
|
|
5126
5123
|
getPlatformAdapterClientConfig(__spreadProps(__spreadValues({}, authorization), {
|
|
@@ -5131,7 +5128,6 @@ var platformAdapterAppStorageApi = {
|
|
|
5131
5128
|
}
|
|
5132
5129
|
}))
|
|
5133
5130
|
);
|
|
5134
|
-
return response.data;
|
|
5135
5131
|
});
|
|
5136
5132
|
}
|
|
5137
5133
|
};
|
|
@@ -5170,40 +5166,36 @@ var platformAdapterAppVariablesApi = {
|
|
|
5170
5166
|
},
|
|
5171
5167
|
syncVariable(appId, key, payload, authorization) {
|
|
5172
5168
|
return __async(this, null, function* () {
|
|
5173
|
-
|
|
5169
|
+
yield platformAdapterClientInstance.post(
|
|
5174
5170
|
`/console/app/${appId}/variables/${key}/sync`,
|
|
5175
5171
|
payload,
|
|
5176
5172
|
getPlatformAdapterClientConfig(authorization)
|
|
5177
5173
|
);
|
|
5178
|
-
return response.data;
|
|
5179
5174
|
});
|
|
5180
5175
|
},
|
|
5181
5176
|
createVariable(appId, data, authorization) {
|
|
5182
5177
|
return __async(this, null, function* () {
|
|
5183
|
-
|
|
5178
|
+
yield platformAdapterClientInstance.post(
|
|
5184
5179
|
`/console/app/${appId}/variables/${data.key}`,
|
|
5185
5180
|
data,
|
|
5186
5181
|
getPlatformAdapterClientConfig(authorization)
|
|
5187
5182
|
);
|
|
5188
|
-
return response.data;
|
|
5189
5183
|
});
|
|
5190
5184
|
},
|
|
5191
5185
|
editVariable(appId, data, authorization) {
|
|
5192
5186
|
return __async(this, null, function* () {
|
|
5193
|
-
|
|
5187
|
+
yield platformAdapterClientInstance.post(
|
|
5194
5188
|
`/console/app/${appId}/variables/${data.key}/edit`,
|
|
5195
5189
|
data,
|
|
5196
5190
|
getPlatformAdapterClientConfig(authorization)
|
|
5197
5191
|
);
|
|
5198
|
-
return response.data;
|
|
5199
5192
|
});
|
|
5200
5193
|
},
|
|
5201
5194
|
deleteVariable(data) {
|
|
5202
5195
|
return __async(this, null, function* () {
|
|
5203
|
-
|
|
5196
|
+
yield platformAdapterClientInstance.delete(
|
|
5204
5197
|
`/console/app/${data.appId}/variables/${data.key}`
|
|
5205
5198
|
);
|
|
5206
|
-
return response.data;
|
|
5207
5199
|
});
|
|
5208
5200
|
}
|
|
5209
5201
|
};
|