@randock/nameshift-api-client 0.0.552 → 0.0.554

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 (156) hide show
  1. package/.openapi-generator/FILES +39 -0
  2. package/README.md +3 -3
  3. package/dist/apis/AccountsApi.d.ts +1 -0
  4. package/dist/apis/AccountsApi.js +2 -1
  5. package/dist/apis/AutomationsApi.d.ts +160 -0
  6. package/dist/apis/AutomationsApi.js +748 -0
  7. package/dist/apis/index.d.ts +1 -0
  8. package/dist/apis/index.js +1 -0
  9. package/dist/models/AccountPaymentMethodProfileDto.d.ts +1 -0
  10. package/dist/models/AccountPaymentMethodProfileDto.js +2 -1
  11. package/dist/models/AutomationActionDto.d.ts +45 -0
  12. package/dist/models/AutomationActionDto.js +60 -0
  13. package/dist/models/AutomationActionInput.d.ts +45 -0
  14. package/dist/models/AutomationActionInput.js +56 -0
  15. package/dist/models/AutomationActionStatusEnum.d.ts +26 -0
  16. package/dist/models/AutomationActionStatusEnum.js +52 -0
  17. package/dist/models/AutomationActionTypeEnum.d.ts +27 -0
  18. package/dist/models/AutomationActionTypeEnum.js +53 -0
  19. package/dist/models/AutomationAggregateEnum.d.ts +24 -0
  20. package/dist/models/AutomationAggregateEnum.js +50 -0
  21. package/dist/models/AutomationCatalogDelayUnitDto.d.ts +45 -0
  22. package/dist/models/AutomationCatalogDelayUnitDto.js +60 -0
  23. package/dist/models/AutomationCatalogDto.d.ts +77 -0
  24. package/dist/models/AutomationCatalogDto.js +82 -0
  25. package/dist/models/AutomationCatalogFactDto.d.ts +54 -0
  26. package/dist/models/AutomationCatalogFactDto.js +67 -0
  27. package/dist/models/AutomationCatalogTriggerDto.d.ts +60 -0
  28. package/dist/models/AutomationCatalogTriggerDto.js +71 -0
  29. package/dist/models/AutomationConditionDto.d.ts +65 -0
  30. package/dist/models/AutomationConditionDto.js +76 -0
  31. package/dist/models/AutomationConditionEvaluationDto.d.ts +77 -0
  32. package/dist/models/AutomationConditionEvaluationDto.js +84 -0
  33. package/dist/models/AutomationConditionGroupDto.d.ts +53 -0
  34. package/dist/models/AutomationConditionGroupDto.js +68 -0
  35. package/dist/models/AutomationConditionGroupDtoChildrenInner.d.ts +27 -0
  36. package/dist/models/AutomationConditionGroupDtoChildrenInner.js +54 -0
  37. package/dist/models/AutomationConditionGroupEvaluationDto.d.ts +59 -0
  38. package/dist/models/AutomationConditionGroupEvaluationDto.js +72 -0
  39. package/dist/models/AutomationConditionGroupEvaluationDtoChildrenInner.d.ts +27 -0
  40. package/dist/models/AutomationConditionGroupEvaluationDtoChildrenInner.js +54 -0
  41. package/dist/models/AutomationConditionGroupInput.d.ts +53 -0
  42. package/dist/models/AutomationConditionGroupInput.js +68 -0
  43. package/dist/models/AutomationConditionGroupInputChildrenInner.d.ts +27 -0
  44. package/dist/models/AutomationConditionGroupInputChildrenInner.js +54 -0
  45. package/dist/models/AutomationConditionInput.d.ts +65 -0
  46. package/dist/models/AutomationConditionInput.js +74 -0
  47. package/dist/models/AutomationDelayDto.d.ts +39 -0
  48. package/dist/models/AutomationDelayDto.js +56 -0
  49. package/dist/models/AutomationDelayInput.d.ts +39 -0
  50. package/dist/models/AutomationDelayInput.js +56 -0
  51. package/dist/models/AutomationDelayUnitEnum.d.ts +25 -0
  52. package/dist/models/AutomationDelayUnitEnum.js +51 -0
  53. package/dist/models/AutomationDto.d.ts +96 -0
  54. package/dist/models/AutomationDto.js +95 -0
  55. package/dist/models/AutomationFactEnum.d.ts +36 -0
  56. package/dist/models/AutomationFactEnum.js +62 -0
  57. package/dist/models/AutomationFactGroupEnum.d.ts +27 -0
  58. package/dist/models/AutomationFactGroupEnum.js +53 -0
  59. package/dist/models/AutomationFactValueTypeEnum.d.ts +30 -0
  60. package/dist/models/AutomationFactValueTypeEnum.js +56 -0
  61. package/dist/models/AutomationGroupOperatorEnum.d.ts +25 -0
  62. package/dist/models/AutomationGroupOperatorEnum.js +51 -0
  63. package/dist/models/AutomationInput.d.ts +66 -0
  64. package/dist/models/AutomationInput.js +71 -0
  65. package/dist/models/AutomationOperatorEnum.d.ts +37 -0
  66. package/dist/models/AutomationOperatorEnum.js +63 -0
  67. package/dist/models/AutomationRunActionDto.d.ts +46 -0
  68. package/dist/models/AutomationRunActionDto.js +61 -0
  69. package/dist/models/AutomationRunAutomationDto.d.ts +58 -0
  70. package/dist/models/AutomationRunAutomationDto.js +69 -0
  71. package/dist/models/AutomationRunDto.d.ts +65 -0
  72. package/dist/models/AutomationRunDto.js +74 -0
  73. package/dist/models/AutomationRunLeadDto.d.ts +44 -0
  74. package/dist/models/AutomationRunLeadDto.js +59 -0
  75. package/dist/models/AutomationSimulationDto.d.ts +64 -0
  76. package/dist/models/AutomationSimulationDto.js +73 -0
  77. package/dist/models/AutomationStatusInput.d.ts +32 -0
  78. package/dist/models/AutomationStatusInput.js +51 -0
  79. package/dist/models/AutomationTriggerEnum.d.ts +28 -0
  80. package/dist/models/AutomationTriggerEnum.js +54 -0
  81. package/dist/models/FeatureFlagListItemDto.d.ts +1 -0
  82. package/dist/models/FeatureFlagListItemDto.js +2 -1
  83. package/dist/models/GetAutomationRuns200Response.d.ts +47 -0
  84. package/dist/models/GetAutomationRuns200Response.js +62 -0
  85. package/dist/models/GetAutomations200Response.d.ts +47 -0
  86. package/dist/models/GetAutomations200Response.js +62 -0
  87. package/dist/models/IntersectionAccountDtoWithSettingsDtoWithNotificationsDtoWithFeatureFlagsDto.d.ts +1 -0
  88. package/dist/models/IntersectionAccountDtoWithSettingsDtoWithNotificationsDtoWithFeatureFlagsDto.js +2 -1
  89. package/dist/models/InvoiceDtoTransaction.d.ts +1 -0
  90. package/dist/models/InvoiceDtoTransaction.js +2 -1
  91. package/dist/models/InvoiceTransactionDto.d.ts +1 -0
  92. package/dist/models/InvoiceTransactionDto.js +2 -1
  93. package/dist/models/LeadMessageDto.d.ts +6 -0
  94. package/dist/models/LeadMessageDto.js +4 -0
  95. package/dist/models/OrderListItemDtoTransaction.d.ts +1 -0
  96. package/dist/models/OrderListItemDtoTransaction.js +2 -1
  97. package/dist/models/PrivateAccountGetMeResponse.d.ts +1 -0
  98. package/dist/models/PrivateAccountGetMeResponse.js +2 -1
  99. package/dist/models/SimulateAutomationsInput.d.ts +70 -0
  100. package/dist/models/SimulateAutomationsInput.js +69 -0
  101. package/dist/models/SubscriptionListItemDtoTransaction.d.ts +1 -0
  102. package/dist/models/SubscriptionListItemDtoTransaction.js +2 -1
  103. package/dist/models/index.d.ts +38 -0
  104. package/dist/models/index.js +38 -0
  105. package/package.json +1 -1
  106. package/src/apis/AccountsApi.ts +2 -1
  107. package/src/apis/AutomationsApi.ts +622 -0
  108. package/src/apis/index.ts +1 -0
  109. package/src/models/AccountPaymentMethodProfileDto.ts +2 -1
  110. package/src/models/AutomationActionDto.ts +94 -0
  111. package/src/models/AutomationActionInput.ts +92 -0
  112. package/src/models/AutomationActionStatusEnum.ts +54 -0
  113. package/src/models/AutomationActionTypeEnum.ts +55 -0
  114. package/src/models/AutomationAggregateEnum.ts +52 -0
  115. package/src/models/AutomationCatalogDelayUnitDto.ts +94 -0
  116. package/src/models/AutomationCatalogDto.ts +151 -0
  117. package/src/models/AutomationCatalogFactDto.ts +124 -0
  118. package/src/models/AutomationCatalogTriggerDto.ts +133 -0
  119. package/src/models/AutomationConditionDto.ts +127 -0
  120. package/src/models/AutomationConditionEvaluationDto.ts +145 -0
  121. package/src/models/AutomationConditionGroupDto.ts +109 -0
  122. package/src/models/AutomationConditionGroupDtoChildrenInner.ts +73 -0
  123. package/src/models/AutomationConditionGroupEvaluationDto.ts +118 -0
  124. package/src/models/AutomationConditionGroupEvaluationDtoChildrenInner.ts +73 -0
  125. package/src/models/AutomationConditionGroupInput.ts +109 -0
  126. package/src/models/AutomationConditionGroupInputChildrenInner.ts +73 -0
  127. package/src/models/AutomationConditionInput.ts +126 -0
  128. package/src/models/AutomationDelayDto.ts +85 -0
  129. package/src/models/AutomationDelayInput.ts +85 -0
  130. package/src/models/AutomationDelayUnitEnum.ts +53 -0
  131. package/src/models/AutomationDto.ts +187 -0
  132. package/src/models/AutomationFactEnum.ts +64 -0
  133. package/src/models/AutomationFactGroupEnum.ts +55 -0
  134. package/src/models/AutomationFactValueTypeEnum.ts +58 -0
  135. package/src/models/AutomationGroupOperatorEnum.ts +53 -0
  136. package/src/models/AutomationInput.ts +140 -0
  137. package/src/models/AutomationOperatorEnum.ts +65 -0
  138. package/src/models/AutomationRunActionDto.ts +101 -0
  139. package/src/models/AutomationRunAutomationDto.ts +117 -0
  140. package/src/models/AutomationRunDto.ts +135 -0
  141. package/src/models/AutomationRunLeadDto.ts +84 -0
  142. package/src/models/AutomationSimulationDto.ts +126 -0
  143. package/src/models/AutomationStatusInput.ts +66 -0
  144. package/src/models/AutomationTriggerEnum.ts +56 -0
  145. package/src/models/FeatureFlagListItemDto.ts +2 -1
  146. package/src/models/GetAutomationRuns200Response.ts +106 -0
  147. package/src/models/GetAutomations200Response.ts +106 -0
  148. package/src/models/IntersectionAccountDtoWithSettingsDtoWithNotificationsDtoWithFeatureFlagsDto.ts +2 -1
  149. package/src/models/InvoiceDtoTransaction.ts +2 -1
  150. package/src/models/InvoiceTransactionDto.ts +2 -1
  151. package/src/models/LeadMessageDto.ts +9 -0
  152. package/src/models/OrderListItemDtoTransaction.ts +2 -1
  153. package/src/models/PrivateAccountGetMeResponse.ts +2 -1
  154. package/src/models/SimulateAutomationsInput.ts +133 -0
  155. package/src/models/SubscriptionListItemDtoTransaction.ts +2 -1
  156. package/src/models/index.ts +38 -0
@@ -0,0 +1,748 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * Nameshift
6
+ * 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.
7
+ *
8
+ * The version of the OpenAPI document: 1.0
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __extends = (this && this.__extends) || (function () {
16
+ var extendStatics = function (d, b) {
17
+ extendStatics = Object.setPrototypeOf ||
18
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
19
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
20
+ return extendStatics(d, b);
21
+ };
22
+ return function (d, b) {
23
+ if (typeof b !== "function" && b !== null)
24
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
25
+ extendStatics(d, b);
26
+ function __() { this.constructor = d; }
27
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
28
+ };
29
+ })();
30
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
31
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
32
+ return new (P || (P = Promise))(function (resolve, reject) {
33
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
34
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
35
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
36
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
37
+ });
38
+ };
39
+ var __generator = (this && this.__generator) || function (thisArg, body) {
40
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
41
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
42
+ function verb(n) { return function (v) { return step([n, v]); }; }
43
+ function step(op) {
44
+ if (f) throw new TypeError("Generator is already executing.");
45
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
46
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
47
+ if (y = 0, t) op = [op[0] & 2, t.value];
48
+ switch (op[0]) {
49
+ case 0: case 1: t = op; break;
50
+ case 4: _.label++; return { value: op[1], done: false };
51
+ case 5: _.label++; y = op[1]; op = [0]; continue;
52
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
53
+ default:
54
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
55
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
56
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
57
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
58
+ if (t[2]) _.ops.pop();
59
+ _.trys.pop(); continue;
60
+ }
61
+ op = body.call(thisArg, _);
62
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
63
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
64
+ }
65
+ };
66
+ Object.defineProperty(exports, "__esModule", { value: true });
67
+ exports.AutomationsApi = void 0;
68
+ var runtime = require("../runtime");
69
+ var index_1 = require("../models/index");
70
+ /**
71
+ *
72
+ */
73
+ var AutomationsApi = /** @class */ (function (_super) {
74
+ __extends(AutomationsApi, _super);
75
+ function AutomationsApi() {
76
+ return _super !== null && _super.apply(this, arguments) || this;
77
+ }
78
+ /**
79
+ * Creates an automation for the seller account. **API key scope required:** `LEADS_WRITE`. Requests authenticated with a seller session do not need any scope.
80
+ * Create an automation
81
+ */
82
+ AutomationsApi.prototype.createAutomationRaw = function (requestParameters, initOverrides) {
83
+ return __awaiter(this, void 0, void 0, function () {
84
+ var queryParameters, headerParameters, _a, _b, token, tokenString, response;
85
+ return __generator(this, function (_c) {
86
+ switch (_c.label) {
87
+ case 0:
88
+ if (requestParameters['automationInput'] == null) {
89
+ throw new runtime.RequiredError('automationInput', 'Required parameter "automationInput" was null or undefined when calling createAutomation().');
90
+ }
91
+ queryParameters = {};
92
+ headerParameters = {};
93
+ headerParameters['Content-Type'] = 'application/json';
94
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
95
+ _a = headerParameters;
96
+ _b = "apikey";
97
+ return [4 /*yield*/, this.configuration.apiKey("apikey")];
98
+ case 1:
99
+ _a[_b] = _c.sent(); // api_key authentication
100
+ _c.label = 2;
101
+ case 2:
102
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
103
+ token = this.configuration.accessToken;
104
+ return [4 /*yield*/, token("bearer", [])];
105
+ case 3:
106
+ tokenString = _c.sent();
107
+ if (tokenString) {
108
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
109
+ }
110
+ _c.label = 4;
111
+ case 4: return [4 /*yield*/, this.request({
112
+ path: "/private/automations",
113
+ method: 'POST',
114
+ headers: headerParameters,
115
+ query: queryParameters,
116
+ body: (0, index_1.AutomationInputToJSON)(requestParameters['automationInput']),
117
+ }, initOverrides)];
118
+ case 5:
119
+ response = _c.sent();
120
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.AutomationDtoFromJSON)(jsonValue); })];
121
+ }
122
+ });
123
+ });
124
+ };
125
+ /**
126
+ * Creates an automation for the seller account. **API key scope required:** `LEADS_WRITE`. Requests authenticated with a seller session do not need any scope.
127
+ * Create an automation
128
+ */
129
+ AutomationsApi.prototype.createAutomation = function (requestParameters, initOverrides) {
130
+ return __awaiter(this, void 0, void 0, function () {
131
+ var response;
132
+ return __generator(this, function (_a) {
133
+ switch (_a.label) {
134
+ case 0: return [4 /*yield*/, this.createAutomationRaw(requestParameters, initOverrides)];
135
+ case 1:
136
+ response = _a.sent();
137
+ return [4 /*yield*/, response.value()];
138
+ case 2: return [2 /*return*/, _a.sent()];
139
+ }
140
+ });
141
+ });
142
+ };
143
+ /**
144
+ * Deletes an automation of the seller account. **API key scope required:** `LEADS_WRITE`. Requests authenticated with a seller session do not need any scope.
145
+ * Delete an automation
146
+ */
147
+ AutomationsApi.prototype.deleteAutomationRaw = function (requestParameters, initOverrides) {
148
+ return __awaiter(this, void 0, void 0, function () {
149
+ var queryParameters, headerParameters, _a, _b, token, tokenString, response;
150
+ return __generator(this, function (_c) {
151
+ switch (_c.label) {
152
+ case 0:
153
+ if (requestParameters['automationId'] == null) {
154
+ throw new runtime.RequiredError('automationId', 'Required parameter "automationId" was null or undefined when calling deleteAutomation().');
155
+ }
156
+ queryParameters = {};
157
+ headerParameters = {};
158
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
159
+ _a = headerParameters;
160
+ _b = "apikey";
161
+ return [4 /*yield*/, this.configuration.apiKey("apikey")];
162
+ case 1:
163
+ _a[_b] = _c.sent(); // api_key authentication
164
+ _c.label = 2;
165
+ case 2:
166
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
167
+ token = this.configuration.accessToken;
168
+ return [4 /*yield*/, token("bearer", [])];
169
+ case 3:
170
+ tokenString = _c.sent();
171
+ if (tokenString) {
172
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
173
+ }
174
+ _c.label = 4;
175
+ case 4: return [4 /*yield*/, this.request({
176
+ path: "/private/automations/{automationId}".replace("{".concat("automationId", "}"), encodeURIComponent(String(requestParameters['automationId']))),
177
+ method: 'DELETE',
178
+ headers: headerParameters,
179
+ query: queryParameters,
180
+ }, initOverrides)];
181
+ case 5:
182
+ response = _c.sent();
183
+ return [2 /*return*/, new runtime.VoidApiResponse(response)];
184
+ }
185
+ });
186
+ });
187
+ };
188
+ /**
189
+ * Deletes an automation of the seller account. **API key scope required:** `LEADS_WRITE`. Requests authenticated with a seller session do not need any scope.
190
+ * Delete an automation
191
+ */
192
+ AutomationsApi.prototype.deleteAutomation = function (requestParameters, initOverrides) {
193
+ return __awaiter(this, void 0, void 0, function () {
194
+ return __generator(this, function (_a) {
195
+ switch (_a.label) {
196
+ case 0: return [4 /*yield*/, this.deleteAutomationRaw(requestParameters, initOverrides)];
197
+ case 1:
198
+ _a.sent();
199
+ return [2 /*return*/];
200
+ }
201
+ });
202
+ });
203
+ };
204
+ /**
205
+ * Returns an automation of the seller account. **API key scope required:** `LEADS_READ`. Requests authenticated with a seller session do not need any scope.
206
+ * Get an automation
207
+ */
208
+ AutomationsApi.prototype.getAutomationRaw = function (requestParameters, initOverrides) {
209
+ return __awaiter(this, void 0, void 0, function () {
210
+ var queryParameters, headerParameters, _a, _b, token, tokenString, response;
211
+ return __generator(this, function (_c) {
212
+ switch (_c.label) {
213
+ case 0:
214
+ if (requestParameters['automationId'] == null) {
215
+ throw new runtime.RequiredError('automationId', 'Required parameter "automationId" was null or undefined when calling getAutomation().');
216
+ }
217
+ queryParameters = {};
218
+ headerParameters = {};
219
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
220
+ _a = headerParameters;
221
+ _b = "apikey";
222
+ return [4 /*yield*/, this.configuration.apiKey("apikey")];
223
+ case 1:
224
+ _a[_b] = _c.sent(); // api_key authentication
225
+ _c.label = 2;
226
+ case 2:
227
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
228
+ token = this.configuration.accessToken;
229
+ return [4 /*yield*/, token("bearer", [])];
230
+ case 3:
231
+ tokenString = _c.sent();
232
+ if (tokenString) {
233
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
234
+ }
235
+ _c.label = 4;
236
+ case 4: return [4 /*yield*/, this.request({
237
+ path: "/private/automations/{automationId}".replace("{".concat("automationId", "}"), encodeURIComponent(String(requestParameters['automationId']))),
238
+ method: 'GET',
239
+ headers: headerParameters,
240
+ query: queryParameters,
241
+ }, initOverrides)];
242
+ case 5:
243
+ response = _c.sent();
244
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.AutomationDtoFromJSON)(jsonValue); })];
245
+ }
246
+ });
247
+ });
248
+ };
249
+ /**
250
+ * Returns an automation of the seller account. **API key scope required:** `LEADS_READ`. Requests authenticated with a seller session do not need any scope.
251
+ * Get an automation
252
+ */
253
+ AutomationsApi.prototype.getAutomation = function (requestParameters, initOverrides) {
254
+ return __awaiter(this, void 0, void 0, function () {
255
+ var response;
256
+ return __generator(this, function (_a) {
257
+ switch (_a.label) {
258
+ case 0: return [4 /*yield*/, this.getAutomationRaw(requestParameters, initOverrides)];
259
+ case 1:
260
+ response = _a.sent();
261
+ return [4 /*yield*/, response.value()];
262
+ case 2: return [2 /*return*/, _a.sent()];
263
+ }
264
+ });
265
+ });
266
+ };
267
+ /**
268
+ * 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.
269
+ * Get the automation catalog
270
+ */
271
+ AutomationsApi.prototype.getAutomationCatalogRaw = function (initOverrides) {
272
+ return __awaiter(this, void 0, void 0, function () {
273
+ var queryParameters, headerParameters, _a, _b, token, tokenString, response;
274
+ return __generator(this, function (_c) {
275
+ switch (_c.label) {
276
+ case 0:
277
+ queryParameters = {};
278
+ headerParameters = {};
279
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
280
+ _a = headerParameters;
281
+ _b = "apikey";
282
+ return [4 /*yield*/, this.configuration.apiKey("apikey")];
283
+ case 1:
284
+ _a[_b] = _c.sent(); // api_key authentication
285
+ _c.label = 2;
286
+ case 2:
287
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
288
+ token = this.configuration.accessToken;
289
+ return [4 /*yield*/, token("bearer", [])];
290
+ case 3:
291
+ tokenString = _c.sent();
292
+ if (tokenString) {
293
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
294
+ }
295
+ _c.label = 4;
296
+ case 4: return [4 /*yield*/, this.request({
297
+ path: "/private/automations/catalog",
298
+ method: 'GET',
299
+ headers: headerParameters,
300
+ query: queryParameters,
301
+ }, initOverrides)];
302
+ case 5:
303
+ response = _c.sent();
304
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.AutomationCatalogDtoFromJSON)(jsonValue); })];
305
+ }
306
+ });
307
+ });
308
+ };
309
+ /**
310
+ * 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.
311
+ * Get the automation catalog
312
+ */
313
+ AutomationsApi.prototype.getAutomationCatalog = function (initOverrides) {
314
+ return __awaiter(this, void 0, void 0, function () {
315
+ var response;
316
+ return __generator(this, function (_a) {
317
+ switch (_a.label) {
318
+ case 0: return [4 /*yield*/, this.getAutomationCatalogRaw(initOverrides)];
319
+ case 1:
320
+ response = _a.sent();
321
+ return [4 /*yield*/, response.value()];
322
+ case 2: return [2 /*return*/, _a.sent()];
323
+ }
324
+ });
325
+ });
326
+ };
327
+ /**
328
+ * 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.
329
+ * List the automation runs
330
+ */
331
+ AutomationsApi.prototype.getAutomationRunsRaw = function (requestParameters, initOverrides) {
332
+ return __awaiter(this, void 0, void 0, function () {
333
+ var queryParameters, headerParameters, _a, _b, token, tokenString, response;
334
+ return __generator(this, function (_c) {
335
+ switch (_c.label) {
336
+ case 0:
337
+ queryParameters = {};
338
+ if (requestParameters['filter'] != null) {
339
+ queryParameters['filter'] = requestParameters['filter'];
340
+ }
341
+ if (requestParameters['page'] != null) {
342
+ queryParameters['page'] = requestParameters['page'];
343
+ }
344
+ if (requestParameters['limit'] != null) {
345
+ queryParameters['limit'] = requestParameters['limit'];
346
+ }
347
+ if (requestParameters['filterAutomationId'] != null) {
348
+ queryParameters['filter[automationId]'] = requestParameters['filterAutomationId'];
349
+ }
350
+ if (requestParameters['filterLeadId'] != null) {
351
+ queryParameters['filter[leadId]'] = requestParameters['filterLeadId'];
352
+ }
353
+ if (requestParameters['filterTrigger'] != null) {
354
+ queryParameters['filter[trigger]'] = requestParameters['filterTrigger'];
355
+ }
356
+ if (requestParameters['filterMatched'] != null) {
357
+ queryParameters['filter[matched]'] = requestParameters['filterMatched'];
358
+ }
359
+ headerParameters = {};
360
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
361
+ _a = headerParameters;
362
+ _b = "apikey";
363
+ return [4 /*yield*/, this.configuration.apiKey("apikey")];
364
+ case 1:
365
+ _a[_b] = _c.sent(); // api_key authentication
366
+ _c.label = 2;
367
+ case 2:
368
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
369
+ token = this.configuration.accessToken;
370
+ return [4 /*yield*/, token("bearer", [])];
371
+ case 3:
372
+ tokenString = _c.sent();
373
+ if (tokenString) {
374
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
375
+ }
376
+ _c.label = 4;
377
+ case 4: return [4 /*yield*/, this.request({
378
+ path: "/private/automations/runs",
379
+ method: 'GET',
380
+ headers: headerParameters,
381
+ query: queryParameters,
382
+ }, initOverrides)];
383
+ case 5:
384
+ response = _c.sent();
385
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.GetAutomationRuns200ResponseFromJSON)(jsonValue); })];
386
+ }
387
+ });
388
+ });
389
+ };
390
+ /**
391
+ * 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.
392
+ * List the automation runs
393
+ */
394
+ AutomationsApi.prototype.getAutomationRuns = function () {
395
+ return __awaiter(this, arguments, void 0, function (requestParameters, initOverrides) {
396
+ var response;
397
+ if (requestParameters === void 0) { requestParameters = {}; }
398
+ return __generator(this, function (_a) {
399
+ switch (_a.label) {
400
+ case 0: return [4 /*yield*/, this.getAutomationRunsRaw(requestParameters, initOverrides)];
401
+ case 1:
402
+ response = _a.sent();
403
+ return [4 /*yield*/, response.value()];
404
+ case 2: return [2 /*return*/, _a.sent()];
405
+ }
406
+ });
407
+ });
408
+ };
409
+ /**
410
+ * 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.
411
+ * List automations
412
+ */
413
+ AutomationsApi.prototype.getAutomationsRaw = function (requestParameters, initOverrides) {
414
+ return __awaiter(this, void 0, void 0, function () {
415
+ var queryParameters, headerParameters, _a, _b, token, tokenString, response;
416
+ return __generator(this, function (_c) {
417
+ switch (_c.label) {
418
+ case 0:
419
+ queryParameters = {};
420
+ if (requestParameters['filter'] != null) {
421
+ queryParameters['filter'] = requestParameters['filter'];
422
+ }
423
+ if (requestParameters['page'] != null) {
424
+ queryParameters['page'] = requestParameters['page'];
425
+ }
426
+ if (requestParameters['limit'] != null) {
427
+ queryParameters['limit'] = requestParameters['limit'];
428
+ }
429
+ if (requestParameters['sortBy'] != null) {
430
+ queryParameters['sortBy'] = requestParameters['sortBy'];
431
+ }
432
+ headerParameters = {};
433
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
434
+ _a = headerParameters;
435
+ _b = "apikey";
436
+ return [4 /*yield*/, this.configuration.apiKey("apikey")];
437
+ case 1:
438
+ _a[_b] = _c.sent(); // api_key authentication
439
+ _c.label = 2;
440
+ case 2:
441
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
442
+ token = this.configuration.accessToken;
443
+ return [4 /*yield*/, token("bearer", [])];
444
+ case 3:
445
+ tokenString = _c.sent();
446
+ if (tokenString) {
447
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
448
+ }
449
+ _c.label = 4;
450
+ case 4: return [4 /*yield*/, this.request({
451
+ path: "/private/automations",
452
+ method: 'GET',
453
+ headers: headerParameters,
454
+ query: queryParameters,
455
+ }, initOverrides)];
456
+ case 5:
457
+ response = _c.sent();
458
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.GetAutomations200ResponseFromJSON)(jsonValue); })];
459
+ }
460
+ });
461
+ });
462
+ };
463
+ /**
464
+ * 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.
465
+ * List automations
466
+ */
467
+ AutomationsApi.prototype.getAutomations = function () {
468
+ return __awaiter(this, arguments, void 0, function (requestParameters, initOverrides) {
469
+ var response;
470
+ if (requestParameters === void 0) { requestParameters = {}; }
471
+ return __generator(this, function (_a) {
472
+ switch (_a.label) {
473
+ case 0: return [4 /*yield*/, this.getAutomationsRaw(requestParameters, initOverrides)];
474
+ case 1:
475
+ response = _a.sent();
476
+ return [4 /*yield*/, response.value()];
477
+ case 2: return [2 /*return*/, _a.sent()];
478
+ }
479
+ });
480
+ });
481
+ };
482
+ /**
483
+ * 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.
484
+ * List the automation runs of a lead
485
+ */
486
+ AutomationsApi.prototype.getLeadAutomationRunsRaw = function (requestParameters, initOverrides) {
487
+ return __awaiter(this, void 0, void 0, function () {
488
+ var queryParameters, headerParameters, _a, _b, token, tokenString, response;
489
+ return __generator(this, function (_c) {
490
+ switch (_c.label) {
491
+ case 0:
492
+ if (requestParameters['leadId'] == null) {
493
+ throw new runtime.RequiredError('leadId', 'Required parameter "leadId" was null or undefined when calling getLeadAutomationRuns().');
494
+ }
495
+ queryParameters = {};
496
+ headerParameters = {};
497
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
498
+ _a = headerParameters;
499
+ _b = "apikey";
500
+ return [4 /*yield*/, this.configuration.apiKey("apikey")];
501
+ case 1:
502
+ _a[_b] = _c.sent(); // api_key authentication
503
+ _c.label = 2;
504
+ case 2:
505
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
506
+ token = this.configuration.accessToken;
507
+ return [4 /*yield*/, token("bearer", [])];
508
+ case 3:
509
+ tokenString = _c.sent();
510
+ if (tokenString) {
511
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
512
+ }
513
+ _c.label = 4;
514
+ case 4: return [4 /*yield*/, this.request({
515
+ path: "/private/leads/{leadId}/automation-runs".replace("{".concat("leadId", "}"), encodeURIComponent(String(requestParameters['leadId']))),
516
+ method: 'GET',
517
+ headers: headerParameters,
518
+ query: queryParameters,
519
+ }, initOverrides)];
520
+ case 5:
521
+ response = _c.sent();
522
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return jsonValue.map(index_1.AutomationRunDtoFromJSON); })];
523
+ }
524
+ });
525
+ });
526
+ };
527
+ /**
528
+ * 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.
529
+ * List the automation runs of a lead
530
+ */
531
+ AutomationsApi.prototype.getLeadAutomationRuns = function (requestParameters, initOverrides) {
532
+ return __awaiter(this, void 0, void 0, function () {
533
+ var response;
534
+ return __generator(this, function (_a) {
535
+ switch (_a.label) {
536
+ case 0: return [4 /*yield*/, this.getLeadAutomationRunsRaw(requestParameters, initOverrides)];
537
+ case 1:
538
+ response = _a.sent();
539
+ return [4 /*yield*/, response.value()];
540
+ case 2: return [2 /*return*/, _a.sent()];
541
+ }
542
+ });
543
+ });
544
+ };
545
+ /**
546
+ * 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.
547
+ * Simulate the automations
548
+ */
549
+ AutomationsApi.prototype.simulateAutomationsRaw = function (requestParameters, initOverrides) {
550
+ return __awaiter(this, void 0, void 0, function () {
551
+ var queryParameters, headerParameters, _a, _b, token, tokenString, response;
552
+ return __generator(this, function (_c) {
553
+ switch (_c.label) {
554
+ case 0:
555
+ if (requestParameters['simulateAutomationsInput'] == null) {
556
+ throw new runtime.RequiredError('simulateAutomationsInput', 'Required parameter "simulateAutomationsInput" was null or undefined when calling simulateAutomations().');
557
+ }
558
+ queryParameters = {};
559
+ headerParameters = {};
560
+ headerParameters['Content-Type'] = 'application/json';
561
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
562
+ _a = headerParameters;
563
+ _b = "apikey";
564
+ return [4 /*yield*/, this.configuration.apiKey("apikey")];
565
+ case 1:
566
+ _a[_b] = _c.sent(); // api_key authentication
567
+ _c.label = 2;
568
+ case 2:
569
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
570
+ token = this.configuration.accessToken;
571
+ return [4 /*yield*/, token("bearer", [])];
572
+ case 3:
573
+ tokenString = _c.sent();
574
+ if (tokenString) {
575
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
576
+ }
577
+ _c.label = 4;
578
+ case 4: return [4 /*yield*/, this.request({
579
+ path: "/private/automations/simulation",
580
+ method: 'POST',
581
+ headers: headerParameters,
582
+ query: queryParameters,
583
+ body: (0, index_1.SimulateAutomationsInputToJSON)(requestParameters['simulateAutomationsInput']),
584
+ }, initOverrides)];
585
+ case 5:
586
+ response = _c.sent();
587
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return jsonValue.map(index_1.AutomationSimulationDtoFromJSON); })];
588
+ }
589
+ });
590
+ });
591
+ };
592
+ /**
593
+ * 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.
594
+ * Simulate the automations
595
+ */
596
+ AutomationsApi.prototype.simulateAutomations = function (requestParameters, initOverrides) {
597
+ return __awaiter(this, void 0, void 0, function () {
598
+ var response;
599
+ return __generator(this, function (_a) {
600
+ switch (_a.label) {
601
+ case 0: return [4 /*yield*/, this.simulateAutomationsRaw(requestParameters, initOverrides)];
602
+ case 1:
603
+ response = _a.sent();
604
+ return [4 /*yield*/, response.value()];
605
+ case 2: return [2 /*return*/, _a.sent()];
606
+ }
607
+ });
608
+ });
609
+ };
610
+ /**
611
+ * 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.
612
+ * Update an automation
613
+ */
614
+ AutomationsApi.prototype.updateAutomationRaw = function (requestParameters, initOverrides) {
615
+ return __awaiter(this, void 0, void 0, function () {
616
+ var queryParameters, headerParameters, _a, _b, token, tokenString, response;
617
+ return __generator(this, function (_c) {
618
+ switch (_c.label) {
619
+ case 0:
620
+ if (requestParameters['automationId'] == null) {
621
+ throw new runtime.RequiredError('automationId', 'Required parameter "automationId" was null or undefined when calling updateAutomation().');
622
+ }
623
+ if (requestParameters['automationInput'] == null) {
624
+ throw new runtime.RequiredError('automationInput', 'Required parameter "automationInput" was null or undefined when calling updateAutomation().');
625
+ }
626
+ queryParameters = {};
627
+ headerParameters = {};
628
+ headerParameters['Content-Type'] = 'application/json';
629
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
630
+ _a = headerParameters;
631
+ _b = "apikey";
632
+ return [4 /*yield*/, this.configuration.apiKey("apikey")];
633
+ case 1:
634
+ _a[_b] = _c.sent(); // api_key authentication
635
+ _c.label = 2;
636
+ case 2:
637
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
638
+ token = this.configuration.accessToken;
639
+ return [4 /*yield*/, token("bearer", [])];
640
+ case 3:
641
+ tokenString = _c.sent();
642
+ if (tokenString) {
643
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
644
+ }
645
+ _c.label = 4;
646
+ case 4: return [4 /*yield*/, this.request({
647
+ path: "/private/automations/{automationId}".replace("{".concat("automationId", "}"), encodeURIComponent(String(requestParameters['automationId']))),
648
+ method: 'PATCH',
649
+ headers: headerParameters,
650
+ query: queryParameters,
651
+ body: (0, index_1.AutomationInputToJSON)(requestParameters['automationInput']),
652
+ }, initOverrides)];
653
+ case 5:
654
+ response = _c.sent();
655
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.AutomationDtoFromJSON)(jsonValue); })];
656
+ }
657
+ });
658
+ });
659
+ };
660
+ /**
661
+ * 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.
662
+ * Update an automation
663
+ */
664
+ AutomationsApi.prototype.updateAutomation = function (requestParameters, initOverrides) {
665
+ return __awaiter(this, void 0, void 0, function () {
666
+ var response;
667
+ return __generator(this, function (_a) {
668
+ switch (_a.label) {
669
+ case 0: return [4 /*yield*/, this.updateAutomationRaw(requestParameters, initOverrides)];
670
+ case 1:
671
+ response = _a.sent();
672
+ return [4 /*yield*/, response.value()];
673
+ case 2: return [2 /*return*/, _a.sent()];
674
+ }
675
+ });
676
+ });
677
+ };
678
+ /**
679
+ * 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.
680
+ * Enable or disable an automation
681
+ */
682
+ AutomationsApi.prototype.updateAutomationStatusRaw = function (requestParameters, initOverrides) {
683
+ return __awaiter(this, void 0, void 0, function () {
684
+ var queryParameters, headerParameters, _a, _b, token, tokenString, response;
685
+ return __generator(this, function (_c) {
686
+ switch (_c.label) {
687
+ case 0:
688
+ if (requestParameters['automationId'] == null) {
689
+ throw new runtime.RequiredError('automationId', 'Required parameter "automationId" was null or undefined when calling updateAutomationStatus().');
690
+ }
691
+ if (requestParameters['automationStatusInput'] == null) {
692
+ throw new runtime.RequiredError('automationStatusInput', 'Required parameter "automationStatusInput" was null or undefined when calling updateAutomationStatus().');
693
+ }
694
+ queryParameters = {};
695
+ headerParameters = {};
696
+ headerParameters['Content-Type'] = 'application/json';
697
+ if (!(this.configuration && this.configuration.apiKey)) return [3 /*break*/, 2];
698
+ _a = headerParameters;
699
+ _b = "apikey";
700
+ return [4 /*yield*/, this.configuration.apiKey("apikey")];
701
+ case 1:
702
+ _a[_b] = _c.sent(); // api_key authentication
703
+ _c.label = 2;
704
+ case 2:
705
+ if (!(this.configuration && this.configuration.accessToken)) return [3 /*break*/, 4];
706
+ token = this.configuration.accessToken;
707
+ return [4 /*yield*/, token("bearer", [])];
708
+ case 3:
709
+ tokenString = _c.sent();
710
+ if (tokenString) {
711
+ headerParameters["Authorization"] = "Bearer ".concat(tokenString);
712
+ }
713
+ _c.label = 4;
714
+ case 4: return [4 /*yield*/, this.request({
715
+ path: "/private/automations/{automationId}/status".replace("{".concat("automationId", "}"), encodeURIComponent(String(requestParameters['automationId']))),
716
+ method: 'PATCH',
717
+ headers: headerParameters,
718
+ query: queryParameters,
719
+ body: (0, index_1.AutomationStatusInputToJSON)(requestParameters['automationStatusInput']),
720
+ }, initOverrides)];
721
+ case 5:
722
+ response = _c.sent();
723
+ return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.AutomationDtoFromJSON)(jsonValue); })];
724
+ }
725
+ });
726
+ });
727
+ };
728
+ /**
729
+ * 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.
730
+ * Enable or disable an automation
731
+ */
732
+ AutomationsApi.prototype.updateAutomationStatus = function (requestParameters, initOverrides) {
733
+ return __awaiter(this, void 0, void 0, function () {
734
+ var response;
735
+ return __generator(this, function (_a) {
736
+ switch (_a.label) {
737
+ case 0: return [4 /*yield*/, this.updateAutomationStatusRaw(requestParameters, initOverrides)];
738
+ case 1:
739
+ response = _a.sent();
740
+ return [4 /*yield*/, response.value()];
741
+ case 2: return [2 /*return*/, _a.sent()];
742
+ }
743
+ });
744
+ });
745
+ };
746
+ return AutomationsApi;
747
+ }(runtime.BaseAPI));
748
+ exports.AutomationsApi = AutomationsApi;