Skip to content

Commit f196e6c

Browse files
author
Chris
committed
Add connections/profiles and count endpoints to API requests
1 parent 10635f6 commit f196e6c

File tree

2 files changed

+34
-3
lines changed

2 files changed

+34
-3
lines changed

src/app/(connected)/sandbox/api-requests/page.tsx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -457,6 +457,10 @@ print(response.json())`
457457
<Link href="/sandbox/token-info">Token Info</Link> page
458458
</p>
459459

460+
<div className="space-y-2">
461+
<h2 className="text-lg font-semibold">API Endpoint</h2>
462+
</div>
463+
460464
{/* Endpoint Selector */}
461465
<div className="space-y-1">
462466
<Label htmlFor="endpointSelect">Select Endpoint</Label>
@@ -478,32 +482,36 @@ print(response.json())`
478482
})}
479483
</SelectContent>
480484
</Select>
485+
<p>
486+
<i>{apiEndpoints[endpoint]!.documentation}</i>
487+
</p>
481488
</div>
482489

483490
{/* Base URL Input (optional) */}
484491
<div className="space-y-1">
485-
<Label htmlFor="baseUrl">API Server URL Endpoint</Label>
492+
<Label htmlFor="baseUrl">API Server</Label>
486493
<Input
487494
id="baseUrl"
488495
value={baseUrl || ""}
489496
onChange={(e) => setBaseUrl(e.target.value)}
490497
placeholder="https://your.custom.server"
498+
disabled={true}
491499
/>
492500
</div>
493501

494502
{/* URL Variables */}
495503
{Object.entries(apiEndpoints[endpoint]!.urlVariables || {}).length >
496504
0 && (
497505
<div className="space-y-2">
498-
<h3 className="text-lg font-semibold">URL Variables</h3>
506+
<h2 className="text-lg font-semibold">URL Variables</h2>
499507
{renderUrlVariableFields()}
500508
</div>
501509
)}
502510

503511
{/* Params */}
504512
{Object.entries(apiEndpoints[endpoint]!.params || {}).length > 0 && (
505513
<div className="space-y-2">
506-
<h3 className="text-lg font-semibold">Parameters</h3>
514+
<h2 className="text-lg font-semibold">Parameters</h2>
507515
{renderParamsFields()}
508516
</div>
509517
)}

src/config/apiEndpoints.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,17 @@ export const apiEndpoints: Record<string, EndpointDefinition> = {
139139
},
140140
},
141141
},
142+
"/ds/count/{schemaUrl}": {
143+
method: "POST",
144+
path: `${apiPrefix}/ds/count/{schemaUrl}`,
145+
documentation: "Count the number of records in a datastore",
146+
urlVariables: {
147+
schemaUrl: commonUrlVariables.schemaUrl!,
148+
},
149+
params: {
150+
query: commonParams.query!,
151+
},
152+
},
142153
"/ds/get/{schemaUrl}/{recordId}": {
143154
method: "GET",
144155
path: `${apiPrefix}/ds/get/{schemaUrl}/{recordId}`,
@@ -338,4 +349,16 @@ Each result contains the chat group and an array of messages.`,
338349
},
339350
},
340351
},
352+
"/connections/profiles": {
353+
method: "GET",
354+
path: `${apiPrefix}/connections/profiles`,
355+
documentation: `Fetch the profile of a connection (ie: "google" or "telegram").`,
356+
params: {
357+
providerId: {
358+
type: "string",
359+
required: false,
360+
documentation: `Optional filter to return profile of a specific provider (ie: "google" or "telegram")`,
361+
},
362+
},
363+
},
341364
}

0 commit comments

Comments
 (0)