|
1 | | -import type * as Models from './models'; |
2 | | -import type * as Parameters from './parameters'; |
3 | | -import type { Client } from '../clients'; |
4 | | -import type { Callback } from '../callback'; |
| 1 | +import type { Client } from '../client'; |
5 | 2 | import type { Request } from '../request'; |
| 3 | +import type { UpdateIssueFieldsParameters } from './parameters/updateIssueFieldsParameters'; |
| 4 | +import type { UpdateEntityPropertiesValueParameters } from './parameters/updateEntityPropertiesValueParameters'; |
| 5 | +import type { WorkflowRuleSearchParameters } from './parameters/workflowRuleSearchParameters'; |
6 | 6 |
|
7 | 7 | export class AppMigration { |
8 | 8 | constructor(private client: Client) {} |
9 | | - |
10 | | - /** |
11 | | - * Updates the value of a custom field added by Connect apps on one or more issues. The values of up to 200 custom |
12 | | - * fields can be updated. |
13 | | - * |
14 | | - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only |
15 | | - * Connect apps can make this request |
16 | | - */ |
17 | | - async updateIssueFields<T = unknown>(parameters: Parameters.UpdateIssueFields, callback: Callback<T>): Promise<void>; |
18 | 9 | /** |
19 | | - * Updates the value of a custom field added by Connect apps on one or more issues. The values of up to 200 custom |
20 | | - * fields can be updated. |
| 10 | + * Updates the value of a custom field added by Connect apps on one or more issues. |
21 | 11 | * |
22 | | - * **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only |
23 | | - * Connect apps can make this request |
| 12 | + * - The values of up to 200 custom fields can be updated. |
| 13 | + * - |
| 14 | + * - **[Permissions](https://developer.atlassian.com/cloud/jira/platform/rest/v2/intro/#permissions) required:** Only |
| 15 | + * Connect apps can make this request |
24 | 16 | */ |
25 | | - async updateIssueFields<T = unknown>(parameters: Parameters.UpdateIssueFields, callback?: never): Promise<T>; |
26 | | - async updateIssueFields<T = unknown>(parameters: Parameters.UpdateIssueFields): Promise<void | T> { |
27 | | - const config: Request = { |
| 17 | + async updateIssueFields(parameters: UpdateIssueFieldsParameters) { |
| 18 | + const request: Request = { |
28 | 19 | url: '/rest/atlassian-connect/1/migration/field', |
29 | 20 | method: 'PUT', |
30 | | - headers: { |
31 | | - 'Atlassian-Account-Id': parameters.accountId, |
32 | | - 'Atlassian-Transfer-Id': parameters.transferId, |
33 | | - }, |
34 | 21 | body: { |
35 | 22 | updateValueList: parameters.updateValueList, |
36 | 23 | }, |
37 | 24 | }; |
38 | 25 |
|
39 | | - return this.client.sendRequest(config); |
| 26 | + return this.client.sendRequest(request); |
40 | 27 | } |
41 | 28 |
|
42 | 29 | /** |
43 | 30 | * Updates the values of multiple entity properties for an object, up to 50 updates per request. This operation is for |
44 | 31 | * use by Connect apps during app migration. |
45 | 32 | */ |
46 | | - async updateEntityPropertiesValue<T = unknown>( |
47 | | - parameters: Parameters.UpdateEntityPropertiesValue, |
48 | | - callback: Callback<T>, |
49 | | - ): Promise<void>; |
50 | | - /** |
51 | | - * Updates the values of multiple entity properties for an object, up to 50 updates per request. This operation is for |
52 | | - * use by Connect apps during app migration. |
53 | | - */ |
54 | | - async updateEntityPropertiesValue<T = unknown>( |
55 | | - parameters: Parameters.UpdateEntityPropertiesValue, |
56 | | - callback?: never, |
57 | | - ): Promise<T>; |
58 | | - async updateEntityPropertiesValue<T = unknown>( |
59 | | - parameters: Parameters.UpdateEntityPropertiesValue, |
60 | | - ): Promise<void | T> { |
61 | | - const config: Request = { |
| 33 | + async updateEntityPropertiesValue(parameters: UpdateEntityPropertiesValueParameters) { |
| 34 | + const request: Request = { |
62 | 35 | url: `/rest/atlassian-connect/1/migration/properties/${parameters.entityType}`, |
63 | 36 | method: 'PUT', |
64 | | - headers: { |
65 | | - 'Atlassian-Account-Id': parameters.accountId, |
66 | | - 'Atlassian-Transfer-Id': parameters.transferId, |
67 | | - 'Content-Type': 'application/json', |
68 | | - }, |
69 | | - body: parameters.entities, |
70 | 37 | }; |
71 | 38 |
|
72 | | - return this.client.sendRequest(config); |
| 39 | + return this.client.sendRequest(request); |
73 | 40 | } |
74 | 41 |
|
75 | 42 | /** |
76 | 43 | * Returns configurations for workflow transition rules migrated from server to cloud and owned by the calling Connect |
77 | 44 | * app. |
78 | 45 | */ |
79 | | - async workflowRuleSearch<T = Models.WorkflowRulesSearchDetails>( |
80 | | - parameters: Parameters.WorkflowRuleSearch, |
81 | | - callback: Callback<T>, |
82 | | - ): Promise<void>; |
83 | | - /** |
84 | | - * Returns configurations for workflow transition rules migrated from server to cloud and owned by the calling Connect |
85 | | - * app. |
86 | | - */ |
87 | | - async workflowRuleSearch<T = Models.WorkflowRulesSearchDetails>( |
88 | | - parameters: Parameters.WorkflowRuleSearch, |
89 | | - callback?: never, |
90 | | - ): Promise<T>; |
91 | | - async workflowRuleSearch<T = Models.WorkflowRulesSearchDetails>( |
92 | | - parameters: Parameters.WorkflowRuleSearch, |
93 | | - ): Promise<void | T> { |
94 | | - const config: Request = { |
| 46 | + async workflowRuleSearch(parameters: WorkflowRuleSearchParameters) { |
| 47 | + const request: Request = { |
95 | 48 | url: '/rest/atlassian-connect/1/migration/workflow/rule/search', |
96 | 49 | method: 'POST', |
97 | | - headers: { |
98 | | - 'Atlassian-Transfer-Id': parameters.transferId, |
99 | | - }, |
100 | 50 | body: { |
101 | 51 | expand: parameters.expand, |
102 | 52 | ruleIds: parameters.ruleIds, |
103 | 53 | workflowEntityId: parameters.workflowEntityId, |
104 | 54 | }, |
105 | 55 | }; |
106 | 56 |
|
107 | | - return this.client.sendRequest(config); |
| 57 | + return this.client.sendRequest(request); |
108 | 58 | } |
109 | 59 | } |
0 commit comments