@intentsolutions/blueprint 2.3.0 → 2.4.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/cli.js +178 -10
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/integrations/linear/client.d.ts +94 -0
- package/dist/integrations/linear/client.d.ts.map +1 -0
- package/dist/integrations/linear/client.js +398 -0
- package/dist/integrations/linear/client.js.map +1 -0
- package/dist/integrations/linear/exporter.d.ts +80 -0
- package/dist/integrations/linear/exporter.d.ts.map +1 -0
- package/dist/integrations/linear/exporter.js +438 -0
- package/dist/integrations/linear/exporter.js.map +1 -0
- package/dist/integrations/linear/index.d.ts +9 -0
- package/dist/integrations/linear/index.d.ts.map +1 -0
- package/dist/integrations/linear/index.js +8 -0
- package/dist/integrations/linear/index.js.map +1 -0
- package/dist/integrations/linear/types.d.ts +137 -0
- package/dist/integrations/linear/types.d.ts.map +1 -0
- package/dist/integrations/linear/types.js +40 -0
- package/dist/integrations/linear/types.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Linear API Client
|
|
3
|
+
* GraphQL client for Linear API
|
|
4
|
+
*/
|
|
5
|
+
const LINEAR_API_URL = 'https://api.linear.app/graphql';
|
|
6
|
+
export class LinearClient {
|
|
7
|
+
apiKey;
|
|
8
|
+
teamId;
|
|
9
|
+
constructor(config) {
|
|
10
|
+
this.apiKey = config.apiKey;
|
|
11
|
+
this.teamId = config.teamId;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Execute a GraphQL query
|
|
15
|
+
*/
|
|
16
|
+
async query(query, variables) {
|
|
17
|
+
const response = await fetch(LINEAR_API_URL, {
|
|
18
|
+
method: 'POST',
|
|
19
|
+
headers: {
|
|
20
|
+
'Content-Type': 'application/json',
|
|
21
|
+
Authorization: this.apiKey,
|
|
22
|
+
},
|
|
23
|
+
body: JSON.stringify({ query, variables }),
|
|
24
|
+
});
|
|
25
|
+
if (!response.ok) {
|
|
26
|
+
throw new Error(`Linear API error: ${response.status} ${response.statusText}`);
|
|
27
|
+
}
|
|
28
|
+
const result = await response.json();
|
|
29
|
+
if (result.errors) {
|
|
30
|
+
throw new Error(`Linear GraphQL error: ${result.errors[0].message}`);
|
|
31
|
+
}
|
|
32
|
+
return result.data;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Verify API key and get user info
|
|
36
|
+
*/
|
|
37
|
+
async verify() {
|
|
38
|
+
const data = await this.query(`
|
|
39
|
+
query {
|
|
40
|
+
viewer {
|
|
41
|
+
id
|
|
42
|
+
name
|
|
43
|
+
email
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
`);
|
|
47
|
+
return data.viewer;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Get team by ID
|
|
51
|
+
*/
|
|
52
|
+
async getTeam(teamId) {
|
|
53
|
+
const id = teamId || this.teamId;
|
|
54
|
+
const data = await this.query(`
|
|
55
|
+
query GetTeam($id: String!) {
|
|
56
|
+
team(id: $id) {
|
|
57
|
+
id
|
|
58
|
+
name
|
|
59
|
+
key
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
`, { id });
|
|
63
|
+
return data.team;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* List all teams
|
|
67
|
+
*/
|
|
68
|
+
async listTeams() {
|
|
69
|
+
const data = await this.query(`
|
|
70
|
+
query {
|
|
71
|
+
teams {
|
|
72
|
+
nodes {
|
|
73
|
+
id
|
|
74
|
+
name
|
|
75
|
+
key
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
`);
|
|
80
|
+
return data.teams.nodes;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Get workflow states for a team
|
|
84
|
+
*/
|
|
85
|
+
async getWorkflowStates(teamId) {
|
|
86
|
+
const id = teamId || this.teamId;
|
|
87
|
+
const data = await this.query(`
|
|
88
|
+
query GetStates($id: String!) {
|
|
89
|
+
team(id: $id) {
|
|
90
|
+
states {
|
|
91
|
+
nodes {
|
|
92
|
+
id
|
|
93
|
+
name
|
|
94
|
+
type
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
`, { id });
|
|
100
|
+
return data.team.states.nodes.map(s => ({ ...s, teamId: id }));
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Get backlog state for a team
|
|
104
|
+
*/
|
|
105
|
+
async getBacklogState(teamId) {
|
|
106
|
+
const states = await this.getWorkflowStates(teamId);
|
|
107
|
+
return states.find(s => s.type === 'backlog');
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Get labels for a team
|
|
111
|
+
*/
|
|
112
|
+
async getLabels(teamId) {
|
|
113
|
+
const id = teamId || this.teamId;
|
|
114
|
+
const data = await this.query(`
|
|
115
|
+
query GetLabels($id: String!) {
|
|
116
|
+
team(id: $id) {
|
|
117
|
+
labels {
|
|
118
|
+
nodes {
|
|
119
|
+
id
|
|
120
|
+
name
|
|
121
|
+
color
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
`, { id });
|
|
127
|
+
return data.team.labels.nodes.map(l => ({ ...l, teamId: id }));
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Create a label
|
|
131
|
+
*/
|
|
132
|
+
async createLabel(name, color, teamId) {
|
|
133
|
+
const id = teamId || this.teamId;
|
|
134
|
+
const data = await this.query(`
|
|
135
|
+
mutation CreateLabel($name: String!, $color: String!, $teamId: String!) {
|
|
136
|
+
issueLabelCreate(input: { name: $name, color: $color, teamId: $teamId }) {
|
|
137
|
+
success
|
|
138
|
+
issueLabel {
|
|
139
|
+
id
|
|
140
|
+
name
|
|
141
|
+
color
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
`, { name, color, teamId: id });
|
|
146
|
+
if (!data.issueLabelCreate.success) {
|
|
147
|
+
throw new Error(`Failed to create label: ${name}`);
|
|
148
|
+
}
|
|
149
|
+
return { ...data.issueLabelCreate.issueLabel, teamId: id };
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Ensure labels exist, create if missing
|
|
153
|
+
*/
|
|
154
|
+
async ensureLabels(labels, teamId) {
|
|
155
|
+
const existingLabels = await this.getLabels(teamId);
|
|
156
|
+
const result = [];
|
|
157
|
+
for (const label of labels) {
|
|
158
|
+
const existing = existingLabels.find(l => l.name.toLowerCase() === label.name.toLowerCase());
|
|
159
|
+
if (existing) {
|
|
160
|
+
result.push(existing);
|
|
161
|
+
}
|
|
162
|
+
else {
|
|
163
|
+
const created = await this.createLabel(label.name, label.color, teamId);
|
|
164
|
+
result.push(created);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return result;
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Create a project
|
|
171
|
+
*/
|
|
172
|
+
async createProject(input) {
|
|
173
|
+
const data = await this.query(`
|
|
174
|
+
mutation CreateProject($name: String!, $description: String, $teamIds: [String!]!, $state: String) {
|
|
175
|
+
projectCreate(input: { name: $name, description: $description, teamIds: $teamIds, state: $state }) {
|
|
176
|
+
success
|
|
177
|
+
project {
|
|
178
|
+
id
|
|
179
|
+
name
|
|
180
|
+
description
|
|
181
|
+
state
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
`, {
|
|
186
|
+
name: input.name,
|
|
187
|
+
description: input.description,
|
|
188
|
+
teamIds: input.teamIds.length > 0 ? input.teamIds : [this.teamId],
|
|
189
|
+
state: input.state || 'planned',
|
|
190
|
+
});
|
|
191
|
+
if (!data.projectCreate.success) {
|
|
192
|
+
throw new Error(`Failed to create project: ${input.name}`);
|
|
193
|
+
}
|
|
194
|
+
return {
|
|
195
|
+
...data.projectCreate.project,
|
|
196
|
+
teamIds: input.teamIds.length > 0 ? input.teamIds : [this.teamId],
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* List projects for a team
|
|
201
|
+
*/
|
|
202
|
+
async listProjects(teamId) {
|
|
203
|
+
const id = teamId || this.teamId;
|
|
204
|
+
const data = await this.query(`
|
|
205
|
+
query GetProjects($id: String!) {
|
|
206
|
+
team(id: $id) {
|
|
207
|
+
projects {
|
|
208
|
+
nodes {
|
|
209
|
+
id
|
|
210
|
+
name
|
|
211
|
+
description
|
|
212
|
+
state
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
`, { id });
|
|
218
|
+
return data.team.projects.nodes.map(p => ({ ...p, teamIds: [id] }));
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Create a cycle
|
|
222
|
+
*/
|
|
223
|
+
async createCycle(input) {
|
|
224
|
+
const data = await this.query(`
|
|
225
|
+
mutation CreateCycle($teamId: String!, $name: String, $startsAt: DateTime!, $endsAt: DateTime!, $description: String) {
|
|
226
|
+
cycleCreate(input: { teamId: $teamId, name: $name, startsAt: $startsAt, endsAt: $endsAt, description: $description }) {
|
|
227
|
+
success
|
|
228
|
+
cycle {
|
|
229
|
+
id
|
|
230
|
+
number
|
|
231
|
+
name
|
|
232
|
+
startsAt
|
|
233
|
+
endsAt
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
`, {
|
|
238
|
+
teamId: input.teamId || this.teamId,
|
|
239
|
+
name: input.name,
|
|
240
|
+
startsAt: input.startsAt,
|
|
241
|
+
endsAt: input.endsAt,
|
|
242
|
+
description: input.description,
|
|
243
|
+
});
|
|
244
|
+
if (!data.cycleCreate.success) {
|
|
245
|
+
throw new Error(`Failed to create cycle: ${input.name}`);
|
|
246
|
+
}
|
|
247
|
+
return {
|
|
248
|
+
...data.cycleCreate.cycle,
|
|
249
|
+
teamId: input.teamId || this.teamId,
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* List cycles for a team
|
|
254
|
+
*/
|
|
255
|
+
async listCycles(teamId) {
|
|
256
|
+
const id = teamId || this.teamId;
|
|
257
|
+
const data = await this.query(`
|
|
258
|
+
query GetCycles($id: String!) {
|
|
259
|
+
team(id: $id) {
|
|
260
|
+
cycles {
|
|
261
|
+
nodes {
|
|
262
|
+
id
|
|
263
|
+
number
|
|
264
|
+
name
|
|
265
|
+
startsAt
|
|
266
|
+
endsAt
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
`, { id });
|
|
272
|
+
return data.team.cycles.nodes.map(c => ({ ...c, teamId: id }));
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Create an issue
|
|
276
|
+
*/
|
|
277
|
+
async createIssue(input) {
|
|
278
|
+
const data = await this.query(`
|
|
279
|
+
mutation CreateIssue(
|
|
280
|
+
$title: String!,
|
|
281
|
+
$description: String,
|
|
282
|
+
$teamId: String!,
|
|
283
|
+
$projectId: String,
|
|
284
|
+
$cycleId: String,
|
|
285
|
+
$priority: Int,
|
|
286
|
+
$estimate: Int,
|
|
287
|
+
$labelIds: [String!],
|
|
288
|
+
$stateId: String,
|
|
289
|
+
$parentId: String
|
|
290
|
+
) {
|
|
291
|
+
issueCreate(input: {
|
|
292
|
+
title: $title,
|
|
293
|
+
description: $description,
|
|
294
|
+
teamId: $teamId,
|
|
295
|
+
projectId: $projectId,
|
|
296
|
+
cycleId: $cycleId,
|
|
297
|
+
priority: $priority,
|
|
298
|
+
estimate: $estimate,
|
|
299
|
+
labelIds: $labelIds,
|
|
300
|
+
stateId: $stateId,
|
|
301
|
+
parentId: $parentId
|
|
302
|
+
}) {
|
|
303
|
+
success
|
|
304
|
+
issue {
|
|
305
|
+
id
|
|
306
|
+
identifier
|
|
307
|
+
title
|
|
308
|
+
description
|
|
309
|
+
priority
|
|
310
|
+
estimate
|
|
311
|
+
url
|
|
312
|
+
state {
|
|
313
|
+
id
|
|
314
|
+
name
|
|
315
|
+
}
|
|
316
|
+
labels {
|
|
317
|
+
nodes {
|
|
318
|
+
id
|
|
319
|
+
name
|
|
320
|
+
color
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
project {
|
|
324
|
+
id
|
|
325
|
+
name
|
|
326
|
+
}
|
|
327
|
+
cycle {
|
|
328
|
+
id
|
|
329
|
+
number
|
|
330
|
+
name
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
`, {
|
|
336
|
+
title: input.title,
|
|
337
|
+
description: input.description,
|
|
338
|
+
teamId: input.teamId || this.teamId,
|
|
339
|
+
projectId: input.projectId,
|
|
340
|
+
cycleId: input.cycleId,
|
|
341
|
+
priority: input.priority,
|
|
342
|
+
estimate: input.estimate,
|
|
343
|
+
labelIds: input.labelIds,
|
|
344
|
+
stateId: input.stateId,
|
|
345
|
+
parentId: input.parentId,
|
|
346
|
+
});
|
|
347
|
+
if (!data.issueCreate.success) {
|
|
348
|
+
throw new Error(`Failed to create issue: ${input.title}`);
|
|
349
|
+
}
|
|
350
|
+
const issue = data.issueCreate.issue;
|
|
351
|
+
return {
|
|
352
|
+
...issue,
|
|
353
|
+
labels: issue.labels.nodes || [],
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Create multiple issues from a task breakdown
|
|
358
|
+
*/
|
|
359
|
+
async createIssuesFromTasks(tasks, options = {}) {
|
|
360
|
+
const issues = [];
|
|
361
|
+
const backlogState = await this.getBacklogState();
|
|
362
|
+
for (const task of tasks) {
|
|
363
|
+
// Combine task-specific labels with global labels
|
|
364
|
+
const taskLabelIds = [...(options.labelIds || [])];
|
|
365
|
+
const issue = await this.createIssue({
|
|
366
|
+
title: task.title,
|
|
367
|
+
description: task.description,
|
|
368
|
+
teamId: this.teamId,
|
|
369
|
+
projectId: options.projectId,
|
|
370
|
+
cycleId: options.cycleId,
|
|
371
|
+
priority: task.priority,
|
|
372
|
+
estimate: task.estimate,
|
|
373
|
+
labelIds: taskLabelIds.length > 0 ? taskLabelIds : undefined,
|
|
374
|
+
stateId: backlogState?.id,
|
|
375
|
+
});
|
|
376
|
+
issues.push(issue);
|
|
377
|
+
// Create subtasks
|
|
378
|
+
if (task.subtasks && task.subtasks.length > 0) {
|
|
379
|
+
for (const subtask of task.subtasks) {
|
|
380
|
+
const subIssue = await this.createIssue({
|
|
381
|
+
title: subtask.title,
|
|
382
|
+
description: subtask.description,
|
|
383
|
+
teamId: this.teamId,
|
|
384
|
+
projectId: options.projectId,
|
|
385
|
+
cycleId: options.cycleId,
|
|
386
|
+
priority: subtask.priority,
|
|
387
|
+
estimate: subtask.estimate,
|
|
388
|
+
parentId: issue.id,
|
|
389
|
+
stateId: backlogState?.id,
|
|
390
|
+
});
|
|
391
|
+
issues.push(subIssue);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
return issues;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/integrations/linear/client.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAeH,MAAM,cAAc,GAAG,gCAAgC,CAAC;AAExD,MAAM,OAAO,YAAY;IACf,MAAM,CAAS;IACf,MAAM,CAAS;IAEvB,YAAY,MAAoB;QAC9B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;IAC9B,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,KAAK,CAAI,KAAa,EAAE,SAAmC;QACvE,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,cAAc,EAAE;YAC3C,MAAM,EAAE,MA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,SAAS;gBAC5D,OAAO,EAAE,YAAY,EAAE,EAAE;aAC1B,CAAC,CAAC;YACH,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAEnB,kBAAkB;YAClB,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC9C,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;oBACpC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC;wBACtC,KAAK,EAAE,OAAO,CAAC,KAAK;wBACpB,WAAW,EAAE,OAAO,CAAC,WAAW;wBAChC,MAAM,EAAE,IAAI,CAAC,MAAM;wBACnB,SAAS,EAAE,OAAO,CAAC,SAAS;wBAC5B,OAAO,EAAE,OAAO,CAAC,OAAO;wBACxB,QAAQ,EAAE,OAAO,CAAC,QAAQ;wBAC1B,QAAQ,EAAE,OAAO,CAAC,QAAQ;wBAC1B,QAAQ,EAAE,KAAK,CAAC,EAAE;wBAClB,OAAO,EAAE,YAAY,EAAE,EAAE;qBAC1B,CAAC,CAAC;oBACH,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACxB,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Linear Exporter
|
|
3
|
+
* High-level export operations for Blueprint documents to Linear
|
|
4
|
+
*/
|
|
5
|
+
import type { LinearConfig, LinearExportResult, LinearExportOptions } from './types.js';
|
|
6
|
+
export declare class LinearExporter {
|
|
7
|
+
private client;
|
|
8
|
+
private teamId;
|
|
9
|
+
constructor(config: LinearConfig);
|
|
10
|
+
/**
|
|
11
|
+
* Export Blueprint documents to Linear
|
|
12
|
+
*/
|
|
13
|
+
export(documents: Array<{
|
|
14
|
+
name: string;
|
|
15
|
+
content: string;
|
|
16
|
+
}>, options?: LinearExportOptions): Promise<LinearExportResult>;
|
|
17
|
+
/**
|
|
18
|
+
* Preview what would be created (dry run)
|
|
19
|
+
*/
|
|
20
|
+
preview(documents: Array<{
|
|
21
|
+
name: string;
|
|
22
|
+
content: string;
|
|
23
|
+
}>, options?: LinearExportOptions): Promise<LinearExportResult>;
|
|
24
|
+
/**
|
|
25
|
+
* Extract project description from documents
|
|
26
|
+
*/
|
|
27
|
+
private extractDescription;
|
|
28
|
+
/**
|
|
29
|
+
* Extract release phases from documents
|
|
30
|
+
*/
|
|
31
|
+
private extractReleasePhases;
|
|
32
|
+
/**
|
|
33
|
+
* Extract task breakdowns from documents
|
|
34
|
+
*/
|
|
35
|
+
private extractTaskBreakdowns;
|
|
36
|
+
/**
|
|
37
|
+
* Parse tasks from markdown content
|
|
38
|
+
*/
|
|
39
|
+
private parseTasksFromMarkdown;
|
|
40
|
+
/**
|
|
41
|
+
* Extract priority from task text
|
|
42
|
+
*/
|
|
43
|
+
private extractPriority;
|
|
44
|
+
/**
|
|
45
|
+
* Map priority string to Linear priority number
|
|
46
|
+
*/
|
|
47
|
+
private mapPriority;
|
|
48
|
+
/**
|
|
49
|
+
* Extract estimate from task text
|
|
50
|
+
*/
|
|
51
|
+
private extractEstimate;
|
|
52
|
+
/**
|
|
53
|
+
* Extract labels from task text
|
|
54
|
+
*/
|
|
55
|
+
private extractLabels;
|
|
56
|
+
/**
|
|
57
|
+
* Clean task title by removing markers
|
|
58
|
+
*/
|
|
59
|
+
private cleanTaskTitle;
|
|
60
|
+
/**
|
|
61
|
+
* Build label ID map from labels
|
|
62
|
+
*/
|
|
63
|
+
private buildLabelMap;
|
|
64
|
+
/**
|
|
65
|
+
* Create cycles from release phases
|
|
66
|
+
*/
|
|
67
|
+
private createCyclesFromPhases;
|
|
68
|
+
/**
|
|
69
|
+
* Create issues from a task breakdown
|
|
70
|
+
*/
|
|
71
|
+
private createIssuesFromBreakdown;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Export documents to Linear (convenience function)
|
|
75
|
+
*/
|
|
76
|
+
export declare function exportToLinear(config: LinearConfig, documents: Array<{
|
|
77
|
+
name: string;
|
|
78
|
+
content: string;
|
|
79
|
+
}>, options?: LinearExportOptions): Promise<LinearExportResult>;
|
|
80
|
+
//# sourceMappingURL=exporter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exporter.d.ts","sourceRoot":"","sources":["../../../src/integrations/linear/exporter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EACV,YAAY,EAOZ,kBAAkB,EAClB,mBAAmB,EAEpB,MAAM,YAAY,CAAC;AAGpB,qBAAa,cAAc;IACzB,OAAO,CAAC,MAAM,CAAe;IAC7B,OAAO,CAAC,MAAM,CAAS;gBAEX,MAAM,EAAE,YAAY;IAKhC;;OAEG;IACG,MAAM,CACV,SAAS,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,EACnD,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,kBAAkB,CAAC;IAgE9B;;OAEG;IACG,OAAO,CACX,SAAS,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC,EACnD,OAAO,GAAE,mBAAwB,GAChC,OAAO,CAAC,kBAAkB,CAAC;IAyF9B;;OAEG;IACH,OAAO,CAAC,kBAAkB;IA4B1B;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAiD5B;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAqB7B;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAmE9B;;OAEG;IACH,OAAO,CAAC,eAAe;IASvB;;OAEG;IACH,OAAO,CAAC,WAAW;IAWnB;;OAEG;IACH,OAAO,CAAC,eAAe;IAkBvB;;OAEG;IACH,OAAO,CAAC,aAAa;IAYrB;;OAEG;IACH,OAAO,CA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