@contractspec/integration.providers-impls 3.0.0 → 3.1.1
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 +59 -9
- package/dist/impls/async-event-queue.js +2 -0
- package/dist/impls/composio-fallback-resolver.d.ts +34 -0
- package/dist/impls/composio-fallback-resolver.js +580 -0
- package/dist/impls/composio-mcp.d.ts +22 -0
- package/dist/impls/composio-mcp.js +164 -0
- package/dist/impls/composio-proxies.d.ts +60 -0
- package/dist/impls/composio-proxies.js +311 -0
- package/dist/impls/composio-sdk.d.ts +25 -0
- package/dist/impls/composio-sdk.js +78 -0
- package/dist/impls/composio-types.d.ts +43 -0
- package/dist/impls/composio-types.js +54 -0
- package/dist/impls/elevenlabs-voice.js +2 -0
- package/dist/impls/fal-voice.js +2 -0
- package/dist/impls/fathom-meeting-recorder.js +2 -0
- package/dist/impls/fathom-meeting-recorder.mapper.js +2 -0
- package/dist/impls/fathom-meeting-recorder.utils.js +2 -0
- package/dist/impls/fathom-meeting-recorder.webhooks.js +2 -0
- package/dist/impls/fireflies-meeting-recorder.js +2 -0
- package/dist/impls/fireflies-meeting-recorder.queries.js +2 -0
- package/dist/impls/fireflies-meeting-recorder.utils.js +2 -0
- package/dist/impls/gcs-storage.js +2 -0
- package/dist/impls/gmail-inbound.js +2 -0
- package/dist/impls/gmail-outbound.js +2 -0
- package/dist/impls/google-calendar.js +2 -0
- package/dist/impls/gradium-voice.js +2 -0
- package/dist/impls/granola-meeting-recorder.js +2 -0
- package/dist/impls/granola-meeting-recorder.mcp.js +2 -0
- package/dist/impls/health/base-health-provider.js +2 -0
- package/dist/impls/health/hybrid-health-providers.js +2 -0
- package/dist/impls/health/official-health-providers.js +2 -0
- package/dist/impls/health/provider-normalizers.js +2 -0
- package/dist/impls/health/providers.js +2 -0
- package/dist/impls/health-provider-factory.js +2 -0
- package/dist/impls/index.d.ts +5 -0
- package/dist/impls/index.js +657 -0
- package/dist/impls/jira.js +2 -0
- package/dist/impls/linear.js +2 -0
- package/dist/impls/messaging-github.js +2 -0
- package/dist/impls/messaging-slack.js +2 -0
- package/dist/impls/messaging-whatsapp-meta.js +2 -0
- package/dist/impls/messaging-whatsapp-twilio.js +2 -0
- package/dist/impls/mistral-conversational.js +2 -0
- package/dist/impls/mistral-conversational.session.js +2 -0
- package/dist/impls/mistral-embedding.js +2 -0
- package/dist/impls/mistral-llm.js +2 -0
- package/dist/impls/mistral-stt.js +2 -0
- package/dist/impls/notion.js +2 -0
- package/dist/impls/posthog-reader.js +2 -0
- package/dist/impls/posthog-utils.js +2 -0
- package/dist/impls/posthog.js +2 -0
- package/dist/impls/postmark-email.js +2 -0
- package/dist/impls/powens-client.js +2 -0
- package/dist/impls/powens-openbanking.js +2 -0
- package/dist/impls/provider-factory.d.ts +24 -0
- package/dist/impls/provider-factory.js +70 -0
- package/dist/impls/qdrant-vector.js +2 -0
- package/dist/impls/stripe-payments.js +2 -0
- package/dist/impls/supabase-psql.js +2 -0
- package/dist/impls/supabase-vector.js +2 -0
- package/dist/impls/tldv-meeting-recorder.js +2 -0
- package/dist/impls/twilio-sms.js +2 -0
- package/dist/index.js +657 -0
- package/dist/node/impls/async-event-queue.js +3 -0
- package/dist/node/impls/composio-fallback-resolver.js +580 -0
- package/dist/node/impls/composio-mcp.js +164 -0
- package/dist/node/impls/composio-proxies.js +311 -0
- package/dist/node/impls/composio-sdk.js +78 -0
- package/dist/node/impls/composio-types.js +54 -0
- package/dist/node/impls/elevenlabs-voice.js +3 -0
- package/dist/node/impls/fal-voice.js +3 -0
- package/dist/node/impls/fathom-meeting-recorder.js +3 -0
- package/dist/node/impls/fathom-meeting-recorder.mapper.js +3 -0
- package/dist/node/impls/fathom-meeting-recorder.utils.js +3 -0
- package/dist/node/impls/fathom-meeting-recorder.webhooks.js +3 -0
- package/dist/node/impls/fireflies-meeting-recorder.js +3 -0
- package/dist/node/impls/fireflies-meeting-recorder.queries.js +3 -0
- package/dist/node/impls/fireflies-meeting-recorder.utils.js +3 -0
- package/dist/node/impls/gcs-storage.js +3 -0
- package/dist/node/impls/gmail-inbound.js +3 -0
- package/dist/node/impls/gmail-outbound.js +3 -0
- package/dist/node/impls/google-calendar.js +3 -0
- package/dist/node/impls/gradium-voice.js +3 -0
- package/dist/node/impls/granola-meeting-recorder.js +3 -0
- package/dist/node/impls/granola-meeting-recorder.mcp.js +3 -0
- package/dist/node/impls/health/base-health-provider.js +3 -0
- package/dist/node/impls/health/hybrid-health-providers.js +3 -0
- package/dist/node/impls/health/official-health-providers.js +3 -0
- package/dist/node/impls/health/provider-normalizers.js +3 -0
- package/dist/node/impls/health/providers.js +3 -0
- package/dist/node/impls/health-provider-factory.js +3 -0
- package/dist/node/impls/index.js +658 -0
- package/dist/node/impls/jira.js +3 -0
- package/dist/node/impls/linear.js +3 -0
- package/dist/node/impls/messaging-github.js +3 -0
- package/dist/node/impls/messaging-slack.js +3 -0
- package/dist/node/impls/messaging-whatsapp-meta.js +3 -0
- package/dist/node/impls/messaging-whatsapp-twilio.js +3 -0
- package/dist/node/impls/mistral-conversational.js +3 -0
- package/dist/node/impls/mistral-conversational.session.js +3 -0
- package/dist/node/impls/mistral-embedding.js +3 -0
- package/dist/node/impls/mistral-llm.js +3 -0
- package/dist/node/impls/mistral-stt.js +3 -0
- package/dist/node/impls/notion.js +3 -0
- package/dist/node/impls/posthog-reader.js +3 -0
- package/dist/node/impls/posthog-utils.js +3 -0
- package/dist/node/impls/posthog.js +3 -0
- package/dist/node/impls/postmark-email.js +3 -0
- package/dist/node/impls/powens-client.js +3 -0
- package/dist/node/impls/powens-openbanking.js +3 -0
- package/dist/node/impls/provider-factory.js +71 -0
- package/dist/node/impls/qdrant-vector.js +3 -0
- package/dist/node/impls/stripe-payments.js +3 -0
- package/dist/node/impls/supabase-psql.js +3 -0
- package/dist/node/impls/supabase-vector.js +3 -0
- package/dist/node/impls/tldv-meeting-recorder.js +3 -0
- package/dist/node/impls/twilio-sms.js +3 -0
- package/dist/node/index.js +658 -0
- package/dist/node/secrets/provider.js +3 -0
- package/dist/secrets/provider.js +2 -0
- package/package.json +71 -10
package/dist/impls/jira.js
CHANGED
package/dist/impls/linear.js
CHANGED
package/dist/impls/notion.js
CHANGED
package/dist/impls/posthog.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { IntegrationContext } from '@contractspec/integration.runtime/runtime';
|
|
2
|
+
import type { IntegrationTransportType } from '@contractspec/lib.contracts-integrations/integrations/transport';
|
|
3
|
+
import type { IntegrationAuthType } from '@contractspec/lib.contracts-integrations/integrations/auth';
|
|
2
4
|
import type { PaymentsProvider } from '../payments';
|
|
3
5
|
import type { EmailOutboundProvider } from '../email';
|
|
4
6
|
import type { SmsProvider } from '../sms';
|
|
@@ -14,7 +16,29 @@ import type { OpenBankingProvider } from '../openbanking';
|
|
|
14
16
|
import type { ProjectManagementProvider } from '../project-management';
|
|
15
17
|
import type { MeetingRecorderProvider } from '../meeting-recorder';
|
|
16
18
|
import type { HealthProvider } from '../health';
|
|
19
|
+
import type { ComposioFallbackResolver } from './composio-fallback-resolver';
|
|
20
|
+
/**
|
|
21
|
+
* Resolved transport, auth, and version context for a provider invocation.
|
|
22
|
+
*/
|
|
23
|
+
export interface ResolvedProviderContext {
|
|
24
|
+
transport: IntegrationTransportType;
|
|
25
|
+
authMethod: IntegrationAuthType | undefined;
|
|
26
|
+
apiVersion: string | undefined;
|
|
27
|
+
/** Pre-built auth headers from the resolved auth method and secrets. */
|
|
28
|
+
authHeaders: Record<string, string>;
|
|
29
|
+
secrets: Record<string, unknown>;
|
|
30
|
+
}
|
|
17
31
|
export declare class IntegrationProviderFactory {
|
|
32
|
+
private readonly composioFallback?;
|
|
33
|
+
constructor(options?: {
|
|
34
|
+
composioFallback?: ComposioFallbackResolver;
|
|
35
|
+
});
|
|
36
|
+
/**
|
|
37
|
+
* Resolve transport, auth method, API version, and build auth headers
|
|
38
|
+
* for a given integration context. Consumers can call this directly
|
|
39
|
+
* for custom wiring or it is used internally by the create* methods.
|
|
40
|
+
*/
|
|
41
|
+
resolveProviderContext(context: IntegrationContext): Promise<ResolvedProviderContext>;
|
|
18
42
|
createPaymentsProvider(context: IntegrationContext): Promise<PaymentsProvider>;
|
|
19
43
|
createEmailOutboundProvider(context: IntegrationContext): Promise<EmailOutboundProvider>;
|
|
20
44
|
createSmsProvider(context: IntegrationContext): Promise<SmsProvider>;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
// @bun
|
|
2
|
+
var __require = import.meta.require;
|
|
3
|
+
|
|
2
4
|
// src/impls/async-event-queue.ts
|
|
3
5
|
class AsyncEventQueue {
|
|
4
6
|
values = [];
|
|
@@ -5857,9 +5859,29 @@ async function safeReadError4(response) {
|
|
|
5857
5859
|
|
|
5858
5860
|
// src/impls/provider-factory.ts
|
|
5859
5861
|
import { Buffer as Buffer6 } from "buffer";
|
|
5862
|
+
import { resolveIntegrationRequestContext } from "@contractspec/lib.contracts-integrations/integrations/runtime";
|
|
5863
|
+
import { buildAuthHeaders } from "@contractspec/lib.contracts-integrations/integrations/auth-helpers";
|
|
5864
|
+
import { findAuthConfig } from "@contractspec/lib.contracts-integrations/integrations/auth";
|
|
5860
5865
|
var SECRET_CACHE = new Map;
|
|
5861
5866
|
|
|
5862
5867
|
class IntegrationProviderFactory {
|
|
5868
|
+
composioFallback;
|
|
5869
|
+
constructor(options) {
|
|
5870
|
+
this.composioFallback = options?.composioFallback;
|
|
5871
|
+
}
|
|
5872
|
+
async resolveProviderContext(context) {
|
|
5873
|
+
const secrets = await this.loadSecrets(context);
|
|
5874
|
+
const { transport, authMethod, apiVersion } = resolveIntegrationRequestContext(context.spec, context.connection);
|
|
5875
|
+
let authHeaders = {};
|
|
5876
|
+
if (authMethod && context.spec.supportedAuthMethods) {
|
|
5877
|
+
const authConfig = findAuthConfig(context.spec.supportedAuthMethods, authMethod);
|
|
5878
|
+
if (authConfig) {
|
|
5879
|
+
const stringSecrets = Object.fromEntries(Object.entries(secrets).filter(([, v]) => typeof v === "string").map(([k, v]) => [k, v]));
|
|
5880
|
+
authHeaders = buildAuthHeaders(authConfig, stringSecrets);
|
|
5881
|
+
}
|
|
5882
|
+
}
|
|
5883
|
+
return { transport, authMethod, apiVersion, authHeaders, secrets };
|
|
5884
|
+
}
|
|
5863
5885
|
async createPaymentsProvider(context) {
|
|
5864
5886
|
const secrets = await this.loadSecrets(context);
|
|
5865
5887
|
switch (context.spec.meta.key) {
|
|
@@ -5868,6 +5890,9 @@ class IntegrationProviderFactory {
|
|
|
5868
5890
|
apiKey: requireSecret(secrets, "apiKey", "Stripe API key is required")
|
|
5869
5891
|
});
|
|
5870
5892
|
default:
|
|
5893
|
+
if (this.composioFallback?.canHandle(context.spec.meta.key)) {
|
|
5894
|
+
return this.composioFallback.createPaymentsProxy(context);
|
|
5895
|
+
}
|
|
5871
5896
|
throw new Error(`Unsupported payments integration: ${context.spec.meta.key}`);
|
|
5872
5897
|
}
|
|
5873
5898
|
}
|
|
@@ -5881,6 +5906,9 @@ class IntegrationProviderFactory {
|
|
|
5881
5906
|
messageStream: context.config.messageStream
|
|
5882
5907
|
});
|
|
5883
5908
|
default:
|
|
5909
|
+
if (this.composioFallback?.canHandle(context.spec.meta.key)) {
|
|
5910
|
+
return this.composioFallback.createEmailProxy(context);
|
|
5911
|
+
}
|
|
5884
5912
|
throw new Error(`Unsupported email integration: ${context.spec.meta.key}`);
|
|
5885
5913
|
}
|
|
5886
5914
|
}
|
|
@@ -5894,6 +5922,9 @@ class IntegrationProviderFactory {
|
|
|
5894
5922
|
fromNumber: context.config.fromNumber
|
|
5895
5923
|
});
|
|
5896
5924
|
default:
|
|
5925
|
+
if (this.composioFallback?.canHandle(context.spec.meta.key)) {
|
|
5926
|
+
return this.composioFallback.createMessagingProxy(context);
|
|
5927
|
+
}
|
|
5897
5928
|
throw new Error(`Unsupported SMS integration: ${context.spec.meta.key}`);
|
|
5898
5929
|
}
|
|
5899
5930
|
}
|
|
@@ -5927,6 +5958,9 @@ class IntegrationProviderFactory {
|
|
|
5927
5958
|
fromNumber: config?.fromNumber
|
|
5928
5959
|
});
|
|
5929
5960
|
default:
|
|
5961
|
+
if (this.composioFallback?.canHandle(context.spec.meta.key)) {
|
|
5962
|
+
return this.composioFallback.createMessagingProxy(context);
|
|
5963
|
+
}
|
|
5930
5964
|
throw new Error(`Unsupported messaging integration: ${context.spec.meta.key}`);
|
|
5931
5965
|
}
|
|
5932
5966
|
}
|
|
@@ -5950,6 +5984,9 @@ class IntegrationProviderFactory {
|
|
|
5950
5984
|
sslMode: config?.sslMode
|
|
5951
5985
|
});
|
|
5952
5986
|
default:
|
|
5987
|
+
if (this.composioFallback?.canHandle(context.spec.meta.key)) {
|
|
5988
|
+
return this.composioFallback.createGenericProxy(context);
|
|
5989
|
+
}
|
|
5953
5990
|
throw new Error(`Unsupported vector store integration: ${context.spec.meta.key}`);
|
|
5954
5991
|
}
|
|
5955
5992
|
}
|
|
@@ -5966,6 +6003,9 @@ class IntegrationProviderFactory {
|
|
|
5966
6003
|
personalApiKey: requireSecret(secrets, "personalApiKey", "PostHog personalApiKey is required")
|
|
5967
6004
|
});
|
|
5968
6005
|
default:
|
|
6006
|
+
if (this.composioFallback?.canHandle(context.spec.meta.key)) {
|
|
6007
|
+
return this.composioFallback.createGenericProxy(context);
|
|
6008
|
+
}
|
|
5969
6009
|
throw new Error(`Unsupported analytics integration: ${context.spec.meta.key}`);
|
|
5970
6010
|
}
|
|
5971
6011
|
}
|
|
@@ -5980,6 +6020,9 @@ class IntegrationProviderFactory {
|
|
|
5980
6020
|
sslMode: config?.sslMode
|
|
5981
6021
|
});
|
|
5982
6022
|
default:
|
|
6023
|
+
if (this.composioFallback?.canHandle(context.spec.meta.key)) {
|
|
6024
|
+
return this.composioFallback.createGenericProxy(context);
|
|
6025
|
+
}
|
|
5983
6026
|
throw new Error(`Unsupported database integration: ${context.spec.meta.key}`);
|
|
5984
6027
|
}
|
|
5985
6028
|
}
|
|
@@ -5993,6 +6036,9 @@ class IntegrationProviderFactory {
|
|
|
5993
6036
|
clientOptions: secrets.type === "service_account" ? { credentials: secrets } : undefined
|
|
5994
6037
|
});
|
|
5995
6038
|
default:
|
|
6039
|
+
if (this.composioFallback?.canHandle(context.spec.meta.key)) {
|
|
6040
|
+
return this.composioFallback.createGenericProxy(context);
|
|
6041
|
+
}
|
|
5996
6042
|
throw new Error(`Unsupported storage integration: ${context.spec.meta.key}`);
|
|
5997
6043
|
}
|
|
5998
6044
|
}
|
|
@@ -6025,6 +6071,9 @@ class IntegrationProviderFactory {
|
|
|
6025
6071
|
pollIntervalMs: config?.pollIntervalMs
|
|
6026
6072
|
});
|
|
6027
6073
|
default:
|
|
6074
|
+
if (this.composioFallback?.canHandle(context.spec.meta.key)) {
|
|
6075
|
+
return this.composioFallback.createGenericProxy(context);
|
|
6076
|
+
}
|
|
6028
6077
|
throw new Error(`Unsupported voice integration: ${context.spec.meta.key}`);
|
|
6029
6078
|
}
|
|
6030
6079
|
}
|
|
@@ -6040,6 +6089,9 @@ class IntegrationProviderFactory {
|
|
|
6040
6089
|
serverURL: config?.serverURL
|
|
6041
6090
|
});
|
|
6042
6091
|
default:
|
|
6092
|
+
if (this.composioFallback?.canHandle(context.spec.meta.key)) {
|
|
6093
|
+
return this.composioFallback.createGenericProxy(context);
|
|
6094
|
+
}
|
|
6043
6095
|
throw new Error(`Unsupported STT integration: ${context.spec.meta.key}`);
|
|
6044
6096
|
}
|
|
6045
6097
|
}
|
|
@@ -6060,6 +6112,9 @@ class IntegrationProviderFactory {
|
|
|
6060
6112
|
}
|
|
6061
6113
|
});
|
|
6062
6114
|
default:
|
|
6115
|
+
if (this.composioFallback?.canHandle(context.spec.meta.key)) {
|
|
6116
|
+
return this.composioFallback.createGenericProxy(context);
|
|
6117
|
+
}
|
|
6063
6118
|
throw new Error(`Unsupported conversational integration: ${context.spec.meta.key}`);
|
|
6064
6119
|
}
|
|
6065
6120
|
}
|
|
@@ -6100,6 +6155,9 @@ class IntegrationProviderFactory {
|
|
|
6100
6155
|
descriptionProperty: config?.descriptionProperty
|
|
6101
6156
|
});
|
|
6102
6157
|
default:
|
|
6158
|
+
if (this.composioFallback?.canHandle(context.spec.meta.key)) {
|
|
6159
|
+
return this.composioFallback.createProjectManagementProxy(context);
|
|
6160
|
+
}
|
|
6103
6161
|
throw new Error(`Unsupported project management integration: ${context.spec.meta.key}`);
|
|
6104
6162
|
}
|
|
6105
6163
|
}
|
|
@@ -6148,6 +6206,9 @@ class IntegrationProviderFactory {
|
|
|
6148
6206
|
webhookSecret: secrets.webhookSecret
|
|
6149
6207
|
});
|
|
6150
6208
|
default:
|
|
6209
|
+
if (this.composioFallback?.canHandle(context.spec.meta.key)) {
|
|
6210
|
+
return this.composioFallback.createGenericProxy(context);
|
|
6211
|
+
}
|
|
6151
6212
|
throw new Error(`Unsupported meeting recorder integration: ${context.spec.meta.key}`);
|
|
6152
6213
|
}
|
|
6153
6214
|
}
|
|
@@ -6160,6 +6221,9 @@ class IntegrationProviderFactory {
|
|
|
6160
6221
|
defaultModel: context.config.model
|
|
6161
6222
|
});
|
|
6162
6223
|
default:
|
|
6224
|
+
if (this.composioFallback?.canHandle(context.spec.meta.key)) {
|
|
6225
|
+
return this.composioFallback.createGenericProxy(context);
|
|
6226
|
+
}
|
|
6163
6227
|
throw new Error(`Unsupported LLM integration: ${context.spec.meta.key}`);
|
|
6164
6228
|
}
|
|
6165
6229
|
}
|
|
@@ -6172,6 +6236,9 @@ class IntegrationProviderFactory {
|
|
|
6172
6236
|
defaultModel: context.config.embeddingModel
|
|
6173
6237
|
});
|
|
6174
6238
|
default:
|
|
6239
|
+
if (this.composioFallback?.canHandle(context.spec.meta.key)) {
|
|
6240
|
+
return this.composioFallback.createGenericProxy(context);
|
|
6241
|
+
}
|
|
6175
6242
|
throw new Error(`Unsupported embeddings integration: ${context.spec.meta.key}`);
|
|
6176
6243
|
}
|
|
6177
6244
|
}
|
|
@@ -6193,6 +6260,9 @@ class IntegrationProviderFactory {
|
|
|
6193
6260
|
});
|
|
6194
6261
|
}
|
|
6195
6262
|
default:
|
|
6263
|
+
if (this.composioFallback?.canHandle(context.spec.meta.key)) {
|
|
6264
|
+
return this.composioFallback.createGenericProxy(context);
|
|
6265
|
+
}
|
|
6196
6266
|
throw new Error(`Unsupported open banking integration: ${context.spec.meta.key}`);
|
|
6197
6267
|
}
|
|
6198
6268
|
}
|