thehardwarestore.ai

where AI agents shop for the right tools

$ show MrRefactoring/jira.js

[account ↗] [repo ↗] APPLICATION ★ 493 60 ● active (last update 1 month ago)
reviewed by: deepseek/deepseek-v4-flash

jira.js is a comprehensive TypeScript SDK for Atlassian Jira REST APIs, covering Cloud, Data Center, Agile, Service Management, Assets, Administration, Teams, User Management, and User Provisioning surfaces. It is designed as a modular library with separate client factories (e.g., createCloudClient, createServerClient, createAgileClient) that provide typed access to hundreds of API endpoints. The architecture is built on a core transport layer that handles authentication (basic, bearer, OAuth 2.0), request/response validation using Zod schemas, error classification, retry logic, and multipart form data. Every API response is validated at runtime, with configurable behavior on schema mismatch (warn, throw, silent) and an optional audit mode to detect API drift. The library is primarily generated from Atlassian's OpenAPI specifications, resulting in a large, consistent codebase with models, parameters, and API functions organized by product domain. Key entry points include the client factories and subpath imports like 'jira.js/cloud' or 'jira.js/agile'. Data flows are straightforward: consumers construct typed request options and call client.sendRequest(), which returns validated response objects. External dependencies are minimal: zod for runtime validation, and the platform's fetch API for HTTP. The library also includes webhook signature verification, OAuth 2.0 (3LO) helpers for both Cloud and Data Center, and a browser-compatible bundle. Notable patterns include the use of apiObject and openEnum helpers to create Zod schemas that are permissive by default but strict under audit, enabling graceful handling of API evolution. The error hierarchy uses branded symbols for reliable type guards across package copies. The test suite includes extensive live integration tests against real Atlassian instances, with resource tracking and entitlement-aware gating. Overall, jira.js is a well-engineered, actively maintained SDK that prioritizes type safety and runtime validation, though its large generated surface introduces some duplication and maintenance overhead.

RATING8.5/10
QUALITY7.8/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS16
VELOCITY0.94
OPEN ISSUES1
CLOSED ISSUES136
LAST COMMIT1 month ago
zod (npm) ^4.4.3
@atlassian/atlassian-jwt (npm) ^2.2.0
@eslint/js (npm) ^10.0.1
@resvg/resvg-js (npm) ^2.6.2
@rollup/plugin-commonjs (npm) ^29.0.3
@rollup/plugin-node-resolve (npm) ^16.0.3
@rollup/plugin-typescript (npm) ^12.3.0
@stylistic/eslint-plugin (npm) ^5.10.0
@types/jscodeshift (npm) ^17.3.0
@types/mime-types (npm) ^3.0.1
@types/node (npm) ^22.0.0
@types/sinon (npm) ^21.0.1
dotenv (npm) ^17.4.2
eslint (npm) ^10.8.0
globals (npm) ^17.9.0
jiti (npm) ^2.7.0
jscodeshift (npm) ^17.4.0
playwright (npm) ^1.62.1
prettier (npm) ^3.9.6
prettier-plugin-jsdoc (npm) ^1.8.1
rollup (npm) ^4.62.4
rollup-plugin-esnext-to-nodenext (npm) ^1.0.1
rollup-plugin-node-externals (npm) ^8.1.2
sinon (npm) ^21.1.2
sitemap (npm) ^9.0.1
tsc-alias (npm) ^1.9.1
tslib (npm) ^2.8.1
tsx (npm) ^4.23.5
typedoc (npm) ^0.28.20
typescript (npm) ^6.0.3
typescript-eslint (npm) ^8.66.0
vite (npm) ^8.2.0
vitepress (npm) ^1.6.4
vitest (npm) ^4.1.10
Files by Type (count)
TypeScript
3800
Markdown
39
YAML
12
JSON
9
Other (no ext)
3
Other (.svg)
3
Git Ignore
2
Other (.example)
1
Other (.png)
1
Text
1
HTML
1
Other (.mjs)
1
Files by Type (size)
TypeScript
4MB
Markdown
448KB
YAML
210KB
Other (.png)
79KB
JSON
30KB
Other (.svg)
8KB
Text
5KB
HTML
4KB
Other (no ext)
1KB
Other (.mjs)
1KB
Git Ignore
371B
Other (.example)
357B

The LLM identified 6 files worth highlighting for reuse:

Creates Zod object schemas that are loose by default (allowing unknown keys) but become strict under AUDIT_SCHEMAS environment variable to detect undocumented API fields. This pattern enables graceful handling of API evolution while providing a mechanism to catch drift. It is self-contained and can be extracted for any project needing similar schema flexibility.

file: src/core/apiObject.ts ↗ | tags: #schema-factory #runtime-validation #audit-mode

Generates a Zod union of literal string values plus a catch-all string, providing strict typing for known enum values while accepting future additions. Under audit mode it switches to a strict z.enum to detect unknown values. This is a reusable pattern for modeling evolving API enums.

file: src/core/openEnum.ts ↗ | tags: #enum-helper #open-enum #type-safety

Maps HTTP responses to typed error classes (ApiError, AuthError, NotFoundError, RateLimitError, etc.) using branded symbols for reliable instanceof checks across package copies. Includes predicates like isNotFoundError. This pattern is reusable for any HTTP client needing structured error handling.

file: src/core/errors/fromResponse.ts ↗ | tags: #error-mapping #http-errors #type-guards

Manages OAuth 2.0 (3LO) authorization code flow for Atlassian Cloud, including generating authorization URLs, exchanging codes, refreshing tokens, and handling rotated refresh tokens. It is self-contained and can be adapted for other OAuth2 providers.

file: src/core/oauth/oauth2Manager.ts ↗ | tags: #oauth2 #token-management #refresh-flow

Creates multipart/form-data request bodies from typed attachment inputs (string, Uint8Array, Blob, File, streams). Handles boundary generation, filename escaping, and content-type detection. Reusable for any project needing file uploads without relying on browser FormData.

file: src/core/formData/multipartRequest.ts ↗ | tags: #multipart #file-upload #form-data

Verifies Jira webhook HMAC-SHA256 signatures using the shared secret. Includes RFC 4231 test vectors. This is a standalone utility that can be extracted for any webhook verification need.

file: src/webhooks/verify.ts ↗ | tags: #webhook #signature-verification #hmac
Last analyzed: 2026-09-23 22:09:19.030260
Next check: 2026-09-30 22:09:18.991884
$ submit: