@livechat/developer-studio-api 2.3.73 → 2.3.74

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 CHANGED
@@ -2643,7 +2643,7 @@ declare const api: {
2643
2643
  integrations: {
2644
2644
  github: {
2645
2645
  installation: {
2646
- getInstallation(account?: string | undefined, authorization?: GithubClientInstanceAuthorization | undefined): Promise<GitHubInstallation | undefined>;
2646
+ getInstallation(appId: number, account?: string | undefined, authorization?: GithubClientInstanceAuthorization | undefined): Promise<GitHubInstallation | undefined>;
2647
2647
  getInstallations(authorization?: GithubClientInstanceAuthorization | undefined): Promise<GitHubInstallation[]>;
2648
2648
  getInstallationRepositories(installationId: string, authorization?: GithubClientInstanceAuthorization | undefined): Promise<GitHubRepository[]>;
2649
2649
  };
package/dist/index.d.ts CHANGED
@@ -2643,7 +2643,7 @@ declare const api: {
2643
2643
  integrations: {
2644
2644
  github: {
2645
2645
  installation: {
2646
- getInstallation(account?: string | undefined, authorization?: GithubClientInstanceAuthorization | undefined): Promise<GitHubInstallation | undefined>;
2646
+ getInstallation(appId: number, account?: string | undefined, authorization?: GithubClientInstanceAuthorization | undefined): Promise<GitHubInstallation | undefined>;
2647
2647
  getInstallations(authorization?: GithubClientInstanceAuthorization | undefined): Promise<GitHubInstallation[]>;
2648
2648
  getInstallationRepositories(installationId: string, authorization?: GithubClientInstanceAuthorization | undefined): Promise<GitHubRepository[]>;
2649
2649
  };
package/dist/index.js CHANGED
@@ -136,101 +136,6 @@ module.exports = __toCommonJS(src_exports);
136
136
  // src/apis/integrations/github/api.ts
137
137
  var import_axios2 = __toESM(require("axios"));
138
138
 
139
- // ../../private/config/src/integrations/github.ts
140
- var GITHUB_CONFIG = {
141
- url: "https://github.com/login/oauth/authorize",
142
- app: process.env.NEXT_PUBLIC_PLATFORM_ENV === "prod" ? {
143
- id: 265597,
144
- client_name: "text-platform-developer-console",
145
- client_id: "Iv1.c582ec1de0bf8428",
146
- client_secret: process.env.GITHUB_APP_CLIENT_SECRET,
147
- redirect_uri: "https://platform.text.com/console-adapter/integrations/github/callbacks/app"
148
- } : {
149
- id: 319969,
150
- client_name: "text-platform-labs",
151
- client_id: "Iv1.e631130cf8ac91d7",
152
- client_secret: process.env.GITHUB_APP_CLIENT_SECRET,
153
- redirect_uri: "https://platform.labs.text.com/console-adapter/integrations/github/callbacks/app"
154
- },
155
- oauth: process.env.NEXT_PUBLIC_PLATFORM_ENV === "prod" ? {
156
- client_id: "ebbb08fa2c26d3e7911d",
157
- client_secret: process.env.GITHUB_OAUTH_CLIENT_SECRET,
158
- redirect_uri: "https://platform.text.com/console-adapter/integrations/github/callbacks/oauth"
159
- } : {
160
- client_id: "bcffd61bd0edd23bca45",
161
- client_secret: process.env.GITHUB_OAUTH_CLIENT_SECRET,
162
- redirect_uri: "https://platform.labs.text.com/console-adapter/integrations/github/callbacks/oauth"
163
- }
164
- };
165
-
166
- // ../../private/config/src/integrations/netlify.ts
167
- var NETLIFY_CONFIG = {
168
- url: "https://app.netlify.com/authorize",
169
- github_app_client_name: "netlify",
170
- app: process.env.NEXT_PUBLIC_PLATFORM_ENV === "prod" ? {
171
- client_id: "qUoHYb2DdVwKxot9Gc7URTdsZQYHYaumykjkv5K3_Mw",
172
- redirect_uri: "https://platform.text.com/console-adapter/integrations/netlify/callbacks/oauth",
173
- client_secret: process.env.NETLIFY_CLIENT_SECRET
174
- } : {
175
- client_id: "vDmNXNN9rTkZJtCwOHot2IKOherrm8t7gGA5kStotlo",
176
- redirect_uri: "https://platform.labs.text.com/console-adapter/integrations/netlify/callbacks/oauth",
177
- client_secret: process.env.NETLIFY_CLIENT_SECRET
178
- }
179
- };
180
-
181
- // ../../private/config/src/integrations/planetscale.ts
182
- var PLANETSCALE_CONFIG = {
183
- url: "http://app.planetscale.com/oauth/authorize",
184
- github_app_client_name: "planetscale",
185
- app: process.env.NEXT_PUBLIC_PLATFORM_ENV === "prod" ? {
186
- organization: "livechat",
187
- appId: "bw2hi8knpzbl",
188
- client_id: "pscale_app_b0aa82ae3d32f32010d7352d88f22fb2",
189
- service_token_id: "be5l1vy34g6h",
190
- redirect_uri: "https://platform.text.com/console-adapter/integrations/planetscale/callbacks/oauth",
191
- client_secret: process.env.PLANETSCALE_CLIENT_SECRET,
192
- service_token: process.env.PLANETSCALE_SERVICE_TOKEN
193
- } : {
194
- organization: "livechat",
195
- appId: "oz4pafhcyshn",
196
- client_id: "pscale_app_54606de46e127f664df359639baf6b66",
197
- service_token_id: "qdpgtmrqpdsm",
198
- redirect_uri: "https://platform.labs.text.com/console-adapter/integrations/planetscale/callbacks/oauth",
199
- client_secret: process.env.PLANETSCALE_CLIENT_SECRET,
200
- service_token: process.env.PLANETSCALE_SERVICE_TOKEN
201
- }
202
- };
203
-
204
- // ../../private/config/src/integrations/sentry.ts
205
- var SENTRY_CONFIG = {
206
- github_app_client_name: "sentry-io",
207
- app: process.env.NEXT_PUBLIC_PLATFORM_ENV === "prod" ? {
208
- client_id: "8c8296fe87cb446e9ded22f8b6f4b078363500062155476490d4583b5406d30a",
209
- client_secret: process.env.SENTRY_CLIENT_SECRET,
210
- redirect_uri: "https://platform.text.com/console-adapter/integrations/sentry/callbacks/oauth"
211
- } : {
212
- client_id: "d35803a39bab43b3b6dbe0b89cb99dc54689c35a74dd442baaef0f5b9b0d70bc",
213
- client_secret: process.env.SENTRY_CLIENT_SECRET,
214
- redirect_uri: "https://platform.labs.text.com/console-adapter/integrations/sentry/callbacks/oauth"
215
- }
216
- };
217
-
218
- // ../../private/config/src/integrations/vercel.ts
219
- var VERCEL_CONFIG = {
220
- github_app_client_name: "vercel",
221
- app: process.env.NEXT_PUBLIC_PLATFORM_ENV === "prod" ? {
222
- client_name: "text-platform-developer-console",
223
- client_id: "oac_0nV7q5jDmCQKqpwEdGljaaLp",
224
- client_secret: process.env.VERCEL_CLIENT_SECRET,
225
- redirect_uri: "https://platform.text.com/console-adapter/integrations/vercel/callbacks/oauth"
226
- } : {
227
- client_name: "text-platform-labs",
228
- client_id: "oac_bgwv72AO8fJWj8I9qIROY7wI",
229
- client_secret: process.env.VERCEL_CLIENT_SECRET,
230
- redirect_uri: "https://platform.labs.text.com/console-adapter/integrations/vercel/callbacks/oauth"
231
- }
232
- };
233
-
234
139
  // src/apis/integrations/github/instance.ts
235
140
  var import_axios = __toESM(require("axios"));
236
141
 
@@ -299,11 +204,11 @@ function updateGithubClientInstance(token) {
299
204
 
300
205
  // src/apis/integrations/github/installation/api.ts
301
206
  var gitHubInstallationApi = {
302
- getInstallation(account, authorization) {
207
+ getInstallation(appId, account, authorization) {
303
208
  return __async(this, null, function* () {
304
209
  const installations = yield this.getInstallations(authorization);
305
210
  return installations.find(
306
- (installation) => installation.app_id === GITHUB_CONFIG.app.id && account ? installation.account.login === account : installation.target_type === "User"
211
+ (installation) => installation.app_id === appId && account ? installation.account.login === account : installation.target_type === "User"
307
212
  );
308
213
  });
309
214
  },
@@ -877,6 +782,7 @@ var netlifyAccountApi = {
877
782
  var netlifyHookApi = {
878
783
  addBuildHooks(siteId, authorization) {
879
784
  return __async(this, null, function* () {
785
+ const basePath = `${process.env.NEXT_PUBLIC_PLATFORM_DEVELOPER_CONSOLE_ADAPTER_APP_URL}${process.env.NEXT_PUBLIC_PLATFORM_DEVELOPER_CONSOLE_ADAPTER_BASE_PATH}`;
880
786
  try {
881
787
  yield netlifyClientInstance.post(
882
788
  "/hooks",
@@ -885,7 +791,7 @@ var netlifyHookApi = {
885
791
  event: "deploy_created",
886
792
  type: "url",
887
793
  data: {
888
- url: `${process.env.NEXT_PUBLIC_PLATFORM_DEVELOPER_CONSOLE_ADAPTER_APP_URL}${process.env.NEXT_PUBLIC_PLATFORM_DEVELOPER_CONSOLE_ADAPTER_BASE_PATH}/api/integrations/netlify/webhook`
794
+ url: `${basePath}/api/integrations/netlify/webhook`
889
795
  }
890
796
  },
891
797
  getNetlifyClientConfig(__spreadProps(__spreadValues({}, authorization), {
@@ -902,7 +808,7 @@ var netlifyHookApi = {
902
808
  event: "deploy_failed",
903
809
  type: "url",
904
810
  data: {
905
- url: `${process.env.NEXT_PUBLIC_PLATFORM_DEVELOPER_CONSOLE_ADAPTER_APP_URL}${process.env.NEXT_PUBLIC_PLATFORM_DEVELOPER_CONSOLE_ADAPTER_BASE_PATH}/api/integrations/netlify/webhook`
811
+ url: `${basePath}/api/integrations/netlify/webhook`
906
812
  }
907
813
  },
908
814
  getNetlifyClientConfig(__spreadProps(__spreadValues({}, authorization), {
@@ -919,7 +825,7 @@ var netlifyHookApi = {
919
825
  event: "deploy_building",
920
826
  type: "url",
921
827
  data: {
922
- url: `${process.env.NEXT_PUBLIC_PLATFORM_DEVELOPER_CONSOLE_ADAPTER_APP_URL}${process.env.NEXT_PUBLIC_PLATFORM_DEVELOPER_CONSOLE_ADAPTER_BASE_PATH}/api/integrations/netlify/webhook`
828
+ url: `${basePath}/api/integrations/netlify/webhook`
923
829
  }
924
830
  },
925
831
  getNetlifyClientConfig(__spreadProps(__spreadValues({}, authorization), {
package/dist/index.mjs CHANGED
@@ -41,101 +41,6 @@ var __async = (__this, __arguments, generator) => {
41
41
  // src/apis/integrations/github/api.ts
42
42
  import axios2 from "axios";
43
43
 
44
- // ../../private/config/src/integrations/github.ts
45
- var GITHUB_CONFIG = {
46
- url: "https://github.com/login/oauth/authorize",
47
- app: process.env.NEXT_PUBLIC_PLATFORM_ENV === "prod" ? {
48
- id: 265597,
49
- client_name: "text-platform-developer-console",
50
- client_id: "Iv1.c582ec1de0bf8428",
51
- client_secret: process.env.GITHUB_APP_CLIENT_SECRET,
52
- redirect_uri: "https://platform.text.com/console-adapter/integrations/github/callbacks/app"
53
- } : {
54
- id: 319969,
55
- client_name: "text-platform-labs",
56
- client_id: "Iv1.e631130cf8ac91d7",
57
- client_secret: process.env.GITHUB_APP_CLIENT_SECRET,
58
- redirect_uri: "https://platform.labs.text.com/console-adapter/integrations/github/callbacks/app"
59
- },
60
- oauth: process.env.NEXT_PUBLIC_PLATFORM_ENV === "prod" ? {
61
- client_id: "ebbb08fa2c26d3e7911d",
62
- client_secret: process.env.GITHUB_OAUTH_CLIENT_SECRET,
63
- redirect_uri: "https://platform.text.com/console-adapter/integrations/github/callbacks/oauth"
64
- } : {
65
- client_id: "bcffd61bd0edd23bca45",
66
- client_secret: process.env.GITHUB_OAUTH_CLIENT_SECRET,
67
- redirect_uri: "https://platform.labs.text.com/console-adapter/integrations/github/callbacks/oauth"
68
- }
69
- };
70
-
71
- // ../../private/config/src/integrations/netlify.ts
72
- var NETLIFY_CONFIG = {
73
- url: "https://app.netlify.com/authorize",
74
- github_app_client_name: "netlify",
75
- app: process.env.NEXT_PUBLIC_PLATFORM_ENV === "prod" ? {
76
- client_id: "qUoHYb2DdVwKxot9Gc7URTdsZQYHYaumykjkv5K3_Mw",
77
- redirect_uri: "https://platform.text.com/console-adapter/integrations/netlify/callbacks/oauth",
78
- client_secret: process.env.NETLIFY_CLIENT_SECRET
79
- } : {
80
- client_id: "vDmNXNN9rTkZJtCwOHot2IKOherrm8t7gGA5kStotlo",
81
- redirect_uri: "https://platform.labs.text.com/console-adapter/integrations/netlify/callbacks/oauth",
82
- client_secret: process.env.NETLIFY_CLIENT_SECRET
83
- }
84
- };
85
-
86
- // ../../private/config/src/integrations/planetscale.ts
87
- var PLANETSCALE_CONFIG = {
88
- url: "http://app.planetscale.com/oauth/authorize",
89
- github_app_client_name: "planetscale",
90
- app: process.env.NEXT_PUBLIC_PLATFORM_ENV === "prod" ? {
91
- organization: "livechat",
92
- appId: "bw2hi8knpzbl",
93
- client_id: "pscale_app_b0aa82ae3d32f32010d7352d88f22fb2",
94
- service_token_id: "be5l1vy34g6h",
95
- redirect_uri: "https://platform.text.com/console-adapter/integrations/planetscale/callbacks/oauth",
96
- client_secret: process.env.PLANETSCALE_CLIENT_SECRET,
97
- service_token: process.env.PLANETSCALE_SERVICE_TOKEN
98
- } : {
99
- organization: "livechat",
100
- appId: "oz4pafhcyshn",
101
- client_id: "pscale_app_54606de46e127f664df359639baf6b66",
102
- service_token_id: "qdpgtmrqpdsm",
103
- redirect_uri: "https://platform.labs.text.com/console-adapter/integrations/planetscale/callbacks/oauth",
104
- client_secret: process.env.PLANETSCALE_CLIENT_SECRET,
105
- service_token: process.env.PLANETSCALE_SERVICE_TOKEN
106
- }
107
- };
108
-
109
- // ../../private/config/src/integrations/sentry.ts
110
- var SENTRY_CONFIG = {
111
- github_app_client_name: "sentry-io",
112
- app: process.env.NEXT_PUBLIC_PLATFORM_ENV === "prod" ? {
113
- client_id: "8c8296fe87cb446e9ded22f8b6f4b078363500062155476490d4583b5406d30a",
114
- client_secret: process.env.SENTRY_CLIENT_SECRET,
115
- redirect_uri: "https://platform.text.com/console-adapter/integrations/sentry/callbacks/oauth"
116
- } : {
117
- client_id: "d35803a39bab43b3b6dbe0b89cb99dc54689c35a74dd442baaef0f5b9b0d70bc",
118
- client_secret: process.env.SENTRY_CLIENT_SECRET,
119
- redirect_uri: "https://platform.labs.text.com/console-adapter/integrations/sentry/callbacks/oauth"
120
- }
121
- };
122
-
123
- // ../../private/config/src/integrations/vercel.ts
124
- var VERCEL_CONFIG = {
125
- github_app_client_name: "vercel",
126
- app: process.env.NEXT_PUBLIC_PLATFORM_ENV === "prod" ? {
127
- client_name: "text-platform-developer-console",
128
- client_id: "oac_0nV7q5jDmCQKqpwEdGljaaLp",
129
- client_secret: process.env.VERCEL_CLIENT_SECRET,
130
- redirect_uri: "https://platform.text.com/console-adapter/integrations/vercel/callbacks/oauth"
131
- } : {
132
- client_name: "text-platform-labs",
133
- client_id: "oac_bgwv72AO8fJWj8I9qIROY7wI",
134
- client_secret: process.env.VERCEL_CLIENT_SECRET,
135
- redirect_uri: "https://platform.labs.text.com/console-adapter/integrations/vercel/callbacks/oauth"
136
- }
137
- };
138
-
139
44
  // src/apis/integrations/github/instance.ts
140
45
  import axios from "axios";
141
46
 
@@ -204,11 +109,11 @@ function updateGithubClientInstance(token) {
204
109
 
205
110
  // src/apis/integrations/github/installation/api.ts
206
111
  var gitHubInstallationApi = {
207
- getInstallation(account, authorization) {
112
+ getInstallation(appId, account, authorization) {
208
113
  return __async(this, null, function* () {
209
114
  const installations = yield this.getInstallations(authorization);
210
115
  return installations.find(
211
- (installation) => installation.app_id === GITHUB_CONFIG.app.id && account ? installation.account.login === account : installation.target_type === "User"
116
+ (installation) => installation.app_id === appId && account ? installation.account.login === account : installation.target_type === "User"
212
117
  );
213
118
  });
214
119
  },
@@ -782,6 +687,7 @@ var netlifyAccountApi = {
782
687
  var netlifyHookApi = {
783
688
  addBuildHooks(siteId, authorization) {
784
689
  return __async(this, null, function* () {
690
+ const basePath = `${process.env.NEXT_PUBLIC_PLATFORM_DEVELOPER_CONSOLE_ADAPTER_APP_URL}${process.env.NEXT_PUBLIC_PLATFORM_DEVELOPER_CONSOLE_ADAPTER_BASE_PATH}`;
785
691
  try {
786
692
  yield netlifyClientInstance.post(
787
693
  "/hooks",
@@ -790,7 +696,7 @@ var netlifyHookApi = {
790
696
  event: "deploy_created",
791
697
  type: "url",
792
698
  data: {
793
- url: `${process.env.NEXT_PUBLIC_PLATFORM_DEVELOPER_CONSOLE_ADAPTER_APP_URL}${process.env.NEXT_PUBLIC_PLATFORM_DEVELOPER_CONSOLE_ADAPTER_BASE_PATH}/api/integrations/netlify/webhook`
699
+ url: `${basePath}/api/integrations/netlify/webhook`
794
700
  }
795
701
  },
796
702
  getNetlifyClientConfig(__spreadProps(__spreadValues({}, authorization), {
@@ -807,7 +713,7 @@ var netlifyHookApi = {
807
713
  event: "deploy_failed",
808
714
  type: "url",
809
715
  data: {
810
- url: `${process.env.NEXT_PUBLIC_PLATFORM_DEVELOPER_CONSOLE_ADAPTER_APP_URL}${process.env.NEXT_PUBLIC_PLATFORM_DEVELOPER_CONSOLE_ADAPTER_BASE_PATH}/api/integrations/netlify/webhook`
716
+ url: `${basePath}/api/integrations/netlify/webhook`
811
717
  }
812
718
  },
813
719
  getNetlifyClientConfig(__spreadProps(__spreadValues({}, authorization), {
@@ -824,7 +730,7 @@ var netlifyHookApi = {
824
730
  event: "deploy_building",
825
731
  type: "url",
826
732
  data: {
827
- url: `${process.env.NEXT_PUBLIC_PLATFORM_DEVELOPER_CONSOLE_ADAPTER_APP_URL}${process.env.NEXT_PUBLIC_PLATFORM_DEVELOPER_CONSOLE_ADAPTER_BASE_PATH}/api/integrations/netlify/webhook`
733
+ url: `${basePath}/api/integrations/netlify/webhook`
828
734
  }
829
735
  },
830
736
  getNetlifyClientConfig(__spreadProps(__spreadValues({}, authorization), {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livechat/developer-studio-api",
3
- "version": "2.3.73",
3
+ "version": "2.3.74",
4
4
  "description": "This project is API for LiveChat Developer Studio.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -17,9 +17,8 @@
17
17
  "@types/node": "^17.0.12",
18
18
  "tsup": "^7.1.0",
19
19
  "typescript": "^5.1.6",
20
- "config": "0.0.2",
21
- "eslint-config-custom": "0.0.3",
22
- "tsconfig": "0.0.1"
20
+ "tsconfig": "0.0.1",
21
+ "eslint-config-custom": "0.0.4"
23
22
  },
24
23
  "scripts": {
25
24
  "build": "tsup src/index.ts --format esm,cjs --dts",