@contractspec/integration.providers-impls 1.57.0 → 1.58.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/dist/analytics.d.ts +1 -8
- package/dist/analytics.d.ts.map +1 -1
- package/dist/analytics.js +3 -3
- package/dist/calendar.d.ts +1 -8
- package/dist/calendar.d.ts.map +1 -1
- package/dist/calendar.js +3 -3
- package/dist/database.d.ts +1 -8
- package/dist/database.d.ts.map +1 -1
- package/dist/database.js +3 -3
- package/dist/email.d.ts +1 -8
- package/dist/email.d.ts.map +1 -1
- package/dist/email.js +3 -3
- package/dist/embedding.d.ts +1 -8
- package/dist/embedding.d.ts.map +1 -1
- package/dist/embedding.js +3 -3
- package/dist/impls/elevenlabs-voice.d.ts +14 -18
- package/dist/impls/elevenlabs-voice.d.ts.map +1 -1
- package/dist/impls/elevenlabs-voice.js +98 -88
- package/dist/impls/fal-voice.d.ts +22 -26
- package/dist/impls/fal-voice.d.ts.map +1 -1
- package/dist/impls/fal-voice.js +103 -78
- package/dist/impls/fathom-meeting-recorder.d.ts +35 -39
- package/dist/impls/fathom-meeting-recorder.d.ts.map +1 -1
- package/dist/impls/fathom-meeting-recorder.js +285 -142
- package/dist/impls/fathom-meeting-recorder.mapper.d.ts +4 -8
- package/dist/impls/fathom-meeting-recorder.mapper.d.ts.map +1 -1
- package/dist/impls/fathom-meeting-recorder.mapper.js +102 -38
- package/dist/impls/fathom-meeting-recorder.types.d.ts +16 -20
- package/dist/impls/fathom-meeting-recorder.types.d.ts.map +1 -1
- package/dist/impls/fathom-meeting-recorder.types.js +1 -0
- package/dist/impls/fathom-meeting-recorder.utils.d.ts +10 -14
- package/dist/impls/fathom-meeting-recorder.utils.d.ts.map +1 -1
- package/dist/impls/fathom-meeting-recorder.utils.js +58 -41
- package/dist/impls/fathom-meeting-recorder.webhooks.d.ts +3 -7
- package/dist/impls/fathom-meeting-recorder.webhooks.d.ts.map +1 -1
- package/dist/impls/fathom-meeting-recorder.webhooks.js +25 -20
- package/dist/impls/fireflies-meeting-recorder.d.ts +21 -25
- package/dist/impls/fireflies-meeting-recorder.d.ts.map +1 -1
- package/dist/impls/fireflies-meeting-recorder.js +272 -149
- package/dist/impls/fireflies-meeting-recorder.queries.d.ts +3 -6
- package/dist/impls/fireflies-meeting-recorder.queries.d.ts.map +1 -1
- package/dist/impls/fireflies-meeting-recorder.queries.js +10 -8
- package/dist/impls/fireflies-meeting-recorder.types.d.ts +26 -29
- package/dist/impls/fireflies-meeting-recorder.types.d.ts.map +1 -1
- package/dist/impls/fireflies-meeting-recorder.types.js +1 -0
- package/dist/impls/fireflies-meeting-recorder.utils.d.ts +4 -7
- package/dist/impls/fireflies-meeting-recorder.utils.d.ts.map +1 -1
- package/dist/impls/fireflies-meeting-recorder.utils.js +34 -27
- package/dist/impls/gcs-storage.d.ts +18 -22
- package/dist/impls/gcs-storage.d.ts.map +1 -1
- package/dist/impls/gcs-storage.js +92 -84
- package/dist/impls/gmail-inbound.d.ts +20 -24
- package/dist/impls/gmail-inbound.d.ts.map +1 -1
- package/dist/impls/gmail-inbound.js +212 -185
- package/dist/impls/gmail-outbound.d.ts +12 -16
- package/dist/impls/gmail-outbound.d.ts.map +1 -1
- package/dist/impls/gmail-outbound.js +126 -92
- package/dist/impls/google-calendar.d.ts +17 -21
- package/dist/impls/google-calendar.d.ts.map +1 -1
- package/dist/impls/google-calendar.js +182 -145
- package/dist/impls/gradium-voice.d.ts +20 -22
- package/dist/impls/gradium-voice.d.ts.map +1 -1
- package/dist/impls/gradium-voice.js +85 -74
- package/dist/impls/granola-meeting-recorder.d.ts +31 -24
- package/dist/impls/granola-meeting-recorder.d.ts.map +1 -1
- package/dist/impls/granola-meeting-recorder.js +511 -143
- package/dist/impls/granola-meeting-recorder.mcp.d.ts +25 -0
- package/dist/impls/granola-meeting-recorder.mcp.d.ts.map +1 -0
- package/dist/impls/granola-meeting-recorder.mcp.js +279 -0
- package/dist/impls/granola-meeting-recorder.types.d.ts +60 -49
- package/dist/impls/granola-meeting-recorder.types.d.ts.map +1 -1
- package/dist/impls/granola-meeting-recorder.types.js +1 -0
- package/dist/impls/index.d.ts +28 -28
- package/dist/impls/index.d.ts.map +1 -0
- package/dist/impls/index.js +4659 -29
- package/dist/impls/jira.d.ts +18 -22
- package/dist/impls/jira.d.ts.map +1 -1
- package/dist/impls/jira.js +112 -101
- package/dist/impls/linear.d.ts +17 -21
- package/dist/impls/linear.d.ts.map +1 -1
- package/dist/impls/linear.js +78 -69
- package/dist/impls/mistral-embedding.d.ts +17 -21
- package/dist/impls/mistral-embedding.d.ts.map +1 -1
- package/dist/impls/mistral-embedding.js +41 -39
- package/dist/impls/mistral-llm.d.ts +25 -29
- package/dist/impls/mistral-llm.d.ts.map +1 -1
- package/dist/impls/mistral-llm.js +266 -244
- package/dist/impls/notion.d.ts +20 -24
- package/dist/impls/notion.d.ts.map +1 -1
- package/dist/impls/notion.js +145 -110
- package/dist/impls/posthog-reader.d.ts +18 -22
- package/dist/impls/posthog-reader.d.ts.map +1 -1
- package/dist/impls/posthog-reader.js +148 -129
- package/dist/impls/posthog-utils.d.ts +4 -7
- package/dist/impls/posthog-utils.d.ts.map +1 -1
- package/dist/impls/posthog-utils.js +31 -22
- package/dist/impls/posthog.d.ts +33 -37
- package/dist/impls/posthog.d.ts.map +1 -1
- package/dist/impls/posthog.js +320 -119
- package/dist/impls/postmark-email.d.ts +13 -17
- package/dist/impls/postmark-email.d.ts.map +1 -1
- package/dist/impls/postmark-email.js +55 -50
- package/dist/impls/powens-client.d.ts +111 -114
- package/dist/impls/powens-client.d.ts.map +1 -1
- package/dist/impls/powens-client.js +194 -170
- package/dist/impls/powens-openbanking.d.ts +22 -26
- package/dist/impls/powens-openbanking.d.ts.map +1 -1
- package/dist/impls/powens-openbanking.js +425 -217
- package/dist/impls/provider-factory.d.ts +29 -33
- package/dist/impls/provider-factory.d.ts.map +1 -1
- package/dist/impls/provider-factory.js +4072 -275
- package/dist/impls/qdrant-vector.d.ts +18 -22
- package/dist/impls/qdrant-vector.d.ts.map +1 -1
- package/dist/impls/qdrant-vector.js +76 -69
- package/dist/impls/stripe-payments.d.ts +22 -26
- package/dist/impls/stripe-payments.d.ts.map +1 -1
- package/dist/impls/stripe-payments.js +219 -193
- package/dist/impls/supabase-psql.d.ts +21 -25
- package/dist/impls/supabase-psql.d.ts.map +1 -1
- package/dist/impls/supabase-psql.js +138 -98
- package/dist/impls/supabase-vector.d.ts +29 -33
- package/dist/impls/supabase-vector.d.ts.map +1 -1
- package/dist/impls/supabase-vector.js +278 -103
- package/dist/impls/tldv-meeting-recorder.d.ts +18 -22
- package/dist/impls/tldv-meeting-recorder.d.ts.map +1 -1
- package/dist/impls/tldv-meeting-recorder.js +142 -127
- package/dist/impls/twilio-sms.d.ts +14 -17
- package/dist/impls/twilio-sms.d.ts.map +1 -1
- package/dist/impls/twilio-sms.js +62 -55
- package/dist/index.d.ts +15 -64
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4700 -107
- package/dist/llm.d.ts +1 -8
- package/dist/llm.d.ts.map +1 -1
- package/dist/llm.js +3 -3
- package/dist/meeting-recorder.d.ts +1 -8
- package/dist/meeting-recorder.d.ts.map +1 -1
- package/dist/meeting-recorder.js +3 -3
- package/dist/node/analytics.js +2 -0
- package/dist/node/calendar.js +2 -0
- package/dist/node/database.js +2 -0
- package/dist/node/email.js +2 -0
- package/dist/node/embedding.js +2 -0
- package/dist/node/impls/elevenlabs-voice.js +102 -0
- package/dist/node/impls/fal-voice.js +112 -0
- package/dist/node/impls/fathom-meeting-recorder.js +287 -0
- package/dist/node/impls/fathom-meeting-recorder.mapper.js +105 -0
- package/dist/node/impls/fathom-meeting-recorder.types.js +0 -0
- package/dist/node/impls/fathom-meeting-recorder.utils.js +72 -0
- package/dist/node/impls/fathom-meeting-recorder.webhooks.js +29 -0
- package/dist/node/impls/fireflies-meeting-recorder.js +274 -0
- package/dist/node/impls/fireflies-meeting-recorder.queries.js +85 -0
- package/dist/node/impls/fireflies-meeting-recorder.types.js +0 -0
- package/dist/node/impls/fireflies-meeting-recorder.utils.js +42 -0
- package/dist/node/impls/gcs-storage.js +97 -0
- package/dist/node/impls/gmail-inbound.js +227 -0
- package/dist/node/impls/gmail-outbound.js +139 -0
- package/dist/node/impls/google-calendar.js +191 -0
- package/dist/node/impls/gradium-voice.js +90 -0
- package/dist/node/impls/granola-meeting-recorder.js +512 -0
- package/dist/node/impls/granola-meeting-recorder.mcp.js +278 -0
- package/dist/node/impls/granola-meeting-recorder.types.js +0 -0
- package/dist/node/impls/index.js +4658 -0
- package/dist/node/impls/jira.js +124 -0
- package/dist/node/impls/linear.js +83 -0
- package/dist/node/impls/mistral-embedding.js +43 -0
- package/dist/node/impls/mistral-llm.js +269 -0
- package/dist/node/impls/notion.js +160 -0
- package/dist/node/impls/posthog-reader.js +159 -0
- package/dist/node/impls/posthog-utils.js +38 -0
- package/dist/node/impls/posthog.js +322 -0
- package/dist/node/impls/postmark-email.js +60 -0
- package/dist/node/impls/powens-client.js +195 -0
- package/dist/node/impls/powens-openbanking.js +426 -0
- package/dist/node/impls/provider-factory.js +4080 -0
- package/dist/node/impls/qdrant-vector.js +78 -0
- package/dist/node/impls/stripe-payments.js +228 -0
- package/dist/node/impls/supabase-psql.js +150 -0
- package/dist/node/impls/supabase-vector.js +323 -0
- package/dist/node/impls/tldv-meeting-recorder.js +145 -0
- package/dist/node/impls/twilio-sms.js +65 -0
- package/dist/node/index.js +4699 -0
- package/dist/node/llm.js +2 -0
- package/dist/node/meeting-recorder.js +2 -0
- package/dist/node/openbanking.js +2 -0
- package/dist/node/payments.js +2 -0
- package/dist/node/project-management.js +2 -0
- package/dist/node/runtime.js +0 -0
- package/dist/node/secrets/provider.js +11 -0
- package/dist/node/sms.js +2 -0
- package/dist/node/storage.js +2 -0
- package/dist/node/vector-store.js +2 -0
- package/dist/node/voice.js +2 -0
- package/dist/openbanking.d.ts +1 -8
- package/dist/openbanking.d.ts.map +1 -1
- package/dist/openbanking.js +3 -3
- package/dist/payments.d.ts +1 -8
- package/dist/payments.d.ts.map +1 -1
- package/dist/payments.js +3 -3
- package/dist/project-management.d.ts +1 -8
- package/dist/project-management.d.ts.map +1 -1
- package/dist/project-management.js +3 -3
- package/dist/runtime.d.ts +2 -2
- package/dist/runtime.d.ts.map +1 -0
- package/dist/runtime.js +1 -0
- package/dist/secrets/provider.d.ts +3 -2
- package/dist/secrets/provider.d.ts.map +1 -0
- package/dist/secrets/provider.js +12 -3
- package/dist/sms.d.ts +1 -8
- package/dist/sms.d.ts.map +1 -1
- package/dist/sms.js +3 -3
- package/dist/storage.d.ts +1 -8
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +3 -3
- package/dist/vector-store.d.ts +1 -8
- package/dist/vector-store.d.ts.map +1 -1
- package/dist/vector-store.js +3 -3
- package/dist/voice.d.ts +1 -8
- package/dist/voice.d.ts.map +1 -1
- package/dist/voice.js +3 -3
- package/package.json +405 -114
- package/dist/_virtual/_rolldown/runtime.js +0 -36
- package/dist/impls/elevenlabs-voice.js.map +0 -1
- package/dist/impls/fal-voice.js.map +0 -1
- package/dist/impls/fathom-meeting-recorder.js.map +0 -1
- package/dist/impls/fathom-meeting-recorder.mapper.js.map +0 -1
- package/dist/impls/fathom-meeting-recorder.utils.js.map +0 -1
- package/dist/impls/fathom-meeting-recorder.webhooks.js.map +0 -1
- package/dist/impls/fireflies-meeting-recorder.js.map +0 -1
- package/dist/impls/fireflies-meeting-recorder.queries.js.map +0 -1
- package/dist/impls/fireflies-meeting-recorder.utils.js.map +0 -1
- package/dist/impls/gcs-storage.js.map +0 -1
- package/dist/impls/gmail-inbound.js.map +0 -1
- package/dist/impls/gmail-outbound.js.map +0 -1
- package/dist/impls/google-calendar.js.map +0 -1
- package/dist/impls/gradium-voice.js.map +0 -1
- package/dist/impls/granola-meeting-recorder.js.map +0 -1
- package/dist/impls/jira.js.map +0 -1
- package/dist/impls/linear.js.map +0 -1
- package/dist/impls/mistral-embedding.js.map +0 -1
- package/dist/impls/mistral-llm.js.map +0 -1
- package/dist/impls/notion.js.map +0 -1
- package/dist/impls/posthog-reader.js.map +0 -1
- package/dist/impls/posthog-utils.js.map +0 -1
- package/dist/impls/posthog.js.map +0 -1
- package/dist/impls/postmark-email.js.map +0 -1
- package/dist/impls/powens-client.js.map +0 -1
- package/dist/impls/powens-openbanking.js.map +0 -1
- package/dist/impls/provider-factory.js.map +0 -1
- package/dist/impls/qdrant-vector.js.map +0 -1
- package/dist/impls/stripe-payments.js.map +0 -1
- package/dist/impls/supabase-psql.js.map +0 -1
- package/dist/impls/supabase-vector.js.map +0 -1
- package/dist/impls/tldv-meeting-recorder.js.map +0 -1
- package/dist/impls/twilio-sms.js.map +0 -1
- package/dist/index.js.map +0 -1
package/dist/impls/jira.d.ts
CHANGED
|
@@ -1,25 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
issueTypeMap?: Partial<Record<project_management_d_exports.ProjectManagementWorkItemType, string>>;
|
|
12
|
-
fetch?: typeof fetch;
|
|
1
|
+
import type { ProjectManagementProvider, ProjectManagementWorkItem, ProjectManagementWorkItemInput, ProjectManagementWorkItemType } from '../project-management';
|
|
2
|
+
export interface JiraProjectManagementProviderOptions {
|
|
3
|
+
siteUrl: string;
|
|
4
|
+
email: string;
|
|
5
|
+
apiToken: string;
|
|
6
|
+
projectKey?: string;
|
|
7
|
+
issueType?: string;
|
|
8
|
+
defaultLabels?: string[];
|
|
9
|
+
issueTypeMap?: Partial<Record<ProjectManagementWorkItemType, string>>;
|
|
10
|
+
fetch?: typeof fetch;
|
|
13
11
|
}
|
|
14
|
-
declare class JiraProjectManagementProvider implements
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
12
|
+
export declare class JiraProjectManagementProvider implements ProjectManagementProvider {
|
|
13
|
+
private readonly siteUrl;
|
|
14
|
+
private readonly authHeader;
|
|
15
|
+
private readonly defaults;
|
|
16
|
+
private readonly fetchFn;
|
|
17
|
+
constructor(options: JiraProjectManagementProviderOptions);
|
|
18
|
+
createWorkItem(input: ProjectManagementWorkItemInput): Promise<ProjectManagementWorkItem>;
|
|
19
|
+
createWorkItems(items: ProjectManagementWorkItemInput[]): Promise<ProjectManagementWorkItem[]>;
|
|
22
20
|
}
|
|
23
|
-
//#endregion
|
|
24
|
-
export { JiraProjectManagementProvider, JiraProjectManagementProviderOptions };
|
|
25
21
|
//# sourceMappingURL=jira.d.ts.map
|
package/dist/impls/jira.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jira.d.ts","
|
|
1
|
+
{"version":3,"file":"jira.d.ts","sourceRoot":"","sources":["../../src/impls/jira.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,yBAAyB,EACzB,yBAAyB,EACzB,8BAA8B,EAE9B,6BAA6B,EAC9B,MAAM,uBAAuB,CAAC;AAE/B,MAAM,WAAW,oCAAoC;IACnD,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,YAAY,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,6BAA6B,EAAE,MAAM,CAAC,CAAC,CAAC;IACtE,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;CACtB;AAED,qBAAa,6BAA8B,YAAW,yBAAyB;IAC7E,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAGvB;IACF,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAe;gBAE3B,OAAO,EAAE,oCAAoC;IAYnD,cAAc,CAClB,KAAK,EAAE,8BAA8B,GACpC,OAAO,CAAC,yBAAyB,CAAC;IAgE/B,eAAe,CACnB,KAAK,EAAE,8BAA8B,EAAE,GACtC,OAAO,CAAC,yBAAyB,EAAE,CAAC;CAOxC"}
|
package/dist/impls/jira.js
CHANGED
|
@@ -1,114 +1,125 @@
|
|
|
1
|
-
|
|
1
|
+
// @bun
|
|
2
|
+
// src/impls/jira.ts
|
|
3
|
+
import { Buffer } from "buffer";
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
5
|
+
class JiraProjectManagementProvider {
|
|
6
|
+
siteUrl;
|
|
7
|
+
authHeader;
|
|
8
|
+
defaults;
|
|
9
|
+
fetchFn;
|
|
10
|
+
constructor(options) {
|
|
11
|
+
this.siteUrl = normalizeSiteUrl(options.siteUrl);
|
|
12
|
+
this.authHeader = buildAuthHeader(options.email, options.apiToken);
|
|
13
|
+
this.defaults = {
|
|
14
|
+
projectKey: options.projectKey,
|
|
15
|
+
issueType: options.issueType,
|
|
16
|
+
defaultLabels: options.defaultLabels,
|
|
17
|
+
issueTypeMap: options.issueTypeMap
|
|
18
|
+
};
|
|
19
|
+
this.fetchFn = options.fetch ?? fetch;
|
|
20
|
+
}
|
|
21
|
+
async createWorkItem(input) {
|
|
22
|
+
const projectKey = input.projectId ?? this.defaults.projectKey;
|
|
23
|
+
if (!projectKey) {
|
|
24
|
+
throw new Error("Jira projectKey is required to create work items.");
|
|
25
|
+
}
|
|
26
|
+
const issueType = resolveIssueType(input.type, this.defaults);
|
|
27
|
+
const description = buildJiraDescription(input.description);
|
|
28
|
+
const labels = mergeLabels(this.defaults.defaultLabels, input.tags);
|
|
29
|
+
const priority = mapPriority(input.priority);
|
|
30
|
+
const payload = {
|
|
31
|
+
fields: {
|
|
32
|
+
project: { key: projectKey },
|
|
33
|
+
summary: input.title,
|
|
34
|
+
description,
|
|
35
|
+
issuetype: { name: issueType },
|
|
36
|
+
labels,
|
|
37
|
+
priority: priority ? { name: priority } : undefined,
|
|
38
|
+
assignee: input.assigneeId ? { accountId: input.assigneeId } : undefined,
|
|
39
|
+
duedate: input.dueDate ? input.dueDate.toISOString().slice(0, 10) : undefined
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const response = await this.fetchFn(`${this.siteUrl}/rest/api/3/issue`, {
|
|
43
|
+
method: "POST",
|
|
44
|
+
headers: {
|
|
45
|
+
Authorization: this.authHeader,
|
|
46
|
+
"Content-Type": "application/json",
|
|
47
|
+
Accept: "application/json"
|
|
48
|
+
},
|
|
49
|
+
body: JSON.stringify(payload)
|
|
50
|
+
});
|
|
51
|
+
if (!response.ok) {
|
|
52
|
+
const body = await response.text();
|
|
53
|
+
throw new Error(`Jira API error (${response.status}): ${body || response.statusText}`);
|
|
54
|
+
}
|
|
55
|
+
const data = await response.json();
|
|
56
|
+
return {
|
|
57
|
+
id: data.id ?? data.key ?? "",
|
|
58
|
+
title: input.title,
|
|
59
|
+
url: data.key ? `${this.siteUrl}/browse/${data.key}` : undefined,
|
|
60
|
+
status: input.status,
|
|
61
|
+
priority: input.priority,
|
|
62
|
+
tags: input.tags,
|
|
63
|
+
projectId: projectKey,
|
|
64
|
+
externalId: input.externalId,
|
|
65
|
+
metadata: input.metadata
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
async createWorkItems(items) {
|
|
69
|
+
const created = [];
|
|
70
|
+
for (const item of items) {
|
|
71
|
+
created.push(await this.createWorkItem(item));
|
|
72
|
+
}
|
|
73
|
+
return created;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
69
76
|
function normalizeSiteUrl(siteUrl) {
|
|
70
|
-
|
|
77
|
+
return siteUrl.replace(/\/$/, "");
|
|
71
78
|
}
|
|
72
79
|
function buildAuthHeader(email, apiToken) {
|
|
73
|
-
|
|
80
|
+
const token = Buffer.from(`${email}:${apiToken}`).toString("base64");
|
|
81
|
+
return `Basic ${token}`;
|
|
74
82
|
}
|
|
75
83
|
function resolveIssueType(type, defaults) {
|
|
76
|
-
|
|
77
|
-
|
|
84
|
+
if (type && defaults.issueTypeMap?.[type]) {
|
|
85
|
+
return defaults.issueTypeMap[type] ?? defaults.issueType ?? "Task";
|
|
86
|
+
}
|
|
87
|
+
return defaults.issueType ?? "Task";
|
|
78
88
|
}
|
|
79
89
|
function mapPriority(priority) {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
90
|
+
switch (priority) {
|
|
91
|
+
case "urgent":
|
|
92
|
+
return "Highest";
|
|
93
|
+
case "high":
|
|
94
|
+
return "High";
|
|
95
|
+
case "medium":
|
|
96
|
+
return "Medium";
|
|
97
|
+
case "low":
|
|
98
|
+
return "Low";
|
|
99
|
+
case "none":
|
|
100
|
+
default:
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
87
103
|
}
|
|
88
104
|
function mergeLabels(defaults, tags) {
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
105
|
+
const merged = new Set;
|
|
106
|
+
(defaults ?? []).forEach((label) => merged.add(label));
|
|
107
|
+
(tags ?? []).forEach((tag) => merged.add(tag));
|
|
108
|
+
const result = [...merged];
|
|
109
|
+
return result.length > 0 ? result : undefined;
|
|
94
110
|
}
|
|
95
111
|
function buildJiraDescription(description) {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
type: "doc",
|
|
107
|
-
version: 1,
|
|
108
|
-
content
|
|
109
|
-
};
|
|
112
|
+
if (!description)
|
|
113
|
+
return;
|
|
114
|
+
const lines = description.split(/\r?\n/).filter((line) => line.trim());
|
|
115
|
+
const content = lines.map((line) => ({
|
|
116
|
+
type: "paragraph",
|
|
117
|
+
content: [{ type: "text", text: line }]
|
|
118
|
+
}));
|
|
119
|
+
if (content.length === 0)
|
|
120
|
+
return;
|
|
121
|
+
return { type: "doc", version: 1, content };
|
|
110
122
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
//# sourceMappingURL=jira.js.map
|
|
123
|
+
export {
|
|
124
|
+
JiraProjectManagementProvider
|
|
125
|
+
};
|
package/dist/impls/linear.d.ts
CHANGED
|
@@ -1,24 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
tagLabelMap?: Record<string, string>;
|
|
13
|
-
client?: LinearClient;
|
|
1
|
+
import { LinearClient } from '@linear/sdk';
|
|
2
|
+
import type { ProjectManagementProvider, ProjectManagementWorkItem, ProjectManagementWorkItemInput } from '../project-management';
|
|
3
|
+
export interface LinearProjectManagementProviderOptions {
|
|
4
|
+
apiKey: string;
|
|
5
|
+
teamId?: string;
|
|
6
|
+
projectId?: string;
|
|
7
|
+
assigneeId?: string;
|
|
8
|
+
stateId?: string;
|
|
9
|
+
labelIds?: string[];
|
|
10
|
+
tagLabelMap?: Record<string, string>;
|
|
11
|
+
client?: LinearClient;
|
|
14
12
|
}
|
|
15
|
-
declare class LinearProjectManagementProvider implements
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
export declare class LinearProjectManagementProvider implements ProjectManagementProvider {
|
|
14
|
+
private readonly client;
|
|
15
|
+
private readonly defaults;
|
|
16
|
+
constructor(options: LinearProjectManagementProviderOptions);
|
|
17
|
+
createWorkItem(input: ProjectManagementWorkItemInput): Promise<ProjectManagementWorkItem>;
|
|
18
|
+
createWorkItems(items: ProjectManagementWorkItemInput[]): Promise<ProjectManagementWorkItem[]>;
|
|
21
19
|
}
|
|
22
|
-
//#endregion
|
|
23
|
-
export { LinearProjectManagementProvider, LinearProjectManagementProviderOptions };
|
|
24
20
|
//# sourceMappingURL=linear.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"linear.d.ts","
|
|
1
|
+
{"version":3,"file":"linear.d.ts","sourceRoot":"","sources":["../../src/impls/linear.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,KAAK,EACV,yBAAyB,EACzB,yBAAyB,EACzB,8BAA8B,EAE/B,MAAM,uBAAuB,CAAC;AAE/B,MAAM,WAAW,sCAAsC;IACrD,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB;AAUD,qBAAa,+BAAgC,YAAW,yBAAyB;IAC/E,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;IACtC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAGvB;gBAEU,OAAO,EAAE,sCAAsC;IAarD,cAAc,CAClB,KAAK,EAAE,8BAA8B,GACpC,OAAO,CAAC,yBAAyB,CAAC;IAiC/B,eAAe,CACnB,KAAK,EAAE,8BAA8B,EAAE,GACtC,OAAO,CAAC,yBAAyB,EAAE,CAAC;CAOxC"}
|
package/dist/impls/linear.js
CHANGED
|
@@ -1,75 +1,84 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/impls/linear.ts
|
|
1
3
|
import { LinearClient } from "@linear/sdk";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
low: 4,
|
|
9
|
-
none: 0
|
|
10
|
-
};
|
|
11
|
-
var LinearProjectManagementProvider = class {
|
|
12
|
-
client;
|
|
13
|
-
defaults;
|
|
14
|
-
constructor(options) {
|
|
15
|
-
this.client = options.client ?? new LinearClient({ apiKey: options.apiKey });
|
|
16
|
-
this.defaults = {
|
|
17
|
-
teamId: options.teamId,
|
|
18
|
-
projectId: options.projectId,
|
|
19
|
-
assigneeId: options.assigneeId,
|
|
20
|
-
stateId: options.stateId,
|
|
21
|
-
labelIds: options.labelIds,
|
|
22
|
-
tagLabelMap: options.tagLabelMap
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
async createWorkItem(input) {
|
|
26
|
-
const teamId = this.defaults.teamId;
|
|
27
|
-
if (!teamId) throw new Error("Linear teamId is required to create work items.");
|
|
28
|
-
const issue = await (await this.client.createIssue({
|
|
29
|
-
teamId,
|
|
30
|
-
title: input.title,
|
|
31
|
-
description: input.description,
|
|
32
|
-
priority: mapPriority(input.priority),
|
|
33
|
-
estimate: input.estimate,
|
|
34
|
-
assigneeId: input.assigneeId ?? this.defaults.assigneeId,
|
|
35
|
-
projectId: input.projectId ?? this.defaults.projectId,
|
|
36
|
-
stateId: this.defaults.stateId,
|
|
37
|
-
labelIds: resolveLabelIds(this.defaults, input.tags)
|
|
38
|
-
})).issue;
|
|
39
|
-
const state = issue ? await issue.state : void 0;
|
|
40
|
-
return {
|
|
41
|
-
id: issue?.id ?? "",
|
|
42
|
-
title: issue?.title ?? input.title,
|
|
43
|
-
url: issue?.url ?? void 0,
|
|
44
|
-
status: state?.name ?? void 0,
|
|
45
|
-
priority: input.priority,
|
|
46
|
-
tags: input.tags,
|
|
47
|
-
projectId: input.projectId ?? this.defaults.projectId,
|
|
48
|
-
externalId: input.externalId,
|
|
49
|
-
metadata: input.metadata
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
async createWorkItems(items) {
|
|
53
|
-
const created = [];
|
|
54
|
-
for (const item of items) created.push(await this.createWorkItem(item));
|
|
55
|
-
return created;
|
|
56
|
-
}
|
|
4
|
+
var PRIORITY_MAP = {
|
|
5
|
+
urgent: 1,
|
|
6
|
+
high: 2,
|
|
7
|
+
medium: 3,
|
|
8
|
+
low: 4,
|
|
9
|
+
none: 0
|
|
57
10
|
};
|
|
11
|
+
|
|
12
|
+
class LinearProjectManagementProvider {
|
|
13
|
+
client;
|
|
14
|
+
defaults;
|
|
15
|
+
constructor(options) {
|
|
16
|
+
this.client = options.client ?? new LinearClient({ apiKey: options.apiKey });
|
|
17
|
+
this.defaults = {
|
|
18
|
+
teamId: options.teamId,
|
|
19
|
+
projectId: options.projectId,
|
|
20
|
+
assigneeId: options.assigneeId,
|
|
21
|
+
stateId: options.stateId,
|
|
22
|
+
labelIds: options.labelIds,
|
|
23
|
+
tagLabelMap: options.tagLabelMap
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
async createWorkItem(input) {
|
|
27
|
+
const teamId = this.defaults.teamId;
|
|
28
|
+
if (!teamId) {
|
|
29
|
+
throw new Error("Linear teamId is required to create work items.");
|
|
30
|
+
}
|
|
31
|
+
const payload = await this.client.createIssue({
|
|
32
|
+
teamId,
|
|
33
|
+
title: input.title,
|
|
34
|
+
description: input.description,
|
|
35
|
+
priority: mapPriority(input.priority),
|
|
36
|
+
estimate: input.estimate,
|
|
37
|
+
assigneeId: input.assigneeId ?? this.defaults.assigneeId,
|
|
38
|
+
projectId: input.projectId ?? this.defaults.projectId,
|
|
39
|
+
stateId: this.defaults.stateId,
|
|
40
|
+
labelIds: resolveLabelIds(this.defaults, input.tags)
|
|
41
|
+
});
|
|
42
|
+
const issue = await payload.issue;
|
|
43
|
+
const state = issue ? await issue.state : undefined;
|
|
44
|
+
return {
|
|
45
|
+
id: issue?.id ?? "",
|
|
46
|
+
title: issue?.title ?? input.title,
|
|
47
|
+
url: issue?.url ?? undefined,
|
|
48
|
+
status: state?.name ?? undefined,
|
|
49
|
+
priority: input.priority,
|
|
50
|
+
tags: input.tags,
|
|
51
|
+
projectId: input.projectId ?? this.defaults.projectId,
|
|
52
|
+
externalId: input.externalId,
|
|
53
|
+
metadata: input.metadata
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
async createWorkItems(items) {
|
|
57
|
+
const created = [];
|
|
58
|
+
for (const item of items) {
|
|
59
|
+
created.push(await this.createWorkItem(item));
|
|
60
|
+
}
|
|
61
|
+
return created;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
58
64
|
function mapPriority(priority) {
|
|
59
|
-
|
|
60
|
-
|
|
65
|
+
if (!priority)
|
|
66
|
+
return;
|
|
67
|
+
return PRIORITY_MAP[priority] ?? undefined;
|
|
61
68
|
}
|
|
62
69
|
function resolveLabelIds(defaults, tags) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
70
|
+
const labelIds = new Set;
|
|
71
|
+
(defaults.labelIds ?? []).forEach((id) => labelIds.add(id));
|
|
72
|
+
if (tags && defaults.tagLabelMap) {
|
|
73
|
+
tags.forEach((tag) => {
|
|
74
|
+
const mapped = defaults.tagLabelMap?.[tag];
|
|
75
|
+
if (mapped)
|
|
76
|
+
labelIds.add(mapped);
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
const merged = [...labelIds];
|
|
80
|
+
return merged.length > 0 ? merged : undefined;
|
|
71
81
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
//# sourceMappingURL=linear.js.map
|
|
82
|
+
export {
|
|
83
|
+
LinearProjectManagementProvider
|
|
84
|
+
};
|
|
@@ -1,24 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
serverURL?: string;
|
|
9
|
-
client?: Mistral;
|
|
1
|
+
import { Mistral } from '@mistralai/mistralai';
|
|
2
|
+
import type { EmbeddingDocument, EmbeddingProvider, EmbeddingResult } from '../embedding';
|
|
3
|
+
export interface MistralEmbeddingProviderOptions {
|
|
4
|
+
apiKey: string;
|
|
5
|
+
defaultModel?: string;
|
|
6
|
+
serverURL?: string;
|
|
7
|
+
client?: Mistral;
|
|
10
8
|
}
|
|
11
|
-
declare class MistralEmbeddingProvider implements
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
9
|
+
export declare class MistralEmbeddingProvider implements EmbeddingProvider {
|
|
10
|
+
private readonly client;
|
|
11
|
+
private readonly defaultModel;
|
|
12
|
+
constructor(options: MistralEmbeddingProviderOptions);
|
|
13
|
+
embedDocuments(documents: EmbeddingDocument[], options?: {
|
|
14
|
+
model?: string;
|
|
15
|
+
}): Promise<EmbeddingResult[]>;
|
|
16
|
+
embedQuery(query: string, options?: {
|
|
17
|
+
model?: string;
|
|
18
|
+
}): Promise<EmbeddingResult>;
|
|
21
19
|
}
|
|
22
|
-
//#endregion
|
|
23
|
-
export { MistralEmbeddingProvider, MistralEmbeddingProviderOptions };
|
|
24
20
|
//# sourceMappingURL=mistral-embedding.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mistral-embedding.d.ts","
|
|
1
|
+
{"version":3,"file":"mistral-embedding.d.ts","sourceRoot":"","sources":["../../src/impls/mistral-embedding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE/C,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EAChB,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,+BAA+B;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,qBAAa,wBAAyB,YAAW,iBAAiB;IAChE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAU;IACjC,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;gBAE1B,OAAO,EAAE,+BAA+B;IAc9C,cAAc,CAClB,SAAS,EAAE,iBAAiB,EAAE,EAC9B,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAC3B,OAAO,CAAC,eAAe,EAAE,CAAC;IAyBvB,UAAU,CACd,KAAK,EAAE,MAAM,EACb,OAAO,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,GAC3B,OAAO,CAAC,eAAe,CAAC;CAU5B"}
|
|
@@ -1,42 +1,44 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/impls/mistral-embedding.ts
|
|
1
3
|
import { Mistral } from "@mistralai/mistralai";
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
5
|
+
class MistralEmbeddingProvider {
|
|
6
|
+
client;
|
|
7
|
+
defaultModel;
|
|
8
|
+
constructor(options) {
|
|
9
|
+
if (!options.apiKey) {
|
|
10
|
+
throw new Error("MistralEmbeddingProvider requires an apiKey");
|
|
11
|
+
}
|
|
12
|
+
this.client = options.client ?? new Mistral({
|
|
13
|
+
apiKey: options.apiKey,
|
|
14
|
+
serverURL: options.serverURL
|
|
15
|
+
});
|
|
16
|
+
this.defaultModel = options.defaultModel ?? "mistral-embed";
|
|
17
|
+
}
|
|
18
|
+
async embedDocuments(documents, options) {
|
|
19
|
+
if (documents.length === 0)
|
|
20
|
+
return [];
|
|
21
|
+
const model = options?.model ?? this.defaultModel;
|
|
22
|
+
const response = await this.client.embeddings.create({
|
|
23
|
+
model,
|
|
24
|
+
inputs: documents.map((doc) => doc.text)
|
|
25
|
+
});
|
|
26
|
+
return response.data.map((item, index) => ({
|
|
27
|
+
id: documents[index]?.id ?? (item.index != null ? `embedding-${item.index}` : `embedding-${index}`),
|
|
28
|
+
vector: item.embedding ?? [],
|
|
29
|
+
dimensions: item.embedding?.length ?? 0,
|
|
30
|
+
model: response.model,
|
|
31
|
+
metadata: documents[index]?.metadata ? Object.fromEntries(Object.entries(documents[index]?.metadata ?? {}).map(([key, value]) => [key, String(value)])) : undefined
|
|
32
|
+
}));
|
|
33
|
+
}
|
|
34
|
+
async embedQuery(query, options) {
|
|
35
|
+
const [result] = await this.embedDocuments([{ id: "query", text: query }], options);
|
|
36
|
+
if (!result) {
|
|
37
|
+
throw new Error("Failed to compute embedding for query");
|
|
38
|
+
}
|
|
39
|
+
return result;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
export {
|
|
43
|
+
MistralEmbeddingProvider
|
|
38
44
|
};
|
|
39
|
-
|
|
40
|
-
//#endregion
|
|
41
|
-
export { MistralEmbeddingProvider };
|
|
42
|
-
//# sourceMappingURL=mistral-embedding.js.map
|