@devrev/typescript-sdk 1.1.3 → 1.1.4

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.
@@ -0,0 +1,784 @@
1
+ "use strict";
2
+ /* eslint-disable */
3
+ /* tslint:disable */
4
+ /*
5
+ * ---------------------------------------------------------------
6
+ * ## THIS FILE WAS GENERATED VIA SWAGGER-TYPESCRIPT-API ##
7
+ * ## ##
8
+ * ## AUTHOR: acacode ##
9
+ * ## SOURCE: https://github.com/acacode/swagger-typescript-api ##
10
+ * ---------------------------------------------------------------
11
+ */
12
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
+ return new (P || (P = Promise))(function (resolve, reject) {
15
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
19
+ });
20
+ };
21
+ var __rest = (this && this.__rest) || function (s, e) {
22
+ var t = {};
23
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
24
+ t[p] = s[p];
25
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
26
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
27
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
28
+ t[p[i]] = s[p[i]];
29
+ }
30
+ return t;
31
+ };
32
+ var __importDefault = (this && this.__importDefault) || function (mod) {
33
+ return (mod && mod.__esModule) ? mod : { "default": mod };
34
+ };
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.Api = exports.HttpClient = exports.ContentType = exports.WorkType = exports.WebhooksUpdateAction = exports.WebhookStatus = exports.WebhookEventType = exports.UserType = exports.UserState = exports.TimelineEntryVisibility = exports.TimelineEntryType = exports.TimelineEntriesUpdateRequestType = exports.TimelineEntriesCreateRequestType = exports.TimelineCommentBodyType = exports.TicketSeverity = exports.PartType = exports.OrgType = exports.OrgEnvironment = exports.ListMode = exports.IssuePriority = exports.ErrorUnauthorizedType = exports.ErrorTooManyRequestsType = exports.ErrorServiceUnavailableType = exports.ErrorNotFoundType = exports.ErrorInternalServerErrorType = exports.ErrorForbiddenType = exports.ErrorBadRequestType = exports.DevOrgAuthConnectionsUpdateRequestType = exports.DevOrgAuthConnectionsCreateRequestType = exports.AuthTokenTokenType = exports.AuthTokenSubjectTokenType = exports.AuthTokenStatus = exports.AuthTokenRequestedTokenType = exports.AuthTokenGrantType = exports.AuthConnectionType = exports.AuthConnectionToggle = void 0;
37
+ var AuthConnectionToggle;
38
+ (function (AuthConnectionToggle) {
39
+ AuthConnectionToggle["Disable"] = "disable";
40
+ AuthConnectionToggle["Enable"] = "enable";
41
+ })(AuthConnectionToggle = exports.AuthConnectionToggle || (exports.AuthConnectionToggle = {}));
42
+ /**
43
+ * Defines the type for the authentication connection. The configuration
44
+ * for each authentication connection will depend on the type value.
45
+ */
46
+ var AuthConnectionType;
47
+ (function (AuthConnectionType) {
48
+ AuthConnectionType["GoogleApps"] = "google_apps";
49
+ AuthConnectionType["Oidc"] = "oidc";
50
+ AuthConnectionType["Samlp"] = "samlp";
51
+ AuthConnectionType["Social"] = "social";
52
+ AuthConnectionType["Waad"] = "waad";
53
+ })(AuthConnectionType = exports.AuthConnectionType || (exports.AuthConnectionType = {}));
54
+ /** Specifies the process of obtaining a token. */
55
+ var AuthTokenGrantType;
56
+ (function (AuthTokenGrantType) {
57
+ AuthTokenGrantType["UrnDevrevParamsOauthGrantTypeTokenIssue"] = "urn:devrev:params:oauth:grant-type:token-issue";
58
+ AuthTokenGrantType["UrnIetfParamsOauthGrantTypeTokenExchange"] = "urn:ietf:params:oauth:grant-type:token-exchange";
59
+ })(AuthTokenGrantType = exports.AuthTokenGrantType || (exports.AuthTokenGrantType = {}));
60
+ /** The type of the requested token. */
61
+ var AuthTokenRequestedTokenType;
62
+ (function (AuthTokenRequestedTokenType) {
63
+ AuthTokenRequestedTokenType["UrnDevrevParamsOauthTokenTypeAat"] = "urn:devrev:params:oauth:token-type:aat";
64
+ AuthTokenRequestedTokenType["UrnDevrevParamsOauthTokenTypeAatPublic"] = "urn:devrev:params:oauth:token-type:aat:public";
65
+ AuthTokenRequestedTokenType["UrnDevrevParamsOauthTokenTypeDev"] = "urn:devrev:params:oauth:token-type:dev";
66
+ AuthTokenRequestedTokenType["UrnDevrevParamsOauthTokenTypePat"] = "urn:devrev:params:oauth:token-type:pat";
67
+ AuthTokenRequestedTokenType["UrnDevrevParamsOauthTokenTypeRev"] = "urn:devrev:params:oauth:token-type:rev";
68
+ AuthTokenRequestedTokenType["UrnDevrevParamsOauthTokenTypeSession"] = "urn:devrev:params:oauth:token-type:session";
69
+ AuthTokenRequestedTokenType["UrnDevrevParamsOauthTokenTypeSessionDev0"] = "urn:devrev:params:oauth:token-type:session:dev0";
70
+ AuthTokenRequestedTokenType["UrnDevrevParamsOauthTokenTypeSys"] = "urn:devrev:params:oauth:token-type:sys";
71
+ AuthTokenRequestedTokenType["UrnIetfParamsOauthTokenTypeJwt"] = "urn:ietf:params:oauth:token-type:jwt";
72
+ })(AuthTokenRequestedTokenType = exports.AuthTokenRequestedTokenType || (exports.AuthTokenRequestedTokenType = {}));
73
+ /** The status of the token. */
74
+ var AuthTokenStatus;
75
+ (function (AuthTokenStatus) {
76
+ AuthTokenStatus["Active"] = "active";
77
+ AuthTokenStatus["Expired"] = "expired";
78
+ AuthTokenStatus["Revoked"] = "revoked";
79
+ })(AuthTokenStatus = exports.AuthTokenStatus || (exports.AuthTokenStatus = {}));
80
+ /** The type of the subject token. */
81
+ var AuthTokenSubjectTokenType;
82
+ (function (AuthTokenSubjectTokenType) {
83
+ AuthTokenSubjectTokenType["UrnDevrevParamsOauthTokenTypeJwtAuth0"] = "urn:devrev:params:oauth:token-type:jwt:auth0";
84
+ AuthTokenSubjectTokenType["UrnDevrevParamsOauthTokenTypeJwtDev"] = "urn:devrev:params:oauth:token-type:jwt:dev";
85
+ AuthTokenSubjectTokenType["UrnDevrevParamsOauthTokenTypeRevinfo"] = "urn:devrev:params:oauth:token-type:revinfo";
86
+ AuthTokenSubjectTokenType["UrnDevrevParamsOauthTokenTypeSysu"] = "urn:devrev:params:oauth:token-type:sysu";
87
+ AuthTokenSubjectTokenType["UrnDevrevParamsOauthTokenTypeUserinfo"] = "urn:devrev:params:oauth:token-type:userinfo";
88
+ AuthTokenSubjectTokenType["UrnDevrevParamsOauthTokenTypeUserinfoProfile"] = "urn:devrev:params:oauth:token-type:userinfo:profile";
89
+ AuthTokenSubjectTokenType["UrnIetfParamsOauthTokenTypeJwt"] = "urn:ietf:params:oauth:token-type:jwt";
90
+ })(AuthTokenSubjectTokenType = exports.AuthTokenSubjectTokenType || (exports.AuthTokenSubjectTokenType = {}));
91
+ /** The type of the issued token. Bearer is the only supported token type. */
92
+ var AuthTokenTokenType;
93
+ (function (AuthTokenTokenType) {
94
+ AuthTokenTokenType["Bearer"] = "bearer";
95
+ })(AuthTokenTokenType = exports.AuthTokenTokenType || (exports.AuthTokenTokenType = {}));
96
+ /**
97
+ * Defines the type for the authentication connection. Different types of
98
+ * authentication connections have different configuration parameters.
99
+ */
100
+ var DevOrgAuthConnectionsCreateRequestType;
101
+ (function (DevOrgAuthConnectionsCreateRequestType) {
102
+ DevOrgAuthConnectionsCreateRequestType["GoogleApps"] = "google_apps";
103
+ DevOrgAuthConnectionsCreateRequestType["Oidc"] = "oidc";
104
+ DevOrgAuthConnectionsCreateRequestType["Samlp"] = "samlp";
105
+ DevOrgAuthConnectionsCreateRequestType["Waad"] = "waad";
106
+ })(DevOrgAuthConnectionsCreateRequestType = exports.DevOrgAuthConnectionsCreateRequestType || (exports.DevOrgAuthConnectionsCreateRequestType = {}));
107
+ /**
108
+ * Specifies the type for the authentication connection. Different types
109
+ * of authentication connections have different configuration parameters
110
+ * that can be updated.
111
+ */
112
+ var DevOrgAuthConnectionsUpdateRequestType;
113
+ (function (DevOrgAuthConnectionsUpdateRequestType) {
114
+ DevOrgAuthConnectionsUpdateRequestType["GoogleApps"] = "google_apps";
115
+ DevOrgAuthConnectionsUpdateRequestType["None"] = "none";
116
+ DevOrgAuthConnectionsUpdateRequestType["Oidc"] = "oidc";
117
+ DevOrgAuthConnectionsUpdateRequestType["Samlp"] = "samlp";
118
+ DevOrgAuthConnectionsUpdateRequestType["Waad"] = "waad";
119
+ })(DevOrgAuthConnectionsUpdateRequestType = exports.DevOrgAuthConnectionsUpdateRequestType || (exports.DevOrgAuthConnectionsUpdateRequestType = {}));
120
+ var ErrorBadRequestType;
121
+ (function (ErrorBadRequestType) {
122
+ ErrorBadRequestType["BadRequest"] = "bad_request";
123
+ ErrorBadRequestType["InvalidEnumValue"] = "invalid_enum_value";
124
+ ErrorBadRequestType["InvalidField"] = "invalid_field";
125
+ ErrorBadRequestType["MissingRequiredField"] = "missing_required_field";
126
+ ErrorBadRequestType["ParseError"] = "parse_error";
127
+ ErrorBadRequestType["ValueNotPermitted"] = "value_not_permitted";
128
+ })(ErrorBadRequestType = exports.ErrorBadRequestType || (exports.ErrorBadRequestType = {}));
129
+ var ErrorForbiddenType;
130
+ (function (ErrorForbiddenType) {
131
+ ErrorForbiddenType["Forbidden"] = "forbidden";
132
+ })(ErrorForbiddenType = exports.ErrorForbiddenType || (exports.ErrorForbiddenType = {}));
133
+ var ErrorInternalServerErrorType;
134
+ (function (ErrorInternalServerErrorType) {
135
+ ErrorInternalServerErrorType["InternalError"] = "internal_error";
136
+ })(ErrorInternalServerErrorType = exports.ErrorInternalServerErrorType || (exports.ErrorInternalServerErrorType = {}));
137
+ var ErrorNotFoundType;
138
+ (function (ErrorNotFoundType) {
139
+ ErrorNotFoundType["NotFound"] = "not_found";
140
+ })(ErrorNotFoundType = exports.ErrorNotFoundType || (exports.ErrorNotFoundType = {}));
141
+ var ErrorServiceUnavailableType;
142
+ (function (ErrorServiceUnavailableType) {
143
+ ErrorServiceUnavailableType["ServiceUnavailable"] = "service_unavailable";
144
+ })(ErrorServiceUnavailableType = exports.ErrorServiceUnavailableType || (exports.ErrorServiceUnavailableType = {}));
145
+ var ErrorTooManyRequestsType;
146
+ (function (ErrorTooManyRequestsType) {
147
+ ErrorTooManyRequestsType["TooManyRequests"] = "too_many_requests";
148
+ })(ErrorTooManyRequestsType = exports.ErrorTooManyRequestsType || (exports.ErrorTooManyRequestsType = {}));
149
+ var ErrorUnauthorizedType;
150
+ (function (ErrorUnauthorizedType) {
151
+ ErrorUnauthorizedType["Unauthenticated"] = "unauthenticated";
152
+ })(ErrorUnauthorizedType = exports.ErrorUnauthorizedType || (exports.ErrorUnauthorizedType = {}));
153
+ /** Priority of the work based upon impact and criticality. */
154
+ var IssuePriority;
155
+ (function (IssuePriority) {
156
+ IssuePriority["P0"] = "p0";
157
+ IssuePriority["P1"] = "p1";
158
+ IssuePriority["P2"] = "p2";
159
+ IssuePriority["P3"] = "p3";
160
+ })(IssuePriority = exports.IssuePriority || (exports.IssuePriority = {}));
161
+ /**
162
+ * The iteration mode to use. If "after", then entries after the provided
163
+ * cursor will be returned, or if no cursor is provided, then from the
164
+ * beginning. If "before", then entries before the provided cursor will be
165
+ * returned, or if no cursor is provided, then from the end. Entries will
166
+ * always be returned in the specified sort-by order.
167
+ */
168
+ var ListMode;
169
+ (function (ListMode) {
170
+ ListMode["After"] = "after";
171
+ ListMode["Before"] = "before";
172
+ })(ListMode = exports.ListMode || (exports.ListMode = {}));
173
+ /** The environment of the Org. Defaults to 'production' if not specified. */
174
+ var OrgEnvironment;
175
+ (function (OrgEnvironment) {
176
+ OrgEnvironment["Production"] = "production";
177
+ OrgEnvironment["Staging"] = "staging";
178
+ OrgEnvironment["Test"] = "test";
179
+ })(OrgEnvironment = exports.OrgEnvironment || (exports.OrgEnvironment = {}));
180
+ var OrgType;
181
+ (function (OrgType) {
182
+ OrgType["RevOrg"] = "rev_org";
183
+ })(OrgType = exports.OrgType || (exports.OrgType = {}));
184
+ var PartType;
185
+ (function (PartType) {
186
+ PartType["Capability"] = "capability";
187
+ PartType["Enhancement"] = "enhancement";
188
+ PartType["Feature"] = "feature";
189
+ PartType["Product"] = "product";
190
+ })(PartType = exports.PartType || (exports.PartType = {}));
191
+ /** Severity of the ticket. */
192
+ var TicketSeverity;
193
+ (function (TicketSeverity) {
194
+ TicketSeverity["Blocker"] = "blocker";
195
+ TicketSeverity["High"] = "high";
196
+ TicketSeverity["Low"] = "low";
197
+ TicketSeverity["Medium"] = "medium";
198
+ })(TicketSeverity = exports.TicketSeverity || (exports.TicketSeverity = {}));
199
+ /** The type of the body to use for the comment. */
200
+ var TimelineCommentBodyType;
201
+ (function (TimelineCommentBodyType) {
202
+ TimelineCommentBodyType["SnapKit"] = "snap_kit";
203
+ TimelineCommentBodyType["Text"] = "text";
204
+ })(TimelineCommentBodyType = exports.TimelineCommentBodyType || (exports.TimelineCommentBodyType = {}));
205
+ var TimelineEntriesCreateRequestType;
206
+ (function (TimelineEntriesCreateRequestType) {
207
+ TimelineEntriesCreateRequestType["TimelineComment"] = "timeline_comment";
208
+ })(TimelineEntriesCreateRequestType = exports.TimelineEntriesCreateRequestType || (exports.TimelineEntriesCreateRequestType = {}));
209
+ var TimelineEntriesUpdateRequestType;
210
+ (function (TimelineEntriesUpdateRequestType) {
211
+ TimelineEntriesUpdateRequestType["TimelineComment"] = "timeline_comment";
212
+ })(TimelineEntriesUpdateRequestType = exports.TimelineEntriesUpdateRequestType || (exports.TimelineEntriesUpdateRequestType = {}));
213
+ var TimelineEntryType;
214
+ (function (TimelineEntryType) {
215
+ TimelineEntryType["TimelineComment"] = "timeline_comment";
216
+ })(TimelineEntryType = exports.TimelineEntryType || (exports.TimelineEntryType = {}));
217
+ /**
218
+ * The visibility of the entry. If 'private', then the entry is only
219
+ * visible to the creator, 'internal' is visible with the Dev
220
+ * organization, 'external' is visible to the Dev organzation and Rev
221
+ * users, and 'public' is visible to all. If not set, then the default
222
+ * visibility is 'external'.
223
+ */
224
+ var TimelineEntryVisibility;
225
+ (function (TimelineEntryVisibility) {
226
+ TimelineEntryVisibility["External"] = "external";
227
+ TimelineEntryVisibility["Internal"] = "internal";
228
+ TimelineEntryVisibility["Private"] = "private";
229
+ TimelineEntryVisibility["Public"] = "public";
230
+ })(TimelineEntryVisibility = exports.TimelineEntryVisibility || (exports.TimelineEntryVisibility = {}));
231
+ /** State of the user. */
232
+ var UserState;
233
+ (function (UserState) {
234
+ UserState["Active"] = "active";
235
+ UserState["Deactivated"] = "deactivated";
236
+ UserState["Locked"] = "locked";
237
+ UserState["Shadow"] = "shadow";
238
+ UserState["Unassigned"] = "unassigned";
239
+ })(UserState = exports.UserState || (exports.UserState = {}));
240
+ var UserType;
241
+ (function (UserType) {
242
+ UserType["DevUser"] = "dev_user";
243
+ UserType["RevUser"] = "rev_user";
244
+ UserType["SysUser"] = "sys_user";
245
+ })(UserType = exports.UserType || (exports.UserType = {}));
246
+ /** The event types that the webhook will receive. */
247
+ var WebhookEventType;
248
+ (function (WebhookEventType) {
249
+ WebhookEventType["PartCreated"] = "part_created";
250
+ WebhookEventType["PartDeleted"] = "part_deleted";
251
+ WebhookEventType["PartUpdated"] = "part_updated";
252
+ WebhookEventType["RevOrgCreated"] = "rev_org_created";
253
+ WebhookEventType["RevOrgDeleted"] = "rev_org_deleted";
254
+ WebhookEventType["RevOrgUpdated"] = "rev_org_updated";
255
+ WebhookEventType["TagCreated"] = "tag_created";
256
+ WebhookEventType["TagDeleted"] = "tag_deleted";
257
+ WebhookEventType["TagUpdated"] = "tag_updated";
258
+ WebhookEventType["TimelineEntryCreated"] = "timeline_entry_created";
259
+ WebhookEventType["TimelineEntryDeleted"] = "timeline_entry_deleted";
260
+ WebhookEventType["TimelineEntryUpdated"] = "timeline_entry_updated";
261
+ WebhookEventType["Verify"] = "verify";
262
+ WebhookEventType["WebhookCreated"] = "webhook_created";
263
+ WebhookEventType["WebhookDeleted"] = "webhook_deleted";
264
+ WebhookEventType["WebhookUpdated"] = "webhook_updated";
265
+ WebhookEventType["WorkCreated"] = "work_created";
266
+ WebhookEventType["WorkDeleted"] = "work_deleted";
267
+ WebhookEventType["WorkUpdated"] = "work_updated";
268
+ })(WebhookEventType = exports.WebhookEventType || (exports.WebhookEventType = {}));
269
+ /** The status of the webhook. */
270
+ var WebhookStatus;
271
+ (function (WebhookStatus) {
272
+ WebhookStatus["Active"] = "active";
273
+ WebhookStatus["Inactive"] = "inactive";
274
+ WebhookStatus["Unverified"] = "unverified";
275
+ })(WebhookStatus = exports.WebhookStatus || (exports.WebhookStatus = {}));
276
+ /** The action to update the webhook's status. */
277
+ var WebhooksUpdateAction;
278
+ (function (WebhooksUpdateAction) {
279
+ WebhooksUpdateAction["Activate"] = "activate";
280
+ WebhooksUpdateAction["Deactivate"] = "deactivate";
281
+ })(WebhooksUpdateAction = exports.WebhooksUpdateAction || (exports.WebhooksUpdateAction = {}));
282
+ var WorkType;
283
+ (function (WorkType) {
284
+ WorkType["Issue"] = "issue";
285
+ WorkType["Ticket"] = "ticket";
286
+ })(WorkType = exports.WorkType || (exports.WorkType = {}));
287
+ const axios_1 = __importDefault(require("axios"));
288
+ var ContentType;
289
+ (function (ContentType) {
290
+ ContentType["Json"] = "application/json";
291
+ ContentType["FormData"] = "multipart/form-data";
292
+ ContentType["UrlEncoded"] = "application/x-www-form-urlencoded";
293
+ ContentType["Text"] = "text/plain";
294
+ })(ContentType = exports.ContentType || (exports.ContentType = {}));
295
+ class HttpClient {
296
+ constructor(_a = {}) {
297
+ var { securityWorker, secure, format } = _a, axiosConfig = __rest(_a, ["securityWorker", "secure", "format"]);
298
+ this.securityData = null;
299
+ this.setSecurityData = (data) => {
300
+ this.securityData = data;
301
+ };
302
+ this.request = (_b) => __awaiter(this, void 0, void 0, function* () {
303
+ var { secure, path, type, query, format, body } = _b, params = __rest(_b, ["secure", "path", "type", "query", "format", "body"]);
304
+ const secureParams = ((typeof secure === "boolean" ? secure : this.secure) &&
305
+ this.securityWorker &&
306
+ (yield this.securityWorker(this.securityData))) ||
307
+ {};
308
+ const requestParams = this.mergeRequestParams(params, secureParams);
309
+ const responseFormat = format || this.format || undefined;
310
+ if (type === ContentType.FormData &&
311
+ body &&
312
+ body !== null &&
313
+ typeof body === "object") {
314
+ body = this.createFormData(body);
315
+ }
316
+ if (type === ContentType.Text &&
317
+ body &&
318
+ body !== null &&
319
+ typeof body !== "string") {
320
+ body = JSON.stringify(body);
321
+ }
322
+ return this.instance.request(Object.assign(Object.assign({}, requestParams), { headers: Object.assign(Object.assign({}, (requestParams.headers || {})), (type && type !== ContentType.FormData
323
+ ? { "Content-Type": type }
324
+ : {})), params: query, responseType: responseFormat, data: body, url: path }));
325
+ });
326
+ this.instance = axios_1.default.create(Object.assign(Object.assign({}, axiosConfig), { baseURL: axiosConfig.baseURL || "{protocol}://{hostname}" }));
327
+ this.secure = secure;
328
+ this.format = format;
329
+ this.securityWorker = securityWorker;
330
+ }
331
+ mergeRequestParams(params1, params2) {
332
+ const method = params1.method || (params2 && params2.method);
333
+ return Object.assign(Object.assign(Object.assign(Object.assign({}, this.instance.defaults), params1), (params2 || {})), { headers: Object.assign(Object.assign(Object.assign({}, ((method &&
334
+ this.instance.defaults.headers[method.toLowerCase()]) ||
335
+ {})), (params1.headers || {})), ((params2 && params2.headers) || {})) });
336
+ }
337
+ stringifyFormItem(formItem) {
338
+ if (typeof formItem === "object" && formItem !== null) {
339
+ return JSON.stringify(formItem);
340
+ }
341
+ else {
342
+ return `${formItem}`;
343
+ }
344
+ }
345
+ createFormData(input) {
346
+ return Object.keys(input || {}).reduce((formData, key) => {
347
+ const property = input[key];
348
+ const propertyContent = property instanceof Array ? property : [property];
349
+ for (const formItem of propertyContent) {
350
+ const isFileType = formItem instanceof Blob || formItem instanceof File;
351
+ formData.append(key, isFileType ? formItem : this.stringifyFormItem(formItem));
352
+ }
353
+ return formData;
354
+ }, new FormData());
355
+ }
356
+ }
357
+ exports.HttpClient = HttpClient;
358
+ /**
359
+ * @title DevRev REST API
360
+ * @version 2022-10-20
361
+ * @baseUrl {protocol}://{hostname}
362
+ *
363
+ * DevRev's REST API.
364
+ */
365
+ class Api extends HttpClient {
366
+ constructor() {
367
+ super(...arguments);
368
+ /**
369
+ * @description Gets the download URL for the artifact.
370
+ *
371
+ * @tags artifacts
372
+ * @name ArtifactsLocate
373
+ * @request GET:/artifacts.locate
374
+ * @secure
375
+ */
376
+ this.artifactsLocate = (query, params = {}) => this.request(Object.assign({ path: `/artifacts.locate`, method: "GET", query: query, secure: true, format: "json" }, params));
377
+ /**
378
+ * @description Creates an artifact and generates an upload URL for its data.
379
+ *
380
+ * @tags artifacts
381
+ * @name ArtifactsPrepare
382
+ * @request POST:/artifacts.prepare
383
+ * @secure
384
+ */
385
+ this.artifactsPrepare = (data, params = {}) => this.request(Object.assign({ path: `/artifacts.prepare`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
386
+ /**
387
+ * @description Creates a JWT corresponding to the requested token type for the authenticated user.
388
+ *
389
+ * @tags auth-tokens
390
+ * @name AuthTokensCreate
391
+ * @request POST:/auth-tokens.create
392
+ * @secure
393
+ */
394
+ this.authTokensCreate = (data, params = {}) => this.request(Object.assign({ path: `/auth-tokens.create`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
395
+ /**
396
+ * @description Revokes the token that matches the given token ID issued under the given Dev organization.
397
+ *
398
+ * @tags auth-tokens
399
+ * @name AuthTokensDelete
400
+ * @request POST:/auth-tokens.delete
401
+ * @secure
402
+ */
403
+ this.authTokensDelete = (data, params = {}) => this.request(Object.assign({ path: `/auth-tokens.delete`, method: "POST", body: data, secure: true, type: ContentType.Json }, params));
404
+ /**
405
+ * @description Gets the token metadata corresponding to the given token ID under the given Dev organization.
406
+ *
407
+ * @tags auth-tokens
408
+ * @name AuthTokensGet
409
+ * @request GET:/auth-tokens.get
410
+ * @secure
411
+ */
412
+ this.authTokensGet = (query, params = {}) => this.request(Object.assign({ path: `/auth-tokens.get`, method: "GET", query: query, secure: true, format: "json" }, params));
413
+ /**
414
+ * @description Gets the token metadata for all the tokens corresponding to the given token type issued for a given subject.
415
+ *
416
+ * @tags auth-tokens
417
+ * @name AuthTokensList
418
+ * @request GET:/auth-tokens.list
419
+ * @secure
420
+ */
421
+ this.authTokensList = (query, params = {}) => this.request(Object.assign({ path: `/auth-tokens.list`, method: "GET", query: query, secure: true, format: "json" }, params));
422
+ /**
423
+ * @description Revokes all the tokens that matches the given token type created by the authenticated user.
424
+ *
425
+ * @tags auth-tokens
426
+ * @name AuthTokensSelfDelete
427
+ * @request POST:/auth-tokens.self.delete
428
+ * @secure
429
+ */
430
+ this.authTokensSelfDelete = (data, params = {}) => this.request(Object.assign({ path: `/auth-tokens.self.delete`, method: "POST", body: data, secure: true, type: ContentType.Json }, params));
431
+ /**
432
+ * @description Updates token metadata of a token issued under a given Dev organization.
433
+ *
434
+ * @tags auth-tokens
435
+ * @name AuthTokensUpdate
436
+ * @request POST:/auth-tokens.update
437
+ * @secure
438
+ */
439
+ this.authTokensUpdate = (data, params = {}) => this.request(Object.assign({ path: `/auth-tokens.update`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
440
+ /**
441
+ * @description Creates a new enterprise authentication connection for a Dev organization. This authentication connection will not be enabled by default for the organization and the user will need to explicitly enable this. Keep in mind that at a time, only one authentication connection can be enabled for a Dev organization. At present, only 5 enterprise connections can be created by an organization.
442
+ *
443
+ * @tags auth-connection, dev-orgs
444
+ * @name DevOrgAuthConnectionsCreate
445
+ * @request POST:/dev-orgs.auth-connections.create
446
+ * @secure
447
+ */
448
+ this.devOrgAuthConnectionsCreate = (data, params = {}) => this.request(Object.assign({ path: `/dev-orgs.auth-connections.create`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
449
+ /**
450
+ * @description Deletes an authentication connection. Only enterprise connections which are explicitly set up for a Dev organization can be deleted. Default connections can not be deleted using this method.
451
+ *
452
+ * @tags auth-connection, dev-orgs
453
+ * @name DevOrgAuthConnectionsDelete
454
+ * @request POST:/dev-orgs.auth-connections.delete
455
+ * @secure
456
+ */
457
+ this.devOrgAuthConnectionsDelete = (data, params = {}) => this.request(Object.assign({ path: `/dev-orgs.auth-connections.delete`, method: "POST", body: data, secure: true, type: ContentType.Json }, params));
458
+ /**
459
+ * @description Retrieves the details for an authentication connection.
460
+ *
461
+ * @tags auth-connection, dev-orgs
462
+ * @name DevOrgAuthConnectionsGet
463
+ * @request GET:/dev-orgs.auth-connections.get
464
+ * @secure
465
+ */
466
+ this.devOrgAuthConnectionsGet = (query, params = {}) => this.request(Object.assign({ path: `/dev-orgs.auth-connections.get`, method: "GET", query: query, secure: true, format: "json" }, params));
467
+ /**
468
+ * @description Lists all the authentication connections available for a Dev organization. This list will include both social and enterprise connections which are either available by default or are explicitly created by the user.
469
+ *
470
+ * @tags auth-connection, dev-orgs
471
+ * @name DevOrgAuthConnectionsList
472
+ * @request GET:/dev-orgs.auth-connections.list
473
+ * @secure
474
+ */
475
+ this.devOrgAuthConnectionsList = (params = {}) => this.request(Object.assign({ path: `/dev-orgs.auth-connections.list`, method: "GET", secure: true, format: "json" }, params));
476
+ /**
477
+ * @description Enable or disable an authentication connection for a Dev organization. Currently, only 1 authentication connection can be enabled at a time. When a new authentication connection is enabled, the connection which is currently enabled for the Dev organization is automatically disabled.
478
+ *
479
+ * @tags auth-connection, dev-orgs
480
+ * @name DevOrgAuthConnectionsToggle
481
+ * @request POST:/dev-orgs.auth-connections.toggle
482
+ * @secure
483
+ */
484
+ this.devOrgAuthConnectionsToggle = (data, params = {}) => this.request(Object.assign({ path: `/dev-orgs.auth-connections.toggle`, method: "POST", body: data, secure: true, type: ContentType.Json }, params));
485
+ /**
486
+ * @description Updates an authentication connection.
487
+ *
488
+ * @tags auth-connection, dev-orgs
489
+ * @name DevOrgAuthConnectionsUpdate
490
+ * @request POST:/dev-orgs.auth-connections.update
491
+ * @secure
492
+ */
493
+ this.devOrgAuthConnectionsUpdate = (data, params = {}) => this.request(Object.assign({ path: `/dev-orgs.auth-connections.update`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
494
+ /**
495
+ * @description Lists users within your organization.
496
+ *
497
+ * @tags dev-users
498
+ * @name DevUsersList
499
+ * @request GET:/dev-users.list
500
+ * @secure
501
+ */
502
+ this.devUsersList = (query, params = {}) => this.request(Object.assign({ path: `/dev-users.list`, method: "GET", query: query, secure: true, format: "json" }, params));
503
+ /**
504
+ * @description Gets the authenticated user's information.
505
+ *
506
+ * @tags dev-users
507
+ * @name DevUsersSelf
508
+ * @request GET:/dev-users.self
509
+ * @secure
510
+ */
511
+ this.devUsersSelf = (params = {}) => this.request(Object.assign({ path: `/dev-users.self`, method: "GET", secure: true, format: "json" }, params));
512
+ /**
513
+ * @description Creates new [part](https://devrev.ai/docs/product/parts).
514
+ *
515
+ * @tags parts
516
+ * @name PartsCreate
517
+ * @request POST:/parts.create
518
+ * @secure
519
+ */
520
+ this.partsCreate = (data, params = {}) => this.request(Object.assign({ path: `/parts.create`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
521
+ /**
522
+ * @description Deletes a [part](https://devrev.ai/docs/product/parts).
523
+ *
524
+ * @tags parts
525
+ * @name PartsDelete
526
+ * @request POST:/parts.delete
527
+ * @secure
528
+ */
529
+ this.partsDelete = (data, params = {}) => this.request(Object.assign({ path: `/parts.delete`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
530
+ /**
531
+ * @description Gets a [part's](https://devrev.ai/docs/product/parts) information.
532
+ *
533
+ * @tags parts
534
+ * @name PartsGet
535
+ * @request GET:/parts.get
536
+ * @secure
537
+ */
538
+ this.partsGet = (query, params = {}) => this.request(Object.assign({ path: `/parts.get`, method: "GET", query: query, secure: true, format: "json" }, params));
539
+ /**
540
+ * @description Lists a collection of [parts](https://devrev.ai/docs/product/parts).
541
+ *
542
+ * @tags parts
543
+ * @name PartsList
544
+ * @request GET:/parts.list
545
+ * @secure
546
+ */
547
+ this.partsList = (query, params = {}) => this.request(Object.assign({ path: `/parts.list`, method: "GET", query: query, secure: true, format: "json" }, params));
548
+ /**
549
+ * @description Updates a [part's](https://devrev.ai/docs/product/parts) information.
550
+ *
551
+ * @tags parts
552
+ * @name PartsUpdate
553
+ * @request POST:/parts.update
554
+ * @secure
555
+ */
556
+ this.partsUpdate = (data, params = {}) => this.request(Object.assign({ path: `/parts.update`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
557
+ /**
558
+ * @description Creates a Rev organization in the authenticated user's Dev organization.
559
+ *
560
+ * @tags rev-orgs
561
+ * @name RevOrgsCreate
562
+ * @request POST:/rev-orgs.create
563
+ * @secure
564
+ */
565
+ this.revOrgsCreate = (data, params = {}) => this.request(Object.assign({ path: `/rev-orgs.create`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
566
+ /**
567
+ * @description Deletes the Rev organization.
568
+ *
569
+ * @tags rev-orgs
570
+ * @name RevOrgsDelete
571
+ * @request POST:/rev-orgs.delete
572
+ * @secure
573
+ */
574
+ this.revOrgsDelete = (data, params = {}) => this.request(Object.assign({ path: `/rev-orgs.delete`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
575
+ /**
576
+ * @description Retrieves the Rev organization's information.
577
+ *
578
+ * @tags rev-orgs
579
+ * @name RevOrgsGet
580
+ * @request GET:/rev-orgs.get
581
+ * @secure
582
+ */
583
+ this.revOrgsGet = (query, params = {}) => this.request(Object.assign({ path: `/rev-orgs.get`, method: "GET", query: query, secure: true, format: "json" }, params));
584
+ /**
585
+ * @description Gets the list of Rev organizations' information belonging to the authenticated user's Dev Organization which the user is also authorized to access.
586
+ *
587
+ * @tags rev-orgs
588
+ * @name RevOrgsList
589
+ * @request GET:/rev-orgs.list
590
+ * @secure
591
+ */
592
+ this.revOrgsList = (query, params = {}) => this.request(Object.assign({ path: `/rev-orgs.list`, method: "GET", query: query, secure: true, format: "json" }, params));
593
+ /**
594
+ * @description Updates the Rev organization's information.
595
+ *
596
+ * @tags rev-orgs
597
+ * @name RevOrgsUpdate
598
+ * @request POST:/rev-orgs.update
599
+ * @secure
600
+ */
601
+ this.revOrgsUpdate = (data, params = {}) => this.request(Object.assign({ path: `/rev-orgs.update`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
602
+ /**
603
+ * @description Creates a new tag, which is used to create associations between objects and a logical concept denoted by the tag's name.
604
+ *
605
+ * @tags tags
606
+ * @name TagsCreate
607
+ * @request POST:/tags.create
608
+ * @secure
609
+ */
610
+ this.tagsCreate = (data, params = {}) => this.request(Object.assign({ path: `/tags.create`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
611
+ /**
612
+ * @description Deletes a tag.
613
+ *
614
+ * @tags tags
615
+ * @name TagsDelete
616
+ * @request POST:/tags.delete
617
+ * @secure
618
+ */
619
+ this.tagsDelete = (data, params = {}) => this.request(Object.assign({ path: `/tags.delete`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
620
+ /**
621
+ * @description Gets a tag's information.
622
+ *
623
+ * @tags tags
624
+ * @name TagsGet
625
+ * @request GET:/tags.get
626
+ * @secure
627
+ */
628
+ this.tagsGet = (query, params = {}) => this.request(Object.assign({ path: `/tags.get`, method: "GET", query: query, secure: true, format: "json" }, params));
629
+ /**
630
+ * @description Lists the available tags.
631
+ *
632
+ * @tags tags
633
+ * @name TagsList
634
+ * @request GET:/tags.list
635
+ * @secure
636
+ */
637
+ this.tagsList = (query, params = {}) => this.request(Object.assign({ path: `/tags.list`, method: "GET", query: query, secure: true, format: "json" }, params));
638
+ /**
639
+ * @description Updates a tag's information.
640
+ *
641
+ * @tags tags
642
+ * @name TagsUpdate
643
+ * @request POST:/tags.update
644
+ * @secure
645
+ */
646
+ this.tagsUpdate = (data, params = {}) => this.request(Object.assign({ path: `/tags.update`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
647
+ /**
648
+ * @description Creates a new entry on an object's timeline.
649
+ *
650
+ * @tags timeline-entries
651
+ * @name TimelineEntriesCreate
652
+ * @request POST:/timeline-entries.create
653
+ * @secure
654
+ */
655
+ this.timelineEntriesCreate = (data, params = {}) => this.request(Object.assign({ path: `/timeline-entries.create`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
656
+ /**
657
+ * @description Gets an entry on an object's timeline.
658
+ *
659
+ * @tags timeline-entries
660
+ * @name TimelineEntriesGet
661
+ * @request GET:/timeline-entries.get
662
+ * @secure
663
+ */
664
+ this.timelineEntriesGet = (query, params = {}) => this.request(Object.assign({ path: `/timeline-entries.get`, method: "GET", query: query, secure: true, format: "json" }, params));
665
+ /**
666
+ * @description Lists the timeline entries for an object.
667
+ *
668
+ * @tags timeline-entries
669
+ * @name TimelineEntriesList
670
+ * @request GET:/timeline-entries.list
671
+ * @secure
672
+ */
673
+ this.timelineEntriesList = (query, params = {}) => this.request(Object.assign({ path: `/timeline-entries.list`, method: "GET", query: query, secure: true, format: "json" }, params));
674
+ /**
675
+ * @description Updates an entry on an object's timeline.
676
+ *
677
+ * @tags timeline-entries
678
+ * @name TimelineEntriesUpdate
679
+ * @request POST:/timeline-entries.update
680
+ * @secure
681
+ */
682
+ this.timelineEntriesUpdate = (data, params = {}) => this.request(Object.assign({ path: `/timeline-entries.update`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
683
+ /**
684
+ * @description Creates a new webhook target.
685
+ *
686
+ * @tags webhooks
687
+ * @name WebhooksCreate
688
+ * @request POST:/webhooks.create
689
+ * @secure
690
+ */
691
+ this.webhooksCreate = (data, params = {}) => this.request(Object.assign({ path: `/webhooks.create`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
692
+ /**
693
+ * @description Deletes the requested webhook.
694
+ *
695
+ * @tags webhooks
696
+ * @name WebhooksDelete
697
+ * @request POST:/webhooks.delete
698
+ * @secure
699
+ */
700
+ this.webhooksDelete = (data, params = {}) => this.request(Object.assign({ path: `/webhooks.delete`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
701
+ /**
702
+ * @description Gets the requested webhook's information.
703
+ *
704
+ * @tags webhooks
705
+ * @name WebhooksGet
706
+ * @request GET:/webhooks.get
707
+ * @secure
708
+ */
709
+ this.webhooksGet = (query, params = {}) => this.request(Object.assign({ path: `/webhooks.get`, method: "GET", query: query, secure: true, format: "json" }, params));
710
+ /**
711
+ * @description Lists the webhooks.
712
+ *
713
+ * @tags webhooks
714
+ * @name WebhooksList
715
+ * @request GET:/webhooks.list
716
+ * @secure
717
+ */
718
+ this.webhooksList = (params = {}) => this.request(Object.assign({ path: `/webhooks.list`, method: "GET", secure: true, format: "json" }, params));
719
+ /**
720
+ * @description Updates the requested webhook.
721
+ *
722
+ * @tags webhooks
723
+ * @name WebhooksUpdate
724
+ * @request POST:/webhooks.update
725
+ * @secure
726
+ */
727
+ this.webhooksUpdate = (data, params = {}) => this.request(Object.assign({ path: `/webhooks.update`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
728
+ /**
729
+ * @description Creates new work ([issue](https://devrev.ai/docs/product/build), [ticket](https://devrev.ai/docs/product/support)) item. [task](https://docs.devrev.ai/product/tasks) and opportunity work types are supported in the beta version.
730
+ *
731
+ * @tags works
732
+ * @name WorksCreate
733
+ * @request POST:/works.create
734
+ * @secure
735
+ */
736
+ this.worksCreate = (data, params = {}) => this.request(Object.assign({ path: `/works.create`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
737
+ /**
738
+ * @description Deletes a work item.
739
+ *
740
+ * @tags works
741
+ * @name WorksDelete
742
+ * @request POST:/works.delete
743
+ * @secure
744
+ */
745
+ this.worksDelete = (data, params = {}) => this.request(Object.assign({ path: `/works.delete`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
746
+ /**
747
+ * @description Exports a collection of work items.
748
+ *
749
+ * @tags works
750
+ * @name WorksExport
751
+ * @request GET:/works.export
752
+ * @secure
753
+ */
754
+ this.worksExport = (query, params = {}) => this.request(Object.assign({ path: `/works.export`, method: "GET", query: query, secure: true, format: "json" }, params));
755
+ /**
756
+ * @description Gets a work item's information.
757
+ *
758
+ * @tags works
759
+ * @name WorksGet
760
+ * @request GET:/works.get
761
+ * @secure
762
+ */
763
+ this.worksGet = (query, params = {}) => this.request(Object.assign({ path: `/works.get`, method: "GET", query: query, secure: true, format: "json" }, params));
764
+ /**
765
+ * @description Lists a collection of work items.
766
+ *
767
+ * @tags works
768
+ * @name WorksList
769
+ * @request GET:/works.list
770
+ * @secure
771
+ */
772
+ this.worksList = (query, params = {}) => this.request(Object.assign({ path: `/works.list`, method: "GET", query: query, secure: true, format: "json" }, params));
773
+ /**
774
+ * @description Updates a work item's information.
775
+ *
776
+ * @tags works
777
+ * @name WorksUpdate
778
+ * @request POST:/works.update
779
+ * @secure
780
+ */
781
+ this.worksUpdate = (data, params = {}) => this.request(Object.assign({ path: `/works.update`, method: "POST", body: data, secure: true, type: ContentType.Json, format: "json" }, params));
782
+ }
783
+ }
784
+ exports.Api = Api;