@skelm/integrations 0.3.7 → 0.3.9

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/base.d.ts CHANGED
@@ -1,34 +1,7 @@
1
- import type { Integration, IntegrationCapabilities, IntegrationConfig } from './types.js';
2
1
  /**
3
- * Base class for all integrations
4
- * Provides common functionality for lifecycle management, health checks, and rate limiting
2
+ * Re-exported from @skelm/integration-sdk.
3
+ * IntegrationBase now lives in the SDK so third-party authors and
4
+ * built-in implementations extend the same class.
5
5
  */
6
- export declare abstract class IntegrationBase implements Integration {
7
- abstract readonly id: string;
8
- abstract readonly name: string;
9
- abstract readonly capabilities: IntegrationCapabilities;
10
- config: IntegrationConfig;
11
- private initialized;
12
- private rateLimitQueue;
13
- constructor(config: IntegrationConfig);
14
- init(): Promise<void>;
15
- shutdown(): Promise<void>;
16
- healthCheck(): Promise<boolean>;
17
- /** Validate credentials - to be implemented by subclasses */
18
- protected abstract validateCredentials(): Promise<void>;
19
- /** Perform health check - to be implemented by subclasses */
20
- protected abstract performHealthCheck(): Promise<boolean>;
21
- /** Setup webhook - optional, only if canReceiveWebhooks */
22
- protected setupWebhook(): Promise<void>;
23
- /** Cleanup webhook - optional, only if canReceiveWebhooks */
24
- protected cleanupWebhook(): Promise<void>;
25
- /** Rate limiting check */
26
- protected checkRateLimit(): Promise<boolean>;
27
- /** Get wait time until next available request (in ms) */
28
- protected getRateLimitWaitTime(): number;
29
- /** Sleep helper */
30
- protected sleep(ms: number): Promise<void>;
31
- /** With rate limiting retry */
32
- protected withRateLimit<T>(fn: () => Promise<T>): Promise<T>;
33
- }
6
+ export { IntegrationBase } from '@skelm/integration-sdk';
34
7
  //# sourceMappingURL=base.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAA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CAAA"}
package/dist/base.js CHANGED
@@ -1,109 +1,7 @@
1
1
  /**
2
- * Base class for all integrations
3
- * Provides common functionality for lifecycle management, health checks, and rate limiting
2
+ * Re-exported from @skelm/integration-sdk.
3
+ * IntegrationBase now lives in the SDK so third-party authors and
4
+ * built-in implementations extend the same class.
4
5
  */
5
- export class IntegrationBase {
6
- config;
7
- initialized = false;
8
- rateLimitQueue = [];
9
- constructor(config) {
10
- this.config = config;
11
- }
12
- async init() {
13
- if (this.initialized) {
14
- return;
15
- }
16
- if (!this.config.enabled) {
17
- return;
18
- }
19
- // Validate credentials
20
- await this.validateCredentials();
21
- // Setup webhooks if configured
22
- if (this.config.webhook && this.capabilities.canReceiveWebhooks) {
23
- await this.setupWebhook();
24
- }
25
- this.initialized = true;
26
- }
27
- async shutdown() {
28
- if (!this.initialized) {
29
- return;
30
- }
31
- // Cleanup webhooks
32
- if (this.config.webhook && this.capabilities.canReceiveWebhooks) {
33
- await this.cleanupWebhook();
34
- }
35
- this.initialized = false;
36
- }
37
- async healthCheck() {
38
- if (!this.initialized) {
39
- return false;
40
- }
41
- try {
42
- return await this.performHealthCheck();
43
- }
44
- catch {
45
- return false;
46
- }
47
- }
48
- /** Setup webhook - optional, only if canReceiveWebhooks */
49
- async setupWebhook() {
50
- // Default implementation does nothing
51
- // Subclasses override if they support webhooks
52
- }
53
- /** Cleanup webhook - optional, only if canReceiveWebhooks */
54
- async cleanupWebhook() {
55
- // Default implementation does nothing
56
- }
57
- /** Rate limiting check */
58
- async checkRateLimit() {
59
- const limit = this.config.rateLimit;
60
- if (!limit) {
61
- return true;
62
- }
63
- const now = Date.now();
64
- const windowStart = now - limit.windowMs;
65
- // Clean old entries
66
- this.rateLimitQueue = this.rateLimitQueue.filter((entry) => entry.timestamp > windowStart);
67
- // Check if we're over limit
68
- if (this.rateLimitQueue.length >= limit.requests) {
69
- return false;
70
- }
71
- // Add current request
72
- this.rateLimitQueue.push({ timestamp: now });
73
- return true;
74
- }
75
- /** Get wait time until next available request (in ms) */
76
- getRateLimitWaitTime() {
77
- const limit = this.config.rateLimit;
78
- if (!limit || this.rateLimitQueue.length === 0) {
79
- return 0;
80
- }
81
- const oldest = this.rateLimitQueue[0];
82
- const windowStart = Date.now() - limit.windowMs;
83
- if (oldest.timestamp <= windowStart) {
84
- return 0;
85
- }
86
- return oldest.timestamp + limit.windowMs - Date.now();
87
- }
88
- /** Sleep helper */
89
- async sleep(ms) {
90
- return new Promise((resolve) => setTimeout(resolve, ms));
91
- }
92
- /** With rate limiting retry */
93
- async withRateLimit(fn) {
94
- const maxRetries = 3;
95
- let retries = 0;
96
- while (retries < maxRetries) {
97
- if (await this.checkRateLimit()) {
98
- return await fn();
99
- }
100
- const waitTime = this.getRateLimitWaitTime();
101
- if (waitTime > 0) {
102
- await this.sleep(waitTime + 100); // Add small buffer
103
- }
104
- retries++;
105
- }
106
- throw new Error(`Rate limit exceeded after ${maxRetries} retries`);
107
- }
108
- }
6
+ export { IntegrationBase } from '@skelm/integration-sdk';
109
7
  //# sourceMappingURL=base.js.map
package/dist/base.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"base.js","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,OAAgB,eAAe;IAKnC,MAAM,CAAmB;IACjB,WAAW,GAAG,KAAK,CAAA;IACnB,cAAc,GAAiC,EAAE,CAAA;IAEzD,YAAY,MAAyB;QACnC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED,KAAK,CAAC,IAAI;QACR,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACrB,OAAM;QACR,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACzB,OAAM;QACR,CAAC;QAED,uBAAuB;QACvB,MAAM,IAAI,CAAC,mBAAmB,EAAE,CAAA;QAEhC,+BAA+B;QAC/B,IAAI,IAAI,CAAC,MAAM,CAAC,OAAO,IAAI,IA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C,cAAc,EAAE,EAAE,CAAC;gBAChC,OAAO,MAAM,EAAE,EAAE,CAAA;YACnB,CAAC;YAED,MAAM,QAAQ,GAAG,IAAI,CAAC,oBAAoB,EAAE,CAAA;YAC5C,IAAI,QAAQ,GAAG,CAAC,EAAE,CAAC;gBACjB,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,GAAG,CAAC,CAAA,CAAC,mBAAmB;YACtD,CAAC;YACD,OAAO,EAAE,CAAA;QACX,CAAC;QAED,MAAM,IAAI,KAAK,CAAC,6BAA6B,UAAU,UAAU,CAAC,CAAA;IACpE,CAAC;CACF"}
1
+ {"version":3,"file":"base.js","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA"}
package/dist/github.d.ts CHANGED
@@ -1,47 +1,16 @@
1
- import { IntegrationBase } from './base.js';
2
- import type { GitHubWebhookEvent } from './types.js';
3
1
  /**
4
- * GitHub integration for skelm pipelines
2
+ * GitHub integration for skelm pipelines.
5
3
  *
6
4
  * Supports:
7
5
  * - Issue/PR triggers
8
6
  * - Webhook event handling
9
7
  * - Repository polling
8
+ * - Notifications via issue/PR comments
10
9
  */
11
- export declare class GitHubIntegration extends IntegrationBase {
12
- readonly id: "github";
13
- readonly name = "GitHub";
14
- readonly capabilities: {
15
- canTrigger: boolean;
16
- canReceiveWebhooks: boolean;
17
- canPoll: boolean;
18
- canSendNotifications: boolean;
19
- };
20
- private apiBaseUrl;
21
- private octokit;
22
- protected validateCredentials(): Promise<void>;
23
- protected performHealthCheck(): Promise<boolean>;
24
- protected setupWebhook(): Promise<void>;
25
- protected cleanupWebhook(): Promise<void>;
26
- /**
27
- * Convert GitHub webhook event to RunInput
28
- */
29
- eventToRunInput(event: GitHubWebhookEvent): Promise<Record<string, unknown> | null>;
30
- /**
31
- * Send notification to GitHub (issue comment, PR comment, etc.)
32
- */
33
- sendNotification(message: string, options?: {
34
- issueNumber?: number;
35
- prNumber?: number;
36
- commentOn?: 'issue' | 'pr';
37
- }): Promise<void>;
38
- /**
39
- * Poll for new issues/PRs
40
- */
41
- pollForChanges(since?: Date): Promise<unknown[]>;
42
- /**
43
- * Get issue or PR details
44
- */
45
- getIssueOrPr(owner: string, repo: string, number: number): Promise<unknown>;
46
- }
10
+ export declare const GitHubIntegration: import("@skelm/integration-sdk").IntegrationClass<{
11
+ token: string;
12
+ ownerId: string;
13
+ repoName: string;
14
+ }>;
15
+ export type GitHubIntegrationType = InstanceType<typeof GitHubIntegration>;
47
16
  //# sourceMappingURL=github.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../src/github.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAC3C,OAAO,KAAK,EAAoC,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAEtF;;;;;;;GAOG;AACH,qBAAa,iBAAkB,SAAQ,eAAe;IACpD,SAAkB,EAAE,EAAG,QAAQ,CAAS;IACxC,SAAkB,IAAI,YAAW;IACjC,QAAQ,CAAC,YAAY;;;;;MAKpB;IAED,OAAO,CAAC,UAAU,CAA2B;IAC7C,OAAO,CAAC,OAAO,CAAuB;cAEtB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;cAoBpC,kBAAkB,IAAI,OAAO,CAAC,OAAO,CAAC;cAUtC,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;cAW7B,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAK/C;;OAEG;IACG,eAAe,CAAC,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAmDzF;;OAEG;IACG,gBAAgB,CACpB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;QACR,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAA;QACjB,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;KAC3B,GACA,OAAO,CAAC,IAAI,CAAC;IAKhB;;OAEG;IACG,cAAc,CAAC,KAAK,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC;IAMtD;;OAEG;IACG,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAKlF"}
1
+ {"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../src/github.ts"],"names":[],"mappings":"AAUA;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB;;;;EAwE5B,CAAA;AAIF,MAAM,MAAM,qBAAqB,GAAG,YAAY,CAAC,OAAO,iBAAiB,CAAC,CAAA"}
package/dist/github.js CHANGED
@@ -1,131 +1,78 @@
1
- import { IntegrationBase } from './base.js';
1
+ import { defineIntegration } from '@skelm/integration-sdk';
2
+ import { z } from 'zod';
3
+ const githubCredentialsSchema = z.object({
4
+ token: z.string().min(1, 'GitHub token is required'),
5
+ ownerId: z.string().min(1, 'GitHub ownerId is required'),
6
+ repoName: z.string().min(1, 'GitHub repoName is required'),
7
+ });
2
8
  /**
3
- * GitHub integration for skelm pipelines
9
+ * GitHub integration for skelm pipelines.
4
10
  *
5
11
  * Supports:
6
12
  * - Issue/PR triggers
7
13
  * - Webhook event handling
8
14
  * - Repository polling
15
+ * - Notifications via issue/PR comments
9
16
  */
10
- export class GitHubIntegration extends IntegrationBase {
11
- id = 'github';
12
- name = 'GitHub';
13
- capabilities = {
17
+ export const GitHubIntegration = defineIntegration({
18
+ id: 'github',
19
+ name: 'GitHub',
20
+ capabilities: {
14
21
  canTrigger: true,
15
22
  canReceiveWebhooks: true,
16
23
  canPoll: true,
17
24
  canSendNotifications: true,
18
- };
19
- apiBaseUrl = 'https://api.github.com';
20
- octokit = null; // Would use @octokit/rest in production
21
- async validateCredentials() {
22
- const { token, ownerId, repoName } = this.config.credentials;
23
- if (!token || !ownerId || !repoName) {
24
- throw new Error('GitHub credentials missing: token, ownerId, and repoName required');
25
+ },
26
+ credentialsSchema: githubCredentialsSchema,
27
+ async validateCredentials(creds) {
28
+ // Warn on unexpected token formats but don't hard-fail — fine-grained
29
+ // tokens don't share the ghp_/gho_ prefixes.
30
+ const { token } = creds;
31
+ if (!token.startsWith('ghp_') && !token.startsWith('gho_') && !token.startsWith('github_')) {
32
+ console.warn('GitHub token does not match expected patterns (ghp_/gho_/github_)');
25
33
  }
26
- // In production, validate the token with GitHub API
27
- // For now, we just check it exists and has reasonable format
28
- const tokenStr = String(token);
29
- if (!tokenStr.startsWith('ghp_') &&
30
- !tokenStr.startsWith('gho_') &&
31
- !tokenStr.startsWith('github_')) {
32
- // Warning only - might be a fine-grained token
33
- console.warn('GitHub token does not match expected patterns');
34
- }
35
- }
36
- async performHealthCheck() {
37
- try {
38
- // In production, make a simple API call to verify connectivity
39
- // For now, just check we have credentials
40
- return !!this.config.credentials.token;
41
- }
42
- catch {
43
- return false;
44
- }
45
- }
46
- async setupWebhook() {
47
- const { webhook } = this.config;
48
- if (!webhook) {
49
- return;
50
- }
51
- // In production, register webhook with GitHub
52
- // This would use the GitHub API to create a repo webhook
53
- console.log(`GitHub webhook would be registered at ${webhook.path}`);
54
- }
34
+ },
35
+ async performHealthCheck(creds) {
36
+ // In production: call GET /user or GET /repos/:owner/:repo
37
+ return typeof creds.token === 'string' && creds.token.length > 0;
38
+ },
39
+ async setupWebhook(_creds, config, webhook) {
40
+ // In production: POST /repos/:owner/:repo/hooks
41
+ console.log(`GitHub webhook would be registered at ${webhook.path} for ${config.name}`);
42
+ },
55
43
  async cleanupWebhook() {
56
- // In production, unregister webhook from GitHub
44
+ // In production: DELETE /repos/:owner/:repo/hooks/:hook_id
57
45
  console.log('GitHub webhook would be unregistered');
58
- }
59
- /**
60
- * Convert GitHub webhook event to RunInput
61
- */
62
- async eventToRunInput(event) {
63
- if (!this.capabilities.canTrigger) {
64
- return null;
65
- }
46
+ },
47
+ async eventToRunInput(event, creds) {
66
48
  const { event: eventType, payload } = event;
67
- // Handle issue events
68
49
  if (eventType === 'issues') {
69
- const issuePayload = payload;
50
+ const p = payload;
70
51
  return {
71
52
  trigger: {
72
53
  type: 'github-issue',
73
54
  event: eventType,
74
- action: issuePayload.action,
75
- owner: issuePayload.owner,
76
- repo: issuePayload.repo,
77
- issueNumber: issuePayload.issueNumber,
78
- title: issuePayload.title,
79
- body: issuePayload.body,
80
- labels: issuePayload.labels,
55
+ action: p.action,
56
+ owner: p.owner ?? creds.ownerId,
57
+ repo: p.repo ?? creds.repoName,
58
+ issueNumber: p.issueNumber,
59
+ title: p.title,
60
+ body: p.body,
61
+ labels: p.labels,
81
62
  },
82
63
  };
83
64
  }
84
- // Handle pull request events
85
65
  if (eventType === 'pull_request') {
86
- return {
87
- trigger: {
88
- type: 'github-pr',
89
- event: eventType,
90
- payload: payload,
91
- },
92
- };
66
+ return { trigger: { type: 'github-pr', event: eventType, payload } };
93
67
  }
94
- // Handle push events
95
68
  if (eventType === 'push') {
96
- return {
97
- trigger: {
98
- type: 'github-push',
99
- event: eventType,
100
- payload: payload,
101
- },
102
- };
69
+ return { trigger: { type: 'github-push', event: eventType, payload } };
103
70
  }
104
- // Other events can be ignored or handled as needed
105
71
  return null;
106
- }
107
- /**
108
- * Send notification to GitHub (issue comment, PR comment, etc.)
109
- */
72
+ },
110
73
  async sendNotification(message, options) {
111
- // In production, use GitHub API to post comments
74
+ // In production: POST /repos/:owner/:repo/issues/:issue_number/comments
112
75
  console.log(`GitHub notification: ${message}`, options);
113
- }
114
- /**
115
- * Poll for new issues/PRs
116
- */
117
- async pollForChanges(since) {
118
- // In production, query GitHub API for changes
119
- console.log(`Polling GitHub for changes since ${since?.toISOString()}`);
120
- return [];
121
- }
122
- /**
123
- * Get issue or PR details
124
- */
125
- async getIssueOrPr(owner, repo, number) {
126
- // In production, fetch from GitHub API
127
- console.log(`Fetching ${owner}/${repo}#${number}`);
128
- return {};
129
- }
130
- }
76
+ },
77
+ });
131
78
  //# sourceMappingURL=github.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"github.js","sourceRoot":"","sources":["../src/github.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAG3C;;;;;;;GAOG;AACH,MAAM,OAAO,iBAAkB,SAAQ,eAAe;IAClC,EAAE,GAAG,QAAiB,CAAA;IACtB,IAAI,GAAG,QAAQ,CAAA;IACxB,YAAY,GAAG;QACtB,UAAU,EAAE,IAAI;QAChB,kBAAkB,EAAE,IAAI;QACxB,OAAO,EAAE,IAAI;QACb,oBAAoB,EAAE,IAAI;KAC3B,CAAA;IAEO,UAAU,GAAG,wBAAwB,CAAA;IACrC,OAAO,GAAmB,IAAI,CAAA,CAAC,wCAAwC;IAErE,KAAK,CAAC,mBAAmB;QACjC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,CAAA;QAE5D,IAAI,CAAC,KAAK,IAAI,CAAC,OAAO,IAAI,CAAC,QAAQ,EAAE,CAAC;YACpC,MAAM,IAAI,KAAK,CAAC,mEAAmE,CAAC,CAAA;QACtF,CAAC;QAED,oDAAoD;QACpD,6DAA6D;QAC7D,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,CAAA;QAC9B,IACE,CAAC,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC;YAC5B,CAAC,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC;YAC5B,CAAC,QAAQ,CAAC,UAAU,CAAC,SAAS,CAAC,EAC/B,CAAC;YACD,+CAA+C;YAC/C,OAAO,CAAC,IAAI,CAAC,+CAA+C,CAAC,CAAA;QAC/D,CAAC;IACH,CAAC;IAES,KAAK,CAAC,kBAAkB;QAChC,IAAI,CAAC;YACH,+DAA+D;YAC/D,0CAA0C;YAC1C,OAAO,CAAC,CA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  /**
2
- * @skelm/integrations - Third-party integration abstractions
2
+ * @skelm/integrations — built-in third-party integrations for skelm pipelines.
3
3
  *
4
- * Provides typed connectors for GitHub, Slack, Jira, IMAP, Telegram, etc.
4
+ * Types and the IntegrationBase class are re-exported from @skelm/integration-sdk
5
+ * so existing consumers of this package continue to work without changes.
6
+ * New integrations should depend directly on @skelm/integration-sdk.
5
7
  */
6
- export type { IntegrationConfig, WebhookConfig, RateLimitConfig, IntegrationCapabilities, Integration, GitHubConfig, GitHubWebhookEvent, GitHubIssueTrigger, SlackConfig, SlackWebhookEvent, JiraConfig, JiraIssueTrigger, IMAPConfig, EmailTrigger, TelegramConfig, TelegramWebhookEvent, TelegramMessageTrigger, } from './types.js';
7
- export { IntegrationBase } from './base.js';
8
+ export type { RunInput, IntegrationConfig, WebhookConfig, RateLimitConfig, IntegrationCapabilities, Integration, GitHubConfig, GitHubWebhookEvent, GitHubIssueTrigger, SlackConfig, SlackWebhookEvent, JiraConfig, JiraIssueTrigger, IMAPConfig, EmailTrigger, TelegramConfig, TelegramWebhookEvent, TelegramMessageTrigger, } from '@skelm/integration-sdk';
9
+ export { IntegrationBase, defineIntegration, createIntegrationPlugin, } from '@skelm/integration-sdk';
10
+ export type { DefineIntegrationOptions, IntegrationClass } from '@skelm/integration-sdk';
8
11
  export { GitHubIntegration } from './github.js';
9
- export { SlackIntegration } from './slack.js';
12
+ export { SlackIntegration, verifySlackSignature } from './slack.js';
13
+ export { TelegramIntegration, telegramUpdateToInput, type CreateTelegramTriggerSourceOptions, type TelegramGetUpdatesOptions, type TelegramMessageInput, type TelegramSendMessageOptions, type TelegramTriggerSource, } from './telegram.js';
10
14
  export { IntegrationRegistry } from './registry.js';
11
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EACV,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,uB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AA"}
package/dist/index.js CHANGED
@@ -1,13 +1,15 @@
1
1
  /**
2
- * @skelm/integrations - Third-party integration abstractions
2
+ * @skelm/integrations — built-in third-party integrations for skelm pipelines.
3
3
  *
4
- * Provides typed connectors for GitHub, Slack, Jira, IMAP, Telegram, etc.
4
+ * Types and the IntegrationBase class are re-exported from @skelm/integration-sdk
5
+ * so existing consumers of this package continue to work without changes.
6
+ * New integrations should depend directly on @skelm/integration-sdk.
5
7
  */
6
- // Integration base class
7
- export { IntegrationBase } from './base.js';
8
- // Integration implementations
8
+ export { IntegrationBase, defineIntegration, createIntegrationPlugin, } from '@skelm/integration-sdk';
9
+ // Built-in integration implementations
9
10
  export { GitHubIntegration } from './github.js';
10
- export { SlackIntegration } from './slack.js';
11
+ export { SlackIntegration, verifySlackSignature } from './slack.js';
12
+ export { TelegramIntegration, telegramUpdateToInput, } from './telegram.js';
11
13
  // Integration registry
12
14
  export { IntegrationRegistry } from './registry.js';
13
15
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAsBH,yBAAyB;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAE3C,8BAA8B;AAC9B,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAE7C,uBAAuB;AACvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAwBH,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,wBAAwB,CAAA;AAG/B,uCAAuC;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AACnE,OAAO,EACL,mBAAmB,EACnB,qBAAqB,GAMtB,MAAM,eAAe,CAAA;AAEtB,uBAAuB;AACvB,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA"}
package/dist/slack.d.ts CHANGED
@@ -1,7 +1,5 @@
1
- import { IntegrationBase } from './base.js';
2
- import type { SlackWebhookEvent } from './types.js';
3
1
  /**
4
- * Slack integration for skelm pipelines
2
+ * Slack integration for skelm pipelines.
5
3
  *
6
4
  * Supports:
7
5
  * - Slash commands
@@ -9,45 +7,15 @@ import type { SlackWebhookEvent } from './types.js';
9
7
  * - Event subscriptions
10
8
  * - Direct message triggers
11
9
  */
12
- export declare class SlackIntegration extends IntegrationBase {
13
- readonly id: "slack";
14
- readonly name = "Slack";
15
- readonly capabilities: {
16
- canTrigger: boolean;
17
- canReceiveWebhooks: boolean;
18
- canPoll: boolean;
19
- canSendNotifications: boolean;
20
- };
21
- private slackApiBaseUrl;
22
- private botToken;
23
- protected validateCredentials(): Promise<void>;
24
- protected performHealthCheck(): Promise<boolean>;
25
- protected setupWebhook(): Promise<void>;
26
- protected cleanupWebhook(): Promise<void>;
27
- /**
28
- * Verify Slack webhook signature
29
- */
30
- verifySignature(signingSecret: string, timestamp: string, body: string, signature: string): boolean;
31
- /**
32
- * Convert Slack webhook event to RunInput
33
- */
34
- eventToRunInput(event: SlackWebhookEvent): Promise<Record<string, unknown> | null>;
35
- /**
36
- * Send message to Slack channel
37
- */
38
- sendNotification(message: string, options?: {
39
- channelId?: string;
40
- threadTs?: string;
41
- ephemeral?: boolean;
42
- userId?: string;
43
- }): Promise<void>;
44
- /**
45
- * Post ephemeral message
46
- */
47
- postEphemeral(channelId: string, userId: string, message: string): Promise<void>;
48
- /**
49
- * Respond to a Slack action (with block kit)
50
- */
51
- respondWithBlocks(triggerId: string, blocks: unknown[]): Promise<void>;
52
- }
10
+ export declare const SlackIntegration: import("@skelm/integration-sdk").IntegrationClass<{
11
+ botToken: string;
12
+ signingSecret: string;
13
+ channelId?: string | undefined;
14
+ }>;
15
+ /**
16
+ * Verify a Slack webhook signature.
17
+ * Call this in your webhook handler before processing the event.
18
+ */
19
+ export declare function verifySlackSignature(signingSecret: string, timestamp: string, body: string, signature: string): boolean;
20
+ export type SlackIntegrationType = InstanceType<typeof SlackIntegration>;
53
21
  //# sourceMappingURL=slack.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"slack.d.ts","sourceRoot":"","sources":["../src/slack.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAC3C,OAAO,KAAK,EAAe,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAEhE;;;;;;;;GAQG;AACH,qBAAa,gBAAiB,SAAQ,eAAe;IACnD,QAAQ,CAAC,EAAE,EAAG,OAAO,CAAS;IAC9B,QAAQ,CAAC,IAAI,WAAU;IACvB,QAAQ,CAAC,YAAY;;;;;MAKpB;IAED,OAAO,CAAC,eAAe,CAA0B;IACjD,OAAO,CAAC,QAAQ,CAAsB;cAEtB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;cAepC,kBAAkB,IAAI,OAAO,CAAC,OAAO,CAAC;cAStC,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;cAa7B,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC;IAK/C;;OAEG;IACH,eAAe,CACb,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GAChB,OAAO;IAOV;;OAEG;IACG,eAAe,CAAC,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IA4DxF;;OAEG;IACG,gBAAgB,CACpB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;QACR,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,QAAQ,CA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