@zackbart/connecta 0.35.0 → 0.36.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/CHANGELOG.md +55 -0
- package/README.md +8 -4
- package/bin/version.mjs +1 -1
- package/dist/auth/downstream-oauth.js +71 -79
- package/dist/auth/static-oauth.js +104 -26
- package/dist/connectors/api-connector.d.ts +17 -0
- package/dist/connectors/api-connector.js +3 -1
- package/dist/http/client.js +1 -1
- package/dist/http/paging.js +1 -2
- package/dist/http/services.js +1 -1
- package/dist/http/tools.js +0 -4
- package/dist/operator-ui/contract.d.ts +1 -0
- package/dist/operator-ui/generated.js +4 -4
- package/dist/providers/_shared/google/kit.js +29 -139
- package/dist/providers/_shared/rest/kit.js +4 -404
- package/dist/providers/docs/tools.js +1 -2
- package/dist/providers/drive/api.js +1 -1
- package/dist/providers/forms/tools.js +1 -2
- package/dist/providers/gmail/tools.js +2 -2
- package/dist/providers/planning-center/lib/constants.d.ts +1 -1
- package/dist/providers/quickbooks/api.js +299 -0
- package/dist/providers/quickbooks/index.d.ts +13 -0
- package/dist/providers/quickbooks/index.js +93 -0
- package/dist/providers/quickbooks/lib/query.js +118 -0
- package/dist/providers/quickbooks/lib/writes.js +168 -0
- package/dist/providers/quickbooks/safety.js +222 -0
- package/dist/providers/quickbooks/skill.generated.js +5 -0
- package/dist/providers/quickbooks/tools.js +117 -0
- package/dist/providers/sheets/tools.js +1 -2
- package/dist/providers/slides/tools.js +2 -2
- package/dist/providers/vercel/index.js +1 -2
- package/dist/routes/oauth.js +3 -0
- package/dist/runtime/call.js +0 -4
- package/dist/skills.js +0 -1
- package/dist/types.d.ts +2 -0
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +0 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/documentation/README.md +1 -0
- package/documentation/architecture.md +134 -301
- package/documentation/auth.md +47 -17
- package/documentation/integrating.md +1 -1
- package/documentation/meta-tools.md +1 -1
- package/documentation/operator-ui.md +16 -3
- package/documentation/providers.md +382 -0
- package/package.json +7 -8
- package/templates/node/package.json +1 -1
- package/dist/operator-ui/agents.d.ts +0 -75
- package/dist/operator-ui/agents.js +0 -114
- package/dist/operator-ui/config-summary.js +0 -566
- package/dist/operator-ui/connection-map.js +0 -378
- package/dist/operator-ui/endpoints.js +0 -212
- package/dist/operator-ui/fix-prompts.d.ts +0 -18
- package/dist/operator-ui/fix-prompts.js +0 -79
- package/dist/operator-ui/health.js +0 -52
- package/dist/operator-ui/member-page.js +0 -97
- package/dist/operator-ui/overview.js +0 -126
- package/dist/operator-ui/setup-commands.js +0 -47
- package/dist/operator-ui/view.d.ts +0 -378
- package/dist/operator-ui/view.js +0 -631
- package/dist/providers/_shared/rest/dispatch.js +0 -21
- package/dist/providers/_shared/rest/tools.js +0 -592
|
@@ -42,6 +42,10 @@ export interface ApiOAuthConfig {
|
|
|
42
42
|
authorizationEndpoint: string;
|
|
43
43
|
/** Where codes are exchanged and refresh tokens redeemed. Absolute https URL. */
|
|
44
44
|
tokenEndpoint: string;
|
|
45
|
+
/** Trusted RFC 7009 endpoint; disconnect removes the local grant then attempts revocation once. */
|
|
46
|
+
revocationEndpoint?: string;
|
|
47
|
+
/** Revocation body encoding, default form. JSON omits the RFC 7009 token_type_hint. */
|
|
48
|
+
revocationRequestFormat?: "form" | "json";
|
|
45
49
|
/** The client id the provider issued for this deployment. */
|
|
46
50
|
clientId: string;
|
|
47
51
|
/**
|
|
@@ -64,6 +68,15 @@ export interface ApiOAuthConfig {
|
|
|
64
68
|
* `access_type`. The grant's own parameters cannot be overridden.
|
|
65
69
|
*/
|
|
66
70
|
authorizationParams?: Record<string, string>;
|
|
71
|
+
/**
|
|
72
|
+
* Fixed provider callback parameters, such as a configured company id.
|
|
73
|
+
* After pending-state verification, each must occur exactly once with this
|
|
74
|
+
* exact value, before issuer validation or code exchange. OAuth response
|
|
75
|
+
* fields (code, state, iss, error, error_description, error_uri) are reserved.
|
|
76
|
+
* Names must be nonempty ASCII letters, digits, dots, underscores or hyphens;
|
|
77
|
+
* values must be nonempty strings. Values are never described or returned.
|
|
78
|
+
*/
|
|
79
|
+
expectedCallbackParameters?: Readonly<Record<string, string>>;
|
|
67
80
|
/**
|
|
68
81
|
* Headers added to every token-endpoint request — the code exchange and
|
|
69
82
|
* each refresh — for a provider whose token endpoint demands its own
|
|
@@ -199,6 +212,7 @@ export declare const API_OPTIONS: import("../config-schema.js").Field<unknown, u
|
|
|
199
212
|
oauth: import("../config-schema.js").Field<unknown, unknown, true> & {
|
|
200
213
|
readonly shape: {
|
|
201
214
|
authorizationParams: import("../config-schema.js").Field<Record<string, string>, Readonly<Record<string, string>> | undefined, true>;
|
|
215
|
+
expectedCallbackParameters: import("../config-schema.js").Field<Record<string, string>, Readonly<Record<string, string>> | undefined, true>;
|
|
202
216
|
tokenRequestHeaders: import("../config-schema.js").Field<Record<string, string>, Readonly<Record<string, string>> | undefined, true>;
|
|
203
217
|
scope: import("../config-schema.js").Field<unknown, unknown, true>;
|
|
204
218
|
authorizationEndpoint: import("../config-schema.js").Field<unknown, unknown, true>;
|
|
@@ -208,6 +222,8 @@ export declare const API_OPTIONS: import("../config-schema.js").Field<unknown, u
|
|
|
208
222
|
pkce: import("../config-schema.js").Field<unknown, unknown, true>;
|
|
209
223
|
clientId: import("../config-schema.js").Field<unknown, unknown, true>;
|
|
210
224
|
clientSecret: import("../config-schema.js").Field<unknown, unknown, true>;
|
|
225
|
+
revocationEndpoint: import("../config-schema.js").Field<unknown, unknown, true>;
|
|
226
|
+
revocationRequestFormat: import("../config-schema.js").Field<unknown, unknown, true>;
|
|
211
227
|
};
|
|
212
228
|
};
|
|
213
229
|
tools: import("../config-schema.js").Field<unknown[], readonly unknown[] | undefined, true>;
|
|
@@ -233,6 +249,7 @@ export interface ApiOAuthHooks {
|
|
|
233
249
|
}): Promise<ConnectorStatus>;
|
|
234
250
|
disconnectAuth(ctx: ConnectorContext): Promise<void>;
|
|
235
251
|
verifyState(state: string | null, ctx: ConnectorContext): Promise<boolean>;
|
|
252
|
+
verifyCallbackParameters(params: URLSearchParams, ctx: ConnectorContext): Promise<boolean>;
|
|
236
253
|
verifyCallbackIssuer(issuer: string | null, ctx: ConnectorContext): Promise<boolean>;
|
|
237
254
|
consumeAuthError(ctx: ConnectorContext): Promise<void>;
|
|
238
255
|
/** Requires callbackParams with a nonempty state, including without PKCE. */
|
|
@@ -57,8 +57,9 @@ export const API_OPTIONS = optionsOf()({
|
|
|
57
57
|
usageGuide: USAGE_GUIDE,
|
|
58
58
|
credential: CREDENTIAL,
|
|
59
59
|
oauth: optionsOf()({
|
|
60
|
-
...keys("authorizationEndpoint", "tokenEndpoint", "clientId", "clientSecret", "tokenEndpointAuthMethod", "scope", "pkce", "apiOrigins"),
|
|
60
|
+
...keys("authorizationEndpoint", "tokenEndpoint", "clientId", "clientSecret", "tokenEndpointAuthMethod", "scope", "pkce", "apiOrigins", "revocationEndpoint", "revocationRequestFormat"),
|
|
61
61
|
authorizationParams: strings(),
|
|
62
|
+
expectedCallbackParameters: strings(),
|
|
62
63
|
tokenRequestHeaders: strings(),
|
|
63
64
|
}),
|
|
64
65
|
// A tool's annotations stay open: MCP lets a tool carry hints Connecta
|
|
@@ -158,6 +159,7 @@ export function apiConnector(id, opts, oauth) {
|
|
|
158
159
|
// Callback work belongs to its request, including the route's
|
|
159
160
|
// uninterruptible exchange, rather than any resource call.
|
|
160
161
|
verifyState: (state, ctx) => settleOnClose(ctx, () => oauth.verifyState(state, ctx), true),
|
|
162
|
+
verifyCallbackParameters: (params, ctx) => settleOnClose(ctx, () => oauth.verifyCallbackParameters(params, ctx), true),
|
|
161
163
|
verifyCallbackIssuer: (issuer, ctx) => settleOnClose(ctx, () => oauth.verifyCallbackIssuer(issuer, ctx), true),
|
|
162
164
|
consumeAuthError: (ctx) => settleOnClose(ctx, () => oauth.consumeAuthError(ctx), true),
|
|
163
165
|
finishAuth: (code, ctx, callbackParams) => settleOnClose(ctx, () => oauth.finishAuth(code, ctx, callbackParams), true),
|
package/dist/http/client.js
CHANGED
|
@@ -324,7 +324,7 @@ function bodyInit(request) {
|
|
|
324
324
|
return { body: body.body };
|
|
325
325
|
case "Uint8Array":
|
|
326
326
|
// The retained text when there is one, so the wire carries exactly the
|
|
327
|
-
// string guarded-fetch sent
|
|
327
|
+
// string guarded-fetch sent.
|
|
328
328
|
return { body: (body.text ?? body.body) };
|
|
329
329
|
case "FormData":
|
|
330
330
|
return { body: body.formData };
|
package/dist/http/paging.js
CHANGED
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
// after this cursor" into a vendor request and reads back rows and the next
|
|
5
5
|
// vendor cursor; tools take one page, and `allRows` walks every page as a
|
|
6
6
|
// Stream for programs and the hatch. The codec is the only place a cursor is
|
|
7
|
-
// minted: `plain` hands the vendor's cursor through
|
|
8
|
-
// promise today, so goldens hold), `bound` ties it to the tool and its
|
|
7
|
+
// minted: `plain` hands the vendor's cursor through; `bound` ties it to the tool and its
|
|
9
8
|
// arguments so a cursor from another call is refused instead of silently
|
|
10
9
|
// reading the wrong list.
|
|
11
10
|
import { Effect, Option, Schema, Stream } from "effect";
|
package/dist/http/services.js
CHANGED
|
@@ -6,7 +6,7 @@ import { fromSignal } from "../runtime/run.js";
|
|
|
6
6
|
import { callFromContext, ContinuationBinding, ContinuationStorage, openCall as openCoreCall, serviceFor, Signal, } from "../runtime/call.js";
|
|
7
7
|
import { RequestRefused, ResendRefused } from "./errors.js";
|
|
8
8
|
export { writeRequestKey } from "./write-request.js";
|
|
9
|
-
export { Caller, Credentials, Secrets, RequestSecrets, Budget, Recovery, Signal, Classification, Ledger,
|
|
9
|
+
export { Caller, Credentials, Secrets, RequestSecrets, Budget, Recovery, Signal, Classification, Ledger, } from "../runtime/call.js";
|
|
10
10
|
/** Permanent write reservations plus resource dispatches, in reservation order. */
|
|
11
11
|
export class Dispatches extends Context.Service()("connecta/http/Dispatches") {
|
|
12
12
|
}
|
package/dist/http/tools.js
CHANGED
|
@@ -264,10 +264,6 @@ export function write(connection, spec) {
|
|
|
264
264
|
...(spec.idempotent === undefined ? {} : { idempotentHint: spec.idempotent }),
|
|
265
265
|
}, spec.idempotency);
|
|
266
266
|
}
|
|
267
|
-
/** Money, mail, and refunds are always destructive and never idempotent hints. */
|
|
268
|
-
export function action(connection, spec) {
|
|
269
|
-
return build(connection, spec, "write", { readOnlyHint: false, destructiveHint: true, idempotentHint: false });
|
|
270
|
-
}
|
|
271
267
|
/**
|
|
272
268
|
* A key the transport may send: not blank, and only characters an HTTP
|
|
273
269
|
* header carries. The REST layer refuses the same keys before dispatch.
|
|
@@ -2,6 +2,7 @@ import type { ActivityOutcome } from "../activity.js";
|
|
|
2
2
|
import type { ConnectaConfigDescription } from "../describe-config.js";
|
|
3
3
|
import type { ConnectorStatus, ConnectorToolDescription } from "../types.js";
|
|
4
4
|
import type { UiProblem } from "./model.js";
|
|
5
|
+
export type OperatorPage = "overview" | "endpoints" | "settings" | "connector" | "tokens" | "connections" | "activity";
|
|
5
6
|
/** The registry's final verdict, independent of whether the viewer's endpoint is read-only. */
|
|
6
7
|
export interface OperatorTool extends ConnectorToolDescription {
|
|
7
8
|
address: string;
|