@valiantys/atlassian-app 3.2.0-alpha-7 → 3.2.0-alpha-8

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=class a{constructor(e){this.fetchSvc=e}async updateProperty(e,t,s){return this.fetchSvc.fetch({method:"PUT",url:this.fetchSvc.route`/rest/api/3/issue/${e}/properties/${t}`},s)}async updateField(e,t,s){await this.updateFields(e,{[t]:s})}async updateFields(e,t){await this.updateIssue(e,{fields:t})}async getIssueField(e,t){var s;return(s=await this.getIssueFields(e,[t]))==null?void 0:s[t]}async getIssueFields(e,t){return(await this.fetchSvc.fetch({method:"GET",url:this.fetchSvc.route`/rest/api/3/issue/${e}?fields=${t.join(",")}`})).fields}async getIssue(e,t=["*all"],s=!1){return this.fetchSvc.fetch({method:"GET",url:this.fetchSvc.route`/rest/api/3/issue/${e}?fields=${t.join(",")}&expand=${s?"renderedFields":""}`})}async issueSearch(e,t,s=50){let c;const r=[];do{const h=await this.issueSearchByPage(e,t,c,s);r.push(...h.issues),c=h.nextPageToken}while(c!==void 0);return r}async issueSearchByPage(e,t,s,c=50){return this.fetchSvc.fetch({method:"POST",url:this.fetchSvc.route`/rest/api/3/search/jql`},{fields:t,jql:e,maxResults:c,nextPageToken:s})}async addWorklog(e,t){return this.fetchSvc.fetch({method:"POST",url:this.fetchSvc.route`/rest/api/3/issue/${e}/worklog`},t)}async queryForIssuesInProjects(e){const t=`project IN (${e.join(",")})`;return this.issueSearch(t,["key","project"],5e3)}async createIssue(e){return this.fetchSvc.fetch({method:"POST",url:this.fetchSvc.route`/rest/api/3/issue`},e)}async updateIssue(e,t){return this.fetchSvc.fetch({method:"PUT",url:this.fetchSvc.route`/rest/api/3/issue/${e}`},t)}async getIssueComments(e,t=0){const s=t?`?startAt=${t}`:"";return this.fetchSvc.fetch({method:"GET",url:this.fetchSvc.route`/rest/api/3/issue/${e}/comment${s}`})}async getIssueCommentById(e,t){return this.fetchSvc.fetch({method:"GET",url:this.fetchSvc.route`/rest/api/3/issue/${e}/comment/${t}`})}async addIssueComment(e,t){return this.fetchSvc.fetch({method:"POST",url:this.fetchSvc.route`/rest/api/3/issue/${e}/comment`},{body:t})}async transitionIssue(e,t){return this.fetchSvc.fetch({method:"POST",url:this.fetchSvc.route`/rest/api/3/issue/${e}/transitions`},t)}async createIssueLink(e){return this.fetchSvc.fetch({method:"POST",url:this.fetchSvc.route`/rest/api/3/issueLink`},e)}async getIssueTypes(){return this.fetchSvc.fetch({method:"GET",url:this.fetchSvc.route`/rest/api/3/issuetype`})}async getIssueTypeSchemes({maxResults:e,orderBy:t,startAt:s,expand:c,id:r,queryString:h}={}){const i=new URLSearchParams;return c&&i.append("expand",c),e&&i.append("maxResults",e.toString()),t&&i.append("orderBy",t),s&&i.append("startAt",s.toString()),r&&r.forEach(n=>i.append("id",n)),h&&i.append("queryString",h),this.fetchSvc.fetch({method:"GET",url:this.fetchSvc.route`/rest/api/3/issuetypescheme?${i}`})}async getIssueTypeSchemesForProject({maxResults:e,startAt:t,projectId:s}={}){const c=new URLSearchParams;return e&&c.append("maxResults",e.toString()),t&&c.append("startAt",t.toString()),s&&s.forEach(r=>c.append("projectId",r)),this.fetchSvc.fetch({method:"GET",url:this.fetchSvc.route`/rest/api/3/issuetypescheme/project?${c}`})}};a.issueUrl="/rest/api/3/issue";let u=a;exports.JiraIssueService=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=class a{constructor(e){this.fetchSvc=e}async updateProperty(e,t,s){return this.fetchSvc.fetch({method:"PUT",url:this.fetchSvc.route`/rest/api/3/issue/${e}/properties/${t}`},s)}async updateField(e,t,s){await this.updateFields(e,{[t]:s})}async updateFields(e,t){await this.updateIssue(e,{fields:t})}async getIssueField(e,t){var s;return(s=await this.getIssueFields(e,[t]))==null?void 0:s[t]}async getIssueFields(e,t){return(await this.fetchSvc.fetch({method:"GET",url:this.fetchSvc.route`/rest/api/3/issue/${e}?fields=${t.join(",")}`})).fields}async getIssue(e,t=["*all"],s=!1){return this.fetchSvc.fetch({method:"GET",url:this.fetchSvc.route`/rest/api/3/issue/${e}?fields=${t.join(",")}&expand=${s?"renderedFields":""}`})}async getBulkIssues(e,t=["*all"]){return(await this.fetchSvc.fetch({method:"POST",url:this.fetchSvc.route`/rest/api/3/issue/bulkfetch`},{issueIdsOrKeys:e,fields:t})).issues}async issueSearch(e,t,s=50){let c;const r=[];do{const h=await this.issueSearchByPage(e,t,c,s);r.push(...h.issues),c=h.nextPageToken}while(c!==void 0);return r}async issueSearchByPage(e,t,s,c=50){return this.fetchSvc.fetch({method:"POST",url:this.fetchSvc.route`/rest/api/3/search/jql`},{fields:t,jql:e,maxResults:c,nextPageToken:s})}async addWorklog(e,t){return this.fetchSvc.fetch({method:"POST",url:this.fetchSvc.route`/rest/api/3/issue/${e}/worklog`},t)}async queryForIssuesInProjects(e){const t=`project IN (${e.join(",")})`;return this.issueSearch(t,["key","project"],5e3)}async createIssue(e){return this.fetchSvc.fetch({method:"POST",url:this.fetchSvc.route`/rest/api/3/issue`},e)}async updateIssue(e,t){return this.fetchSvc.fetch({method:"PUT",url:this.fetchSvc.route`/rest/api/3/issue/${e}`},t)}async getIssueComments(e,t=0){const s=t?`?startAt=${t}`:"";return this.fetchSvc.fetch({method:"GET",url:this.fetchSvc.route`/rest/api/3/issue/${e}/comment${s}`})}async getIssueCommentById(e,t){return this.fetchSvc.fetch({method:"GET",url:this.fetchSvc.route`/rest/api/3/issue/${e}/comment/${t}`})}async addIssueComment(e,t){return this.fetchSvc.fetch({method:"POST",url:this.fetchSvc.route`/rest/api/3/issue/${e}/comment`},{body:t})}async transitionIssue(e,t){return this.fetchSvc.fetch({method:"POST",url:this.fetchSvc.route`/rest/api/3/issue/${e}/transitions`},t)}async createIssueLink(e){return this.fetchSvc.fetch({method:"POST",url:this.fetchSvc.route`/rest/api/3/issueLink`},e)}async getIssueTypes(){return this.fetchSvc.fetch({method:"GET",url:this.fetchSvc.route`/rest/api/3/issuetype`})}async getIssueTypeSchemes({maxResults:e,orderBy:t,startAt:s,expand:c,id:r,queryString:h}={}){const i=new URLSearchParams;return c&&i.append("expand",c),e&&i.append("maxResults",e.toString()),t&&i.append("orderBy",t),s&&i.append("startAt",s.toString()),r&&r.forEach(n=>i.append("id",n)),h&&i.append("queryString",h),this.fetchSvc.fetch({method:"GET",url:this.fetchSvc.route`/rest/api/3/issuetypescheme?${i}`})}async getIssueTypeSchemesForProject({maxResults:e,startAt:t,projectId:s}={}){const c=new URLSearchParams;return e&&c.append("maxResults",e.toString()),t&&c.append("startAt",t.toString()),s&&s.forEach(r=>c.append("projectId",r)),this.fetchSvc.fetch({method:"GET",url:this.fetchSvc.route`/rest/api/3/issuetypescheme/project?${c}`})}};a.issueUrl="/rest/api/3/issue";let u=a;exports.JiraIssueService=u;
@@ -33,6 +33,15 @@ const u = class u {
33
33
  url: this.fetchSvc.route`/rest/api/3/issue/${e}?fields=${t.join(",")}&expand=${s ? "renderedFields" : ""}`
34
34
  });
35
35
  }
36
+ async getBulkIssues(e, t = ["*all"]) {
37
+ return (await this.fetchSvc.fetch(
38
+ {
39
+ method: "POST",
40
+ url: this.fetchSvc.route`/rest/api/3/issue/bulkfetch`
41
+ },
42
+ { issueIdsOrKeys: e, fields: t }
43
+ )).issues;
44
+ }
36
45
  async issueSearch(e, t, s = 50) {
37
46
  let c;
38
47
  const r = [];
@@ -500,6 +500,84 @@
500
500
  "isAbstract": false,
501
501
  "name": "createIssueLink"
502
502
  },
503
+ {
504
+ "kind": "Method",
505
+ "canonicalReference": "@valiantys/atlassian-app!JiraIssueService#getBulkIssues:member(1)",
506
+ "docComment": "",
507
+ "excerptTokens": [
508
+ {
509
+ "kind": "Content",
510
+ "text": "getBulkIssues(issueIdsOrKeys: "
511
+ },
512
+ {
513
+ "kind": "Content",
514
+ "text": "string[]"
515
+ },
516
+ {
517
+ "kind": "Content",
518
+ "text": ", fields?: "
519
+ },
520
+ {
521
+ "kind": "Content",
522
+ "text": "string[]"
523
+ },
524
+ {
525
+ "kind": "Content",
526
+ "text": "): "
527
+ },
528
+ {
529
+ "kind": "Reference",
530
+ "text": "Promise",
531
+ "canonicalReference": "!Promise:interface"
532
+ },
533
+ {
534
+ "kind": "Content",
535
+ "text": "<"
536
+ },
537
+ {
538
+ "kind": "Reference",
539
+ "text": "Issue",
540
+ "canonicalReference": "@valiantys/atlassian-app!~Issue:interface"
541
+ },
542
+ {
543
+ "kind": "Content",
544
+ "text": "[]>"
545
+ },
546
+ {
547
+ "kind": "Content",
548
+ "text": ";"
549
+ }
550
+ ],
551
+ "isStatic": false,
552
+ "returnTypeTokenRange": {
553
+ "startIndex": 5,
554
+ "endIndex": 9
555
+ },
556
+ "releaseTag": "Public",
557
+ "isProtected": false,
558
+ "overloadIndex": 1,
559
+ "parameters": [
560
+ {
561
+ "parameterName": "issueIdsOrKeys",
562
+ "parameterTypeTokenRange": {
563
+ "startIndex": 1,
564
+ "endIndex": 2
565
+ },
566
+ "isOptional": false
567
+ },
568
+ {
569
+ "parameterName": "fields",
570
+ "parameterTypeTokenRange": {
571
+ "startIndex": 3,
572
+ "endIndex": 4
573
+ },
574
+ "isOptional": true
575
+ }
576
+ ],
577
+ "isOptional": false,
578
+ "isAbstract": false,
579
+ "name": "getBulkIssues"
580
+ },
503
581
  {
504
582
  "kind": "Method",
505
583
  "canonicalReference": "@valiantys/atlassian-app!JiraIssueService#getIssue:member(1)",
@@ -24,6 +24,8 @@ export class JiraIssueService {
24
24
  //
25
25
  // (undocumented)
26
26
  createIssueLink(issueLinkRequest: IssueLinkRequest): Promise<void>;
27
+ // (undocumented)
28
+ getBulkIssues(issueIdsOrKeys: string[], fields?: string[]): Promise<Issue[]>;
27
29
  // Warning: (ae-forgotten-export) The symbol "Issue" needs to be exported by the entry point data-access-issue.d.ts
28
30
  //
29
31
  // (undocumented)
@@ -236,6 +236,7 @@ export declare class JiraIssueService {
236
236
  getIssueField<T>(issueIdOrKey: string, field: string): Promise<T | undefined>;
237
237
  getIssueFields(issueIdOrKey: string, fields: string[]): Promise<IssueFields | undefined>;
238
238
  getIssue(issueIdOrKey: string, fields?: string[], rendered?: boolean): Promise<Issue | undefined>;
239
+ getBulkIssues(issueIdsOrKeys: string[], fields?: string[]): Promise<Issue[]>;
239
240
  issueSearch(jql: string, fields: string[], maxResults?: number): Promise<Issue<AtlassianDocumentFormat>[]>;
240
241
  issueSearchByPage(jql: string, fields: string[], nextPageToken?: string, maxResults?: number): Promise<{
241
242
  issues: Issue[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@valiantys/atlassian-app",
3
- "version": "3.2.0-alpha-7",
3
+ "version": "3.2.0-alpha-8",
4
4
  "description": "This library provides Atlassian Forge components, wrappers, and utilities to support writing Forge apps that can run deployed or in standalone mode",
5
5
  "exports": {
6
6
  "./frontend-app": {
@@ -2308,6 +2308,32 @@
2308
2308
  ],
2309
2309
  "extendsTokenRanges": []
2310
2310
  },
2311
+ {
2312
+ "kind": "TypeAlias",
2313
+ "canonicalReference": "@valiantys/atlassian-app!IssueAssetFieldValue:type",
2314
+ "docComment": "",
2315
+ "excerptTokens": [
2316
+ {
2317
+ "kind": "Content",
2318
+ "text": "export type IssueAssetFieldValue = "
2319
+ },
2320
+ {
2321
+ "kind": "Content",
2322
+ "text": "{\n workspaceId: string;\n id: string;\n objectId: string;\n}[]"
2323
+ },
2324
+ {
2325
+ "kind": "Content",
2326
+ "text": ";"
2327
+ }
2328
+ ],
2329
+ "fileUrlPath": "../../jira/shared/util-jira-v3-api/src/lib/issue.d.ts",
2330
+ "releaseTag": "Public",
2331
+ "name": "IssueAssetFieldValue",
2332
+ "typeTokenRange": {
2333
+ "startIndex": 1,
2334
+ "endIndex": 2
2335
+ }
2336
+ },
2311
2337
  {
2312
2338
  "kind": "TypeAlias",
2313
2339
  "canonicalReference": "@valiantys/atlassian-app!IssueComment:type",
@@ -204,6 +204,13 @@ export interface Issue<T = AtlassianDocumentFormat> {
204
204
  self?: string;
205
205
  }
206
206
 
207
+ // @public (undocumented)
208
+ export type IssueAssetFieldValue = {
209
+ workspaceId: string;
210
+ id: string;
211
+ objectId: string;
212
+ }[];
213
+
207
214
  // @public (undocumented)
208
215
  export type IssueComment = {
209
216
  author: User;
@@ -121,6 +121,12 @@ export declare interface Issue<T = AtlassianDocumentFormat> {
121
121
  renderedFields?: IssueFields<string>;
122
122
  }
123
123
 
124
+ export declare type IssueAssetFieldValue = {
125
+ workspaceId: string;
126
+ id: string;
127
+ objectId: string;
128
+ }[];
129
+
124
130
  export declare type IssueComment = {
125
131
  author: User;
126
132
  body: AtlassianDocumentFormat;