apteva 0.4.6 → 0.4.8
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/package.json +1 -1
- package/src/providers.ts +1 -1
- package/src/routes/api/integrations.ts +17 -10
package/package.json
CHANGED
package/src/providers.ts
CHANGED
|
@@ -360,7 +360,7 @@ export const Onboarding = {
|
|
|
360
360
|
|
|
361
361
|
// Get provider list with configuration status for frontend
|
|
362
362
|
export function getProvidersWithStatus() {
|
|
363
|
-
const configuredProviders = new Set(
|
|
363
|
+
const configuredProviders = new Set(ProviderKeysDB.getAllConfiguredProviders());
|
|
364
364
|
const keyStatuses = new Map(
|
|
365
365
|
ProviderKeys.getAll().map(k => [k.provider_id, k])
|
|
366
366
|
);
|
|
@@ -50,7 +50,9 @@ export async function handleIntegrationRoutes(
|
|
|
50
50
|
return json({ error: `Unknown provider: ${providerId}` }, 404);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
const
|
|
53
|
+
const url = new URL(req.url);
|
|
54
|
+
const projectId = url.searchParams.get("project_id") || null;
|
|
55
|
+
const apiKey = ProviderKeys.getDecryptedForProject(providerId, projectId);
|
|
54
56
|
if (!apiKey) {
|
|
55
57
|
return json({ error: `${provider.name} API key not configured`, apps: [] }, 200);
|
|
56
58
|
}
|
|
@@ -73,7 +75,9 @@ export async function handleIntegrationRoutes(
|
|
|
73
75
|
return json({ error: `Unknown provider: ${providerId}` }, 404);
|
|
74
76
|
}
|
|
75
77
|
|
|
76
|
-
const
|
|
78
|
+
const url = new URL(req.url);
|
|
79
|
+
const projectId = url.searchParams.get("project_id") || null;
|
|
80
|
+
const apiKey = ProviderKeys.getDecryptedForProject(providerId, projectId);
|
|
77
81
|
if (!apiKey) {
|
|
78
82
|
return json({ error: `${provider.name} API key not configured`, accounts: [] }, 200);
|
|
79
83
|
}
|
|
@@ -99,14 +103,13 @@ export async function handleIntegrationRoutes(
|
|
|
99
103
|
return json({ error: `Unknown provider: ${providerId}` }, 404);
|
|
100
104
|
}
|
|
101
105
|
|
|
102
|
-
const apiKey = ProviderKeys.getDecrypted(providerId);
|
|
103
|
-
if (!apiKey) {
|
|
104
|
-
return json({ error: `${provider.name} API key not configured` }, 401);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
106
|
try {
|
|
108
107
|
const body = await req.json();
|
|
109
|
-
const { appSlug, redirectUrl, credentials } = body;
|
|
108
|
+
const { appSlug, redirectUrl, credentials, project_id } = body;
|
|
109
|
+
const apiKey = ProviderKeys.getDecryptedForProject(providerId, project_id || null);
|
|
110
|
+
if (!apiKey) {
|
|
111
|
+
return json({ error: `${provider.name} API key not configured` }, 401);
|
|
112
|
+
}
|
|
110
113
|
|
|
111
114
|
if (!appSlug) {
|
|
112
115
|
return json({ error: "appSlug is required" }, 400);
|
|
@@ -136,7 +139,9 @@ export async function handleIntegrationRoutes(
|
|
|
136
139
|
return json({ error: `Unknown provider: ${providerId}` }, 404);
|
|
137
140
|
}
|
|
138
141
|
|
|
139
|
-
const
|
|
142
|
+
const url = new URL(req.url);
|
|
143
|
+
const projectId = url.searchParams.get("project_id") || null;
|
|
144
|
+
const apiKey = ProviderKeys.getDecryptedForProject(providerId, projectId);
|
|
140
145
|
if (!apiKey) {
|
|
141
146
|
return json({ error: `${provider.name} API key not configured` }, 401);
|
|
142
147
|
}
|
|
@@ -162,7 +167,9 @@ export async function handleIntegrationRoutes(
|
|
|
162
167
|
return json({ error: `Unknown provider: ${providerId}` }, 404);
|
|
163
168
|
}
|
|
164
169
|
|
|
165
|
-
const
|
|
170
|
+
const url = new URL(req.url);
|
|
171
|
+
const projectId = url.searchParams.get("project_id") || null;
|
|
172
|
+
const apiKey = ProviderKeys.getDecryptedForProject(providerId, projectId);
|
|
166
173
|
if (!apiKey) {
|
|
167
174
|
return json({ error: `${provider.name} API key not configured` }, 401);
|
|
168
175
|
}
|