@contractspec/integration.providers-impls 2.10.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 +66 -10
- package/dist/impls/async-event-queue.d.ts +8 -0
- package/dist/impls/async-event-queue.js +49 -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.d.ts +64 -13
- package/dist/impls/health/base-health-provider.js +508 -156
- package/dist/impls/health/hybrid-health-providers.d.ts +34 -0
- package/dist/impls/health/hybrid-health-providers.js +1090 -0
- package/dist/impls/health/official-health-providers.d.ts +78 -0
- package/dist/impls/health/official-health-providers.js +970 -0
- package/dist/impls/health/provider-normalizers.d.ts +28 -0
- package/dist/impls/health/provider-normalizers.js +289 -0
- package/dist/impls/health/providers.d.ts +2 -39
- package/dist/impls/health/providers.js +897 -184
- package/dist/impls/health-provider-factory.js +1011 -196
- package/dist/impls/index.d.ts +11 -0
- package/dist/impls/index.js +2588 -259
- package/dist/impls/jira.js +2 -0
- package/dist/impls/linear.js +2 -0
- package/dist/impls/messaging-github.d.ts +17 -0
- package/dist/impls/messaging-github.js +112 -0
- package/dist/impls/messaging-slack.d.ts +14 -0
- package/dist/impls/messaging-slack.js +82 -0
- package/dist/impls/messaging-whatsapp-meta.d.ts +13 -0
- package/dist/impls/messaging-whatsapp-meta.js +54 -0
- package/dist/impls/messaging-whatsapp-twilio.d.ts +13 -0
- package/dist/impls/messaging-whatsapp-twilio.js +84 -0
- package/dist/impls/mistral-conversational.d.ts +23 -0
- package/dist/impls/mistral-conversational.js +478 -0
- package/dist/impls/mistral-conversational.session.d.ts +32 -0
- package/dist/impls/mistral-conversational.session.js +208 -0
- package/dist/impls/mistral-embedding.js +2 -0
- package/dist/impls/mistral-llm.js +2 -0
- package/dist/impls/mistral-stt.d.ts +17 -0
- package/dist/impls/mistral-stt.js +169 -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 +29 -1
- package/dist/impls/provider-factory.js +1985 -249
- package/dist/impls/qdrant-vector.js +2 -0
- package/dist/impls/stripe-payments.js +3 -1
- 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.d.ts +1 -0
- package/dist/index.js +2615 -283
- package/dist/messaging.d.ts +1 -0
- package/dist/messaging.js +3 -0
- package/dist/node/impls/async-event-queue.js +49 -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 +509 -156
- package/dist/node/impls/health/hybrid-health-providers.js +1090 -0
- package/dist/node/impls/health/official-health-providers.js +970 -0
- package/dist/node/impls/health/provider-normalizers.js +289 -0
- package/dist/node/impls/health/providers.js +898 -184
- package/dist/node/impls/health-provider-factory.js +1012 -196
- package/dist/node/impls/index.js +2589 -259
- package/dist/node/impls/jira.js +3 -0
- package/dist/node/impls/linear.js +3 -0
- package/dist/node/impls/messaging-github.js +112 -0
- package/dist/node/impls/messaging-slack.js +82 -0
- package/dist/node/impls/messaging-whatsapp-meta.js +54 -0
- package/dist/node/impls/messaging-whatsapp-twilio.js +84 -0
- package/dist/node/impls/mistral-conversational.js +478 -0
- package/dist/node/impls/mistral-conversational.session.js +208 -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 +169 -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 +1986 -249
- package/dist/node/impls/qdrant-vector.js +3 -0
- package/dist/node/impls/stripe-payments.js +4 -1
- 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 +2616 -283
- package/dist/node/messaging.js +2 -0
- package/dist/node/secrets/provider.js +3 -0
- package/dist/secrets/provider.js +2 -0
- package/package.json +219 -14
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
var __require = import.meta.require;
|
|
3
|
+
|
|
4
|
+
// src/impls/composio-types.ts
|
|
5
|
+
var INTEGRATION_KEY_TO_TOOLKIT = {
|
|
6
|
+
payments: "stripe",
|
|
7
|
+
email: "gmail",
|
|
8
|
+
calendar: "googlecalendar",
|
|
9
|
+
sms: "twilio",
|
|
10
|
+
"messaging.slack": "slack",
|
|
11
|
+
"messaging.github": "github",
|
|
12
|
+
"messaging.discord": "discord",
|
|
13
|
+
"messaging.teams": "microsoft_teams",
|
|
14
|
+
"analytics.posthog": "posthog",
|
|
15
|
+
"project-management.linear": "linear",
|
|
16
|
+
"project-management.jira": "jira",
|
|
17
|
+
"project-management.notion": "notion",
|
|
18
|
+
"project-management.asana": "asana",
|
|
19
|
+
"project-management.trello": "trello",
|
|
20
|
+
"project-management.monday": "monday",
|
|
21
|
+
"storage.s3": "aws",
|
|
22
|
+
"storage.gcs": "google_cloud",
|
|
23
|
+
"storage.gdrive": "googledrive",
|
|
24
|
+
"storage.dropbox": "dropbox",
|
|
25
|
+
"storage.onedrive": "onedrive",
|
|
26
|
+
"crm.salesforce": "salesforce",
|
|
27
|
+
"crm.hubspot": "hubspot",
|
|
28
|
+
"crm.pipedrive": "pipedrive",
|
|
29
|
+
"database.supabase": "supabase",
|
|
30
|
+
"vectordb.supabase": "supabase",
|
|
31
|
+
"ai-llm": "openai"
|
|
32
|
+
};
|
|
33
|
+
var SESSION_TTL_MS = 30 * 60 * 1000;
|
|
34
|
+
function isSessionExpired(session) {
|
|
35
|
+
return Date.now() - session.createdAt > SESSION_TTL_MS;
|
|
36
|
+
}
|
|
37
|
+
function resolveToolkit(integrationKey) {
|
|
38
|
+
if (INTEGRATION_KEY_TO_TOOLKIT[integrationKey]) {
|
|
39
|
+
return INTEGRATION_KEY_TO_TOOLKIT[integrationKey];
|
|
40
|
+
}
|
|
41
|
+
for (const [prefix, toolkit] of Object.entries(INTEGRATION_KEY_TO_TOOLKIT)) {
|
|
42
|
+
if (integrationKey.startsWith(prefix)) {
|
|
43
|
+
return toolkit;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
const parts = integrationKey.split(".");
|
|
47
|
+
const last = parts[parts.length - 1];
|
|
48
|
+
return parts.length > 1 && last ? last : integrationKey;
|
|
49
|
+
}
|
|
50
|
+
export {
|
|
51
|
+
resolveToolkit,
|
|
52
|
+
isSessionExpired,
|
|
53
|
+
INTEGRATION_KEY_TO_TOOLKIT
|
|
54
|
+
};
|
package/dist/impls/fal-voice.js
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
|
-
import type { HealthConnectionStatus, HealthDataSource, HealthListActivitiesParams, HealthListActivitiesResult, HealthListBiometricsParams, HealthListBiometricsResult, HealthListNutritionParams, HealthListNutritionResult, HealthListSleepParams, HealthListSleepResult, HealthListWorkoutsParams, HealthListWorkoutsResult, HealthProvider, HealthSyncRequest, HealthSyncResult, HealthWebhookEvent, HealthWebhookRequest } from '../../health';
|
|
1
|
+
import type { HealthActivity, HealthBiometric, HealthConnectionStatus, HealthDataSource, HealthListActivitiesParams, HealthListActivitiesResult, HealthListBiometricsParams, HealthListBiometricsResult, HealthListNutritionParams, HealthListNutritionResult, HealthListSleepParams, HealthListSleepResult, HealthListWorkoutsParams, HealthListWorkoutsResult, HealthNutrition, HealthProvider, HealthSleep, HealthSyncRequest, HealthSyncResult, HealthWebhookEvent, HealthWebhookRequest, HealthWorkout } from '../../health';
|
|
2
2
|
import type { HealthTransportStrategy } from '@contractspec/integration.runtime/runtime';
|
|
3
|
+
type UnknownRecord = Record<string, unknown>;
|
|
4
|
+
interface OAuthOptions {
|
|
5
|
+
tokenUrl?: string;
|
|
6
|
+
refreshToken?: string;
|
|
7
|
+
clientId?: string;
|
|
8
|
+
clientSecret?: string;
|
|
9
|
+
tokenExpiresAt?: string;
|
|
10
|
+
}
|
|
3
11
|
export interface BaseHealthProviderOptions {
|
|
4
12
|
providerKey: string;
|
|
5
13
|
transport: HealthTransportStrategy;
|
|
@@ -9,25 +17,51 @@ export interface BaseHealthProviderOptions {
|
|
|
9
17
|
accessToken?: string;
|
|
10
18
|
mcpAccessToken?: string;
|
|
11
19
|
webhookSecret?: string;
|
|
20
|
+
webhookSignatureHeader?: string;
|
|
21
|
+
route?: 'primary' | 'fallback';
|
|
22
|
+
aggregatorKey?: string;
|
|
23
|
+
oauth?: OAuthOptions;
|
|
12
24
|
fetchFn?: typeof fetch;
|
|
13
25
|
}
|
|
26
|
+
interface DatasetFetchConfig<P, T> {
|
|
27
|
+
apiPath?: string;
|
|
28
|
+
mcpTool: string;
|
|
29
|
+
listKeys?: readonly string[];
|
|
30
|
+
method?: 'GET' | 'POST';
|
|
31
|
+
buildQuery?: (params: P) => UnknownRecord;
|
|
32
|
+
buildBody?: (params: P) => UnknownRecord;
|
|
33
|
+
mapItem: (item: UnknownRecord, params: P) => T | undefined;
|
|
34
|
+
}
|
|
35
|
+
interface ConnectionStatusConfig {
|
|
36
|
+
apiPath?: string;
|
|
37
|
+
mcpTool: string;
|
|
38
|
+
}
|
|
39
|
+
export declare class HealthProviderCapabilityError extends Error {
|
|
40
|
+
readonly code = "NOT_SUPPORTED";
|
|
41
|
+
constructor(message: string);
|
|
42
|
+
}
|
|
14
43
|
export declare class BaseHealthProvider implements HealthProvider {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
private readonly apiBaseUrl
|
|
44
|
+
protected readonly providerKey: string;
|
|
45
|
+
protected readonly transport: HealthTransportStrategy;
|
|
46
|
+
private readonly apiBaseUrl?;
|
|
18
47
|
private readonly mcpUrl?;
|
|
19
48
|
private readonly apiKey?;
|
|
20
|
-
private
|
|
49
|
+
private accessToken?;
|
|
50
|
+
private refreshToken?;
|
|
21
51
|
private readonly mcpAccessToken?;
|
|
22
52
|
private readonly webhookSecret?;
|
|
53
|
+
private readonly webhookSignatureHeader;
|
|
54
|
+
private readonly route;
|
|
55
|
+
private readonly aggregatorKey?;
|
|
56
|
+
private readonly oauth;
|
|
23
57
|
private readonly fetchFn;
|
|
24
58
|
private mcpRequestId;
|
|
25
59
|
constructor(options: BaseHealthProviderOptions);
|
|
26
|
-
listActivities(
|
|
27
|
-
listWorkouts(
|
|
28
|
-
listSleep(
|
|
29
|
-
listBiometrics(
|
|
30
|
-
listNutrition(
|
|
60
|
+
listActivities(_params: HealthListActivitiesParams): Promise<HealthListActivitiesResult>;
|
|
61
|
+
listWorkouts(_params: HealthListWorkoutsParams): Promise<HealthListWorkoutsResult>;
|
|
62
|
+
listSleep(_params: HealthListSleepParams): Promise<HealthListSleepResult>;
|
|
63
|
+
listBiometrics(_params: HealthListBiometricsParams): Promise<HealthListBiometricsResult>;
|
|
64
|
+
listNutrition(_params: HealthListNutritionParams): Promise<HealthListNutritionResult>;
|
|
31
65
|
getConnectionStatus(params: {
|
|
32
66
|
tenantId: string;
|
|
33
67
|
connectionId: string;
|
|
@@ -39,9 +73,26 @@ export declare class BaseHealthProvider implements HealthProvider {
|
|
|
39
73
|
syncNutrition(params: HealthSyncRequest): Promise<HealthSyncResult>;
|
|
40
74
|
parseWebhook(request: HealthWebhookRequest): Promise<HealthWebhookEvent>;
|
|
41
75
|
verifyWebhook(request: HealthWebhookRequest): Promise<boolean>;
|
|
76
|
+
protected fetchActivities(params: HealthListActivitiesParams, config: DatasetFetchConfig<HealthListActivitiesParams, HealthActivity>): Promise<HealthListActivitiesResult>;
|
|
77
|
+
protected fetchWorkouts(params: HealthListWorkoutsParams, config: DatasetFetchConfig<HealthListWorkoutsParams, HealthWorkout>): Promise<HealthListWorkoutsResult>;
|
|
78
|
+
protected fetchSleep(params: HealthListSleepParams, config: DatasetFetchConfig<HealthListSleepParams, HealthSleep>): Promise<HealthListSleepResult>;
|
|
79
|
+
protected fetchBiometrics(params: HealthListBiometricsParams, config: DatasetFetchConfig<HealthListBiometricsParams, HealthBiometric>): Promise<HealthListBiometricsResult>;
|
|
80
|
+
protected fetchNutrition(params: HealthListNutritionParams, config: DatasetFetchConfig<HealthListNutritionParams, HealthNutrition>): Promise<HealthListNutritionResult>;
|
|
81
|
+
protected fetchConnectionStatus(params: {
|
|
82
|
+
tenantId: string;
|
|
83
|
+
connectionId: string;
|
|
84
|
+
}, config: ConnectionStatusConfig): Promise<HealthConnectionStatus>;
|
|
85
|
+
protected currentSource(): HealthDataSource;
|
|
86
|
+
protected providerSlug(): string;
|
|
87
|
+
protected unsupported(capability: string): HealthProviderCapabilityError;
|
|
88
|
+
private syncFromList;
|
|
42
89
|
private fetchList;
|
|
43
|
-
private
|
|
44
|
-
private
|
|
90
|
+
private fetchPayload;
|
|
91
|
+
private isMcpTransport;
|
|
92
|
+
private requestApi;
|
|
45
93
|
private callMcpTool;
|
|
46
|
-
|
|
94
|
+
private authorizationHeaders;
|
|
95
|
+
private refreshAccessToken;
|
|
96
|
+
private readResponsePayload;
|
|
47
97
|
}
|
|
98
|
+
export {};
|