@venturialstd/jira 0.1.31 → 0.1.33

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 (154) hide show
  1. package/README.md +481 -0
  2. package/dist/clients/jira.client.d.ts +16 -0
  3. package/dist/clients/jira.client.d.ts.map +1 -0
  4. package/dist/clients/jira.client.js +100 -0
  5. package/dist/clients/jira.client.js.map +1 -0
  6. package/dist/constants/http-method.constant.d.ts +8 -0
  7. package/dist/constants/http-method.constant.d.ts.map +1 -0
  8. package/dist/constants/http-method.constant.js +12 -0
  9. package/dist/constants/http-method.constant.js.map +1 -0
  10. package/dist/constants/jira.constant.d.ts +56 -0
  11. package/dist/constants/jira.constant.d.ts.map +1 -0
  12. package/dist/constants/jira.constant.js +67 -0
  13. package/dist/constants/jira.constant.js.map +1 -0
  14. package/dist/constants/jira.constants.d.ts +2 -0
  15. package/dist/constants/jira.constants.d.ts.map +1 -0
  16. package/dist/constants/jira.constants.js +6 -0
  17. package/dist/constants/jira.constants.js.map +1 -0
  18. package/dist/constants/jira.settings.constant.d.ts +6 -0
  19. package/dist/constants/jira.settings.constant.d.ts.map +1 -0
  20. package/dist/{jira/constants/jira.constants.js → constants/jira.settings.constant.js} +1 -1
  21. package/dist/constants/jira.settings.constant.js.map +1 -0
  22. package/dist/constants/jira.settings.constants.d.ts +6 -0
  23. package/dist/constants/jira.settings.constants.d.ts.map +1 -0
  24. package/dist/constants/jira.settings.constants.js +9 -0
  25. package/dist/constants/jira.settings.constants.js.map +1 -0
  26. package/dist/dtos/jira-webhook-event.dto.d.ts +16 -0
  27. package/dist/dtos/jira-webhook-event.dto.d.ts.map +1 -0
  28. package/dist/dtos/jira-webhook-event.dto.js +95 -0
  29. package/dist/dtos/jira-webhook-event.dto.js.map +1 -0
  30. package/dist/index.d.ts +30 -0
  31. package/dist/index.d.ts.map +1 -0
  32. package/dist/index.js +52 -0
  33. package/dist/index.js.map +1 -0
  34. package/dist/jira.module.d.ts +3 -0
  35. package/dist/jira.module.d.ts.map +1 -0
  36. package/dist/jira.module.js +56 -0
  37. package/dist/jira.module.js.map +1 -0
  38. package/dist/services/jira-attachment.service.d.ts +93 -0
  39. package/dist/services/jira-attachment.service.d.ts.map +1 -0
  40. package/dist/services/jira-attachment.service.js +149 -0
  41. package/dist/services/jira-attachment.service.js.map +1 -0
  42. package/dist/services/jira-comment.service.d.ts +40 -0
  43. package/dist/services/jira-comment.service.d.ts.map +1 -0
  44. package/dist/services/jira-comment.service.js +95 -0
  45. package/dist/services/jira-comment.service.js.map +1 -0
  46. package/dist/services/jira-event.service.d.ts +17 -0
  47. package/dist/services/jira-event.service.d.ts.map +1 -0
  48. package/dist/{jira/services/jira-issue.service.js → services/jira-event.service.js} +23 -19
  49. package/dist/services/jira-event.service.js.map +1 -0
  50. package/dist/services/jira-issue.service.d.ts +113 -0
  51. package/dist/services/jira-issue.service.d.ts.map +1 -0
  52. package/dist/services/jira-issue.service.js +261 -0
  53. package/dist/services/jira-issue.service.js.map +1 -0
  54. package/dist/services/jira-project.service.d.ts +89 -0
  55. package/dist/services/jira-project.service.d.ts.map +1 -0
  56. package/dist/services/jira-project.service.js +135 -0
  57. package/dist/services/jira-project.service.js.map +1 -0
  58. package/dist/services/jira-search.service.d.ts +160 -0
  59. package/dist/services/jira-search.service.d.ts.map +1 -0
  60. package/dist/services/jira-search.service.js +244 -0
  61. package/dist/services/jira-search.service.js.map +1 -0
  62. package/dist/services/jira-user.service.d.ts +35 -0
  63. package/dist/services/jira-user.service.d.ts.map +1 -0
  64. package/dist/services/jira-user.service.js +88 -0
  65. package/dist/services/jira-user.service.js.map +1 -0
  66. package/dist/services/jira-webhook.service.d.ts +50 -0
  67. package/dist/services/jira-webhook.service.d.ts.map +1 -0
  68. package/dist/services/jira-webhook.service.js +99 -0
  69. package/dist/services/jira-webhook.service.js.map +1 -0
  70. package/dist/services/jira-worklog.service.d.ts +34 -0
  71. package/dist/services/jira-worklog.service.d.ts.map +1 -0
  72. package/dist/services/jira-worklog.service.js +146 -0
  73. package/dist/services/jira-worklog.service.js.map +1 -0
  74. package/dist/{jira/settings → settings}/jira-settings.d.ts +1 -0
  75. package/dist/settings/jira-settings.d.ts.map +1 -0
  76. package/dist/settings/jira-settings.js.map +1 -0
  77. package/dist/types/jira-comment.params.types.d.ts +7 -0
  78. package/dist/types/jira-comment.params.types.d.ts.map +1 -0
  79. package/dist/types/jira-comment.params.types.js +3 -0
  80. package/dist/types/jira-comment.params.types.js.map +1 -0
  81. package/dist/types/jira-common.types.d.ts +51 -0
  82. package/dist/types/jira-common.types.d.ts.map +1 -0
  83. package/dist/types/jira-common.types.js +6 -0
  84. package/dist/types/jira-common.types.js.map +1 -0
  85. package/dist/types/jira-event.types.d.ts +5 -0
  86. package/dist/types/jira-event.types.d.ts.map +1 -0
  87. package/dist/types/jira-event.types.js +3 -0
  88. package/dist/types/jira-event.types.js.map +1 -0
  89. package/dist/types/jira-issue.params.types.d.ts +42 -0
  90. package/dist/types/jira-issue.params.types.d.ts.map +1 -0
  91. package/dist/types/jira-issue.params.types.js +3 -0
  92. package/dist/types/jira-issue.params.types.js.map +1 -0
  93. package/dist/types/jira-issue.response.types.d.ts +50 -0
  94. package/dist/types/jira-issue.response.types.d.ts.map +1 -0
  95. package/dist/types/jira-issue.response.types.js +3 -0
  96. package/dist/types/jira-issue.response.types.js.map +1 -0
  97. package/dist/types/jira-metadata.types.d.ts +92 -0
  98. package/dist/types/jira-metadata.types.d.ts.map +1 -0
  99. package/dist/types/jira-metadata.types.js +3 -0
  100. package/dist/types/jira-metadata.types.js.map +1 -0
  101. package/dist/types/jira-project.params.types.d.ts +13 -0
  102. package/dist/types/jira-project.params.types.d.ts.map +1 -0
  103. package/dist/types/jira-project.params.types.js +3 -0
  104. package/dist/types/jira-project.params.types.js.map +1 -0
  105. package/dist/types/jira-user.params.types.d.ts +19 -0
  106. package/dist/types/jira-user.params.types.d.ts.map +1 -0
  107. package/dist/types/jira-user.params.types.js +3 -0
  108. package/dist/types/jira-user.params.types.js.map +1 -0
  109. package/dist/types/jira-webhook.params.types.d.ts +15 -0
  110. package/dist/types/jira-webhook.params.types.d.ts.map +1 -0
  111. package/dist/types/jira-webhook.params.types.js +3 -0
  112. package/dist/types/jira-webhook.params.types.js.map +1 -0
  113. package/dist/types/jira-webhook.types.d.ts +77 -0
  114. package/dist/types/jira-webhook.types.d.ts.map +1 -0
  115. package/dist/types/jira-webhook.types.js +3 -0
  116. package/dist/types/jira-webhook.types.js.map +1 -0
  117. package/dist/types/jira-worklog.params.types.d.ts +22 -0
  118. package/dist/types/jira-worklog.params.types.d.ts.map +1 -0
  119. package/dist/types/jira-worklog.params.types.js +3 -0
  120. package/dist/types/jira-worklog.params.types.js.map +1 -0
  121. package/dist/types/jira.config.type.d.ts +14 -0
  122. package/dist/types/jira.config.type.d.ts.map +1 -0
  123. package/dist/types/jira.config.type.js +3 -0
  124. package/dist/types/jira.config.type.js.map +1 -0
  125. package/dist/types/jira.request.types.d.ts +187 -0
  126. package/dist/types/jira.request.types.d.ts.map +1 -0
  127. package/dist/types/jira.request.types.js +3 -0
  128. package/dist/types/jira.request.types.js.map +1 -0
  129. package/dist/types/jira.types.d.ts +314 -0
  130. package/dist/types/jira.types.d.ts.map +1 -0
  131. package/dist/{jira/types/jira.event.type.js → types/jira.types.js} +1 -1
  132. package/dist/types/jira.types.js.map +1 -0
  133. package/package.json +19 -14
  134. package/dist/jira/clients/jira.client.d.ts +0 -13
  135. package/dist/jira/clients/jira.client.js +0 -70
  136. package/dist/jira/clients/jira.client.js.map +0 -1
  137. package/dist/jira/constants/jira.constants.d.ts +0 -5
  138. package/dist/jira/constants/jira.constants.js.map +0 -1
  139. package/dist/jira/dtos/jira-webhook-event.dto.d.ts +0 -21
  140. package/dist/jira/dtos/jira-webhook-event.dto.js +0 -139
  141. package/dist/jira/dtos/jira-webhook-event.dto.js.map +0 -1
  142. package/dist/jira/index.d.ts +0 -4
  143. package/dist/jira/index.js +0 -10
  144. package/dist/jira/index.js.map +0 -1
  145. package/dist/jira/jira.module.d.ts +0 -2
  146. package/dist/jira/jira.module.js +0 -25
  147. package/dist/jira/jira.module.js.map +0 -1
  148. package/dist/jira/services/jira-issue.service.d.ts +0 -12
  149. package/dist/jira/services/jira-issue.service.js.map +0 -1
  150. package/dist/jira/settings/jira-settings.js.map +0 -1
  151. package/dist/jira/tsconfig.build.tsbuildinfo +0 -1
  152. package/dist/jira/types/jira.event.type.d.ts +0 -37
  153. package/dist/jira/types/jira.event.type.js.map +0 -1
  154. /package/dist/{jira/settings → settings}/jira-settings.js +0 -0
@@ -0,0 +1,149 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var JiraAttachmentService_1;
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.JiraAttachmentService = void 0;
14
+ const axios_1 = require("@nestjs/axios");
15
+ const common_1 = require("@nestjs/common");
16
+ const core_1 = require("@venturialstd/core");
17
+ const jira_client_1 = require("../clients/jira.client");
18
+ const http_method_constant_1 = require("../constants/http-method.constant");
19
+ const jira_constant_1 = require("../constants/jira.constant");
20
+ let JiraAttachmentService = JiraAttachmentService_1 = class JiraAttachmentService {
21
+ httpService;
22
+ jiraClient;
23
+ logger;
24
+ constructor(httpService, jiraClient, logger) {
25
+ this.httpService = httpService;
26
+ this.jiraClient = jiraClient;
27
+ this.logger = logger;
28
+ this.logger.setContext(JiraAttachmentService_1.name);
29
+ }
30
+ /**
31
+ * Get attachments for an issue
32
+ * Note: This method retrieves attachments through the issue endpoint.
33
+ * For direct attachment metadata, use getAttachment().
34
+ */
35
+ async getAttachments(config, issueIdOrKey) {
36
+ const endpoint = `${jira_constant_1.JIRA_API_PREFIX}/issue/${issueIdOrKey}`;
37
+ const issue = await this.jiraClient.request(http_method_constant_1.HttpMethod.GET, endpoint, config, undefined, { fields: ['attachment'] });
38
+ return issue.fields?.attachment || [];
39
+ }
40
+ /**
41
+ * Get a specific attachment
42
+ */
43
+ async getAttachment(config, attachmentId) {
44
+ const endpoint = `${jira_constant_1.JIRA_API_PREFIX}/attachment/${attachmentId}`;
45
+ return this.jiraClient.request(http_method_constant_1.HttpMethod.GET, endpoint, config);
46
+ }
47
+ /**
48
+ * Add attachment to an issue
49
+ */
50
+ async addAttachment(config, issueIdOrKey, file, filename) {
51
+ const credentials = await this.jiraClient.getCredentials(config);
52
+ const jiraAuth = Buffer.from(`${credentials.user}:${credentials.token}`).toString('base64');
53
+ const formData = new FormData();
54
+ if (file instanceof Buffer) {
55
+ const blob = new Blob([new Uint8Array(file)]);
56
+ formData.append('file', blob, filename);
57
+ }
58
+ else if (file instanceof File) {
59
+ formData.append('file', file, filename);
60
+ }
61
+ else {
62
+ // file is Blob
63
+ formData.append('file', file, filename);
64
+ }
65
+ const endpoint = `${jira_constant_1.JIRA_API_PREFIX}/issue/${issueIdOrKey}/attachments`;
66
+ const response = await this.httpService.axiosRef.post(`${credentials.baseUrl}${endpoint}`, formData, {
67
+ headers: {
68
+ Authorization: `Basic ${jiraAuth}`,
69
+ 'X-Atlassian-Token': 'no-check',
70
+ },
71
+ });
72
+ return response.data;
73
+ }
74
+ /**
75
+ * Delete an attachment
76
+ * Deletes an attachment from an issue.
77
+ * Permissions required: Delete own attachments or Delete all attachments project permission.
78
+ */
79
+ async deleteAttachment(config, attachmentId) {
80
+ const endpoint = `${jira_constant_1.JIRA_API_PREFIX}/attachment/${attachmentId}`;
81
+ return this.jiraClient.request(http_method_constant_1.HttpMethod.DELETE, endpoint, config);
82
+ }
83
+ /**
84
+ * Get attachment content
85
+ * Returns the contents of an attachment.
86
+ * A Range header can be set to define a range of bytes within the attachment to download.
87
+ * This operation can be accessed anonymously.
88
+ */
89
+ async getAttachmentContent(config, attachmentId, redirect) {
90
+ const endpoint = `${jira_constant_1.JIRA_API_PREFIX}/attachment/content/${attachmentId}`;
91
+ const queryParams = redirect !== undefined ? { redirect } : undefined;
92
+ return this.jiraClient.request(http_method_constant_1.HttpMethod.GET, endpoint, config, undefined, queryParams);
93
+ }
94
+ /**
95
+ * Get Jira attachment settings
96
+ * Returns the attachment settings, that is, whether attachments are enabled and the maximum attachment size allowed.
97
+ * This operation can be accessed anonymously.
98
+ */
99
+ async getAttachmentSettings(config) {
100
+ const endpoint = `${jira_constant_1.JIRA_API_PREFIX}/attachment/meta`;
101
+ return this.jiraClient.request(http_method_constant_1.HttpMethod.GET, endpoint, config);
102
+ }
103
+ /**
104
+ * Get attachment thumbnail
105
+ * Returns the thumbnail of an attachment.
106
+ * This operation can be accessed anonymously.
107
+ */
108
+ async getAttachmentThumbnail(config, attachmentId, params) {
109
+ const endpoint = `${jira_constant_1.JIRA_API_PREFIX}/attachment/thumbnail/${attachmentId}`;
110
+ const queryParams = {};
111
+ if (params?.redirect !== undefined)
112
+ queryParams.redirect = params.redirect;
113
+ if (params?.fallbackToDefault !== undefined)
114
+ queryParams.fallbackToDefault = params.fallbackToDefault;
115
+ if (params?.width !== undefined)
116
+ queryParams.width = params.width;
117
+ if (params?.height !== undefined)
118
+ queryParams.height = params.height;
119
+ return this.jiraClient.request(http_method_constant_1.HttpMethod.GET, endpoint, config, undefined, Object.keys(queryParams).length > 0 ? queryParams : undefined);
120
+ }
121
+ /**
122
+ * Get all metadata for an expanded attachment (Experimental)
123
+ * Returns the metadata for the contents of an attachment, if it is an archive, and metadata for the attachment itself.
124
+ * Currently, only the ZIP archive format is supported.
125
+ * This operation can be accessed anonymously.
126
+ */
127
+ async getExpandedAttachmentMetadata(config, attachmentId) {
128
+ const endpoint = `${jira_constant_1.JIRA_API_PREFIX}/attachment/${attachmentId}/expand/human`;
129
+ return this.jiraClient.request(http_method_constant_1.HttpMethod.GET, endpoint, config);
130
+ }
131
+ /**
132
+ * Get contents metadata for an expanded attachment (Experimental)
133
+ * Returns the metadata for the contents of an attachment, if it is an archive.
134
+ * Currently, only the ZIP archive format is supported.
135
+ * This operation can be accessed anonymously.
136
+ */
137
+ async getExpandedAttachmentContentsMetadata(config, attachmentId) {
138
+ const endpoint = `${jira_constant_1.JIRA_API_PREFIX}/attachment/${attachmentId}/expand/raw`;
139
+ return this.jiraClient.request(http_method_constant_1.HttpMethod.GET, endpoint, config);
140
+ }
141
+ };
142
+ exports.JiraAttachmentService = JiraAttachmentService;
143
+ exports.JiraAttachmentService = JiraAttachmentService = JiraAttachmentService_1 = __decorate([
144
+ (0, common_1.Injectable)(),
145
+ __metadata("design:paramtypes", [axios_1.HttpService,
146
+ jira_client_1.JiraClient,
147
+ core_1.AppLogger])
148
+ ], JiraAttachmentService);
149
+ //# sourceMappingURL=jira-attachment.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jira-attachment.service.js","sourceRoot":"","sources":["../../src/services/jira-attachment.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,yCAA4C;AAC5C,2CAA4C;AAC5C,6CAA+C;AAE/C,wDAAoD;AACpD,4EAA+D;AAI/D,8DAA6D;AAGtD,IAAM,qBAAqB,6BAA3B,MAAM,qBAAqB;IAEb;IACA;IACA;IAHnB,YACmB,WAAwB,EACxB,UAAsB,EACtB,MAAiB;QAFjB,gBAAW,GAAX,WAAW,CAAa;QACxB,eAAU,GAAV,UAAU,CAAY;QACtB,WAAM,GAAN,MAAM,CAAW;QAElC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,uBAAqB,CAAC,IAAI,CAAC,CAAC;IACrD,C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AC,GAAG,EACd,QAAQ,EACR,MAAM,CACP,CAAC;IACJ,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,qCAAqC,CACzC,MAAyB,EACzB,YAAoB;QAUpB,MAAM,QAAQ,GAAG,GAAG,+BAAe,eAAe,YAAY,aAAa,CAAC;QAE5E,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAS5B,iCAAU,CAAC,GAAG,EACd,QAAQ,EACR,MAAM,CACP,CAAC;IACJ,CAAC;CACF,CAAA;AAxPY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,mBAAU,GAAE;qCAGqB,mBAAW;QACZ,wBAAU;QACd,gBAAS;GAJzB,qBAAqB,CAwPjC"}
@@ -0,0 +1,40 @@
1
+ import { HttpService } from '@nestjs/axios';
2
+ import { AppLogger } from '@venturialstd/core';
3
+ import { JiraClient } from '../clients/jira.client';
4
+ import { CreateCommentRequest, UpdateCommentRequest } from '../types/jira.request.types';
5
+ import { GetCommentsParams } from '../types/jira-comment.params.types';
6
+ import { JiraComment, JiraPageBean } from '../types/jira.types';
7
+ import { JiraConfig } from '../types/jira.config.type';
8
+ export declare class JiraCommentService {
9
+ private readonly httpService;
10
+ private readonly jiraClient;
11
+ private readonly logger;
12
+ constructor(httpService: HttpService, jiraClient: JiraClient, logger: AppLogger);
13
+ /**
14
+ * Get comments for an issue
15
+ */
16
+ getComments(config: JiraConfig | null, issueIdOrKey: string, params?: GetCommentsParams): Promise<JiraPageBean<JiraComment>>;
17
+ /**
18
+ * Get a specific comment
19
+ */
20
+ getComment(config: JiraConfig | null, issueIdOrKey: string, commentId: string, expand?: string): Promise<JiraComment>;
21
+ /**
22
+ * Add a comment to an issue
23
+ */
24
+ addComment(config: JiraConfig | null, issueIdOrKey: string, request: CreateCommentRequest, expand?: string): Promise<JiraComment>;
25
+ /**
26
+ * Update a comment
27
+ */
28
+ updateComment(config: JiraConfig | null, issueIdOrKey: string, commentId: string, request: UpdateCommentRequest, expand?: string): Promise<JiraComment>;
29
+ /**
30
+ * Delete a comment
31
+ */
32
+ deleteComment(config: JiraConfig | null, issueIdOrKey: string, commentId: string): Promise<void>;
33
+ /**
34
+ * Get comments by IDs
35
+ * Returns a paginated list of comments specified by a list of comment IDs.
36
+ * This operation can be accessed anonymously.
37
+ */
38
+ getCommentsByIds(config: JiraConfig | null, commentIds: number[], expand?: string): Promise<JiraPageBean<JiraComment>>;
39
+ }
40
+ //# sourceMappingURL=jira-comment.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jira-comment.service.d.ts","sourceRoot":"","sources":["../../src/services/jira-comment.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGpD,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAGvD,qBACa,kBAAkB;IAE3B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAFN,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,SAAS;IAKpC;;OAEG;IACG,WAAW,CACf,MAAM,EAAE,UAAU,GAAG,IAAI,EACzB,YAAY,EAAE,MAAM,EACpB,MAAM,CAAC,EAAE,iBAAiB,GACzB,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;IAkBrC;;OAEG;IACG,UAAU,CACd,MAAM,EAAE,UAAU,GAAG,IAAI,EACzB,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,WAAW,CAAC;IAavB;;OAEG;IACG,UAAU,CACd,MAAM,EAAE,UAAU,GAAG,IAAI,EACzB,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,oBAAoB,EAC7B,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,WAAW,CAAC;IAavB;;OAEG;IACG,aAAa,CACjB,MAAM,EAAE,UAAU,GAAG,IAAI,EACzB,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,oBAAoB,EAC7B,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,WAAW,CAAC;IAavB;;OAEG;IACG,aAAa,CACjB,MAAM,EAAE,UAAU,GAAG,IAAI,EACzB,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC;IAUhB;;;;OAIG;IACG,gBAAgB,CACpB,MAAM,EAAE,UAAU,GAAG,IAAI,EACzB,UAAU,EAAE,MAAM,EAAE,EACpB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC;CAYtC"}
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var JiraCommentService_1;
12
+ Object.defineProperty(exports, "__esModule", { value: true });
13
+ exports.JiraCommentService = void 0;
14
+ const axios_1 = require("@nestjs/axios");
15
+ const common_1 = require("@nestjs/common");
16
+ const core_1 = require("@venturialstd/core");
17
+ const jira_client_1 = require("../clients/jira.client");
18
+ const http_method_constant_1 = require("../constants/http-method.constant");
19
+ const __1 = require("..");
20
+ let JiraCommentService = JiraCommentService_1 = class JiraCommentService {
21
+ httpService;
22
+ jiraClient;
23
+ logger;
24
+ constructor(httpService, jiraClient, logger) {
25
+ this.httpService = httpService;
26
+ this.jiraClient = jiraClient;
27
+ this.logger = logger;
28
+ this.logger.setContext(JiraCommentService_1.name);
29
+ }
30
+ /**
31
+ * Get comments for an issue
32
+ */
33
+ async getComments(config, issueIdOrKey, params) {
34
+ const endpoint = `${__1.JIRA_API_PREFIX}/issue/${issueIdOrKey}/comment`;
35
+ const queryParams = {};
36
+ if (params?.startAt !== undefined)
37
+ queryParams.startAt = params.startAt;
38
+ if (params?.maxResults !== undefined)
39
+ queryParams.maxResults = params.maxResults;
40
+ if (params?.orderBy)
41
+ queryParams.orderBy = params.orderBy;
42
+ if (params?.expand)
43
+ queryParams.expand = params.expand;
44
+ return this.jiraClient.request(http_method_constant_1.HttpMethod.GET, endpoint, config, undefined, Object.keys(queryParams).length > 0 ? queryParams : undefined);
45
+ }
46
+ /**
47
+ * Get a specific comment
48
+ */
49
+ async getComment(config, issueIdOrKey, commentId, expand) {
50
+ const endpoint = `${__1.JIRA_API_PREFIX}/issue/${issueIdOrKey}/comment/${commentId}`;
51
+ const queryParams = expand ? { expand } : undefined;
52
+ return this.jiraClient.request(http_method_constant_1.HttpMethod.GET, endpoint, config, undefined, queryParams);
53
+ }
54
+ /**
55
+ * Add a comment to an issue
56
+ */
57
+ async addComment(config, issueIdOrKey, request, expand) {
58
+ const endpoint = `${__1.JIRA_API_PREFIX}/issue/${issueIdOrKey}/comment`;
59
+ const queryParams = expand ? { expand } : undefined;
60
+ return this.jiraClient.request(http_method_constant_1.HttpMethod.POST, endpoint, config, request, queryParams);
61
+ }
62
+ /**
63
+ * Update a comment
64
+ */
65
+ async updateComment(config, issueIdOrKey, commentId, request, expand) {
66
+ const endpoint = `${__1.JIRA_API_PREFIX}/issue/${issueIdOrKey}/comment/${commentId}`;
67
+ const queryParams = expand ? { expand } : undefined;
68
+ return this.jiraClient.request(http_method_constant_1.HttpMethod.PUT, endpoint, config, request, queryParams);
69
+ }
70
+ /**
71
+ * Delete a comment
72
+ */
73
+ async deleteComment(config, issueIdOrKey, commentId) {
74
+ const endpoint = `${__1.JIRA_API_PREFIX}/issue/${issueIdOrKey}/comment/${commentId}`;
75
+ return this.jiraClient.request(http_method_constant_1.HttpMethod.DELETE, endpoint, config);
76
+ }
77
+ /**
78
+ * Get comments by IDs
79
+ * Returns a paginated list of comments specified by a list of comment IDs.
80
+ * This operation can be accessed anonymously.
81
+ */
82
+ async getCommentsByIds(config, commentIds, expand) {
83
+ const endpoint = `${__1.JIRA_API_PREFIX}/comment/list`;
84
+ const queryParams = expand ? { expand } : undefined;
85
+ return this.jiraClient.request(http_method_constant_1.HttpMethod.POST, endpoint, config, { ids: commentIds }, queryParams);
86
+ }
87
+ };
88
+ exports.JiraCommentService = JiraCommentService;
89
+ exports.JiraCommentService = JiraCommentService = JiraCommentService_1 = __decorate([
90
+ (0, common_1.Injectable)(),
91
+ __metadata("design:paramtypes", [axios_1.HttpService,
92
+ jira_client_1.JiraClient,
93
+ core_1.AppLogger])
94
+ ], JiraCommentService);
95
+ //# sourceMappingURL=jira-comment.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jira-comment.service.js","sourceRoot":"","sources":["../../src/services/jira-comment.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,yCAA4C;AAC5C,2CAA4C;AAC5C,6CAA+C;AAE/C,wDAAoD;AACpD,4EAA+D;AAM/D,0BAAqC;AAG9B,IAAM,kBAAkB,0BAAxB,MAAM,kBAAkB;IAEV;I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AAC;IAED;;;;OAIG;IACH,KAAK,CAAC,gBAAgB,CACpB,MAAyB,EACzB,UAAoB,EACpB,MAAe;QAEf,MAAM,QAAQ,GAAG,GAAG,mBAAe,eAAe,CAAC;QACnD,MAAM,WAAW,GAAG,MAAM,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;QAEpD,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAC5B,iCAAU,CAAC,IAAI,EACf,QAAQ,EACR,MAAM,EACN,EAAE,GAAG,EAAE,UAAU,EAAE,EACnB,WAAW,CACZ,CAAC;IACJ,CAAC;CACF,CAAA;AAxIY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,mBAAU,GAAE;qCAGqB,mBAAW;QACZ,wBAAU;QACd,gBAAS;GAJzB,kBAAkB,CAwI9B"}
@@ -0,0 +1,17 @@
1
+ import { HttpService } from '@nestjs/axios';
2
+ import { AppLogger } from '@venturialstd/core';
3
+ import { JiraClient } from '../clients/jira.client';
4
+ import { JiraEvent } from '../types/jira-event.types';
5
+ import { JiraConfig } from '../types/jira.config.type';
6
+ export declare class JiraEventService {
7
+ private readonly httpService;
8
+ private readonly jiraClient;
9
+ private readonly logger;
10
+ constructor(httpService: HttpService, jiraClient: JiraClient, logger: AppLogger);
11
+ /**
12
+ * Get all issue events
13
+ * Requires Administer Jira global permission
14
+ */
15
+ getEvents(config: JiraConfig | null): Promise<JiraEvent[]>;
16
+ }
17
+ //# sourceMappingURL=jira-event.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jira-event.service.d.ts","sourceRoot":"","sources":["../../src/services/jira-event.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAGvD,qBACa,gBAAgB;IAEzB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAFN,WAAW,EAAE,WAAW,EACxB,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,SAAS;IAKpC;;;OAGG;IACG,SAAS,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;CASjE"}
@@ -8,35 +8,39 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  var __metadata = (this && this.__metadata) || function (k, v) {
9
9
  if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
10
  };
11
- var JiraIssueService_1;
11
+ var JiraEventService_1;
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
- exports.JiraIssueService = void 0;
13
+ exports.JiraEventService = void 0;
14
+ const axios_1 = require("@nestjs/axios");
14
15
  const common_1 = require("@nestjs/common");
15
16
  const core_1 = require("@venturialstd/core");
16
17
  const jira_client_1 = require("../clients/jira.client");
17
- let JiraIssueService = JiraIssueService_1 = class JiraIssueService {
18
+ const http_method_constant_1 = require("../constants/http-method.constant");
19
+ const jira_constant_1 = require("../constants/jira.constant");
20
+ let JiraEventService = JiraEventService_1 = class JiraEventService {
21
+ httpService;
18
22
  jiraClient;
19
23
  logger;
20
- constructor(jiraClient, logger) {
24
+ constructor(httpService, jiraClient, logger) {
25
+ this.httpService = httpService;
21
26
  this.jiraClient = jiraClient;
22
27
  this.logger = logger;
23
- this.logger.setContext(JiraIssueService_1.name);
28
+ this.logger.setContext(JiraEventService_1.name);
24
29
  }
25
- async getTicketInformation(ticketId) {
26
- try {
27
- this.logger.log(`Fetching ticket information for ${ticketId}`);
28
- return await this.jiraClient.getTicketInformation(ticketId);
29
- }
30
- catch (error) {
31
- this.logger.error(`Error fetching ticket information for ${ticketId}`, error);
32
- throw error;
33
- }
30
+ /**
31
+ * Get all issue events
32
+ * Requires Administer Jira global permission
33
+ */
34
+ async getEvents(config) {
35
+ const endpoint = `${jira_constant_1.JIRA_API_PREFIX}/events`;
36
+ return this.jiraClient.request(http_method_constant_1.HttpMethod.GET, endpoint, config);
34
37
  }
35
38
  };
36
- exports.JiraIssueService = JiraIssueService;
37
- exports.JiraIssueService = JiraIssueService = JiraIssueService_1 = __decorate([
39
+ exports.JiraEventService = JiraEventService;
40
+ exports.JiraEventService = JiraEventService = JiraEventService_1 = __decorate([
38
41
  (0, common_1.Injectable)(),
39
- __metadata("design:paramtypes", [jira_client_1.JiraClient,
42
+ __metadata("design:paramtypes", [axios_1.HttpService,
43
+ jira_client_1.JiraClient,
40
44
  core_1.AppLogger])
41
- ], JiraIssueService);
42
- //# sourceMappingURL=jira-issue.service.js.map
45
+ ], JiraEventService);
46
+ //# sourceMappingURL=jira-event.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jira-event.service.js","sourceRoot":"","sources":["../../src/services/jira-event.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,yCAA4C;AAC5C,2CAA4C;AAC5C,6CAA+C;AAE/C,wDAAoD;AACpD,4EAA+D;AAG/D,8DAA6D;AAGtD,IAAM,gBAAgB,wBAAtB,MAAM,gBAAgB;IAER;IACA;IACA;IAHnB,YACmB,WAAwB,EACxB,UAAsB,EACtB,MAAiB;QAFjB,gBAAW,GAAX,WAAW,CAAa;QACxB,eAAU,GAAV,UAAU,CAAY;QACtB,WAAM,GAAN,MAAM,CAAW;QAElC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,kBAAgB,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,SAAS,CAAC,MAAyB;QACvC,MAAM,QAAQ,GAAG,GAAG,+BAAe,SAAS,CAAC;QAE7C,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAC5B,iCAAU,CAAC,GAAG,EACd,QAAQ,EACR,MAAM,CACP,CAAC;IACJ,CAAC;CACF,CAAA;AAtBY,4CAAgB;2BAAhB,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;qCAGqB,mBAAW;QACZ,wBAAU;QACd,gBAAS;GAJzB,gBAAgB,CAsB5B"}
@@ -0,0 +1,113 @@
1
+ import { HttpService } from '@nestjs/axios';
2
+ import { AppLogger } from '@venturialstd/core';
3
+ import { JiraClient } from '../clients/jira.client';
4
+ import { JiraEditMeta, JiraCreateMeta, JiraCreateMetaIssueType, JiraCreateMetaField, JiraTransitionsResponse } from '../types/jira-metadata.types';
5
+ import { ArchiveIssuesByJqlRequest, ArchiveIssuesRequest, AssignIssueRequest, BulkCreateIssueRequest, BulkFetchChangelogsRequest, BulkFetchIssuesRequest, CreateIssueRequest, EditIssueRequest, GetChangelogsByIdsRequest, SendNotificationRequest, TransitionIssueRequest, UnarchiveIssuesRequest } from '../types/jira.request.types';
6
+ import { GetChangelogsParams, GetCreateMetaFieldsParams, GetCreateMetaIssueTypesParams, GetCreateMetaParams, GetIssueParams, GetTransitionsParams, EditIssueParams } from '../types/jira-issue.params.types';
7
+ import { ArchiveIssuesResponse, BulkCreateIssuesResponse, BulkFetchChangelogsResponse, BulkFetchIssuesResponse, CreateIssueResponse, ExportArchivedIssuesResponse, IssueLimitReportResponse } from '../types/jira-issue.response.types';
8
+ import { JiraChangelog, JiraIssue, JiraPageBean } from '../types/jira.types';
9
+ import { JiraConfig } from '../types/jira.config.type';
10
+ export declare class JiraIssueService {
11
+ private readonly httpService;
12
+ private readonly jiraClient;
13
+ private readonly logger;
14
+ constructor(httpService: HttpService, jiraClient: JiraClient, logger: AppLogger);
15
+ /**
16
+ * Get issue by ID or key
17
+ */
18
+ getIssue(config: JiraConfig | null, issueIdOrKey: string, params?: GetIssueParams): Promise<JiraIssue>;
19
+ /**
20
+ * Create a new issue
21
+ */
22
+ createIssue(config: JiraConfig | null, request: CreateIssueRequest, updateHistory?: boolean): Promise<CreateIssueResponse>;
23
+ /**
24
+ * Edit an issue
25
+ */
26
+ editIssue(config: JiraConfig | null, issueIdOrKey: string, request: EditIssueRequest, params?: EditIssueParams): Promise<JiraIssue | void>;
27
+ /**
28
+ * Delete an issue
29
+ */
30
+ deleteIssue(config: JiraConfig | null, issueIdOrKey: string, deleteSubtasks?: boolean): Promise<void>;
31
+ /**
32
+ * Assign an issue
33
+ */
34
+ assignIssue(config: JiraConfig | null, issueIdOrKey: string, request: AssignIssueRequest): Promise<void>;
35
+ /**
36
+ * Get issue changelogs
37
+ */
38
+ getChangelogs(config: JiraConfig | null, issueIdOrKey: string, params?: GetChangelogsParams): Promise<JiraPageBean<JiraChangelog>>;
39
+ /**
40
+ * Get changelogs by IDs
41
+ */
42
+ getChangelogsByIds(config: JiraConfig | null, issueIdOrKey: string, request: GetChangelogsByIdsRequest): Promise<JiraPageBean<JiraChangelog>>;
43
+ /**
44
+ * Get edit issue metadata
45
+ */
46
+ getEditMeta(config: JiraConfig | null, issueIdOrKey: string, overrideScreenSecurity?: boolean, overrideEditableFlag?: boolean): Promise<JiraEditMeta>;
47
+ /**
48
+ * Send notification for issue
49
+ */
50
+ sendNotification(config: JiraConfig | null, issueIdOrKey: string, request: SendNotificationRequest): Promise<void>;
51
+ /**
52
+ * Get transitions for an issue
53
+ */
54
+ getTransitions(config: JiraConfig | null, issueIdOrKey: string, params?: GetTransitionsParams): Promise<JiraTransitionsResponse>;
55
+ /**
56
+ * Transition an issue
57
+ */
58
+ transitionIssue(config: JiraConfig | null, issueIdOrKey: string, request: TransitionIssueRequest): Promise<void>;
59
+ /**
60
+ * Bulk create issues
61
+ */
62
+ bulkCreateIssues(config: JiraConfig | null, request: BulkCreateIssueRequest): Promise<BulkCreateIssuesResponse>;
63
+ /**
64
+ * Bulk fetch issues
65
+ */
66
+ bulkFetchIssues(config: JiraConfig | null, request: BulkFetchIssuesRequest): Promise<BulkFetchIssuesResponse>;
67
+ /**
68
+ * Archive issues by ID/key
69
+ */
70
+ archiveIssues(config: JiraConfig | null, request: ArchiveIssuesRequest): Promise<ArchiveIssuesResponse>;
71
+ /**
72
+ * Archive issues by JQL
73
+ */
74
+ archiveIssuesByJql(config: JiraConfig | null, request: ArchiveIssuesByJqlRequest): Promise<string>;
75
+ /**
76
+ * Unarchive issues
77
+ */
78
+ unarchiveIssues(config: JiraConfig | null, request: UnarchiveIssuesRequest): Promise<ArchiveIssuesResponse>;
79
+ /**
80
+ * Get issue limit report
81
+ */
82
+ getIssueLimitReport(config: JiraConfig | null, isReturningKeys?: boolean): Promise<IssueLimitReportResponse>;
83
+ /**
84
+ * Export archived issues
85
+ */
86
+ exportArchivedIssues(config: JiraConfig | null, request: {
87
+ projects?: string[];
88
+ archivedBy?: string[];
89
+ archivedDateRange?: {
90
+ dateAfter?: string;
91
+ dateBefore?: string;
92
+ };
93
+ issueTypes?: string[];
94
+ reporters?: string[];
95
+ }): Promise<ExportArchivedIssuesResponse>;
96
+ /**
97
+ * Get create issue metadata
98
+ */
99
+ getCreateMeta(config: JiraConfig | null, params?: GetCreateMetaParams): Promise<JiraCreateMeta>;
100
+ /**
101
+ * Get create metadata issue types for a project
102
+ */
103
+ getCreateMetaIssueTypes(config: JiraConfig | null, projectIdOrKey: string, params?: GetCreateMetaIssueTypesParams): Promise<JiraPageBean<JiraCreateMetaIssueType>>;
104
+ /**
105
+ * Get create field metadata for a project and issue type
106
+ */
107
+ getCreateMetaFields(config: JiraConfig | null, projectIdOrKey: string, issueTypeId: string, params?: GetCreateMetaFieldsParams): Promise<JiraPageBean<JiraCreateMetaField>>;
108
+ /**
109
+ * Bulk fetch changelogs
110
+ */
111
+ bulkFetchChangelogs(config: JiraConfig | null, request: BulkFetchChangelogsRequest): Promise<BulkFetchChangelogsResponse>;
112
+ }
113
+ //# sourceMappingURL=jira-issue.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jira-issue.service.d.ts","sourceRo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