@squidcloud/jira-client 1.0.429
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/connectors/jira/common/src/jira-types.d.ts +184 -0
- package/dist/connectors/jira/jira-client/src/index.d.ts +2 -0
- package/dist/connectors/jira/jira-client/src/jira-client.d.ts +82 -0
- package/dist/index.js +1 -0
- package/dist/internal-common/src/public-types/communication.public-types.d.ts +30 -0
- package/package.json +31 -0
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { IntegrationId } from '../../../../internal-common/src/public-types/communication.public-types';
|
|
2
|
+
/**
|
|
3
|
+
* Jira API Types - Shared between backend and client
|
|
4
|
+
*/
|
|
5
|
+
export type JiraPriority = 1 | 2 | 3 | 4 | 5;
|
|
6
|
+
export declare const PRIORITY_LABELS: Record<JiraPriority, string>;
|
|
7
|
+
export interface JiraProject {
|
|
8
|
+
id: string;
|
|
9
|
+
key: string;
|
|
10
|
+
name: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
projectTypeKey?: string;
|
|
13
|
+
avatarUrls?: Record<string, string>;
|
|
14
|
+
}
|
|
15
|
+
export interface JiraUser {
|
|
16
|
+
accountId: string;
|
|
17
|
+
displayName: string;
|
|
18
|
+
emailAddress?: string;
|
|
19
|
+
avatarUrls?: Record<string, string>;
|
|
20
|
+
active: boolean;
|
|
21
|
+
}
|
|
22
|
+
export interface JiraIssueType {
|
|
23
|
+
id: string;
|
|
24
|
+
name: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
subtask: boolean;
|
|
27
|
+
iconUrl?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface JiraStatus {
|
|
30
|
+
id: string;
|
|
31
|
+
name: string;
|
|
32
|
+
description?: string;
|
|
33
|
+
statusCategory: {
|
|
34
|
+
id: number;
|
|
35
|
+
key: string;
|
|
36
|
+
name: string;
|
|
37
|
+
colorName: string;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export interface JiraComment {
|
|
41
|
+
id: string;
|
|
42
|
+
body: string;
|
|
43
|
+
author: JiraUser;
|
|
44
|
+
created: string;
|
|
45
|
+
updated: string;
|
|
46
|
+
}
|
|
47
|
+
export interface JiraIssue {
|
|
48
|
+
id: string;
|
|
49
|
+
key: string;
|
|
50
|
+
summary: string;
|
|
51
|
+
description?: string;
|
|
52
|
+
priority?: {
|
|
53
|
+
id: string;
|
|
54
|
+
name: string;
|
|
55
|
+
};
|
|
56
|
+
status: JiraStatus;
|
|
57
|
+
issuetype: JiraIssueType;
|
|
58
|
+
project: JiraProject;
|
|
59
|
+
assignee?: JiraUser;
|
|
60
|
+
reporter?: JiraUser;
|
|
61
|
+
created: string;
|
|
62
|
+
updated: string;
|
|
63
|
+
labels?: Array<string>;
|
|
64
|
+
}
|
|
65
|
+
export interface JiraTransition {
|
|
66
|
+
id: string;
|
|
67
|
+
name: string;
|
|
68
|
+
to: JiraStatus;
|
|
69
|
+
}
|
|
70
|
+
export type RelatedIssuesMode = 'RESOLVED' | 'ALL' | 'NONE';
|
|
71
|
+
export declare const RELATED_ISSUES_MODE_ENUM: Array<string>;
|
|
72
|
+
/** Request to search Jira issues by text */
|
|
73
|
+
export interface SearchJiraIssuesRequest {
|
|
74
|
+
/** The ID of the Jira integration */
|
|
75
|
+
integrationId: IntegrationId;
|
|
76
|
+
/** The search query to find issues */
|
|
77
|
+
query: string;
|
|
78
|
+
/** Optional project keys to filter by (comma-separated) */
|
|
79
|
+
projectKeys?: string;
|
|
80
|
+
/** Maximum number of issues to return (default: 50) */
|
|
81
|
+
limit?: number;
|
|
82
|
+
}
|
|
83
|
+
/** Request to search Jira issues by JQL */
|
|
84
|
+
export interface SearchJiraIssuesByJqlRequest {
|
|
85
|
+
/** The ID of the Jira integration */
|
|
86
|
+
integrationId: IntegrationId;
|
|
87
|
+
/** The JQL query to execute */
|
|
88
|
+
jql: string;
|
|
89
|
+
/** Maximum number of issues to return (default: 50) */
|
|
90
|
+
limit?: number;
|
|
91
|
+
}
|
|
92
|
+
/** Request to get details of a Jira issue */
|
|
93
|
+
export interface GetJiraIssueRequest {
|
|
94
|
+
/** The ID of the Jira integration */
|
|
95
|
+
integrationId: IntegrationId;
|
|
96
|
+
/** The Jira issue key (e.g., "PROJ-123") */
|
|
97
|
+
issueKey: string;
|
|
98
|
+
/** Whether to include related issues in the response */
|
|
99
|
+
relatedIssuesMode?: RelatedIssuesMode;
|
|
100
|
+
}
|
|
101
|
+
/** Request to create a Jira issue */
|
|
102
|
+
export interface CreateJiraIssueRequest {
|
|
103
|
+
/** The ID of the Jira integration */
|
|
104
|
+
integrationId: IntegrationId;
|
|
105
|
+
/** The project key to create the issue in */
|
|
106
|
+
projectKey: string;
|
|
107
|
+
/** The title/summary of the issue */
|
|
108
|
+
summary: string;
|
|
109
|
+
/** The description of the issue */
|
|
110
|
+
description?: string;
|
|
111
|
+
/** The issue type (e.g., "Bug", "Task", "Story") */
|
|
112
|
+
issueType: string;
|
|
113
|
+
/** Priority name (e.g., "High", "Medium", "Low") */
|
|
114
|
+
priority?: string;
|
|
115
|
+
/** Email or account ID of the assignee */
|
|
116
|
+
assignee?: string;
|
|
117
|
+
/** Labels to apply to the issue */
|
|
118
|
+
labels?: Array<string>;
|
|
119
|
+
}
|
|
120
|
+
/** Request to update a Jira issue */
|
|
121
|
+
export interface UpdateJiraIssueRequest {
|
|
122
|
+
/** The ID of the Jira integration */
|
|
123
|
+
integrationId: IntegrationId;
|
|
124
|
+
/** The Jira issue key (e.g., "PROJ-123") */
|
|
125
|
+
issueKey: string;
|
|
126
|
+
/** New summary for the issue */
|
|
127
|
+
summary?: string;
|
|
128
|
+
/** New description for the issue */
|
|
129
|
+
description?: string;
|
|
130
|
+
/** New priority name */
|
|
131
|
+
priority?: string;
|
|
132
|
+
/** Email or account ID of the new assignee */
|
|
133
|
+
assignee?: string;
|
|
134
|
+
/** Labels to set on the issue */
|
|
135
|
+
labels?: Array<string>;
|
|
136
|
+
}
|
|
137
|
+
/** Request to add a comment to a Jira issue */
|
|
138
|
+
export interface AddJiraCommentRequest {
|
|
139
|
+
/** The ID of the Jira integration */
|
|
140
|
+
integrationId: IntegrationId;
|
|
141
|
+
/** The Jira issue key (e.g., "PROJ-123") */
|
|
142
|
+
issueKey: string;
|
|
143
|
+
/** The comment body */
|
|
144
|
+
body: string;
|
|
145
|
+
}
|
|
146
|
+
/** Request to transition a Jira issue */
|
|
147
|
+
export interface TransitionJiraIssueRequest {
|
|
148
|
+
/** The ID of the Jira integration */
|
|
149
|
+
integrationId: IntegrationId;
|
|
150
|
+
/** The Jira issue key (e.g., "PROJ-123") */
|
|
151
|
+
issueKey: string;
|
|
152
|
+
/** The name of the transition to apply */
|
|
153
|
+
transitionName: string;
|
|
154
|
+
}
|
|
155
|
+
/** Request to list Jira projects */
|
|
156
|
+
export interface ListJiraProjectsRequest {
|
|
157
|
+
/** The ID of the Jira integration */
|
|
158
|
+
integrationId: IntegrationId;
|
|
159
|
+
}
|
|
160
|
+
/** Response from Jira issue operations */
|
|
161
|
+
export interface JiraIssueResponse {
|
|
162
|
+
/** Issue key (e.g., "PROJ-123") */
|
|
163
|
+
key: string;
|
|
164
|
+
/** Issue summary */
|
|
165
|
+
summary: string;
|
|
166
|
+
/** Issue URL */
|
|
167
|
+
url: string;
|
|
168
|
+
}
|
|
169
|
+
/** Response from listing projects */
|
|
170
|
+
export interface JiraProjectResponse {
|
|
171
|
+
/** Project key (e.g., "PROJ") */
|
|
172
|
+
key: string;
|
|
173
|
+
/** Project name */
|
|
174
|
+
name: string;
|
|
175
|
+
/** Project description */
|
|
176
|
+
description?: string;
|
|
177
|
+
}
|
|
178
|
+
/** Response with issue details as XML string */
|
|
179
|
+
export interface JiraIssueDetailsResponse {
|
|
180
|
+
/** Issue key */
|
|
181
|
+
key: string;
|
|
182
|
+
/** Issue details as formatted string */
|
|
183
|
+
details: string;
|
|
184
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { Squid } from '@squidcloud/client';
|
|
2
|
+
import { CreateJiraIssueRequest, JiraIssueResponse, JiraProjectResponse, RelatedIssuesMode, SearchJiraIssuesByJqlRequest, SearchJiraIssuesRequest, UpdateJiraIssueRequest } from '../../common/src/jira-types';
|
|
3
|
+
/**
|
|
4
|
+
* Client for interacting with the Jira connector.
|
|
5
|
+
*
|
|
6
|
+
* Provides methods to search, create, update issues, add comments,
|
|
7
|
+
* transition issues, and list projects from Jira.
|
|
8
|
+
*/
|
|
9
|
+
export declare class SquidJiraClient {
|
|
10
|
+
private readonly squid;
|
|
11
|
+
private readonly integrationId;
|
|
12
|
+
/**
|
|
13
|
+
* Creates a new Jira client instance.
|
|
14
|
+
*
|
|
15
|
+
* @param squid - Squid client instance. Provide an instance that includes the Squid API key.
|
|
16
|
+
* @param integrationId - The ID of the Jira integration in the Squid console.
|
|
17
|
+
*/
|
|
18
|
+
constructor(squid: Squid, integrationId: string);
|
|
19
|
+
/**
|
|
20
|
+
* Search for Jira issues by text query.
|
|
21
|
+
*
|
|
22
|
+
* Returns issues matching the search term in summary, description, or comments.
|
|
23
|
+
*
|
|
24
|
+
* @param request - Search parameters.
|
|
25
|
+
* @returns Formatted string with matching issues.
|
|
26
|
+
*/
|
|
27
|
+
searchIssues(request: Omit<SearchJiraIssuesRequest, 'integrationId'>): Promise<string>;
|
|
28
|
+
/**
|
|
29
|
+
* Search for Jira issues using JQL (Jira Query Language).
|
|
30
|
+
*
|
|
31
|
+
* Provides powerful filtering capabilities.
|
|
32
|
+
*
|
|
33
|
+
* @param request - Search parameters including JQL query.
|
|
34
|
+
* @returns Formatted string with matching issues.
|
|
35
|
+
*/
|
|
36
|
+
searchByJql(request: Omit<SearchJiraIssuesByJqlRequest, 'integrationId'>): Promise<string>;
|
|
37
|
+
/**
|
|
38
|
+
* Get detailed information about a specific Jira issue.
|
|
39
|
+
*
|
|
40
|
+
* @param issueKey - The Jira issue key (e.g., "PROJ-123").
|
|
41
|
+
* @param relatedIssuesMode - Whether to include related issues (default: 'RESOLVED').
|
|
42
|
+
* @returns Formatted string with issue details including comments.
|
|
43
|
+
*/
|
|
44
|
+
getIssue(issueKey: string, relatedIssuesMode?: RelatedIssuesMode): Promise<string>;
|
|
45
|
+
/**
|
|
46
|
+
* Create a new Jira issue.
|
|
47
|
+
*
|
|
48
|
+
* @param request - Create parameters including project, summary, and issue type.
|
|
49
|
+
* @returns The created issue information.
|
|
50
|
+
*/
|
|
51
|
+
createIssue(request: Omit<CreateJiraIssueRequest, 'integrationId'>): Promise<JiraIssueResponse>;
|
|
52
|
+
/**
|
|
53
|
+
* Update an existing Jira issue.
|
|
54
|
+
*
|
|
55
|
+
* @param request - Update parameters including issue key and fields to update.
|
|
56
|
+
* @returns The updated issue information.
|
|
57
|
+
*/
|
|
58
|
+
updateIssue(request: Omit<UpdateJiraIssueRequest, 'integrationId'>): Promise<JiraIssueResponse>;
|
|
59
|
+
/**
|
|
60
|
+
* Add a comment to a Jira issue.
|
|
61
|
+
*
|
|
62
|
+
* @param issueKey - The Jira issue key (e.g., "PROJ-123").
|
|
63
|
+
* @param body - The comment text.
|
|
64
|
+
* @returns The created comment ID.
|
|
65
|
+
*/
|
|
66
|
+
addComment(issueKey: string, body: string): Promise<{
|
|
67
|
+
commentId: string;
|
|
68
|
+
}>;
|
|
69
|
+
/**
|
|
70
|
+
* Transition a Jira issue to a different status.
|
|
71
|
+
*
|
|
72
|
+
* @param issueKey - The Jira issue key (e.g., "PROJ-123").
|
|
73
|
+
* @param transitionName - The name of the transition (e.g., "Done", "In Progress").
|
|
74
|
+
*/
|
|
75
|
+
transitionIssue(issueKey: string, transitionName: string): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* List available Jira projects.
|
|
78
|
+
*
|
|
79
|
+
* @returns Array of projects with their key, name, and description.
|
|
80
|
+
*/
|
|
81
|
+
listProjects(): Promise<Array<JiraProjectResponse>>;
|
|
82
|
+
}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var e={d:(t,i)=>{for(var s in i)e.o(i,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:i[s]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{PRIORITY_LABELS:()=>i,RELATED_ISSUES_MODE_ENUM:()=>s,SquidJiraClient:()=>n});const i={1:"Highest",2:"High",3:"Medium",4:"Low",5:"Lowest"},s=["RESOLVED","ALL","NONE"];class n{constructor(e,t){this.squid=e,this.integrationId=t}async searchIssues(e){const t={...e,integrationId:this.integrationId};return this.squid.executeFunction("searchJiraIssuesExecutable",t)}async searchByJql(e){const t={...e,integrationId:this.integrationId};return this.squid.executeFunction("searchJiraIssuesByJqlExecutable",t)}async getIssue(e,t){const i={integrationId:this.integrationId,issueKey:e,relatedIssuesMode:t};return this.squid.executeFunction("getJiraIssueDetailsExecutable",i)}async createIssue(e){const t={...e,integrationId:this.integrationId};return this.squid.executeFunction("createJiraIssueExecutable",t)}async updateIssue(e){const t={...e,integrationId:this.integrationId};return this.squid.executeFunction("updateJiraIssueExecutable",t)}async addComment(e,t){const i={integrationId:this.integrationId,issueKey:e,body:t};return this.squid.executeFunction("addJiraCommentExecutable",i)}async transitionIssue(e,t){const i={integrationId:this.integrationId,issueKey:e,transitionName:t};return this.squid.executeFunction("transitionJiraIssueExecutable",i)}async listProjects(){const e={integrationId:this.integrationId};return this.squid.executeFunction("listJiraProjectsExecutable",e)}}var r=exports;for(var a in t)r[a]=t[a];t.__esModule&&Object.defineProperty(r,"__esModule",{value:!0})})();
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** A type alias for an application id. */
|
|
2
|
+
export type AppId = string;
|
|
3
|
+
/** A tuple of environment identifiers like 'dev' or 'prod'. */
|
|
4
|
+
export declare const ENVIRONMENT_IDS: readonly ["dev", "prod"];
|
|
5
|
+
/** A type representing valid environment identifiers derived from ENVIRONMENT_IDS. */
|
|
6
|
+
export type EnvironmentId = (typeof ENVIRONMENT_IDS)[number];
|
|
7
|
+
/** A type alias for a squid developer identifier. */
|
|
8
|
+
export type SquidDeveloperId = string;
|
|
9
|
+
/** A type alias for an integration id. */
|
|
10
|
+
export type IntegrationId = string;
|
|
11
|
+
/** A type alias for a client identifier. */
|
|
12
|
+
export type ClientId = string;
|
|
13
|
+
/** A type alias for a squid document identifier. */
|
|
14
|
+
export type SquidDocId = string;
|
|
15
|
+
/** A type alias for a client request identifier. */
|
|
16
|
+
export type ClientRequestId = string;
|
|
17
|
+
/** ID of AI agent. Also known as AI profile id. */
|
|
18
|
+
export type AiAgentId = string;
|
|
19
|
+
/** App-level ID of AI Knowledge Base */
|
|
20
|
+
export type AiKnowledgeBaseId = string;
|
|
21
|
+
/**
|
|
22
|
+
* The built-in agent id. Cannot be customized.
|
|
23
|
+
* @category AI
|
|
24
|
+
*/
|
|
25
|
+
export declare const BUILT_IN_AGENT_ID = "built_in_agent";
|
|
26
|
+
/**
|
|
27
|
+
* A type alias for an AI context identifier.
|
|
28
|
+
* @category AI
|
|
29
|
+
*/
|
|
30
|
+
export type AiContextId = string;
|
package/package.json
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@squidcloud/jira-client",
|
|
3
|
+
"version": "1.0.429",
|
|
4
|
+
"description": "Squid Jira Client - SDK for interacting with the Jira connector",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/jira-client/src/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"prebuild": "del-cli dist",
|
|
9
|
+
"build": "webpack --mode=production",
|
|
10
|
+
"lint": "eslint",
|
|
11
|
+
"publish:public": "npm run build && npm publish --access public"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist/**/*"
|
|
15
|
+
],
|
|
16
|
+
"keywords": [
|
|
17
|
+
"squid",
|
|
18
|
+
"jira",
|
|
19
|
+
"issue-tracking",
|
|
20
|
+
"connector"
|
|
21
|
+
],
|
|
22
|
+
"author": "",
|
|
23
|
+
"license": "ISC",
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"assertic": "^1.3.0",
|
|
26
|
+
"@squidcloud/client": "^1.0.429"
|
|
27
|
+
},
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=20.0.0"
|
|
30
|
+
}
|
|
31
|
+
}
|