@engini/sdk 0.24.0 → 0.26.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 +23 -0
- package/dist/client.d.ts +2 -0
- package/dist/client.js +3 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +1 -1
- package/dist/resources/authProviders.d.ts +52 -0
- package/dist/resources/authProviders.js +67 -0
- package/dist/resources/connections.d.ts +9 -1
- package/dist/resources/connections.js +11 -1
- package/dist/resources/index.d.ts +2 -0
- package/dist/resources/index.js +1 -0
- package/dist/resources/opa.d.ts +10 -10
- package/dist/resources/opa.js +12 -12
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -96,6 +96,29 @@ which replaces its whole field map. Settings you omit take the server's defaults
|
|
|
96
96
|
minimums come from the connector's own declared metadata rather than the client. Agents are
|
|
97
97
|
not connections: `client.connections` never returns them.
|
|
98
98
|
|
|
99
|
+
`client.authProviders` manages your own OAuth/credential providers: a name plus the values of
|
|
100
|
+
the connector's "Set on provider" fields, addressed by slot. A secret slot is write-only
|
|
101
|
+
(`hasValue: true`, `value: null` on read). `authProviderId` on `connections.getSignInUrl()` /
|
|
102
|
+
`connections.create()` is tri-state — omit it for the account default, `0` for the connector's
|
|
103
|
+
own OAuth client, an id for that provider (test `!== undefined`, never truthiness).
|
|
104
|
+
|
|
105
|
+
```ts
|
|
106
|
+
const [source] = await client.authProviders.sources(); // eligible apps, methods, slots
|
|
107
|
+
const { redirectUri } = await client.authProviders.redirectUri(source.applicationId);
|
|
108
|
+
const p = await client.authProviders.create({
|
|
109
|
+
providerName: "Acme prod",
|
|
110
|
+
applicationId: source.applicationId,
|
|
111
|
+
sourceAuthenticationId: source.methods[0].authenticationId,
|
|
112
|
+
isDefault: false,
|
|
113
|
+
isSandbox: false,
|
|
114
|
+
fieldValues: { Key1: "client-id", Key2: process.env.CLIENT_SECRET! },
|
|
115
|
+
});
|
|
116
|
+
await client.authProviders.update(p.id, { fieldValues: { Key3: "" } }); // "" clears a slot
|
|
117
|
+
const { signInUrl } = await client.connections.getSignInUrl("salesforce", 9, { authProviderId: p.id });
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
`list()`/`get()` need permission to manage providers; `usable()` (ids and names) needs only view.
|
|
121
|
+
|
|
99
122
|
`client.triggers` is the event side of the platform: a trigger instance (`ti_…`) watches a
|
|
100
123
|
connected system and captures events, which Engini POSTs to a destination you register.
|
|
101
124
|
|
package/dist/client.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { ToolsResource } from "./resources/tools.js";
|
|
|
5
5
|
import { ConnectionsResource } from "./resources/connections.js";
|
|
6
6
|
import { ToolsetsResource } from "./resources/toolsets.js";
|
|
7
7
|
import { McpResource } from "./resources/mcp.js";
|
|
8
|
+
import { AuthProvidersResource } from "./resources/authProviders.js";
|
|
8
9
|
import { OpaResource } from "./resources/opa.js";
|
|
9
10
|
import { TriggersResource } from "./resources/triggers.js";
|
|
10
11
|
import { ApplicationsResource } from "./resources/applications.js";
|
|
@@ -52,6 +53,7 @@ export declare class Engini {
|
|
|
52
53
|
readonly toolsets: ToolsetsResource;
|
|
53
54
|
readonly mcp: McpResource;
|
|
54
55
|
readonly opa: OpaResource;
|
|
56
|
+
readonly authProviders: AuthProvidersResource;
|
|
55
57
|
readonly triggers: TriggersResource;
|
|
56
58
|
readonly applications: ApplicationsResource;
|
|
57
59
|
readonly auth: AuthResource;
|
package/dist/client.js
CHANGED
|
@@ -6,6 +6,7 @@ import { ToolsResource } from "./resources/tools.js";
|
|
|
6
6
|
import { ConnectionsResource } from "./resources/connections.js";
|
|
7
7
|
import { ToolsetsResource } from "./resources/toolsets.js";
|
|
8
8
|
import { McpResource } from "./resources/mcp.js";
|
|
9
|
+
import { AuthProvidersResource } from "./resources/authProviders.js";
|
|
9
10
|
import { OpaResource } from "./resources/opa.js";
|
|
10
11
|
import { TriggersResource } from "./resources/triggers.js";
|
|
11
12
|
import { ApplicationsResource } from "./resources/applications.js";
|
|
@@ -19,6 +20,7 @@ export class Engini {
|
|
|
19
20
|
toolsets;
|
|
20
21
|
mcp;
|
|
21
22
|
opa;
|
|
23
|
+
authProviders;
|
|
22
24
|
triggers;
|
|
23
25
|
applications;
|
|
24
26
|
auth;
|
|
@@ -74,6 +76,7 @@ export class Engini {
|
|
|
74
76
|
this.toolsets = new ToolsetsResource(this);
|
|
75
77
|
this.mcp = new McpResource(this);
|
|
76
78
|
this.opa = new OpaResource(this);
|
|
79
|
+
this.authProviders = new AuthProvidersResource(this);
|
|
77
80
|
this.triggers = new TriggersResource(this);
|
|
78
81
|
this.applications = new ApplicationsResource(this);
|
|
79
82
|
this.auth = new AuthResource(this);
|
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export type { Verify } from "./http.js";
|
|
|
7
7
|
export { VERSION } from "./version.js";
|
|
8
8
|
export { EnginiError, EnginiNetworkError, EnginiAPIError, EnginiAuthError, EnginiNotFoundError, EnginiValidationError, EnginiRateLimitError, EnginiConflictError, EnginiServerError, EnginiClientError, EnginiConnectionError, EnginiToolsetError, EnginiToolsetNotFoundError, EnginiMcpServerNotFoundError, EnginiTimeoutError, EnginiToolExecutionError, EnginiOpaAgentNotFoundError, EnginiOpaAgentOfflineError, EnginiOpaApplicationAmbiguousError, EnginiOpaAgentTimeoutError, EnginiOpaAgentDispatchError, EnginiTriggerGapError, EnginiTriggerSubscribeFailedError, EnginiTriggerStreamLimitError, EnginiWebhookSignatureError, } from "./errors.js";
|
|
9
9
|
export type { EnginiAPIErrorOptions } from "./errors.js";
|
|
10
|
-
export { ToolsResource, ConnectionsResource, ToolsetsResource, McpResource, OpaResource, TriggersResource, ApplicationsResource, refreshFailed, verifyWebhook, } from "./resources/index.js";
|
|
10
|
+
export { ToolsResource, ConnectionsResource, ToolsetsResource, McpResource, OpaResource, AuthProvidersResource, TriggersResource, ApplicationsResource, refreshFailed, verifyWebhook, } from "./resources/index.js";
|
|
11
11
|
export type { ToolsGetOptions, ToolsExecuteOptions, ApplicationsListOptions, TriggersClient, TriggerWebhookEvent, } from "./resources/index.js";
|
|
12
12
|
export { Toolset } from "./toolset.js";
|
|
13
13
|
export type { ConnectionBinding, ToolsetExecuteOptions } from "./toolset.js";
|
|
@@ -15,7 +15,8 @@ export { File } from "./files.js";
|
|
|
15
15
|
export type { FileWire } from "./files.js";
|
|
16
16
|
export type { ToolSchema, Filter, Sort, ToolExecuteResult, Application, ApplicationDetail, Connection, ConnectionDetail, ConnectionObject, WhoAmI, AccessTokenResponse, } from "./types.js";
|
|
17
17
|
export type { ToolsetConnectionDto, ToolsetConnectionRequest, ToolsetDto } from "@engini/client";
|
|
18
|
-
export type {
|
|
18
|
+
export type { AuthProviderResponse, AuthProviderFieldValue, AuthProviderFieldDefinition, AuthProviderSourceApplication, AuthProviderSourceMethod, AuthProviderRedirectUriResponse, CreateAuthProviderRequest, UpdateAuthProviderRequest, UsableAuthProvider, } from "@engini/client";
|
|
19
|
+
export type { OnPremAgentListItem as OpaAgentListItem, OnPremAgentDetail as OpaAgentDetail, OnPremAgentSettings as OpaAgentSettings, OnPremAgentTokenResponse as OpaAgentTokenResponse, OnPremAgentCreateResponse as OpaAgentCreateResponse, OnPremAgentReleaseManifest as OpaReleaseManifest, CreateOnPremAgentRequest as CreateOpaAgentRequest, UpdateOnPremAgentRequest as UpdateOpaAgentRequest, } from "@engini/client";
|
|
19
20
|
export type { TriggerTypeDto, TriggerTypeDetailDto, TriggerParametersDto, TriggerInstanceView, TriggerInstanceStatus, TriggerKind, TriggerStatusReason, TriggerScheduleDto, TriggerScheduleFrequency, TriggerTimeFrameDto, TriggerEventView, TriggerEventDetailView, TriggerEventDeliveryStateDto, TriggerDeliveryAttemptView, TriggerDestinationView, TriggerDestinationCreated, TriggerDestinationStatusDto, CreateTriggerRequest, PatchTriggerRequest, CreateTriggerDestinationRequest, PatchTriggerDestinationRequest, PutDefaultDestinationRequest, } from "@engini/client";
|
|
20
21
|
export type { McpServerPublicDto, McpServerConnectionDto, McpServerConnectionRequest, McpServerWorkflowDto, McpServerWorkflowRequest, McpAvailableToolDto, } from "@engini/client";
|
|
21
22
|
export type { Provider, ToolCall, ToolResultOptions } from "./providers/base.js";
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ export { ApiKeyAuth, BearerAuth, ENV_API_KEY_VAR, ENV_TOKEN_VAR, ENV_COMPANY_TOK
|
|
|
3
3
|
export { composeUserAgent } from "./http.js";
|
|
4
4
|
export { VERSION } from "./version.js";
|
|
5
5
|
export { EnginiError, EnginiNetworkError, EnginiAPIError, EnginiAuthError, EnginiNotFoundError, EnginiValidationError, EnginiRateLimitError, EnginiConflictError, EnginiServerError, EnginiClientError, EnginiConnectionError, EnginiToolsetError, EnginiToolsetNotFoundError, EnginiMcpServerNotFoundError, EnginiTimeoutError, EnginiToolExecutionError, EnginiOpaAgentNotFoundError, EnginiOpaAgentOfflineError, EnginiOpaApplicationAmbiguousError, EnginiOpaAgentTimeoutError, EnginiOpaAgentDispatchError, EnginiTriggerGapError, EnginiTriggerSubscribeFailedError, EnginiTriggerStreamLimitError, EnginiWebhookSignatureError, } from "./errors.js";
|
|
6
|
-
export { ToolsResource, ConnectionsResource, ToolsetsResource, McpResource, OpaResource, TriggersResource, ApplicationsResource, refreshFailed, verifyWebhook, } from "./resources/index.js";
|
|
6
|
+
export { ToolsResource, ConnectionsResource, ToolsetsResource, McpResource, OpaResource, AuthProvidersResource, TriggersResource, ApplicationsResource, refreshFailed, verifyWebhook, } from "./resources/index.js";
|
|
7
7
|
export { Toolset } from "./toolset.js";
|
|
8
8
|
export { File } from "./files.js";
|
|
9
9
|
export { OpenAIProvider } from "./providers/openai.js";
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auth providers resource — an account's own OAuth/credential setup for one authentication
|
|
3
|
+
* method of one application.
|
|
4
|
+
*
|
|
5
|
+
* A provider is a name plus the values of the method's "Set on provider" connection fields,
|
|
6
|
+
* addressed by slot (`Key1`..`Key10`, `ApiUser`, `ApiPassword`, `BaseUrl`). A secret slot is
|
|
7
|
+
* write-only: it is accepted on the way in and a read returns `hasValue: true` with a null
|
|
8
|
+
* `value`. The server rejects a top-level `clientId` / `clientSecret`, so neither is a
|
|
9
|
+
* parameter here.
|
|
10
|
+
*
|
|
11
|
+
* Named `authProviders`, never bare `provider`: `client.provider` is the LLM-vendor wrapper.
|
|
12
|
+
*
|
|
13
|
+
* Listing and reading providers is manager-gated server-side; `usable()` (VIEW-gated) is the
|
|
14
|
+
* way for a plain member to resolve a provider by name.
|
|
15
|
+
*/
|
|
16
|
+
import { type AuthProviderRedirectUriResponse, type AuthProviderResponse, type AuthProviderSourceApplication, type CreateAuthProviderRequest, type UpdateAuthProviderRequest, type UsableAuthProvider } from "@engini/client";
|
|
17
|
+
import { type Transport } from "../http.js";
|
|
18
|
+
/** Minimal client surface this resource needs (satisfied by `Engini`). */
|
|
19
|
+
export interface AuthProvidersClient {
|
|
20
|
+
_transport: Transport;
|
|
21
|
+
}
|
|
22
|
+
export declare class AuthProvidersResource {
|
|
23
|
+
private readonly client;
|
|
24
|
+
constructor(client: AuthProvidersClient);
|
|
25
|
+
/** Every auth provider on the account (manager-gated; password values are never returned). */
|
|
26
|
+
list(): Promise<AuthProviderResponse[]>;
|
|
27
|
+
get(id: number): Promise<AuthProviderResponse>;
|
|
28
|
+
/**
|
|
29
|
+
* Create a provider. `fieldValues` is keyed by slot; password values are write-only. A body
|
|
30
|
+
* carrying `clientId` / `clientSecret` is a 400 `INVALID_AUTH_PROVIDER`.
|
|
31
|
+
*/
|
|
32
|
+
create(body: CreateAuthProviderRequest): Promise<AuthProviderResponse>;
|
|
33
|
+
/**
|
|
34
|
+
* Partial update: an omitted field is left alone. In `fieldValues`, an omitted slot keeps its
|
|
35
|
+
* stored value and `""` clears it.
|
|
36
|
+
*/
|
|
37
|
+
update(id: number, body: UpdateAuthProviderRequest): Promise<AuthProviderResponse>;
|
|
38
|
+
/** Delete a provider; refused (409 `AUTH_PROVIDER_IN_USE`) while a connection uses it. */
|
|
39
|
+
delete(id: number): Promise<void>;
|
|
40
|
+
/**
|
|
41
|
+
* The callback URL to register in your own OAuth app *before* creating a provider for the
|
|
42
|
+
* method. `authenticationId` is optional when the application has a single eligible method.
|
|
43
|
+
*/
|
|
44
|
+
redirectUri(applicationId: number, opts?: {
|
|
45
|
+
authenticationId?: number;
|
|
46
|
+
sandbox?: boolean;
|
|
47
|
+
}): Promise<AuthProviderRedirectUriResponse>;
|
|
48
|
+
/** Applications and methods a provider can be based on, with their "Set on provider" slots. */
|
|
49
|
+
sources(): Promise<AuthProviderSourceApplication[]>;
|
|
50
|
+
/** Active providers the caller may sign a connection in through; ids and names only, VIEW-gated. */
|
|
51
|
+
usable(): Promise<UsableAuthProvider[]>;
|
|
52
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Auth providers resource — an account's own OAuth/credential setup for one authentication
|
|
3
|
+
* method of one application.
|
|
4
|
+
*
|
|
5
|
+
* A provider is a name plus the values of the method's "Set on provider" connection fields,
|
|
6
|
+
* addressed by slot (`Key1`..`Key10`, `ApiUser`, `ApiPassword`, `BaseUrl`). A secret slot is
|
|
7
|
+
* write-only: it is accepted on the way in and a read returns `hasValue: true` with a null
|
|
8
|
+
* `value`. The server rejects a top-level `clientId` / `clientSecret`, so neither is a
|
|
9
|
+
* parameter here.
|
|
10
|
+
*
|
|
11
|
+
* Named `authProviders`, never bare `provider`: `client.provider` is the LLM-vendor wrapper.
|
|
12
|
+
*
|
|
13
|
+
* Listing and reading providers is manager-gated server-side; `usable()` (VIEW-gated) is the
|
|
14
|
+
* way for a plain member to resolve a provider by name.
|
|
15
|
+
*/
|
|
16
|
+
import { authProvidersCreate, authProvidersDelete, authProvidersGet, authProvidersGetRedirectUri, authProvidersList, authProvidersListSources, authProvidersListUsable, authProvidersUpdate, } from "@engini/client";
|
|
17
|
+
import { call } from "../http.js";
|
|
18
|
+
export class AuthProvidersResource {
|
|
19
|
+
client;
|
|
20
|
+
constructor(client) {
|
|
21
|
+
this.client = client;
|
|
22
|
+
}
|
|
23
|
+
/** Every auth provider on the account (manager-gated; password values are never returned). */
|
|
24
|
+
async list() {
|
|
25
|
+
return call(authProvidersList, { client: this.client._transport });
|
|
26
|
+
}
|
|
27
|
+
async get(id) {
|
|
28
|
+
return call(authProvidersGet, { client: this.client._transport, path: { id } });
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Create a provider. `fieldValues` is keyed by slot; password values are write-only. A body
|
|
32
|
+
* carrying `clientId` / `clientSecret` is a 400 `INVALID_AUTH_PROVIDER`.
|
|
33
|
+
*/
|
|
34
|
+
async create(body) {
|
|
35
|
+
return call(authProvidersCreate, { client: this.client._transport, body });
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Partial update: an omitted field is left alone. In `fieldValues`, an omitted slot keeps its
|
|
39
|
+
* stored value and `""` clears it.
|
|
40
|
+
*/
|
|
41
|
+
async update(id, body) {
|
|
42
|
+
return call(authProvidersUpdate, { client: this.client._transport, path: { id }, body });
|
|
43
|
+
}
|
|
44
|
+
/** Delete a provider; refused (409 `AUTH_PROVIDER_IN_USE`) while a connection uses it. */
|
|
45
|
+
async delete(id) {
|
|
46
|
+
await call(authProvidersDelete, { client: this.client._transport, path: { id } });
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The callback URL to register in your own OAuth app *before* creating a provider for the
|
|
50
|
+
* method. `authenticationId` is optional when the application has a single eligible method.
|
|
51
|
+
*/
|
|
52
|
+
async redirectUri(applicationId, opts = {}) {
|
|
53
|
+
return call(authProvidersGetRedirectUri, {
|
|
54
|
+
client: this.client._transport,
|
|
55
|
+
path: { applicationId },
|
|
56
|
+
query: { authenticationId: opts.authenticationId, sandbox: opts.sandbox },
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/** Applications and methods a provider can be based on, with their "Set on provider" slots. */
|
|
60
|
+
async sources() {
|
|
61
|
+
return call(authProvidersListSources, { client: this.client._transport });
|
|
62
|
+
}
|
|
63
|
+
/** Active providers the caller may sign a connection in through; ids and names only, VIEW-gated. */
|
|
64
|
+
async usable() {
|
|
65
|
+
return call(authProvidersListUsable, { client: this.client._transport });
|
|
66
|
+
}
|
|
67
|
+
}
|
|
@@ -82,10 +82,17 @@ export declare class ConnectionsResource {
|
|
|
82
82
|
setDefault(connectionId: number): Promise<unknown>;
|
|
83
83
|
clearDefault(application: string): Promise<unknown>;
|
|
84
84
|
resolve(application: string, name: string): Promise<number>;
|
|
85
|
-
/**
|
|
85
|
+
/**
|
|
86
|
+
* Begin an OAuth2 sign-in: returns `{ signInUrl, state }` to poll on.
|
|
87
|
+
*
|
|
88
|
+
* `opts.authProviderId` is tri-state: omitted = the account's default provider (if the
|
|
89
|
+
* caller may use it), `0` = the connector's own OAuth client, an id = that provider.
|
|
90
|
+
* Test it with `!== undefined` - a falsy check swallows `0`.
|
|
91
|
+
*/
|
|
86
92
|
getSignInUrl(application: string, authenticationId: number, opts?: {
|
|
87
93
|
fields?: Record<string, string>;
|
|
88
94
|
environment?: string;
|
|
95
|
+
authProviderId?: number;
|
|
89
96
|
}): Promise<SignInUrlResponse>;
|
|
90
97
|
/** Poll an OAuth2 sign-in by `state`; `status` is `completed` when done. */
|
|
91
98
|
getAccessToken(state: string): Promise<AccessTokenResponse>;
|
|
@@ -102,6 +109,7 @@ export declare class ConnectionsResource {
|
|
|
102
109
|
create(application: string, connectionName: string, authenticationId: number, fields: Record<string, string>, opts?: {
|
|
103
110
|
description?: string;
|
|
104
111
|
oauthState?: string;
|
|
112
|
+
authProviderId?: number;
|
|
105
113
|
}): Promise<ConnectionPublicDetail>;
|
|
106
114
|
/** Test a connection's liveness; returns the decoded check result. */
|
|
107
115
|
check(connectionId: number): Promise<unknown>;
|
|
@@ -201,7 +201,13 @@ export class ConnectionsResource {
|
|
|
201
201
|
return matches[0].connectionId;
|
|
202
202
|
}
|
|
203
203
|
// --- Creation flow (backs `engini connect`) --------------------------------
|
|
204
|
-
/**
|
|
204
|
+
/**
|
|
205
|
+
* Begin an OAuth2 sign-in: returns `{ signInUrl, state }` to poll on.
|
|
206
|
+
*
|
|
207
|
+
* `opts.authProviderId` is tri-state: omitted = the account's default provider (if the
|
|
208
|
+
* caller may use it), `0` = the connector's own OAuth client, an id = that provider.
|
|
209
|
+
* Test it with `!== undefined` - a falsy check swallows `0`.
|
|
210
|
+
*/
|
|
205
211
|
async getSignInUrl(application, authenticationId, opts = {}) {
|
|
206
212
|
return call(connectionsGetSignInUrl, {
|
|
207
213
|
client: this.client._transport,
|
|
@@ -210,6 +216,7 @@ export class ConnectionsResource {
|
|
|
210
216
|
authenticationId,
|
|
211
217
|
...(opts.environment !== undefined ? { environment: opts.environment } : {}),
|
|
212
218
|
...(opts.fields !== undefined ? { fields: opts.fields } : {}),
|
|
219
|
+
...(opts.authProviderId !== undefined ? { authProviderId: opts.authProviderId } : {}),
|
|
213
220
|
},
|
|
214
221
|
});
|
|
215
222
|
}
|
|
@@ -233,6 +240,9 @@ export class ConnectionsResource {
|
|
|
233
240
|
async create(application, connectionName, authenticationId, fields, opts = {}) {
|
|
234
241
|
return call(connectionsCreateConnection, {
|
|
235
242
|
client: this.client._transport,
|
|
243
|
+
// A *query* parameter here, honoured only for OAuth2-without-sign-in methods (the body's own
|
|
244
|
+
// AuthProviderId is ignored). Same tri-state as get-sign-in-url: omitted / 0 / id.
|
|
245
|
+
...(opts.authProviderId !== undefined ? { query: { authProviderId: opts.authProviderId } } : {}),
|
|
236
246
|
body: {
|
|
237
247
|
applicationSlug: application,
|
|
238
248
|
connectionName,
|
|
@@ -3,6 +3,8 @@ export type { ToolsGetOptions, ToolsExecuteOptions } from "./tools.js";
|
|
|
3
3
|
export { ConnectionsResource, refreshFailed } from "./connections.js";
|
|
4
4
|
export { ToolsetsResource } from "./toolsets.js";
|
|
5
5
|
export { McpResource } from "./mcp.js";
|
|
6
|
+
export { AuthProvidersResource } from "./authProviders.js";
|
|
7
|
+
export type { AuthProvidersClient } from "./authProviders.js";
|
|
6
8
|
export { OpaResource } from "./opa.js";
|
|
7
9
|
export type { OpaClient } from "./opa.js";
|
|
8
10
|
export { TriggersResource, verifyWebhook } from "./triggers.js";
|
package/dist/resources/index.js
CHANGED
|
@@ -2,6 +2,7 @@ export { ToolsResource } from "./tools.js";
|
|
|
2
2
|
export { ConnectionsResource, refreshFailed } from "./connections.js";
|
|
3
3
|
export { ToolsetsResource } from "./toolsets.js";
|
|
4
4
|
export { McpResource } from "./mcp.js";
|
|
5
|
+
export { AuthProvidersResource } from "./authProviders.js";
|
|
5
6
|
export { OpaResource } from "./opa.js";
|
|
6
7
|
export { TriggersResource, verifyWebhook } from "./triggers.js";
|
|
7
8
|
export { ApplicationsResource } from "./applications.js";
|
package/dist/resources/opa.d.ts
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Agents are NOT connections on this surface: `client.connections` never returns them,
|
|
11
11
|
* and `connections.get(agentId)` is a 404.
|
|
12
12
|
*/
|
|
13
|
-
import { type
|
|
13
|
+
import { type OnPremAgentCreateResponse, type OnPremAgentDetail, type OnPremAgentListItem, type OnPremAgentTokenResponse, type OnPremAgentReleaseManifest } from "@engini/client";
|
|
14
14
|
import { type Transport } from "../http.js";
|
|
15
15
|
/** The settings members every write accepts. Each is independently optional. */
|
|
16
16
|
interface OpaSettingsParams {
|
|
@@ -44,7 +44,7 @@ export declare class OpaResource {
|
|
|
44
44
|
list(params?: {
|
|
45
45
|
status?: string;
|
|
46
46
|
name?: string;
|
|
47
|
-
}): Promise<
|
|
47
|
+
}): Promise<OnPremAgentListItem[]>;
|
|
48
48
|
/**
|
|
49
49
|
* One agent's status, self-reported version, last heartbeat and settings.
|
|
50
50
|
*
|
|
@@ -52,7 +52,7 @@ export declare class OpaResource {
|
|
|
52
52
|
* account, or is not an on-premise agent — the API answers 404 for all three
|
|
53
53
|
* deliberately and does not distinguish them.
|
|
54
54
|
*/
|
|
55
|
-
get(agentId: number): Promise<
|
|
55
|
+
get(agentId: number): Promise<OnPremAgentDetail>;
|
|
56
56
|
/**
|
|
57
57
|
* Where to download the current agent installer.
|
|
58
58
|
*
|
|
@@ -61,7 +61,7 @@ export declare class OpaResource {
|
|
|
61
61
|
* are then null. A caller that needs integrity verification should refuse a degraded
|
|
62
62
|
* manifest.
|
|
63
63
|
*/
|
|
64
|
-
latestRelease(): Promise<
|
|
64
|
+
latestRelease(): Promise<OnPremAgentReleaseManifest>;
|
|
65
65
|
/**
|
|
66
66
|
* Build a settings object carrying ONLY what the caller supplied, or `undefined`
|
|
67
67
|
* when nothing was.
|
|
@@ -96,7 +96,7 @@ export declare class OpaResource {
|
|
|
96
96
|
name: string;
|
|
97
97
|
description?: string;
|
|
98
98
|
applicationSlug?: string;
|
|
99
|
-
} & OpaSettingsParams): Promise<
|
|
99
|
+
} & OpaSettingsParams): Promise<OnPremAgentCreateResponse>;
|
|
100
100
|
/**
|
|
101
101
|
* Change an agent's name, description or runtime settings.
|
|
102
102
|
*
|
|
@@ -110,7 +110,7 @@ export declare class OpaResource {
|
|
|
110
110
|
update(agentId: number, params: {
|
|
111
111
|
name?: string;
|
|
112
112
|
description?: string;
|
|
113
|
-
} & OpaSettingsParams): Promise<
|
|
113
|
+
} & OpaSettingsParams): Promise<OnPremAgentDetail>;
|
|
114
114
|
/** Permanently delete an agent. Workflows routed through it stop working. */
|
|
115
115
|
delete(agentId: number): Promise<void>;
|
|
116
116
|
/**
|
|
@@ -119,21 +119,21 @@ export declare class OpaResource {
|
|
|
119
119
|
* A no-op on an agent that is not disabled — its reported liveness is left alone
|
|
120
120
|
* rather than being reset.
|
|
121
121
|
*/
|
|
122
|
-
enable(agentId: number): Promise<
|
|
122
|
+
enable(agentId: number): Promise<OnPremAgentDetail>;
|
|
123
123
|
/**
|
|
124
124
|
* Disable an agent so it stops being marked online.
|
|
125
125
|
*
|
|
126
126
|
* Not a delete and not a pause of in-flight work: tasks it already holds still run
|
|
127
127
|
* to completion.
|
|
128
128
|
*/
|
|
129
|
-
disable(agentId: number): Promise<
|
|
129
|
+
disable(agentId: number): Promise<OnPremAgentDetail>;
|
|
130
130
|
/**
|
|
131
131
|
* The agent's token — the credential it authenticates to Engini with.
|
|
132
132
|
*
|
|
133
133
|
* Treat the result as a secret: it is equivalent to the agent's identity. Reads are
|
|
134
134
|
* audit-logged server-side.
|
|
135
135
|
*/
|
|
136
|
-
getToken(agentId: number): Promise<
|
|
136
|
+
getToken(agentId: number): Promise<OnPremAgentTokenResponse>;
|
|
137
137
|
/**
|
|
138
138
|
* Issue a new token, invalidating the current one immediately.
|
|
139
139
|
*
|
|
@@ -144,7 +144,7 @@ export declare class OpaResource {
|
|
|
144
144
|
* confirmation gate belongs in the CLI, not in library code where a prompt would be
|
|
145
145
|
* unreachable.
|
|
146
146
|
*/
|
|
147
|
-
rotateToken(agentId: number): Promise<
|
|
147
|
+
rotateToken(agentId: number): Promise<OnPremAgentTokenResponse>;
|
|
148
148
|
/**
|
|
149
149
|
* Map the OPA agent-side wire codes onto their typed errors.
|
|
150
150
|
*
|
package/dist/resources/opa.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* Agents are NOT connections on this surface: `client.connections` never returns them,
|
|
11
11
|
* and `connections.get(agentId)` is a 404.
|
|
12
12
|
*/
|
|
13
|
-
import {
|
|
13
|
+
import { onPremAgentsCreateAgent, onPremAgentsDeleteAgent, onPremAgentsDisableAgent, onPremAgentsEnableAgent, onPremAgentsGetAgent, onPremAgentsGetAgentLogs, onPremAgentsGetAgentToken, onPremAgentsGetLatestRelease, onPremAgentsListAgents, onPremAgentsRotateAgentToken, onPremAgentsUpdateAgent, } from "@engini/client";
|
|
14
14
|
import { call } from "../http.js";
|
|
15
15
|
import { paginate, collect } from "../pagination.js";
|
|
16
16
|
import { EnginiAPIError, EnginiNotFoundError, EnginiOpaAgentDispatchError, EnginiOpaAgentNotFoundError, EnginiOpaAgentOfflineError, EnginiOpaAgentTimeoutError, EnginiOpaApplicationAmbiguousError, } from "../errors.js";
|
|
@@ -43,7 +43,7 @@ export class OpaResource {
|
|
|
43
43
|
*/
|
|
44
44
|
async list(params = {}) {
|
|
45
45
|
const transport = this.client._transport;
|
|
46
|
-
return collect(paginate((offset, top) => call(
|
|
46
|
+
return collect(paginate((offset, top) => call(onPremAgentsListAgents, {
|
|
47
47
|
client: transport,
|
|
48
48
|
query: { offset, top, status: params.status, name: params.name },
|
|
49
49
|
})));
|
|
@@ -57,7 +57,7 @@ export class OpaResource {
|
|
|
57
57
|
*/
|
|
58
58
|
async get(agentId) {
|
|
59
59
|
try {
|
|
60
|
-
return await call(
|
|
60
|
+
return await call(onPremAgentsGetAgent, {
|
|
61
61
|
client: this.client._transport,
|
|
62
62
|
path: { id: agentId },
|
|
63
63
|
});
|
|
@@ -75,7 +75,7 @@ export class OpaResource {
|
|
|
75
75
|
* manifest.
|
|
76
76
|
*/
|
|
77
77
|
async latestRelease() {
|
|
78
|
-
return call(
|
|
78
|
+
return call(onPremAgentsGetLatestRelease, { client: this.client._transport });
|
|
79
79
|
}
|
|
80
80
|
// ---- lifecycle -------------------------------------------------------------------
|
|
81
81
|
/**
|
|
@@ -129,7 +129,7 @@ export class OpaResource {
|
|
|
129
129
|
*/
|
|
130
130
|
async create(params) {
|
|
131
131
|
try {
|
|
132
|
-
return await call(
|
|
132
|
+
return await call(onPremAgentsCreateAgent, {
|
|
133
133
|
client: this.client._transport,
|
|
134
134
|
body: {
|
|
135
135
|
name: params.name,
|
|
@@ -155,7 +155,7 @@ export class OpaResource {
|
|
|
155
155
|
*/
|
|
156
156
|
async update(agentId, params) {
|
|
157
157
|
try {
|
|
158
|
-
return await call(
|
|
158
|
+
return await call(onPremAgentsUpdateAgent, {
|
|
159
159
|
client: this.client._transport,
|
|
160
160
|
path: { id: agentId },
|
|
161
161
|
body: {
|
|
@@ -172,7 +172,7 @@ export class OpaResource {
|
|
|
172
172
|
/** Permanently delete an agent. Workflows routed through it stop working. */
|
|
173
173
|
async delete(agentId) {
|
|
174
174
|
try {
|
|
175
|
-
await call(
|
|
175
|
+
await call(onPremAgentsDeleteAgent, {
|
|
176
176
|
client: this.client._transport,
|
|
177
177
|
path: { id: agentId },
|
|
178
178
|
});
|
|
@@ -189,7 +189,7 @@ export class OpaResource {
|
|
|
189
189
|
*/
|
|
190
190
|
async enable(agentId) {
|
|
191
191
|
try {
|
|
192
|
-
return await call(
|
|
192
|
+
return await call(onPremAgentsEnableAgent, {
|
|
193
193
|
client: this.client._transport,
|
|
194
194
|
path: { id: agentId },
|
|
195
195
|
});
|
|
@@ -206,7 +206,7 @@ export class OpaResource {
|
|
|
206
206
|
*/
|
|
207
207
|
async disable(agentId) {
|
|
208
208
|
try {
|
|
209
|
-
return await call(
|
|
209
|
+
return await call(onPremAgentsDisableAgent, {
|
|
210
210
|
client: this.client._transport,
|
|
211
211
|
path: { id: agentId },
|
|
212
212
|
});
|
|
@@ -224,7 +224,7 @@ export class OpaResource {
|
|
|
224
224
|
*/
|
|
225
225
|
async getToken(agentId) {
|
|
226
226
|
try {
|
|
227
|
-
return await call(
|
|
227
|
+
return await call(onPremAgentsGetAgentToken, {
|
|
228
228
|
client: this.client._transport,
|
|
229
229
|
path: { id: agentId },
|
|
230
230
|
});
|
|
@@ -245,7 +245,7 @@ export class OpaResource {
|
|
|
245
245
|
*/
|
|
246
246
|
async rotateToken(agentId) {
|
|
247
247
|
try {
|
|
248
|
-
return await call(
|
|
248
|
+
return await call(onPremAgentsRotateAgentToken, {
|
|
249
249
|
client: this.client._transport,
|
|
250
250
|
path: { id: agentId },
|
|
251
251
|
query: { confirm: true },
|
|
@@ -298,7 +298,7 @@ export class OpaResource {
|
|
|
298
298
|
async downloadLogs(agentId) {
|
|
299
299
|
let payload;
|
|
300
300
|
try {
|
|
301
|
-
payload = await call(
|
|
301
|
+
payload = await call(onPremAgentsGetAgentLogs, {
|
|
302
302
|
client: this.client._transport,
|
|
303
303
|
path: { id: agentId },
|
|
304
304
|
// `as const` is load-bearing: through `call`'s generic inference the literal
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@engini/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.26.0",
|
|
4
4
|
"description": "Engini SDK — agent-first ergonomic layer over the Engini Public API",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"test": "vitest run"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@engini/client": "0.
|
|
30
|
+
"@engini/client": "0.12.0",
|
|
31
31
|
"undici": "^6.0.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|