@orgloop/connector-linear-webhook 0.1.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/LICENSE.md +21 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -0
- package/dist/source.d.ts +49 -0
- package/dist/source.d.ts.map +1 -0
- package/dist/source.js +280 -0
- package/dist/source.js.map +1 -0
- package/package.json +32 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 OrgLoop contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @orgloop/connector-linear-webhook — Linear webhook source connector registration.
|
|
3
|
+
*
|
|
4
|
+
* Receives Linear webhook POST deliveries and normalizes them into OrgLoop events
|
|
5
|
+
* using the same normalizer functions as the polling Linear connector.
|
|
6
|
+
*/
|
|
7
|
+
import type { ConnectorRegistration } from '@orgloop/sdk';
|
|
8
|
+
export default function register(): ConnectorRegistration;
|
|
9
|
+
export { LinearWebhookSource } from './source.js';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AAG1D,MAAM,CAAC,OAAO,UAAU,QAAQ,IAAI,qBAAqB,CAsBxD;AAED,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @orgloop/connector-linear-webhook — Linear webhook source connector registration.
|
|
3
|
+
*
|
|
4
|
+
* Receives Linear webhook POST deliveries and normalizes them into OrgLoop events
|
|
5
|
+
* using the same normalizer functions as the polling Linear connector.
|
|
6
|
+
*/
|
|
7
|
+
import { LinearWebhookSource } from './source.js';
|
|
8
|
+
export default function register() {
|
|
9
|
+
return {
|
|
10
|
+
id: 'linear-webhook',
|
|
11
|
+
source: LinearWebhookSource,
|
|
12
|
+
setup: {
|
|
13
|
+
env_vars: [
|
|
14
|
+
{
|
|
15
|
+
name: 'LINEAR_WEBHOOK_SECRET',
|
|
16
|
+
description: 'HMAC signing secret for validating Linear webhook payloads',
|
|
17
|
+
help_url: 'https://developers.linear.app/docs/graphql/webhooks',
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
integrations: [
|
|
21
|
+
{
|
|
22
|
+
id: 'linear-webhook-setup',
|
|
23
|
+
description: 'Configure a webhook in your Linear workspace settings pointing to the OrgLoop endpoint',
|
|
24
|
+
platform: 'linear',
|
|
25
|
+
},
|
|
26
|
+
],
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export { LinearWebhookSource } from './source.js';
|
|
31
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,CAAC,OAAO,UAAU,QAAQ;IAC/B,OAAO;QACN,EAAE,EAAE,gBAAgB;QACpB,MAAM,EAAE,mBAAmB;QAC3B,KAAK,EAAE;YACN,QAAQ,EAAE;gBACT;oBACC,IAAI,EAAE,uBAAuB;oBAC7B,WAAW,EAAE,4DAA4D;oBACzE,QAAQ,EAAE,qDAAqD;iBAC/D;aACD;YACD,YAAY,EAAE;gBACb;oBACC,EAAE,EAAE,sBAAsB;oBAC1B,WAAW,EACV,wFAAwF;oBACzF,QAAQ,EAAE,QAAQ;iBAClB;aACD;SACD;KACD,CAAC;AACH,CAAC;AAED,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/source.d.ts
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Linear webhook source connector — receives Linear webhook POST deliveries
|
|
3
|
+
* and normalizes them into OrgLoop events using the same normalizers as the
|
|
4
|
+
* polling connector.
|
|
5
|
+
*
|
|
6
|
+
* Linear webhook payload shape:
|
|
7
|
+
* { action, createdAt, data, type, url, updatedFrom }
|
|
8
|
+
*
|
|
9
|
+
* Signature: Linear-Signature header, HMAC-SHA256 of raw body with signing secret.
|
|
10
|
+
*/
|
|
11
|
+
import type { OrgLoopEvent, PollResult, SourceConfig, SourceConnector, WebhookHandler } from '@orgloop/sdk';
|
|
12
|
+
export interface LinearWebhookConfig {
|
|
13
|
+
/** HMAC signing secret for validating webhook signatures */
|
|
14
|
+
secret?: string;
|
|
15
|
+
/** URL path to mount the webhook handler on */
|
|
16
|
+
path?: string;
|
|
17
|
+
/** Event types to accept (e.g., ["Issue", "Comment"]) */
|
|
18
|
+
events?: string[];
|
|
19
|
+
/** Optional team key filter — only process events for this team */
|
|
20
|
+
team?: string;
|
|
21
|
+
/** Directory for persisting buffered events across restarts */
|
|
22
|
+
buffer_dir?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare class LinearWebhookSource implements SourceConnector {
|
|
25
|
+
readonly id = "linear-webhook";
|
|
26
|
+
private secret?;
|
|
27
|
+
private sourceId;
|
|
28
|
+
private allowedEvents?;
|
|
29
|
+
private teamFilter?;
|
|
30
|
+
private pendingEvents;
|
|
31
|
+
private bufferPath?;
|
|
32
|
+
init(config: SourceConfig): Promise<void>;
|
|
33
|
+
poll(_checkpoint: string | null): Promise<PollResult>;
|
|
34
|
+
webhook(): WebhookHandler;
|
|
35
|
+
shutdown(): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Normalize a Linear webhook payload into OrgLoop events.
|
|
38
|
+
* Uses the same normalizer functions as the polling connector to produce
|
|
39
|
+
* identical event shapes.
|
|
40
|
+
*/
|
|
41
|
+
normalizeWebhookPayload(resourceType: string, action: string, payload: Record<string, unknown>): OrgLoopEvent[];
|
|
42
|
+
private normalizeIssueEvent;
|
|
43
|
+
private normalizeCommentEvent;
|
|
44
|
+
private isEventAllowed;
|
|
45
|
+
private buildRawEvent;
|
|
46
|
+
private persistEvent;
|
|
47
|
+
private loadBufferedEvents;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../src/source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAcH,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 -0,0 +1,280 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Linear webhook source connector — receives Linear webhook POST deliveries
|
|
3
|
+
* and normalizes them into OrgLoop events using the same normalizers as the
|
|
4
|
+
* polling connector.
|
|
5
|
+
*
|
|
6
|
+
* Linear webhook payload shape:
|
|
7
|
+
* { action, createdAt, data, type, url, updatedFrom }
|
|
8
|
+
*
|
|
9
|
+
* Signature: Linear-Signature header, HMAC-SHA256 of raw body with signing secret.
|
|
10
|
+
*/
|
|
11
|
+
import { createHmac, timingSafeEqual } from 'node:crypto';
|
|
12
|
+
import { appendFileSync, existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
13
|
+
import { join } from 'node:path';
|
|
14
|
+
import { normalizeAssigneeChange, normalizeComment, normalizeIssueStateChange, normalizeLabelChange, normalizeNewIssue, normalizePriorityChange, } from '@orgloop/connector-linear';
|
|
15
|
+
import { buildEvent } from '@orgloop/sdk';
|
|
16
|
+
/** Resolve env var references like ${LINEAR_WEBHOOK_SECRET} */
|
|
17
|
+
function resolveEnvVar(value) {
|
|
18
|
+
const match = value.match(/^\$\{(.+)\}$/);
|
|
19
|
+
if (match) {
|
|
20
|
+
const envValue = process.env[match[1]];
|
|
21
|
+
if (!envValue) {
|
|
22
|
+
throw new Error(`Environment variable ${match[1]} is not set`);
|
|
23
|
+
}
|
|
24
|
+
return envValue;
|
|
25
|
+
}
|
|
26
|
+
return value;
|
|
27
|
+
}
|
|
28
|
+
export class LinearWebhookSource {
|
|
29
|
+
id = 'linear-webhook';
|
|
30
|
+
secret;
|
|
31
|
+
sourceId = 'linear-webhook';
|
|
32
|
+
allowedEvents;
|
|
33
|
+
teamFilter;
|
|
34
|
+
pendingEvents = [];
|
|
35
|
+
bufferPath;
|
|
36
|
+
async init(config) {
|
|
37
|
+
this.sourceId = config.id;
|
|
38
|
+
const cfg = config.config;
|
|
39
|
+
if (cfg.secret) {
|
|
40
|
+
this.secret = resolveEnvVar(cfg.secret);
|
|
41
|
+
}
|
|
42
|
+
if (cfg.events && cfg.events.length > 0) {
|
|
43
|
+
this.allowedEvents = new Set(cfg.events);
|
|
44
|
+
}
|
|
45
|
+
if (cfg.team) {
|
|
46
|
+
this.teamFilter = cfg.team;
|
|
47
|
+
}
|
|
48
|
+
if (cfg.buffer_dir) {
|
|
49
|
+
const dir = resolveEnvVar(cfg.buffer_dir);
|
|
50
|
+
if (!existsSync(dir)) {
|
|
51
|
+
mkdirSync(dir, { recursive: true });
|
|
52
|
+
}
|
|
53
|
+
this.bufferPath = join(dir, `linear-webhook-${this.sourceId}.jsonl`);
|
|
54
|
+
this.loadBufferedEvents();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
async poll(_checkpoint) {
|
|
58
|
+
let events;
|
|
59
|
+
if (this.bufferPath) {
|
|
60
|
+
events = this.loadBufferedEvents();
|
|
61
|
+
writeFileSync(this.bufferPath, '');
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
events = [...this.pendingEvents];
|
|
65
|
+
this.pendingEvents = [];
|
|
66
|
+
}
|
|
67
|
+
const checkpoint = events.length > 0 ? events[events.length - 1].timestamp : new Date().toISOString();
|
|
68
|
+
return { events, checkpoint };
|
|
69
|
+
}
|
|
70
|
+
webhook() {
|
|
71
|
+
return async (req, res) => {
|
|
72
|
+
if (req.method !== 'POST') {
|
|
73
|
+
res.writeHead(405, { 'Content-Type': 'application/json' });
|
|
74
|
+
res.end(JSON.stringify({ error: 'Method not allowed' }));
|
|
75
|
+
return [];
|
|
76
|
+
}
|
|
77
|
+
const bodyStr = await readBody(req);
|
|
78
|
+
// HMAC-SHA256 signature validation
|
|
79
|
+
if (this.secret) {
|
|
80
|
+
const signature = req.headers['linear-signature'];
|
|
81
|
+
if (!signature) {
|
|
82
|
+
res.writeHead(401, { 'Content-Type': 'application/json' });
|
|
83
|
+
res.end(JSON.stringify({ error: 'Missing Linear-Signature header' }));
|
|
84
|
+
return [];
|
|
85
|
+
}
|
|
86
|
+
const expected = createHmac('sha256', this.secret).update(bodyStr).digest('hex');
|
|
87
|
+
const sigBuffer = Buffer.from(signature);
|
|
88
|
+
const expectedBuffer = Buffer.from(expected);
|
|
89
|
+
if (sigBuffer.length !== expectedBuffer.length ||
|
|
90
|
+
!timingSafeEqual(sigBuffer, expectedBuffer)) {
|
|
91
|
+
res.writeHead(401, { 'Content-Type': 'application/json' });
|
|
92
|
+
res.end(JSON.stringify({ error: 'Invalid signature' }));
|
|
93
|
+
return [];
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
let payload;
|
|
97
|
+
try {
|
|
98
|
+
payload = JSON.parse(bodyStr);
|
|
99
|
+
}
|
|
100
|
+
catch {
|
|
101
|
+
res.writeHead(400, { 'Content-Type': 'application/json' });
|
|
102
|
+
res.end(JSON.stringify({ error: 'Invalid JSON payload' }));
|
|
103
|
+
return [];
|
|
104
|
+
}
|
|
105
|
+
// Linear webhook payloads have: action, type, data, url, createdAt, updatedFrom
|
|
106
|
+
const resourceType = payload.type;
|
|
107
|
+
const action = payload.action;
|
|
108
|
+
if (!resourceType || !action) {
|
|
109
|
+
res.writeHead(400, { 'Content-Type': 'application/json' });
|
|
110
|
+
res.end(JSON.stringify({ error: 'Missing type or action field' }));
|
|
111
|
+
return [];
|
|
112
|
+
}
|
|
113
|
+
// Team filter: if configured, only accept events for the specified team
|
|
114
|
+
if (this.teamFilter) {
|
|
115
|
+
const data = payload.data;
|
|
116
|
+
const team = data?.team;
|
|
117
|
+
const teamKey = team?.key;
|
|
118
|
+
if (teamKey && teamKey !== this.teamFilter) {
|
|
119
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
120
|
+
res.end(JSON.stringify({ ok: true, filtered: true, reason: 'team_mismatch' }));
|
|
121
|
+
return [];
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
const events = this.normalizeWebhookPayload(resourceType, action, payload);
|
|
125
|
+
for (const event of events) {
|
|
126
|
+
this.persistEvent(event);
|
|
127
|
+
}
|
|
128
|
+
res.writeHead(200, { 'Content-Type': 'application/json' });
|
|
129
|
+
res.end(JSON.stringify({
|
|
130
|
+
ok: true,
|
|
131
|
+
events_created: events.length,
|
|
132
|
+
event_ids: events.map((e) => e.id),
|
|
133
|
+
}));
|
|
134
|
+
return events;
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
async shutdown() {
|
|
138
|
+
this.pendingEvents = [];
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Normalize a Linear webhook payload into OrgLoop events.
|
|
142
|
+
* Uses the same normalizer functions as the polling connector to produce
|
|
143
|
+
* identical event shapes.
|
|
144
|
+
*/
|
|
145
|
+
normalizeWebhookPayload(resourceType, action, payload) {
|
|
146
|
+
const data = payload.data;
|
|
147
|
+
if (!data)
|
|
148
|
+
return [];
|
|
149
|
+
const updatedFrom = payload.updatedFrom;
|
|
150
|
+
switch (resourceType) {
|
|
151
|
+
case 'Issue': {
|
|
152
|
+
if (!this.isEventAllowed('Issue'))
|
|
153
|
+
return [];
|
|
154
|
+
return this.normalizeIssueEvent(action, data, updatedFrom);
|
|
155
|
+
}
|
|
156
|
+
case 'Comment': {
|
|
157
|
+
if (!this.isEventAllowed('Comment'))
|
|
158
|
+
return [];
|
|
159
|
+
if (action !== 'create')
|
|
160
|
+
return this.buildRawEvent(resourceType, action, payload);
|
|
161
|
+
return this.normalizeCommentEvent(data);
|
|
162
|
+
}
|
|
163
|
+
default:
|
|
164
|
+
return this.buildRawEvent(resourceType, action, payload);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
normalizeIssueEvent(action, data, updatedFrom) {
|
|
168
|
+
if (action === 'create') {
|
|
169
|
+
return [
|
|
170
|
+
normalizeNewIssue(this.sourceId, {
|
|
171
|
+
id: data.id,
|
|
172
|
+
identifier: data.identifier,
|
|
173
|
+
title: data.title,
|
|
174
|
+
description: data.description,
|
|
175
|
+
url: data.url,
|
|
176
|
+
state: { name: data.state?.name ?? 'Unknown' },
|
|
177
|
+
creator: data.creator,
|
|
178
|
+
createdAt: data.createdAt,
|
|
179
|
+
}),
|
|
180
|
+
];
|
|
181
|
+
}
|
|
182
|
+
if (action === 'update' && updatedFrom) {
|
|
183
|
+
const events = [];
|
|
184
|
+
const issueBase = {
|
|
185
|
+
identifier: data.identifier,
|
|
186
|
+
title: data.title,
|
|
187
|
+
url: data.url,
|
|
188
|
+
assignee: data.assignee,
|
|
189
|
+
updatedAt: data.updatedAt,
|
|
190
|
+
};
|
|
191
|
+
// State change
|
|
192
|
+
if (updatedFrom.state !== undefined) {
|
|
193
|
+
const previousState = updatedFrom.state?.name;
|
|
194
|
+
const currentState = data.state?.name ?? 'Unknown';
|
|
195
|
+
events.push(normalizeIssueStateChange(this.sourceId, { id: data.id, state: { name: currentState }, ...issueBase }, previousState));
|
|
196
|
+
}
|
|
197
|
+
// Assignee change
|
|
198
|
+
if (updatedFrom.assigneeId !== undefined) {
|
|
199
|
+
const previousAssignee = updatedFrom.assignee?.name ?? null;
|
|
200
|
+
events.push(normalizeAssigneeChange(this.sourceId, issueBase, previousAssignee));
|
|
201
|
+
}
|
|
202
|
+
// Priority change
|
|
203
|
+
if (updatedFrom.priority !== undefined) {
|
|
204
|
+
events.push(normalizePriorityChange(this.sourceId, issueBase, updatedFrom.priority, data.priority));
|
|
205
|
+
}
|
|
206
|
+
// Label change
|
|
207
|
+
if (updatedFrom.labelIds !== undefined) {
|
|
208
|
+
const prevLabels = (updatedFrom.labels ?? []).map((l) => l.name);
|
|
209
|
+
const newLabels = (data.labels ?? []).map((l) => l.name);
|
|
210
|
+
events.push(normalizeLabelChange(this.sourceId, issueBase, prevLabels, newLabels));
|
|
211
|
+
}
|
|
212
|
+
if (events.length > 0)
|
|
213
|
+
return events;
|
|
214
|
+
}
|
|
215
|
+
// Fallback for unrecognized issue actions (remove, etc.)
|
|
216
|
+
return this.buildRawEvent('Issue', action, { data });
|
|
217
|
+
}
|
|
218
|
+
normalizeCommentEvent(data) {
|
|
219
|
+
const issue = data.issue;
|
|
220
|
+
return [
|
|
221
|
+
normalizeComment(this.sourceId, {
|
|
222
|
+
id: data.id,
|
|
223
|
+
body: data.body,
|
|
224
|
+
url: data.url,
|
|
225
|
+
createdAt: data.createdAt,
|
|
226
|
+
user: data.user,
|
|
227
|
+
}, {
|
|
228
|
+
identifier: issue?.identifier ?? 'unknown',
|
|
229
|
+
title: issue?.title ?? '',
|
|
230
|
+
assignee: issue?.assignee,
|
|
231
|
+
creator: issue?.creator,
|
|
232
|
+
}),
|
|
233
|
+
];
|
|
234
|
+
}
|
|
235
|
+
isEventAllowed(eventType) {
|
|
236
|
+
if (!this.allowedEvents)
|
|
237
|
+
return true;
|
|
238
|
+
return this.allowedEvents.has(eventType);
|
|
239
|
+
}
|
|
240
|
+
buildRawEvent(resourceType, action, payload) {
|
|
241
|
+
return [
|
|
242
|
+
buildEvent({
|
|
243
|
+
source: this.sourceId,
|
|
244
|
+
type: 'resource.changed',
|
|
245
|
+
provenance: {
|
|
246
|
+
platform: 'linear',
|
|
247
|
+
platform_event: `${resourceType.toLowerCase()}.${action}`,
|
|
248
|
+
},
|
|
249
|
+
payload,
|
|
250
|
+
}),
|
|
251
|
+
];
|
|
252
|
+
}
|
|
253
|
+
persistEvent(event) {
|
|
254
|
+
if (this.bufferPath) {
|
|
255
|
+
appendFileSync(this.bufferPath, `${JSON.stringify(event)}\n`);
|
|
256
|
+
}
|
|
257
|
+
else {
|
|
258
|
+
this.pendingEvents.push(event);
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
loadBufferedEvents() {
|
|
262
|
+
if (!this.bufferPath || !existsSync(this.bufferPath)) {
|
|
263
|
+
return [];
|
|
264
|
+
}
|
|
265
|
+
const content = readFileSync(this.bufferPath, 'utf-8').trim();
|
|
266
|
+
if (!content) {
|
|
267
|
+
return [];
|
|
268
|
+
}
|
|
269
|
+
return content.split('\n').map((line) => JSON.parse(line));
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
function readBody(req) {
|
|
273
|
+
return new Promise((resolve, reject) => {
|
|
274
|
+
const chunks = [];
|
|
275
|
+
req.on('data', (chunk) => chunks.push(chunk));
|
|
276
|
+
req.on('end', () => resolve(Buffer.concat(chunks).toString('utf-8')));
|
|
277
|
+
req.on('error', reject);
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
//# sourceMappingURL=source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source.js","sourceRoot":"","sources":["../src/source.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7F,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EACN,uBAAuB,EACvB,gBAAgB,EAChB,yBAAyB,EACzB,oBAAoB,EACpB,iBAAiB,EACjB,uBAAuB,GACvB,MAAM,2BAA2B,CAAC;AAQnC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAe1C,+DAA+D;AAC/D,SAAS,aAAa,CAAC,KAAa;IACnC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;IAC1C,IAAI,KAAK,EAAE,CAAC;QACX,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QACvC,IAAI,CAAC,QAAQ,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,wBAAwB,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC;QAChE,CAAC;QACD,OAAO,QAAQ,CAAC;IACjB,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC;AAED,MAAM,OAAO,mBAAmB;IACtB,EAAE,GAAG,gBAAgB,CAAC;IACvB,MAAM,CAAU;IAChB,QAAQ,GAAG,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AC;QACX,CAAC;QACD,MAAM,OAAO,GAAG,YAAY,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;QAC9D,IAAI,CAAC,OAAO,EAAE,CAAC;YACd,OAAO,EAAE,CAAC;QACX,CAAC;QACD,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAiB,CAAC,CAAC;IAC5E,CAAC;CACD;AAED,SAAS,QAAQ,CAAC,GAAoB;IACrC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACtC,MAAM,MAAM,GAAa,EAAE,CAAC;QAC5B,GAAG,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;QACtD,GAAG,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACtE,GAAG,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;AACJ,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@orgloop/connector-linear-webhook",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "OrgLoop Linear webhook connector — real-time event delivery via Linear webhooks",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"@orgloop/sdk": "0.7.1",
|
|
10
|
+
"@orgloop/connector-linear": "0.1.9"
|
|
11
|
+
},
|
|
12
|
+
"orgloop": {
|
|
13
|
+
"type": "connector",
|
|
14
|
+
"provides": [
|
|
15
|
+
"source"
|
|
16
|
+
],
|
|
17
|
+
"id": "linear-webhook"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist"
|
|
21
|
+
],
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"scripts": {
|
|
27
|
+
"build": "tsc",
|
|
28
|
+
"clean": "rm -rf dist",
|
|
29
|
+
"typecheck": "tsc --noEmit",
|
|
30
|
+
"test": "vitest run"
|
|
31
|
+
}
|
|
32
|
+
}
|