@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 +4 -31
- package/dist/base.d.ts.map +1 -1
- package/dist/base.js +4 -106
- package/dist/base.js.map +1 -1
- package/dist/github.d.ts +8 -39
- package/dist/github.d.ts.map +1 -1
- package/dist/github.js +47 -100
- package/dist/github.js.map +1 -1
- package/dist/index.d.ts +9 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/dist/slack.d.ts +12 -44
- package/dist/slack.d.ts.map +1 -1
- package/dist/slack.js +53 -96
- package/dist/slack.js.map +1 -1
- package/dist/telegram.d.ts +169 -0
- package/dist/telegram.d.ts.map +1 -0
- package/dist/telegram.js +314 -0
- package/dist/telegram.js.map +1 -0
- package/dist/types.d.ts +4 -193
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +0 -7
- package/dist/types.js.map +1 -1
- package/package.json +5 -3
package/dist/base.d.ts
CHANGED
|
@@ -1,34 +1,7 @@
|
|
|
1
|
-
import type { Integration, IntegrationCapabilities, IntegrationConfig } from './types.js';
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
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
|
|
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
|
package/dist/base.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA"}
|
package/dist/base.js
CHANGED
|
@@ -1,109 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
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
|
|
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":"
|
|
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
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
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
|
package/dist/github.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../src/github.ts"],"names":[],"mappings":"
|
|
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 {
|
|
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
|
|
11
|
-
id
|
|
12
|
-
name
|
|
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
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
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
|
|
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
|
|
50
|
+
const p = payload;
|
|
70
51
|
return {
|
|
71
52
|
trigger: {
|
|
72
53
|
type: 'github-issue',
|
|
73
54
|
event: eventType,
|
|
74
|
-
action:
|
|
75
|
-
owner:
|
|
76
|
-
repo:
|
|
77
|
-
issueNumber:
|
|
78
|
-
title:
|
|
79
|
-
body:
|
|
80
|
-
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
|
|
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
|
package/dist/github.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github.js","sourceRoot":"","sources":["../src/github.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"github.js","sourceRoot":"","sources":["../src/github.ts"],"names":[],"mappings":"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"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @skelm/integrations -
|
|
2
|
+
* @skelm/integrations — built-in third-party integrations for skelm pipelines.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
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 '
|
|
7
|
-
export { IntegrationBase } from '
|
|
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
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,YAAY,EACV,QAAQ,EACR,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,uBAAuB,EACvB,WAAW,EACX,YAAY,EACZ,kBAAkB,EAClB,kBAAkB,EAClB,WAAW,EACX,iBAAiB,EACjB,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,cAAc,EACd,oBAAoB,EACpB,sBAAsB,GACvB,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,uBAAuB,GACxB,MAAM,wBAAwB,CAAA;AAC/B,YAAY,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAGxF,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AACnE,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,KAAK,kCAAkC,EACvC,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,KAAK,0BAA0B,EAC/B,KAAK,qBAAqB,GAC3B,MAAM,eAAe,CAAA;AAGtB,OAAO,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @skelm/integrations -
|
|
2
|
+
* @skelm/integrations — built-in third-party integrations for skelm pipelines.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
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
|
-
|
|
7
|
-
|
|
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
|
|
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
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
package/dist/slack.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slack.d.ts","sourceRoot":"","sources":["../src/slack.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"slack.d.ts","sourceRoot":"","sources":["../src/slack.ts"],"names":[],"mappings":"AAUA;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB;;;;EA8F3B,CAAA;AAEF;;;GAGG;AACH,wBAAgB,oBAAoB,CAClC,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GAChB,OAAO,CAMT;AAED,MAAM,MAAM,oBAAoB,GAAG,YAAY,CAAC,OAAO,gBAAgB,CAAC,CAAA"}
|