@devrev/typescript-sdk 1.1.3 → 1.1.5

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,810 @@
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.TimelineEntryObjectType = 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
+ /** The type of object that the Timeline entry belongs to. */
214
+ var TimelineEntryObjectType;
215
+ (function (TimelineEntryObjectType) {
216
+ TimelineEntryObjectType["Capability"] = "capability";
217
+ TimelineEntryObjectType["Conversation"] = "conversation";
218
+ TimelineEntryObjectType["Enhancement"] = "enhancement";
219
+ TimelineEntryObjectType["Feature"] = "feature";
220
+ TimelineEntryObjectType["Issue"] = "issue";
221
+ TimelineEntryObjectType["Product"] = "product";
222
+ TimelineEntryObjectType["RevOrg"] = "rev_org";
223
+ TimelineEntryObjectType["RevUser"] = "rev_user";
224
+ TimelineEntryObjectType["Ticket"] = "ticket";
225
+ TimelineEntryObjectType["TimelineComment"] = "timeline_comment";
226
+ })(TimelineEntryObjectType = exports.TimelineEntryObjectType || (exports.TimelineEntryObjectType = {}));
227
+ var TimelineEntryType;
228
+ (function (TimelineEntryType) {
229
+ TimelineEntryType["TimelineComment"] = "timeline_comment";
230
+ })(TimelineEntryType = exports.TimelineEntryType || (exports.TimelineEntryType = {}));
231
+ /**
232
+ * The visibility of the entry. If 'private', then the entry is only
233
+ * visible to the creator, 'internal' is visible with the Dev
234
+ * organization, 'external' is visible to the Dev organzation and Rev
235
+ * users, and 'public' is visible to all. If not set, then the default
236
+ * visibility is 'external'.
237
+ */
238
+ var TimelineEntryVisibility;
239
+ (function (TimelineEntryVisibility) {
240
+ TimelineEntryVisibility["External"] = "external";
241
+ TimelineEntryVisibility["Internal"] = "internal";
242
+ TimelineEntryVisibility["Private"] = "private";
243
+ TimelineEntryVisibility["Public"] = "public";
244
+ })(TimelineEntryVisibility = exports.TimelineEntryVisibility || (exports.TimelineEntryVisibility = {}));
245
+ /** State of the user. */
246
+ var UserState;
247
+ (function (UserState) {
248
+ UserState["Active"] = "active";
249
+ UserState["Deactivated"] = "deactivated";
250
+ UserState["Locked"] = "locked";
251
+ UserState["Shadow"] = "shadow";
252
+ UserState["Unassigned"] = "unassigned";
253
+ })(UserState = exports.UserState || (exports.UserState = {}));
254
+ var UserType;
255
+ (function (UserType) {
256
+ UserType["DevUser"] = "dev_user";
257
+ UserType["RevUser"] = "rev_user";
258
+ UserType["SysUser"] = "sys_user";
259
+ })(UserType = exports.UserType || (exports.UserType = {}));
260
+ /** The event types that the webhook will receive. */
261
+ var WebhookEventType;
262
+ (function (WebhookEventType) {
263
+ WebhookEventType["PartCreated"] = "part_created";
264
+ WebhookEventType["PartDeleted"] = "part_deleted";
265
+ WebhookEventType["PartUpdated"] = "part_updated";
266
+ WebhookEventType["RevOrgCreated"] = "rev_org_created";
267
+ WebhookEventType["RevOrgDeleted"] = "rev_org_deleted";
268
+ WebhookEventType["RevOrgUpdated"] = "rev_org_updated";
269
+ WebhookEventType["RevUserCreated"] = "rev_user_created";
270
+ WebhookEventType["RevUserDeleted"] = "rev_user_deleted";
271
+ WebhookEventType["RevUserUpdated"] = "rev_user_updated";
272
+ WebhookEventType["TagCreated"] = "tag_created";
273
+ WebhookEventType["TagDeleted"] = "tag_deleted";
274
+ WebhookEventType["TagUpdated"] = "tag_updated";
275
+ WebhookEventType["TimelineEntryCreated"] = "timeline_entry_created";
276
+ WebhookEventType["TimelineEntryDeleted"] = "timeline_entry_deleted";
277
+ WebhookEventType["TimelineEntryUpdated"] = "timeline_entry_updated";
278
+ WebhookEventType["Verify"] = "verify";
279
+ WebhookEventType["WebhookCreated"] = "webhook_created";
280
+ WebhookEventType["WebhookDeleted"] = "webhook_deleted";
281
+ WebhookEventType["WebhookUpdated"] = "webhook_updated";
282
+ WebhookEventType["WorkCreated"] = "work_created";
283
+ WebhookEventType["WorkDeleted"] = "work_deleted";
284
+ WebhookEventType["WorkUpdated"] = "work_updated";
285
+ })(WebhookEventType = exports.WebhookEventType || (exports.WebhookEventType = {}));
286
+ /** The status of the webhook. */
287
+ var WebhookStatus;
288
+ (function (WebhookStatus) {
289
+ WebhookStatus["Active"] = "active";
290
+ WebhookStatus["Inactive"] = "inactive";
291
+ WebhookStatus["Unverified"] = "unverified";
292
+ })(WebhookStatus = exports.WebhookStatus || (exports.WebhookStatus = {}));
293
+ /** The action to update the webhook's status. */
294
+ var WebhooksUpdateAction;
295
+ (function (WebhooksUpdateAction) {
296
+ WebhooksUpdateAction["Activate"] = "activate";
297
+ WebhooksUpdateAction["Deactivate"] = "deactivate";
298
+ })(WebhooksUpdateAction = exports.WebhooksUpdateAction || (exports.WebhooksUpdateAction = {}));
299
+ var WorkType;
300
+ (function (WorkType) {
301
+ WorkType["Issue"] = "issue";
302
+ WorkType["Ticket"] = "ticket";
303
+ })(WorkType = exports.WorkType || (exports.WorkType = {}));
304
+ const axios_1 = __importDefault(require("axios"));
305
+ var ContentType;
306
+ (function (ContentType) {
307
+ ContentType["Json"] = "application/json";
308
+ ContentType["FormData"] = "multipart/form-data";
309
+ ContentType["UrlEncoded"] = "application/x-www-form-urlencoded";
310
+ ContentType["Text"] = "text/plain";
311
+ })(ContentType = exports.ContentType || (exports.ContentType = {}));
312
+ class HttpClient {
313
+ constructor(_a = {}) {
314
+ var { securityWorker, secure, format } = _a, axiosConfig = __rest(_a, ["securityWorker", "secure", "format"]);
315
+ this.securityData = null;
316
+ this.setSecurityData = (data) => {
317
+ this.securityData = data;
318
+ };
319
+ this.request = (_b) => __awaiter(this, void 0, void 0, function* () {
320
+ var { secure, path, type, query, format, body } = _b, params = __rest(_b, ["secure", "path", "type", "query", "format", "body"]);
321
+ const secureParams = ((typeof secure === 'boolean' ? secure : this.secure) &&
322
+ this.securityWorker &&
323
+ (yield this.securityWorker(this.securityData))) ||
324
+ {};
325
+ const requestParams = this.mergeRequestParams(params, secureParams);
326
+ const responseFormat = format || this.format || undefined;
327
+ if (type === ContentType.FormData &&
328
+ body &&
329
+ body !== null &&
330
+ typeof body === 'object') {
331
+ body = this.createFormData(body);
332
+ }
333
+ if (type === ContentType.Text &&
334
+ body &&
335
+ body !== null &&
336
+ typeof body !== 'string') {
337
+ body = JSON.stringify(body);
338
+ }
339
+ return this.instance.request(Object.assign(Object.assign({}, requestParams), { headers: Object.assign(Object.assign({}, (requestParams.headers || {})), (type && type !== ContentType.FormData
340
+ ? { 'Content-Type': type }
341
+ : {})), params: query, responseType: responseFormat, data: body, url: path }));
342
+ });
343
+ this.instance = axios_1.default.create(Object.assign(Object.assign({}, axiosConfig), { baseURL: axiosConfig.baseURL || '{protocol}://{hostname}' }));
344
+ this.secure = secure;
345
+ this.format = format;
346
+ this.securityWorker = securityWorker;
347
+ }
348
+ mergeRequestParams(params1, params2) {
349
+ const method = params1.method || (params2 && params2.method);
350
+ return Object.assign(Object.assign(Object.assign(Object.assign({}, this.instance.defaults), params1), (params2 || {})), { headers: Object.assign(Object.assign(Object.assign({}, ((method &&
351
+ this.instance.defaults.headers[method.toLowerCase()]) ||
352
+ {})), (params1.headers || {})), ((params2 && params2.headers) || {})) });
353
+ }
354
+ stringifyFormItem(formItem) {
355
+ if (typeof formItem === 'object' && formItem !== null) {
356
+ return JSON.stringify(formItem);
357
+ }
358
+ else {
359
+ return `${formItem}`;
360
+ }
361
+ }
362
+ createFormData(input) {
363
+ return Object.keys(input || {}).reduce((formData, key) => {
364
+ const property = input[key];
365
+ const propertyContent = property instanceof Array ? property : [property];
366
+ for (const formItem of propertyContent) {
367
+ const isFileType = formItem instanceof Blob || formItem instanceof File;
368
+ formData.append(key, isFileType ? formItem : this.stringifyFormItem(formItem));
369
+ }
370
+ return formData;
371
+ }, new FormData());
372
+ }
373
+ }
374
+ exports.HttpClient = HttpClient;
375
+ /**
376
+ * @title DevRev REST API
377
+ * @version 2022-10-20
378
+ * @baseUrl {protocol}://{hostname}
379
+ *
380
+ * DevRev's REST API.
381
+ */
382
+ class Api extends HttpClient {
383
+ constructor() {
384
+ super(...arguments);
385
+ /**
386
+ * @description Gets the download URL for the artifact.
387
+ *
388
+ * @tags artifacts
389
+ * @name ArtifactsLocate
390
+ * @request GET:/artifacts.locate
391
+ * @secure
392
+ */
393
+ this.artifactsLocate = (query, params = {}) => this.request(Object.assign({ path: `/artifacts.locate`, method: 'GET', query: query, secure: true, format: 'json' }, params));
394
+ /**
395
+ * @description Creates an artifact and generates an upload URL for its data.
396
+ *
397
+ * @tags artifacts
398
+ * @name ArtifactsPrepare
399
+ * @request POST:/artifacts.prepare
400
+ * @secure
401
+ */
402
+ this.artifactsPrepare = (data, params = {}) => this.request(Object.assign({ path: `/artifacts.prepare`, method: 'POST', body: data, secure: true, type: ContentType.Json, format: 'json' }, params));
403
+ /**
404
+ * @description Creates a JWT corresponding to the requested token type for the authenticated user.
405
+ *
406
+ * @tags auth-tokens
407
+ * @name AuthTokensCreate
408
+ * @request POST:/auth-tokens.create
409
+ * @secure
410
+ */
411
+ this.authTokensCreate = (data, params = {}) => this.request(Object.assign({ path: `/auth-tokens.create`, method: 'POST', body: data, secure: true, type: ContentType.Json, format: 'json' }, params));
412
+ /**
413
+ * @description Revokes the token that matches the given token ID issued under the given Dev organization.
414
+ *
415
+ * @tags auth-tokens
416
+ * @name AuthTokensDelete
417
+ * @request POST:/auth-tokens.delete
418
+ * @secure
419
+ */
420
+ this.authTokensDelete = (data, params = {}) => this.request(Object.assign({ path: `/auth-tokens.delete`, method: 'POST', body: data, secure: true, type: ContentType.Json }, params));
421
+ /**
422
+ * @description Gets the token metadata corresponding to the given token ID under the given Dev organization.
423
+ *
424
+ * @tags auth-tokens
425
+ * @name AuthTokensGet
426
+ * @request GET:/auth-tokens.get
427
+ * @secure
428
+ */
429
+ this.authTokensGet = (query, params = {}) => this.request(Object.assign({ path: `/auth-tokens.get`, method: 'GET', query: query, secure: true, format: 'json' }, params));
430
+ /**
431
+ * @description Gets the token metadata for all the tokens corresponding to the given token type issued for a given subject.
432
+ *
433
+ * @tags auth-tokens
434
+ * @name AuthTokensList
435
+ * @request GET:/auth-tokens.list
436
+ * @secure
437
+ */
438
+ this.authTokensList = (query, params = {}) => this.request(Object.assign({ path: `/auth-tokens.list`, method: 'GET', query: query, secure: true, format: 'json' }, params));
439
+ /**
440
+ * @description Revokes all the tokens that matches the given token type created by the authenticated user.
441
+ *
442
+ * @tags auth-tokens
443
+ * @name AuthTokensSelfDelete
444
+ * @request POST:/auth-tokens.self.delete
445
+ * @secure
446
+ */
447
+ this.authTokensSelfDelete = (data, params = {}) => this.request(Object.assign({ path: `/auth-tokens.self.delete`, method: 'POST', body: data, secure: true, type: ContentType.Json }, params));
448
+ /**
449
+ * @description Updates token metadata of a token issued under a given Dev organization.
450
+ *
451
+ * @tags auth-tokens
452
+ * @name AuthTokensUpdate
453
+ * @request POST:/auth-tokens.update
454
+ * @secure
455
+ */
456
+ this.authTokensUpdate = (data, params = {}) => this.request(Object.assign({ path: `/auth-tokens.update`, method: 'POST', body: data, secure: true, type: ContentType.Json, format: 'json' }, params));
457
+ /**
458
+ * @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.
459
+ *
460
+ * @tags auth-connection, dev-orgs
461
+ * @name DevOrgAuthConnectionsCreate
462
+ * @request POST:/dev-orgs.auth-connections.create
463
+ * @secure
464
+ */
465
+ 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));
466
+ /**
467
+ * @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.
468
+ *
469
+ * @tags auth-connection, dev-orgs
470
+ * @name DevOrgAuthConnectionsDelete
471
+ * @request POST:/dev-orgs.auth-connections.delete
472
+ * @secure
473
+ */
474
+ this.devOrgAuthConnectionsDelete = (data, params = {}) => this.request(Object.assign({ path: `/dev-orgs.auth-connections.delete`, method: 'POST', body: data, secure: true, type: ContentType.Json }, params));
475
+ /**
476
+ * @description Retrieves the details for an authentication connection.
477
+ *
478
+ * @tags auth-connection, dev-orgs
479
+ * @name DevOrgAuthConnectionsGet
480
+ * @request GET:/dev-orgs.auth-connections.get
481
+ * @secure
482
+ */
483
+ this.devOrgAuthConnectionsGet = (query, params = {}) => this.request(Object.assign({ path: `/dev-orgs.auth-connections.get`, method: 'GET', query: query, secure: true, format: 'json' }, params));
484
+ /**
485
+ * @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.
486
+ *
487
+ * @tags auth-connection, dev-orgs
488
+ * @name DevOrgAuthConnectionsList
489
+ * @request GET:/dev-orgs.auth-connections.list
490
+ * @secure
491
+ */
492
+ this.devOrgAuthConnectionsList = (params = {}) => this.request(Object.assign({ path: `/dev-orgs.auth-connections.list`, method: 'GET', secure: true, format: 'json' }, params));
493
+ /**
494
+ * @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.
495
+ *
496
+ * @tags auth-connection, dev-orgs
497
+ * @name DevOrgAuthConnectionsToggle
498
+ * @request POST:/dev-orgs.auth-connections.toggle
499
+ * @secure
500
+ */
501
+ this.devOrgAuthConnectionsToggle = (data, params = {}) => this.request(Object.assign({ path: `/dev-orgs.auth-connections.toggle`, method: 'POST', body: data, secure: true, type: ContentType.Json }, params));
502
+ /**
503
+ * @description Updates an authentication connection.
504
+ *
505
+ * @tags auth-connection, dev-orgs
506
+ * @name DevOrgAuthConnectionsUpdate
507
+ * @request POST:/dev-orgs.auth-connections.update
508
+ * @secure
509
+ */
510
+ 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));
511
+ /**
512
+ * @description Lists users within your organization.
513
+ *
514
+ * @tags dev-users
515
+ * @name DevUsersList
516
+ * @request GET:/dev-users.list
517
+ * @secure
518
+ */
519
+ this.devUsersList = (query, params = {}) => this.request(Object.assign({ path: `/dev-users.list`, method: 'GET', query: query, secure: true, format: 'json' }, params));
520
+ /**
521
+ * @description Gets the authenticated user's information.
522
+ *
523
+ * @tags dev-users
524
+ * @name DevUsersSelf
525
+ * @request GET:/dev-users.self
526
+ * @secure
527
+ */
528
+ this.devUsersSelf = (params = {}) => this.request(Object.assign({ path: `/dev-users.self`, method: 'GET', secure: true, format: 'json' }, params));
529
+ /**
530
+ * @description Creates new [part](https://devrev.ai/docs/product/parts).
531
+ *
532
+ * @tags parts
533
+ * @name PartsCreate
534
+ * @request POST:/parts.create
535
+ * @secure
536
+ */
537
+ this.partsCreate = (data, params = {}) => this.request(Object.assign({ path: `/parts.create`, method: 'POST', body: data, secure: true, type: ContentType.Json, format: 'json' }, params));
538
+ /**
539
+ * @description Deletes a [part](https://devrev.ai/docs/product/parts).
540
+ *
541
+ * @tags parts
542
+ * @name PartsDelete
543
+ * @request POST:/parts.delete
544
+ * @secure
545
+ */
546
+ this.partsDelete = (data, params = {}) => this.request(Object.assign({ path: `/parts.delete`, method: 'POST', body: data, secure: true, type: ContentType.Json, format: 'json' }, params));
547
+ /**
548
+ * @description Gets a [part's](https://devrev.ai/docs/product/parts) information.
549
+ *
550
+ * @tags parts
551
+ * @name PartsGet
552
+ * @request GET:/parts.get
553
+ * @secure
554
+ */
555
+ this.partsGet = (query, params = {}) => this.request(Object.assign({ path: `/parts.get`, method: 'GET', query: query, secure: true, format: 'json' }, params));
556
+ /**
557
+ * @description Lists a collection of [parts](https://devrev.ai/docs/product/parts).
558
+ *
559
+ * @tags parts
560
+ * @name PartsList
561
+ * @request GET:/parts.list
562
+ * @secure
563
+ */
564
+ this.partsList = (query, params = {}) => this.request(Object.assign({ path: `/parts.list`, method: 'GET', query: query, secure: true, format: 'json' }, params));
565
+ /**
566
+ * @description Updates a [part's](https://devrev.ai/docs/product/parts) information.
567
+ *
568
+ * @tags parts
569
+ * @name PartsUpdate
570
+ * @request POST:/parts.update
571
+ * @secure
572
+ */
573
+ this.partsUpdate = (data, params = {}) => this.request(Object.assign({ path: `/parts.update`, method: 'POST', body: data, secure: true, type: ContentType.Json, format: 'json' }, params));
574
+ /**
575
+ * @description Creates a Rev organization in the authenticated user's Dev organization.
576
+ *
577
+ * @tags rev-orgs
578
+ * @name RevOrgsCreate
579
+ * @request POST:/rev-orgs.create
580
+ * @secure
581
+ */
582
+ this.revOrgsCreate = (data, params = {}) => this.request(Object.assign({ path: `/rev-orgs.create`, method: 'POST', body: data, secure: true, type: ContentType.Json, format: 'json' }, params));
583
+ /**
584
+ * @description Deletes the Rev organization.
585
+ *
586
+ * @tags rev-orgs
587
+ * @name RevOrgsDelete
588
+ * @request POST:/rev-orgs.delete
589
+ * @secure
590
+ */
591
+ this.revOrgsDelete = (data, params = {}) => this.request(Object.assign({ path: `/rev-orgs.delete`, method: 'POST', body: data, secure: true, type: ContentType.Json, format: 'json' }, params));
592
+ /**
593
+ * @description Retrieves the Rev organization's information.
594
+ *
595
+ * @tags rev-orgs
596
+ * @name RevOrgsGet
597
+ * @request GET:/rev-orgs.get
598
+ * @secure
599
+ */
600
+ this.revOrgsGet = (query, params = {}) => this.request(Object.assign({ path: `/rev-orgs.get`, method: 'GET', query: query, secure: true, format: 'json' }, params));
601
+ /**
602
+ * @description Gets the list of Rev organizations' information belonging to the authenticated user's Dev Organization which the user is also authorized to access.
603
+ *
604
+ * @tags rev-orgs
605
+ * @name RevOrgsList
606
+ * @request GET:/rev-orgs.list
607
+ * @secure
608
+ */
609
+ this.revOrgsList = (query, params = {}) => this.request(Object.assign({ path: `/rev-orgs.list`, method: 'GET', query: query, secure: true, format: 'json' }, params));
610
+ /**
611
+ * @description Updates the Rev organization's information.
612
+ *
613
+ * @tags rev-orgs
614
+ * @name RevOrgsUpdate
615
+ * @request POST:/rev-orgs.update
616
+ * @secure
617
+ */
618
+ this.revOrgsUpdate = (data, params = {}) => this.request(Object.assign({ path: `/rev-orgs.update`, method: 'POST', body: data, secure: true, type: ContentType.Json, format: 'json' }, params));
619
+ /**
620
+ * @description Creates a new tag, which is used to create associations between objects and a logical concept denoted by the tag's name.
621
+ *
622
+ * @tags tags
623
+ * @name TagsCreate
624
+ * @request POST:/tags.create
625
+ * @secure
626
+ */
627
+ this.tagsCreate = (data, params = {}) => this.request(Object.assign({ path: `/tags.create`, method: 'POST', body: data, secure: true, type: ContentType.Json, format: 'json' }, params));
628
+ /**
629
+ * @description Deletes a tag.
630
+ *
631
+ * @tags tags
632
+ * @name TagsDelete
633
+ * @request POST:/tags.delete
634
+ * @secure
635
+ */
636
+ this.tagsDelete = (data, params = {}) => this.request(Object.assign({ path: `/tags.delete`, method: 'POST', body: data, secure: true, type: ContentType.Json, format: 'json' }, params));
637
+ /**
638
+ * @description Gets a tag's information.
639
+ *
640
+ * @tags tags
641
+ * @name TagsGet
642
+ * @request GET:/tags.get
643
+ * @secure
644
+ */
645
+ this.tagsGet = (query, params = {}) => this.request(Object.assign({ path: `/tags.get`, method: 'GET', query: query, secure: true, format: 'json' }, params));
646
+ /**
647
+ * @description Lists the available tags.
648
+ *
649
+ * @tags tags
650
+ * @name TagsList
651
+ * @request GET:/tags.list
652
+ * @secure
653
+ */
654
+ this.tagsList = (query, params = {}) => this.request(Object.assign({ path: `/tags.list`, method: 'GET', query: query, secure: true, format: 'json' }, params));
655
+ /**
656
+ * @description Updates a tag's information.
657
+ *
658
+ * @tags tags
659
+ * @name TagsUpdate
660
+ * @request POST:/tags.update
661
+ * @secure
662
+ */
663
+ this.tagsUpdate = (data, params = {}) => this.request(Object.assign({ path: `/tags.update`, method: 'POST', body: data, secure: true, type: ContentType.Json, format: 'json' }, params));
664
+ /**
665
+ * @description Creates a new entry on an object's timeline.
666
+ *
667
+ * @tags timeline-entries
668
+ * @name TimelineEntriesCreate
669
+ * @request POST:/timeline-entries.create
670
+ * @secure
671
+ */
672
+ this.timelineEntriesCreate = (data, params = {}) => this.request(Object.assign({ path: `/timeline-entries.create`, method: 'POST', body: data, secure: true, type: ContentType.Json, format: 'json' }, params));
673
+ /**
674
+ * @description Deletes an entry from an object's timeline.
675
+ *
676
+ * @tags timeline-entries
677
+ * @name TimelineEntriesDelete
678
+ * @request POST:/timeline-entries.delete
679
+ * @secure
680
+ */
681
+ this.timelineEntriesDelete = (data, params = {}) => this.request(Object.assign({ path: `/timeline-entries.delete`, method: 'POST', body: data, secure: true, type: ContentType.Json, format: 'json' }, params));
682
+ /**
683
+ * @description Gets an entry on an object's timeline.
684
+ *
685
+ * @tags timeline-entries
686
+ * @name TimelineEntriesGet
687
+ * @request GET:/timeline-entries.get
688
+ * @secure
689
+ */
690
+ this.timelineEntriesGet = (query, params = {}) => this.request(Object.assign({ path: `/timeline-entries.get`, method: 'GET', query: query, secure: true, format: 'json' }, params));
691
+ /**
692
+ * @description Lists the timeline entries for an object.
693
+ *
694
+ * @tags timeline-entries
695
+ * @name TimelineEntriesList
696
+ * @request GET:/timeline-entries.list
697
+ * @secure
698
+ */
699
+ this.timelineEntriesList = (query, params = {}) => this.request(Object.assign({ path: `/timeline-entries.list`, method: 'GET', query: query, secure: true, format: 'json' }, params));
700
+ /**
701
+ * @description Updates an entry on an object's timeline.
702
+ *
703
+ * @tags timeline-entries
704
+ * @name TimelineEntriesUpdate
705
+ * @request POST:/timeline-entries.update
706
+ * @secure
707
+ */
708
+ this.timelineEntriesUpdate = (data, params = {}) => this.request(Object.assign({ path: `/timeline-entries.update`, method: 'POST', body: data, secure: true, type: ContentType.Json, format: 'json' }, params));
709
+ /**
710
+ * @description Creates a new webhook target.
711
+ *
712
+ * @tags webhooks
713
+ * @name WebhooksCreate
714
+ * @request POST:/webhooks.create
715
+ * @secure
716
+ */
717
+ this.webhooksCreate = (data, params = {}) => this.request(Object.assign({ path: `/webhooks.create`, method: 'POST', body: data, secure: true, type: ContentType.Json, format: 'json' }, params));
718
+ /**
719
+ * @description Deletes the requested webhook.
720
+ *
721
+ * @tags webhooks
722
+ * @name WebhooksDelete
723
+ * @request POST:/webhooks.delete
724
+ * @secure
725
+ */
726
+ this.webhooksDelete = (data, params = {}) => this.request(Object.assign({ path: `/webhooks.delete`, method: 'POST', body: data, secure: true, type: ContentType.Json, format: 'json' }, params));
727
+ /**
728
+ * @description Gets the requested webhook's information.
729
+ *
730
+ * @tags webhooks
731
+ * @name WebhooksGet
732
+ * @request GET:/webhooks.get
733
+ * @secure
734
+ */
735
+ this.webhooksGet = (query, params = {}) => this.request(Object.assign({ path: `/webhooks.get`, method: 'GET', query: query, secure: true, format: 'json' }, params));
736
+ /**
737
+ * @description Lists the webhooks.
738
+ *
739
+ * @tags webhooks
740
+ * @name WebhooksList
741
+ * @request GET:/webhooks.list
742
+ * @secure
743
+ */
744
+ this.webhooksList = (params = {}) => this.request(Object.assign({ path: `/webhooks.list`, method: 'GET', secure: true, format: 'json' }, params));
745
+ /**
746
+ * @description Updates the requested webhook.
747
+ *
748
+ * @tags webhooks
749
+ * @name WebhooksUpdate
750
+ * @request POST:/webhooks.update
751
+ * @secure
752
+ */
753
+ this.webhooksUpdate = (data, params = {}) => this.request(Object.assign({ path: `/webhooks.update`, method: 'POST', body: data, secure: true, type: ContentType.Json, format: 'json' }, params));
754
+ /**
755
+ * @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.
756
+ *
757
+ * @tags works
758
+ * @name WorksCreate
759
+ * @request POST:/works.create
760
+ * @secure
761
+ */
762
+ this.worksCreate = (data, params = {}) => this.request(Object.assign({ path: `/works.create`, method: 'POST', body: data, secure: true, type: ContentType.Json, format: 'json' }, params));
763
+ /**
764
+ * @description Deletes a work item.
765
+ *
766
+ * @tags works
767
+ * @name WorksDelete
768
+ * @request POST:/works.delete
769
+ * @secure
770
+ */
771
+ this.worksDelete = (data, params = {}) => this.request(Object.assign({ path: `/works.delete`, method: 'POST', body: data, secure: true, type: ContentType.Json, format: 'json' }, params));
772
+ /**
773
+ * @description Exports a collection of work items.
774
+ *
775
+ * @tags works
776
+ * @name WorksExport
777
+ * @request GET:/works.export
778
+ * @secure
779
+ */
780
+ this.worksExport = (query, params = {}) => this.request(Object.assign({ path: `/works.export`, method: 'GET', query: query, secure: true, format: 'json' }, params));
781
+ /**
782
+ * @description Gets a work item's information.
783
+ *
784
+ * @tags works
785
+ * @name WorksGet
786
+ * @request GET:/works.get
787
+ * @secure
788
+ */
789
+ this.worksGet = (query, params = {}) => this.request(Object.assign({ path: `/works.get`, method: 'GET', query: query, secure: true, format: 'json' }, params));
790
+ /**
791
+ * @description Lists a collection of work items.
792
+ *
793
+ * @tags works
794
+ * @name WorksList
795
+ * @request GET:/works.list
796
+ * @secure
797
+ */
798
+ this.worksList = (query, params = {}) => this.request(Object.assign({ path: `/works.list`, method: 'GET', query: query, secure: true, format: 'json' }, params));
799
+ /**
800
+ * @description Updates a work item's information.
801
+ *
802
+ * @tags works
803
+ * @name WorksUpdate
804
+ * @request POST:/works.update
805
+ * @secure
806
+ */
807
+ this.worksUpdate = (data, params = {}) => this.request(Object.assign({ path: `/works.update`, method: 'POST', body: data, secure: true, type: ContentType.Json, format: 'json' }, params));
808
+ }
809
+ }
810
+ exports.Api = Api;