@tangle-network/agent-integrations 0.25.1 → 0.25.3
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 +28 -5
- package/dist/bin/tangle-catalog-runtime.js +5 -1
- package/dist/bin/tangle-catalog-runtime.js.map +1 -1
- package/dist/catalog.d.ts +4 -0
- package/dist/catalog.js +15 -0
- package/dist/catalog.js.map +1 -0
- package/dist/chunk-376UBTNB.js +1 -0
- package/dist/chunk-376UBTNB.js.map +1 -0
- package/dist/chunk-6KWCC42J.js +120 -0
- package/dist/chunk-6KWCC42J.js.map +1 -0
- package/dist/chunk-FQAT4IEE.js +246 -0
- package/dist/chunk-FQAT4IEE.js.map +1 -0
- package/dist/chunk-IDX3KIPA.js +3233 -0
- package/dist/chunk-IDX3KIPA.js.map +1 -0
- package/dist/{chunk-VJ57GPYO.js → chunk-MU3UTIOX.js} +3234 -6787
- package/dist/chunk-MU3UTIOX.js.map +1 -0
- package/dist/connectors/adapters/index.d.ts +1 -0
- package/dist/connectors/adapters/index.js +39 -0
- package/dist/connectors/adapters/index.js.map +1 -0
- package/dist/connectors/index.d.ts +180 -0
- package/dist/connectors/index.js +74 -0
- package/dist/connectors/index.js.map +1 -0
- package/dist/index-BNb1A0Id.d.ts +810 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +51 -44
- package/dist/registry.d.ts +1982 -0
- package/dist/registry.js +20 -0
- package/dist/registry.js.map +1 -0
- package/dist/runtime.d.ts +4 -0
- package/dist/runtime.js +12 -0
- package/dist/runtime.js.map +1 -0
- package/dist/specs.d.ts +4 -2962
- package/dist/tangle-catalog-runtime.d.ts +4 -0
- package/dist/tangle-catalog-runtime.js +22 -0
- package/dist/tangle-catalog-runtime.js.map +1 -0
- package/docs/adapter-triage.md +1 -1
- package/docs/platform-control-plane.md +54 -0
- package/docs/product-hub-ownership.md +126 -0
- package/docs/production-completion-checklist.md +2 -0
- package/docs/provider-decision-matrix.md +3 -3
- package/examples/calendar-exercise-app.ts +3 -3
- package/package.json +40 -12
- package/dist/chunk-VJ57GPYO.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { G as GoogleCalendarOptions, p as GoogleSheetsOptions, H as HubSpotOptions, M as MicrosoftCalendarOptions, N as NotionDatabaseOptions, s as RestConnectorSpec, t as RestCredentialPlacement, u as RestOperationSpec, v as RestRequestSpec, S as SlackOptions, w as airtableConnector, x as asanaConnector, z as declarativeRestConnector, B as githubConnector, F as gitlabConnector, J as googleCalendar, K as googleSheets, L as hubspot, O as microsoftCalendar, P as notionDatabase, Q as salesforceConnector, T as slack, U as slackEventsConnector, V as stripePackConnector, W as stripeWebhookReceiverConnector, X as twilioSmsConnector, Z as webhookConnector } from '../../index-BNb1A0Id.js';
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import {
|
|
2
|
+
airtableConnector,
|
|
3
|
+
asanaConnector,
|
|
4
|
+
declarativeRestConnector,
|
|
5
|
+
githubConnector,
|
|
6
|
+
gitlabConnector,
|
|
7
|
+
googleCalendar,
|
|
8
|
+
googleSheets,
|
|
9
|
+
hubspot,
|
|
10
|
+
microsoftCalendar,
|
|
11
|
+
notionDatabase,
|
|
12
|
+
salesforceConnector,
|
|
13
|
+
slack,
|
|
14
|
+
slackEventsConnector,
|
|
15
|
+
stripePackConnector,
|
|
16
|
+
stripeWebhookReceiverConnector,
|
|
17
|
+
twilioSmsConnector,
|
|
18
|
+
webhookConnector
|
|
19
|
+
} from "../../chunk-IDX3KIPA.js";
|
|
20
|
+
export {
|
|
21
|
+
airtableConnector,
|
|
22
|
+
asanaConnector,
|
|
23
|
+
declarativeRestConnector,
|
|
24
|
+
githubConnector,
|
|
25
|
+
gitlabConnector,
|
|
26
|
+
googleCalendar,
|
|
27
|
+
googleSheets,
|
|
28
|
+
hubspot,
|
|
29
|
+
microsoftCalendar,
|
|
30
|
+
notionDatabase,
|
|
31
|
+
salesforceConnector,
|
|
32
|
+
slack,
|
|
33
|
+
slackEventsConnector,
|
|
34
|
+
stripePackConnector,
|
|
35
|
+
stripeWebhookReceiverConnector,
|
|
36
|
+
twilioSmsConnector,
|
|
37
|
+
webhookConnector
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
export { A as AuthSpec, b as CASStrategy, c as Capability, d as CapabilityClass, e as CapabilityMutation, f as CapabilityMutationResult, g as CapabilityParameterSchema, h as CapabilityRead, i as CapabilityReadResult, C as ConnectorAdapter, a as ConnectorCredentials, j as ConnectorInvocation, k as ConnectorManifest, l as ConnectorManifestValidationIssue, m as ConnectorManifestValidationResult, n as ConsistencyModel, o as CredentialsExpired, D as DataSourceMetadata, E as EventHandlerResult, G as GoogleCalendarOptions, p as GoogleSheetsOptions, H as HubSpotOptions, I as InboundEvent, M as MicrosoftCalendarOptions, N as NotionDatabaseOptions, q as RateLimitSpec, R as ResolvedDataSource, r as ResourceContention, s as RestConnectorSpec, t as RestCredentialPlacement, u as RestOperationSpec, v as RestRequestSpec, S as SlackOptions, w as airtableConnector, x as asanaConnector, y as assertValidConnectorManifest, z as declarativeRestConnector, B as githubConnector, F as gitlabConnector, J as googleCalendar, K as googleSheets, L as hubspot, O as microsoftCalendar, P as notionDatabase, Q as salesforceConnector, T as slack, U as slackEventsConnector, V as stripePackConnector, W as stripeWebhookReceiverConnector, X as twilioSmsConnector, Y as validateConnectorManifest, Z as webhookConnector } from '../index-BNb1A0Id.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Generic OAuth2 helper used by every oauth-shaped connector (Google
|
|
5
|
+
* Calendar, Sheets, Drive, HubSpot, Salesforce, Zoom, ...).
|
|
6
|
+
*
|
|
7
|
+
* Everything PKCE-aware. Opaque-state CSRF guard. Refresh-token aware.
|
|
8
|
+
* No connector-specific logic lives here — adapters hand a `clientId`,
|
|
9
|
+
* `clientSecret`, `tokenUrl`, optional `extraAuthParams` and the rest is
|
|
10
|
+
* mechanical.
|
|
11
|
+
*
|
|
12
|
+
* State and code_verifier are kept in a short-TTL flow store keyed by the
|
|
13
|
+
* opaque `state` we round-trip through the provider. The default store is
|
|
14
|
+
* in-memory for local/dev and tests. Production deployments should inject a
|
|
15
|
+
* durable store backed by KV/Redis/D1/etc. so callbacks can land on any worker.
|
|
16
|
+
*/
|
|
17
|
+
interface PendingOAuthFlow {
|
|
18
|
+
/** code_verifier for PKCE. */
|
|
19
|
+
codeVerifier: string;
|
|
20
|
+
/** Opaque-state value also returned in the OAuth redirect. */
|
|
21
|
+
state: string;
|
|
22
|
+
/** Project the user is connecting under. */
|
|
23
|
+
projectId: string;
|
|
24
|
+
/** Connector kind (e.g. 'google-calendar'). */
|
|
25
|
+
kind: string;
|
|
26
|
+
/** Operator-supplied label that becomes DataSource.label. */
|
|
27
|
+
label: string;
|
|
28
|
+
/** When we drop the entry. */
|
|
29
|
+
expiresAt: number;
|
|
30
|
+
/** The redirectUri we used in the start step — must match exactly on
|
|
31
|
+
* the callback exchange. */
|
|
32
|
+
redirectUri: string;
|
|
33
|
+
}
|
|
34
|
+
interface OAuthFlowStore {
|
|
35
|
+
put(state: string, flow: PendingOAuthFlow): Promise<void> | void;
|
|
36
|
+
consume(state: string): Promise<PendingOAuthFlow | undefined> | PendingOAuthFlow | undefined;
|
|
37
|
+
sweep?(now: number): Promise<void> | void;
|
|
38
|
+
clear?(): Promise<void> | void;
|
|
39
|
+
}
|
|
40
|
+
declare class InMemoryOAuthFlowStore implements OAuthFlowStore {
|
|
41
|
+
private readonly pendingFlows;
|
|
42
|
+
put(state: string, flow: PendingOAuthFlow): void;
|
|
43
|
+
consume(state: string): PendingOAuthFlow | undefined;
|
|
44
|
+
sweep(now: number): void;
|
|
45
|
+
clear(): void;
|
|
46
|
+
}
|
|
47
|
+
interface StartOAuthInput {
|
|
48
|
+
projectId: string;
|
|
49
|
+
kind: string;
|
|
50
|
+
label: string;
|
|
51
|
+
authorizationUrl: string;
|
|
52
|
+
scopes: string[];
|
|
53
|
+
clientId: string;
|
|
54
|
+
redirectUri: string;
|
|
55
|
+
/** Optional extra query params; Google needs `access_type=offline` and
|
|
56
|
+
* `prompt=consent` to issue refresh tokens reliably. */
|
|
57
|
+
extraAuthParams?: Record<string, string>;
|
|
58
|
+
/** Optional flow store. Use a durable store in distributed production
|
|
59
|
+
* runtimes; omitted means local in-memory storage. */
|
|
60
|
+
store?: OAuthFlowStore;
|
|
61
|
+
/** Override clock for tests. */
|
|
62
|
+
now?: number;
|
|
63
|
+
}
|
|
64
|
+
interface StartOAuthOutput {
|
|
65
|
+
/** URL the SPA should redirect the user to. */
|
|
66
|
+
authorizationUrl: string;
|
|
67
|
+
/** State token — caller stashes this in localStorage to verify on
|
|
68
|
+
* callback. */
|
|
69
|
+
state: string;
|
|
70
|
+
}
|
|
71
|
+
/** Build the authorization URL + state. SPA navigates the user there;
|
|
72
|
+
* user consents; provider redirects back to redirectUri with `code` +
|
|
73
|
+
* `state`. The caller's callback then invokes `consumePendingFlow`. */
|
|
74
|
+
declare function startOAuthFlow(input: StartOAuthInput): StartOAuthOutput;
|
|
75
|
+
/** Look up + remove the pending flow record. Throws if state is unknown
|
|
76
|
+
* or expired (CSRF guard / replay protection). */
|
|
77
|
+
declare function consumePendingFlow(state: string, store?: OAuthFlowStore): Promise<PendingOAuthFlow>;
|
|
78
|
+
interface ExchangeCodeInput {
|
|
79
|
+
tokenUrl: string;
|
|
80
|
+
clientId: string;
|
|
81
|
+
clientSecret: string;
|
|
82
|
+
code: string;
|
|
83
|
+
codeVerifier: string;
|
|
84
|
+
redirectUri: string;
|
|
85
|
+
fetchImpl?: typeof fetch;
|
|
86
|
+
signal?: AbortSignal;
|
|
87
|
+
}
|
|
88
|
+
interface OAuthTokens {
|
|
89
|
+
accessToken: string;
|
|
90
|
+
refreshToken?: string;
|
|
91
|
+
expiresIn?: number;
|
|
92
|
+
scope?: string;
|
|
93
|
+
tokenType?: string;
|
|
94
|
+
}
|
|
95
|
+
/** POST authorization code → token endpoint. Provider-agnostic; if a
|
|
96
|
+
* provider returns a non-standard JSON shape, the adapter wraps this
|
|
97
|
+
* call rather than reaching into the helper. */
|
|
98
|
+
declare function exchangeAuthorizationCode(input: ExchangeCodeInput): Promise<OAuthTokens>;
|
|
99
|
+
interface RefreshInput {
|
|
100
|
+
tokenUrl: string;
|
|
101
|
+
clientId: string;
|
|
102
|
+
clientSecret: string;
|
|
103
|
+
refreshToken: string;
|
|
104
|
+
fetchImpl?: typeof fetch;
|
|
105
|
+
signal?: AbortSignal;
|
|
106
|
+
}
|
|
107
|
+
/** Refresh an access token. Returns the new tokens — the connector layer
|
|
108
|
+
* is responsible for re-encrypting + persisting the envelope. */
|
|
109
|
+
declare function refreshAccessToken(input: RefreshInput): Promise<OAuthTokens>;
|
|
110
|
+
/** Test-only — drop pending flows between unit-test runs. */
|
|
111
|
+
declare function _resetPendingFlowsForTests(): void;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Inbound webhook signature verifiers — provider-specific HMAC schemes.
|
|
115
|
+
*
|
|
116
|
+
* Each signature scheme is a pure function:
|
|
117
|
+
* (rawBody: string, headers, secret, now?) → boolean
|
|
118
|
+
*
|
|
119
|
+
* Constant-time comparison via `crypto.timingSafeEqual`. Timestamps are
|
|
120
|
+
* checked against a configurable tolerance to bound replay risk; the default
|
|
121
|
+
* mirrors the upstream provider's documented window (Stripe: 5 min, Slack: 5 min).
|
|
122
|
+
*
|
|
123
|
+
* These verifiers are the building blocks for any inbound-webhook receiver
|
|
124
|
+
* (a route + a `verify` call + a per-event handler). They live in this
|
|
125
|
+
* package so every consumer of the integration substrate gets correct
|
|
126
|
+
* verification — not just one product reimplementing it.
|
|
127
|
+
*/
|
|
128
|
+
/** Default replay-protection window. Providers commonly use 5 minutes. */
|
|
129
|
+
declare const DEFAULT_SIGNATURE_TOLERANCE_SECONDS: number;
|
|
130
|
+
interface ParsedStripeSignatureHeader {
|
|
131
|
+
t: number;
|
|
132
|
+
sigs: string[];
|
|
133
|
+
}
|
|
134
|
+
declare function parseStripeSignatureHeader(header: string): ParsedStripeSignatureHeader | null;
|
|
135
|
+
interface StripeVerifyOptions {
|
|
136
|
+
/** Replay-protection window in seconds. Default 300. */
|
|
137
|
+
toleranceSeconds?: number;
|
|
138
|
+
/** Override `now()` for tests. UTC seconds. */
|
|
139
|
+
now?: number;
|
|
140
|
+
}
|
|
141
|
+
/** Verify a Stripe webhook signature against the raw request body. */
|
|
142
|
+
declare function verifyStripeSignature(rawBody: string, signatureHeader: string, secret: string, options?: StripeVerifyOptions): boolean;
|
|
143
|
+
interface SlackVerifyOptions {
|
|
144
|
+
toleranceSeconds?: number;
|
|
145
|
+
now?: number;
|
|
146
|
+
}
|
|
147
|
+
declare function verifySlackSignature(rawBody: string, signatureHeader: string, timestampHeader: string, secret: string, options?: SlackVerifyOptions): boolean;
|
|
148
|
+
interface GenericHmacVerifyOptions {
|
|
149
|
+
/** sha256 (default) | sha1 | sha512 — matches the algorithm the receiver
|
|
150
|
+
* computed at sign time. */
|
|
151
|
+
algorithm?: 'sha256' | 'sha1' | 'sha512';
|
|
152
|
+
/** Optional prefix the receiver prepends to the signature in the header
|
|
153
|
+
* (e.g., `'sha256='`). Stripped before constant-time comparison. */
|
|
154
|
+
signaturePrefix?: string;
|
|
155
|
+
/** Lowercase comparison (most providers emit hex-lowercase). Default true. */
|
|
156
|
+
lowercaseHex?: boolean;
|
|
157
|
+
}
|
|
158
|
+
declare function verifyHmacSignature(rawBody: string, signatureHeader: string, secret: string, options?: GenericHmacVerifyOptions): boolean;
|
|
159
|
+
interface TwilioVerifyOptions {
|
|
160
|
+
/** Skip verification when the auth token isn't configured. Useful in
|
|
161
|
+
* dev where the receiver wants to accept any payload. Default `false`
|
|
162
|
+
* — production should always require a configured token. */
|
|
163
|
+
skipWhenAuthTokenMissing?: boolean;
|
|
164
|
+
/** When true, sign the raw body instead of the URL-encoded sorted-params
|
|
165
|
+
* reduction. Twilio uses raw-body signing for `application/json`
|
|
166
|
+
* webhook bodies. Default `false`. */
|
|
167
|
+
bodyAsRaw?: boolean;
|
|
168
|
+
/** When `bodyAsRaw` is true, the raw body to sign. Ignored otherwise. */
|
|
169
|
+
rawBody?: string;
|
|
170
|
+
}
|
|
171
|
+
/** Verify a Twilio webhook signature. */
|
|
172
|
+
declare function verifyTwilioSignature(input: {
|
|
173
|
+
authToken: string | null | undefined;
|
|
174
|
+
signatureHeader: string | string[] | undefined;
|
|
175
|
+
fullUrl: string | null | undefined;
|
|
176
|
+
params: Record<string, string> | undefined;
|
|
177
|
+
}, options?: TwilioVerifyOptions): boolean;
|
|
178
|
+
declare function firstHeader(headers: Record<string, string | string[] | undefined>, name: string): string | undefined;
|
|
179
|
+
|
|
180
|
+
export { DEFAULT_SIGNATURE_TOLERANCE_SECONDS, type ExchangeCodeInput, type GenericHmacVerifyOptions, InMemoryOAuthFlowStore, type OAuthFlowStore, type OAuthTokens, type ParsedStripeSignatureHeader, type PendingOAuthFlow, type RefreshInput, type SlackVerifyOptions, type StartOAuthInput, type StartOAuthOutput, type StripeVerifyOptions, type TwilioVerifyOptions, _resetPendingFlowsForTests, consumePendingFlow, exchangeAuthorizationCode, firstHeader, parseStripeSignatureHeader, refreshAccessToken, startOAuthFlow, verifyHmacSignature, verifySlackSignature, verifyStripeSignature, verifyTwilioSignature };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import "../chunk-376UBTNB.js";
|
|
2
|
+
import {
|
|
3
|
+
CredentialsExpired,
|
|
4
|
+
DEFAULT_SIGNATURE_TOLERANCE_SECONDS,
|
|
5
|
+
InMemoryOAuthFlowStore,
|
|
6
|
+
ResourceContention,
|
|
7
|
+
_resetPendingFlowsForTests,
|
|
8
|
+
airtableConnector,
|
|
9
|
+
asanaConnector,
|
|
10
|
+
assertValidConnectorManifest,
|
|
11
|
+
consumePendingFlow,
|
|
12
|
+
declarativeRestConnector,
|
|
13
|
+
exchangeAuthorizationCode,
|
|
14
|
+
firstHeader,
|
|
15
|
+
githubConnector,
|
|
16
|
+
gitlabConnector,
|
|
17
|
+
googleCalendar,
|
|
18
|
+
googleSheets,
|
|
19
|
+
hubspot,
|
|
20
|
+
microsoftCalendar,
|
|
21
|
+
notionDatabase,
|
|
22
|
+
parseStripeSignatureHeader,
|
|
23
|
+
refreshAccessToken,
|
|
24
|
+
salesforceConnector,
|
|
25
|
+
slack,
|
|
26
|
+
slackEventsConnector,
|
|
27
|
+
startOAuthFlow,
|
|
28
|
+
stripePackConnector,
|
|
29
|
+
stripeWebhookReceiverConnector,
|
|
30
|
+
twilioSmsConnector,
|
|
31
|
+
validateConnectorManifest,
|
|
32
|
+
verifyHmacSignature,
|
|
33
|
+
verifySlackSignature,
|
|
34
|
+
verifyStripeSignature,
|
|
35
|
+
verifyTwilioSignature,
|
|
36
|
+
webhookConnector
|
|
37
|
+
} from "../chunk-IDX3KIPA.js";
|
|
38
|
+
export {
|
|
39
|
+
CredentialsExpired,
|
|
40
|
+
DEFAULT_SIGNATURE_TOLERANCE_SECONDS,
|
|
41
|
+
InMemoryOAuthFlowStore,
|
|
42
|
+
ResourceContention,
|
|
43
|
+
_resetPendingFlowsForTests,
|
|
44
|
+
airtableConnector,
|
|
45
|
+
asanaConnector,
|
|
46
|
+
assertValidConnectorManifest,
|
|
47
|
+
consumePendingFlow,
|
|
48
|
+
declarativeRestConnector,
|
|
49
|
+
exchangeAuthorizationCode,
|
|
50
|
+
firstHeader,
|
|
51
|
+
githubConnector,
|
|
52
|
+
gitlabConnector,
|
|
53
|
+
googleCalendar,
|
|
54
|
+
googleSheets,
|
|
55
|
+
hubspot,
|
|
56
|
+
microsoftCalendar,
|
|
57
|
+
notionDatabase,
|
|
58
|
+
parseStripeSignatureHeader,
|
|
59
|
+
refreshAccessToken,
|
|
60
|
+
salesforceConnector,
|
|
61
|
+
slack,
|
|
62
|
+
slackEventsConnector,
|
|
63
|
+
startOAuthFlow,
|
|
64
|
+
stripePackConnector,
|
|
65
|
+
stripeWebhookReceiverConnector,
|
|
66
|
+
twilioSmsConnector,
|
|
67
|
+
validateConnectorManifest,
|
|
68
|
+
verifyHmacSignature,
|
|
69
|
+
verifySlackSignature,
|
|
70
|
+
verifyStripeSignature,
|
|
71
|
+
verifyTwilioSignature,
|
|
72
|
+
webhookConnector
|
|
73
|
+
};
|
|
74
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|