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

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 = [];
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a="fixVersions";function e(t){return t.type==="paragraph"}function o(t){return t.type==="text"}exports.FIX_VERSIONS_FIELD=a;exports.isAtlassianDocumentFormatParagraphNode=e;exports.isAtlassianDocumentFormatTextNode=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="fixVersions";exports.FIX_VERSIONS_FIELD=e;
@@ -1,12 +1,4 @@
1
- const a = "fixVersions";
2
- function e(t) {
3
- return t.type === "paragraph";
4
- }
5
- function n(t) {
6
- return t.type === "text";
7
- }
1
+ const o = "fixVersions";
8
2
  export {
9
- a as FIX_VERSIONS_FIELD,
10
- e as isAtlassianDocumentFormatParagraphNode,
11
- n as isAtlassianDocumentFormatTextNode
3
+ o as FIX_VERSIONS_FIELD
12
4
  };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function c(n,t){var r,e;for(const o of n)if(o.text!==void 0&&o.text.includes(t)||(e=(r=o.attrs)==null?void 0:r.text)!=null&&e.includes(t)||o.content&&c(o.content,t))return!0;return!1}function a(n,t){return c(n.content,t)}function u(n,t,r){return n.map(e=>{var o;return e.text!==void 0?{...e,text:e.text.replaceAll(t,r)}:((o=e.attrs)==null?void 0:o.text)!==void 0?{...e,attrs:{...e.attrs,text:e.attrs.text.replaceAll(t,r)}}:e.content?{...e,content:u(e.content,t,r)}:e})}function f(n,t,r){return{...n,content:u(n.content,t,r)}}function i(n,t){const r={type:"text",text:t};return{...n,content:[...n.content,{type:"paragraph",content:[r]}]}}function p(n){return{type:"doc",version:1,content:[{type:"paragraph",content:[{type:"text",text:n}]}]}}exports.appendParagraph=i;exports.replaceInAdf=f;exports.searchAdf=a;exports.toAdfDoc=p;
@@ -0,0 +1,59 @@
1
+ function c(e, t) {
2
+ var r, n;
3
+ for (const o of e)
4
+ if (o.text !== void 0 && o.text.includes(t) || (n = (r = o.attrs) == null ? void 0 : r.text) != null && n.includes(t) || o.content && c(o.content, t))
5
+ return !0;
6
+ return !1;
7
+ }
8
+ function f(e, t) {
9
+ return c(e.content, t);
10
+ }
11
+ function u(e, t, r) {
12
+ return e.map((n) => {
13
+ var o;
14
+ return n.text !== void 0 ? { ...n, text: n.text.replaceAll(t, r) } : ((o = n.attrs) == null ? void 0 : o.text) !== void 0 ? {
15
+ ...n,
16
+ attrs: {
17
+ ...n.attrs,
18
+ text: n.attrs.text.replaceAll(t, r)
19
+ }
20
+ } : n.content ? {
21
+ ...n,
22
+ content: u(n.content, t, r)
23
+ } : n;
24
+ });
25
+ }
26
+ function i(e, t, r) {
27
+ return {
28
+ ...e,
29
+ content: u(e.content, t, r)
30
+ };
31
+ }
32
+ function a(e, t) {
33
+ const r = { type: "text", text: t };
34
+ return {
35
+ ...e,
36
+ content: [...e.content, { type: "paragraph", content: [r] }]
37
+ };
38
+ }
39
+ function p(e) {
40
+ return {
41
+ type: "doc",
42
+ version: 1,
43
+ content: [
44
+ {
45
+ type: "paragraph",
46
+ content: [{
47
+ type: "text",
48
+ text: e
49
+ }]
50
+ }
51
+ ]
52
+ };
53
+ }
54
+ export {
55
+ a as appendParagraph,
56
+ i as replaceInAdf,
57
+ f as searchAdf,
58
+ p as toAdfDoc
59
+ };
@@ -1,22 +1,46 @@
1
1
  import { WebTriggerRequest } from '@forge/api/out/webTrigger';
2
2
  import { WebTriggerResponse } from '@forge/api/out/webTrigger';
3
3
 
4
- declare interface AtlassianDocumentFormat {
4
+ /** Root document node */
5
+ declare interface AdfDoc {
5
6
  type: 'doc';
6
- version: number;
7
- content: AtlassianDocumentFormatNode[];
7
+ version: 1;
8
+ content: AdfNode[];
8
9
  }
9
10
 
10
- declare interface AtlassianDocumentFormatBlockNode {
11
+ /**
12
+ * TypeScript types for Atlassian Document Format (ADF)
13
+ * Conforms to https://unpkg.com/@atlaskit/adf-schema@52.4.0/dist/json-schema/v1/full.json
14
+ */
15
+ declare interface AdfMark {
11
16
  type: string;
12
- content: AtlassianDocumentFormatNode[];
17
+ attrs?: Record<string, unknown>;
13
18
  }
14
19
 
15
- declare interface AtlassianDocumentFormatInlineNode {
20
+ /**
21
+ * Base for all ADF nodes. `content` is optional because many block nodes
22
+ * (paragraph, heading, codeBlock, etc.) define it as optional in the schema.
23
+ * `text` is only populated on text nodes. `attrs` is present on most non-text
24
+ * nodes. `marks` is present on nodes that support formatting.
25
+ */
26
+ declare interface AdfNode {
16
27
  type: string;
28
+ text?: string;
29
+ attrs?: AdfNodeAttrs;
30
+ content?: AdfNode[];
31
+ marks?: AdfMark[];
17
32
  }
18
33
 
19
- declare type AtlassianDocumentFormatNode = AtlassianDocumentFormatInlineNode | AtlassianDocumentFormatBlockNode;
34
+ /**
35
+ * Attrs common across node types. Many inline node types (emoji, mention,
36
+ * status, placeholder, hardBreak, inlineExtension, extension, bodiedExtension)
37
+ * store their display text in `attrs.text`.
38
+ */
39
+ declare interface AdfNodeAttrs {
40
+ text?: string;
41
+ localId?: string;
42
+ [key: string]: unknown;
43
+ }
20
44
 
21
45
  declare interface AvatarUrls {
22
46
  '48x48': string;
@@ -43,7 +67,7 @@ declare interface FixVersion {
43
67
 
44
68
  declare type FixVersions = FixVersion[];
45
69
 
46
- declare interface Issue<T = AtlassianDocumentFormat> {
70
+ declare interface Issue<T = AdfDoc> {
47
71
  id: string;
48
72
  expand?: string;
49
73
  key: string;
@@ -52,7 +76,7 @@ declare interface Issue<T = AtlassianDocumentFormat> {
52
76
  renderedFields?: IssueFields<string>;
53
77
  }
54
78
 
55
- declare type IssueFields<T = AtlassianDocumentFormat> = CustomFields & StaticIssueFields<T>;
79
+ declare type IssueFields<T = AdfDoc> = CustomFields & StaticIssueFields<T>;
56
80
 
57
81
  declare interface IssueLink {
58
82
  id: string;
@@ -138,7 +162,7 @@ declare interface Project {
138
162
  lead?: User;
139
163
  }
140
164
 
141
- declare interface StaticIssueFields<T = AtlassianDocumentFormat> {
165
+ declare interface StaticIssueFields<T = AdfDoc> {
142
166
  statuscategorychangedate?: string;
143
167
  fixVersions?: FixVersions;
144
168
  resolution?: unknown;
@@ -244,8 +244,8 @@
244
244
  },
245
245
  {
246
246
  "kind": "Reference",
247
- "text": "AtlassianDocumentFormat",
248
- "canonicalReference": "@valiantys/atlassian-app!~AtlassianDocumentFormat:interface"
247
+ "text": "AdfDoc",
248
+ "canonicalReference": "@valiantys/atlassian-app!~AdfDoc:interface"
249
249
  },
250
250
  {
251
251
  "kind": "Content",
@@ -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)",
@@ -1150,8 +1228,8 @@
1150
1228
  },
1151
1229
  {
1152
1230
  "kind": "Reference",
1153
- "text": "AtlassianDocumentFormat",
1154
- "canonicalReference": "@valiantys/atlassian-app!~AtlassianDocumentFormat:interface"
1231
+ "text": "AdfDoc",
1232
+ "canonicalReference": "@valiantys/atlassian-app!~AdfDoc:interface"
1155
1233
  },
1156
1234
  {
1157
1235
  "kind": "Content",
@@ -1381,8 +1459,8 @@
1381
1459
  },
1382
1460
  {
1383
1461
  "kind": "Reference",
1384
- "text": "AtlassianDocumentFormat",
1385
- "canonicalReference": "@valiantys/atlassian-app!~AtlassianDocumentFormat:interface"
1462
+ "text": "AdfDoc",
1463
+ "canonicalReference": "@valiantys/atlassian-app!~AdfDoc:interface"
1386
1464
  },
1387
1465
  {
1388
1466
  "kind": "Content",
@@ -9,7 +9,7 @@ export class JiraIssueService {
9
9
  // Warning: (ae-forgotten-export) The symbol "AtlassianProductFetchService" needs to be exported by the entry point data-access-issue.d.ts
10
10
  constructor(fetchSvc: AtlassianProductFetchService<'jira'>);
11
11
  // (undocumented)
12
- addIssueComment(issueIdOrKey: string, body: AtlassianDocumentFormat): Promise<IssueComment>;
12
+ addIssueComment(issueIdOrKey: string, body: AdfDoc): Promise<IssueComment>;
13
13
  // Warning: (ae-forgotten-export) The symbol "WorklogCreateRequest" needs to be exported by the entry point data-access-issue.d.ts
14
14
  // Warning: (ae-forgotten-export) The symbol "Worklog" needs to be exported by the entry point data-access-issue.d.ts
15
15
  //
@@ -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)
@@ -66,10 +68,10 @@ export class JiraIssueService {
66
68
  startAt?: number;
67
69
  projectId?: string[];
68
70
  }): Promise<PagedResponseWithNextLink<IssueTypeSchemeForProjects>>;
69
- // Warning: (ae-forgotten-export) The symbol "AtlassianDocumentFormat" needs to be exported by the entry point data-access-issue.d.ts
71
+ // Warning: (ae-forgotten-export) The symbol "AdfDoc" needs to be exported by the entry point data-access-issue.d.ts
70
72
  //
71
73
  // (undocumented)
72
- issueSearch(jql: string, fields: string[], maxResults?: number): Promise<Issue<AtlassianDocumentFormat>[]>;
74
+ issueSearch(jql: string, fields: string[], maxResults?: number): Promise<Issue<AdfDoc>[]>;
73
75
  // (undocumented)
74
76
  issueSearchByPage(jql: string, fields: string[], nextPageToken?: string, maxResults?: number): Promise<{
75
77
  issues: Issue[];
@@ -78,7 +80,7 @@ export class JiraIssueService {
78
80
  // (undocumented)
79
81
  static readonly issueUrl = "/rest/api/3/issue";
80
82
  // (undocumented)
81
- queryForIssuesInProjects(projectIdsOrKeys: string[]): Promise<Issue<AtlassianDocumentFormat>[]>;
83
+ queryForIssuesInProjects(projectIdsOrKeys: string[]): Promise<Issue<AdfDoc>[]>;
82
84
  // Warning: (ae-forgotten-export) The symbol "TransitionIssueRequest" needs to be exported by the entry point data-access-issue.d.ts
83
85
  //
84
86
  // (undocumented)
@@ -1,21 +1,45 @@
1
- declare type APIResponse = Pick<Response, 'json' | 'text' | 'ok' | 'status' | 'statusText' | 'headers'>;
2
-
3
- declare interface AtlassianDocumentFormat {
1
+ /** Root document node */
2
+ declare interface AdfDoc {
4
3
  type: 'doc';
5
- version: number;
6
- content: AtlassianDocumentFormatNode[];
4
+ version: 1;
5
+ content: AdfNode[];
7
6
  }
8
7
 
9
- declare interface AtlassianDocumentFormatBlockNode {
8
+ /**
9
+ * TypeScript types for Atlassian Document Format (ADF)
10
+ * Conforms to https://unpkg.com/@atlaskit/adf-schema@52.4.0/dist/json-schema/v1/full.json
11
+ */
12
+ declare interface AdfMark {
10
13
  type: string;
11
- content: AtlassianDocumentFormatNode[];
14
+ attrs?: Record<string, unknown>;
12
15
  }
13
16
 
14
- declare interface AtlassianDocumentFormatInlineNode {
17
+ /**
18
+ * Base for all ADF nodes. `content` is optional because many block nodes
19
+ * (paragraph, heading, codeBlock, etc.) define it as optional in the schema.
20
+ * `text` is only populated on text nodes. `attrs` is present on most non-text
21
+ * nodes. `marks` is present on nodes that support formatting.
22
+ */
23
+ declare interface AdfNode {
15
24
  type: string;
25
+ text?: string;
26
+ attrs?: AdfNodeAttrs;
27
+ content?: AdfNode[];
28
+ marks?: AdfMark[];
29
+ }
30
+
31
+ /**
32
+ * Attrs common across node types. Many inline node types (emoji, mention,
33
+ * status, placeholder, hardBreak, inlineExtension, extension, bodiedExtension)
34
+ * store their display text in `attrs.text`.
35
+ */
36
+ declare interface AdfNodeAttrs {
37
+ text?: string;
38
+ localId?: string;
39
+ [key: string]: unknown;
16
40
  }
17
41
 
18
- declare type AtlassianDocumentFormatNode = AtlassianDocumentFormatInlineNode | AtlassianDocumentFormatBlockNode;
42
+ declare type APIResponse = Pick<Response, 'json' | 'text' | 'ok' | 'status' | 'statusText' | 'headers'>;
19
43
 
20
44
  declare interface AtlassianProductFetchService<P extends Product> {
21
45
  productType: P;
@@ -49,7 +73,7 @@ declare interface CreatedIssue {
49
73
  }
50
74
 
51
75
  declare interface CreateIssue {
52
- fields: IssueFields<AtlassianDocumentFormat | string>;
76
+ fields: IssueFields<AdfDoc | string>;
53
77
  properties?: {
54
78
  key: string;
55
79
  value: unknown;
@@ -115,7 +139,7 @@ declare interface HistoryMetadataParticipant {
115
139
  url: string;
116
140
  }
117
141
 
118
- declare interface Issue<T = AtlassianDocumentFormat> {
142
+ declare interface Issue<T = AdfDoc> {
119
143
  id: string;
120
144
  expand?: string;
121
145
  key: string;
@@ -126,7 +150,7 @@ declare interface Issue<T = AtlassianDocumentFormat> {
126
150
 
127
151
  declare type IssueComment = {
128
152
  author: User;
129
- body: AtlassianDocumentFormat;
153
+ body: AdfDoc;
130
154
  created: string;
131
155
  id: string;
132
156
  self: string;
@@ -135,7 +159,7 @@ declare type IssueComment = {
135
159
  visibility: Visibility;
136
160
  };
137
161
 
138
- declare type IssueFields<T = AtlassianDocumentFormat> = CustomFields & StaticIssueFields<T>;
162
+ declare type IssueFields<T = AdfDoc> = CustomFields & StaticIssueFields<T>;
139
163
 
140
164
  declare interface IssueLink {
141
165
  id: string;
@@ -161,7 +185,7 @@ declare interface IssueLinkRequest {
161
185
  key?: string;
162
186
  };
163
187
  comment?: {
164
- body: AtlassianDocumentFormat;
188
+ body: AdfDoc;
165
189
  };
166
190
  type: {
167
191
  id?: string;
@@ -236,18 +260,19 @@ export declare class JiraIssueService {
236
260
  getIssueField<T>(issueIdOrKey: string, field: string): Promise<T | undefined>;
237
261
  getIssueFields(issueIdOrKey: string, fields: string[]): Promise<IssueFields | undefined>;
238
262
  getIssue(issueIdOrKey: string, fields?: string[], rendered?: boolean): Promise<Issue | undefined>;
239
- issueSearch(jql: string, fields: string[], maxResults?: number): Promise<Issue<AtlassianDocumentFormat>[]>;
263
+ getBulkIssues(issueIdsOrKeys: string[], fields?: string[]): Promise<Issue[]>;
264
+ issueSearch(jql: string, fields: string[], maxResults?: number): Promise<Issue<AdfDoc>[]>;
240
265
  issueSearchByPage(jql: string, fields: string[], nextPageToken?: string, maxResults?: number): Promise<{
241
266
  issues: Issue[];
242
267
  nextPageToken?: string;
243
268
  }>;
244
269
  addWorklog(issueIdOrKey: string, worklog: WorklogCreateRequest): Promise<Worklog>;
245
- queryForIssuesInProjects(projectIdsOrKeys: string[]): Promise<Issue<AtlassianDocumentFormat>[]>;
270
+ queryForIssuesInProjects(projectIdsOrKeys: string[]): Promise<Issue<AdfDoc>[]>;
246
271
  createIssue(body: CreateIssue): Promise<CreatedIssue>;
247
272
  updateIssue(issueIdOrKey: string, body: UpdateIssue): Promise<void>;
248
273
  getIssueComments(issueIdOrKey: string, startAt?: number): Promise<JiraCommentResponse>;
249
274
  getIssueCommentById(issueIdOrKey: string, commentId: string): Promise<IssueComment>;
250
- addIssueComment(issueIdOrKey: string, body: AtlassianDocumentFormat): Promise<IssueComment>;
275
+ addIssueComment(issueIdOrKey: string, body: AdfDoc): Promise<IssueComment>;
251
276
  transitionIssue(issueIdOrKey: string, body: TransitionIssueRequest): Promise<void>;
252
277
  createIssueLink(issueLinkRequest: IssueLinkRequest): Promise<void>;
253
278
  getIssueTypes(): Promise<IssueTypeDetails[]>;
@@ -329,7 +354,7 @@ declare interface RemoteIssueLink {
329
354
 
330
355
  declare type RequestProductMethod = (url: FetchRoute, init: RequestInit) => Promise<APIResponse>;
331
356
 
332
- declare interface StaticIssueFields<T = AtlassianDocumentFormat> {
357
+ declare interface StaticIssueFields<T = AdfDoc> {
333
358
  statuscategorychangedate?: string;
334
359
  fixVersions?: FixVersions;
335
360
  resolution?: unknown;
@@ -398,7 +423,7 @@ declare interface TransitionIssueRequest {
398
423
  }
399
424
 
400
425
  declare interface UpdateIssue {
401
- fields?: IssueFields<AtlassianDocumentFormat | string>;
426
+ fields?: IssueFields<AdfDoc | string>;
402
427
  properties?: {
403
428
  key: string;
404
429
  value: unknown;
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-9",
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": {
@@ -198,6 +198,11 @@
198
198
  "require": "./util-jira-v3-api/index.cjs.js",
199
199
  "types": "./util-jira-v3-api/index.d.ts"
200
200
  },
201
+ "./util-adf": {
202
+ "import": "./util-adf/index.es.js",
203
+ "require": "./util-adf/index.cjs.js",
204
+ "types": "./util-adf/index.d.ts"
205
+ },
201
206
  "./backend-async-queue": {
202
207
  "import": "./backend-async-queue/index.es.js",
203
208
  "require": "./backend-async-queue/index.cjs.js",