@uluops/ops-sdk 1.8.1 → 1.8.4
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/CHANGELOG.md +56 -1
- package/README.md +83 -52
- package/dist/client.d.ts +15 -46
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +17 -11
- package/dist/client.js.map +1 -1
- package/dist/config/constants.d.ts +2 -2
- package/dist/config/constants.js +1 -1
- package/dist/config/validators.d.ts +141 -3
- package/dist/config/validators.d.ts.map +1 -1
- package/dist/config/validators.js +146 -6
- package/dist/config/validators.js.map +1 -1
- package/dist/errors/errors.d.ts +1 -0
- package/dist/errors/errors.d.ts.map +1 -1
- package/dist/errors/errors.js +2 -0
- package/dist/errors/errors.js.map +1 -1
- package/dist/http/http-client.d.ts +17 -2
- package/dist/http/http-client.d.ts.map +1 -1
- package/dist/http/http-client.js +6 -1
- package/dist/http/http-client.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/operations/analytics.d.ts +87 -30
- package/dist/operations/analytics.d.ts.map +1 -1
- package/dist/operations/analytics.js +89 -33
- package/dist/operations/analytics.js.map +1 -1
- package/dist/operations/auth.d.ts +46 -8
- package/dist/operations/auth.d.ts.map +1 -1
- package/dist/operations/auth.js +46 -8
- package/dist/operations/auth.js.map +1 -1
- package/dist/operations/issues.d.ts +86 -16
- package/dist/operations/issues.d.ts.map +1 -1
- package/dist/operations/issues.js +86 -16
- package/dist/operations/issues.js.map +1 -1
- package/dist/operations/projects.d.ts +64 -10
- package/dist/operations/projects.d.ts.map +1 -1
- package/dist/operations/projects.js +69 -17
- package/dist/operations/projects.js.map +1 -1
- package/dist/operations/runs.d.ts +103 -19
- package/dist/operations/runs.d.ts.map +1 -1
- package/dist/operations/runs.js +111 -24
- package/dist/operations/runs.js.map +1 -1
- package/dist/operations/taxonomy.d.ts +3 -3
- package/dist/operations/taxonomy.d.ts.map +1 -1
- package/dist/operations/taxonomy.js +1 -1
- package/dist/types/analytics.d.ts +15 -21
- package/dist/types/analytics.d.ts.map +1 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -2
- package/dist/types/index.js.map +1 -1
- package/dist/types/projects.d.ts +0 -6
- package/dist/types/projects.d.ts.map +1 -1
- package/dist/types/response-schemas.d.ts +8 -38
- package/dist/types/response-schemas.d.ts.map +1 -1
- package/dist/types/response-schemas.js +9 -7
- package/dist/types/response-schemas.js.map +1 -1
- package/dist/types/runs.d.ts +3 -9
- package/dist/types/runs.d.ts.map +1 -1
- package/dist/types/schemas.d.ts +3 -24
- package/dist/types/schemas.d.ts.map +1 -1
- package/dist/types/schemas.js +2 -4
- package/dist/types/schemas.js.map +1 -1
- package/package.json +4 -4
- package/dist/operations/admin.d.ts +0 -89
- package/dist/operations/admin.d.ts.map +0 -1
- package/dist/operations/admin.js +0 -134
- package/dist/operations/admin.js.map +0 -1
package/dist/operations/auth.js
CHANGED
|
@@ -3,21 +3,36 @@ import { AuthUserResponseSchema, PublicUserResponseSchema, LoginResponseSchema,
|
|
|
3
3
|
import { validateRegisterInput, validateLoginInput, validateUpdateProfileInput, validateChangePasswordInput, validateResetPasswordInput, validateCreateApiKeyInput, } from '../config/validators.js';
|
|
4
4
|
const ProfileResponseSchema = z.object({ user: PublicUserResponseSchema });
|
|
5
5
|
/**
|
|
6
|
-
* Register a new user
|
|
6
|
+
* Register a new user account. Does not require authentication.
|
|
7
|
+
*
|
|
8
|
+
* @param client - HTTP client instance
|
|
9
|
+
* @param input - `{ email, password }` — password requires 8-128 chars, uppercase + lowercase + digit
|
|
10
|
+
* @returns `{ user, token }` — the token can be used for immediate session auth
|
|
11
|
+
* @throws {InputValidationError} If email invalid or password doesn't meet requirements
|
|
7
12
|
*/
|
|
8
13
|
export async function register(client, input) {
|
|
9
14
|
validateRegisterInput(input);
|
|
10
15
|
return client.post('/auth/register', input, { skipAuth: true, schema: RegisterResponseSchema });
|
|
11
16
|
}
|
|
12
17
|
/**
|
|
13
|
-
* Login with email and password
|
|
18
|
+
* Login with email and password. Does not require authentication.
|
|
19
|
+
* Returns a session token — use `OpsClient.login()` instead for auto-install.
|
|
20
|
+
*
|
|
21
|
+
* @param client - HTTP client instance
|
|
22
|
+
* @param input - `{ email, password }`
|
|
23
|
+
* @returns `{ user, sessionToken }` — token must be manually installed on the client
|
|
24
|
+
* @throws {InputValidationError} If email or password is missing
|
|
25
|
+
* @throws {UnauthorizedError} If credentials are invalid
|
|
14
26
|
*/
|
|
15
27
|
export async function login(client, input) {
|
|
16
28
|
validateLoginInput(input);
|
|
17
29
|
return client.post('/auth/login', input, { skipAuth: true, schema: LoginResponseSchema });
|
|
18
30
|
}
|
|
19
31
|
/**
|
|
20
|
-
*
|
|
32
|
+
* Revoke all sessions for the current user (not just the current session).
|
|
33
|
+
*
|
|
34
|
+
* @param client - HTTP client instance
|
|
35
|
+
* @returns `{ sessionsRevoked: number }`
|
|
21
36
|
*/
|
|
22
37
|
export async function logoutAll(client) {
|
|
23
38
|
return client.post('/auth/logout-all', undefined, { schema: z.object({ sessionsRevoked: z.number() }) });
|
|
@@ -36,14 +51,24 @@ export async function resetPassword(client, input) {
|
|
|
36
51
|
return client.post('/auth/reset-password', input, { skipAuth: true, schema: MessageResponseSchema });
|
|
37
52
|
}
|
|
38
53
|
/**
|
|
39
|
-
* Change password
|
|
54
|
+
* Change the current user's password. Requires knowing the current password.
|
|
55
|
+
*
|
|
56
|
+
* @param client - HTTP client instance
|
|
57
|
+
* @param input - `{ currentPassword, newPassword }` — new password must meet requirements
|
|
58
|
+
* @returns Success message
|
|
59
|
+
* @throws {InputValidationError} If new password doesn't meet requirements
|
|
60
|
+
* @throws {UnauthorizedError} If current password is incorrect
|
|
40
61
|
*/
|
|
41
62
|
export async function changePassword(client, input) {
|
|
42
63
|
validateChangePasswordInput(input);
|
|
43
64
|
return client.put('/auth/password', input, { schema: MessageResponseSchema });
|
|
44
65
|
}
|
|
45
66
|
/**
|
|
46
|
-
* Set password
|
|
67
|
+
* Set password for the first time (accounts created without one, e.g. OAuth or admin-created).
|
|
68
|
+
*
|
|
69
|
+
* @param client - HTTP client instance
|
|
70
|
+
* @param password - New password
|
|
71
|
+
* @returns Success message
|
|
47
72
|
*/
|
|
48
73
|
export async function setPassword(client, password) {
|
|
49
74
|
return client.post('/auth/password', { password }, { schema: MessageResponseSchema });
|
|
@@ -61,14 +86,22 @@ export async function getProfile(client) {
|
|
|
61
86
|
return client.get('/auth/profile', undefined, { schema: ProfileResponseSchema });
|
|
62
87
|
}
|
|
63
88
|
/**
|
|
64
|
-
* Update current user's profile
|
|
89
|
+
* Update the current user's profile. At least one field must be provided.
|
|
90
|
+
*
|
|
91
|
+
* @param client - HTTP client instance
|
|
92
|
+
* @param input - Profile fields: username, name, bio, timezone, websiteUrl, avatar (base64), avatarMimeType
|
|
93
|
+
* @returns `{ user }` with updated profile
|
|
94
|
+
* @throws {InputValidationError} If no fields provided or constraints violated
|
|
65
95
|
*/
|
|
66
96
|
export async function updateProfile(client, input) {
|
|
67
97
|
validateUpdateProfileInput(input);
|
|
68
98
|
return client.patch('/auth/profile', input, { schema: ProfileResponseSchema });
|
|
69
99
|
}
|
|
70
100
|
/**
|
|
71
|
-
* Get current user's avatar
|
|
101
|
+
* Get the current user's avatar image as binary data.
|
|
102
|
+
*
|
|
103
|
+
* @param client - HTTP client instance
|
|
104
|
+
* @returns `{ data: ArrayBuffer, contentType: string }` — contentType is e.g. 'image/png'
|
|
72
105
|
*/
|
|
73
106
|
export async function getAvatar(client) {
|
|
74
107
|
const response = await client.requestBinary('GET', '/auth/avatar');
|
|
@@ -90,7 +123,12 @@ export async function listApiKeys(client) {
|
|
|
90
123
|
return client.get('/auth/keys', undefined, { schema: z.array(PublicApiKeyResponseSchema) });
|
|
91
124
|
}
|
|
92
125
|
/**
|
|
93
|
-
* Create a new API key
|
|
126
|
+
* Create a new API key. The full key is only returned once — store it securely.
|
|
127
|
+
*
|
|
128
|
+
* @param client - HTTP client instance
|
|
129
|
+
* @param input - Optional: `{ name?, expiresAt? }`
|
|
130
|
+
* @returns `{ id, name, key }` — key starts with `ulr_` prefix
|
|
131
|
+
* @throws {InputValidationError} If name exceeds 100 chars
|
|
94
132
|
*/
|
|
95
133
|
export async function createApiKey(client, input) {
|
|
96
134
|
if (input)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/operations/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkBxB,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EACxB,mBAAmB,EACnB,sBAAsB,EACtB,0BAA0B,EAC1B,2BAA2B,EAC3B,2BAA2B,EAC3B,qBAAqB,GACtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,qBAAqB,EACrB,kBAAkB,EAClB,0BAA0B,EAC1B,2BAA2B,EAC3B,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,yBAAyB,CAAC;AAEjC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,wBAAwB,EAAE,CAAC,CAAC;AAE3E
|
|
1
|
+
{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/operations/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAkBxB,OAAO,EACL,sBAAsB,EACtB,wBAAwB,EACxB,mBAAmB,EACnB,sBAAsB,EACtB,0BAA0B,EAC1B,2BAA2B,EAC3B,2BAA2B,EAC3B,qBAAqB,GACtB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,qBAAqB,EACrB,kBAAkB,EAClB,0BAA0B,EAC1B,2BAA2B,EAC3B,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,yBAAyB,CAAC;AAEjC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,C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AC,MAAM,CAAC,kBAAkB,kBAAkB,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;AACzE,CAAC"}
|
|
@@ -3,61 +3,131 @@ import type { OpsHttpClient } from '../http/http-client.js';
|
|
|
3
3
|
import type { Issue, CreateUserIssueInput, UpdateIssueInput, UpdateIssueStatusInput, CreateIssueNoteInput, IssueNote, IssueDetails, IssueSearchQuery, ListIssuesQuery, BulkStatusUpdateItem, StatusUpdateResult } from '../types/issues.js';
|
|
4
4
|
import { StatusHistoryResponseSchema, BulkStatusUpdateResultResponseSchema } from '../types/response-schemas.js';
|
|
5
5
|
/**
|
|
6
|
-
* Create a user-submitted issue
|
|
6
|
+
* Create a user-submitted issue in a project.
|
|
7
|
+
*
|
|
8
|
+
* @param client - HTTP client instance
|
|
9
|
+
* @param input - Issue data with required project, title, priority
|
|
10
|
+
* @returns Created issue with generated fingerprint and UUID
|
|
11
|
+
* @throws {InputValidationError} If input fails client-side Zod validation
|
|
7
12
|
*/
|
|
8
13
|
export declare function create(client: OpsHttpClient, input: CreateUserIssueInput): Promise<Issue>;
|
|
9
14
|
/**
|
|
10
|
-
* Search issues across projects
|
|
15
|
+
* Search issues across projects with full-text query and filters.
|
|
16
|
+
*
|
|
17
|
+
* @param client - HTTP client instance
|
|
18
|
+
* @param query - Search parameters: query string, projects, agents, status, priority, severities, failureDomains
|
|
19
|
+
* @returns Array of matching issues
|
|
11
20
|
*/
|
|
12
21
|
export declare function search(client: OpsHttpClient, query: IssueSearchQuery): Promise<Issue[]>;
|
|
13
22
|
/**
|
|
14
|
-
* Get an issue by its fingerprint
|
|
23
|
+
* Get an issue by its SHA-256 fingerprint hash.
|
|
24
|
+
*
|
|
25
|
+
* @param client - HTTP client instance
|
|
26
|
+
* @param fingerprint - Issue fingerprint (SHA-256 hash)
|
|
27
|
+
* @param project - Project name or ID
|
|
28
|
+
* @returns Issue matching the fingerprint
|
|
29
|
+
* @throws {NotFoundError} If no issue matches the fingerprint in the project
|
|
15
30
|
*/
|
|
16
31
|
export declare function getByFingerprint(client: OpsHttpClient, fingerprint: string, project: string): Promise<Issue>;
|
|
17
32
|
/**
|
|
18
|
-
* Update issue status
|
|
33
|
+
* Update an issue's status using its fingerprint hash.
|
|
34
|
+
*
|
|
35
|
+
* @param client - HTTP client instance
|
|
36
|
+
* @param fingerprint - Issue fingerprint (SHA-256 hash)
|
|
37
|
+
* @param project - Project name or ID
|
|
38
|
+
* @param input - Status update with new status and optional reason
|
|
39
|
+
* @returns Status update result with previous and new status
|
|
19
40
|
*/
|
|
20
41
|
export declare function updateStatusByFingerprint(client: OpsHttpClient, fingerprint: string, project: string, input: UpdateIssueStatusInput): Promise<StatusUpdateResult>;
|
|
21
42
|
/**
|
|
22
|
-
* Get an issue by
|
|
43
|
+
* Get an issue by its UUID.
|
|
44
|
+
*
|
|
45
|
+
* @param client - HTTP client instance
|
|
46
|
+
* @param issueId - Issue UUID
|
|
47
|
+
* @returns Issue record
|
|
48
|
+
* @throws {NotFoundError} If issue does not exist
|
|
23
49
|
*/
|
|
24
50
|
export declare function get(client: OpsHttpClient, issueId: string): Promise<Issue>;
|
|
25
51
|
/**
|
|
26
|
-
* Get full issue details
|
|
52
|
+
* Get full issue details including occurrences, notes, and status history.
|
|
53
|
+
*
|
|
54
|
+
* @param client - HTTP client instance
|
|
55
|
+
* @param issueId - Issue UUID
|
|
56
|
+
* @returns Issue details with nested occurrences, notes, and history arrays
|
|
27
57
|
*/
|
|
28
58
|
export declare function getDetails(client: OpsHttpClient, issueId: string): Promise<IssueDetails>;
|
|
29
59
|
/**
|
|
30
|
-
* Get issue
|
|
60
|
+
* Get status change history for an issue. Each entry has oldStatus, newStatus,
|
|
61
|
+
* reason, and changedAt timestamp.
|
|
62
|
+
*
|
|
63
|
+
* @param client - HTTP client instance
|
|
64
|
+
* @param issueId - Issue UUID
|
|
65
|
+
* @returns Array of status history entries (newest first)
|
|
31
66
|
*/
|
|
32
67
|
export declare function getHistory(client: OpsHttpClient, issueId: string): Promise<z.infer<typeof StatusHistoryResponseSchema>[]>;
|
|
33
68
|
/**
|
|
34
|
-
* Update issue status
|
|
69
|
+
* Update an issue's status with optional reason.
|
|
70
|
+
*
|
|
71
|
+
* @param client - HTTP client instance
|
|
72
|
+
* @param issueId - Issue UUID
|
|
73
|
+
* @param input - New status and optional reason
|
|
74
|
+
* @returns Updated issue
|
|
75
|
+
* @throws {InputValidationError} If status is not a valid enum value
|
|
35
76
|
*/
|
|
36
77
|
export declare function updateStatus(client: OpsHttpClient, issueId: string, input: UpdateIssueStatusInput): Promise<Issue>;
|
|
37
78
|
/**
|
|
38
|
-
* Update issue metadata
|
|
79
|
+
* Update issue metadata (title, severity, file path, failure code, etc.).
|
|
80
|
+
*
|
|
81
|
+
* @param client - HTTP client instance
|
|
82
|
+
* @param issueId - Issue UUID
|
|
83
|
+
* @param input - Fields to update (all optional)
|
|
84
|
+
* @returns Updated issue
|
|
85
|
+
* @throws {InputValidationError} If any provided field violates constraints
|
|
39
86
|
*/
|
|
40
87
|
export declare function update(client: OpsHttpClient, issueId: string, input: UpdateIssueInput): Promise<Issue>;
|
|
41
88
|
/**
|
|
42
|
-
* Add a note to an issue
|
|
89
|
+
* Add a note to an issue (context, resolution, or blocker).
|
|
90
|
+
*
|
|
91
|
+
* @param client - HTTP client instance
|
|
92
|
+
* @param issueId - Issue UUID
|
|
93
|
+
* @param input - Note content (1-10000 chars), optional noteType and createdBy
|
|
94
|
+
* @returns Created note
|
|
95
|
+
* @throws {InputValidationError} If content is empty or exceeds limits
|
|
43
96
|
*/
|
|
44
97
|
export declare function addNote(client: OpsHttpClient, issueId: string, input: CreateIssueNoteInput): Promise<IssueNote>;
|
|
45
98
|
/**
|
|
46
|
-
* Restore a deleted issue
|
|
99
|
+
* Restore a soft-deleted issue.
|
|
100
|
+
*
|
|
101
|
+
* @param client - HTTP client instance
|
|
102
|
+
* @param issueId - Issue UUID
|
|
103
|
+
* @returns Restored issue
|
|
47
104
|
*/
|
|
48
105
|
export declare function restore(client: OpsHttpClient, issueId: string): Promise<Issue>;
|
|
49
106
|
/**
|
|
50
|
-
* Undo the last status change
|
|
107
|
+
* Undo the last status change on an issue. Must be within 24 hours.
|
|
108
|
+
*
|
|
109
|
+
* @param client - HTTP client instance
|
|
110
|
+
* @param issueId - Issue UUID
|
|
111
|
+
* @returns Issue with previous status restored
|
|
51
112
|
*/
|
|
52
113
|
export declare function undoLastChange(client: OpsHttpClient, issueId: string): Promise<Issue>;
|
|
53
114
|
/**
|
|
54
|
-
* Bulk update issue statuses
|
|
115
|
+
* Bulk update issue statuses. Max 100 items per request. Each item may
|
|
116
|
+
* succeed or fail independently — check per-item results.
|
|
117
|
+
*
|
|
118
|
+
* @param client - HTTP client instance
|
|
119
|
+
* @param updates - Array of `{ issueId, status, reason? }` (1-100 items)
|
|
120
|
+
* @returns Per-item results with success/failure status
|
|
121
|
+
* @throws {InputValidationError} If updates array is empty or exceeds 100 items
|
|
55
122
|
*/
|
|
56
123
|
export declare function bulkUpdateStatus(client: OpsHttpClient, updates: BulkStatusUpdateItem[]): Promise<z.infer<typeof BulkStatusUpdateResultResponseSchema>>;
|
|
57
124
|
/**
|
|
58
|
-
* List issues
|
|
125
|
+
* List issues for a project with optional filters.
|
|
126
|
+
*
|
|
127
|
+
* @param client - HTTP client instance
|
|
128
|
+
* @param projectId - Project ID or name
|
|
129
|
+
* @param query - Optional filters: status, priority, severity, agent, limit, offset
|
|
130
|
+
* @returns Array of issues
|
|
59
131
|
*/
|
|
60
132
|
export declare function listByProject(client: OpsHttpClient, projectId: string, query?: ListIssuesQuery): Promise<Issue[]>;
|
|
61
|
-
/** @deprecated Use update instead */
|
|
62
|
-
export declare const edit: typeof update;
|
|
63
133
|
//# sourceMappingURL=issues.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"issues.d.ts","sourceRoot":"","sources":["../../src/operations/issues.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,O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;;;GAQG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE,oBAAoB,EAAE,GAC9B,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,oCAAoC,CAAC,CAAC,CAU/D;AAED;;;;;;;GAOG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,aAAa,EACrB,SAAS,EAAE,MAAM,EACjB,KAAK,CAAC,EAAE,eAAe,GACtB,OAAO,CAAC,KAAK,EAAE,CAAC,CAMlB"}
|
|
@@ -4,7 +4,12 @@ import { validateCreateUserIssueInput, validateUpdateIssueInput, validateUpdateI
|
|
|
4
4
|
import { toApiQuery } from '../http/http-client.js';
|
|
5
5
|
import { buildIssueListParams } from './query-utils.js';
|
|
6
6
|
/**
|
|
7
|
-
* Create a user-submitted issue
|
|
7
|
+
* Create a user-submitted issue in a project.
|
|
8
|
+
*
|
|
9
|
+
* @param client - HTTP client instance
|
|
10
|
+
* @param input - Issue data with required project, title, priority
|
|
11
|
+
* @returns Created issue with generated fingerprint and UUID
|
|
12
|
+
* @throws {InputValidationError} If input fails client-side Zod validation
|
|
8
13
|
*/
|
|
9
14
|
export async function create(client, input) {
|
|
10
15
|
validateCreateUserIssueInput(input);
|
|
@@ -25,43 +30,79 @@ export async function create(client, input) {
|
|
|
25
30
|
}, { schema: IssueResponseSchema });
|
|
26
31
|
}
|
|
27
32
|
/**
|
|
28
|
-
* Search issues across projects
|
|
33
|
+
* Search issues across projects with full-text query and filters.
|
|
34
|
+
*
|
|
35
|
+
* @param client - HTTP client instance
|
|
36
|
+
* @param query - Search parameters: query string, projects, agents, status, priority, severities, failureDomains
|
|
37
|
+
* @returns Array of matching issues
|
|
29
38
|
*/
|
|
30
39
|
export async function search(client, query) {
|
|
31
40
|
return client.get('/issues/search', toApiQuery(query), { schema: z.array(IssueResponseSchema) });
|
|
32
41
|
}
|
|
33
42
|
/**
|
|
34
|
-
* Get an issue by its fingerprint
|
|
43
|
+
* Get an issue by its SHA-256 fingerprint hash.
|
|
44
|
+
*
|
|
45
|
+
* @param client - HTTP client instance
|
|
46
|
+
* @param fingerprint - Issue fingerprint (SHA-256 hash)
|
|
47
|
+
* @param project - Project name or ID
|
|
48
|
+
* @returns Issue matching the fingerprint
|
|
49
|
+
* @throws {NotFoundError} If no issue matches the fingerprint in the project
|
|
35
50
|
*/
|
|
36
51
|
export async function getByFingerprint(client, fingerprint, project) {
|
|
37
52
|
return client.get(`/issues/by-fingerprint/${encodeURIComponent(fingerprint)}`, { project }, { schema: IssueResponseSchema });
|
|
38
53
|
}
|
|
39
54
|
/**
|
|
40
|
-
* Update issue status
|
|
55
|
+
* Update an issue's status using its fingerprint hash.
|
|
56
|
+
*
|
|
57
|
+
* @param client - HTTP client instance
|
|
58
|
+
* @param fingerprint - Issue fingerprint (SHA-256 hash)
|
|
59
|
+
* @param project - Project name or ID
|
|
60
|
+
* @param input - Status update with new status and optional reason
|
|
61
|
+
* @returns Status update result with previous and new status
|
|
41
62
|
*/
|
|
42
63
|
export async function updateStatusByFingerprint(client, fingerprint, project, input) {
|
|
43
64
|
return client.patch(`/issues/by-fingerprint/${encodeURIComponent(fingerprint)}/status`, { status: input.status, reason: input.reason }, { params: { project }, schema: StatusUpdateResultResponseSchema });
|
|
44
65
|
}
|
|
45
66
|
/**
|
|
46
|
-
* Get an issue by
|
|
67
|
+
* Get an issue by its UUID.
|
|
68
|
+
*
|
|
69
|
+
* @param client - HTTP client instance
|
|
70
|
+
* @param issueId - Issue UUID
|
|
71
|
+
* @returns Issue record
|
|
72
|
+
* @throws {NotFoundError} If issue does not exist
|
|
47
73
|
*/
|
|
48
74
|
export async function get(client, issueId) {
|
|
49
75
|
return client.get(`/issues/${encodeURIComponent(issueId)}`, undefined, { schema: IssueResponseSchema });
|
|
50
76
|
}
|
|
51
77
|
/**
|
|
52
|
-
* Get full issue details
|
|
78
|
+
* Get full issue details including occurrences, notes, and status history.
|
|
79
|
+
*
|
|
80
|
+
* @param client - HTTP client instance
|
|
81
|
+
* @param issueId - Issue UUID
|
|
82
|
+
* @returns Issue details with nested occurrences, notes, and history arrays
|
|
53
83
|
*/
|
|
54
84
|
export async function getDetails(client, issueId) {
|
|
55
85
|
return client.get(`/issues/${encodeURIComponent(issueId)}/details`, undefined, { schema: IssueDetailsResponseSchema });
|
|
56
86
|
}
|
|
57
87
|
/**
|
|
58
|
-
* Get issue
|
|
88
|
+
* Get status change history for an issue. Each entry has oldStatus, newStatus,
|
|
89
|
+
* reason, and changedAt timestamp.
|
|
90
|
+
*
|
|
91
|
+
* @param client - HTTP client instance
|
|
92
|
+
* @param issueId - Issue UUID
|
|
93
|
+
* @returns Array of status history entries (newest first)
|
|
59
94
|
*/
|
|
60
95
|
export async function getHistory(client, issueId) {
|
|
61
96
|
return client.get(`/issues/${encodeURIComponent(issueId)}/history`, undefined, { schema: z.array(StatusHistoryResponseSchema) });
|
|
62
97
|
}
|
|
63
98
|
/**
|
|
64
|
-
* Update issue status
|
|
99
|
+
* Update an issue's status with optional reason.
|
|
100
|
+
*
|
|
101
|
+
* @param client - HTTP client instance
|
|
102
|
+
* @param issueId - Issue UUID
|
|
103
|
+
* @param input - New status and optional reason
|
|
104
|
+
* @returns Updated issue
|
|
105
|
+
* @throws {InputValidationError} If status is not a valid enum value
|
|
65
106
|
*/
|
|
66
107
|
export async function updateStatus(client, issueId, input) {
|
|
67
108
|
validateUpdateIssueStatusInput(input);
|
|
@@ -71,7 +112,13 @@ export async function updateStatus(client, issueId, input) {
|
|
|
71
112
|
}, { schema: IssueResponseSchema });
|
|
72
113
|
}
|
|
73
114
|
/**
|
|
74
|
-
* Update issue metadata
|
|
115
|
+
* Update issue metadata (title, severity, file path, failure code, etc.).
|
|
116
|
+
*
|
|
117
|
+
* @param client - HTTP client instance
|
|
118
|
+
* @param issueId - Issue UUID
|
|
119
|
+
* @param input - Fields to update (all optional)
|
|
120
|
+
* @returns Updated issue
|
|
121
|
+
* @throws {InputValidationError} If any provided field violates constraints
|
|
75
122
|
*/
|
|
76
123
|
export async function update(client, issueId, input) {
|
|
77
124
|
validateUpdateIssueInput(input);
|
|
@@ -90,7 +137,13 @@ export async function update(client, issueId, input) {
|
|
|
90
137
|
}, { schema: IssueResponseSchema });
|
|
91
138
|
}
|
|
92
139
|
/**
|
|
93
|
-
* Add a note to an issue
|
|
140
|
+
* Add a note to an issue (context, resolution, or blocker).
|
|
141
|
+
*
|
|
142
|
+
* @param client - HTTP client instance
|
|
143
|
+
* @param issueId - Issue UUID
|
|
144
|
+
* @param input - Note content (1-10000 chars), optional noteType and createdBy
|
|
145
|
+
* @returns Created note
|
|
146
|
+
* @throws {InputValidationError} If content is empty or exceeds limits
|
|
94
147
|
*/
|
|
95
148
|
export async function addNote(client, issueId, input) {
|
|
96
149
|
validateCreateIssueNoteInput(input);
|
|
@@ -101,19 +154,33 @@ export async function addNote(client, issueId, input) {
|
|
|
101
154
|
}, { schema: IssueNoteResponseSchema });
|
|
102
155
|
}
|
|
103
156
|
/**
|
|
104
|
-
* Restore a deleted issue
|
|
157
|
+
* Restore a soft-deleted issue.
|
|
158
|
+
*
|
|
159
|
+
* @param client - HTTP client instance
|
|
160
|
+
* @param issueId - Issue UUID
|
|
161
|
+
* @returns Restored issue
|
|
105
162
|
*/
|
|
106
163
|
export async function restore(client, issueId) {
|
|
107
164
|
return client.post(`/issues/${encodeURIComponent(issueId)}/restore`, undefined, { schema: IssueResponseSchema });
|
|
108
165
|
}
|
|
109
166
|
/**
|
|
110
|
-
* Undo the last status change
|
|
167
|
+
* Undo the last status change on an issue. Must be within 24 hours.
|
|
168
|
+
*
|
|
169
|
+
* @param client - HTTP client instance
|
|
170
|
+
* @param issueId - Issue UUID
|
|
171
|
+
* @returns Issue with previous status restored
|
|
111
172
|
*/
|
|
112
173
|
export async function undoLastChange(client, issueId) {
|
|
113
174
|
return client.post(`/issues/${encodeURIComponent(issueId)}/undo`, undefined, { schema: IssueResponseSchema });
|
|
114
175
|
}
|
|
115
176
|
/**
|
|
116
|
-
* Bulk update issue statuses
|
|
177
|
+
* Bulk update issue statuses. Max 100 items per request. Each item may
|
|
178
|
+
* succeed or fail independently — check per-item results.
|
|
179
|
+
*
|
|
180
|
+
* @param client - HTTP client instance
|
|
181
|
+
* @param updates - Array of `{ issueId, status, reason? }` (1-100 items)
|
|
182
|
+
* @returns Per-item results with success/failure status
|
|
183
|
+
* @throws {InputValidationError} If updates array is empty or exceeds 100 items
|
|
117
184
|
*/
|
|
118
185
|
export async function bulkUpdateStatus(client, updates) {
|
|
119
186
|
validateBulkStatusUpdateInput({ updates });
|
|
@@ -127,11 +194,14 @@ export async function bulkUpdateStatus(client, updates) {
|
|
|
127
194
|
}, { schema: BulkStatusUpdateResultResponseSchema });
|
|
128
195
|
}
|
|
129
196
|
/**
|
|
130
|
-
* List issues
|
|
197
|
+
* List issues for a project with optional filters.
|
|
198
|
+
*
|
|
199
|
+
* @param client - HTTP client instance
|
|
200
|
+
* @param projectId - Project ID or name
|
|
201
|
+
* @param query - Optional filters: status, priority, severity, agent, limit, offset
|
|
202
|
+
* @returns Array of issues
|
|
131
203
|
*/
|
|
132
204
|
export async function listByProject(client, projectId, query) {
|
|
133
205
|
return client.get(`/projects/${encodeURIComponent(projectId)}/issues`, buildIssueListParams(query), { schema: z.array(IssueResponseSchema) });
|
|
134
206
|
}
|
|
135
|
-
/** @deprecated Use update instead */
|
|
136
|
-
export const edit = update;
|
|
137
207
|
//# sourceMappingURL=issues.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"issues.js","sourceRoot":"","sources":["../../src/operations/issues.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAexB,OAAO,EACL,mBAAmB,EACnB,0BAA0B,EAC1B,uBAAuB,EACvB,2BAA2B,EAC3B,gCAAgC,EAChC,oCAAoC,GACrC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,8BAA8B,EAC9B,4BAA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BAA6B,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC;IAC3C,OAAO,MAAM,CAAC,IAAI,CAAC,qBAAqB,EAAE;QACxC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC3B,OAAO,EAAE,CAAC,CAAC,OAAO;YAClB,EAAE,EAAE,CAAC,CAAC,EAAE;YACR,MAAM,EAAE,CAAC,CAAC,MAAM;YAChB,MAAM,EAAE,CAAC,CAAC,MAAM;SACjB,CAAC,CAAC;KACJ,EAAE,EAAE,MAAM,EAAE,oCAAoC,EAAE,CAAC,CAAC;AACvD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,MAAqB,EACrB,SAAiB,EACjB,KAAuB;IAEvB,OAAO,MAAM,CAAC,GAAG,CACf,aAAa,kBAAkB,CAAC,SAAS,CAAC,SAAS,EACnD,oBAAoB,CAAC,KAAK,CAAC,EAC3B,EAAE,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC,EAAE,CACzC,CAAC;AACJ,CAAC"}
|
|
@@ -3,27 +3,59 @@ import type { Project, CreateProjectInput, UpdateProjectInput, DeleteProjectInpu
|
|
|
3
3
|
import type { Issue } from '../types/issues.js';
|
|
4
4
|
import type { DeleteResult } from '../types/responses.js';
|
|
5
5
|
/**
|
|
6
|
-
* List all projects
|
|
6
|
+
* List all projects accessible to the current user.
|
|
7
|
+
*
|
|
8
|
+
* @param client - HTTP client instance
|
|
9
|
+
* @returns Array of projects with metadata (runCount, issueCount, etc.)
|
|
7
10
|
*/
|
|
8
11
|
export declare function list(client: OpsHttpClient): Promise<Project[]>;
|
|
9
12
|
/**
|
|
10
|
-
* Get a
|
|
13
|
+
* Get a project by UUID or name.
|
|
14
|
+
*
|
|
15
|
+
* @param client - HTTP client instance
|
|
16
|
+
* @param idOrName - Project UUID or name string
|
|
17
|
+
* @returns Project record
|
|
18
|
+
* @throws {NotFoundError} If project does not exist
|
|
11
19
|
*/
|
|
12
20
|
export declare function get(client: OpsHttpClient, idOrName: string): Promise<Project>;
|
|
13
21
|
/**
|
|
14
|
-
* Create a new project
|
|
22
|
+
* Create a new project.
|
|
23
|
+
*
|
|
24
|
+
* @param client - HTTP client instance
|
|
25
|
+
* @param input - Project data: `{ name: string }` (1-200 chars, unique)
|
|
26
|
+
* @returns Created project
|
|
27
|
+
* @throws {InputValidationError} If name is empty or exceeds 200 chars
|
|
28
|
+
* @throws {ConflictError} If a project with that name already exists
|
|
15
29
|
*/
|
|
16
30
|
export declare function create(client: OpsHttpClient, input: CreateProjectInput): Promise<Project>;
|
|
17
31
|
/**
|
|
18
|
-
* Update a project
|
|
32
|
+
* Update a project's mutable fields (name, description).
|
|
33
|
+
* Unlike create/delete, does not run client-side Zod validation — input is validated server-side only.
|
|
34
|
+
*
|
|
35
|
+
* @param client - HTTP client instance
|
|
36
|
+
* @param idOrName - Project UUID or name
|
|
37
|
+
* @param input - Fields to update
|
|
38
|
+
* @returns Updated project
|
|
19
39
|
*/
|
|
20
40
|
export declare function update(client: OpsHttpClient, idOrName: string, input: UpdateProjectInput): Promise<Project>;
|
|
21
41
|
/**
|
|
22
|
-
*
|
|
42
|
+
* Permanently delete a project. Irreversible — use softDelete for recoverable removal.
|
|
43
|
+
*
|
|
44
|
+
* @param client - HTTP client instance
|
|
45
|
+
* @param idOrName - Project UUID or name
|
|
46
|
+
* @param input - Confirmation: `{ confirm: true, confirmationPhrase: string }`
|
|
47
|
+
* @returns `{ deleted: true }`
|
|
48
|
+
* @throws {InputValidationError} If confirm is not `true` or phrase is missing
|
|
23
49
|
*/
|
|
24
50
|
export declare function deleteProject(client: OpsHttpClient, idOrName: string, input: DeleteProjectInput): Promise<DeleteResult>;
|
|
25
51
|
/**
|
|
26
|
-
* Soft delete a project
|
|
52
|
+
* Soft delete a project. Can be restored via `restore()`.
|
|
53
|
+
*
|
|
54
|
+
* @param client - HTTP client instance
|
|
55
|
+
* @param idOrName - Project UUID or name
|
|
56
|
+
* @param input - Confirmation: `{ confirm: true, confirmationPhrase: string }`
|
|
57
|
+
* @returns `{ deleted: true }`
|
|
58
|
+
* @throws {InputValidationError} If confirm is not `true` or phrase is missing
|
|
27
59
|
*/
|
|
28
60
|
export declare function softDelete(client: OpsHttpClient, idOrName: string, input: DeleteProjectInput): Promise<DeleteResult>;
|
|
29
61
|
/**
|
|
@@ -31,7 +63,12 @@ export declare function softDelete(client: OpsHttpClient, idOrName: string, inpu
|
|
|
31
63
|
*/
|
|
32
64
|
export declare function restore(client: OpsHttpClient, idOrName: string): Promise<Project>;
|
|
33
65
|
/**
|
|
34
|
-
* Rename a project by name
|
|
66
|
+
* Rename a project by name.
|
|
67
|
+
*
|
|
68
|
+
* @param client - HTTP client instance
|
|
69
|
+
* @param input - `{ oldName: string, newName: string }` (newName 1-200 chars)
|
|
70
|
+
* @returns Renamed project
|
|
71
|
+
* @throws {InputValidationError} If names are empty or newName exceeds 200 chars
|
|
35
72
|
*/
|
|
36
73
|
export declare function rename(client: OpsHttpClient, input: RenameProjectInput): Promise<Project>;
|
|
37
74
|
/**
|
|
@@ -49,17 +86,34 @@ export declare function listIssues(client: OpsHttpClient, idOrName: string, quer
|
|
|
49
86
|
/**
|
|
50
87
|
* List issues in a project with count (preserves pagination count from API envelope).
|
|
51
88
|
*
|
|
89
|
+
* @remarks
|
|
52
90
|
* Uses `requestRaw` to access the `count` field outside the `data` envelope.
|
|
53
|
-
*
|
|
91
|
+
* This bypasses automatic retry, token refresh, and Zod schema validation.
|
|
54
92
|
* For retry-safe access without count, use {@link listIssues}.
|
|
93
|
+
* For retry-safe pagination count, call `getSummary()` separately for `totalIssues`.
|
|
94
|
+
*
|
|
95
|
+
* @param client - HTTP client instance
|
|
96
|
+
* @param idOrName - Project UUID or name
|
|
97
|
+
* @param query - Optional filters: status, priority, agent, limit, offset
|
|
98
|
+
* @returns `{ issues, count }` — count reflects total matching issues for pagination
|
|
55
99
|
*/
|
|
56
100
|
export declare function listIssuesWithCount(client: OpsHttpClient, idOrName: string, query?: ListProjectIssuesQuery): Promise<PaginatedIssues>;
|
|
57
101
|
/**
|
|
58
|
-
* Bulk update issue statuses
|
|
102
|
+
* Bulk update issue statuses within a project. Each item may succeed or fail independently.
|
|
103
|
+
*
|
|
104
|
+
* @param client - HTTP client instance
|
|
105
|
+
* @param idOrName - Project UUID or name
|
|
106
|
+
* @param updates - Array of `{ issueId, status, reason? }`
|
|
107
|
+
* @returns Per-item results with success/failure status
|
|
59
108
|
*/
|
|
60
109
|
export declare function bulkUpdateIssueStatus(client: OpsHttpClient, idOrName: string, updates: BulkIssueStatusUpdate[]): Promise<BulkIssueStatusResult>;
|
|
61
110
|
/**
|
|
62
|
-
* Merge
|
|
111
|
+
* Merge duplicate issues into a target issue. Source issues are closed.
|
|
112
|
+
*
|
|
113
|
+
* @param client - HTTP client instance
|
|
114
|
+
* @param idOrName - Project UUID or name
|
|
115
|
+
* @param input - `{ targetIssueId, sourceIssueIds, strategy? }` — strategy: 'keep_target' or 'keep_highest_priority'
|
|
116
|
+
* @returns Merge result with counts
|
|
63
117
|
*/
|
|
64
118
|
export declare function mergeIssues(client: OpsHttpClient, idOrName: string, input: MergeIssuesInput): Promise<MergeIssuesResult>;
|
|
65
119
|
//# sourceMappingURL=projects.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/operations/projects.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE5D,OAAO,KAAK,EACV,OAAO,EACP,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,aAAa,EACb,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAgB1D
|
|
1
|
+
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/operations/projects.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE5D,OAAO,KAAK,EACV,OAAO,EACP,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,aAAa,EACb,kBAAkB,EAClB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EAChB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAgB1D;;;;;GAKG;AACH,wBAAsB,IAAI,CAAC,MAAM,EAAE,aAAa,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAEpE;AAED;;;;;;;GAOG;AACH,wBAAsB,GAAG,CACvB,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,OAAO,CAAC,CAElB;AAED;;;;;;;;GAQG;AACH,wBAAsB,MAAM,CAC1B,MAAM,EAAE,aAAa,EACrB,KAAK,EAAE,kBAAkB,GACxB,OAAO,CAAC,OAAO,CAAC,CAGlB;AAED;;;;;;;;GAQG;AACH,wBAAsB,MAAM,CAC1B,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,kBAAkB,GACxB,OAAO,CAAC,OAAO,CAAC,CAElB;AAED;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,aAAa,EACrB,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,kBAAkB,GACxB,OAAO,CAAC,YAAY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