@stoneforge/quarry 1.12.0 → 1.14.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/README.md +2 -0
- package/dist/api/quarry-api.d.ts +9 -1
- package/dist/api/quarry-api.d.ts.map +1 -1
- package/dist/api/quarry-api.js +21 -2
- package/dist/api/quarry-api.js.map +1 -1
- package/dist/api/types.d.ts +8 -1
- package/dist/api/types.d.ts.map +1 -1
- package/dist/api/types.js.map +1 -1
- package/dist/cli/commands/auto-link-helper.d.ts +33 -0
- package/dist/cli/commands/auto-link-helper.d.ts.map +1 -0
- package/dist/cli/commands/auto-link-helper.js +74 -0
- package/dist/cli/commands/auto-link-helper.js.map +1 -0
- package/dist/cli/commands/crud.d.ts +3 -0
- package/dist/cli/commands/crud.d.ts.map +1 -1
- package/dist/cli/commands/crud.js +144 -15
- package/dist/cli/commands/crud.js.map +1 -1
- package/dist/cli/commands/docs.js +2 -2
- package/dist/cli/commands/docs.js.map +1 -1
- package/dist/cli/commands/document.js +1 -1
- package/dist/cli/commands/document.js.map +1 -1
- package/dist/cli/commands/entity.js +1 -1
- package/dist/cli/commands/entity.js.map +1 -1
- package/dist/cli/commands/external-sync.d.ts +18 -0
- package/dist/cli/commands/external-sync.d.ts.map +1 -0
- package/dist/cli/commands/external-sync.js +2499 -0
- package/dist/cli/commands/external-sync.js.map +1 -0
- package/dist/cli/commands/library.js +1 -1
- package/dist/cli/commands/library.js.map +1 -1
- package/dist/cli/commands/message.js +2 -2
- package/dist/cli/commands/message.js.map +1 -1
- package/dist/cli/commands/serve.d.ts.map +1 -1
- package/dist/cli/commands/serve.js +2 -0
- package/dist/cli/commands/serve.js.map +1 -1
- package/dist/cli/commands/task.d.ts.map +1 -1
- package/dist/cli/commands/task.js +7 -4
- package/dist/cli/commands/task.js.map +1 -1
- package/dist/cli/commands/team.js +1 -1
- package/dist/cli/commands/team.js.map +1 -1
- package/dist/cli/commands/workflow.js +1 -1
- package/dist/cli/commands/workflow.js.map +1 -1
- package/dist/cli/runner.d.ts.map +1 -1
- package/dist/cli/runner.js +3 -0
- package/dist/cli/runner.js.map +1 -1
- package/dist/cli/utils/progress.d.ts +30 -0
- package/dist/cli/utils/progress.d.ts.map +1 -0
- package/dist/cli/utils/progress.js +47 -0
- package/dist/cli/utils/progress.js.map +1 -0
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/config.js +34 -0
- package/dist/config/config.js.map +1 -1
- package/dist/config/defaults.d.ts +13 -1
- package/dist/config/defaults.d.ts.map +1 -1
- package/dist/config/defaults.js +22 -0
- package/dist/config/defaults.js.map +1 -1
- package/dist/config/file.d.ts.map +1 -1
- package/dist/config/file.js +71 -0
- package/dist/config/file.js.map +1 -1
- package/dist/config/index.d.ts +3 -3
- package/dist/config/index.d.ts.map +1 -1
- package/dist/config/index.js +2 -2
- package/dist/config/index.js.map +1 -1
- package/dist/config/merge.d.ts.map +1 -1
- package/dist/config/merge.js +52 -1
- package/dist/config/merge.js.map +1 -1
- package/dist/config/types.d.ts +68 -1
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/types.js +33 -0
- package/dist/config/types.js.map +1 -1
- package/dist/config/validation.d.ts.map +1 -1
- package/dist/config/validation.js +64 -1
- package/dist/config/validation.js.map +1 -1
- package/dist/external-sync/adapters/document-sync-adapter.d.ts +150 -0
- package/dist/external-sync/adapters/document-sync-adapter.d.ts.map +1 -0
- package/dist/external-sync/adapters/document-sync-adapter.js +325 -0
- package/dist/external-sync/adapters/document-sync-adapter.js.map +1 -0
- package/dist/external-sync/adapters/task-sync-adapter.d.ts +177 -0
- package/dist/external-sync/adapters/task-sync-adapter.d.ts.map +1 -0
- package/dist/external-sync/adapters/task-sync-adapter.js +353 -0
- package/dist/external-sync/adapters/task-sync-adapter.js.map +1 -0
- package/dist/external-sync/auto-link.d.ts +66 -0
- package/dist/external-sync/auto-link.d.ts.map +1 -0
- package/dist/external-sync/auto-link.js +98 -0
- package/dist/external-sync/auto-link.js.map +1 -0
- package/dist/external-sync/conflict-resolver.d.ts +170 -0
- package/dist/external-sync/conflict-resolver.d.ts.map +1 -0
- package/dist/external-sync/conflict-resolver.js +580 -0
- package/dist/external-sync/conflict-resolver.js.map +1 -0
- package/dist/external-sync/index.d.ts +23 -0
- package/dist/external-sync/index.d.ts.map +1 -0
- package/dist/external-sync/index.js +24 -0
- package/dist/external-sync/index.js.map +1 -0
- package/dist/external-sync/provider-registry.d.ts +113 -0
- package/dist/external-sync/provider-registry.d.ts.map +1 -0
- package/dist/external-sync/provider-registry.js +205 -0
- package/dist/external-sync/provider-registry.js.map +1 -0
- package/dist/external-sync/providers/folder/folder-document-adapter.d.ts +97 -0
- package/dist/external-sync/providers/folder/folder-document-adapter.d.ts.map +1 -0
- package/dist/external-sync/providers/folder/folder-document-adapter.js +261 -0
- package/dist/external-sync/providers/folder/folder-document-adapter.js.map +1 -0
- package/dist/external-sync/providers/folder/folder-fs.d.ts +146 -0
- package/dist/external-sync/providers/folder/folder-fs.d.ts.map +1 -0
- package/dist/external-sync/providers/folder/folder-fs.js +300 -0
- package/dist/external-sync/providers/folder/folder-fs.js.map +1 -0
- package/dist/external-sync/providers/folder/folder-provider.d.ts +28 -0
- package/dist/external-sync/providers/folder/folder-provider.d.ts.map +1 -0
- package/dist/external-sync/providers/folder/folder-provider.js +87 -0
- package/dist/external-sync/providers/folder/folder-provider.js.map +1 -0
- package/dist/external-sync/providers/folder/index.d.ts +11 -0
- package/dist/external-sync/providers/folder/index.d.ts.map +1 -0
- package/dist/external-sync/providers/folder/index.js +13 -0
- package/dist/external-sync/providers/folder/index.js.map +1 -0
- package/dist/external-sync/providers/github/github-api.d.ts +271 -0
- package/dist/external-sync/providers/github/github-api.d.ts.map +1 -0
- package/dist/external-sync/providers/github/github-api.js +366 -0
- package/dist/external-sync/providers/github/github-api.js.map +1 -0
- package/dist/external-sync/providers/github/github-field-map.d.ts +76 -0
- package/dist/external-sync/providers/github/github-field-map.d.ts.map +1 -0
- package/dist/external-sync/providers/github/github-field-map.js +157 -0
- package/dist/external-sync/providers/github/github-field-map.js.map +1 -0
- package/dist/external-sync/providers/github/github-provider.d.ts +36 -0
- package/dist/external-sync/providers/github/github-provider.d.ts.map +1 -0
- package/dist/external-sync/providers/github/github-provider.js +212 -0
- package/dist/external-sync/providers/github/github-provider.js.map +1 -0
- package/dist/external-sync/providers/github/github-task-adapter.d.ts +135 -0
- package/dist/external-sync/providers/github/github-task-adapter.d.ts.map +1 -0
- package/dist/external-sync/providers/github/github-task-adapter.js +374 -0
- package/dist/external-sync/providers/github/github-task-adapter.js.map +1 -0
- package/dist/external-sync/providers/github/index.d.ts +12 -0
- package/dist/external-sync/providers/github/index.d.ts.map +1 -0
- package/dist/external-sync/providers/github/index.js +15 -0
- package/dist/external-sync/providers/github/index.js.map +1 -0
- package/dist/external-sync/providers/index.d.ts +13 -0
- package/dist/external-sync/providers/index.d.ts.map +1 -0
- package/dist/external-sync/providers/index.js +15 -0
- package/dist/external-sync/providers/index.js.map +1 -0
- package/dist/external-sync/providers/linear/index.d.ts +19 -0
- package/dist/external-sync/providers/linear/index.d.ts.map +1 -0
- package/dist/external-sync/providers/linear/index.js +19 -0
- package/dist/external-sync/providers/linear/index.js.map +1 -0
- package/dist/external-sync/providers/linear/linear-api.d.ts +252 -0
- package/dist/external-sync/providers/linear/linear-api.d.ts.map +1 -0
- package/dist/external-sync/providers/linear/linear-api.js +522 -0
- package/dist/external-sync/providers/linear/linear-api.js.map +1 -0
- package/dist/external-sync/providers/linear/linear-field-map.d.ts +135 -0
- package/dist/external-sync/providers/linear/linear-field-map.d.ts.map +1 -0
- package/dist/external-sync/providers/linear/linear-field-map.js +338 -0
- package/dist/external-sync/providers/linear/linear-field-map.js.map +1 -0
- package/dist/external-sync/providers/linear/linear-provider.d.ts +52 -0
- package/dist/external-sync/providers/linear/linear-provider.d.ts.map +1 -0
- package/dist/external-sync/providers/linear/linear-provider.js +169 -0
- package/dist/external-sync/providers/linear/linear-provider.js.map +1 -0
- package/dist/external-sync/providers/linear/linear-task-adapter.d.ts +190 -0
- package/dist/external-sync/providers/linear/linear-task-adapter.d.ts.map +1 -0
- package/dist/external-sync/providers/linear/linear-task-adapter.js +521 -0
- package/dist/external-sync/providers/linear/linear-task-adapter.js.map +1 -0
- package/dist/external-sync/providers/linear/linear-types.d.ts +114 -0
- package/dist/external-sync/providers/linear/linear-types.d.ts.map +1 -0
- package/dist/external-sync/providers/linear/linear-types.js +10 -0
- package/dist/external-sync/providers/linear/linear-types.js.map +1 -0
- package/dist/external-sync/providers/notion/index.d.ts +19 -0
- package/dist/external-sync/providers/notion/index.d.ts.map +1 -0
- package/dist/external-sync/providers/notion/index.js +20 -0
- package/dist/external-sync/providers/notion/index.js.map +1 -0
- package/dist/external-sync/providers/notion/notion-api.d.ts +253 -0
- package/dist/external-sync/providers/notion/notion-api.d.ts.map +1 -0
- package/dist/external-sync/providers/notion/notion-api.js +492 -0
- package/dist/external-sync/providers/notion/notion-api.js.map +1 -0
- package/dist/external-sync/providers/notion/notion-blocks.d.ts +93 -0
- package/dist/external-sync/providers/notion/notion-blocks.d.ts.map +1 -0
- package/dist/external-sync/providers/notion/notion-blocks.js +773 -0
- package/dist/external-sync/providers/notion/notion-blocks.js.map +1 -0
- package/dist/external-sync/providers/notion/notion-document-adapter.d.ts +176 -0
- package/dist/external-sync/providers/notion/notion-document-adapter.d.ts.map +1 -0
- package/dist/external-sync/providers/notion/notion-document-adapter.js +413 -0
- package/dist/external-sync/providers/notion/notion-document-adapter.js.map +1 -0
- package/dist/external-sync/providers/notion/notion-provider.d.ts +57 -0
- package/dist/external-sync/providers/notion/notion-provider.d.ts.map +1 -0
- package/dist/external-sync/providers/notion/notion-provider.js +159 -0
- package/dist/external-sync/providers/notion/notion-provider.js.map +1 -0
- package/dist/external-sync/providers/notion/notion-types.d.ts +388 -0
- package/dist/external-sync/providers/notion/notion-types.d.ts.map +1 -0
- package/dist/external-sync/providers/notion/notion-types.js +47 -0
- package/dist/external-sync/providers/notion/notion-types.js.map +1 -0
- package/dist/external-sync/sync-engine.d.ts +364 -0
- package/dist/external-sync/sync-engine.d.ts.map +1 -0
- package/dist/external-sync/sync-engine.js +1154 -0
- package/dist/external-sync/sync-engine.js.map +1 -0
- 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/server/index.js +8 -8
- package/dist/server/index.js.map +1 -1
- package/dist/services/inbox.js +1 -1
- package/dist/sync/hash.d.ts +5 -0
- package/dist/sync/hash.d.ts.map +1 -1
- package/dist/sync/hash.js +21 -2
- package/dist/sync/hash.js.map +1 -1
- package/package.json +10 -12
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Linear GraphQL API Client
|
|
3
|
+
*
|
|
4
|
+
* Pure fetch-based client for Linear issue operations via GraphQL.
|
|
5
|
+
* Supports API key authentication, rate limit handling, cursor pagination,
|
|
6
|
+
* and typed error responses.
|
|
7
|
+
*
|
|
8
|
+
* No external dependencies — uses only the standard fetch API.
|
|
9
|
+
*
|
|
10
|
+
* @see https://developers.linear.app/docs/graphql/working-with-the-graphql-api
|
|
11
|
+
*/
|
|
12
|
+
import type { LinearIssue, LinearTeam, LinearWorkflowState } from './linear-types.js';
|
|
13
|
+
/**
|
|
14
|
+
* Rate limit information parsed from Linear response headers.
|
|
15
|
+
*/
|
|
16
|
+
export interface RateLimitInfo {
|
|
17
|
+
/** Total requests allowed per hour */
|
|
18
|
+
readonly limit: number;
|
|
19
|
+
/** Requests remaining in the current window */
|
|
20
|
+
readonly remaining: number;
|
|
21
|
+
/** UTC epoch timestamp when the rate limit resets */
|
|
22
|
+
readonly reset: number;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* GraphQL error as returned in the response `errors` array.
|
|
26
|
+
*/
|
|
27
|
+
export interface GraphQLError {
|
|
28
|
+
readonly message: string;
|
|
29
|
+
readonly locations?: readonly {
|
|
30
|
+
readonly line: number;
|
|
31
|
+
readonly column: number;
|
|
32
|
+
}[];
|
|
33
|
+
readonly path?: readonly (string | number)[];
|
|
34
|
+
readonly extensions?: Record<string, unknown>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Configuration for creating a LinearApiClient.
|
|
38
|
+
*/
|
|
39
|
+
export interface LinearApiClientOptions {
|
|
40
|
+
/** Linear API key for authentication */
|
|
41
|
+
apiKey: string;
|
|
42
|
+
/** Remaining requests threshold to trigger warnings (default: 100) */
|
|
43
|
+
rateLimitWarningThreshold?: number;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Input for creating a new Linear issue.
|
|
47
|
+
*/
|
|
48
|
+
export interface CreateIssueInput {
|
|
49
|
+
/** Team ID to create the issue in (required) */
|
|
50
|
+
teamId: string;
|
|
51
|
+
/** Issue title (required) */
|
|
52
|
+
title: string;
|
|
53
|
+
/** Issue description (markdown) */
|
|
54
|
+
description?: string;
|
|
55
|
+
/** Priority level (0-4) */
|
|
56
|
+
priority?: number;
|
|
57
|
+
/** Workflow state ID */
|
|
58
|
+
stateId?: string;
|
|
59
|
+
/** Assignee user ID */
|
|
60
|
+
assigneeId?: string;
|
|
61
|
+
/** Label IDs to attach to the issue */
|
|
62
|
+
labelIds?: readonly string[];
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Input for updating an existing Linear issue.
|
|
66
|
+
*/
|
|
67
|
+
export interface UpdateIssueInput {
|
|
68
|
+
/** Updated title */
|
|
69
|
+
title?: string;
|
|
70
|
+
/** Updated description (markdown) */
|
|
71
|
+
description?: string;
|
|
72
|
+
/** Updated priority level (0-4) */
|
|
73
|
+
priority?: number;
|
|
74
|
+
/** Updated workflow state ID */
|
|
75
|
+
stateId?: string;
|
|
76
|
+
/** Updated assignee user ID */
|
|
77
|
+
assigneeId?: string;
|
|
78
|
+
/** Label IDs to set on the issue (replaces all existing labels) */
|
|
79
|
+
labelIds?: readonly string[];
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Typed error for Linear API failures.
|
|
83
|
+
* Wraps fetch errors with status code, GraphQL errors, and rate limit info.
|
|
84
|
+
*/
|
|
85
|
+
export declare class LinearApiError extends Error {
|
|
86
|
+
/** HTTP status code from Linear's response */
|
|
87
|
+
readonly status: number;
|
|
88
|
+
/** GraphQL errors from the response (if any) */
|
|
89
|
+
readonly graphqlErrors: readonly GraphQLError[];
|
|
90
|
+
/** Rate limit information at the time of the error */
|
|
91
|
+
readonly rateLimit: RateLimitInfo | null;
|
|
92
|
+
constructor(message: string, status: number, graphqlErrors?: readonly GraphQLError[], rateLimit?: RateLimitInfo | null, cause?: Error);
|
|
93
|
+
/**
|
|
94
|
+
* Whether this error is due to rate limiting.
|
|
95
|
+
*/
|
|
96
|
+
get isRateLimited(): boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Whether this error is due to authentication failure.
|
|
99
|
+
*/
|
|
100
|
+
get isAuthError(): boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Returns a JSON-serializable representation of the error.
|
|
103
|
+
*/
|
|
104
|
+
toJSON(): {
|
|
105
|
+
name: string;
|
|
106
|
+
message: string;
|
|
107
|
+
status: number;
|
|
108
|
+
graphqlErrors: readonly GraphQLError[];
|
|
109
|
+
rateLimit: RateLimitInfo | null;
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Type guard for LinearApiError.
|
|
114
|
+
*/
|
|
115
|
+
export declare function isLinearApiError(error: unknown): error is LinearApiError;
|
|
116
|
+
/**
|
|
117
|
+
* Fetch-based Linear GraphQL API client for issue operations.
|
|
118
|
+
*
|
|
119
|
+
* Features:
|
|
120
|
+
* - API key authentication (no Bearer prefix)
|
|
121
|
+
* - Rate limit tracking with warnings when approaching limit
|
|
122
|
+
* - Typed errors with GraphQL error details
|
|
123
|
+
* - Relay-style cursor pagination
|
|
124
|
+
* - Partial error handling (data + errors)
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* ```typescript
|
|
128
|
+
* const client = new LinearApiClient({ apiKey: 'lin_api_...' });
|
|
129
|
+
* const viewer = await client.getViewer();
|
|
130
|
+
* const issues = await client.listIssuesSince('ENG', '2024-01-01T00:00:00Z');
|
|
131
|
+
* ```
|
|
132
|
+
*/
|
|
133
|
+
export declare class LinearApiClient {
|
|
134
|
+
private readonly apiKey;
|
|
135
|
+
private readonly rateLimitWarningThreshold;
|
|
136
|
+
/** Most recently observed rate limit info (updated after each request) */
|
|
137
|
+
private lastRateLimit;
|
|
138
|
+
constructor(options: LinearApiClientOptions);
|
|
139
|
+
/**
|
|
140
|
+
* Returns the most recently observed rate limit info, or null if no requests have been made.
|
|
141
|
+
*/
|
|
142
|
+
getRateLimit(): RateLimitInfo | null;
|
|
143
|
+
/**
|
|
144
|
+
* Performs a GraphQL request to the Linear API.
|
|
145
|
+
*
|
|
146
|
+
* Handles authentication, rate limit parsing, and error responses.
|
|
147
|
+
* For 200 responses that include both `data` and `errors`, it logs warnings
|
|
148
|
+
* for partial errors but returns the data.
|
|
149
|
+
*
|
|
150
|
+
* @throws {LinearApiError} On network errors, non-200 responses, or responses with only errors.
|
|
151
|
+
*/
|
|
152
|
+
graphql<T>(query: string, variables?: Record<string, unknown>): Promise<T>;
|
|
153
|
+
/**
|
|
154
|
+
* Fetch the authenticated user's identity.
|
|
155
|
+
* Useful for testing the API connection.
|
|
156
|
+
*
|
|
157
|
+
* @returns Viewer info with id, name, and email.
|
|
158
|
+
*/
|
|
159
|
+
getViewer(): Promise<{
|
|
160
|
+
id: string;
|
|
161
|
+
name: string;
|
|
162
|
+
email: string;
|
|
163
|
+
}>;
|
|
164
|
+
/**
|
|
165
|
+
* List all teams accessible to the authenticated user.
|
|
166
|
+
*
|
|
167
|
+
* @returns Array of teams with id, key, and name.
|
|
168
|
+
*/
|
|
169
|
+
getTeams(): Promise<LinearTeam[]>;
|
|
170
|
+
/**
|
|
171
|
+
* Fetch all workflow states for a specific team.
|
|
172
|
+
* Needed for mapping between Linear state types and Stoneforge statuses.
|
|
173
|
+
*
|
|
174
|
+
* @param teamId - UUID of the team.
|
|
175
|
+
* @returns Array of workflow states.
|
|
176
|
+
*/
|
|
177
|
+
getTeamWorkflowStates(teamId: string): Promise<LinearWorkflowState[]>;
|
|
178
|
+
/**
|
|
179
|
+
* Fetch all labels (issue labels) in the workspace.
|
|
180
|
+
* Labels in Linear are workspace-scoped and can be filtered by team.
|
|
181
|
+
*
|
|
182
|
+
* @returns Array of all labels with id and name.
|
|
183
|
+
*/
|
|
184
|
+
getLabels(): Promise<{
|
|
185
|
+
id: string;
|
|
186
|
+
name: string;
|
|
187
|
+
}[]>;
|
|
188
|
+
/**
|
|
189
|
+
* Create a new label in the workspace, optionally associated with a team.
|
|
190
|
+
*
|
|
191
|
+
* @param name - Label name (e.g., "blocked")
|
|
192
|
+
* @param teamId - Optional team ID to associate the label with
|
|
193
|
+
* @returns The created label with id and name.
|
|
194
|
+
*/
|
|
195
|
+
createLabel(name: string, teamId?: string): Promise<{
|
|
196
|
+
id: string;
|
|
197
|
+
name: string;
|
|
198
|
+
}>;
|
|
199
|
+
/**
|
|
200
|
+
* Fetch a single issue by UUID or identifier (e.g., "ENG-123").
|
|
201
|
+
*
|
|
202
|
+
* @param issueId - UUID or human-readable identifier.
|
|
203
|
+
* @returns The issue, or null if not found.
|
|
204
|
+
*/
|
|
205
|
+
getIssue(issueId: string): Promise<LinearIssue | null>;
|
|
206
|
+
/**
|
|
207
|
+
* List issues for a team updated since a given timestamp.
|
|
208
|
+
* Automatically paginates through all results using cursor pagination.
|
|
209
|
+
*
|
|
210
|
+
* @param teamKey - Team key (e.g., "ENG").
|
|
211
|
+
* @param since - ISO 8601 timestamp. Only issues updated at or after this time are returned.
|
|
212
|
+
* @returns Array of all matching issues.
|
|
213
|
+
*/
|
|
214
|
+
listIssuesSince(teamKey: string, since: string): Promise<LinearIssue[]>;
|
|
215
|
+
/**
|
|
216
|
+
* Create a new issue in Linear.
|
|
217
|
+
*
|
|
218
|
+
* @param input - Issue creation input (teamId and title required).
|
|
219
|
+
* @returns The created issue.
|
|
220
|
+
*/
|
|
221
|
+
createIssue(input: CreateIssueInput): Promise<LinearIssue>;
|
|
222
|
+
/**
|
|
223
|
+
* Update an existing issue in Linear.
|
|
224
|
+
*
|
|
225
|
+
* @param issueId - UUID of the issue to update.
|
|
226
|
+
* @param input - Fields to update.
|
|
227
|
+
* @returns The updated issue.
|
|
228
|
+
*/
|
|
229
|
+
updateIssue(issueId: string, input: UpdateIssueInput): Promise<LinearIssue>;
|
|
230
|
+
/**
|
|
231
|
+
* Logs a warning when rate limit is approaching exhaustion.
|
|
232
|
+
*/
|
|
233
|
+
private checkRateLimitWarning;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Parses rate limit information from Linear response headers.
|
|
237
|
+
*
|
|
238
|
+
* Linear uses these headers:
|
|
239
|
+
* - X-RateLimit-Requests-Limit
|
|
240
|
+
* - X-RateLimit-Requests-Remaining
|
|
241
|
+
* - X-RateLimit-Requests-Reset (epoch seconds)
|
|
242
|
+
*
|
|
243
|
+
* Also checks standard headers as fallback:
|
|
244
|
+
* - X-RateLimit-Limit
|
|
245
|
+
* - X-RateLimit-Remaining
|
|
246
|
+
* - X-RateLimit-Reset
|
|
247
|
+
*
|
|
248
|
+
* @returns Parsed rate limit info, or null if headers are not present.
|
|
249
|
+
*/
|
|
250
|
+
declare function parseRateLimitHeaders(headers: Headers): RateLimitInfo | null;
|
|
251
|
+
export { parseRateLimitHeaders };
|
|
252
|
+
//# sourceMappingURL=linear-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linear-api.d.ts","sourceRoot":"","sources":["../../../../src/external-sync/providers/linear/linear-api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,UAAU,EAEV,mBAAmB,EAEpB,MAAM,mBAAmB,CAAC;AAM3B;;GAEG;AACH,MAAM,WAAW,aAAa;I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