@agentforge-io/sdk-console 0.2.0 → 0.3.0
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/README.md +1 -0
- package/dist/resources/connectors.d.ts +7 -1
- package/dist/resources/connectors.js +12 -1
- package/dist/types.d.ts +10 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -140,6 +140,7 @@ Resource → methods → HTTP route (all JSON, bearer auth unless marked *public
|
|
|
140
140
|
| `t.connectors` | `directory` / `facets` (sends `X-Tenant-Id`) | `GET /connectors/oauth/directory[/facets]` |
|
|
141
141
|
| | `authorize` | `POST /connectors/oauth/:id/authorize?tenantId=&postAuthRedirect=` |
|
|
142
142
|
| | `saveApiKey` | `POST /connectors/oauth/:id/api-key?tenantId=` |
|
|
143
|
+
| | `disconnect` | `DELETE /connectors/oauth/:id?tenantId=` |
|
|
143
144
|
| `templates` | `listPublic` / `getPublic` (public) | `GET /public/templates[/:id]` |
|
|
144
145
|
| | `get` / `updateListing` / `listVersions` | `GET` / `PATCH /templates/:id` · `GET /templates/:id/versions` |
|
|
145
146
|
| | `signListingAsset` | `POST /templates/:id/listing-assets/sign` |
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { HttpCore } from '../http';
|
|
2
|
-
import type { AuthorizeConnectorInput, ConnectorFacets, ConnectorStatus, ListConnectorsInput } from '../types';
|
|
2
|
+
import type { AuthorizeConnectorInput, ConnectorFacets, ConnectorStatus, DisconnectConnectorResult, ListConnectorsInput } from '../types';
|
|
3
3
|
export declare class ConnectorsResource {
|
|
4
4
|
private readonly http;
|
|
5
5
|
private readonly tenantId;
|
|
@@ -22,4 +22,10 @@ export declare class ConnectorsResource {
|
|
|
22
22
|
saveApiKey(connectorId: string, apiKey: string): Promise<{
|
|
23
23
|
connectorId: string;
|
|
24
24
|
}>;
|
|
25
|
+
/** `DELETE /connectors/oauth/:id?tenantId=`: removes this workspace's
|
|
26
|
+
* connection (owner/admin; best-effort revoke at the provider). Idempotent:
|
|
27
|
+
* `disconnected: false` when there was nothing to remove. A
|
|
28
|
+
* `postAuthRedirect` outside the platform allow-list makes `authorize`
|
|
29
|
+
* fail with `ApiError` code `post_auth_redirect_not_allowed`. */
|
|
30
|
+
disconnect(connectorId: string): Promise<DisconnectConnectorResult>;
|
|
25
31
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// connectors for one workspace (`forTenant(id).connectors`): the directory
|
|
3
|
-
// with per-workspace `connected` flags,
|
|
3
|
+
// with per-workspace `connected` flags, the OAuth / API-key connect flow and
|
|
4
|
+
// disconnect.
|
|
4
5
|
//
|
|
5
6
|
// The directory resolves the workspace from the `X-Tenant-Id` header (the JWT
|
|
6
7
|
// carries no tenant), so these calls send it. A browser therefore needs CORS
|
|
@@ -43,5 +44,15 @@ class ConnectorsResource {
|
|
|
43
44
|
body: { apiKey },
|
|
44
45
|
});
|
|
45
46
|
}
|
|
47
|
+
/** `DELETE /connectors/oauth/:id?tenantId=`: removes this workspace's
|
|
48
|
+
* connection (owner/admin; best-effort revoke at the provider). Idempotent:
|
|
49
|
+
* `disconnected: false` when there was nothing to remove. A
|
|
50
|
+
* `postAuthRedirect` outside the platform allow-list makes `authorize`
|
|
51
|
+
* fail with `ApiError` code `post_auth_redirect_not_allowed`. */
|
|
52
|
+
async disconnect(connectorId) {
|
|
53
|
+
return this.http.request('DELETE', `/connectors/oauth/${(0, http_1.seg)(connectorId)}`, {
|
|
54
|
+
query: { tenantId: this.tenantId },
|
|
55
|
+
});
|
|
56
|
+
}
|
|
46
57
|
}
|
|
47
58
|
exports.ConnectorsResource = ConnectorsResource;
|
package/dist/types.d.ts
CHANGED
|
@@ -1007,3 +1007,13 @@ export interface PublisherErrorBody {
|
|
|
1007
1007
|
message: string;
|
|
1008
1008
|
issues?: TeamPublicationIssue[];
|
|
1009
1009
|
}
|
|
1010
|
+
/** `DELETE /connectors/oauth/:id` result. */
|
|
1011
|
+
export interface DisconnectConnectorResult {
|
|
1012
|
+
ok: true;
|
|
1013
|
+
connectorId: string;
|
|
1014
|
+
tenantId: string;
|
|
1015
|
+
/** False when the workspace had no connection (idempotent). */
|
|
1016
|
+
disconnected: boolean;
|
|
1017
|
+
/** True when the provider confirmed the token revoke (best effort). */
|
|
1018
|
+
revokedAtProvider: boolean;
|
|
1019
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentforge-io/sdk-console",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "User-session SDK for admin clients of the AgentForge platform (Expo / React Native, web, Node). Dashboard JWT auth with refresh, tenant scoping, typed resources.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|