@randock/nameshift-api-client 0.0.552 → 0.0.553

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.
Files changed (138) hide show
  1. package/.openapi-generator/FILES +39 -0
  2. package/README.md +3 -3
  3. package/dist/apis/AutomationsApi.d.ts +160 -0
  4. package/dist/apis/AutomationsApi.js +748 -0
  5. package/dist/apis/index.d.ts +1 -0
  6. package/dist/apis/index.js +1 -0
  7. package/dist/models/AutomationActionDto.d.ts +45 -0
  8. package/dist/models/AutomationActionDto.js +60 -0
  9. package/dist/models/AutomationActionInput.d.ts +45 -0
  10. package/dist/models/AutomationActionInput.js +56 -0
  11. package/dist/models/AutomationActionStatusEnum.d.ts +26 -0
  12. package/dist/models/AutomationActionStatusEnum.js +52 -0
  13. package/dist/models/AutomationActionTypeEnum.d.ts +27 -0
  14. package/dist/models/AutomationActionTypeEnum.js +53 -0
  15. package/dist/models/AutomationAggregateEnum.d.ts +24 -0
  16. package/dist/models/AutomationAggregateEnum.js +50 -0
  17. package/dist/models/AutomationCatalogDelayUnitDto.d.ts +45 -0
  18. package/dist/models/AutomationCatalogDelayUnitDto.js +60 -0
  19. package/dist/models/AutomationCatalogDto.d.ts +77 -0
  20. package/dist/models/AutomationCatalogDto.js +82 -0
  21. package/dist/models/AutomationCatalogFactDto.d.ts +54 -0
  22. package/dist/models/AutomationCatalogFactDto.js +67 -0
  23. package/dist/models/AutomationCatalogTriggerDto.d.ts +60 -0
  24. package/dist/models/AutomationCatalogTriggerDto.js +71 -0
  25. package/dist/models/AutomationConditionDto.d.ts +65 -0
  26. package/dist/models/AutomationConditionDto.js +76 -0
  27. package/dist/models/AutomationConditionEvaluationDto.d.ts +77 -0
  28. package/dist/models/AutomationConditionEvaluationDto.js +84 -0
  29. package/dist/models/AutomationConditionGroupDto.d.ts +53 -0
  30. package/dist/models/AutomationConditionGroupDto.js +68 -0
  31. package/dist/models/AutomationConditionGroupDtoChildrenInner.d.ts +27 -0
  32. package/dist/models/AutomationConditionGroupDtoChildrenInner.js +54 -0
  33. package/dist/models/AutomationConditionGroupEvaluationDto.d.ts +59 -0
  34. package/dist/models/AutomationConditionGroupEvaluationDto.js +72 -0
  35. package/dist/models/AutomationConditionGroupEvaluationDtoChildrenInner.d.ts +27 -0
  36. package/dist/models/AutomationConditionGroupEvaluationDtoChildrenInner.js +54 -0
  37. package/dist/models/AutomationConditionGroupInput.d.ts +53 -0
  38. package/dist/models/AutomationConditionGroupInput.js +68 -0
  39. package/dist/models/AutomationConditionGroupInputChildrenInner.d.ts +27 -0
  40. package/dist/models/AutomationConditionGroupInputChildrenInner.js +54 -0
  41. package/dist/models/AutomationConditionInput.d.ts +65 -0
  42. package/dist/models/AutomationConditionInput.js +74 -0
  43. package/dist/models/AutomationDelayDto.d.ts +39 -0
  44. package/dist/models/AutomationDelayDto.js +56 -0
  45. package/dist/models/AutomationDelayInput.d.ts +39 -0
  46. package/dist/models/AutomationDelayInput.js +56 -0
  47. package/dist/models/AutomationDelayUnitEnum.d.ts +25 -0
  48. package/dist/models/AutomationDelayUnitEnum.js +51 -0
  49. package/dist/models/AutomationDto.d.ts +96 -0
  50. package/dist/models/AutomationDto.js +95 -0
  51. package/dist/models/AutomationFactEnum.d.ts +36 -0
  52. package/dist/models/AutomationFactEnum.js +62 -0
  53. package/dist/models/AutomationFactGroupEnum.d.ts +27 -0
  54. package/dist/models/AutomationFactGroupEnum.js +53 -0
  55. package/dist/models/AutomationFactValueTypeEnum.d.ts +30 -0
  56. package/dist/models/AutomationFactValueTypeEnum.js +56 -0
  57. package/dist/models/AutomationGroupOperatorEnum.d.ts +25 -0
  58. package/dist/models/AutomationGroupOperatorEnum.js +51 -0
  59. package/dist/models/AutomationInput.d.ts +66 -0
  60. package/dist/models/AutomationInput.js +71 -0
  61. package/dist/models/AutomationOperatorEnum.d.ts +37 -0
  62. package/dist/models/AutomationOperatorEnum.js +63 -0
  63. package/dist/models/AutomationRunActionDto.d.ts +46 -0
  64. package/dist/models/AutomationRunActionDto.js +61 -0
  65. package/dist/models/AutomationRunAutomationDto.d.ts +58 -0
  66. package/dist/models/AutomationRunAutomationDto.js +69 -0
  67. package/dist/models/AutomationRunDto.d.ts +65 -0
  68. package/dist/models/AutomationRunDto.js +74 -0
  69. package/dist/models/AutomationRunLeadDto.d.ts +44 -0
  70. package/dist/models/AutomationRunLeadDto.js +59 -0
  71. package/dist/models/AutomationSimulationDto.d.ts +64 -0
  72. package/dist/models/AutomationSimulationDto.js +73 -0
  73. package/dist/models/AutomationStatusInput.d.ts +32 -0
  74. package/dist/models/AutomationStatusInput.js +51 -0
  75. package/dist/models/AutomationTriggerEnum.d.ts +28 -0
  76. package/dist/models/AutomationTriggerEnum.js +54 -0
  77. package/dist/models/FeatureFlagListItemDto.d.ts +1 -0
  78. package/dist/models/FeatureFlagListItemDto.js +2 -1
  79. package/dist/models/GetAutomationRuns200Response.d.ts +47 -0
  80. package/dist/models/GetAutomationRuns200Response.js +62 -0
  81. package/dist/models/GetAutomations200Response.d.ts +47 -0
  82. package/dist/models/GetAutomations200Response.js +62 -0
  83. package/dist/models/IntersectionAccountDtoWithSettingsDtoWithNotificationsDtoWithFeatureFlagsDto.d.ts +1 -0
  84. package/dist/models/IntersectionAccountDtoWithSettingsDtoWithNotificationsDtoWithFeatureFlagsDto.js +2 -1
  85. package/dist/models/LeadMessageDto.d.ts +6 -0
  86. package/dist/models/LeadMessageDto.js +4 -0
  87. package/dist/models/PrivateAccountGetMeResponse.d.ts +1 -0
  88. package/dist/models/PrivateAccountGetMeResponse.js +2 -1
  89. package/dist/models/SimulateAutomationsInput.d.ts +70 -0
  90. package/dist/models/SimulateAutomationsInput.js +69 -0
  91. package/dist/models/index.d.ts +38 -0
  92. package/dist/models/index.js +38 -0
  93. package/package.json +1 -1
  94. package/src/apis/AutomationsApi.ts +622 -0
  95. package/src/apis/index.ts +1 -0
  96. package/src/models/AutomationActionDto.ts +94 -0
  97. package/src/models/AutomationActionInput.ts +92 -0
  98. package/src/models/AutomationActionStatusEnum.ts +54 -0
  99. package/src/models/AutomationActionTypeEnum.ts +55 -0
  100. package/src/models/AutomationAggregateEnum.ts +52 -0
  101. package/src/models/AutomationCatalogDelayUnitDto.ts +94 -0
  102. package/src/models/AutomationCatalogDto.ts +151 -0
  103. package/src/models/AutomationCatalogFactDto.ts +124 -0
  104. package/src/models/AutomationCatalogTriggerDto.ts +133 -0
  105. package/src/models/AutomationConditionDto.ts +127 -0
  106. package/src/models/AutomationConditionEvaluationDto.ts +145 -0
  107. package/src/models/AutomationConditionGroupDto.ts +109 -0
  108. package/src/models/AutomationConditionGroupDtoChildrenInner.ts +73 -0
  109. package/src/models/AutomationConditionGroupEvaluationDto.ts +118 -0
  110. package/src/models/AutomationConditionGroupEvaluationDtoChildrenInner.ts +73 -0
  111. package/src/models/AutomationConditionGroupInput.ts +109 -0
  112. package/src/models/AutomationConditionGroupInputChildrenInner.ts +73 -0
  113. package/src/models/AutomationConditionInput.ts +126 -0
  114. package/src/models/AutomationDelayDto.ts +85 -0
  115. package/src/models/AutomationDelayInput.ts +85 -0
  116. package/src/models/AutomationDelayUnitEnum.ts +53 -0
  117. package/src/models/AutomationDto.ts +187 -0
  118. package/src/models/AutomationFactEnum.ts +64 -0
  119. package/src/models/AutomationFactGroupEnum.ts +55 -0
  120. package/src/models/AutomationFactValueTypeEnum.ts +58 -0
  121. package/src/models/AutomationGroupOperatorEnum.ts +53 -0
  122. package/src/models/AutomationInput.ts +140 -0
  123. package/src/models/AutomationOperatorEnum.ts +65 -0
  124. package/src/models/AutomationRunActionDto.ts +101 -0
  125. package/src/models/AutomationRunAutomationDto.ts +117 -0
  126. package/src/models/AutomationRunDto.ts +135 -0
  127. package/src/models/AutomationRunLeadDto.ts +84 -0
  128. package/src/models/AutomationSimulationDto.ts +126 -0
  129. package/src/models/AutomationStatusInput.ts +66 -0
  130. package/src/models/AutomationTriggerEnum.ts +56 -0
  131. package/src/models/FeatureFlagListItemDto.ts +2 -1
  132. package/src/models/GetAutomationRuns200Response.ts +106 -0
  133. package/src/models/GetAutomations200Response.ts +106 -0
  134. package/src/models/IntersectionAccountDtoWithSettingsDtoWithNotificationsDtoWithFeatureFlagsDto.ts +2 -1
  135. package/src/models/LeadMessageDto.ts +9 -0
  136. package/src/models/PrivateAccountGetMeResponse.ts +2 -1
  137. package/src/models/SimulateAutomationsInput.ts +133 -0
  138. package/src/models/index.ts +38 -0
@@ -0,0 +1,622 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Nameshift
5
+ * Nameshift domain marketplace and management API. ## Authentication - **Bearer JWT** — Seller and buyer sessions obtained via login endpoints. - **API key** — Pass the `apikey` header for programmatic seller access. ## Audiences - **(public)** tags — Unauthenticated or buyer-facing endpoints. - **Accounts / Domains / Leads / Buyers** — Seller or buyer resources. - **Partner** — Partner integrations.
6
+ *
7
+ * The version of the OpenAPI document: 1.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ import * as runtime from '../runtime';
17
+ import type {
18
+ AutomationCatalogDto,
19
+ AutomationDto,
20
+ AutomationInput,
21
+ AutomationRunDto,
22
+ AutomationSimulationDto,
23
+ AutomationStatusInput,
24
+ GetAutomationRuns200Response,
25
+ GetAutomations200Response,
26
+ SimulateAutomationsInput,
27
+ ValidationException,
28
+ } from '../models/index';
29
+ import {
30
+ AutomationCatalogDtoFromJSON,
31
+ AutomationCatalogDtoToJSON,
32
+ AutomationDtoFromJSON,
33
+ AutomationDtoToJSON,
34
+ AutomationInputFromJSON,
35
+ AutomationInputToJSON,
36
+ AutomationRunDtoFromJSON,
37
+ AutomationRunDtoToJSON,
38
+ AutomationSimulationDtoFromJSON,
39
+ AutomationSimulationDtoToJSON,
40
+ AutomationStatusInputFromJSON,
41
+ AutomationStatusInputToJSON,
42
+ GetAutomationRuns200ResponseFromJSON,
43
+ GetAutomationRuns200ResponseToJSON,
44
+ GetAutomations200ResponseFromJSON,
45
+ GetAutomations200ResponseToJSON,
46
+ SimulateAutomationsInputFromJSON,
47
+ SimulateAutomationsInputToJSON,
48
+ ValidationExceptionFromJSON,
49
+ ValidationExceptionToJSON,
50
+ } from '../models/index';
51
+
52
+ export interface AutomationsApiCreateAutomationRequest {
53
+ automationInput: AutomationInput;
54
+ }
55
+
56
+ export interface AutomationsApiDeleteAutomationRequest {
57
+ automationId: string;
58
+ }
59
+
60
+ export interface AutomationsApiGetAutomationRequest {
61
+ automationId: string;
62
+ }
63
+
64
+ export interface AutomationsApiGetAutomationRunsRequest {
65
+ filter?: { [key: string]: string; };
66
+ page?: number;
67
+ limit?: number;
68
+ filterAutomationId?: string;
69
+ filterLeadId?: string;
70
+ filterTrigger?: string;
71
+ filterMatched?: string;
72
+ }
73
+
74
+ export interface AutomationsApiGetAutomationsRequest {
75
+ filter?: { [key: string]: string; };
76
+ page?: number;
77
+ limit?: number;
78
+ sortBy?: Array<string>;
79
+ }
80
+
81
+ export interface AutomationsApiGetLeadAutomationRunsRequest {
82
+ leadId: string;
83
+ }
84
+
85
+ export interface AutomationsApiSimulateAutomationsRequest {
86
+ simulateAutomationsInput: SimulateAutomationsInput;
87
+ }
88
+
89
+ export interface AutomationsApiUpdateAutomationRequest {
90
+ automationId: string;
91
+ automationInput: AutomationInput;
92
+ }
93
+
94
+ export interface AutomationsApiUpdateAutomationStatusRequest {
95
+ automationId: string;
96
+ automationStatusInput: AutomationStatusInput;
97
+ }
98
+
99
+ /**
100
+ *
101
+ */
102
+ export class AutomationsApi extends runtime.BaseAPI {
103
+
104
+ /**
105
+ * Creates an automation for the seller account. **API key scope required:** `LEADS_WRITE`. Requests authenticated with a seller session do not need any scope.
106
+ * Create an automation
107
+ */
108
+ async createAutomationRaw(requestParameters: AutomationsApiCreateAutomationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AutomationDto>> {
109
+ if (requestParameters['automationInput'] == null) {
110
+ throw new runtime.RequiredError(
111
+ 'automationInput',
112
+ 'Required parameter "automationInput" was null or undefined when calling createAutomation().'
113
+ );
114
+ }
115
+
116
+ const queryParameters: any = {};
117
+
118
+ const headerParameters: runtime.HTTPHeaders = {};
119
+
120
+ headerParameters['Content-Type'] = 'application/json';
121
+
122
+ if (this.configuration && this.configuration.apiKey) {
123
+ headerParameters["apikey"] = await this.configuration.apiKey("apikey"); // api_key authentication
124
+ }
125
+
126
+ if (this.configuration && this.configuration.accessToken) {
127
+ const token = this.configuration.accessToken;
128
+ const tokenString = await token("bearer", []);
129
+
130
+ if (tokenString) {
131
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
132
+ }
133
+ }
134
+ const response = await this.request({
135
+ path: `/private/automations`,
136
+ method: 'POST',
137
+ headers: headerParameters,
138
+ query: queryParameters,
139
+ body: AutomationInputToJSON(requestParameters['automationInput']),
140
+ }, initOverrides);
141
+
142
+ return new runtime.JSONApiResponse(response, (jsonValue) => AutomationDtoFromJSON(jsonValue));
143
+ }
144
+
145
+ /**
146
+ * Creates an automation for the seller account. **API key scope required:** `LEADS_WRITE`. Requests authenticated with a seller session do not need any scope.
147
+ * Create an automation
148
+ */
149
+ async createAutomation(requestParameters: AutomationsApiCreateAutomationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutomationDto> {
150
+ const response = await this.createAutomationRaw(requestParameters, initOverrides);
151
+ return await response.value();
152
+ }
153
+
154
+ /**
155
+ * Deletes an automation of the seller account. **API key scope required:** `LEADS_WRITE`. Requests authenticated with a seller session do not need any scope.
156
+ * Delete an automation
157
+ */
158
+ async deleteAutomationRaw(requestParameters: AutomationsApiDeleteAutomationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
159
+ if (requestParameters['automationId'] == null) {
160
+ throw new runtime.RequiredError(
161
+ 'automationId',
162
+ 'Required parameter "automationId" was null or undefined when calling deleteAutomation().'
163
+ );
164
+ }
165
+
166
+ const queryParameters: any = {};
167
+
168
+ const headerParameters: runtime.HTTPHeaders = {};
169
+
170
+ if (this.configuration && this.configuration.apiKey) {
171
+ headerParameters["apikey"] = await this.configuration.apiKey("apikey"); // api_key authentication
172
+ }
173
+
174
+ if (this.configuration && this.configuration.accessToken) {
175
+ const token = this.configuration.accessToken;
176
+ const tokenString = await token("bearer", []);
177
+
178
+ if (tokenString) {
179
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
180
+ }
181
+ }
182
+ const response = await this.request({
183
+ path: `/private/automations/{automationId}`.replace(`{${"automationId"}}`, encodeURIComponent(String(requestParameters['automationId']))),
184
+ method: 'DELETE',
185
+ headers: headerParameters,
186
+ query: queryParameters,
187
+ }, initOverrides);
188
+
189
+ return new runtime.VoidApiResponse(response);
190
+ }
191
+
192
+ /**
193
+ * Deletes an automation of the seller account. **API key scope required:** `LEADS_WRITE`. Requests authenticated with a seller session do not need any scope.
194
+ * Delete an automation
195
+ */
196
+ async deleteAutomation(requestParameters: AutomationsApiDeleteAutomationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
197
+ await this.deleteAutomationRaw(requestParameters, initOverrides);
198
+ }
199
+
200
+ /**
201
+ * Returns an automation of the seller account. **API key scope required:** `LEADS_READ`. Requests authenticated with a seller session do not need any scope.
202
+ * Get an automation
203
+ */
204
+ async getAutomationRaw(requestParameters: AutomationsApiGetAutomationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AutomationDto>> {
205
+ if (requestParameters['automationId'] == null) {
206
+ throw new runtime.RequiredError(
207
+ 'automationId',
208
+ 'Required parameter "automationId" was null or undefined when calling getAutomation().'
209
+ );
210
+ }
211
+
212
+ const queryParameters: any = {};
213
+
214
+ const headerParameters: runtime.HTTPHeaders = {};
215
+
216
+ if (this.configuration && this.configuration.apiKey) {
217
+ headerParameters["apikey"] = await this.configuration.apiKey("apikey"); // api_key authentication
218
+ }
219
+
220
+ if (this.configuration && this.configuration.accessToken) {
221
+ const token = this.configuration.accessToken;
222
+ const tokenString = await token("bearer", []);
223
+
224
+ if (tokenString) {
225
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
226
+ }
227
+ }
228
+ const response = await this.request({
229
+ path: `/private/automations/{automationId}`.replace(`{${"automationId"}}`, encodeURIComponent(String(requestParameters['automationId']))),
230
+ method: 'GET',
231
+ headers: headerParameters,
232
+ query: queryParameters,
233
+ }, initOverrides);
234
+
235
+ return new runtime.JSONApiResponse(response, (jsonValue) => AutomationDtoFromJSON(jsonValue));
236
+ }
237
+
238
+ /**
239
+ * Returns an automation of the seller account. **API key scope required:** `LEADS_READ`. Requests authenticated with a seller session do not need any scope.
240
+ * Get an automation
241
+ */
242
+ async getAutomation(requestParameters: AutomationsApiGetAutomationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutomationDto> {
243
+ const response = await this.getAutomationRaw(requestParameters, initOverrides);
244
+ return await response.value();
245
+ }
246
+
247
+ /**
248
+ * Returns the triggers, facts, operators and actions an automation can be built from. **API key scope required:** `LEADS_READ`. Requests authenticated with a seller session do not need any scope.
249
+ * Get the automation catalog
250
+ */
251
+ async getAutomationCatalogRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AutomationCatalogDto>> {
252
+ const queryParameters: any = {};
253
+
254
+ const headerParameters: runtime.HTTPHeaders = {};
255
+
256
+ if (this.configuration && this.configuration.apiKey) {
257
+ headerParameters["apikey"] = await this.configuration.apiKey("apikey"); // api_key authentication
258
+ }
259
+
260
+ if (this.configuration && this.configuration.accessToken) {
261
+ const token = this.configuration.accessToken;
262
+ const tokenString = await token("bearer", []);
263
+
264
+ if (tokenString) {
265
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
266
+ }
267
+ }
268
+ const response = await this.request({
269
+ path: `/private/automations/catalog`,
270
+ method: 'GET',
271
+ headers: headerParameters,
272
+ query: queryParameters,
273
+ }, initOverrides);
274
+
275
+ return new runtime.JSONApiResponse(response, (jsonValue) => AutomationCatalogDtoFromJSON(jsonValue));
276
+ }
277
+
278
+ /**
279
+ * Returns the triggers, facts, operators and actions an automation can be built from. **API key scope required:** `LEADS_READ`. Requests authenticated with a seller session do not need any scope.
280
+ * Get the automation catalog
281
+ */
282
+ async getAutomationCatalog(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutomationCatalogDto> {
283
+ const response = await this.getAutomationCatalogRaw(initOverrides);
284
+ return await response.value();
285
+ }
286
+
287
+ /**
288
+ * Lists every time the automations of the seller account were evaluated, newest first, with how each condition and action went. **API key scope required:** `LEADS_READ`. Requests authenticated with a seller session do not need any scope.
289
+ * List the automation runs
290
+ */
291
+ async getAutomationRunsRaw(requestParameters: AutomationsApiGetAutomationRunsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetAutomationRuns200Response>> {
292
+ const queryParameters: any = {};
293
+
294
+ if (requestParameters['filter'] != null) {
295
+ queryParameters['filter'] = requestParameters['filter'];
296
+ }
297
+
298
+ if (requestParameters['page'] != null) {
299
+ queryParameters['page'] = requestParameters['page'];
300
+ }
301
+
302
+ if (requestParameters['limit'] != null) {
303
+ queryParameters['limit'] = requestParameters['limit'];
304
+ }
305
+
306
+ if (requestParameters['filterAutomationId'] != null) {
307
+ queryParameters['filter[automationId]'] = requestParameters['filterAutomationId'];
308
+ }
309
+
310
+ if (requestParameters['filterLeadId'] != null) {
311
+ queryParameters['filter[leadId]'] = requestParameters['filterLeadId'];
312
+ }
313
+
314
+ if (requestParameters['filterTrigger'] != null) {
315
+ queryParameters['filter[trigger]'] = requestParameters['filterTrigger'];
316
+ }
317
+
318
+ if (requestParameters['filterMatched'] != null) {
319
+ queryParameters['filter[matched]'] = requestParameters['filterMatched'];
320
+ }
321
+
322
+ const headerParameters: runtime.HTTPHeaders = {};
323
+
324
+ if (this.configuration && this.configuration.apiKey) {
325
+ headerParameters["apikey"] = await this.configuration.apiKey("apikey"); // api_key authentication
326
+ }
327
+
328
+ if (this.configuration && this.configuration.accessToken) {
329
+ const token = this.configuration.accessToken;
330
+ const tokenString = await token("bearer", []);
331
+
332
+ if (tokenString) {
333
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
334
+ }
335
+ }
336
+ const response = await this.request({
337
+ path: `/private/automations/runs`,
338
+ method: 'GET',
339
+ headers: headerParameters,
340
+ query: queryParameters,
341
+ }, initOverrides);
342
+
343
+ return new runtime.JSONApiResponse(response, (jsonValue) => GetAutomationRuns200ResponseFromJSON(jsonValue));
344
+ }
345
+
346
+ /**
347
+ * Lists every time the automations of the seller account were evaluated, newest first, with how each condition and action went. **API key scope required:** `LEADS_READ`. Requests authenticated with a seller session do not need any scope.
348
+ * List the automation runs
349
+ */
350
+ async getAutomationRuns(requestParameters: AutomationsApiGetAutomationRunsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetAutomationRuns200Response> {
351
+ const response = await this.getAutomationRunsRaw(requestParameters, initOverrides);
352
+ return await response.value();
353
+ }
354
+
355
+ /**
356
+ * Lists the automations of the seller account, oldest first by default. **API key scope required:** `LEADS_READ`. Requests authenticated with a seller session do not need any scope.
357
+ * List automations
358
+ */
359
+ async getAutomationsRaw(requestParameters: AutomationsApiGetAutomationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GetAutomations200Response>> {
360
+ const queryParameters: any = {};
361
+
362
+ if (requestParameters['filter'] != null) {
363
+ queryParameters['filter'] = requestParameters['filter'];
364
+ }
365
+
366
+ if (requestParameters['page'] != null) {
367
+ queryParameters['page'] = requestParameters['page'];
368
+ }
369
+
370
+ if (requestParameters['limit'] != null) {
371
+ queryParameters['limit'] = requestParameters['limit'];
372
+ }
373
+
374
+ if (requestParameters['sortBy'] != null) {
375
+ queryParameters['sortBy'] = requestParameters['sortBy'];
376
+ }
377
+
378
+ const headerParameters: runtime.HTTPHeaders = {};
379
+
380
+ if (this.configuration && this.configuration.apiKey) {
381
+ headerParameters["apikey"] = await this.configuration.apiKey("apikey"); // api_key authentication
382
+ }
383
+
384
+ if (this.configuration && this.configuration.accessToken) {
385
+ const token = this.configuration.accessToken;
386
+ const tokenString = await token("bearer", []);
387
+
388
+ if (tokenString) {
389
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
390
+ }
391
+ }
392
+ const response = await this.request({
393
+ path: `/private/automations`,
394
+ method: 'GET',
395
+ headers: headerParameters,
396
+ query: queryParameters,
397
+ }, initOverrides);
398
+
399
+ return new runtime.JSONApiResponse(response, (jsonValue) => GetAutomations200ResponseFromJSON(jsonValue));
400
+ }
401
+
402
+ /**
403
+ * Lists the automations of the seller account, oldest first by default. **API key scope required:** `LEADS_READ`. Requests authenticated with a seller session do not need any scope.
404
+ * List automations
405
+ */
406
+ async getAutomations(requestParameters: AutomationsApiGetAutomationsRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GetAutomations200Response> {
407
+ const response = await this.getAutomationsRaw(requestParameters, initOverrides);
408
+ return await response.value();
409
+ }
410
+
411
+ /**
412
+ * Lists the times an automation of the seller account acted on the lead, oldest first. **API key scope required:** `LEADS_READ`. Requests authenticated with a seller session do not need any scope.
413
+ * List the automation runs of a lead
414
+ */
415
+ async getLeadAutomationRunsRaw(requestParameters: AutomationsApiGetLeadAutomationRunsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<AutomationRunDto>>> {
416
+ if (requestParameters['leadId'] == null) {
417
+ throw new runtime.RequiredError(
418
+ 'leadId',
419
+ 'Required parameter "leadId" was null or undefined when calling getLeadAutomationRuns().'
420
+ );
421
+ }
422
+
423
+ const queryParameters: any = {};
424
+
425
+ const headerParameters: runtime.HTTPHeaders = {};
426
+
427
+ if (this.configuration && this.configuration.apiKey) {
428
+ headerParameters["apikey"] = await this.configuration.apiKey("apikey"); // api_key authentication
429
+ }
430
+
431
+ if (this.configuration && this.configuration.accessToken) {
432
+ const token = this.configuration.accessToken;
433
+ const tokenString = await token("bearer", []);
434
+
435
+ if (tokenString) {
436
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
437
+ }
438
+ }
439
+ const response = await this.request({
440
+ path: `/private/leads/{leadId}/automation-runs`.replace(`{${"leadId"}}`, encodeURIComponent(String(requestParameters['leadId']))),
441
+ method: 'GET',
442
+ headers: headerParameters,
443
+ query: queryParameters,
444
+ }, initOverrides);
445
+
446
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(AutomationRunDtoFromJSON));
447
+ }
448
+
449
+ /**
450
+ * Lists the times an automation of the seller account acted on the lead, oldest first. **API key scope required:** `LEADS_READ`. Requests authenticated with a seller session do not need any scope.
451
+ * List the automation runs of a lead
452
+ */
453
+ async getLeadAutomationRuns(requestParameters: AutomationsApiGetLeadAutomationRunsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<AutomationRunDto>> {
454
+ const response = await this.getLeadAutomationRunsRaw(requestParameters, initOverrides);
455
+ return await response.value();
456
+ }
457
+
458
+ /**
459
+ * Tells what the automations of the seller account would do with a lead that is only described. **API key scope required:** `LEADS_READ`. Requests authenticated with a seller session do not need any scope.
460
+ * Simulate the automations
461
+ */
462
+ async simulateAutomationsRaw(requestParameters: AutomationsApiSimulateAutomationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<AutomationSimulationDto>>> {
463
+ if (requestParameters['simulateAutomationsInput'] == null) {
464
+ throw new runtime.RequiredError(
465
+ 'simulateAutomationsInput',
466
+ 'Required parameter "simulateAutomationsInput" was null or undefined when calling simulateAutomations().'
467
+ );
468
+ }
469
+
470
+ const queryParameters: any = {};
471
+
472
+ const headerParameters: runtime.HTTPHeaders = {};
473
+
474
+ headerParameters['Content-Type'] = 'application/json';
475
+
476
+ if (this.configuration && this.configuration.apiKey) {
477
+ headerParameters["apikey"] = await this.configuration.apiKey("apikey"); // api_key authentication
478
+ }
479
+
480
+ if (this.configuration && this.configuration.accessToken) {
481
+ const token = this.configuration.accessToken;
482
+ const tokenString = await token("bearer", []);
483
+
484
+ if (tokenString) {
485
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
486
+ }
487
+ }
488
+ const response = await this.request({
489
+ path: `/private/automations/simulation`,
490
+ method: 'POST',
491
+ headers: headerParameters,
492
+ query: queryParameters,
493
+ body: SimulateAutomationsInputToJSON(requestParameters['simulateAutomationsInput']),
494
+ }, initOverrides);
495
+
496
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(AutomationSimulationDtoFromJSON));
497
+ }
498
+
499
+ /**
500
+ * Tells what the automations of the seller account would do with a lead that is only described. **API key scope required:** `LEADS_READ`. Requests authenticated with a seller session do not need any scope.
501
+ * Simulate the automations
502
+ */
503
+ async simulateAutomations(requestParameters: AutomationsApiSimulateAutomationsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<AutomationSimulationDto>> {
504
+ const response = await this.simulateAutomationsRaw(requestParameters, initOverrides);
505
+ return await response.value();
506
+ }
507
+
508
+ /**
509
+ * Changes the name, trigger, conditions and actions of an automation. **API key scope required:** `LEADS_WRITE`. Requests authenticated with a seller session do not need any scope.
510
+ * Update an automation
511
+ */
512
+ async updateAutomationRaw(requestParameters: AutomationsApiUpdateAutomationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AutomationDto>> {
513
+ if (requestParameters['automationId'] == null) {
514
+ throw new runtime.RequiredError(
515
+ 'automationId',
516
+ 'Required parameter "automationId" was null or undefined when calling updateAutomation().'
517
+ );
518
+ }
519
+
520
+ if (requestParameters['automationInput'] == null) {
521
+ throw new runtime.RequiredError(
522
+ 'automationInput',
523
+ 'Required parameter "automationInput" was null or undefined when calling updateAutomation().'
524
+ );
525
+ }
526
+
527
+ const queryParameters: any = {};
528
+
529
+ const headerParameters: runtime.HTTPHeaders = {};
530
+
531
+ headerParameters['Content-Type'] = 'application/json';
532
+
533
+ if (this.configuration && this.configuration.apiKey) {
534
+ headerParameters["apikey"] = await this.configuration.apiKey("apikey"); // api_key authentication
535
+ }
536
+
537
+ if (this.configuration && this.configuration.accessToken) {
538
+ const token = this.configuration.accessToken;
539
+ const tokenString = await token("bearer", []);
540
+
541
+ if (tokenString) {
542
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
543
+ }
544
+ }
545
+ const response = await this.request({
546
+ path: `/private/automations/{automationId}`.replace(`{${"automationId"}}`, encodeURIComponent(String(requestParameters['automationId']))),
547
+ method: 'PATCH',
548
+ headers: headerParameters,
549
+ query: queryParameters,
550
+ body: AutomationInputToJSON(requestParameters['automationInput']),
551
+ }, initOverrides);
552
+
553
+ return new runtime.JSONApiResponse(response, (jsonValue) => AutomationDtoFromJSON(jsonValue));
554
+ }
555
+
556
+ /**
557
+ * Changes the name, trigger, conditions and actions of an automation. **API key scope required:** `LEADS_WRITE`. Requests authenticated with a seller session do not need any scope.
558
+ * Update an automation
559
+ */
560
+ async updateAutomation(requestParameters: AutomationsApiUpdateAutomationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutomationDto> {
561
+ const response = await this.updateAutomationRaw(requestParameters, initOverrides);
562
+ return await response.value();
563
+ }
564
+
565
+ /**
566
+ * Turns an automation on or off without changing it. **API key scope required:** `LEADS_WRITE`. Requests authenticated with a seller session do not need any scope.
567
+ * Enable or disable an automation
568
+ */
569
+ async updateAutomationStatusRaw(requestParameters: AutomationsApiUpdateAutomationStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AutomationDto>> {
570
+ if (requestParameters['automationId'] == null) {
571
+ throw new runtime.RequiredError(
572
+ 'automationId',
573
+ 'Required parameter "automationId" was null or undefined when calling updateAutomationStatus().'
574
+ );
575
+ }
576
+
577
+ if (requestParameters['automationStatusInput'] == null) {
578
+ throw new runtime.RequiredError(
579
+ 'automationStatusInput',
580
+ 'Required parameter "automationStatusInput" was null or undefined when calling updateAutomationStatus().'
581
+ );
582
+ }
583
+
584
+ const queryParameters: any = {};
585
+
586
+ const headerParameters: runtime.HTTPHeaders = {};
587
+
588
+ headerParameters['Content-Type'] = 'application/json';
589
+
590
+ if (this.configuration && this.configuration.apiKey) {
591
+ headerParameters["apikey"] = await this.configuration.apiKey("apikey"); // api_key authentication
592
+ }
593
+
594
+ if (this.configuration && this.configuration.accessToken) {
595
+ const token = this.configuration.accessToken;
596
+ const tokenString = await token("bearer", []);
597
+
598
+ if (tokenString) {
599
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
600
+ }
601
+ }
602
+ const response = await this.request({
603
+ path: `/private/automations/{automationId}/status`.replace(`{${"automationId"}}`, encodeURIComponent(String(requestParameters['automationId']))),
604
+ method: 'PATCH',
605
+ headers: headerParameters,
606
+ query: queryParameters,
607
+ body: AutomationStatusInputToJSON(requestParameters['automationStatusInput']),
608
+ }, initOverrides);
609
+
610
+ return new runtime.JSONApiResponse(response, (jsonValue) => AutomationDtoFromJSON(jsonValue));
611
+ }
612
+
613
+ /**
614
+ * Turns an automation on or off without changing it. **API key scope required:** `LEADS_WRITE`. Requests authenticated with a seller session do not need any scope.
615
+ * Enable or disable an automation
616
+ */
617
+ async updateAutomationStatus(requestParameters: AutomationsApiUpdateAutomationStatusRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutomationDto> {
618
+ const response = await this.updateAutomationStatusRaw(requestParameters, initOverrides);
619
+ return await response.value();
620
+ }
621
+
622
+ }
package/src/apis/index.ts CHANGED
@@ -7,6 +7,7 @@ export * from './AddressPublicApi';
7
7
  export * from './AdminApi';
8
8
  export * from './AuctionsApi';
9
9
  export * from './AuctionsPublicApi';
10
+ export * from './AutomationsApi';
10
11
  export * from './BankAccountsApi';
11
12
  export * from './BrokeredLeadsApi';
12
13
  export * from './BrokeredLeadsPublicApi';