linear-sdk-cli 0.4.0 → 0.5.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.
@@ -34,6 +34,8 @@ export interface ProjectRow {
34
34
  targetDate: string | null;
35
35
  status: { name: string } | null;
36
36
  lead: { displayName: string } | null;
37
+ archivedAt: string | null;
38
+ trashed: boolean;
37
39
  }
38
40
 
39
41
  /** The row's shape as `linear commands` advertises it (TES-610); checked against the interface. */
@@ -47,6 +49,8 @@ export const PROJECT_ROW_SHAPE = shape<ProjectRow>({
47
49
  targetDate: "string|null",
48
50
  status: { nullable: { name: "string" } },
49
51
  lead: { nullable: { displayName: "string" } },
52
+ archivedAt: "string|null",
53
+ trashed: "boolean",
50
54
  });
51
55
 
52
56
  export interface ListFilters {
@@ -54,13 +58,15 @@ export interface ListFilters {
54
58
  /** Every team's projects: no team clause at all, and the default team is not applied. */
55
59
  allTeams?: boolean;
56
60
  state?: string;
61
+ /** Widen the connection beyond live projects. */
62
+ includeArchived?: boolean;
57
63
  }
58
64
 
59
65
  const LIST_QUERY = `
60
66
  query CliProjects($filter: ProjectFilter, $first: Int!, $after: String, $includeArchived: Boolean) {
61
67
  projects(filter: $filter, first: $first, after: $after, includeArchived: $includeArchived) {
62
68
  nodes {
63
- id name state progress url startDate targetDate
69
+ id name state progress url startDate targetDate archivedAt trashed
64
70
  status { name }
65
71
  lead { displayName }
66
72
  }
@@ -107,7 +113,7 @@ export async function listProjects(
107
113
  return collectRawQuery<ProjectRow>(
108
114
  client as any,
109
115
  LIST_QUERY,
110
- { filter, includeArchived: false },
116
+ { filter, includeArchived: filters.includeArchived === true },
111
117
  "projects",
112
118
  limit,
113
119
  (n) => ({
@@ -120,6 +126,8 @@ export async function listProjects(
120
126
  targetDate: n.targetDate ?? null,
121
127
  status: n.status ?? null,
122
128
  lead: n.lead ?? null,
129
+ archivedAt: n.archivedAt ?? null,
130
+ trashed: n.trashed === true,
123
131
  }),
124
132
  );
125
133
  }
@@ -151,6 +159,7 @@ export interface ProjectDetail {
151
159
  updatedAt: string;
152
160
  completedAt: string | null;
153
161
  archivedAt: string | null;
162
+ trashed: boolean;
154
163
  lead: { id: string; displayName: string; email: string } | null;
155
164
  teams: Array<{ id: string; key: string; name: string }>;
156
165
  members: Array<{ id: string; displayName: string; email: string }>;
@@ -176,6 +185,7 @@ export const PROJECT_DETAIL_SHAPE = shape<ProjectDetail>({
176
185
  updatedAt: "string",
177
186
  completedAt: "string|null",
178
187
  archivedAt: "string|null",
188
+ trashed: "boolean",
179
189
  lead: { nullable: { id: "string", displayName: "string", email: "string" } },
180
190
  teams: [{ id: "string", key: "string", name: "string" }],
181
191
  members: [{ id: "string", displayName: "string", email: "string" }],
@@ -201,7 +211,7 @@ query CliProjectDetail($filter: ProjectFilter!, $includeArchived: Boolean!) {
201
211
  projects(filter: $filter, first: 2, includeArchived: $includeArchived) {
202
212
  nodes {
203
213
  id name description content state health progress priority priorityLabel url
204
- startDate targetDate createdAt updatedAt completedAt archivedAt
214
+ startDate targetDate createdAt updatedAt completedAt archivedAt trashed
205
215
  status { id name type }
206
216
  lead { id displayName email }
207
217
  labels(first: 50) { nodes { id name } }
@@ -247,6 +257,7 @@ export async function getProjectDetail(
247
257
  updatedAt: p.updatedAt,
248
258
  completedAt: p.completedAt ?? null,
249
259
  archivedAt: p.archivedAt ?? null,
260
+ trashed: p.trashed === true,
250
261
  lead: p.lead ?? null,
251
262
  teams: p.teams?.nodes ?? [],
252
263
  members: p.members?.nodes ?? [],