@felixgeelhaar/jira-sdk 0.3.0 → 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 (46) hide show
  1. package/README.md +214 -374
  2. package/dist/auth/index.cjs +400 -0
  3. package/dist/auth/index.cjs.map +1 -0
  4. package/dist/auth/index.d.cts +192 -0
  5. package/dist/auth/index.d.ts +192 -0
  6. package/dist/auth/index.js +386 -0
  7. package/dist/auth/index.js.map +1 -0
  8. package/dist/errors/index.cjs +272 -0
  9. package/dist/errors/index.cjs.map +1 -0
  10. package/dist/errors/index.d.cts +203 -0
  11. package/dist/errors/index.d.ts +203 -0
  12. package/dist/errors/index.js +254 -0
  13. package/dist/errors/index.js.map +1 -0
  14. package/dist/http-client-BSzRYQZa.d.cts +317 -0
  15. package/dist/http-client-erRvYNs-.d.ts +317 -0
  16. package/dist/index.cjs +9541 -13612
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.d.cts +1242 -76
  19. package/dist/index.d.ts +1242 -76
  20. package/dist/index.js +9118 -13450
  21. package/dist/index.js.map +1 -1
  22. package/dist/schemas/index.cjs +2429 -13094
  23. package/dist/schemas/index.cjs.map +1 -1
  24. package/dist/schemas/index.d.cts +351 -13
  25. package/dist/schemas/index.d.ts +351 -13
  26. package/dist/schemas/index.js +2096 -13052
  27. package/dist/schemas/index.js.map +1 -1
  28. package/dist/services/index.cjs +6346 -13497
  29. package/dist/services/index.cjs.map +1 -1
  30. package/dist/services/index.d.cts +3828 -358
  31. package/dist/services/index.d.ts +3828 -358
  32. package/dist/services/index.js +6330 -13504
  33. package/dist/services/index.js.map +1 -1
  34. package/dist/transport/index.cjs +1016 -0
  35. package/dist/transport/index.cjs.map +1 -0
  36. package/dist/transport/index.d.cts +372 -0
  37. package/dist/transport/index.d.ts +372 -0
  38. package/dist/transport/index.js +997 -0
  39. package/dist/transport/index.js.map +1 -0
  40. package/dist/types-E6djPHpW.d.cts +95 -0
  41. package/dist/types-E6djPHpW.d.ts +95 -0
  42. package/dist/webhook-Bn8gme6Y.d.cts +6959 -0
  43. package/dist/webhook-Bn8gme6Y.d.ts +6959 -0
  44. package/package.json +73 -27
  45. package/dist/project-B1UelBH4.d.cts +0 -1810
  46. package/dist/project-B1UelBH4.d.ts +0 -1810
package/dist/index.d.cts CHANGED
@@ -1,11 +1,1101 @@
1
- import { RetryMiddlewareConfig, RateLimitMiddlewareConfig, CircuitBreakerConfig, Middleware, CircuitBreaker, AuthProvider, Logger, HttpClient } from '@felixgeelhaar/sdk-core';
2
- export { AbortError, ApiError, ApiTokenAuth, ApiTokenAuthConfig, AuthConfigError, AuthError, AuthProvider, BasicAuth, BasicAuthConfig, CircuitBreaker, CircuitBreakerConfig, CircuitBreakerOpenError, CircuitState, ConfigValidationError, ConsoleLogger, ForbiddenError, JiraSdkError, LogLevel, Logger, Middleware, MiddlewareContext, NetworkError, NoopLogger, NotFoundError, OAuth2Auth, OAuth2AuthConfig, PatAuth, PatAuthConfig, RateLimitError, ResponseValidationError, ServerError, TimeoutError, TokenExpiredError, TokenRefreshError, UnauthorizedError, ValidationError, composeMiddleware, createApiTokenAuth, createBasicAuth, createCircuitBreakerMiddleware, createDefaultCircuitBreaker, createLoggingMiddleware, createOAuth2Auth, createPatAuth, createRateLimitMiddleware, createRequestIdMiddleware, createRetryMiddleware, createUserAgentMiddleware } from '@felixgeelhaar/sdk-core';
3
- import { IssueService, ProjectService, SearchService, UserService } from './services/index.cjs';
1
+ export { AbortError, ApiError, AuthConfigError, AuthError, ConfigValidationError, ForbiddenError, JiraErrorDetail, JiraSdkError, NetworkError, NotFoundError, RateLimitError, ResponseValidationError, ServerError, TimeoutError, TokenExpiredError, TokenRefreshError, UnauthorizedError, ValidationError } from './errors/index.cjs';
2
+ import { L as Logger, a as LogFields, b as LogLevel, M as Middleware, H as HttpClient } from './http-client-BSzRYQZa.cjs';
3
+ export { c as HttpClientConfig, d as HttpMethod, e as HttpRequest, f as HttpResponse, g as MiddlewareContext, h as MiddlewareNext, Q as QueryParamValue, R as RequestOptions, i as createHttpClient, j as isLogger } from './http-client-BSzRYQZa.cjs';
4
+ import { A as AuthProvider } from './types-E6djPHpW.cjs';
5
+ export { a as ApiTokenAuthConfig, b as ApiTokenAuthConfigSchema, c as AuthConfig, d as AuthType, B as BasicAuthConfig, e as BasicAuthConfigSchema, O as OAuth2AuthConfig, f as OAuth2AuthConfigSchema, g as OAuth2TokenResponse, h as OAuth2TokenResponseSchema, P as PatAuthConfig, i as PatAuthConfigSchema } from './types-E6djPHpW.cjs';
6
+ export { ApiTokenAuth, BasicAuth, OAuth2Auth, PatAuth, createApiTokenAuth, createBasicAuth, createOAuth2Auth, createPatAuth } from './auth/index.cjs';
7
+ import { CircuitBreaker, RetryMiddlewareConfig, RateLimitMiddlewareConfig, CircuitBreakerConfig } from './transport/index.cjs';
8
+ export { CircuitBreakerOpenError, CircuitState, LoggingMiddlewareConfig, RateLimitHeaderMiddlewareConfig, RateLimitPolicy, RateLimitSnapshot, UserAgentMiddlewareConfig, composeMiddleware, createCircuitBreakerMiddleware, createDefaultCircuitBreaker, createLoggingMiddleware, createRateLimitHeaderMiddleware, createRateLimitMiddleware, createRequestIdMiddleware, createRetryMiddleware, createUserAgentMiddleware, parseBetaRateLimit, parseBetaRateLimitPolicy, parseRetryAfterSeconds, readRateLimitHeaders } from './transport/index.cjs';
9
+ import { A as AdfDocument, a as AdfNode } from './webhook-Bn8gme6Y.cjs';
10
+ export { b as AccountType, c as AccountTypeSchema, d as AddActorInput, e as AddActorInputSchema, f as AddAttachmentResponse, g as AddAttachmentResponseSchema, h as AddCommentInput, i as AddCommentInputSchema, j as AddGadgetInput, k as AddGadgetInputSchema, l as AddGroupUserOptions, m as AddGroupUserOptionsSchema, n as AddIssueTypesToSchemeInput, o as AddIssueTypesToSchemeInputSchema, p as AddNotificationInput, q as AddNotificationInputSchema, r as AddNotificationsRequest, s as AddNotificationsRequestSchema, t as AddScreenFieldInput, u as AddScreenFieldInputSchema, v as AddSharePermissionInput, w as AddSharePermissionInputSchema, x as AddWorklogInput, y as AddWorklogInputSchema, z as AdfDocumentSchema, B as AdfMark, C as AdfMarkSchema, D as AdfNodeSchema, E as AdfOrString, F as AdfOrStringSchema, G as AgileIssue, H as AgileIssueFields, I as AgileIssueFieldsSchema, J as AgileIssuePage, K as AgileIssuePageSchema, L as AgileIssueSchema, M as AllPermissionsResponse, N as AllPermissionsResponseSchema, O as AnalysisInput, P as AnalysisInputSchema, Q as AnalysisResult, R as AnalysisResultSchema, S as ApplicationProperty, T as ApplicationPropertySchema, U as AssociateContextProjectsInput, V as AssociateContextProjectsInputSchema, W as Attachment, X as AttachmentMetadata, Y as AttachmentMetadataSchema, Z as AttachmentSchema, _ as AuditAssociatedItem, $ as AuditAssociatedItemSchema, a0 as AuditChangedValue, a1 as AuditChangedValueSchema, a2 as AuditListOptions, a3 as AuditListOptionsSchema, a4 as AuditObjectItem, a5 as AuditObjectItemSchema, a6 as AuditRecord, a7 as AuditRecordPage, a8 as AuditRecordPageSchema, a9 as AuditRecordSchema, aa as AvatarUrls, ab as AvatarUrlsSchema, ac as Board, ad as BoardFilter, ae as BoardFilterSchema, af as BoardLocation, ag as BoardLocationSchema, ah as BoardPage, ai as BoardPageSchema, aj as BoardSchema, ak as BoardType, al as BoardTypeSchema, am as BulkGetGroupsOptions, an as BulkGetGroupsOptionsSchema, ao as BulkOperationError, ap as BulkOperationErrorSchema, aq as BulkOperationProgress, ar as BulkOperationProgressSchema, as as BulkOperationResult, at as BulkOperationResultSchema, au as BulkOperationStatus, av as BulkOperationStatusValue, aw as Comment, ax as CommentSchema, ay as CommentVisibility, az as CommentVisibilitySchema, aA as CommentsPage, aB as CommentsPageSchema, aC as Complexity, aD as ComplexitySchema, aE as ComponentAssigneeType, aF as ComponentAssigneeTypeSchema, aG as ContextProjectMapping, aH as ContextProjectMappingListResponse, aI as ContextProjectMappingListResponseSchema, aJ as ContextProjectMappingSchema, aK as CreateBoardInput, aL as CreateBoardInputSchema, aM as CreateComponentInput, aN as CreateComponentInputSchema, aO as CreateDashboardInput, aP as CreateDashboardInputSchema, aQ as CreateFieldContextInput, aR as CreateFieldContextInputSchema, aS as CreateFieldInput, aT as CreateFieldInputSchema, aU as CreateFieldOptionInput, aV as CreateFieldOptionInputSchema, aW as CreateFieldOptionsRequest, aX as CreateFieldOptionsRequestSchema, aY as CreateFieldOptionsResponse, aZ as CreateFieldOptionsResponseSchema, a_ as CreateFilterInput, a$ as CreateFilterInputSchema, b0 as CreateGroupInput, b1 as CreateGroupInputSchema, b2 as CreateIssueFields, b3 as CreateIssueFieldsSchema, b4 as CreateIssueInput, b5 as CreateIssueInputSchema, b6 as CreateIssueLinkInput, b7 as CreateIssueLinkInputSchema, b8 as CreateIssueLinkTypeInput, b9 as CreateIssueLinkTypeInputSchema, ba as CreateIssueResponse, bb as CreateIssueResponseSchema, bc as CreateIssueTypeInput, bd as CreateIssueTypeInputSchema, be as CreateIssueTypeSchemeInput, bf as CreateIssueTypeSchemeInputSchema, bg as CreateIssuesInput, bh as CreateIssuesInputSchema, bi as CreateIssuesResult, bj as CreateIssuesResultSchema, bk as CreateNotificationSchemeInput, bl as CreateNotificationSchemeInputSchema, bm as CreatePermissionSchemeInput, bn as CreatePermissionSchemeInputSchema, bo as CreatePriorityInput, bp as CreatePriorityInputSchema, bq as CreateProjectInput, br as CreateProjectInputSchema, bs as CreateResolutionInput, bt as CreateResolutionInputSchema, bu as CreateScreenInput, bv as CreateScreenInputSchema, bw as CreateScreenTabInput, bx as CreateScreenTabInputSchema, by as CreateSprintInput, bz as CreateSprintInputSchema, bA as CreateVersionInput, bB as CreateVersionInputSchema, bC as CreateWebhookInput, bD as CreateWebhookInputSchema, bE as CreateWorkflowSchemeInput, bF as CreateWorkflowSchemeInputSchema, bG as CreatedIssue, bH as CreatedIssueSchema, bI as CurrentUser, bJ as CurrentUserSchema, bK as Dashboard, bL as DashboardGadget, bM as DashboardGadgetList, bN as DashboardGadgetListSchema, bO as DashboardGadgetSchema, bP as DashboardListResult, bQ as DashboardListResultSchema, bR as DashboardOwner, bS as DashboardOwnerSchema, bT as DashboardSchema, bU as DashboardSharePermission, bV as DashboardSharePermissionInput, bW as DashboardSharePermissionInputSchema, bX as DashboardSharePermissionSchema, bY as DefaultShareScope, bZ as DefaultShareScopeSchema, b_ as DeleteGroupOptions, b$ as DeleteGroupOptionsSchema, c0 as DeleteIssuesInput, c1 as DeleteIssuesInputSchema, c2 as DoTransitionInput, c3 as DoTransitionInputSchema, c4 as DynamicModules, c5 as DynamicModulesSchema, c6 as ElementErrors, c7 as ElementErrorsSchema, c8 as EntityProperty, c9 as EntityPropertySchema, ca as Epic, cb as EpicColor, cc as EpicColorSchema, cd as EpicPage, ce as EpicPageSchema, cf as EpicSchema, cg as EvaluationError, ch as EvaluationErrorSchema, ci as EvaluationInput, cj as EvaluationInputSchema, ck as EvaluationMeta, cl as EvaluationMetaSchema, cm as EvaluationResult, cn as EvaluationResultSchema, co as ExpressionAnalysis, cp as ExpressionAnalysisSchema, cq as FailedWebhook, cr as FailedWebhookPage, cs as FailedWebhookPageSchema, ct as FailedWebhookSchema, cu as Field, cv as FieldConfigScheme, cw as FieldConfigSchemeSchema, cx as FieldContext, cy as FieldContextListResponse, cz as FieldContextListResponseSchema, cA as FieldContextSchema, cB as FieldOperation, cC as FieldOperationSchema, cD as FieldOption, cE as FieldOptionListResponse, cF as FieldOptionListResponseSchema, cG as FieldOptionSchema, cH as FieldSchema, cI as FieldSchemaDefinition, cJ as FieldSchemaDefinitionSchema, cK as FieldScope, cL as FieldScopeProject, cM as FieldScopeProjectSchema, cN as FieldScopeSchema, cO as FieldUsage, cP as FieldUsageSchema, cQ as Filter, cR as FilterGroupRef, cS as FilterGroupRefSchema, cT as FilterOwner, cU as FilterOwnerSchema, cV as FilterPermission, cW as FilterPermissionInput, cX as FilterPermissionInputSchema, cY as FilterPermissionSchema, cZ as FilterPermissionType, c_ as FilterPermissionTypeSchema, c$ as FilterProjectRef, d0 as FilterProjectRefSchema, d1 as FilterRoleRef, d2 as FilterRoleRefSchema, d3 as FilterSchema, d4 as FilterSearchResult, d5 as FilterSearchResultSchema, d6 as FilterShareScope, d7 as FilterShareScopeSchema, d8 as FilterSubscription, d9 as FilterSubscriptionSchema, da as FilterSubscriptions, db as FilterSubscriptionsSchema, dc as FindGroupsOptions, dd as FindGroupsOptionsSchema, de as GetBacklogOptions, df as GetBoardEpicsOptions, dg as GetBoardSprintsOptions, dh as GetBoardsOptions, di as GetContextProjectMappingsOptions, dj as GetContextProjectMappingsOptionsSchema, dk as GetFilterOptions, dl as GetGroupMembersOptions, dm as GetGroupMembersOptionsSchema, dn as GetGroupOptions, dp as GetGroupOptionsSchema, dq as GetIssueOptions, dr as GetIssueOptionsSchema, ds as GetIssueTypeSchemeMappingsOptions, dt as GetIssueTypeSchemeMappingsOptionsSchema, du as GetMyFiltersOptions, dv as GetPermissionSchemeOptions, dw as GetPermissionSchemeOptionsSchema, dx as GetProjectsOptions, dy as GetProjectsOptionsSchema, dz as GetWorkflowTransitionsOptions, dA as Group, dB as GroupMemberPage, dC as GroupMemberPageSchema, dD as GroupPage, dE as GroupPageSchema, dF as GroupPickerResult, dG as GroupPickerResultSchema, dH as GroupSchema, dI as GroupUser, dJ as GroupUserSchema, dK as GroupUsers, dL as GroupUsersSchema, dM as HealthCheck, dN as HealthCheckSchema, dO as HistoryMetadata, dP as HistoryMetadataActor, dQ as HistoryMetadataActorSchema, dR as HistoryMetadataCause, dS as HistoryMetadataCauseSchema, dT as HistoryMetadataSchema, dU as Issue, dV as IssueFields, dW as IssueFieldsSchema, dX as IssueLink, dY as IssueLinkSchema, dZ as IssueLinkType, d_ as IssueLinkTypeSchema, d$ as IssueLinkTypesResponse, e0 as IssueLinkTypesResponseSchema, e1 as IssueRef, e2 as IssueRefSchema, e3 as IssueSchema, e4 as IssueSecuritySchemesResponse, e5 as IssueSecuritySchemesResponseSchema, e6 as IssueTypeDetails, e7 as IssueTypeDetailsSchema, e8 as IssueTypeScheme, e9 as IssueTypeSchemeListResponse, ea as IssueTypeSchemeListResponseSchema, eb as IssueTypeSchemeMapping, ec as IssueTypeSchemeMappingListResponse, ed as IssueTypeSchemeMappingListResponseSchema, ee as IssueTypeSchemeMappingSchema, ef as IssueTypeSchemeSchema, eg as IssueTypeScope, eh as IssueTypeScopeProject, ei as IssueTypeScopeProjectSchema, ej as IssueTypeScopeSchema, ek as IssueUpdate, el as IssueUpdateSchema, em as JiraConfiguration, en as JiraConfigurationSchema, eo as LabelPage, ep as LabelPageSchema, eq as LabelSuggestions, er as LabelSuggestionsSchema, es as LinkedIssue, et as LinkedIssueFields, eu as LinkedIssueFieldsSchema, ev as LinkedIssueSchema, ew as ListDashboardsOptions, ex as ListFiltersOptions, ey as ListIssueTypeSchemesOptions, ez as ListIssueTypeSchemesOptionsSchema, eA as ListLabelsOptions, eB as ListNotificationSchemesOptions, eC as ListNotificationSchemesOptionsSchema, eD as ListPermissionSchemesOptions, eE as ListPermissionSchemesOptionsSchema, eF as ListScreensOptions, eG as ListWorkflowSchemesOptions, eH as ListWorkflowsOptions, eI as MAX_BULK_ISSUES, eJ as MoveIssuesToSprintInput, eK as MoveIssuesToSprintInputSchema, eL as MyPermissions, eM as MyPermissionsOptions, eN as MyPermissionsOptionsSchema, eO as MyPermissionsSchema, eP as Notification, eQ as NotificationEvent, eR as NotificationEventSchema, eS as NotificationField, eT as NotificationFieldSchema, eU as NotificationGroup, eV as NotificationGroupSchema, eW as NotificationProjectRole, eX as NotificationProjectRoleSchema, eY as NotificationSchema, eZ as NotificationScheme, e_ as NotificationSchemeItem, e$ as NotificationSchemeItemSchema, f0 as NotificationSchemePage, f1 as NotificationSchemePageSchema, f2 as NotificationSchemeSchema, f3 as NotificationTarget, f4 as NotificationTargetSchema, f5 as NotificationUser, f6 as NotificationUserSchema, f7 as Permission, f8 as PermissionGrant, f9 as PermissionGrantInput, fa as PermissionGrantInputSchema, fb as PermissionGrantSchema, fc as PermissionHolder, fd as PermissionHolderInput, fe as PermissionHolderInputSchema, ff as PermissionHolderSchema, fg as PermissionSchema, fh as PermissionScheme, fi as PermissionSchemeSchema, fj as PermissionSchemesResponse, fk as PermissionSchemesResponseSchema, fl as PermissionStatus, fm as PermissionStatusSchema, fn as PreferenceValue, fo as PreferenceValueSchema, fp as Priority, fq as PrioritySchema, fr as Project, fs as ProjectComponent, ft as ProjectComponentSchema, fu as ProjectComponents, fv as ProjectComponentsSchema, fw as ProjectRef, fx as ProjectRefSchema, fy as ProjectRole, fz as ProjectRoleActor, fA as ProjectRoleActorGroup, fB as ProjectRoleActorGroupSchema, fC as ProjectRoleActorSchema, fD as ProjectRoleActorType, fE as ProjectRoleActorTypeSchema, fF as ProjectRoleActorUser, fG as ProjectRoleActorUserSchema, fH as ProjectRoleSchema, fI as ProjectRoleScope, fJ as ProjectRoleScopeProject, fK as ProjectRoleScopeProjectSchema, fL as ProjectRoleScopeSchema, fM as ProjectRoles, fN as ProjectRolesSchema, fO as ProjectSchema, fP as ProjectSearchResult, fQ as ProjectSearchResultSchema, fR as ProjectVersion, fS as ProjectVersionSchema, fT as ProjectVersions, fU as ProjectVersionsSchema, fV as PublishedWorkflowId, fW as PublishedWorkflowIdSchema, fX as RemoveContextProjectsInput, fY as RemoveContextProjectsInputSchema, fZ as RemoveGroupUserOptions, f_ as RemoveGroupUserOptionsSchema, f$ as Resolution, g0 as ResolutionSchema, g1 as Screen, g2 as ScreenField, g3 as ScreenFieldSchema, g4 as ScreenListResult, g5 as ScreenListResultSchema, g6 as ScreenProject, g7 as ScreenProjectSchema, g8 as ScreenSchema, g9 as ScreenScope, ga as ScreenScopeSchema, gb as ScreenTab, gc as ScreenTabSchema, gd as SecurityLevel, ge as SecurityLevelSchema, gf as SecurityScheme, gg as SecuritySchemeSchema, gh as SendNotificationInput, gi as SendNotificationInputSchema, gj as ServerInfo, gk as ServerInfoSchema, gl as SetApplicationPropertyInput, gm as SetApplicationPropertyInputSchema, gn as SetUserPreferencesInput, go as SetUserPreferencesInputSchema, gp as Sprint, gq as SprintPage, gr as SprintPageSchema, gs as SprintSchema, gt as SprintState, gu as SprintStateSchema, gv as TERMINAL_BULK_OPERATION_STATUSES, gw as TimeTrackingConfiguration, gx as TimeTrackingConfigurationSchema, gy as TimeTrackingCreateWorklogInput, gz as TimeTrackingCreateWorklogInputSchema, gA as TimeTrackingProvider, gB as TimeTrackingProviderSchema, gC as TimeTrackingUpdateWorklogInput, gD as TimeTrackingUpdateWorklogInputSchema, gE as Transition, gF as TransitionSchema, gG as TransitionsResponse, gH as TransitionsResponseSchema, gI as UpdateCommentInput, gJ as UpdateCommentInputSchema, gK as UpdateComponentInput, gL as UpdateComponentInputSchema, gM as UpdateDashboardInput, gN as UpdateDashboardInputSchema, gO as UpdateFieldContextInput, gP as UpdateFieldContextInputSchema, gQ as UpdateFieldInput, gR as UpdateFieldInputSchema, gS as UpdateFilterInput, gT as UpdateFilterInputSchema, gU as UpdateGadgetInput, gV as UpdateGadgetInputSchema, gW as UpdateIssueInput, gX as UpdateIssueInputSchema, gY as UpdateIssueLinkTypeInput, gZ as UpdateIssueLinkTypeInputSchema, g_ as UpdateIssueTypeInput, g$ as UpdateIssueTypeInputSchema, h0 as UpdateIssueTypeSchemeInput, h1 as UpdateIssueTypeSchemeInputSchema, h2 as UpdateNotificationSchemeInput, h3 as UpdateNotificationSchemeInputSchema, h4 as UpdatePermissionSchemeInput, h5 as UpdatePermissionSchemeInputSchema, h6 as UpdatePriorityInput, h7 as UpdatePriorityInputSchema, h8 as UpdateProjectInput, h9 as UpdateProjectInputSchema, ha as UpdateResolutionInput, hb as UpdateResolutionInputSchema, hc as UpdateScreenInput, hd as UpdateScreenInputSchema, he as UpdateScreenTabInput, hf as UpdateScreenTabInputSchema, hg as UpdateSprintInput, hh as UpdateSprintInputSchema, hi as UpdateTimeTrackingConfigurationInput, hj as UpdateTimeTrackingConfigurationInputSchema, hk as UpdateVersionInput, hl as UpdateVersionInputSchema, hm as UpdateWebhookInput, hn as UpdateWebhookInputSchema, ho as UpdateWorkflowSchemeInput, hp as UpdateWorkflowSchemeInputSchema, hq as UpdateWorklogInput, hr as UpdateWorklogInputSchema, hs as User, ht as UserGroupItem, hu as UserGroupItemSchema, hv as UserGroups, hw as UserGroupsSchema, hx as UserInput, hy as UserInputSchema, hz as UserPreferences, hA as UserPreferencesSchema, hB as UserRef, hC as UserRefSchema, hD as UserSchema, hE as WaitForCompletionOptions, hF as Watchers, hG as WatchersSchema, hH as Webhook, hI as WebhookError, hJ as WebhookErrorSchema, hK as WebhookListOptions, hL as WebhookListOptionsSchema, hM as WebhookPage, hN as WebhookPageSchema, hO as WebhookRefreshResponse, hP as WebhookRefreshResponseSchema, hQ as WebhookRegistrationResponse, hR as WebhookRegistrationResponseSchema, hS as WebhookRegistrationResult, hT as WebhookRegistrationResultSchema, hU as WebhookSchema, hV as Workflow, hW as WorkflowDoTransitionInput, hX as WorkflowDoTransitionInputSchema, hY as WorkflowFieldInfo, hZ as WorkflowFieldInfoSchema, h_ as WorkflowFieldSchema, h$ as WorkflowFieldSchemaSchema, i0 as WorkflowSchema, i1 as WorkflowScheme, i2 as WorkflowSchemeIssueTypeInput, i3 as WorkflowSchemeIssueTypeInputSchema, i4 as WorkflowSchemeListResult, i5 as WorkflowSchemeListResultSchema, i6 as WorkflowSchemeSchema, i7 as WorkflowSchemeUser, i8 as WorkflowSchemeUserSchema, i9 as WorkflowSearchResult, ia as WorkflowSearchResultSchema, ib as WorkflowStatus, ic as WorkflowStatusCategory, id as WorkflowStatusCategorySchema, ie as WorkflowStatusSchema, ig as WorkflowTransition, ih as WorkflowTransitionSchema, ii as WorkflowTransitionsResponse, ij as WorkflowTransitionsResponseSchema, ik as Worklog, il as WorklogListOptions, im as WorklogProperty, io as WorklogPropertySchema, ip as WorklogSchema, iq as WorklogVisibility, ir as WorklogVisibilitySchema, is as WorklogsPage, it as WorklogsPageSchema, iu as adfToText, iv as blocksLinkType, iw as causesLinkType, ix as clonesLinkType, iy as duplicatesLinkType, iz as relatesToLinkType, iA as textToAdf } from './webhook-Bn8gme6Y.cjs';
11
+ import { IssueService, ProjectService, SearchService, UserService, AgileService, FieldService, IssueTypeService, IssueLinkTypeService, PriorityService, ResolutionService, ScreenService, WorkflowService, DashboardService, FilterService, GroupService, MyselfService, PermissionService, SecurityLevelService, AppPropertiesService, AuditService, BulkService, ExpressionService, LabelService, NotificationService, ServerInfoService, TimeTrackingService, WebhookService } from './services/index.cjs';
4
12
  export { BaseService, SearchOptions, SearchResult } from './services/index.cjs';
5
- export { Component, ComponentInput, ComponentInputSchema, ComponentSchema, Insight, InsightSchema, IssuePriority, IssuePrioritySchema, IssueProject, IssueProjectSchema, IssueResolution, IssueResolutionSchema, IssueStatus, IssueStatusSchema, IssueType, IssueTypeInput, IssueTypeInputSchema, IssueTypeSchema, PriorityInput, PriorityInputSchema, ProjectCategory, ProjectCategorySchema, ProjectInput, ProjectInputSchema, ProjectLead, ProjectLeadSchema, ProjectStyle, ProjectStyleSchema, ProjectType, ProjectTypeSchema, ResolutionInput, ResolutionInputSchema, StatusCategory, StatusCategorySchema, Version, VersionInput, VersionInputSchema, VersionSchema } from './schemas/index.cjs';
6
- export { J as AddAttachmentResponse, H as AddAttachmentResponseSchema, q as AddCommentInput, A as AddCommentInputSchema, O as AddWorklogInput, N as AddWorklogInputSchema, B as Attachment, F as AttachmentMetadata, E as AttachmentMetadataSchema, z as AttachmentSchema, p as Comment, o as CommentSchema, n as CommentVisibility, m as CommentVisibilitySchema, u as CommentsPage, t as CommentsPageSchema, f as CreateIssueFields, C as CreateIssueFieldsSchema, h as CreateIssueInput, g as CreateIssueInputSchema, a3 as CreateIssueLinkInput, a2 as CreateIssueLinkInputSchema, k as CreateIssueResponse, j as CreateIssueResponseSchema, ai as CreateProjectInput, ah as CreateProjectInputSchema, y as DoTransitionInput, D as DoTransitionInputSchema, l as GetIssueOptions, G as GetIssueOptionsSchema, ao as GetProjectsOptions, an as GetProjectsOptionsSchema, e as Issue, c as IssueFields, b as IssueFieldsSchema, a1 as IssueLink, a0 as IssueLinkSchema, X as IssueLinkType, V as IssueLinkTypeSchema, a5 as IssueLinkTypesResponse, a4 as IssueLinkTypesResponseSchema, a as IssueRef, I as IssueRefSchema, d as IssueSchema, $ as LinkedIssue, Z as LinkedIssueFields, Y as LinkedIssueFieldsSchema, _ as LinkedIssueSchema, ag as Project, ae as ProjectRef, ad as ProjectRefSchema, af as ProjectSchema, am as ProjectSearchResult, al as ProjectSearchResultSchema, v as Transition, T as TransitionSchema, x as TransitionsResponse, w as TransitionsResponseSchema, s as UpdateCommentInput, r as UpdateCommentInputSchema, i as UpdateIssueInput, U as UpdateIssueInputSchema, ak as UpdateProjectInput, aj as UpdateProjectInputSchema, Q as UpdateWorklogInput, P as UpdateWorklogInputSchema, ac as Watchers, ab as WatchersSchema, M as Worklog, L as WorklogSchema, K as WorklogVisibility, W as WorklogVisibilitySchema, S as WorklogsPage, R as WorklogsPageSchema, a6 as blocksLinkType, a9 as causesLinkType, aa as clonesLinkType, a7 as duplicatesLinkType, a8 as relatesToLinkType } from './project-B1UelBH4.cjs';
13
+ export { Component, ComponentInput, ComponentInputSchema, ComponentSchema, DashboardGroupRef, DashboardGroupRefSchema, DashboardProjectRef, DashboardProjectRefSchema, DashboardRoleRef, DashboardRoleRefSchema, GadgetColor, GadgetColorSchema, GadgetPosition, GadgetPositionSchema, IdLink, IdLinkSchema, Insight, InsightSchema, IssuePriority, IssuePrioritySchema, IssueProject, IssueProjectSchema, IssueResolution, IssueResolutionSchema, IssueStatus, IssueStatusSchema, IssueType, IssueTypeInput, IssueTypeInputSchema, IssueTypeSchema, JiraDate, JiraDateSchema, JiraDateTime, JiraDateTimeSchema, NamedLink, NamedLinkSchema, OptionalJiraDateTime, OptionalJiraDateTimeSchema, PaginatedResponse, PaginationParams, PaginationParamsSchema, PriorityInput, PriorityInputSchema, ProjectCategory, ProjectCategorySchema, ProjectInput, ProjectInputSchema, ProjectLead, ProjectLeadSchema, ProjectStyle, ProjectStyleSchema, ProjectType, ProjectTypeSchema, ResolutionInput, ResolutionInputSchema, SearchPagination, SearchPaginationSchema, SelfLink, SelfLinkSchema, StatusCategory, StatusCategorySchema, Version, VersionInput, VersionInputSchema, VersionSchema, WebLink, WebLinkSchema, commentInputFromText, createPaginatedResponseSchema, getAttachmentCreatedDate, getCommentBodyText, getCommentCreatedDate, getCommentUpdatedDate, getCreatedDate, getDescriptionText, getDueDate, getEnvironmentText, getResolutionDate, getUpdatedDate, getWorklogCommentText, getWorklogStartedDate, setBody, setBodyText, setDescription, setDescriptionText, setEnvironment, setEnvironmentText, toJiraDate, toJiraDateTime } from './schemas/index.cjs';
7
14
  import 'zod';
8
- import '@felixgeelhaar/sdk-core/schemas';
15
+
16
+ /**
17
+ * Common type definitions used throughout the SDK.
18
+ */
19
+ /** Generic async function type */
20
+ type AsyncFn<T = void> = () => Promise<T>;
21
+ /** Generic callback with error-first pattern */
22
+ type Callback<T> = (error: Error | null, result?: T) => void;
23
+ /** Brand type for nominal typing */
24
+ type Brand<T, B> = T & {
25
+ __brand: B;
26
+ };
27
+ /** Issue key (e.g., "PROJ-123") */
28
+ type IssueKey = Brand<string, 'IssueKey'>;
29
+ /** Project key (e.g., "PROJ") */
30
+ type ProjectKey = Brand<string, 'ProjectKey'>;
31
+ /** Account ID for Jira Cloud users */
32
+ type AccountId = Brand<string, 'AccountId'>;
33
+ /** Deep partial type for nested optional properties */
34
+ type DeepPartial<T> = {
35
+ [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
36
+ };
37
+ /** Make specific properties required */
38
+ type RequireFields<T, K extends keyof T> = T & Required<Pick<T, K>>;
39
+ /** Make specific properties optional */
40
+ type OptionalFields<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
41
+ /** Extract the element type from an array */
42
+ type ArrayElement<T> = T extends ReadonlyArray<infer E> ? E : never;
43
+ /** Make all properties mutable */
44
+ type Mutable<T> = {
45
+ -readonly [P in keyof T]: T[P];
46
+ };
47
+ /** JSON serializable types */
48
+ type JsonPrimitive = string | number | boolean | null;
49
+ type JsonArray = JsonValue[];
50
+ interface JsonObject {
51
+ [key: string]: JsonValue;
52
+ }
53
+ type JsonValue = JsonPrimitive | JsonArray | JsonObject;
54
+ /** Expand options for API requests */
55
+ interface ExpandOptions {
56
+ expand?: string[];
57
+ }
58
+ /** Field selection options for API requests */
59
+ interface FieldOptions {
60
+ fields?: string[];
61
+ }
62
+
63
+ /**
64
+ * No-op logger that discards all log messages.
65
+ * Used as the default logger when no logger is configured.
66
+ */
67
+ declare class NoopLogger implements Logger {
68
+ debug(_message: string, _fields?: LogFields): void;
69
+ info(_message: string, _fields?: LogFields): void;
70
+ warn(_message: string, _fields?: LogFields): void;
71
+ error(_message: string, _fields?: LogFields): void;
72
+ child(_fields: LogFields): Logger;
73
+ }
74
+ /** Singleton instance of the no-op logger */
75
+ declare const noopLogger: NoopLogger;
76
+
77
+ /**
78
+ * Options for configuring the console logger
79
+ */
80
+ interface ConsoleLoggerOptions {
81
+ /** Minimum log level to output */
82
+ level?: LogLevel;
83
+ /** Whether to include timestamps */
84
+ timestamps?: boolean;
85
+ /** Whether to pretty print objects */
86
+ prettyPrint?: boolean;
87
+ /** Prefix for all log messages */
88
+ prefix?: string;
89
+ }
90
+ /**
91
+ * Console logger implementation for development and debugging.
92
+ */
93
+ declare class ConsoleLogger implements Logger {
94
+ private readonly options;
95
+ private readonly contextFields;
96
+ constructor(options?: ConsoleLoggerOptions, contextFields?: LogFields);
97
+ debug(message: string, fields?: LogFields): void;
98
+ info(message: string, fields?: LogFields): void;
99
+ warn(message: string, fields?: LogFields): void;
100
+ error(message: string, fields?: LogFields): void;
101
+ child(fields: LogFields): Logger;
102
+ private log;
103
+ private shouldLog;
104
+ private formatMessage;
105
+ private getConsoleFn;
106
+ }
107
+ /** Create a console logger with sensible defaults */
108
+ declare function createConsoleLogger(options?: ConsoleLoggerOptions): ConsoleLogger;
109
+
110
+ /**
111
+ * Utility functions for the SDK.
112
+ */
113
+ /**
114
+ * Sleep for a specified duration
115
+ */
116
+ declare function sleep(ms: number): Promise<void>;
117
+ /**
118
+ * Create a timeout promise that rejects after the specified duration
119
+ */
120
+ declare function timeout(ms: number, message?: string): Promise<never>;
121
+ /**
122
+ * Race a promise against a timeout
123
+ */
124
+ declare function promiseWithTimeout<T>(promise: Promise<T>, ms: number, message?: string): Promise<T>;
125
+ /**
126
+ * Build a URL query string from a parameters object.
127
+ *
128
+ * Returns the encoded pairs **without** a leading `?` (for example
129
+ * `a=1&b=2`), so callers stay in control of the separator. Returns an empty
130
+ * string when there is nothing to encode.
131
+ *
132
+ * Note: this previously returned a leading `?`, while the only caller also
133
+ * prepended its own separator. The result was a doubled `??`, which made the
134
+ * first parameter's name `?jql` rather than `jql` — so the first query
135
+ * parameter of every request was silently dropped by Jira.
136
+ */
137
+ declare function buildQueryString(params: Record<string, unknown>): string;
138
+ /**
139
+ * Join path segments into a URL path
140
+ */
141
+ declare function joinPath(...segments: Array<string | number>): string;
142
+ /**
143
+ * Build a Jira REST API path
144
+ */
145
+ declare function buildApiPath(version: '2' | '3', ...segments: Array<string | number>): string;
146
+ /**
147
+ * Build a Jira Agile API path
148
+ */
149
+ declare function buildAgileApiPath(...segments: Array<string | number>): string;
150
+ /**
151
+ * Safely parse JSON, returning undefined on error
152
+ */
153
+ declare function safeJsonParse<T = unknown>(json: string): T | undefined;
154
+ /**
155
+ * Check if a value is a non-null object
156
+ */
157
+ declare function isObject(value: unknown): value is Record<string, unknown>;
158
+ /**
159
+ * Check if a value is a non-empty string
160
+ */
161
+ declare function isNonEmptyString(value: unknown): value is string;
162
+ /**
163
+ * Clamp a number between min and max
164
+ */
165
+ declare function clamp(value: number, min: number, max: number): number;
166
+ /**
167
+ * Calculate exponential backoff delay
168
+ */
169
+ declare function exponentialBackoff(attempt: number, baseDelay: number, maxDelay: number, multiplier?: number, jitter?: boolean): number;
170
+ /**
171
+ * Generate a random request ID for tracing
172
+ */
173
+ declare function generateRequestId(): string;
174
+ /**
175
+ * Sanitize headers for logging (redact sensitive values)
176
+ */
177
+ declare function sanitizeHeaders(headers: Record<string, string>): Record<string, string>;
178
+ /**
179
+ * Retry a function with exponential backoff
180
+ */
181
+ declare function retry<T>(fn: () => Promise<T>, options: {
182
+ maxAttempts: number;
183
+ baseDelay: number;
184
+ maxDelay: number;
185
+ shouldRetry?: (error: unknown, attempt: number) => boolean;
186
+ }): Promise<T>;
187
+ /**
188
+ * Create a deferred promise
189
+ */
190
+ declare function createDeferred<T>(): {
191
+ promise: Promise<T>;
192
+ resolve: (value: T) => void;
193
+ reject: (error: unknown) => void;
194
+ };
195
+ /**
196
+ * Parse a Jira duration string into seconds.
197
+ *
198
+ * Accepts the units Jira uses — `w`, `d`, `h`, `m`, `s` — in any order, with
199
+ * or without spaces. A bare number is interpreted as minutes, as Jira does.
200
+ *
201
+ * @param value - Duration string, e.g. `'3h 30m'`, `'1d4h'`, `'90'`
202
+ * @returns The duration in whole seconds
203
+ * @throws {Error} If the string is empty or not a valid duration
204
+ *
205
+ * @example
206
+ * ```ts
207
+ * parseDuration('3h 30m'); // 12600
208
+ * parseDuration('1d 4h'); // 100800
209
+ * ```
210
+ */
211
+ declare function parseDuration(value: string): number;
212
+ /**
213
+ * Format a number of seconds as a Jira duration string.
214
+ *
215
+ * Uses the same calendar units as {@link parseDuration}, so the two round-trip.
216
+ * Components that would be zero are omitted; sub-minute remainders are dropped.
217
+ *
218
+ * @param seconds - A non-negative duration in seconds
219
+ * @returns The duration string, e.g. `'3h 30m'`; `'0m'` for zero
220
+ * @throws {Error} If `seconds` is negative or not a finite number
221
+ *
222
+ * @example
223
+ * ```ts
224
+ * formatDuration(12600); // '3h 30m'
225
+ * formatDuration(100800); // '1d 4h'
226
+ * ```
227
+ */
228
+ declare function formatDuration(seconds: number): string;
229
+ /**
230
+ * Parse environment variable as number
231
+ */
232
+ declare function parseEnvNumber(value: string | undefined, defaultValue: number): number;
233
+ /**
234
+ * Parse environment variable as boolean
235
+ */
236
+ declare function parseEnvBoolean(value: string | undefined, defaultValue: boolean): boolean;
237
+
238
+ /**
239
+ * Fluent builder for Atlassian Document Format (ADF) documents.
240
+ *
241
+ * The builder is immutable: every `add*` method returns a **new** builder
242
+ * instance, leaving the receiver untouched. This makes it safe to keep a
243
+ * partially built document around and branch from it.
244
+ *
245
+ * @example
246
+ * ```ts
247
+ * const doc = adf()
248
+ * .addHeading('Release notes', 2)
249
+ * .addParagraph('Highlights of this release:')
250
+ * .addBulletList(['Faster search', 'Fewer bugs'])
251
+ * .addCodeBlock('npm install jirasdk', 'bash')
252
+ * .toDocument();
253
+ * ```
254
+ */
255
+ declare class AdfBuilder {
256
+ private readonly nodes;
257
+ private constructor();
258
+ /**
259
+ * Creates an empty ADF document builder.
260
+ *
261
+ * Equivalent to the Go SDK's `issue.NewADF()`.
262
+ *
263
+ * @returns A new, empty builder
264
+ */
265
+ static create(): AdfBuilder;
266
+ /**
267
+ * Creates a builder pre-populated from plain text.
268
+ *
269
+ * Text is split into paragraphs on blank lines (`\n\n`); a single newline is
270
+ * treated as a soft wrap and becomes a space within the current paragraph.
271
+ * This mirrors the Go SDK's `issue.ADFFromText`.
272
+ *
273
+ * @param text - The plain text to convert
274
+ * @returns A builder containing one paragraph per text block
275
+ */
276
+ static fromText(text: string): AdfBuilder;
277
+ /**
278
+ * Creates a builder from an existing ADF document, so it can be extended.
279
+ *
280
+ * @param document - The document to seed the builder with
281
+ * @returns A builder containing the document's top-level nodes
282
+ */
283
+ static fromDocument(document: AdfDocument): AdfBuilder;
284
+ /**
285
+ * Appends a paragraph of plain text.
286
+ *
287
+ * @param text - The paragraph text
288
+ * @returns A new builder with the paragraph appended
289
+ */
290
+ addParagraph(text: string): AdfBuilder;
291
+ /**
292
+ * Appends a heading.
293
+ *
294
+ * @param text - The heading text
295
+ * @param level - Heading level; values outside 1-6 are clamped (default 1)
296
+ * @returns A new builder with the heading appended
297
+ */
298
+ addHeading(text: string, level?: number): AdfBuilder;
299
+ /**
300
+ * Appends a bullet (unordered) list.
301
+ *
302
+ * @param items - One string per list item
303
+ * @returns A new builder with the list appended
304
+ */
305
+ addBulletList(items: readonly string[]): AdfBuilder;
306
+ /**
307
+ * Appends an ordered (numbered) list.
308
+ *
309
+ * @param items - One string per list item
310
+ * @returns A new builder with the list appended
311
+ */
312
+ addOrderedList(items: readonly string[]): AdfBuilder;
313
+ /**
314
+ * Appends a code block.
315
+ *
316
+ * @param code - The source code
317
+ * @param language - Optional syntax-highlighting language (e.g. `'ts'`)
318
+ * @returns A new builder with the code block appended
319
+ */
320
+ addCodeBlock(code: string, language?: string): AdfBuilder;
321
+ /**
322
+ * Appends an arbitrary, pre-built ADF node for constructs the builder does
323
+ * not model (panels, tables, media, ...).
324
+ *
325
+ * @param node - The node to append
326
+ * @returns A new builder with the node appended
327
+ */
328
+ addNode(node: AdfNode): AdfBuilder;
329
+ /**
330
+ * Returns true when the document has no content nodes.
331
+ *
332
+ * @returns Whether the builder is empty
333
+ */
334
+ isEmpty(): boolean;
335
+ /**
336
+ * Number of top-level content nodes.
337
+ */
338
+ get length(): number;
339
+ /**
340
+ * Builds and validates the ADF document.
341
+ *
342
+ * @returns A document validated against `AdfDocumentSchema`
343
+ * @throws {z.ZodError} If the accumulated content is not valid ADF
344
+ */
345
+ toDocument(): AdfDocument;
346
+ /**
347
+ * Extracts the plain-text representation of the document.
348
+ *
349
+ * @returns The document rendered as plain text
350
+ */
351
+ toText(): string;
352
+ /**
353
+ * Makes `JSON.stringify(builder)` emit the ADF document.
354
+ *
355
+ * @returns The built document
356
+ */
357
+ toJSON(): AdfDocument;
358
+ /**
359
+ * Pretty-printed JSON, useful for debugging (Go's `ADF.String()`).
360
+ *
361
+ * @returns The document as indented JSON
362
+ */
363
+ toString(): string;
364
+ private append;
365
+ }
366
+ /**
367
+ * Shorthand factory for {@link AdfBuilder.create}.
368
+ *
369
+ * @returns A new, empty ADF builder
370
+ */
371
+ declare function adf(): AdfBuilder;
372
+ /**
373
+ * Shorthand factory for {@link AdfBuilder.fromText}.
374
+ *
375
+ * @param text - The plain text to convert
376
+ * @returns A builder seeded with the text
377
+ */
378
+ declare function adfFromText(text: string): AdfBuilder;
379
+
380
+ /**
381
+ * Known custom field types.
382
+ *
383
+ * Modelled as a const object rather than a TS `enum` so it survives
384
+ * `isolatedModules` and erases cleanly at runtime.
385
+ */
386
+ declare const CustomFieldType: {
387
+ readonly String: "string";
388
+ readonly Number: "number";
389
+ readonly Date: "date";
390
+ readonly DateTime: "datetime";
391
+ readonly User: "user";
392
+ readonly Select: "select";
393
+ readonly MultiSelect: "multiselect";
394
+ readonly Url: "url";
395
+ readonly TextArea: "textarea";
396
+ readonly Checkbox: "checkbox";
397
+ readonly Radio: "radio";
398
+ readonly CascadingSelect: "cascadingselect";
399
+ readonly Version: "version";
400
+ readonly Labels: "labels";
401
+ };
402
+ type CustomFieldType = (typeof CustomFieldType)[keyof typeof CustomFieldType];
403
+ /**
404
+ * A single custom field value together with the type it was written as.
405
+ */
406
+ interface CustomField {
407
+ /** The custom field id, e.g. `customfield_10001` */
408
+ id: string;
409
+ /** The type the value was set as; absent for raw/unmarshalled values */
410
+ type?: CustomFieldType | undefined;
411
+ /** The wire value, exactly as it is sent to (or received from) Jira */
412
+ value: unknown;
413
+ }
414
+ /**
415
+ * Type-safe helper for reading and writing Jira custom fields.
416
+ *
417
+ * Setters are chainable and return the same instance; getters return the
418
+ * decoded value or `undefined` when the field is absent or holds an
419
+ * incompatible shape.
420
+ *
421
+ * @example
422
+ * ```ts
423
+ * const fields = new CustomFields()
424
+ * .setString('customfield_10001', 'Sprint 1')
425
+ * .setNumber('customfield_10002', 42.5)
426
+ * .setLabels('customfield_10008', ['bug', 'urgent']);
427
+ *
428
+ * await client.issues.updateIssue('PROJ-1', { fields: fields.toMap() });
429
+ * ```
430
+ */
431
+ declare class CustomFields {
432
+ private readonly fields;
433
+ /**
434
+ * Creates a collection, optionally seeded from raw Jira field values.
435
+ *
436
+ * @param initial - Raw `{ fieldId: value }` map, e.g. from an issue response
437
+ */
438
+ constructor(initial?: Readonly<Record<string, unknown>>);
439
+ /**
440
+ * Creates an empty collection (Go's `NewCustomFields`).
441
+ *
442
+ * @returns A new, empty collection
443
+ */
444
+ static create(): CustomFields;
445
+ /**
446
+ * Creates a collection from a raw `{ fieldId: value }` map (Go's `FromMap`).
447
+ *
448
+ * @param map - Raw field values as returned by the Jira API
449
+ * @returns A collection wrapping the supplied values
450
+ */
451
+ static fromMap(map: Readonly<Record<string, unknown>>): CustomFields;
452
+ /**
453
+ * Parses a JSON string or already-parsed object of raw field values
454
+ * (Go's `UnmarshalJSON`).
455
+ *
456
+ * @param data - JSON text or a plain object of field values
457
+ * @returns A collection wrapping the parsed values
458
+ * @throws {Error} If the input is not a JSON object
459
+ */
460
+ static fromJSON(data: string | Record<string, unknown>): CustomFields;
461
+ /** Number of fields held in the collection. */
462
+ get size(): number;
463
+ /**
464
+ * Whether a field id is present.
465
+ *
466
+ * @param fieldId - The custom field id
467
+ * @returns True when the field has a value
468
+ */
469
+ has(fieldId: string): boolean;
470
+ /**
471
+ * Removes a field.
472
+ *
473
+ * @param fieldId - The custom field id
474
+ * @returns This collection, for chaining
475
+ */
476
+ remove(fieldId: string): this;
477
+ /**
478
+ * The declared type of a field, when it was written through a typed setter.
479
+ *
480
+ * @param fieldId - The custom field id
481
+ * @returns The field type, or `undefined`
482
+ */
483
+ getType(fieldId: string): CustomFieldType | undefined;
484
+ /**
485
+ * Sets a text field value.
486
+ *
487
+ * @param fieldId - The custom field id
488
+ * @param value - The text value
489
+ * @returns This collection, for chaining
490
+ */
491
+ setString(fieldId: string, value: string): this;
492
+ /**
493
+ * Reads a text field value.
494
+ *
495
+ * @param fieldId - The custom field id
496
+ * @returns The string, or `undefined` if absent or not a string
497
+ */
498
+ getString(fieldId: string): string | undefined;
499
+ /**
500
+ * Sets a numeric field value.
501
+ *
502
+ * @param fieldId - The custom field id
503
+ * @param value - The numeric value
504
+ * @returns This collection, for chaining
505
+ */
506
+ setNumber(fieldId: string, value: number): this;
507
+ /**
508
+ * Reads a numeric field value. Numeric strings are coerced, as Jira
509
+ * occasionally returns numbers as strings.
510
+ *
511
+ * @param fieldId - The custom field id
512
+ * @returns The number, or `undefined` if absent or not numeric
513
+ */
514
+ getNumber(fieldId: string): number | undefined;
515
+ /**
516
+ * Sets a date field value, serialised as `YYYY-MM-DD` (UTC).
517
+ *
518
+ * @param fieldId - The custom field id
519
+ * @param value - A `Date` or an already formatted `YYYY-MM-DD` string
520
+ * @returns This collection, for chaining
521
+ */
522
+ setDate(fieldId: string, value: Date | string): this;
523
+ /**
524
+ * Reads a date field value, tolerating the several formats Jira emits.
525
+ *
526
+ * @param fieldId - The custom field id
527
+ * @returns The parsed `Date`, or `undefined` if absent or unparseable
528
+ */
529
+ getDate(fieldId: string): Date | undefined;
530
+ /**
531
+ * Sets a datetime field value, serialised as ISO-8601.
532
+ *
533
+ * @param fieldId - The custom field id
534
+ * @param value - A `Date` or an already formatted ISO-8601 string
535
+ * @returns This collection, for chaining
536
+ */
537
+ setDateTime(fieldId: string, value: Date | string): this;
538
+ /**
539
+ * Reads a datetime field value, tolerating the several formats Jira emits.
540
+ *
541
+ * @param fieldId - The custom field id
542
+ * @returns The parsed `Date`, or `undefined` if absent or unparseable
543
+ */
544
+ getDateTime(fieldId: string): Date | undefined;
545
+ /**
546
+ * Sets a user-picker field value.
547
+ *
548
+ * @param fieldId - The custom field id
549
+ * @param accountId - The Atlassian account id
550
+ * @returns This collection, for chaining
551
+ */
552
+ setUser(fieldId: string, accountId: string): this;
553
+ /**
554
+ * Reads the account id from a user-picker field.
555
+ *
556
+ * @param fieldId - The custom field id
557
+ * @returns The account id, or `undefined`
558
+ */
559
+ getUser(fieldId: string): string | undefined;
560
+ /**
561
+ * Sets a single-select field value.
562
+ *
563
+ * @param fieldId - The custom field id
564
+ * @param value - The option value
565
+ * @returns This collection, for chaining
566
+ */
567
+ setSelect(fieldId: string, value: string): this;
568
+ /**
569
+ * Reads a single-select field value.
570
+ *
571
+ * @param fieldId - The custom field id
572
+ * @returns The option value, or `undefined`
573
+ */
574
+ getSelect(fieldId: string): string | undefined;
575
+ /**
576
+ * Sets a multi-select field value.
577
+ *
578
+ * @param fieldId - The custom field id
579
+ * @param values - The option values
580
+ * @returns This collection, for chaining
581
+ */
582
+ setMultiSelect(fieldId: string, values: readonly string[]): this;
583
+ /**
584
+ * Reads a multi-select field value.
585
+ *
586
+ * @param fieldId - The custom field id
587
+ * @returns The option values, or `undefined` if absent or not an array
588
+ */
589
+ getMultiSelect(fieldId: string): string[] | undefined;
590
+ /**
591
+ * Sets a labels field value.
592
+ *
593
+ * @param fieldId - The custom field id
594
+ * @param labels - The labels
595
+ * @returns This collection, for chaining
596
+ */
597
+ setLabels(fieldId: string, labels: readonly string[]): this;
598
+ /**
599
+ * Reads a labels field value.
600
+ *
601
+ * @param fieldId - The custom field id
602
+ * @returns The labels, or `undefined` if absent or not an array
603
+ */
604
+ getLabels(fieldId: string): string[] | undefined;
605
+ /**
606
+ * Sets an arbitrary value for field shapes the typed setters do not cover.
607
+ *
608
+ * @param fieldId - The custom field id
609
+ * @param value - The value, sent to Jira verbatim
610
+ * @returns This collection, for chaining
611
+ */
612
+ setRaw(fieldId: string, value: unknown): this;
613
+ /**
614
+ * Reads the untouched wire value of a field.
615
+ *
616
+ * @param fieldId - The custom field id
617
+ * @returns The raw value, or `undefined` if the field is absent
618
+ */
619
+ getRaw(fieldId: string): unknown;
620
+ /**
621
+ * Merges another collection into this one; conflicting ids are overwritten.
622
+ *
623
+ * @param other - The collection to merge in
624
+ * @returns This collection, for chaining
625
+ */
626
+ merge(other: CustomFields): this;
627
+ /**
628
+ * All entries as `[fieldId, CustomField]` pairs.
629
+ *
630
+ * @returns An iterable of field entries
631
+ */
632
+ entries(): IterableIterator<[string, CustomField]>;
633
+ /**
634
+ * All field ids in the collection.
635
+ *
636
+ * @returns An iterable of field ids
637
+ */
638
+ keys(): IterableIterator<string>;
639
+ /**
640
+ * Converts to the `{ fieldId: value }` map Jira expects in a `fields` payload.
641
+ *
642
+ * @returns A plain object of raw field values
643
+ */
644
+ toMap(): Record<string, unknown>;
645
+ /**
646
+ * Makes `JSON.stringify(fields)` emit the Jira wire format.
647
+ *
648
+ * @returns The same object as {@link CustomFields.toMap}
649
+ */
650
+ toJSON(): Record<string, unknown>;
651
+ /**
652
+ * Creates an independent copy of this collection.
653
+ *
654
+ * @returns A cloned collection
655
+ */
656
+ clone(): CustomFields;
657
+ private set;
658
+ private rawValue;
659
+ }
660
+
661
+ /** Sort direction for an `ORDER BY` term. */
662
+ type SortDirection = 'ASC' | 'DESC';
663
+ /**
664
+ * Fluent, injection-safe builder for JQL queries.
665
+ *
666
+ * The builder is immutable: every method returns a **new** builder, so a
667
+ * partially built query can be safely reused as the base for several
668
+ * variations.
669
+ *
670
+ * Consecutive clauses are joined with `AND` automatically; call
671
+ * {@link JqlQueryBuilder.or} between them to use `OR` instead.
672
+ *
673
+ * @example
674
+ * ```ts
675
+ * const jql = jql()
676
+ * .project('PROJ')
677
+ * .status('In Progress')
678
+ * .assignee('5b10a2844c20165700ede21g')
679
+ * .orderBy('created', 'DESC')
680
+ * .build();
681
+ * // project = "PROJ" AND status = "In Progress" AND assignee = "5b10..." ORDER BY created DESC
682
+ * ```
683
+ */
684
+ declare class JqlQueryBuilder {
685
+ private readonly parts;
686
+ private readonly order;
687
+ private constructor();
688
+ /**
689
+ * Creates an empty query builder.
690
+ *
691
+ * @returns A new builder
692
+ */
693
+ static create(): JqlQueryBuilder;
694
+ /**
695
+ * Adds a `project = ...` filter.
696
+ *
697
+ * @param key - Project key or id
698
+ * @returns A new builder with the clause appended
699
+ */
700
+ project(key: string): JqlQueryBuilder;
701
+ /**
702
+ * Adds a `status = ...` filter.
703
+ *
704
+ * @param status - Status name or id
705
+ * @returns A new builder with the clause appended
706
+ */
707
+ status(status: string): JqlQueryBuilder;
708
+ /**
709
+ * Adds an `issuetype = ...` filter.
710
+ *
711
+ * @param issueType - Issue type name or id
712
+ * @returns A new builder with the clause appended
713
+ */
714
+ issueType(issueType: string): JqlQueryBuilder;
715
+ /**
716
+ * Adds an `assignee` filter. An empty string becomes `assignee is EMPTY`
717
+ * (unassigned issues), matching the Go SDK.
718
+ *
719
+ * @param assignee - Account id, or `''` for unassigned
720
+ * @returns A new builder with the clause appended
721
+ */
722
+ assignee(assignee: string): JqlQueryBuilder;
723
+ /**
724
+ * Adds a `reporter = ...` filter.
725
+ *
726
+ * @param reporter - Account id
727
+ * @returns A new builder with the clause appended
728
+ */
729
+ reporter(reporter: string): JqlQueryBuilder;
730
+ /**
731
+ * Adds a `priority = ...` filter.
732
+ *
733
+ * @param priority - Priority name or id
734
+ * @returns A new builder with the clause appended
735
+ */
736
+ priority(priority: string): JqlQueryBuilder;
737
+ /**
738
+ * Adds one `labels = ...` clause per label, joined with `AND`.
739
+ *
740
+ * @param labels - The labels an issue must carry
741
+ * @returns A new builder with the clauses appended
742
+ */
743
+ labels(...labels: string[]): JqlQueryBuilder;
744
+ /**
745
+ * Adds a free-text search (`text ~ ...`).
746
+ *
747
+ * @param text - The search text
748
+ * @returns A new builder with the clause appended
749
+ */
750
+ text(text: string): JqlQueryBuilder;
751
+ /**
752
+ * Adds a `summary ~ ...` filter.
753
+ *
754
+ * @param text - The search text
755
+ * @returns A new builder with the clause appended
756
+ */
757
+ summary(text: string): JqlQueryBuilder;
758
+ /**
759
+ * Adds a `description ~ ...` filter.
760
+ *
761
+ * @param text - The search text
762
+ * @returns A new builder with the clause appended
763
+ */
764
+ description(text: string): JqlQueryBuilder;
765
+ /**
766
+ * Adds a `created >= ...` filter.
767
+ *
768
+ * @param date - A JQL date literal (`'2024-01-01'`) or function (`'-7d'`)
769
+ * @returns A new builder with the clause appended
770
+ */
771
+ createdAfter(date: string | Date): JqlQueryBuilder;
772
+ /**
773
+ * Adds a `created <= ...` filter.
774
+ *
775
+ * @param date - A JQL date literal or function
776
+ * @returns A new builder with the clause appended
777
+ */
778
+ createdBefore(date: string | Date): JqlQueryBuilder;
779
+ /**
780
+ * Adds an `updated >= ...` filter.
781
+ *
782
+ * @param date - A JQL date literal or function
783
+ * @returns A new builder with the clause appended
784
+ */
785
+ updatedAfter(date: string | Date): JqlQueryBuilder;
786
+ /**
787
+ * Adds an `updated <= ...` filter.
788
+ *
789
+ * @param date - A JQL date literal or function
790
+ * @returns A new builder with the clause appended
791
+ */
792
+ updatedBefore(date: string | Date): JqlQueryBuilder;
793
+ /**
794
+ * Joins the previous and next clause with `AND`. Redundant in most cases,
795
+ * since consecutive clauses are already `AND`-ed.
796
+ *
797
+ * @returns A new builder with the operator appended
798
+ */
799
+ and(): JqlQueryBuilder;
800
+ /**
801
+ * Joins the previous and next clause with `OR`.
802
+ *
803
+ * @returns A new builder with the operator appended
804
+ */
805
+ or(): JqlQueryBuilder;
806
+ /**
807
+ * Adds an `ORDER BY` term. Multiple calls accumulate into a single
808
+ * comma-separated clause, always emitted at the end of the query.
809
+ *
810
+ * @param field - The field to sort by; validated as a JQL identifier
811
+ * @param direction - Sort direction, defaults to `ASC`
812
+ * @returns A new builder with the sort term appended
813
+ * @throws {Error} If the field name is not a valid JQL identifier
814
+ */
815
+ orderBy(field: string, direction?: string): JqlQueryBuilder;
816
+ /**
817
+ * Appends a raw JQL fragment.
818
+ *
819
+ * **Unsafe:** the fragment is inserted verbatim. Never pass unvalidated user
820
+ * input here — use the typed methods, or escape with `quoteJqlValue` first.
821
+ *
822
+ * @param jql - The raw JQL fragment
823
+ * @returns A new builder with the fragment appended
824
+ */
825
+ raw(jql: string): JqlQueryBuilder;
826
+ /**
827
+ * Whether the builder has no clauses and no sort terms.
828
+ *
829
+ * @returns True when `build()` would return an empty string
830
+ */
831
+ isEmpty(): boolean;
832
+ /**
833
+ * Renders the JQL query.
834
+ *
835
+ * @returns The assembled JQL string
836
+ */
837
+ build(): string;
838
+ /**
839
+ * Alias for {@link JqlQueryBuilder.build}, so a builder can be interpolated
840
+ * into a template literal.
841
+ *
842
+ * @returns The assembled JQL string
843
+ */
844
+ toString(): string;
845
+ private clause;
846
+ private operator;
847
+ }
848
+ /**
849
+ * Shorthand factory for {@link JqlQueryBuilder.create}.
850
+ *
851
+ * @returns A new JQL query builder
852
+ */
853
+ declare function jql(): JqlQueryBuilder;
854
+
855
+ /**
856
+ * JQL escaping helpers.
857
+ *
858
+ * Every value interpolated into a JQL query must go through
859
+ * {@link quoteJqlValue}. Concatenating raw user input into JQL allows an
860
+ * attacker to break out of the string literal and append arbitrary clauses
861
+ * (`project = "X" OR project != "X"` — i.e. read every issue they can see).
862
+ */
863
+ /**
864
+ * Escapes the contents of a JQL string literal (without adding quotes).
865
+ *
866
+ * @param value - The raw value
867
+ * @returns The escaped value
868
+ */
869
+ declare function escapeJqlValue(value: string): string;
870
+ /**
871
+ * Escapes and double-quotes a value for safe use in a JQL query.
872
+ *
873
+ * Values are *always* quoted — quoting is valid for every JQL operand, and it
874
+ * removes any need to reason about whether a particular value happens to be a
875
+ * reserved word (`AND`, `ORDER`, `EMPTY`, ...) or contains a special
876
+ * character.
877
+ *
878
+ * @param value - The raw value
879
+ * @returns A quoted, escaped JQL string literal
880
+ */
881
+ declare function quoteJqlValue(value: string): string;
882
+ /**
883
+ * Validates a JQL field name, rejecting anything that could inject syntax.
884
+ *
885
+ * @param field - The field name to validate
886
+ * @returns The field name, unchanged
887
+ * @throws {Error} If the field name is not a valid JQL identifier
888
+ */
889
+ declare function assertJqlFieldName(field: string): string;
890
+
891
+ /**
892
+ * Extracts the issue key from a Jira issue URL.
893
+ *
894
+ * Handles the canonical `/browse/PROJ-123` form (with or without a host,
895
+ * query string or fragment) and the `?selectedIssue=PROJ-123` links used by
896
+ * board and backlog views.
897
+ *
898
+ * @param issueUrl - The issue URL, e.g. `https://acme.atlassian.net/browse/PROJ-123`
899
+ * @returns The issue key, e.g. `PROJ-123`
900
+ * @throws {Error} If no issue key can be extracted
901
+ *
902
+ * @example
903
+ * ```ts
904
+ * parseIssueUrl('https://acme.atlassian.net/browse/PROJ-123'); // 'PROJ-123'
905
+ * ```
906
+ */
907
+ declare function parseIssueUrl(issueUrl: string): string;
908
+ /**
909
+ * Non-throwing variant of {@link parseIssueUrl}.
910
+ *
911
+ * @param issueUrl - The issue URL
912
+ * @returns The issue key, or `undefined` if none could be extracted
913
+ */
914
+ declare function tryParseIssueUrl(issueUrl: string): string | undefined;
915
+
916
+ /**
917
+ * Shared pagination primitives.
918
+ *
919
+ * Jira uses two pagination styles:
920
+ *
921
+ * - **Offset based** (`startAt` / `maxResults` / `total` / `isLast`) — used by
922
+ * almost every endpoint. See {@link paginate}.
923
+ * - **Token based** (`nextPageToken`, no `total`) — used by the Enhanced JQL
924
+ * Search API. See {@link paginateByToken}.
925
+ */
926
+ /** Default page size when a caller does not specify one. */
927
+ declare const DEFAULT_MAX_RESULTS = 50;
928
+ /** Largest page size the Jira API accepts for most endpoints. */
929
+ declare const MAX_MAX_RESULTS = 100;
930
+ /**
931
+ * Pagination metadata returned alongside a page of results.
932
+ */
933
+ interface PageInfo {
934
+ /** Index of the first item in this page (0-based) */
935
+ startAt: number;
936
+ /** Maximum number of items the page could contain */
937
+ maxResults: number;
938
+ /** Total number of items available; omitted by some endpoints */
939
+ total?: number | undefined;
940
+ /** Whether this is the final page; omitted by some endpoints */
941
+ isLast?: boolean | undefined;
942
+ }
943
+ /** A page of offset-paginated results. */
944
+ interface Page<T> {
945
+ items: T[];
946
+ pageInfo: PageInfo;
947
+ }
948
+ /** A page of token-paginated results. */
949
+ interface TokenPage<T> {
950
+ items: T[];
951
+ /** Token for the following page; absent or empty when this is the last page */
952
+ nextPageToken?: string | undefined;
953
+ }
954
+ /** Options accepted by {@link paginate}. */
955
+ interface PaginateOptions {
956
+ /** Index to start from (0-based, default `0`) */
957
+ startAt?: number | undefined;
958
+ /** Stop after yielding this many items */
959
+ maxItems?: number | undefined;
960
+ }
961
+ /** Options accepted by {@link paginateByToken}. */
962
+ interface PaginateByTokenOptions {
963
+ /** Resume from a previously returned page token */
964
+ initialToken?: string | undefined;
965
+ /** Stop after yielding this many items */
966
+ maxItems?: number | undefined;
967
+ }
968
+ /**
969
+ * Whether more pages follow the given page.
970
+ *
971
+ * `isLast` wins when present; otherwise `startAt + maxResults < total` decides.
972
+ * When neither is available the answer is `false`, so callers stop rather than
973
+ * loop forever against an endpoint that reports no pagination metadata.
974
+ *
975
+ * @param page - The page metadata
976
+ * @returns True when another page should be fetched
977
+ */
978
+ declare function hasNextPage(page: PageInfo): boolean;
979
+ /**
980
+ * The `startAt` value for the page after the given one.
981
+ *
982
+ * @param page - The page metadata
983
+ * @returns The next offset
984
+ */
985
+ declare function nextStartAt(page: PageInfo): number;
986
+ /**
987
+ * Clamps a requested page size into the range Jira accepts.
988
+ *
989
+ * @param maxResults - The requested page size, if any
990
+ * @returns A page size between 1 and {@link MAX_MAX_RESULTS}
991
+ */
992
+ declare function normalizeMaxResults(maxResults?: number): number;
993
+ /**
994
+ * Turns an offset-paginated endpoint into an async iterator over its items.
995
+ *
996
+ * Pages are fetched lazily, one at a time, so `break`ing out of the loop stops
997
+ * making requests. Errors thrown by `fetchPage` propagate to the consumer.
998
+ *
999
+ * @param fetchPage - Fetches the page starting at the given offset
1000
+ * @param options - Starting offset and item cap
1001
+ * @returns An async generator over every item across all pages
1002
+ *
1003
+ * @example
1004
+ * ```ts
1005
+ * for await (const issue of paginate((startAt) => fetchIssues({ startAt }))) {
1006
+ * console.log(issue.key);
1007
+ * }
1008
+ * ```
1009
+ */
1010
+ declare function paginate<T>(fetchPage: (startAt: number) => Promise<Page<T>>, options?: PaginateOptions): AsyncGenerator<T, void, undefined>;
1011
+ /**
1012
+ * Turns a token-paginated endpoint (the Enhanced JQL Search API) into an async
1013
+ * iterator over its items.
1014
+ *
1015
+ * Iteration stops when a page comes back without a `nextPageToken`, when a
1016
+ * page is empty, or when the server repeats a token it already returned.
1017
+ *
1018
+ * @param fetchPage - Fetches the page for the given token (`undefined` = first page)
1019
+ * @param options - Initial token and item cap
1020
+ * @returns An async generator over every item across all pages
1021
+ */
1022
+ declare function paginateByToken<T>(fetchPage: (pageToken: string | undefined) => Promise<TokenPage<T>>, options?: PaginateByTokenOptions): AsyncGenerator<T, void, undefined>;
1023
+ /**
1024
+ * Collects an async iterable into an array — the `all()` counterpart to an
1025
+ * `iterate()` generator.
1026
+ *
1027
+ * @param source - The async iterable to drain
1028
+ * @param maxItems - Optional cap on the number of collected items
1029
+ * @returns Every item produced by the iterable
1030
+ */
1031
+ declare function collect<T>(source: AsyncIterable<T>, maxItems?: number): Promise<T[]>;
1032
+
1033
+ /**
1034
+ * Jira client configuration
1035
+ */
1036
+ interface JiraClientConfig {
1037
+ /**
1038
+ * Jira Cloud instance URL (e.g., https://your-domain.atlassian.net)
1039
+ */
1040
+ host: string;
1041
+ /**
1042
+ * Authentication provider
1043
+ */
1044
+ auth: AuthProvider;
1045
+ /**
1046
+ * Logger instance (optional)
1047
+ */
1048
+ logger?: Logger;
1049
+ /**
1050
+ * Request timeout in milliseconds (default: 30000)
1051
+ */
1052
+ timeout?: number;
1053
+ /**
1054
+ * Additional middleware to apply
1055
+ */
1056
+ middleware?: Middleware[];
1057
+ /**
1058
+ * User agent suffix (optional)
1059
+ */
1060
+ userAgent?: string;
1061
+ /**
1062
+ * API version (default: '3')
1063
+ */
1064
+ apiVersion?: '2' | '3';
1065
+ /**
1066
+ * Enable automatic retry on failures (default: true)
1067
+ */
1068
+ retryEnabled?: boolean;
1069
+ /**
1070
+ * Maximum number of retries (default: 3)
1071
+ */
1072
+ maxRetries?: number;
1073
+ /**
1074
+ * Enable request logging (default: false)
1075
+ */
1076
+ debug?: boolean;
1077
+ /**
1078
+ * Allow plain-HTTP hosts.
1079
+ *
1080
+ * The transport rejects non-HTTPS hosts when `NODE_ENV=production` and warns
1081
+ * otherwise. Set this to opt out — intended for local development against a
1082
+ * proxy or a self-hosted instance without TLS.
1083
+ *
1084
+ * @default false
1085
+ */
1086
+ allowInsecureHttp?: boolean;
1087
+ /**
1088
+ * Circuit breaker instance attached by {@link withResilience}.
1089
+ *
1090
+ * Set by the resilience option rather than by hand; read it back from
1091
+ * `client.circuitBreaker` to monitor breaker state.
1092
+ */
1093
+ circuitBreaker?: CircuitBreaker;
1094
+ }
1095
+ /**
1096
+ * Functional option for client configuration
1097
+ */
1098
+ type JiraClientOption = (config: JiraClientConfig) => JiraClientConfig;
9
1099
 
10
1100
  /**
11
1101
  * Resilience configuration for the Jira client
@@ -86,71 +1176,29 @@ interface ResilienceMiddlewareResult {
86
1176
  */
87
1177
  declare function createResilienceMiddleware(config?: ResilienceConfig): ResilienceMiddlewareResult;
88
1178
  /**
89
- * Create a Jira client option that adds resilience middleware
1179
+ * Create a Jira client option that adds resilience middleware.
1180
+ *
1181
+ * The resilience stack supplies its own retry middleware, so this option also
1182
+ * disables the client's built-in retry to avoid retrying each request twice
1183
+ * (which would multiply out to `maxRetries * maxRetries` attempts). Pass
1184
+ * `{ retry: false }` if you would rather keep the client's built-in retry.
1185
+ *
1186
+ * The circuit breaker instance is attached to the client and reachable via
1187
+ * `client.circuitBreaker` for monitoring.
90
1188
  *
91
1189
  * @example
92
1190
  * ```typescript
93
1191
  * import { JiraClient, withResilience } from '@felixgeelhaar/jira-sdk';
94
1192
  *
95
1193
  * const client = new JiraClient(
96
- * { host: '...', auth: '...' },
1194
+ * { host: '...', auth: apiTokenAuth },
97
1195
  * withResilience()
98
1196
  * );
1197
+ *
1198
+ * console.log(client.circuitBreaker?.getStats());
99
1199
  * ```
100
1200
  */
101
- declare function withResilience(config?: ResilienceConfig): (internalConfig: {
102
- middleware?: Middleware[];
103
- }) => void;
104
-
105
- /**
106
- * Jira client configuration
107
- */
108
- interface JiraClientConfig {
109
- /**
110
- * Jira Cloud instance URL (e.g., https://your-domain.atlassian.net)
111
- */
112
- host: string;
113
- /**
114
- * Authentication provider
115
- */
116
- auth: AuthProvider;
117
- /**
118
- * Logger instance (optional)
119
- */
120
- logger?: Logger;
121
- /**
122
- * Request timeout in milliseconds (default: 30000)
123
- */
124
- timeout?: number;
125
- /**
126
- * Additional middleware to apply
127
- */
128
- middleware?: Middleware[];
129
- /**
130
- * User agent suffix (optional)
131
- */
132
- userAgent?: string;
133
- /**
134
- * API version (default: '3')
135
- */
136
- apiVersion?: '2' | '3';
137
- /**
138
- * Enable automatic retry on failures (default: true)
139
- */
140
- retryEnabled?: boolean;
141
- /**
142
- * Maximum number of retries (default: 3)
143
- */
144
- maxRetries?: number;
145
- /**
146
- * Enable request logging (default: false)
147
- */
148
- debug?: boolean;
149
- }
150
- /**
151
- * Functional option for client configuration
152
- */
153
- type JiraClientOption = (config: JiraClientConfig) => JiraClientConfig;
1201
+ declare function withResilience(config?: ResilienceConfig): JiraClientOption;
154
1202
 
155
1203
  /**
156
1204
  * Jira API Client
@@ -180,11 +1228,15 @@ type JiraClientOption = (config: JiraClientConfig) => JiraClientConfig;
180
1228
  declare class JiraClient {
181
1229
  private readonly httpClient;
182
1230
  private readonly config;
183
- private _issues?;
184
- private _projects?;
185
- private _search?;
186
- private _users?;
1231
+ private readonly serviceCache;
187
1232
  constructor(config: JiraClientConfig, ...options: JiraClientOption[]);
1233
+ /**
1234
+ * Circuit breaker attached by {@link withResilience}, for monitoring.
1235
+ *
1236
+ * Returns `undefined` unless the client was constructed with the resilience
1237
+ * option and the breaker is enabled.
1238
+ */
1239
+ get circuitBreaker(): CircuitBreaker | undefined;
188
1240
  /**
189
1241
  * Get the API base path for the configured version
190
1242
  */
@@ -194,21 +1246,63 @@ declare class JiraClient {
194
1246
  */
195
1247
  get agileApiBasePath(): string;
196
1248
  /**
197
- * Issues service - CRUD operations for issues
1249
+ * Resolve a service from the cache, constructing it on first access.
198
1250
  */
1251
+ private service;
1252
+ /** Issues - CRUD, comments, transitions, worklogs, attachments, links. */
199
1253
  get issues(): IssueService;
200
- /**
201
- * Projects service - CRUD operations for projects
202
- */
1254
+ /** Projects - CRUD plus components and versions. */
203
1255
  get projects(): ProjectService;
204
- /**
205
- * Search service - JQL search and filters
206
- */
1256
+ /** Search - JQL search, including the enhanced token-paginated API. */
207
1257
  get search(): SearchService;
208
- /**
209
- * Users service - User management
210
- */
1258
+ /** Users - lookup, search and user properties. */
211
1259
  get users(): UserService;
1260
+ /** Agile boards, sprints, epics and backlog (`/rest/agile/1.0`). */
1261
+ get agile(): AgileService;
1262
+ /** Custom fields, field contexts and context options. */
1263
+ get fields(): FieldService;
1264
+ /** Issue types and issue type schemes. */
1265
+ get issueTypes(): IssueTypeService;
1266
+ /** Issue link types. */
1267
+ get issueLinkTypes(): IssueLinkTypeService;
1268
+ /** Priorities. */
1269
+ get priorities(): PriorityService;
1270
+ /** Resolutions. */
1271
+ get resolutions(): ResolutionService;
1272
+ /** Screens, screen tabs and screen fields. */
1273
+ get screens(): ScreenService;
1274
+ /** Workflows, statuses, status categories and workflow schemes. */
1275
+ get workflows(): WorkflowService;
1276
+ /** Dashboards and dashboard gadgets. */
1277
+ get dashboards(): DashboardService;
1278
+ /** Saved filters, favourites and share permissions. */
1279
+ get filters(): FilterService;
1280
+ /** Groups and group membership. */
1281
+ get groups(): GroupService;
1282
+ /** The current user and their preferences. */
1283
+ get myself(): MyselfService;
1284
+ /** Permissions, permission schemes and project roles. */
1285
+ get permissions(): PermissionService;
1286
+ /** Issue security levels and schemes. */
1287
+ get securityLevels(): SecurityLevelService;
1288
+ /** Application properties and advanced settings. */
1289
+ get appProperties(): AppPropertiesService;
1290
+ /** Audit records. */
1291
+ get audit(): AuditService;
1292
+ /** Bulk issue create/delete and task progress polling. */
1293
+ get bulk(): BulkService;
1294
+ /** Jira expression evaluation and analysis. */
1295
+ get expressions(): ExpressionService;
1296
+ /** Labels. */
1297
+ get labels(): LabelService;
1298
+ /** Notification schemes and issue notifications. */
1299
+ get notifications(): NotificationService;
1300
+ /** Server info and instance configuration. */
1301
+ get serverInfo(): ServerInfoService;
1302
+ /** Time tracking providers, configuration and worklogs. */
1303
+ get timeTracking(): TimeTrackingService;
1304
+ /** Webhook registration and delivery status. */
1305
+ get webhooks(): WebhookService;
212
1306
  /**
213
1307
  * Get the underlying HTTP client for advanced usage
214
1308
  */
@@ -247,4 +1341,76 @@ declare function withMiddleware(...middleware: Middleware[]): JiraClientOption;
247
1341
  */
248
1342
  declare function withLogger(logger: Logger): JiraClientOption;
249
1343
 
250
- export { DEFAULT_RESILIENCE_CONFIG, IssueService, JiraClient, type JiraClientConfig, type JiraClientOption, ProjectService, type ResilienceConfig, type ResilienceMiddlewareResult, SearchService, UserService, createJiraClient, createResilienceMiddleware, withApiVersion, withDebug, withLogger, withMiddleware, withResilience, withRetry, withTimeout };
1344
+ /**
1345
+ * Environment variable names, matching the Go SDK's `env.go` so the two SDKs can
1346
+ * share a deployment's configuration.
1347
+ *
1348
+ * One deliberate omission: Go reads `JIRA_OAUTH_REDIRECT_URL` because its
1349
+ * `OAuth2Authenticator` drives the full authorization-code flow. This SDK's
1350
+ * `OAuth2Auth` consumes tokens that were obtained elsewhere and has no redirect
1351
+ * URL, so reading that variable would silently do nothing.
1352
+ */
1353
+ declare const ENV_VARS: {
1354
+ readonly baseUrl: "JIRA_BASE_URL";
1355
+ readonly email: "JIRA_EMAIL";
1356
+ readonly apiToken: "JIRA_API_TOKEN";
1357
+ readonly pat: "JIRA_PAT";
1358
+ readonly username: "JIRA_USERNAME";
1359
+ readonly password: "JIRA_PASSWORD";
1360
+ readonly oauthClientId: "JIRA_OAUTH_CLIENT_ID";
1361
+ readonly oauthClientSecret: "JIRA_OAUTH_CLIENT_SECRET";
1362
+ readonly timeout: "JIRA_TIMEOUT";
1363
+ readonly maxRetries: "JIRA_MAX_RETRIES";
1364
+ readonly userAgent: "JIRA_USER_AGENT";
1365
+ };
1366
+ /** A source of environment variables. Defaults to `process.env`. */
1367
+ type EnvSource = Record<string, string | undefined>;
1368
+ /**
1369
+ * Build an auth provider from environment variables.
1370
+ *
1371
+ * Resolution order matches the Go SDK:
1372
+ * 1. `JIRA_EMAIL` + `JIRA_API_TOKEN` → API token (Jira Cloud)
1373
+ * 2. `JIRA_PAT` → personal access token (Server/Data Center)
1374
+ * 3. `JIRA_USERNAME` + `JIRA_PASSWORD` → basic auth
1375
+ * 4. `JIRA_OAUTH_CLIENT_ID` + `JIRA_OAUTH_CLIENT_SECRET` + `JIRA_OAUTH_REDIRECT_URL` → OAuth 2.0
1376
+ *
1377
+ * @param source Environment variables; defaults to `process.env`.
1378
+ * @returns The first auth provider whose variables are fully present.
1379
+ * @throws {ConfigValidationError} If no complete credential set is present.
1380
+ */
1381
+ declare function createAuthFromEnv(source?: EnvSource): AuthProvider;
1382
+ /**
1383
+ * Build a full client configuration from environment variables.
1384
+ *
1385
+ * @param source Environment variables; defaults to `process.env`.
1386
+ * @returns A configuration ready to pass to {@link JiraClient}.
1387
+ * @throws {ConfigValidationError} If `JIRA_BASE_URL` is missing, a numeric
1388
+ * variable is malformed, or no credentials are present.
1389
+ */
1390
+ declare function loadConfigFromEnv(source?: EnvSource): JiraClientConfig;
1391
+ /**
1392
+ * Create a Jira client entirely from environment variables.
1393
+ *
1394
+ * The equivalent of the Go SDK's `LoadConfigFromEnv()`.
1395
+ *
1396
+ * @example
1397
+ * ```typescript
1398
+ * // JIRA_BASE_URL=https://acme.atlassian.net
1399
+ * // JIRA_EMAIL=me@acme.com
1400
+ * // JIRA_API_TOKEN=...
1401
+ * const client = createJiraClientFromEnv();
1402
+ * ```
1403
+ *
1404
+ * @param options Functional options applied on top of the environment config.
1405
+ * @returns A configured client.
1406
+ */
1407
+ declare function createJiraClientFromEnv(...options: JiraClientOption[]): JiraClient;
1408
+ /**
1409
+ * Functional option that layers environment-variable configuration onto an
1410
+ * existing config. Explicit values already present on the config win.
1411
+ *
1412
+ * The equivalent of the Go SDK's `WithEnv()`.
1413
+ */
1414
+ declare function withEnv(source?: EnvSource): JiraClientOption;
1415
+
1416
+ export { type AccountId, AdfBuilder, AdfDocument, AdfNode, AgileService, AppPropertiesService, type ArrayElement, type AsyncFn, AuditService, AuthProvider, type Brand, BulkService, type Callback, CircuitBreaker, CircuitBreakerConfig, ConsoleLogger, type ConsoleLoggerOptions, type CustomField, CustomFieldType, CustomFields, DEFAULT_MAX_RESULTS, DEFAULT_RESILIENCE_CONFIG, DashboardService, type DeepPartial, ENV_VARS, type EnvSource, type ExpandOptions, ExpressionService, type FieldOptions, FieldService, FilterService, GroupService, HttpClient, type IssueKey, IssueLinkTypeService, IssueService, IssueTypeService, JiraClient, type JiraClientConfig, type JiraClientOption, JqlQueryBuilder, type JsonArray, type JsonObject, type JsonPrimitive, type JsonValue, LabelService, LogFields, LogLevel, Logger, MAX_MAX_RESULTS, Middleware, type Mutable, MyselfService, NoopLogger, NotificationService, type OptionalFields, type Page, type PageInfo, type PaginateByTokenOptions, type PaginateOptions, PermissionService, PriorityService, type ProjectKey, ProjectService, RateLimitMiddlewareConfig, type RequireFields, type ResilienceConfig, type ResilienceMiddlewareResult, ResolutionService, RetryMiddlewareConfig, ScreenService, SearchService, SecurityLevelService, ServerInfoService, type SortDirection, TimeTrackingService, type TokenPage, UserService, WebhookService, WorkflowService, adf, adfFromText, assertJqlFieldName, buildAgileApiPath, buildApiPath, buildQueryString, clamp, collect, createAuthFromEnv, createConsoleLogger, createDeferred, createJiraClient, createJiraClientFromEnv, createResilienceMiddleware, escapeJqlValue, exponentialBackoff, formatDuration, generateRequestId, hasNextPage, isNonEmptyString, isObject, joinPath, jql, loadConfigFromEnv, nextStartAt, noopLogger, normalizeMaxResults, paginate, paginateByToken, parseDuration, parseEnvBoolean, parseEnvNumber, parseIssueUrl, promiseWithTimeout, quoteJqlValue, retry, safeJsonParse, sanitizeHeaders, sleep, timeout, tryParseIssueUrl, withApiVersion, withDebug, withEnv, withLogger, withMiddleware, withResilience, withRetry, withTimeout };