@theholocron/holocron-plugin-linear 5.0.0-alpha.477 → 5.0.0-alpha.479
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/index.d.mts +2 -0
- package/dist/index.mjs +29 -7
- package/package.json +6 -6
package/dist/index.d.mts
CHANGED
|
@@ -48,8 +48,10 @@ export declare class LinearIssues implements Issues {
|
|
|
48
48
|
body?: string;
|
|
49
49
|
labels?: string[];
|
|
50
50
|
milestone?: string;
|
|
51
|
+
assignees?: string[];
|
|
51
52
|
}): Promise<{
|
|
52
53
|
key: string;
|
|
54
|
+
dropped?: string[];
|
|
53
55
|
}>;
|
|
54
56
|
/** Moves the issue to the state its slot names. Idempotent. */
|
|
55
57
|
transition(key: string, slot: LifecycleSlot): Promise<LifecycleResult>;
|
package/dist/index.mjs
CHANGED
|
@@ -479,6 +479,24 @@ var LinearIssues = class {
|
|
|
479
479
|
/** Makes an issue; labels the team lacks are made, and `milestone` is a project's name or id. */
|
|
480
480
|
async create(input) {
|
|
481
481
|
const { client } = this.scope;
|
|
482
|
+
const dropped = [];
|
|
483
|
+
let assigneeId;
|
|
484
|
+
const [wanted, ...extra] = input.assignees ?? [];
|
|
485
|
+
if (wanted) {
|
|
486
|
+
if (/^@?me$/i.test(wanted)) assigneeId = (await client.teams.viewer()).user.id;
|
|
487
|
+
else {
|
|
488
|
+
const w = wanted.replace(/^@/, "").toLowerCase();
|
|
489
|
+
const match = (await client.teams.users()).find((u) => [
|
|
490
|
+
u.id,
|
|
491
|
+
u.email,
|
|
492
|
+
u.displayName,
|
|
493
|
+
u.name
|
|
494
|
+
].some((v) => v?.toLowerCase() === w));
|
|
495
|
+
assigneeId = match?.id;
|
|
496
|
+
if (!match) dropped.push(`assignee (no Linear user matches): ${wanted}`);
|
|
497
|
+
}
|
|
498
|
+
if (extra.length > 0) dropped.push(`assignee (Linear holds one): ${extra.join(", ")}`);
|
|
499
|
+
}
|
|
482
500
|
const team = await this.scope.team();
|
|
483
501
|
const labelIds = input.labels?.length ? await this.labelIds(team.id, input.labels) : [];
|
|
484
502
|
let projectId;
|
|
@@ -487,13 +505,17 @@ var LinearIssues = class {
|
|
|
487
505
|
if (!match) throw new Error(`Project "${input.milestone}" not found in Linear. Use the id or an exact name.`);
|
|
488
506
|
projectId = match.id;
|
|
489
507
|
}
|
|
490
|
-
return {
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
508
|
+
return {
|
|
509
|
+
key: (await client.issues.create({
|
|
510
|
+
teamId: team.id,
|
|
511
|
+
title: input.summary,
|
|
512
|
+
...input.body ? { description: input.body } : {},
|
|
513
|
+
...labelIds.length > 0 ? { labelIds } : {},
|
|
514
|
+
...projectId ? { projectId } : {},
|
|
515
|
+
...assigneeId ? { assigneeId } : {}
|
|
516
|
+
})).identifier,
|
|
517
|
+
...dropped.length > 0 ? { dropped } : {}
|
|
518
|
+
};
|
|
497
519
|
}
|
|
498
520
|
/** Moves the issue to the state its slot names. Idempotent. */
|
|
499
521
|
async transition(key, slot) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/holocron-plugin-linear",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.479",
|
|
4
4
|
"description": "Holocron plugin for Linear. Implements the issues and projects capabilities against the Linear GraphQL API, with export and import for migrating to and from other trackers.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"holocron",
|
|
@@ -40,18 +40,18 @@
|
|
|
40
40
|
"tsdown": "^0.23.7",
|
|
41
41
|
"typescript": "^5.9.3",
|
|
42
42
|
"vitest": "^5.1.0",
|
|
43
|
-
"@theholocron/cli": "5.0.0-alpha.
|
|
43
|
+
"@theholocron/cli": "5.0.0-alpha.479",
|
|
44
44
|
"@theholocron/eslint-config": "^8.9.0-alpha.20",
|
|
45
45
|
"@theholocron/linear-client": "^1.58.0-alpha.40",
|
|
46
|
-
"@theholocron/misc-utils": "^1.17.0-alpha.5",
|
|
47
46
|
"@theholocron/tsconfig": "^8.9.0-alpha.20",
|
|
48
|
-
"@theholocron/
|
|
49
|
-
"@theholocron/
|
|
47
|
+
"@theholocron/tsdown-config": "^8.9.0-alpha.20",
|
|
48
|
+
"@theholocron/misc-utils": "^1.17.0-alpha.5",
|
|
49
|
+
"@theholocron/vitest-config": "^8.9.0-alpha.20"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"@theholocron/linear-client": "^1.58.0",
|
|
53
53
|
"@theholocron/misc-utils": "^1.16.0",
|
|
54
|
-
"@theholocron/cli": "5.0.0-alpha.
|
|
54
|
+
"@theholocron/cli": "5.0.0-alpha.479"
|
|
55
55
|
},
|
|
56
56
|
"peerDependenciesMeta": {
|
|
57
57
|
"@theholocron/linear-client": {}
|