forked from MrRefactoring/jira.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevelopmentInformation.ts
189 lines (176 loc) · 8.7 KB
/
developmentInformation.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
import * as Models from './models';
import * as Parameters from './parameters';
import { Client } from '../clients';
import { Callback } from '../callback';
import { RequestConfig } from '../requestConfig';
export class DevelopmentInformation {
constructor(private client: Client) {}
/**
* Stores development information provided in the request to make it available when viewing issues in Jira. Existing
* repository and entity data for the same ID will be replaced if the updateSequenceId of existing data is less than
* the incoming data. Submissions are performed asynchronously. Submitted data will eventually be available in Jira;
* most updates are available within a short period of time, but may take some time during peak load and/or
* maintenance times.
*/
async storeDevelopmentInformation<T = Models.StoreDevelopmentInformation>(
parameters: Parameters.StoreDevelopmentInformation,
callback: Callback<T>,
): Promise<void>;
/**
* Stores development information provided in the request to make it available when viewing issues in Jira. Existing
* repository and entity data for the same ID will be replaced if the updateSequenceId of existing data is less than
* the incoming data. Submissions are performed asynchronously. Submitted data will eventually be available in Jira;
* most updates are available within a short period of time, but may take some time during peak load and/or
* maintenance times.
*/
async storeDevelopmentInformation<T = Models.StoreDevelopmentInformation>(
parameters: Parameters.StoreDevelopmentInformation,
callback?: never,
): Promise<T>;
async storeDevelopmentInformation<T = Models.StoreDevelopmentInformation>(
parameters: Parameters.StoreDevelopmentInformation,
callback?: Callback<T>,
): Promise<void | T> {
const config: RequestConfig = {
url: '/rest/devinfo/0.10/bulk',
method: 'POST',
data: {
repositories: parameters.repositories,
preventTransitions: parameters.preventTransitions,
operationType: parameters.operationType,
properties: parameters.properties,
providerMetadata: parameters.providerMetadata,
},
};
return this.client.sendRequest(config, callback);
}
/**
* For the specified repository ID, retrieves the repository and the most recent 400 development information entities.
* The result will be what is currently stored, ignoring any pending updates or deletes.
*/
async getRepository<T = Models.GetRepository>(
parameters: Parameters.GetRepository,
callback: Callback<T>,
): Promise<void>;
/**
* For the specified repository ID, retrieves the repository and the most recent 400 development information entities.
* The result will be what is currently stored, ignoring any pending updates or deletes.
*/
async getRepository<T = Models.GetRepository>(parameters: Parameters.GetRepository, callback?: never): Promise<T>;
async getRepository<T = Models.GetRepository>(
parameters: Parameters.GetRepository,
callback?: Callback<T>,
): Promise<void | T> {
const config: RequestConfig = {
url: `/rest/devinfo/0.10/repository/${parameters.repositoryId}`,
method: 'GET',
};
return this.client.sendRequest(config, callback);
}
/**
* Deletes the repository data stored by the given ID and all related development information entities. Deletion is
* performed asynchronously.
*/
async deleteRepository<T = unknown>(parameters: Parameters.DeleteRepository, callback: Callback<T>): Promise<void>;
/**
* Deletes the repository data stored by the given ID and all related development information entities. Deletion is
* performed asynchronously.
*/
async deleteRepository<T = unknown>(parameters: Parameters.DeleteRepository, callback?: never): Promise<T>;
async deleteRepository<T = unknown>(
parameters: Parameters.DeleteRepository,
callback?: Callback<T>,
): Promise<void | T> {
const config: RequestConfig = {
url: `/rest/devinfo/0.10/repository/${parameters.repositoryId}`,
method: 'DELETE',
params: {
_updateSequenceId: parameters.updateSequenceId,
},
};
return this.client.sendRequest(config, callback);
}
/**
* Deletes development information entities which have all the provided properties. Repositories which have properties
* that match ALL of the properties (i.e. treated as an AND), and all their related development information (such as
* commits, branches and pull requests), will be deleted. For example if request is `DELETE
* bulk?accountId=123&projectId=ABC` entities which have properties `accountId=123` and `projectId=ABC` will be
* deleted. Optional param `_updateSequenceId` is no longer supported. Deletion is performed asynchronously: specified
* entities will eventually be removed from Jira.
*/
async deleteByProperties<T = unknown>(
parameters: Parameters.DeleteByProperties,
callback: Callback<T>,
): Promise<void>;
/**
* Deletes development information entities which have all the provided properties. Repositories which have properties
* that match ALL of the properties (i.e. treated as an AND), and all their related development information (such as
* commits, branches and pull requests), will be deleted. For example if request is `DELETE
* bulk?accountId=123&projectId=ABC` entities which have properties `accountId=123` and `projectId=ABC` will be
* deleted. Optional param `_updateSequenceId` is no longer supported. Deletion is performed asynchronously: specified
* entities will eventually be removed from Jira.
*/
async deleteByProperties<T = unknown>(parameters: Parameters.DeleteByProperties, callback?: never): Promise<T>;
async deleteByProperties<T = unknown>(
parameters: Parameters.DeleteByProperties,
callback?: Callback<T>,
): Promise<void | T> {
const config: RequestConfig = {
url: '/rest/devinfo/0.10/bulkByProperties',
method: 'DELETE',
params: {
_updateSequenceId: parameters.updateSequenceId,
},
};
return this.client.sendRequest(config, callback);
}
/**
* Checks if repositories which have all the provided properties exists. For example, if request is `GET
* existsByProperties?accountId=123&projectId=ABC` then result will be positive only if there is at least one
* repository with both properties `accountId=123` and `projectId=ABC`. Special property `_updateSequenceId` can be
* used to filter all entities with updateSequenceId less or equal than the value specified. In addition to the
* optional `_updateSequenceId`, one or more query params must be supplied to specify properties to search by.
*/
async existsByProperties<T = Models.ExistsByProperties>(
parameters: Parameters.ExistsByProperties,
callback: Callback<T>,
): Promise<void>;
/**
* Checks if repositories which have all the provided properties exists. For example, if request is `GET
* existsByProperties?accountId=123&projectId=ABC` then result will be positive only if there is at least one
* repository with both properties `accountId=123` and `projectId=ABC`. Special property `_updateSequenceId` can be
* used to filter all entities with updateSequenceId less or equal than the value specified. In addition to the
* optional `_updateSequenceId`, one or more query params must be supplied to specify properties to search by.
*/
async existsByProperties<T = Models.ExistsByProperties>(
parameters: Parameters.ExistsByProperties,
callback?: never,
): Promise<T>;
async existsByProperties<T = Models.ExistsByProperties>(
parameters: Parameters.ExistsByProperties,
callback?: Callback<T>,
): Promise<void | T> {
const config: RequestConfig = {
url: '/rest/devinfo/0.10/existsByProperties',
method: 'GET',
params: {
_updateSequenceId: parameters.updateSequenceId,
},
};
return this.client.sendRequest(config, callback);
}
/** Deletes particular development information entity. Deletion is performed asynchronously. */
async deleteEntity<T = unknown>(parameters: Parameters.DeleteEntity, callback: Callback<T>): Promise<void>;
/** Deletes particular development information entity. Deletion is performed asynchronously. */
async deleteEntity<T = unknown>(parameters: Parameters.DeleteEntity, callback?: never): Promise<T>;
async deleteEntity<T = unknown>(parameters: Parameters.DeleteEntity, callback?: Callback<T>): Promise<void | T> {
const config: RequestConfig = {
url: `/rest/devinfo/0.10/repository/${parameters.repositoryId}/${parameters.entityType}/${parameters.entityId}`,
method: 'DELETE',
params: {
_updateSequenceId: parameters.updateSequenceId,
},
};
return this.client.sendRequest(config, callback);
}
}