ticketlens 0.1.9 → 0.1.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ticketlens",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "Jira CLI for developers — fetch ticket context, triage your queue, and stop tab-switching. Zero dependencies, all local.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -51,12 +51,14 @@ async function gql(query, variables, { token, fetcher, signal }) {
51
51
  headers: {
52
52
  Authorization: `Bearer ${token}`,
53
53
  'Content-Type': 'application/json',
54
+ Accept: 'application/json',
54
55
  },
55
56
  body: JSON.stringify(Object.keys(variables).length ? { query, variables } : { query }),
56
57
  signal,
57
58
  });
58
59
  if (!res.ok) {
59
- throw new Error(`Linear API error ${res.status} (${res.statusText})`);
60
+ const detail = await res.text().catch(() => '');
61
+ throw new Error(`Linear API error ${res.status} (${res.statusText})${detail ? ': ' + detail.slice(0, 300) : ''}`);
60
62
  }
61
63
  const { data, errors } = await res.json();
62
64
  if (errors?.length) throw new Error(`Linear GraphQL error: ${errors[0].message}`);
@@ -76,7 +78,7 @@ export function createLinearAdapter(conn, { fetcher = globalThis.fetch } = {}) {
76
78
  async fetchTicket(key, opts = {}) {
77
79
  const signal = AbortSignal.timeout(opts.timeoutMs ?? 10_000);
78
80
  const data = await gql(
79
- `query IssueByIdentifier($id: String!) {
81
+ `query ($id: String!) {
80
82
  issues(filter: { identifier: { eq: $id } }, first: 1) {
81
83
  nodes { ${ISSUE_FIELDS} }
82
84
  }
@@ -92,7 +94,7 @@ export function createLinearAdapter(conn, { fetcher = globalThis.fetch } = {}) {
92
94
  async fetchCurrentUser(opts = {}) {
93
95
  const signal = AbortSignal.timeout(opts.timeoutMs ?? 10_000);
94
96
  const data = await gql(
95
- `query Me { viewer { name email } }`,
97
+ `{ viewer { name email } }`,
96
98
  {},
97
99
  { token, fetcher, signal },
98
100
  );
@@ -103,7 +105,7 @@ export function createLinearAdapter(conn, { fetcher = globalThis.fetch } = {}) {
103
105
  async searchTickets(_query, opts = {}) {
104
106
  const signal = AbortSignal.timeout(opts.timeoutMs ?? 10_000);
105
107
  const data = await gql(
106
- `query MyIssues {
108
+ `{
107
109
  viewer {
108
110
  assignedIssues(
109
111
  filter: { state: { type: { nin: ["completed", "cancelled"] } } }
@@ -122,7 +124,7 @@ export function createLinearAdapter(conn, { fetcher = globalThis.fetch } = {}) {
122
124
  async fetchStatuses(opts = {}) {
123
125
  const signal = AbortSignal.timeout(opts.timeoutMs ?? 10_000);
124
126
  const data = await gql(
125
- `query WorkflowStates { workflowStates(first: 50) { nodes { name } } }`,
127
+ `{ workflowStates(first: 50) { nodes { name } } }`,
126
128
  {},
127
129
  { token, fetcher, signal },
128
130
  );