@squidcloud/jira-jsm-client 1.0.433
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_jsm/common/src/jira-jsm-types.d.ts +224 -0
- package/dist/connectors/jira_jsm/jira-jsm-client/src/index.d.ts +2 -0
- package/dist/connectors/jira_jsm/jira-jsm-client/src/jira-jsm-client.d.ts +88 -0
- package/dist/index.js +1 -0
- package/dist/internal-common/src/public-types/communication.public-types.d.ts +30 -0
- package/package.json +33 -0
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import { IntegrationId } from '../../../../internal-common/src/public-types/communication.public-types';
|
|
2
|
+
/**
|
|
3
|
+
* Jira Service Management API Types - Shared between backend and client
|
|
4
|
+
*/
|
|
5
|
+
export type JsmPriority = 1 | 2 | 3 | 4 | 5;
|
|
6
|
+
export declare const PRIORITY_LABELS: Record<JsmPriority, string>;
|
|
7
|
+
export interface JsmServiceDesk {
|
|
8
|
+
id: string;
|
|
9
|
+
projectId: string;
|
|
10
|
+
projectKey: string;
|
|
11
|
+
projectName: string;
|
|
12
|
+
}
|
|
13
|
+
export interface JsmUser {
|
|
14
|
+
accountId: string;
|
|
15
|
+
displayName: string;
|
|
16
|
+
emailAddress?: string;
|
|
17
|
+
avatarUrls?: Record<string, string>;
|
|
18
|
+
active: boolean;
|
|
19
|
+
}
|
|
20
|
+
export interface JsmCustomer {
|
|
21
|
+
accountId: string;
|
|
22
|
+
displayName: string;
|
|
23
|
+
emailAddress?: string;
|
|
24
|
+
active?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface JsmOrganization {
|
|
27
|
+
id: string;
|
|
28
|
+
name: string;
|
|
29
|
+
}
|
|
30
|
+
export interface JsmRequestType {
|
|
31
|
+
id: string;
|
|
32
|
+
name: string;
|
|
33
|
+
description?: string;
|
|
34
|
+
serviceDeskId: string;
|
|
35
|
+
groupIds?: Array<string>;
|
|
36
|
+
portalId?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface JsmStatus {
|
|
39
|
+
id: string;
|
|
40
|
+
name: string;
|
|
41
|
+
description?: string;
|
|
42
|
+
statusCategory: {
|
|
43
|
+
id: number;
|
|
44
|
+
key: string;
|
|
45
|
+
name: string;
|
|
46
|
+
colorName: string;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
export interface JsmComment {
|
|
50
|
+
id: string;
|
|
51
|
+
body: string;
|
|
52
|
+
author: JsmUser;
|
|
53
|
+
created: string;
|
|
54
|
+
public: boolean;
|
|
55
|
+
}
|
|
56
|
+
export interface JsmSla {
|
|
57
|
+
id: string;
|
|
58
|
+
name: string;
|
|
59
|
+
completedCycles?: Array<{
|
|
60
|
+
startTime: string;
|
|
61
|
+
stopTime: string;
|
|
62
|
+
breached: boolean;
|
|
63
|
+
goalDuration: {
|
|
64
|
+
millis: number;
|
|
65
|
+
friendly: string;
|
|
66
|
+
};
|
|
67
|
+
elapsedTime: {
|
|
68
|
+
millis: number;
|
|
69
|
+
friendly: string;
|
|
70
|
+
};
|
|
71
|
+
remainingTime: {
|
|
72
|
+
millis: number;
|
|
73
|
+
friendly: string;
|
|
74
|
+
};
|
|
75
|
+
}>;
|
|
76
|
+
ongoingCycle?: {
|
|
77
|
+
startTime: string;
|
|
78
|
+
breached: boolean;
|
|
79
|
+
paused: boolean;
|
|
80
|
+
withinCalendarHours: boolean;
|
|
81
|
+
goalDuration: {
|
|
82
|
+
millis: number;
|
|
83
|
+
friendly: string;
|
|
84
|
+
};
|
|
85
|
+
elapsedTime: {
|
|
86
|
+
millis: number;
|
|
87
|
+
friendly: string;
|
|
88
|
+
};
|
|
89
|
+
remainingTime: {
|
|
90
|
+
millis: number;
|
|
91
|
+
friendly: string;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
export interface JsmRequest {
|
|
96
|
+
issueId: string;
|
|
97
|
+
issueKey: string;
|
|
98
|
+
requestTypeId: string;
|
|
99
|
+
serviceDeskId: string;
|
|
100
|
+
createdDate: string;
|
|
101
|
+
reporter: JsmCustomer;
|
|
102
|
+
requestFieldValues?: Array<{
|
|
103
|
+
fieldId: string;
|
|
104
|
+
label: string;
|
|
105
|
+
value: unknown;
|
|
106
|
+
}>;
|
|
107
|
+
currentStatus: JsmStatus;
|
|
108
|
+
_links?: Record<string, string>;
|
|
109
|
+
}
|
|
110
|
+
export interface JsmRequestFull extends JsmRequest {
|
|
111
|
+
summary?: string;
|
|
112
|
+
description?: string;
|
|
113
|
+
priority?: {
|
|
114
|
+
id: string;
|
|
115
|
+
name: string;
|
|
116
|
+
};
|
|
117
|
+
assignee?: JsmUser;
|
|
118
|
+
participants?: Array<JsmCustomer>;
|
|
119
|
+
organizations?: Array<JsmOrganization>;
|
|
120
|
+
slas?: Array<JsmSla>;
|
|
121
|
+
requestType?: JsmRequestType;
|
|
122
|
+
url: string;
|
|
123
|
+
}
|
|
124
|
+
export interface JsmRequestDetails {
|
|
125
|
+
request: JsmRequestFull;
|
|
126
|
+
comments: Array<JsmComment>;
|
|
127
|
+
detailsAsString: string;
|
|
128
|
+
}
|
|
129
|
+
/** Request to list service desks */
|
|
130
|
+
export interface ListJsmServiceDesksRequest {
|
|
131
|
+
integrationId: IntegrationId;
|
|
132
|
+
}
|
|
133
|
+
/** Request to list request types for a service desk */
|
|
134
|
+
export interface ListJsmRequestTypesRequest {
|
|
135
|
+
integrationId: IntegrationId;
|
|
136
|
+
serviceDeskId: string;
|
|
137
|
+
}
|
|
138
|
+
/** Request to search JSM requests by text */
|
|
139
|
+
export interface SearchJsmRequestsRequest {
|
|
140
|
+
integrationId: IntegrationId;
|
|
141
|
+
query: string;
|
|
142
|
+
serviceDeskId?: string;
|
|
143
|
+
requestStatus?: 'OPEN' | 'CLOSED' | 'ALL';
|
|
144
|
+
limit?: number;
|
|
145
|
+
}
|
|
146
|
+
/** Request to get details of a JSM request */
|
|
147
|
+
export interface GetJsmRequestRequest {
|
|
148
|
+
integrationId: IntegrationId;
|
|
149
|
+
issueIdOrKey: string;
|
|
150
|
+
relatedRequestsMode?: RelatedRequestsMode;
|
|
151
|
+
}
|
|
152
|
+
/** Request to create a JSM request */
|
|
153
|
+
export interface CreateJsmRequestRequest {
|
|
154
|
+
integrationId: IntegrationId;
|
|
155
|
+
serviceDeskId: string;
|
|
156
|
+
requestTypeId: string;
|
|
157
|
+
summary: string;
|
|
158
|
+
description?: string;
|
|
159
|
+
priority?: string;
|
|
160
|
+
reporterEmail?: string;
|
|
161
|
+
requestFieldValues?: Record<string, unknown>;
|
|
162
|
+
}
|
|
163
|
+
/** Request to update a JSM request */
|
|
164
|
+
export interface UpdateJsmRequestRequest {
|
|
165
|
+
integrationId: IntegrationId;
|
|
166
|
+
issueIdOrKey: string;
|
|
167
|
+
summary?: string;
|
|
168
|
+
description?: string;
|
|
169
|
+
priority?: string;
|
|
170
|
+
assignee?: string;
|
|
171
|
+
}
|
|
172
|
+
/** Request to add a comment to a JSM request */
|
|
173
|
+
export interface AddJsmCommentRequest {
|
|
174
|
+
integrationId: IntegrationId;
|
|
175
|
+
issueIdOrKey: string;
|
|
176
|
+
body: string;
|
|
177
|
+
public?: boolean;
|
|
178
|
+
}
|
|
179
|
+
/** Request to transition a JSM request */
|
|
180
|
+
export interface TransitionJsmRequestRequest {
|
|
181
|
+
integrationId: IntegrationId;
|
|
182
|
+
issueIdOrKey: string;
|
|
183
|
+
transitionId: string;
|
|
184
|
+
}
|
|
185
|
+
/** Request to list customers */
|
|
186
|
+
export interface ListJsmCustomersRequest {
|
|
187
|
+
integrationId: IntegrationId;
|
|
188
|
+
serviceDeskId: string;
|
|
189
|
+
query?: string;
|
|
190
|
+
limit?: number;
|
|
191
|
+
}
|
|
192
|
+
/** Request to add a customer to a service desk */
|
|
193
|
+
export interface AddJsmCustomerRequest {
|
|
194
|
+
integrationId: IntegrationId;
|
|
195
|
+
serviceDeskId: string;
|
|
196
|
+
email: string;
|
|
197
|
+
displayName?: string;
|
|
198
|
+
}
|
|
199
|
+
export type RelatedRequestsMode = 'RESOLVED' | 'ALL' | 'NONE';
|
|
200
|
+
export declare const RELATED_REQUESTS_MODE_ENUM: Array<string>;
|
|
201
|
+
/** Response from JSM request operations */
|
|
202
|
+
export interface JsmRequestResponse {
|
|
203
|
+
issueKey: string;
|
|
204
|
+
summary?: string;
|
|
205
|
+
url: string;
|
|
206
|
+
}
|
|
207
|
+
/** Response from listing service desks */
|
|
208
|
+
export interface JsmServiceDeskResponse {
|
|
209
|
+
id: string;
|
|
210
|
+
projectKey: string;
|
|
211
|
+
projectName: string;
|
|
212
|
+
}
|
|
213
|
+
/** Response from listing request types */
|
|
214
|
+
export interface JsmRequestTypeResponse {
|
|
215
|
+
id: string;
|
|
216
|
+
name: string;
|
|
217
|
+
description?: string;
|
|
218
|
+
}
|
|
219
|
+
/** Response from listing customers */
|
|
220
|
+
export interface JsmCustomerResponse {
|
|
221
|
+
accountId: string;
|
|
222
|
+
displayName: string;
|
|
223
|
+
emailAddress?: string;
|
|
224
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { Squid } from '@squidcloud/client';
|
|
2
|
+
import { CreateJsmRequestRequest, JsmCustomerResponse, JsmRequestDetails, JsmRequestResponse, JsmRequestTypeResponse, JsmServiceDeskResponse, RelatedRequestsMode, SearchJsmRequestsRequest, UpdateJsmRequestRequest } from '../../common/src/jira-jsm-types';
|
|
3
|
+
/**
|
|
4
|
+
* Client for interacting with the Jira Service Management connector.
|
|
5
|
+
*
|
|
6
|
+
* Provides methods to manage support tickets, service desks, request types,
|
|
7
|
+
* and customers in Jira Service Management.
|
|
8
|
+
*/
|
|
9
|
+
export declare class SquidJiraJsmClient {
|
|
10
|
+
private readonly squid;
|
|
11
|
+
private readonly integrationId;
|
|
12
|
+
/**
|
|
13
|
+
* Creates a new JSM 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 JSM integration in the Squid console.
|
|
17
|
+
*/
|
|
18
|
+
constructor(squid: Squid, integrationId: string);
|
|
19
|
+
/**
|
|
20
|
+
* List available service desks.
|
|
21
|
+
*
|
|
22
|
+
* @returns Array of service desks with their ID, project key, and name.
|
|
23
|
+
*/
|
|
24
|
+
listServiceDesks(): Promise<Array<JsmServiceDeskResponse>>;
|
|
25
|
+
/**
|
|
26
|
+
* List request types available in a service desk.
|
|
27
|
+
*
|
|
28
|
+
* @param serviceDeskId - The service desk ID.
|
|
29
|
+
* @returns Array of request types with their ID, name, and description.
|
|
30
|
+
*/
|
|
31
|
+
listRequestTypes(serviceDeskId: string): Promise<Array<JsmRequestTypeResponse>>;
|
|
32
|
+
/**
|
|
33
|
+
* Search for JSM requests by text query.
|
|
34
|
+
*
|
|
35
|
+
* @param request - Search parameters.
|
|
36
|
+
* @returns Formatted string with matching requests.
|
|
37
|
+
*/
|
|
38
|
+
searchRequests(request: Omit<SearchJsmRequestsRequest, 'integrationId'>): Promise<string>;
|
|
39
|
+
/**
|
|
40
|
+
* Get detailed information about a specific JSM request.
|
|
41
|
+
*
|
|
42
|
+
* @param issueIdOrKey - The JSM request key or ID (e.g., "HELP-123").
|
|
43
|
+
* @param relatedRequestsMode - Whether to include related requests (default: 'RESOLVED').
|
|
44
|
+
* @returns Request details including request object, comments, and formatted details string.
|
|
45
|
+
*/
|
|
46
|
+
getRequest(issueIdOrKey: string, relatedRequestsMode?: RelatedRequestsMode): Promise<JsmRequestDetails>;
|
|
47
|
+
/**
|
|
48
|
+
* Create a new JSM request (support ticket).
|
|
49
|
+
*
|
|
50
|
+
* @param request - Create parameters including service desk, request type, and summary.
|
|
51
|
+
* @returns The created request information.
|
|
52
|
+
*/
|
|
53
|
+
createRequest(request: Omit<CreateJsmRequestRequest, 'integrationId'>): Promise<JsmRequestResponse>;
|
|
54
|
+
/**
|
|
55
|
+
* Update an existing JSM request.
|
|
56
|
+
*
|
|
57
|
+
* @param request - Update parameters including issue key and fields to update.
|
|
58
|
+
* @returns The updated request information.
|
|
59
|
+
*/
|
|
60
|
+
updateRequest(request: Omit<UpdateJsmRequestRequest, 'integrationId'>): Promise<JsmRequestResponse>;
|
|
61
|
+
/**
|
|
62
|
+
* Add a comment to a JSM request.
|
|
63
|
+
*
|
|
64
|
+
* @param issueIdOrKey - The JSM request key (e.g., "HELP-123").
|
|
65
|
+
* @param body - The comment text.
|
|
66
|
+
* @param isPublic - Whether the comment is public (visible to customer) or internal. Default: true.
|
|
67
|
+
* @returns The created comment ID.
|
|
68
|
+
*/
|
|
69
|
+
addComment(issueIdOrKey: string, body: string, isPublic?: boolean): Promise<{
|
|
70
|
+
commentId: string;
|
|
71
|
+
}>;
|
|
72
|
+
/**
|
|
73
|
+
* Transition a JSM request to a different status.
|
|
74
|
+
*
|
|
75
|
+
* @param issueIdOrKey - The JSM request key (e.g., "HELP-123").
|
|
76
|
+
* @param transitionId - The ID of the transition to apply.
|
|
77
|
+
*/
|
|
78
|
+
transitionRequest(issueIdOrKey: string, transitionId: string): Promise<void>;
|
|
79
|
+
/**
|
|
80
|
+
* List customers in a service desk.
|
|
81
|
+
*
|
|
82
|
+
* @param serviceDeskId - The service desk ID.
|
|
83
|
+
* @param query - Optional search query to filter customers.
|
|
84
|
+
* @param limit - Maximum number of customers to return.
|
|
85
|
+
* @returns Array of customers with their account ID, display name, and email.
|
|
86
|
+
*/
|
|
87
|
+
listCustomers(serviceDeskId: string, query?: string, limit?: number): Promise<Array<JsmCustomerResponse>>;
|
|
88
|
+
}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(()=>{"use strict";var e={d:(t,s)=>{for(var i in s)e.o(s,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:s[i]})},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:()=>s,RELATED_REQUESTS_MODE_ENUM:()=>i,SquidJiraJsmClient:()=>n});const s={1:"Highest",2:"High",3:"Medium",4:"Low",5:"Lowest"},i=["RESOLVED","ALL","NONE"];class n{constructor(e,t){this.squid=e,this.integrationId=t}async listServiceDesks(){const e={integrationId:this.integrationId};return this.squid.executeFunction("listJsmServiceDesksExecutable",e)}async listRequestTypes(e){const t={integrationId:this.integrationId,serviceDeskId:e};return this.squid.executeFunction("listJsmRequestTypesExecutable",t)}async searchRequests(e){const t={...e,integrationId:this.integrationId};return this.squid.executeFunction("searchJsmRequestsExecutable",t)}async getRequest(e,t){const s={integrationId:this.integrationId,issueIdOrKey:e,relatedRequestsMode:t};return this.squid.executeFunction("getJsmRequestDetailsExecutable",s)}async createRequest(e){const t={...e,integrationId:this.integrationId};return this.squid.executeFunction("createJsmRequestExecutable",t)}async updateRequest(e){const t={...e,integrationId:this.integrationId};return this.squid.executeFunction("updateJsmRequestExecutable",t)}async addComment(e,t,s=!0){const i={integrationId:this.integrationId,issueIdOrKey:e,body:t,public:s};return this.squid.executeFunction("addJsmCommentExecutable",i)}async transitionRequest(e,t){const s={integrationId:this.integrationId,issueIdOrKey:e,transitionId:t};return this.squid.executeFunction("transitionJsmRequestExecutable",s)}async listCustomers(e,t,s){const i={integrationId:this.integrationId,serviceDeskId:e,query:t,limit:s};return this.squid.executeFunction("listJsmCustomersExecutable",i)}}var r=exports;for(var u in t)r[u]=t[u];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,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@squidcloud/jira-jsm-client",
|
|
3
|
+
"version": "1.0.433",
|
|
4
|
+
"description": "Squid Jira Service Management Client - SDK for interacting with the JSM connector",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/jira-jsm-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
|
+
"jira-service-management",
|
|
20
|
+
"jsm",
|
|
21
|
+
"support-tickets",
|
|
22
|
+
"connector"
|
|
23
|
+
],
|
|
24
|
+
"author": "",
|
|
25
|
+
"license": "ISC",
|
|
26
|
+
"dependencies": {
|
|
27
|
+
"assertic": "^1.3.0",
|
|
28
|
+
"@squidcloud/client": "^1.0.433"
|
|
29
|
+
},
|
|
30
|
+
"engines": {
|
|
31
|
+
"node": ">=20.0.0"
|
|
32
|
+
}
|
|
33
|
+
}
|