jira-data-center-client 1.0.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.
Files changed (85) hide show
  1. package/.claude/settings.local.json +17 -0
  2. package/.nvmrc +1 -0
  3. package/AGENTS.md +155 -0
  4. package/JiraServerSwagger.json +1 -0
  5. package/LICENSE +21 -0
  6. package/README.md +121 -0
  7. package/dist/api/agile.d.ts +10 -0
  8. package/dist/api/agile.d.ts.map +1 -0
  9. package/dist/api/agile.js +102 -0
  10. package/dist/api/agile.js.map +1 -0
  11. package/dist/api/base.d.ts +8 -0
  12. package/dist/api/base.d.ts.map +1 -0
  13. package/dist/api/base.js +19 -0
  14. package/dist/api/base.js.map +1 -0
  15. package/dist/api/fields.d.ts +11 -0
  16. package/dist/api/fields.d.ts.map +1 -0
  17. package/dist/api/fields.js +51 -0
  18. package/dist/api/fields.js.map +1 -0
  19. package/dist/api/index.d.ts +8 -0
  20. package/dist/api/index.d.ts.map +1 -0
  21. package/dist/api/index.js +8 -0
  22. package/dist/api/index.js.map +1 -0
  23. package/dist/api/issues.d.ts +11 -0
  24. package/dist/api/issues.d.ts.map +1 -0
  25. package/dist/api/issues.js +125 -0
  26. package/dist/api/issues.js.map +1 -0
  27. package/dist/api/links.d.ts +7 -0
  28. package/dist/api/links.d.ts.map +1 -0
  29. package/dist/api/links.js +12 -0
  30. package/dist/api/links.js.map +1 -0
  31. package/dist/api/projects.d.ts +7 -0
  32. package/dist/api/projects.d.ts.map +1 -0
  33. package/dist/api/projects.js +20 -0
  34. package/dist/api/projects.js.map +1 -0
  35. package/dist/api/users.d.ts +8 -0
  36. package/dist/api/users.d.ts.map +1 -0
  37. package/dist/api/users.js +34 -0
  38. package/dist/api/users.js.map +1 -0
  39. package/dist/client.d.ts +22 -0
  40. package/dist/client.d.ts.map +1 -0
  41. package/dist/client.js +33 -0
  42. package/dist/client.js.map +1 -0
  43. package/dist/index.d.ts +4 -0
  44. package/dist/index.d.ts.map +1 -0
  45. package/dist/index.js +4 -0
  46. package/dist/index.js.map +1 -0
  47. package/dist/types/agile.d.ts +63 -0
  48. package/dist/types/agile.d.ts.map +1 -0
  49. package/dist/types/agile.js +2 -0
  50. package/dist/types/agile.js.map +1 -0
  51. package/dist/types/common.d.ts +22 -0
  52. package/dist/types/common.d.ts.map +1 -0
  53. package/dist/types/common.js +2 -0
  54. package/dist/types/common.js.map +1 -0
  55. package/dist/types/field.d.ts +26 -0
  56. package/dist/types/field.d.ts.map +1 -0
  57. package/dist/types/field.js +2 -0
  58. package/dist/types/field.js.map +1 -0
  59. package/dist/types/index.d.ts +9 -0
  60. package/dist/types/index.d.ts.map +1 -0
  61. package/dist/types/index.js +9 -0
  62. package/dist/types/index.js.map +1 -0
  63. package/dist/types/issue.d.ts +188 -0
  64. package/dist/types/issue.d.ts.map +1 -0
  65. package/dist/types/issue.js +2 -0
  66. package/dist/types/issue.js.map +1 -0
  67. package/dist/types/link.d.ts +30 -0
  68. package/dist/types/link.d.ts.map +1 -0
  69. package/dist/types/link.js +2 -0
  70. package/dist/types/link.js.map +1 -0
  71. package/dist/types/project.d.ts +27 -0
  72. package/dist/types/project.d.ts.map +1 -0
  73. package/dist/types/project.js +2 -0
  74. package/dist/types/project.js.map +1 -0
  75. package/dist/types/transition.d.ts +21 -0
  76. package/dist/types/transition.d.ts.map +1 -0
  77. package/dist/types/transition.js +2 -0
  78. package/dist/types/transition.js.map +1 -0
  79. package/dist/types/user.d.ts +43 -0
  80. package/dist/types/user.d.ts.map +1 -0
  81. package/dist/types/user.js +2 -0
  82. package/dist/types/user.js.map +1 -0
  83. package/package.json +39 -0
  84. package/tests/integration/utils.ts +17 -0
  85. package/vitest.config.ts +8 -0
@@ -0,0 +1,17 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(curl:*)",
5
+ "mcp__bitbucket__create_pull_request",
6
+ "WebFetch(domain:developer.atlassian.com)",
7
+ "WebSearch",
8
+ "WebFetch(domain:docs.atlassian.com)",
9
+ "mcp__bitbucket__get_pull_request",
10
+ "mcp__bitbucket__get_pull_request_activities",
11
+ "mcp__bitbucket__get_pull_request_changes",
12
+ "mcp__bitbucket__get_pull_request_diff"
13
+ ],
14
+ "deny": [],
15
+ "ask": []
16
+ }
17
+ }
package/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ v24.1.0
package/AGENTS.md ADDED
@@ -0,0 +1,155 @@
1
+ # AGENTS.md
2
+
3
+ Guidance for coding agents working with this repository.
4
+
5
+ ## Project Overview
6
+
7
+ TypeScript client library for Jira Server/Data Center REST API. ESM-only package using axios.
8
+
9
+ ## Commands
10
+
11
+ ```bash
12
+ npm run build # Compile TypeScript to dist/
13
+ npm run clean # Remove dist/
14
+ npm test # Run all tests (Vitest)
15
+ npm run test:integration # Run integration tests against live Jira
16
+ ```
17
+
18
+ ## Project Structure
19
+
20
+ ```
21
+ src/
22
+ ├── api/ # Domain API classes
23
+ │ ├── index.ts # Re-exports all APIs
24
+ │ ├── base.ts # BaseApi with axios client
25
+ │ ├── users.ts # UsersApi
26
+ │ ├── projects.ts # ProjectsApi
27
+ │ ├── issues.ts # IssuesApi
28
+ │ ├── fields.ts # FieldsApi (with caching)
29
+ │ ├── agile.ts # AgileApi (boards, sprints)
30
+ │ └── links.ts # LinksApi
31
+ ├── types/ # TypeScript type definitions
32
+ │ ├── index.ts # Re-exports all types
33
+ │ ├── common.ts # JiraClientConfig, JiraSearchResponse
34
+ │ ├── user.ts # JiraUser + params
35
+ │ ├── project.ts # JiraProject + params
36
+ │ ├── issue.ts # JiraIssue, JiraIssueFields + params
37
+ │ ├── field.ts # JiraField, FieldCache + params
38
+ │ ├── transition.ts # JiraTransition + params
39
+ │ ├── agile.ts # JiraBoard, JiraSprint + params
40
+ │ └── link.ts # JiraIssueLinkType + params
41
+ ├── client.ts # JiraClient facade (composes all APIs)
42
+ └── index.ts # Public exports
43
+
44
+ tests/
45
+ └── integration/ # Integration tests (Vitest)
46
+ ├── utils.ts # Test utilities
47
+ ├── users.test.ts
48
+ ├── projects.test.ts
49
+ ├── issues.test.ts
50
+ ├── fields.test.ts
51
+ ├── agile.test.ts
52
+ └── links.test.ts
53
+ ```
54
+
55
+ ## Architecture
56
+
57
+ **Pattern**: Composition with Facade
58
+
59
+ - `BaseApi` - Base class with shared axios client
60
+ - Domain APIs (`UsersApi`, `IssuesApi`, etc.) - Extend `BaseApi`
61
+ - `JiraClient` - Facade that composes all domain APIs
62
+
63
+ ```typescript
64
+ // Usage
65
+ const client = new JiraClient({ baseUrl, token });
66
+ client.users.getMyself(); // UsersApi
67
+ client.issues.search({ jql }); // IssuesApi
68
+ client.agile.getBoards(); // AgileApi
69
+ ```
70
+
71
+ **Single axios client** with `baseURL` override for Agile API:
72
+ - REST API: `/rest/api/2`
73
+ - Agile API: `/rest/agile/1.0`
74
+
75
+ ## Adding New Methods
76
+
77
+ 1. Add types to `src/types/<domain>.ts`
78
+ 2. Add method to `src/api/<domain>.ts`
79
+ 3. Export from `src/types/index.ts` and `src/api/index.ts` if new file
80
+ 4. Add integration test in `tests/integration/<domain>.test.ts`
81
+ 5. Run `npm run build && npm run test:integration`
82
+
83
+ ## Adding New API Domain
84
+
85
+ 1. Create `src/types/<domain>.ts` with interfaces
86
+ 2. Create `src/api/<domain>.ts` extending `BaseApi`
87
+ 3. Add `export * from './<domain>.js'` to both index files
88
+ 4. Add property to `JiraClient` in `src/client.ts`
89
+ 5. Create `tests/integration/<domain>.test.ts`
90
+
91
+ ## Commit Convention
92
+
93
+ - Present tense ("Add feature" not "Added feature")
94
+ - Concise subject line
95
+ - Optional short description on new line
96
+ - No signatures or co-author tags
97
+
98
+ ## Jira DC REST API Reference
99
+
100
+ ### Base URLs
101
+ - REST API: `/rest/api/2`
102
+ - Agile API: `/rest/agile/1.0`
103
+
104
+ ### Authentication
105
+ ```
106
+ Authorization: Bearer <personal-access-token>
107
+ ```
108
+
109
+ ### Pagination
110
+ - `startAt`: Starting index (0-based)
111
+ - `maxResults`: Page size (max 50 for DC)
112
+ - Response includes `total` for total count
113
+
114
+ ### Key Endpoints
115
+
116
+ | Endpoint | Method | Description |
117
+ |----------|--------|-------------|
118
+ | `/myself` | GET | Get authenticated user |
119
+ | `/user?username=X` | GET | Get user by username |
120
+ | `/user/search?username=X` | GET | Search users |
121
+ | `/project` | GET | List all projects |
122
+ | `/project/{key}` | GET | Get project details |
123
+ | `/search` | GET/POST | JQL issue search |
124
+ | `/issue/{key}` | GET | Get issue details |
125
+ | `/issue/{key}/transitions` | GET | Get available transitions |
126
+ | `/field` | GET | List all fields |
127
+ | `/issueLinkType` | GET | List issue link types |
128
+
129
+ ### Agile Endpoints
130
+
131
+ | Endpoint | Method | Description |
132
+ |----------|--------|-------------|
133
+ | `/board` | GET | List boards |
134
+ | `/board/{id}` | GET | Get board |
135
+ | `/board/{id}/sprint` | GET | List sprints for board |
136
+ | `/sprint/{id}/issue` | GET | Get sprint issues |
137
+
138
+ ### JQL Examples
139
+
140
+ ```sql
141
+ -- Bugs in a project
142
+ project = PROJ AND issuetype = Bug
143
+
144
+ -- Issues by custom field (Severity Level)
145
+ project = PROJ AND cf[11120] = "P1"
146
+
147
+ -- Issues created in date range
148
+ project = PROJ AND created >= "2024-01-01" AND created <= "2024-12-31"
149
+
150
+ -- Issues by creator (team vs non-team)
151
+ project = PROJ AND creator NOT IN ("user1", "user2")
152
+
153
+ -- Issues by assignee
154
+ project = PROJ AND assignee IN ("user1", "user2")
155
+ ```