@tritonium/api-client 2.1.0

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.
package/dist/index.js ADDED
@@ -0,0 +1,3045 @@
1
+ 'use strict';
2
+
3
+ var crypto = require('crypto');
4
+
5
+ function _interopNamespace(e) {
6
+ if (e && e.__esModule) return e;
7
+ var n = Object.create(null);
8
+ if (e) {
9
+ Object.keys(e).forEach(function (k) {
10
+ if (k !== 'default') {
11
+ var d = Object.getOwnPropertyDescriptor(e, k);
12
+ Object.defineProperty(n, k, d.get ? d : {
13
+ enumerable: true,
14
+ get: function () { return e[k]; }
15
+ });
16
+ }
17
+ });
18
+ }
19
+ n.default = e;
20
+ return Object.freeze(n);
21
+ }
22
+
23
+ var crypto__namespace = /*#__PURE__*/_interopNamespace(crypto);
24
+
25
+ var __typeError = (msg) => {
26
+ throw TypeError(msg);
27
+ };
28
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
29
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
30
+ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
31
+ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
32
+
33
+ // core/ApiError.ts
34
+ var ApiError = class extends Error {
35
+ constructor(request2, response, message) {
36
+ super(message);
37
+ this.name = "ApiError";
38
+ this.url = response.url;
39
+ this.status = response.status;
40
+ this.statusText = response.statusText;
41
+ this.body = response.body;
42
+ this.request = request2;
43
+ }
44
+ };
45
+
46
+ // core/CancelablePromise.ts
47
+ var CancelError = class extends Error {
48
+ constructor(message) {
49
+ super(message);
50
+ this.name = "CancelError";
51
+ }
52
+ get isCancelled() {
53
+ return true;
54
+ }
55
+ };
56
+ var _isResolved, _isRejected, _isCancelled, _cancelHandlers, _promise, _resolve, _reject;
57
+ var CancelablePromise = class {
58
+ constructor(executor) {
59
+ __privateAdd(this, _isResolved);
60
+ __privateAdd(this, _isRejected);
61
+ __privateAdd(this, _isCancelled);
62
+ __privateAdd(this, _cancelHandlers);
63
+ __privateAdd(this, _promise);
64
+ __privateAdd(this, _resolve);
65
+ __privateAdd(this, _reject);
66
+ __privateSet(this, _isResolved, false);
67
+ __privateSet(this, _isRejected, false);
68
+ __privateSet(this, _isCancelled, false);
69
+ __privateSet(this, _cancelHandlers, []);
70
+ __privateSet(this, _promise, new Promise((resolve2, reject) => {
71
+ __privateSet(this, _resolve, resolve2);
72
+ __privateSet(this, _reject, reject);
73
+ const onResolve = (value) => {
74
+ if (__privateGet(this, _isResolved) || __privateGet(this, _isRejected) || __privateGet(this, _isCancelled)) {
75
+ return;
76
+ }
77
+ __privateSet(this, _isResolved, true);
78
+ if (__privateGet(this, _resolve)) __privateGet(this, _resolve).call(this, value);
79
+ };
80
+ const onReject = (reason) => {
81
+ if (__privateGet(this, _isResolved) || __privateGet(this, _isRejected) || __privateGet(this, _isCancelled)) {
82
+ return;
83
+ }
84
+ __privateSet(this, _isRejected, true);
85
+ if (__privateGet(this, _reject)) __privateGet(this, _reject).call(this, reason);
86
+ };
87
+ const onCancel = (cancelHandler) => {
88
+ if (__privateGet(this, _isResolved) || __privateGet(this, _isRejected) || __privateGet(this, _isCancelled)) {
89
+ return;
90
+ }
91
+ __privateGet(this, _cancelHandlers).push(cancelHandler);
92
+ };
93
+ Object.defineProperty(onCancel, "isResolved", {
94
+ get: () => __privateGet(this, _isResolved)
95
+ });
96
+ Object.defineProperty(onCancel, "isRejected", {
97
+ get: () => __privateGet(this, _isRejected)
98
+ });
99
+ Object.defineProperty(onCancel, "isCancelled", {
100
+ get: () => __privateGet(this, _isCancelled)
101
+ });
102
+ return executor(onResolve, onReject, onCancel);
103
+ }));
104
+ }
105
+ get [Symbol.toStringTag]() {
106
+ return "Cancellable Promise";
107
+ }
108
+ then(onFulfilled, onRejected) {
109
+ return __privateGet(this, _promise).then(onFulfilled, onRejected);
110
+ }
111
+ catch(onRejected) {
112
+ return __privateGet(this, _promise).catch(onRejected);
113
+ }
114
+ finally(onFinally) {
115
+ return __privateGet(this, _promise).finally(onFinally);
116
+ }
117
+ cancel() {
118
+ if (__privateGet(this, _isResolved) || __privateGet(this, _isRejected) || __privateGet(this, _isCancelled)) {
119
+ return;
120
+ }
121
+ __privateSet(this, _isCancelled, true);
122
+ if (__privateGet(this, _cancelHandlers).length) {
123
+ try {
124
+ for (const cancelHandler of __privateGet(this, _cancelHandlers)) {
125
+ cancelHandler();
126
+ }
127
+ } catch (error) {
128
+ console.warn("Cancellation threw an error", error);
129
+ return;
130
+ }
131
+ }
132
+ __privateGet(this, _cancelHandlers).length = 0;
133
+ if (__privateGet(this, _reject)) __privateGet(this, _reject).call(this, new CancelError("Request aborted"));
134
+ }
135
+ get isCancelled() {
136
+ return __privateGet(this, _isCancelled);
137
+ }
138
+ };
139
+ _isResolved = new WeakMap();
140
+ _isRejected = new WeakMap();
141
+ _isCancelled = new WeakMap();
142
+ _cancelHandlers = new WeakMap();
143
+ _promise = new WeakMap();
144
+ _resolve = new WeakMap();
145
+ _reject = new WeakMap();
146
+
147
+ // core/OpenAPI.ts
148
+ var OpenAPI = {
149
+ BASE: "https://api.tritonium.com",
150
+ VERSION: "1.0.0",
151
+ WITH_CREDENTIALS: false,
152
+ CREDENTIALS: "include",
153
+ TOKEN: void 0,
154
+ USERNAME: void 0,
155
+ PASSWORD: void 0,
156
+ HEADERS: void 0,
157
+ ENCODE_PATH: void 0
158
+ };
159
+
160
+ // auth.ts
161
+ function configureApiKey(apiKey, baseUrl = "https://api.tritonium.com") {
162
+ OpenAPI.BASE = baseUrl;
163
+ const existingHeaders = typeof OpenAPI.HEADERS === "object" && OpenAPI.HEADERS !== null ? OpenAPI.HEADERS : {};
164
+ OpenAPI.HEADERS = {
165
+ ...existingHeaders,
166
+ "X-API-Key": apiKey
167
+ };
168
+ if (OpenAPI.TOKEN) {
169
+ OpenAPI.TOKEN = void 0;
170
+ }
171
+ }
172
+ function configureBearerToken(token, baseUrl = "https://api.tritonium.com") {
173
+ OpenAPI.BASE = baseUrl;
174
+ OpenAPI.TOKEN = token;
175
+ if (OpenAPI.HEADERS && "X-API-Key" in OpenAPI.HEADERS) {
176
+ const { "X-API-Key": _, ...rest } = OpenAPI.HEADERS;
177
+ OpenAPI.HEADERS = rest;
178
+ }
179
+ }
180
+ function configure(config) {
181
+ if (config.baseUrl) {
182
+ OpenAPI.BASE = config.baseUrl;
183
+ }
184
+ if (config.apiKey) {
185
+ OpenAPI.HEADERS = {
186
+ ...OpenAPI.HEADERS,
187
+ ...config.headers,
188
+ "X-API-Key": config.apiKey
189
+ };
190
+ OpenAPI.TOKEN = void 0;
191
+ } else if (config.token) {
192
+ OpenAPI.TOKEN = config.token;
193
+ OpenAPI.HEADERS = {
194
+ ...OpenAPI.HEADERS,
195
+ ...config.headers
196
+ };
197
+ } else if (config.headers) {
198
+ OpenAPI.HEADERS = {
199
+ ...OpenAPI.HEADERS,
200
+ ...config.headers
201
+ };
202
+ }
203
+ }
204
+ function getConfiguration() {
205
+ const headers = OpenAPI.HEADERS;
206
+ const hasApiKey = typeof headers === "object" && headers !== null && "X-API-Key" in headers;
207
+ return {
208
+ baseUrl: OpenAPI.BASE,
209
+ hasApiKey,
210
+ hasToken: Boolean(OpenAPI.TOKEN)
211
+ };
212
+ }
213
+ function clearAuth() {
214
+ OpenAPI.TOKEN = void 0;
215
+ const headers = OpenAPI.HEADERS;
216
+ if (typeof headers === "object" && headers !== null && "X-API-Key" in headers) {
217
+ const { "X-API-Key": _, ...rest } = headers;
218
+ OpenAPI.HEADERS = rest;
219
+ }
220
+ }
221
+ var WebhookVerificationError = class extends Error {
222
+ constructor(message) {
223
+ super(message);
224
+ this.name = "WebhookVerificationError";
225
+ }
226
+ };
227
+ var WebhookExpiredError = class extends WebhookVerificationError {
228
+ constructor(message) {
229
+ super(message);
230
+ this.name = "WebhookExpiredError";
231
+ }
232
+ };
233
+ var WebhookSignatureError = class extends WebhookVerificationError {
234
+ constructor(message) {
235
+ super(message);
236
+ this.name = "WebhookSignatureError";
237
+ }
238
+ };
239
+ var EventTypes = {
240
+ CRISIS_DETECTED: "crisis.detected",
241
+ INSIGHT_GENERATED: "insight.generated",
242
+ REVIEW_RECEIVED: "review.received",
243
+ ANALYSIS_COMPLETED: "analysis.completed",
244
+ ALERT_TRIGGERED: "alert.triggered",
245
+ TEST_PING: "test.ping"
246
+ };
247
+ function verifySignature(payload, signature, secret) {
248
+ const payloadBuffer = typeof payload === "string" ? Buffer.from(payload) : payload;
249
+ const receivedSig = signature.startsWith("sha256=") ? signature.slice(7) : signature;
250
+ const expectedSig = crypto__namespace.createHmac("sha256", secret).update(payloadBuffer).digest("hex");
251
+ try {
252
+ return crypto__namespace.timingSafeEqual(
253
+ Buffer.from(receivedSig),
254
+ Buffer.from(expectedSig)
255
+ );
256
+ } catch {
257
+ return false;
258
+ }
259
+ }
260
+ function verifyTimestamp(timestamp, toleranceSeconds = 300) {
261
+ try {
262
+ const webhookTime = new Date(timestamp).getTime();
263
+ const now = Date.now();
264
+ const ageMs = Math.abs(now - webhookTime);
265
+ return ageMs <= toleranceSeconds * 1e3;
266
+ } catch {
267
+ return false;
268
+ }
269
+ }
270
+ function verifyWebhook(options) {
271
+ const { payload, signature, timestamp, secret, toleranceSeconds = 300 } = options;
272
+ if (!verifyTimestamp(timestamp, toleranceSeconds)) {
273
+ throw new WebhookExpiredError(
274
+ `Webhook timestamp is too old or invalid: ${timestamp}`
275
+ );
276
+ }
277
+ if (!verifySignature(payload, signature, secret)) {
278
+ throw new WebhookSignatureError("Invalid webhook signature");
279
+ }
280
+ let data;
281
+ try {
282
+ const payloadStr = typeof payload === "string" ? payload : payload.toString("utf-8");
283
+ data = JSON.parse(payloadStr);
284
+ } catch (e) {
285
+ throw new WebhookVerificationError(`Invalid webhook payload: ${e}`);
286
+ }
287
+ let eventTimestamp;
288
+ try {
289
+ eventTimestamp = new Date(
290
+ data.timestamp || timestamp
291
+ );
292
+ } catch {
293
+ eventTimestamp = /* @__PURE__ */ new Date();
294
+ }
295
+ return {
296
+ eventId: data.event_id || "",
297
+ eventType: data.event_type || "",
298
+ timestamp: eventTimestamp,
299
+ tenantId: data.tenant_id || "",
300
+ appUuid: data.app_uuid,
301
+ data: data.data || {},
302
+ rawPayload: data
303
+ };
304
+ }
305
+ var constructEvent = verifyWebhook;
306
+ function isWebhookError(error) {
307
+ return error instanceof WebhookVerificationError;
308
+ }
309
+
310
+ // models/Alert.ts
311
+ exports.Alert = void 0;
312
+ ((Alert2) => {
313
+ ((severity2) => {
314
+ severity2["CRITICAL"] = "critical";
315
+ severity2["HIGH"] = "high";
316
+ severity2["MEDIUM"] = "medium";
317
+ severity2["LOW"] = "low";
318
+ })(Alert2.severity || (Alert2.severity = {}));
319
+ ((status2) => {
320
+ status2["UNREAD"] = "unread";
321
+ status2["READ"] = "read";
322
+ status2["ACKNOWLEDGED"] = "acknowledged";
323
+ status2["SNOOZED"] = "snoozed";
324
+ })(Alert2.status || (Alert2.status = {}));
325
+ })(exports.Alert || (exports.Alert = {}));
326
+
327
+ // models/AlertUpdateRequest.ts
328
+ exports.AlertUpdateRequest = void 0;
329
+ ((AlertUpdateRequest2) => {
330
+ ((status2) => {
331
+ status2["UNREAD"] = "unread";
332
+ status2["READ"] = "read";
333
+ status2["ACKNOWLEDGED"] = "acknowledged";
334
+ status2["SNOOZED"] = "snoozed";
335
+ })(AlertUpdateRequest2.status || (AlertUpdateRequest2.status = {}));
336
+ })(exports.AlertUpdateRequest || (exports.AlertUpdateRequest = {}));
337
+
338
+ // models/AutoSyncConfigRequest.ts
339
+ exports.AutoSyncConfigRequest = void 0;
340
+ ((AutoSyncConfigRequest2) => {
341
+ ((frequency2) => {
342
+ frequency2["HOURLY"] = "hourly";
343
+ frequency2["DAILY"] = "daily";
344
+ frequency2["WEEKLY"] = "weekly";
345
+ })(AutoSyncConfigRequest2.frequency || (AutoSyncConfigRequest2.frequency = {}));
346
+ })(exports.AutoSyncConfigRequest || (exports.AutoSyncConfigRequest = {}));
347
+
348
+ // core/request.ts
349
+ var isDefined = (value) => {
350
+ return value !== void 0 && value !== null;
351
+ };
352
+ var isString = (value) => {
353
+ return typeof value === "string";
354
+ };
355
+ var isStringWithValue = (value) => {
356
+ return isString(value) && value !== "";
357
+ };
358
+ var isBlob = (value) => {
359
+ return typeof value === "object" && typeof value.type === "string" && typeof value.stream === "function" && typeof value.arrayBuffer === "function" && typeof value.constructor === "function" && typeof value.constructor.name === "string" && /^(Blob|File)$/.test(value.constructor.name) && /^(Blob|File)$/.test(value[Symbol.toStringTag]);
360
+ };
361
+ var isFormData = (value) => {
362
+ return value instanceof FormData;
363
+ };
364
+ var base64 = (str) => {
365
+ try {
366
+ return btoa(str);
367
+ } catch (err) {
368
+ return Buffer.from(str).toString("base64");
369
+ }
370
+ };
371
+ var getQueryString = (params) => {
372
+ const qs = [];
373
+ const append = (key, value) => {
374
+ qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
375
+ };
376
+ const process = (key, value) => {
377
+ if (isDefined(value)) {
378
+ if (Array.isArray(value)) {
379
+ value.forEach((v) => {
380
+ process(key, v);
381
+ });
382
+ } else if (typeof value === "object") {
383
+ Object.entries(value).forEach(([k, v]) => {
384
+ process(`${key}[${k}]`, v);
385
+ });
386
+ } else {
387
+ append(key, value);
388
+ }
389
+ }
390
+ };
391
+ Object.entries(params).forEach(([key, value]) => {
392
+ process(key, value);
393
+ });
394
+ if (qs.length > 0) {
395
+ return `?${qs.join("&")}`;
396
+ }
397
+ return "";
398
+ };
399
+ var getUrl = (config, options) => {
400
+ const encoder = config.ENCODE_PATH || encodeURI;
401
+ const path = options.url.replace("{api-version}", config.VERSION).replace(/{(.*?)}/g, (substring, group) => {
402
+ if (options.path?.hasOwnProperty(group)) {
403
+ return encoder(String(options.path[group]));
404
+ }
405
+ return substring;
406
+ });
407
+ const url = `${config.BASE}${path}`;
408
+ if (options.query) {
409
+ return `${url}${getQueryString(options.query)}`;
410
+ }
411
+ return url;
412
+ };
413
+ var getFormData = (options) => {
414
+ if (options.formData) {
415
+ const formData = new FormData();
416
+ const process = (key, value) => {
417
+ if (isString(value) || isBlob(value)) {
418
+ formData.append(key, value);
419
+ } else {
420
+ formData.append(key, JSON.stringify(value));
421
+ }
422
+ };
423
+ Object.entries(options.formData).filter(([_, value]) => isDefined(value)).forEach(([key, value]) => {
424
+ if (Array.isArray(value)) {
425
+ value.forEach((v) => process(key, v));
426
+ } else {
427
+ process(key, value);
428
+ }
429
+ });
430
+ return formData;
431
+ }
432
+ return void 0;
433
+ };
434
+ var resolve = async (options, resolver) => {
435
+ if (typeof resolver === "function") {
436
+ return resolver(options);
437
+ }
438
+ return resolver;
439
+ };
440
+ var getHeaders = async (config, options) => {
441
+ const [token, username, password, additionalHeaders] = await Promise.all([
442
+ resolve(options, config.TOKEN),
443
+ resolve(options, config.USERNAME),
444
+ resolve(options, config.PASSWORD),
445
+ resolve(options, config.HEADERS)
446
+ ]);
447
+ const headers = Object.entries({
448
+ Accept: "application/json",
449
+ ...additionalHeaders,
450
+ ...options.headers
451
+ }).filter(([_, value]) => isDefined(value)).reduce((headers2, [key, value]) => ({
452
+ ...headers2,
453
+ [key]: String(value)
454
+ }), {});
455
+ if (isStringWithValue(token)) {
456
+ headers["Authorization"] = `Bearer ${token}`;
457
+ }
458
+ if (isStringWithValue(username) && isStringWithValue(password)) {
459
+ const credentials = base64(`${username}:${password}`);
460
+ headers["Authorization"] = `Basic ${credentials}`;
461
+ }
462
+ if (options.body !== void 0) {
463
+ if (options.mediaType) {
464
+ headers["Content-Type"] = options.mediaType;
465
+ } else if (isBlob(options.body)) {
466
+ headers["Content-Type"] = options.body.type || "application/octet-stream";
467
+ } else if (isString(options.body)) {
468
+ headers["Content-Type"] = "text/plain";
469
+ } else if (!isFormData(options.body)) {
470
+ headers["Content-Type"] = "application/json";
471
+ }
472
+ }
473
+ return new Headers(headers);
474
+ };
475
+ var getRequestBody = (options) => {
476
+ if (options.body !== void 0) {
477
+ if (options.mediaType?.includes("/json")) {
478
+ return JSON.stringify(options.body);
479
+ } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) {
480
+ return options.body;
481
+ } else {
482
+ return JSON.stringify(options.body);
483
+ }
484
+ }
485
+ return void 0;
486
+ };
487
+ var sendRequest = async (config, options, url, body, formData, headers, onCancel) => {
488
+ const controller = new AbortController();
489
+ const request2 = {
490
+ headers,
491
+ body: body ?? formData,
492
+ method: options.method,
493
+ signal: controller.signal
494
+ };
495
+ if (config.WITH_CREDENTIALS) {
496
+ request2.credentials = config.CREDENTIALS;
497
+ }
498
+ onCancel(() => controller.abort());
499
+ return await fetch(url, request2);
500
+ };
501
+ var getResponseHeader = (response, responseHeader) => {
502
+ if (responseHeader) {
503
+ const content = response.headers.get(responseHeader);
504
+ if (isString(content)) {
505
+ return content;
506
+ }
507
+ }
508
+ return void 0;
509
+ };
510
+ var getResponseBody = async (response) => {
511
+ if (response.status !== 204) {
512
+ try {
513
+ const contentType = response.headers.get("Content-Type");
514
+ if (contentType) {
515
+ const jsonTypes = ["application/json", "application/problem+json"];
516
+ const isJSON = jsonTypes.some((type) => contentType.toLowerCase().startsWith(type));
517
+ if (isJSON) {
518
+ return await response.json();
519
+ } else {
520
+ return await response.text();
521
+ }
522
+ }
523
+ } catch (error) {
524
+ console.error(error);
525
+ }
526
+ }
527
+ return void 0;
528
+ };
529
+ var catchErrorCodes = (options, result) => {
530
+ const errors = {
531
+ 400: "Bad Request",
532
+ 401: "Unauthorized",
533
+ 403: "Forbidden",
534
+ 404: "Not Found",
535
+ 500: "Internal Server Error",
536
+ 502: "Bad Gateway",
537
+ 503: "Service Unavailable",
538
+ ...options.errors
539
+ };
540
+ const error = errors[result.status];
541
+ if (error) {
542
+ throw new ApiError(options, result, error);
543
+ }
544
+ if (!result.ok) {
545
+ const errorStatus = result.status ?? "unknown";
546
+ const errorStatusText = result.statusText ?? "unknown";
547
+ const errorBody = (() => {
548
+ try {
549
+ return JSON.stringify(result.body, null, 2);
550
+ } catch (e) {
551
+ return void 0;
552
+ }
553
+ })();
554
+ throw new ApiError(
555
+ options,
556
+ result,
557
+ `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}`
558
+ );
559
+ }
560
+ };
561
+ var request = (config, options) => {
562
+ return new CancelablePromise(async (resolve2, reject, onCancel) => {
563
+ try {
564
+ const url = getUrl(config, options);
565
+ const formData = getFormData(options);
566
+ const body = getRequestBody(options);
567
+ const headers = await getHeaders(config, options);
568
+ if (!onCancel.isCancelled) {
569
+ const response = await sendRequest(config, options, url, body, formData, headers, onCancel);
570
+ const responseBody = await getResponseBody(response);
571
+ const responseHeader = getResponseHeader(response, options.responseHeader);
572
+ const result = {
573
+ url,
574
+ ok: response.ok,
575
+ status: response.status,
576
+ statusText: response.statusText,
577
+ body: responseHeader ?? responseBody
578
+ };
579
+ catchErrorCodes(options, result);
580
+ resolve2(result.body);
581
+ }
582
+ } catch (error) {
583
+ reject(error);
584
+ }
585
+ });
586
+ };
587
+
588
+ // services/AlertsService.ts
589
+ var AlertsService = class {
590
+ /**
591
+ * List alert notifications for the tenant.
592
+ * @param limit
593
+ * @param cursor
594
+ * @param severity
595
+ * @param status
596
+ * @returns any Alerts returned.
597
+ * @throws ApiError
598
+ */
599
+ static getAlerts(limit, cursor, severity, status) {
600
+ return request(OpenAPI, {
601
+ method: "GET",
602
+ url: "/api/v1/alerts",
603
+ query: {
604
+ "limit": limit,
605
+ "cursor": cursor,
606
+ "severity": severity,
607
+ "status": status
608
+ },
609
+ errors: {
610
+ 401: `Authentication required or token invalid.`
611
+ }
612
+ });
613
+ }
614
+ /**
615
+ * Retrieve alert details.
616
+ * @param alertId
617
+ * @returns Alert Alert returned.
618
+ * @throws ApiError
619
+ */
620
+ static getAlert(alertId) {
621
+ return request(OpenAPI, {
622
+ method: "GET",
623
+ url: "/api/v1/alerts/{alertId}",
624
+ path: {
625
+ "alertId": alertId
626
+ },
627
+ errors: {
628
+ 401: `Authentication required or token invalid.`,
629
+ 404: `Resource not found.`
630
+ }
631
+ });
632
+ }
633
+ /**
634
+ * Update alert status or acknowledgement metadata.
635
+ * @param alertId
636
+ * @param requestBody
637
+ * @returns Alert Alert updated.
638
+ * @throws ApiError
639
+ */
640
+ static patchAlert(alertId, requestBody) {
641
+ return request(OpenAPI, {
642
+ method: "PATCH",
643
+ url: "/api/v1/alerts/{alertId}",
644
+ path: {
645
+ "alertId": alertId
646
+ },
647
+ body: requestBody,
648
+ mediaType: "application/json",
649
+ errors: {
650
+ 400: `Request validation failed.`,
651
+ 401: `Authentication required or token invalid.`,
652
+ 404: `Resource not found.`
653
+ }
654
+ });
655
+ }
656
+ /**
657
+ * Assign an alert to a team member.
658
+ * Assigns the specified alert to a team member for follow-up. Used by the alerts PWA for delegation workflows.
659
+ * @param alertId
660
+ * @param requestBody
661
+ * @returns GenericSuccess Alert assigned successfully.
662
+ * @throws ApiError
663
+ */
664
+ static postAlertAssign(alertId, requestBody) {
665
+ return request(OpenAPI, {
666
+ method: "POST",
667
+ url: "/api/v1/alerts/{alertId}/assign",
668
+ path: {
669
+ "alertId": alertId
670
+ },
671
+ body: requestBody,
672
+ mediaType: "application/json",
673
+ errors: {
674
+ 400: `Request validation failed.`,
675
+ 401: `Authentication required or token invalid.`,
676
+ 404: `Resource not found.`
677
+ }
678
+ });
679
+ }
680
+ };
681
+
682
+ // services/AppsService.ts
683
+ var AppsService = class {
684
+ /**
685
+ * List apps connected to the current tenant.
686
+ * @returns any Apps retrieved.
687
+ * @throws ApiError
688
+ */
689
+ static getApps() {
690
+ return request(OpenAPI, {
691
+ method: "GET",
692
+ url: "/api/v1/apps",
693
+ errors: {
694
+ 401: `Authentication required or token invalid.`
695
+ }
696
+ });
697
+ }
698
+ /**
699
+ * Connect a new app using stored credentials.
700
+ * @param requestBody
701
+ * @returns AppSummary App connected.
702
+ * @throws ApiError
703
+ */
704
+ static postAppsConnect(requestBody) {
705
+ return request(OpenAPI, {
706
+ method: "POST",
707
+ url: "/api/v1/apps",
708
+ body: requestBody,
709
+ mediaType: "application/json",
710
+ errors: {
711
+ 400: `Request validation failed.`,
712
+ 401: `Authentication required or token invalid.`
713
+ }
714
+ });
715
+ }
716
+ /**
717
+ * Alias endpoint for connecting apps.
718
+ * @param requestBody
719
+ * @returns AppSummary App connected.
720
+ * @throws ApiError
721
+ */
722
+ static postAppsConnectAlias(requestBody) {
723
+ return request(OpenAPI, {
724
+ method: "POST",
725
+ url: "/api/v1/apps/connect",
726
+ body: requestBody,
727
+ mediaType: "application/json",
728
+ errors: {
729
+ 400: `Request validation failed.`,
730
+ 401: `Authentication required or token invalid.`
731
+ }
732
+ });
733
+ }
734
+ /**
735
+ * Trigger an on-demand review sync for a specific app.
736
+ * @param requestBody
737
+ * @returns GenericSuccess Sync job queued.
738
+ * @throws ApiError
739
+ */
740
+ static postAppsSync(requestBody) {
741
+ return request(OpenAPI, {
742
+ method: "POST",
743
+ url: "/api/v1/apps/sync",
744
+ body: requestBody,
745
+ mediaType: "application/json",
746
+ errors: {
747
+ 400: `Request validation failed.`,
748
+ 401: `Authentication required or token invalid.`,
749
+ 403: `Request not permitted for this user.`
750
+ }
751
+ });
752
+ }
753
+ /**
754
+ * Queue AI-powered analysis for an app.
755
+ * @param requestBody
756
+ * @returns any Analysis queued or cached result returned.
757
+ * @throws ApiError
758
+ */
759
+ static postAppsAnalyze(requestBody) {
760
+ return request(OpenAPI, {
761
+ method: "POST",
762
+ url: "/api/v1/apps/analyze",
763
+ body: requestBody,
764
+ mediaType: "application/json",
765
+ errors: {
766
+ 400: `Request validation failed.`,
767
+ 401: `Authentication required or token invalid.`,
768
+ 403: `Request not permitted for this user.`
769
+ }
770
+ });
771
+ }
772
+ /**
773
+ * Update automatic review sync settings.
774
+ * @param appUuid
775
+ * @param requestBody
776
+ * @returns any Auto-sync settings updated.
777
+ * @throws ApiError
778
+ */
779
+ static patchAppAutoSync(appUuid, requestBody) {
780
+ return request(OpenAPI, {
781
+ method: "PATCH",
782
+ url: "/api/v1/apps/{appUuid}/auto-sync",
783
+ path: {
784
+ "appUuid": appUuid
785
+ },
786
+ body: requestBody,
787
+ mediaType: "application/json",
788
+ errors: {
789
+ 400: `Request validation failed.`,
790
+ 401: `Authentication required or token invalid.`,
791
+ 403: `Request not permitted for this user.`,
792
+ 404: `Resource not found.`
793
+ }
794
+ });
795
+ }
796
+ /**
797
+ * Enable or disable automatic review sync.
798
+ * @param appUuid
799
+ * @param requestBody
800
+ * @returns any Auto-sync settings updated.
801
+ * @throws ApiError
802
+ */
803
+ static postAppAutoSync(appUuid, requestBody) {
804
+ return request(OpenAPI, {
805
+ method: "POST",
806
+ url: "/api/v1/apps/{appUuid}/auto-sync",
807
+ path: {
808
+ "appUuid": appUuid
809
+ },
810
+ body: requestBody,
811
+ mediaType: "application/json",
812
+ errors: {
813
+ 400: `Request validation failed.`,
814
+ 401: `Authentication required or token invalid.`,
815
+ 403: `Request not permitted for this user.`,
816
+ 404: `Resource not found.`
817
+ }
818
+ });
819
+ }
820
+ /**
821
+ * List competitor apps registered for benchmarking.
822
+ * @param appUuid
823
+ * @returns any Competitors returned.
824
+ * @throws ApiError
825
+ */
826
+ static getCompetitors(appUuid) {
827
+ return request(OpenAPI, {
828
+ method: "GET",
829
+ url: "/api/v1/apps/{appUuid}/competitors",
830
+ path: {
831
+ "appUuid": appUuid
832
+ },
833
+ errors: {
834
+ 401: `Authentication required or token invalid.`,
835
+ 403: `Request not permitted for this user.`,
836
+ 404: `Resource not found.`
837
+ }
838
+ });
839
+ }
840
+ /**
841
+ * Register a competitor app.
842
+ * @param appUuid
843
+ * @param requestBody
844
+ * @returns Competitor Competitor registered.
845
+ * @throws ApiError
846
+ */
847
+ static postCompetitor(appUuid, requestBody) {
848
+ return request(OpenAPI, {
849
+ method: "POST",
850
+ url: "/api/v1/apps/{appUuid}/competitors",
851
+ path: {
852
+ "appUuid": appUuid
853
+ },
854
+ body: requestBody,
855
+ mediaType: "application/json",
856
+ errors: {
857
+ 400: `Request validation failed.`,
858
+ 401: `Authentication required or token invalid.`,
859
+ 403: `Request not permitted for this user.`,
860
+ 404: `Resource not found.`
861
+ }
862
+ });
863
+ }
864
+ /**
865
+ * Remove a competitor mapping.
866
+ * @param appUuid
867
+ * @param platform
868
+ * @param externalAppId
869
+ * @returns void
870
+ * @throws ApiError
871
+ */
872
+ static deleteCompetitor(appUuid, platform, externalAppId) {
873
+ return request(OpenAPI, {
874
+ method: "DELETE",
875
+ url: "/api/v1/apps/{appUuid}/competitors/{platform}/{externalAppId}",
876
+ path: {
877
+ "appUuid": appUuid,
878
+ "platform": platform,
879
+ "externalAppId": externalAppId
880
+ },
881
+ errors: {
882
+ 401: `Authentication required or token invalid.`,
883
+ 403: `Request not permitted for this user.`,
884
+ 404: `Resource not found.`
885
+ }
886
+ });
887
+ }
888
+ /**
889
+ * Historical feature impact entries for an app release.
890
+ * @param appUuid
891
+ * @param limit
892
+ * @param cursor
893
+ * @returns any Feature history returned.
894
+ * @throws ApiError
895
+ */
896
+ static getFeatureHistory(appUuid, limit, cursor) {
897
+ return request(OpenAPI, {
898
+ method: "GET",
899
+ url: "/api/v1/apps/{appUuid}/features/history",
900
+ path: {
901
+ "appUuid": appUuid
902
+ },
903
+ query: {
904
+ "limit": limit,
905
+ "cursor": cursor
906
+ },
907
+ errors: {
908
+ 401: `Authentication required or token invalid.`,
909
+ 403: `Request not permitted for this user.`,
910
+ 404: `Resource not found.`
911
+ }
912
+ });
913
+ }
914
+ };
915
+
916
+ // services/AuthService.ts
917
+ var AuthService = class {
918
+ /**
919
+ * Register a new workspace owner.
920
+ * @param requestBody
921
+ * @returns GenericSuccess Registration accepted.
922
+ * @throws ApiError
923
+ */
924
+ static postRegister(requestBody) {
925
+ return request(OpenAPI, {
926
+ method: "POST",
927
+ url: "/api/v1/auth/register",
928
+ body: requestBody,
929
+ mediaType: "application/json",
930
+ errors: {
931
+ 400: `Request validation failed.`,
932
+ 409: `Resource already exists or is in conflict.`
933
+ }
934
+ });
935
+ }
936
+ /**
937
+ * Confirm email verification token.
938
+ * @param requestBody
939
+ * @returns GenericSuccess Email verified.
940
+ * @throws ApiError
941
+ */
942
+ static postVerifyEmail(requestBody) {
943
+ return request(OpenAPI, {
944
+ method: "POST",
945
+ url: "/api/v1/auth/verify-email",
946
+ body: requestBody,
947
+ mediaType: "application/json",
948
+ errors: {
949
+ 400: `Request validation failed.`,
950
+ 410: `Token expired or resource no longer available.`
951
+ }
952
+ });
953
+ }
954
+ /**
955
+ * Trigger a new verification email.
956
+ * @param requestBody
957
+ * @returns GenericSuccess Verification email queued.
958
+ * @throws ApiError
959
+ */
960
+ static postResendVerification(requestBody) {
961
+ return request(OpenAPI, {
962
+ method: "POST",
963
+ url: "/api/v1/auth/resend-verification",
964
+ body: requestBody,
965
+ mediaType: "application/json",
966
+ errors: {
967
+ 400: `Request validation failed.`
968
+ }
969
+ });
970
+ }
971
+ /**
972
+ * Request a password reset email.
973
+ * @param requestBody
974
+ * @returns GenericSuccess Reset email dispatched.
975
+ * @throws ApiError
976
+ */
977
+ static postForgotPassword(requestBody) {
978
+ return request(OpenAPI, {
979
+ method: "POST",
980
+ url: "/api/v1/auth/forgot-password",
981
+ body: requestBody,
982
+ mediaType: "application/json",
983
+ errors: {
984
+ 400: `Request validation failed.`
985
+ }
986
+ });
987
+ }
988
+ /**
989
+ * Reset password with a valid token.
990
+ * @param requestBody
991
+ * @returns GenericSuccess Password updated.
992
+ * @throws ApiError
993
+ */
994
+ static postResetPassword(requestBody) {
995
+ return request(OpenAPI, {
996
+ method: "POST",
997
+ url: "/api/v1/auth/reset-password",
998
+ body: requestBody,
999
+ mediaType: "application/json",
1000
+ errors: {
1001
+ 400: `Request validation failed.`,
1002
+ 410: `Token expired or resource no longer available.`
1003
+ }
1004
+ });
1005
+ }
1006
+ /**
1007
+ * Authenticate via email and password.
1008
+ * @param requestBody
1009
+ * @returns any Login successful.
1010
+ * @throws ApiError
1011
+ */
1012
+ static postLogin(requestBody) {
1013
+ return request(OpenAPI, {
1014
+ method: "POST",
1015
+ url: "/api/v1/auth/login",
1016
+ body: requestBody,
1017
+ mediaType: "application/json",
1018
+ errors: {
1019
+ 400: `Request validation failed.`,
1020
+ 401: `Authentication required or token invalid.`,
1021
+ 403: `Request not permitted for this user.`
1022
+ }
1023
+ });
1024
+ }
1025
+ /**
1026
+ * Complete Google Workspace SSO exchange.
1027
+ * @param requestBody
1028
+ * @returns any Google SSO successful.
1029
+ * @throws ApiError
1030
+ */
1031
+ static postGoogleSso(requestBody) {
1032
+ return request(OpenAPI, {
1033
+ method: "POST",
1034
+ url: "/api/v1/auth/google/sso",
1035
+ body: requestBody,
1036
+ mediaType: "application/json",
1037
+ errors: {
1038
+ 400: `Request validation failed.`,
1039
+ 401: `Authentication required or token invalid.`,
1040
+ 403: `Request not permitted for this user.`
1041
+ }
1042
+ });
1043
+ }
1044
+ /**
1045
+ * Complete Microsoft Entra ID SSO exchange.
1046
+ * @param requestBody
1047
+ * @returns any Microsoft SSO successful.
1048
+ * @throws ApiError
1049
+ */
1050
+ static postMicrosoftSso(requestBody) {
1051
+ return request(OpenAPI, {
1052
+ method: "POST",
1053
+ url: "/api/v1/auth/microsoft/sso",
1054
+ body: requestBody,
1055
+ mediaType: "application/json",
1056
+ errors: {
1057
+ 400: `Request validation failed.`,
1058
+ 401: `Authentication required or token invalid.`,
1059
+ 403: `Request not permitted for this user.`
1060
+ }
1061
+ });
1062
+ }
1063
+ };
1064
+
1065
+ // services/BillingService.ts
1066
+ var BillingService = class {
1067
+ /**
1068
+ * Create a Stripe Checkout session.
1069
+ * @param requestBody
1070
+ * @returns any Checkout session created.
1071
+ * @throws ApiError
1072
+ */
1073
+ static postBillingCheckout(requestBody) {
1074
+ return request(OpenAPI, {
1075
+ method: "POST",
1076
+ url: "/api/v1/billing/checkout",
1077
+ body: requestBody,
1078
+ mediaType: "application/json",
1079
+ errors: {
1080
+ 400: `Request validation failed.`,
1081
+ 401: `Authentication required or token invalid.`
1082
+ }
1083
+ });
1084
+ }
1085
+ /**
1086
+ * Retrieve current subscription details.
1087
+ * @returns Subscription Subscription returned.
1088
+ * @throws ApiError
1089
+ */
1090
+ static getSubscription() {
1091
+ return request(OpenAPI, {
1092
+ method: "GET",
1093
+ url: "/api/v1/billing/subscription",
1094
+ errors: {
1095
+ 401: `Authentication required or token invalid.`
1096
+ }
1097
+ });
1098
+ }
1099
+ /**
1100
+ * Retrieve per-integration subscription details.
1101
+ * @returns any Per-integration subscription returned.
1102
+ * @throws ApiError
1103
+ */
1104
+ static getSubscriptionV2() {
1105
+ return request(OpenAPI, {
1106
+ method: "GET",
1107
+ url: "/api/v1/billing/subscription-v2",
1108
+ errors: {
1109
+ 401: `Authentication required or token invalid.`
1110
+ }
1111
+ });
1112
+ }
1113
+ /**
1114
+ * Cancel the active subscription at period end.
1115
+ * @returns Subscription Subscription cancellation scheduled.
1116
+ * @throws ApiError
1117
+ */
1118
+ static postCancelSubscription() {
1119
+ return request(OpenAPI, {
1120
+ method: "POST",
1121
+ url: "/api/v1/billing/cancel-subscription",
1122
+ errors: {
1123
+ 401: `Authentication required or token invalid.`
1124
+ }
1125
+ });
1126
+ }
1127
+ /**
1128
+ * Reactivate a cancelled subscription.
1129
+ * @returns Subscription Subscription reactivated.
1130
+ * @throws ApiError
1131
+ */
1132
+ static postReactivateSubscription() {
1133
+ return request(OpenAPI, {
1134
+ method: "POST",
1135
+ url: "/api/v1/billing/reactivate-subscription",
1136
+ errors: {
1137
+ 401: `Authentication required or token invalid.`
1138
+ }
1139
+ });
1140
+ }
1141
+ /**
1142
+ * Attach or update a default payment method.
1143
+ * @param requestBody
1144
+ * @returns Subscription Payment method updated.
1145
+ * @throws ApiError
1146
+ */
1147
+ static postPaymentMethod(requestBody) {
1148
+ return request(OpenAPI, {
1149
+ method: "POST",
1150
+ url: "/api/v1/billing/payment-method",
1151
+ body: requestBody,
1152
+ mediaType: "application/json",
1153
+ errors: {
1154
+ 400: `Request validation failed.`,
1155
+ 401: `Authentication required or token invalid.`
1156
+ }
1157
+ });
1158
+ }
1159
+ /**
1160
+ * List invoices for the tenant.
1161
+ * @param limit
1162
+ * @param cursor
1163
+ * @returns any Invoices returned.
1164
+ * @throws ApiError
1165
+ */
1166
+ static getInvoices(limit, cursor) {
1167
+ return request(OpenAPI, {
1168
+ method: "GET",
1169
+ url: "/api/v1/billing/invoices",
1170
+ query: {
1171
+ "limit": limit,
1172
+ "cursor": cursor
1173
+ },
1174
+ errors: {
1175
+ 401: `Authentication required or token invalid.`
1176
+ }
1177
+ });
1178
+ }
1179
+ /**
1180
+ * Stripe webhook endpoint.
1181
+ * @param requestBody
1182
+ * @returns any Event processed.
1183
+ * @throws ApiError
1184
+ */
1185
+ static postBillingWebhook(requestBody) {
1186
+ return request(OpenAPI, {
1187
+ method: "POST",
1188
+ url: "/api/v1/billing/webhooks",
1189
+ body: requestBody,
1190
+ mediaType: "application/json",
1191
+ errors: {
1192
+ 400: `Request validation failed.`,
1193
+ 401: `Authentication required or token invalid.`
1194
+ }
1195
+ });
1196
+ }
1197
+ /**
1198
+ * Calculate per-integration pricing totals.
1199
+ * @param requestBody
1200
+ * @returns any Pricing calculated.
1201
+ * @throws ApiError
1202
+ */
1203
+ static postCalculatePricing(requestBody) {
1204
+ return request(OpenAPI, {
1205
+ method: "POST",
1206
+ url: "/api/v1/billing/calculate-pricing",
1207
+ body: requestBody,
1208
+ mediaType: "application/json",
1209
+ errors: {
1210
+ 400: `Request validation failed.`
1211
+ }
1212
+ });
1213
+ }
1214
+ /**
1215
+ * Create per-integration subscription.
1216
+ * @param requestBody
1217
+ * @returns any Subscription created.
1218
+ * @throws ApiError
1219
+ */
1220
+ static postCreateSubscriptionV2(requestBody) {
1221
+ return request(OpenAPI, {
1222
+ method: "POST",
1223
+ url: "/api/v1/billing/create-subscription-v2",
1224
+ body: requestBody,
1225
+ mediaType: "application/json",
1226
+ errors: {
1227
+ 400: `Request validation failed.`,
1228
+ 402: `Request validation failed.`
1229
+ }
1230
+ });
1231
+ }
1232
+ /**
1233
+ * Update per-integration subscription quantities.
1234
+ * @param requestBody
1235
+ * @returns any Subscription updated.
1236
+ * @throws ApiError
1237
+ */
1238
+ static postUpdateSubscriptionV2(requestBody) {
1239
+ return request(OpenAPI, {
1240
+ method: "POST",
1241
+ url: "/api/v1/billing/update-subscription-v2",
1242
+ body: requestBody,
1243
+ mediaType: "application/json",
1244
+ errors: {
1245
+ 400: `Request validation failed.`,
1246
+ 402: `Request validation failed.`
1247
+ }
1248
+ });
1249
+ }
1250
+ /**
1251
+ * Migrate legacy subscriptions to per-integration pricing.
1252
+ * @param requestBody
1253
+ * @returns any Migration initiated.
1254
+ * @throws ApiError
1255
+ */
1256
+ static postMigrateSubscription(requestBody) {
1257
+ return request(OpenAPI, {
1258
+ method: "POST",
1259
+ url: "/api/v1/billing/migrate-subscription",
1260
+ body: requestBody,
1261
+ mediaType: "application/json",
1262
+ errors: {
1263
+ 400: `Request validation failed.`,
1264
+ 401: `Authentication required or token invalid.`,
1265
+ 402: `Request validation failed.`
1266
+ }
1267
+ });
1268
+ }
1269
+ /**
1270
+ * Calculate regional pricing based on country.
1271
+ * Returns pricing information adjusted for purchasing power parity (PPP) based on the provided country code. Discounts range from 0% (US/UK/EU) to 60% for developing economies.
1272
+ * @param requestBody
1273
+ * @returns any Regional pricing calculated.
1274
+ * @throws ApiError
1275
+ */
1276
+ static postRegionalPricing(requestBody) {
1277
+ return request(OpenAPI, {
1278
+ method: "POST",
1279
+ url: "/api/v1/billing/regional-pricing",
1280
+ body: requestBody,
1281
+ mediaType: "application/json",
1282
+ errors: {
1283
+ 400: `Request validation failed.`,
1284
+ 401: `Authentication required or token invalid.`
1285
+ }
1286
+ });
1287
+ }
1288
+ /**
1289
+ * Detect user's country from IP address.
1290
+ * Detects the user's country based on their IP address for display purposes. Note: Final pricing is always determined by card country, not IP location.
1291
+ * @returns any Country detected successfully.
1292
+ * @throws ApiError
1293
+ */
1294
+ static getDetectCountry() {
1295
+ return request(OpenAPI, {
1296
+ method: "GET",
1297
+ url: "/api/v1/billing/detect-country",
1298
+ errors: {
1299
+ 401: `Authentication required or token invalid.`
1300
+ }
1301
+ });
1302
+ }
1303
+ /**
1304
+ * Get usage dashboard data.
1305
+ * Returns comprehensive usage data for the current billing period including apps, members, syncs, and cost projections.
1306
+ * @returns any Usage dashboard data returned.
1307
+ * @throws ApiError
1308
+ */
1309
+ static getUsageDashboard() {
1310
+ return request(OpenAPI, {
1311
+ method: "GET",
1312
+ url: "/api/v1/billing/usage-dashboard",
1313
+ errors: {
1314
+ 401: `Authentication required or token invalid.`,
1315
+ 404: `Resource not found.`
1316
+ }
1317
+ });
1318
+ }
1319
+ /**
1320
+ * Get bill forecast data.
1321
+ * Returns projected billing amounts over a specified horizon (7d, 30d, or 90d) with confidence intervals.
1322
+ * @param horizon Forecast horizon
1323
+ * @returns any Bill forecast returned.
1324
+ * @throws ApiError
1325
+ */
1326
+ static getBillForecast(horizon = "30d") {
1327
+ return request(OpenAPI, {
1328
+ method: "GET",
1329
+ url: "/api/v1/billing/bill-forecast",
1330
+ query: {
1331
+ "horizon": horizon
1332
+ },
1333
+ errors: {
1334
+ 401: `Authentication required or token invalid.`,
1335
+ 404: `Resource not found.`
1336
+ }
1337
+ });
1338
+ }
1339
+ /**
1340
+ * Get pricing information.
1341
+ * Returns the current pricing model and rates.
1342
+ * @returns any Pricing information returned.
1343
+ * @throws ApiError
1344
+ */
1345
+ static getPricing() {
1346
+ return request(OpenAPI, {
1347
+ method: "GET",
1348
+ url: "/api/v1/billing/pricing",
1349
+ errors: {
1350
+ 401: `Authentication required or token invalid.`
1351
+ }
1352
+ });
1353
+ }
1354
+ };
1355
+
1356
+ // services/CredentialsService.ts
1357
+ var CredentialsService = class {
1358
+ /**
1359
+ * List stored credentials for the tenant.
1360
+ * @returns any Credentials returned.
1361
+ * @throws ApiError
1362
+ */
1363
+ static getCredentials() {
1364
+ return request(OpenAPI, {
1365
+ method: "GET",
1366
+ url: "/api/v1/credentials",
1367
+ errors: {
1368
+ 401: `Authentication required or token invalid.`
1369
+ }
1370
+ });
1371
+ }
1372
+ /**
1373
+ * Store a new credential set.
1374
+ * @param requestBody
1375
+ * @returns Credential Credential stored.
1376
+ * @throws ApiError
1377
+ */
1378
+ static postCredential(requestBody) {
1379
+ return request(OpenAPI, {
1380
+ method: "POST",
1381
+ url: "/api/v1/credentials",
1382
+ body: requestBody,
1383
+ mediaType: "application/json",
1384
+ errors: {
1385
+ 400: `Request validation failed.`,
1386
+ 401: `Authentication required or token invalid.`
1387
+ }
1388
+ });
1389
+ }
1390
+ /**
1391
+ * Retrieve credential details by ID.
1392
+ * @param credentialId
1393
+ * @returns Credential Credential returned.
1394
+ * @throws ApiError
1395
+ */
1396
+ static getCredential(credentialId) {
1397
+ return request(OpenAPI, {
1398
+ method: "GET",
1399
+ url: "/api/v1/credentials/{credentialId}",
1400
+ path: {
1401
+ "credentialId": credentialId
1402
+ },
1403
+ errors: {
1404
+ 401: `Authentication required or token invalid.`,
1405
+ 404: `Resource not found.`
1406
+ }
1407
+ });
1408
+ }
1409
+ /**
1410
+ * Update an existing credential.
1411
+ * @param credentialId
1412
+ * @param requestBody
1413
+ * @returns Credential Credential updated.
1414
+ * @throws ApiError
1415
+ */
1416
+ static putCredential(credentialId, requestBody) {
1417
+ return request(OpenAPI, {
1418
+ method: "PUT",
1419
+ url: "/api/v1/credentials/{credentialId}",
1420
+ path: {
1421
+ "credentialId": credentialId
1422
+ },
1423
+ body: requestBody,
1424
+ mediaType: "application/json",
1425
+ errors: {
1426
+ 400: `Request validation failed.`,
1427
+ 401: `Authentication required or token invalid.`,
1428
+ 404: `Resource not found.`
1429
+ }
1430
+ });
1431
+ }
1432
+ /**
1433
+ * Delete a credential.
1434
+ * @param credentialId
1435
+ * @returns void
1436
+ * @throws ApiError
1437
+ */
1438
+ static deleteCredential(credentialId) {
1439
+ return request(OpenAPI, {
1440
+ method: "DELETE",
1441
+ url: "/api/v1/credentials/{credentialId}",
1442
+ path: {
1443
+ "credentialId": credentialId
1444
+ },
1445
+ errors: {
1446
+ 401: `Authentication required or token invalid.`,
1447
+ 404: `Resource not found.`
1448
+ }
1449
+ });
1450
+ }
1451
+ /**
1452
+ * List apps linked to a credential.
1453
+ * @param credentialId
1454
+ * @returns any Linked apps returned.
1455
+ * @throws ApiError
1456
+ */
1457
+ static getCredentialApps(credentialId) {
1458
+ return request(OpenAPI, {
1459
+ method: "GET",
1460
+ url: "/api/v1/credentials/{credentialId}/apps",
1461
+ path: {
1462
+ "credentialId": credentialId
1463
+ },
1464
+ errors: {
1465
+ 401: `Authentication required or token invalid.`,
1466
+ 404: `Resource not found.`
1467
+ }
1468
+ });
1469
+ }
1470
+ /**
1471
+ * Validate credential authenticity with source systems.
1472
+ * @param requestBody
1473
+ * @returns GenericSuccess Validation outcome.
1474
+ * @throws ApiError
1475
+ */
1476
+ static postCredentialValidate(requestBody) {
1477
+ return request(OpenAPI, {
1478
+ method: "POST",
1479
+ url: "/api/v1/credentials/validate",
1480
+ body: requestBody,
1481
+ mediaType: "application/json",
1482
+ errors: {
1483
+ 400: `Request validation failed.`,
1484
+ 401: `Authentication required or token invalid.`
1485
+ }
1486
+ });
1487
+ }
1488
+ };
1489
+
1490
+ // services/HealthService.ts
1491
+ var HealthService = class {
1492
+ /**
1493
+ * Check API availability.
1494
+ * @returns any API is reachable.
1495
+ * @throws ApiError
1496
+ */
1497
+ static getHealth() {
1498
+ return request(OpenAPI, {
1499
+ method: "GET",
1500
+ url: "/health",
1501
+ errors: {
1502
+ 500: `Unexpected server error.`
1503
+ }
1504
+ });
1505
+ }
1506
+ /**
1507
+ * Root health probe.
1508
+ * @returns any API is reachable.
1509
+ * @throws ApiError
1510
+ */
1511
+ static getRoot() {
1512
+ return request(OpenAPI, {
1513
+ method: "GET",
1514
+ url: "/",
1515
+ errors: {
1516
+ 500: `Unexpected server error.`
1517
+ }
1518
+ });
1519
+ }
1520
+ };
1521
+
1522
+ // services/InsightsService.ts
1523
+ var InsightsService = class {
1524
+ /**
1525
+ * Queue AI-powered analysis for an app.
1526
+ * @param requestBody
1527
+ * @returns any Analysis queued or cached result returned.
1528
+ * @throws ApiError
1529
+ */
1530
+ static postAppsAnalyze(requestBody) {
1531
+ return request(OpenAPI, {
1532
+ method: "POST",
1533
+ url: "/api/v1/apps/analyze",
1534
+ body: requestBody,
1535
+ mediaType: "application/json",
1536
+ errors: {
1537
+ 400: `Request validation failed.`,
1538
+ 401: `Authentication required or token invalid.`,
1539
+ 403: `Request not permitted for this user.`
1540
+ }
1541
+ });
1542
+ }
1543
+ /**
1544
+ * Aggregate reply performance metrics for an app.
1545
+ * @param appUuid
1546
+ * @returns ReplyAnalytics Reply analytics returned.
1547
+ * @throws ApiError
1548
+ */
1549
+ static getReplyAnalytics(appUuid) {
1550
+ return request(OpenAPI, {
1551
+ method: "GET",
1552
+ url: "/api/v1/apps/{appUuid}/replies/analytics",
1553
+ path: {
1554
+ "appUuid": appUuid
1555
+ },
1556
+ errors: {
1557
+ 401: `Authentication required or token invalid.`,
1558
+ 403: `Request not permitted for this user.`,
1559
+ 404: `Resource not found.`
1560
+ }
1561
+ });
1562
+ }
1563
+ /**
1564
+ * Retrieve the latest insight bundle for an app.
1565
+ * @param appUuid
1566
+ * @returns Insight Insight bundle retrieved.
1567
+ * @throws ApiError
1568
+ */
1569
+ static getAppInsights(appUuid) {
1570
+ return request(OpenAPI, {
1571
+ method: "GET",
1572
+ url: "/api/v1/apps/{appUuid}/insights",
1573
+ path: {
1574
+ "appUuid": appUuid
1575
+ },
1576
+ errors: {
1577
+ 401: `Authentication required or token invalid.`,
1578
+ 403: `Request not permitted for this user.`,
1579
+ 404: `Resource not found.`
1580
+ }
1581
+ });
1582
+ }
1583
+ /**
1584
+ * Historical insight summaries for an app.
1585
+ * @param appUuid
1586
+ * @param limit
1587
+ * @param cursor
1588
+ * @returns any Insight history returned.
1589
+ * @throws ApiError
1590
+ */
1591
+ static getAppInsightHistory(appUuid, limit, cursor) {
1592
+ return request(OpenAPI, {
1593
+ method: "GET",
1594
+ url: "/api/v1/apps/{appUuid}/insights/history",
1595
+ path: {
1596
+ "appUuid": appUuid
1597
+ },
1598
+ query: {
1599
+ "limit": limit,
1600
+ "cursor": cursor
1601
+ },
1602
+ errors: {
1603
+ 401: `Authentication required or token invalid.`,
1604
+ 403: `Request not permitted for this user.`,
1605
+ 404: `Resource not found.`
1606
+ }
1607
+ });
1608
+ }
1609
+ /**
1610
+ * Historical feature impact entries for an app release.
1611
+ * @param appUuid
1612
+ * @param limit
1613
+ * @param cursor
1614
+ * @returns any Feature history returned.
1615
+ * @throws ApiError
1616
+ */
1617
+ static getFeatureHistory(appUuid, limit, cursor) {
1618
+ return request(OpenAPI, {
1619
+ method: "GET",
1620
+ url: "/api/v1/apps/{appUuid}/features/history",
1621
+ path: {
1622
+ "appUuid": appUuid
1623
+ },
1624
+ query: {
1625
+ "limit": limit,
1626
+ "cursor": cursor
1627
+ },
1628
+ errors: {
1629
+ 401: `Authentication required or token invalid.`,
1630
+ 403: `Request not permitted for this user.`,
1631
+ 404: `Resource not found.`
1632
+ }
1633
+ });
1634
+ }
1635
+ /**
1636
+ * Tenant-level feed of insight highlights.
1637
+ * @param limit
1638
+ * @param cursor
1639
+ * @returns any Insights returned.
1640
+ * @throws ApiError
1641
+ */
1642
+ static getTenantInsights(limit, cursor) {
1643
+ return request(OpenAPI, {
1644
+ method: "GET",
1645
+ url: "/api/v1/insights",
1646
+ query: {
1647
+ "limit": limit,
1648
+ "cursor": cursor
1649
+ },
1650
+ errors: {
1651
+ 401: `Authentication required or token invalid.`
1652
+ }
1653
+ });
1654
+ }
1655
+ /**
1656
+ * List reviewer segments for an app.
1657
+ * @param appUuid App UUID assigned by Tritonium.
1658
+ * @param segmentType
1659
+ * @param sort
1660
+ * @param limit
1661
+ * @returns any Segments returned.
1662
+ * @throws ApiError
1663
+ */
1664
+ static getAppSegments(appUuid, segmentType, sort, limit) {
1665
+ return request(OpenAPI, {
1666
+ method: "GET",
1667
+ url: "/api/v1/apps/{app_uuid}/segments",
1668
+ path: {
1669
+ "app_uuid": appUuid
1670
+ },
1671
+ query: {
1672
+ "segment_type": segmentType,
1673
+ "sort": sort,
1674
+ "limit": limit
1675
+ },
1676
+ errors: {
1677
+ 401: `Authentication required or token invalid.`,
1678
+ 403: `Request not permitted for this user.`
1679
+ }
1680
+ });
1681
+ }
1682
+ /**
1683
+ * Retrieve reviews tied to a specific segment.
1684
+ * @param appUuid App UUID assigned by Tritonium.
1685
+ * @param segmentType
1686
+ * @returns any Reviews returned.
1687
+ * @throws ApiError
1688
+ */
1689
+ static getSegmentReviews(appUuid, segmentType) {
1690
+ return request(OpenAPI, {
1691
+ method: "GET",
1692
+ url: "/api/v1/apps/{app_uuid}/segments/{segment_type}/reviews",
1693
+ path: {
1694
+ "app_uuid": appUuid,
1695
+ "segment_type": segmentType
1696
+ },
1697
+ errors: {
1698
+ 401: `Authentication required or token invalid.`,
1699
+ 403: `Request not permitted for this user.`
1700
+ }
1701
+ });
1702
+ }
1703
+ /**
1704
+ * List reviews with viral engagement.
1705
+ * @param appUuid App UUID assigned by Tritonium.
1706
+ * @param lookbackHours
1707
+ * @param minEngagement
1708
+ * @param sentiment
1709
+ * @returns any Viral review payload.
1710
+ * @throws ApiError
1711
+ */
1712
+ static getViralReviews(appUuid, lookbackHours = 48, minEngagement = 50, sentiment) {
1713
+ return request(OpenAPI, {
1714
+ method: "GET",
1715
+ url: "/api/v1/apps/{app_uuid}/reviews/viral",
1716
+ path: {
1717
+ "app_uuid": appUuid
1718
+ },
1719
+ query: {
1720
+ "lookback_hours": lookbackHours,
1721
+ "min_engagement": minEngagement,
1722
+ "sentiment": sentiment
1723
+ },
1724
+ errors: {
1725
+ 401: `Authentication required or token invalid.`,
1726
+ 403: `Request not permitted for this user.`
1727
+ }
1728
+ });
1729
+ }
1730
+ /**
1731
+ * Retrieve engagement history for a review.
1732
+ * @param reviewId
1733
+ * @param appUuid
1734
+ * @returns any History returned.
1735
+ * @throws ApiError
1736
+ */
1737
+ static getReviewEngagementHistory(reviewId, appUuid) {
1738
+ return request(OpenAPI, {
1739
+ method: "GET",
1740
+ url: "/api/v1/reviews/{review_id}/engagement/history",
1741
+ path: {
1742
+ "review_id": reviewId
1743
+ },
1744
+ query: {
1745
+ "app_uuid": appUuid
1746
+ },
1747
+ errors: {
1748
+ 401: `Authentication required or token invalid.`,
1749
+ 403: `Request not permitted for this user.`
1750
+ }
1751
+ });
1752
+ }
1753
+ /**
1754
+ * List reply template performance metrics.
1755
+ * @param days
1756
+ * @param templateId
1757
+ * @returns any Template analytics returned.
1758
+ * @throws ApiError
1759
+ */
1760
+ static getTemplatePerformance(days = 90, templateId) {
1761
+ return request(OpenAPI, {
1762
+ method: "GET",
1763
+ url: "/api/v1/reply-templates/performance",
1764
+ query: {
1765
+ "days": days,
1766
+ "template_id": templateId
1767
+ },
1768
+ errors: {
1769
+ 401: `Authentication required or token invalid.`,
1770
+ 403: `Request not permitted for this user.`
1771
+ }
1772
+ });
1773
+ }
1774
+ /**
1775
+ * Alias for template performance listing.
1776
+ * @returns any Template analytics returned.
1777
+ * @throws ApiError
1778
+ */
1779
+ static getTemplateComparison() {
1780
+ return request(OpenAPI, {
1781
+ method: "GET",
1782
+ url: "/api/v1/reply-templates/comparison",
1783
+ errors: {
1784
+ 401: `Authentication required or token invalid.`,
1785
+ 403: `Request not permitted for this user.`
1786
+ }
1787
+ });
1788
+ }
1789
+ };
1790
+
1791
+ // services/IntegrationsService.ts
1792
+ var IntegrationsService = class {
1793
+ /**
1794
+ * List configured integrations.
1795
+ * @returns any Integrations returned.
1796
+ * @throws ApiError
1797
+ */
1798
+ static getIntegrations() {
1799
+ return request(OpenAPI, {
1800
+ method: "GET",
1801
+ url: "/api/v1/integrations",
1802
+ errors: {
1803
+ 401: `Authentication required or token invalid.`
1804
+ }
1805
+ });
1806
+ }
1807
+ /**
1808
+ * Retrieve integration configuration.
1809
+ * @param integrationId
1810
+ * @returns Integration Integration returned.
1811
+ * @throws ApiError
1812
+ */
1813
+ static getIntegration(integrationId) {
1814
+ return request(OpenAPI, {
1815
+ method: "GET",
1816
+ url: "/api/v1/integrations/{integrationId}",
1817
+ path: {
1818
+ "integrationId": integrationId
1819
+ },
1820
+ errors: {
1821
+ 401: `Authentication required or token invalid.`,
1822
+ 404: `Resource not found.`
1823
+ }
1824
+ });
1825
+ }
1826
+ /**
1827
+ * Update mutable integration metadata.
1828
+ * @param integrationId
1829
+ * @param requestBody
1830
+ * @returns Integration Integration updated.
1831
+ * @throws ApiError
1832
+ */
1833
+ static patchIntegration(integrationId, requestBody) {
1834
+ return request(OpenAPI, {
1835
+ method: "PATCH",
1836
+ url: "/api/v1/integrations/{integrationId}",
1837
+ path: {
1838
+ "integrationId": integrationId
1839
+ },
1840
+ body: requestBody,
1841
+ mediaType: "application/json",
1842
+ errors: {
1843
+ 400: `Request validation failed.`,
1844
+ 401: `Authentication required or token invalid.`,
1845
+ 404: `Resource not found.`
1846
+ }
1847
+ });
1848
+ }
1849
+ /**
1850
+ * Delete an integration configuration.
1851
+ * @param integrationId
1852
+ * @returns void
1853
+ * @throws ApiError
1854
+ */
1855
+ static deleteIntegration(integrationId) {
1856
+ return request(OpenAPI, {
1857
+ method: "DELETE",
1858
+ url: "/api/v1/integrations/{integrationId}",
1859
+ path: {
1860
+ "integrationId": integrationId
1861
+ },
1862
+ errors: {
1863
+ 401: `Authentication required or token invalid.`,
1864
+ 404: `Resource not found.`
1865
+ }
1866
+ });
1867
+ }
1868
+ /**
1869
+ * Send a test payload for an integration.
1870
+ * @param integrationId
1871
+ * @param requestBody
1872
+ * @returns GenericSuccess Test executed.
1873
+ * @throws ApiError
1874
+ */
1875
+ static postIntegrationTest(integrationId, requestBody) {
1876
+ return request(OpenAPI, {
1877
+ method: "POST",
1878
+ url: "/api/v1/integrations/{integrationId}/test",
1879
+ path: {
1880
+ "integrationId": integrationId
1881
+ },
1882
+ body: requestBody,
1883
+ mediaType: "application/json",
1884
+ errors: {
1885
+ 400: `Request validation failed.`,
1886
+ 401: `Authentication required or token invalid.`,
1887
+ 404: `Resource not found.`
1888
+ }
1889
+ });
1890
+ }
1891
+ /**
1892
+ * Start Jira OAuth connection.
1893
+ * @param requestBody
1894
+ * @returns Integration Authorization URL or status returned.
1895
+ * @throws ApiError
1896
+ */
1897
+ static postJiraConnect(requestBody) {
1898
+ return request(OpenAPI, {
1899
+ method: "POST",
1900
+ url: "/api/v1/integrations/jira/connect",
1901
+ body: requestBody,
1902
+ mediaType: "application/json",
1903
+ errors: {
1904
+ 401: `Authentication required or token invalid.`
1905
+ }
1906
+ });
1907
+ }
1908
+ /**
1909
+ * Complete Jira OAuth exchange.
1910
+ * @param state
1911
+ * @param code
1912
+ * @returns Integration Jira integration connected.
1913
+ * @throws ApiError
1914
+ */
1915
+ static getJiraCallback(state, code) {
1916
+ return request(OpenAPI, {
1917
+ method: "GET",
1918
+ url: "/api/v1/integrations/jira/callback",
1919
+ query: {
1920
+ "state": state,
1921
+ "code": code
1922
+ },
1923
+ errors: {
1924
+ 400: `Request validation failed.`
1925
+ }
1926
+ });
1927
+ }
1928
+ /**
1929
+ * Push an incident update to Jira.
1930
+ * @param requestBody
1931
+ * @returns GenericSuccess Issue created or updated.
1932
+ * @throws ApiError
1933
+ */
1934
+ static postJiraIncident(requestBody) {
1935
+ return request(OpenAPI, {
1936
+ method: "POST",
1937
+ url: "/api/v1/integrations/jira/post",
1938
+ body: requestBody,
1939
+ mediaType: "application/json",
1940
+ errors: {
1941
+ 400: `Request validation failed.`,
1942
+ 401: `Authentication required or token invalid.`
1943
+ }
1944
+ });
1945
+ }
1946
+ /**
1947
+ * Connect Linear workspace.
1948
+ * @param requestBody
1949
+ * @returns Integration Linear integration configured.
1950
+ * @throws ApiError
1951
+ */
1952
+ static postLinearConnect(requestBody) {
1953
+ return request(OpenAPI, {
1954
+ method: "POST",
1955
+ url: "/api/v1/integrations/linear/connect",
1956
+ body: requestBody,
1957
+ mediaType: "application/json",
1958
+ errors: {
1959
+ 401: `Authentication required or token invalid.`
1960
+ }
1961
+ });
1962
+ }
1963
+ /**
1964
+ * Connect Discord notifications.
1965
+ * @param requestBody
1966
+ * @returns Integration Discord integration configured.
1967
+ * @throws ApiError
1968
+ */
1969
+ static postDiscordConnect(requestBody) {
1970
+ return request(OpenAPI, {
1971
+ method: "POST",
1972
+ url: "/api/v1/integrations/discord/connect",
1973
+ body: requestBody,
1974
+ mediaType: "application/json",
1975
+ errors: {
1976
+ 401: `Authentication required or token invalid.`
1977
+ }
1978
+ });
1979
+ }
1980
+ /**
1981
+ * Connect Microsoft Teams notifications.
1982
+ * @param requestBody
1983
+ * @returns Integration Teams integration configured.
1984
+ * @throws ApiError
1985
+ */
1986
+ static postTeamsConnect(requestBody) {
1987
+ return request(OpenAPI, {
1988
+ method: "POST",
1989
+ url: "/api/v1/integrations/teams/connect",
1990
+ body: requestBody,
1991
+ mediaType: "application/json",
1992
+ errors: {
1993
+ 401: `Authentication required or token invalid.`
1994
+ }
1995
+ });
1996
+ }
1997
+ /**
1998
+ * Start Help Scout OAuth flow.
1999
+ * @param requestBody
2000
+ * @returns GenericSuccess Authorization URL generated.
2001
+ * @throws ApiError
2002
+ */
2003
+ static postHelpScoutStart(requestBody) {
2004
+ return request(OpenAPI, {
2005
+ method: "POST",
2006
+ url: "/api/v1/integrations/helpscout/start",
2007
+ body: requestBody,
2008
+ mediaType: "application/json",
2009
+ errors: {
2010
+ 401: `Authentication required or token invalid.`
2011
+ }
2012
+ });
2013
+ }
2014
+ /**
2015
+ * Complete Help Scout OAuth exchange.
2016
+ * @param requestBody
2017
+ * @returns Integration Help Scout integration connected.
2018
+ * @throws ApiError
2019
+ */
2020
+ static postHelpScoutConnect(requestBody) {
2021
+ return request(OpenAPI, {
2022
+ method: "POST",
2023
+ url: "/api/v1/integrations/helpscout/connect",
2024
+ body: requestBody,
2025
+ mediaType: "application/json",
2026
+ errors: {
2027
+ 401: `Authentication required or token invalid.`
2028
+ }
2029
+ });
2030
+ }
2031
+ /**
2032
+ * Start Salesforce OAuth flow.
2033
+ * @param requestBody
2034
+ * @returns GenericSuccess Authorization URL generated.
2035
+ * @throws ApiError
2036
+ */
2037
+ static postSalesforceStart(requestBody) {
2038
+ return request(OpenAPI, {
2039
+ method: "POST",
2040
+ url: "/api/v1/integrations/salesforce/start",
2041
+ body: requestBody,
2042
+ mediaType: "application/json",
2043
+ errors: {
2044
+ 401: `Authentication required or token invalid.`
2045
+ }
2046
+ });
2047
+ }
2048
+ /**
2049
+ * Complete Salesforce OAuth exchange.
2050
+ * @param requestBody
2051
+ * @returns Integration Salesforce integration connected.
2052
+ * @throws ApiError
2053
+ */
2054
+ static postSalesforceConnect(requestBody) {
2055
+ return request(OpenAPI, {
2056
+ method: "POST",
2057
+ url: "/api/v1/integrations/salesforce/connect",
2058
+ body: requestBody,
2059
+ mediaType: "application/json",
2060
+ errors: {
2061
+ 401: `Authentication required or token invalid.`
2062
+ }
2063
+ });
2064
+ }
2065
+ /**
2066
+ * Start Zendesk OAuth flow.
2067
+ * @param requestBody
2068
+ * @returns GenericSuccess Authorization URL generated.
2069
+ * @throws ApiError
2070
+ */
2071
+ static postZendeskStart(requestBody) {
2072
+ return request(OpenAPI, {
2073
+ method: "POST",
2074
+ url: "/api/v1/integrations/zendesk/start",
2075
+ body: requestBody,
2076
+ mediaType: "application/json",
2077
+ errors: {
2078
+ 401: `Authentication required or token invalid.`
2079
+ }
2080
+ });
2081
+ }
2082
+ /**
2083
+ * Complete Zendesk OAuth exchange.
2084
+ * @param requestBody
2085
+ * @returns Integration Zendesk integration connected.
2086
+ * @throws ApiError
2087
+ */
2088
+ static postZendeskConnect(requestBody) {
2089
+ return request(OpenAPI, {
2090
+ method: "POST",
2091
+ url: "/api/v1/integrations/zendesk/connect",
2092
+ body: requestBody,
2093
+ mediaType: "application/json",
2094
+ errors: {
2095
+ 401: `Authentication required or token invalid.`
2096
+ }
2097
+ });
2098
+ }
2099
+ /**
2100
+ * Connect Asana workspace.
2101
+ * @param requestBody
2102
+ * @returns Integration Asana integration connected.
2103
+ * @throws ApiError
2104
+ */
2105
+ static postAsanaConnect(requestBody) {
2106
+ return request(OpenAPI, {
2107
+ method: "POST",
2108
+ url: "/api/v1/integrations/asana/connect",
2109
+ body: requestBody,
2110
+ mediaType: "application/json",
2111
+ errors: {
2112
+ 401: `Authentication required or token invalid.`
2113
+ }
2114
+ });
2115
+ }
2116
+ /**
2117
+ * Connect ClickUp workspace.
2118
+ * @param requestBody
2119
+ * @returns Integration ClickUp integration connected.
2120
+ * @throws ApiError
2121
+ */
2122
+ static postClickUpConnect(requestBody) {
2123
+ return request(OpenAPI, {
2124
+ method: "POST",
2125
+ url: "/api/v1/integrations/clickup/connect",
2126
+ body: requestBody,
2127
+ mediaType: "application/json",
2128
+ errors: {
2129
+ 401: `Authentication required or token invalid.`
2130
+ }
2131
+ });
2132
+ }
2133
+ /**
2134
+ * Connect Trello workspace.
2135
+ * @param requestBody
2136
+ * @returns Integration Trello integration connected.
2137
+ * @throws ApiError
2138
+ */
2139
+ static postTrelloConnect(requestBody) {
2140
+ return request(OpenAPI, {
2141
+ method: "POST",
2142
+ url: "/api/v1/integrations/trello/connect",
2143
+ body: requestBody,
2144
+ mediaType: "application/json",
2145
+ errors: {
2146
+ 401: `Authentication required or token invalid.`
2147
+ }
2148
+ });
2149
+ }
2150
+ /**
2151
+ * Save Zapier webhook destination.
2152
+ * @param requestBody
2153
+ * @returns Integration Zapier webhook registered.
2154
+ * @throws ApiError
2155
+ */
2156
+ static postZapierConnect(requestBody) {
2157
+ return request(OpenAPI, {
2158
+ method: "POST",
2159
+ url: "/api/v1/integrations/zapier/connect",
2160
+ body: requestBody,
2161
+ mediaType: "application/json",
2162
+ errors: {
2163
+ 401: `Authentication required or token invalid.`
2164
+ }
2165
+ });
2166
+ }
2167
+ /**
2168
+ * Configure SMS delivery integration.
2169
+ * @param requestBody
2170
+ * @returns Integration SMS integration configured.
2171
+ * @throws ApiError
2172
+ */
2173
+ static postSmsConnect(requestBody) {
2174
+ return request(OpenAPI, {
2175
+ method: "POST",
2176
+ url: "/api/v1/integrations/sms/connect",
2177
+ body: requestBody,
2178
+ mediaType: "application/json",
2179
+ errors: {
2180
+ 401: `Authentication required or token invalid.`
2181
+ }
2182
+ });
2183
+ }
2184
+ /**
2185
+ * Connect GitLab project.
2186
+ * @param requestBody
2187
+ * @returns Integration GitLab integration connected.
2188
+ * @throws ApiError
2189
+ */
2190
+ static postGitlabConnect(requestBody) {
2191
+ return request(OpenAPI, {
2192
+ method: "POST",
2193
+ url: "/api/v1/integrations/gitlab/connect",
2194
+ body: requestBody,
2195
+ mediaType: "application/json",
2196
+ errors: {
2197
+ 401: `Authentication required or token invalid.`
2198
+ }
2199
+ });
2200
+ }
2201
+ /**
2202
+ * Start Slack OAuth flow.
2203
+ * @param redirectUri
2204
+ * @returns GenericSuccess Authorization URL generated.
2205
+ * @throws ApiError
2206
+ */
2207
+ static getSlackConnect(redirectUri) {
2208
+ return request(OpenAPI, {
2209
+ method: "GET",
2210
+ url: "/api/v1/integrations/slack/connect",
2211
+ query: {
2212
+ "redirect_uri": redirectUri
2213
+ },
2214
+ errors: {
2215
+ 401: `Authentication required or token invalid.`
2216
+ }
2217
+ });
2218
+ }
2219
+ /**
2220
+ * Complete Slack OAuth exchange.
2221
+ * @param code
2222
+ * @param state
2223
+ * @returns Integration Slack workspace connected.
2224
+ * @throws ApiError
2225
+ */
2226
+ static getSlackCallback(code, state) {
2227
+ return request(OpenAPI, {
2228
+ method: "GET",
2229
+ url: "/api/v1/integrations/slack/callback",
2230
+ query: {
2231
+ "code": code,
2232
+ "state": state
2233
+ },
2234
+ errors: {
2235
+ 400: `Request validation failed.`
2236
+ }
2237
+ });
2238
+ }
2239
+ /**
2240
+ * Retrieve Slack integration status.
2241
+ * @returns Integration Slack status returned.
2242
+ * @throws ApiError
2243
+ */
2244
+ static getSlackStatus() {
2245
+ return request(OpenAPI, {
2246
+ method: "GET",
2247
+ url: "/api/v1/integrations/slack/status",
2248
+ errors: {
2249
+ 401: `Authentication required or token invalid.`
2250
+ }
2251
+ });
2252
+ }
2253
+ /**
2254
+ * List Slack channels available to the app.
2255
+ * @returns any Channel listing returned.
2256
+ * @throws ApiError
2257
+ */
2258
+ static getSlackChannels() {
2259
+ return request(OpenAPI, {
2260
+ method: "GET",
2261
+ url: "/api/v1/integrations/slack/channels",
2262
+ errors: {
2263
+ 401: `Authentication required or token invalid.`
2264
+ }
2265
+ });
2266
+ }
2267
+ /**
2268
+ * Save the default Slack channel for alerts.
2269
+ * @param requestBody
2270
+ * @returns Integration Channel saved.
2271
+ * @throws ApiError
2272
+ */
2273
+ static postSlackChannel(requestBody) {
2274
+ return request(OpenAPI, {
2275
+ method: "POST",
2276
+ url: "/api/v1/integrations/slack/channel",
2277
+ body: requestBody,
2278
+ mediaType: "application/json",
2279
+ errors: {
2280
+ 400: `Request validation failed.`,
2281
+ 401: `Authentication required or token invalid.`
2282
+ }
2283
+ });
2284
+ }
2285
+ /**
2286
+ * Send a test Slack notification.
2287
+ * @returns GenericSuccess Test notification sent.
2288
+ * @throws ApiError
2289
+ */
2290
+ static postSlackTest() {
2291
+ return request(OpenAPI, {
2292
+ method: "POST",
2293
+ url: "/api/v1/integrations/slack/test",
2294
+ errors: {
2295
+ 401: `Authentication required or token invalid.`
2296
+ }
2297
+ });
2298
+ }
2299
+ /**
2300
+ * Post a custom alert message to Slack.
2301
+ * @param requestBody
2302
+ * @returns GenericSuccess Message posted.
2303
+ * @throws ApiError
2304
+ */
2305
+ static postSlackMessage(requestBody) {
2306
+ return request(OpenAPI, {
2307
+ method: "POST",
2308
+ url: "/api/v1/integrations/slack/post",
2309
+ body: requestBody,
2310
+ mediaType: "application/json",
2311
+ errors: {
2312
+ 400: `Request validation failed.`,
2313
+ 401: `Authentication required or token invalid.`
2314
+ }
2315
+ });
2316
+ }
2317
+ /**
2318
+ * Disconnect Slack workspace.
2319
+ * @returns GenericSuccess Slack integration disabled.
2320
+ * @throws ApiError
2321
+ */
2322
+ static postSlackDisconnect() {
2323
+ return request(OpenAPI, {
2324
+ method: "POST",
2325
+ url: "/api/v1/integrations/slack/disconnect",
2326
+ errors: {
2327
+ 401: `Authentication required or token invalid.`
2328
+ }
2329
+ });
2330
+ }
2331
+ };
2332
+
2333
+ // services/InternalService.ts
2334
+ var InternalService = class {
2335
+ /**
2336
+ * Health probe for scheduled trial reminder execution.
2337
+ * @returns any Automation healthy.
2338
+ * @throws ApiError
2339
+ */
2340
+ static headTrialReminders() {
2341
+ return request(OpenAPI, {
2342
+ method: "HEAD",
2343
+ url: "/api/v1/internal/run-trial-reminders",
2344
+ errors: {
2345
+ 401: `Authentication required or token invalid.`
2346
+ }
2347
+ });
2348
+ }
2349
+ /**
2350
+ * Execute trial reminder workflow.
2351
+ * @returns any Workflow started.
2352
+ * @throws ApiError
2353
+ */
2354
+ static postTrialReminders() {
2355
+ return request(OpenAPI, {
2356
+ method: "POST",
2357
+ url: "/api/v1/internal/run-trial-reminders",
2358
+ errors: {
2359
+ 401: `Authentication required or token invalid.`
2360
+ }
2361
+ });
2362
+ }
2363
+ /**
2364
+ * Trigger nightly auto-sync job across apps.
2365
+ * @param requestBody
2366
+ * @returns any Job accepted.
2367
+ * @throws ApiError
2368
+ */
2369
+ static postInternalAutoSync(requestBody) {
2370
+ return request(OpenAPI, {
2371
+ method: "POST",
2372
+ url: "/api/v1/internal/auto-sync",
2373
+ body: requestBody,
2374
+ mediaType: "application/json",
2375
+ errors: {
2376
+ 401: `Authentication required or token invalid.`
2377
+ }
2378
+ });
2379
+ }
2380
+ /**
2381
+ * Perform competitor metadata sync.
2382
+ * @param requestBody
2383
+ * @returns any Sync started.
2384
+ * @throws ApiError
2385
+ */
2386
+ static postInternalCompetitorSync(requestBody) {
2387
+ return request(OpenAPI, {
2388
+ method: "POST",
2389
+ url: "/api/v1/internal/competitors/sync",
2390
+ body: requestBody,
2391
+ mediaType: "application/json",
2392
+ errors: {
2393
+ 401: `Authentication required or token invalid.`
2394
+ }
2395
+ });
2396
+ }
2397
+ /**
2398
+ * Aggregate metrics into dashboards.
2399
+ * @param requestBody
2400
+ * @returns any Aggregation started.
2401
+ * @throws ApiError
2402
+ */
2403
+ static postInternalMetricsAggregate(requestBody) {
2404
+ return request(OpenAPI, {
2405
+ method: "POST",
2406
+ url: "/api/v1/internal/metrics/aggregate",
2407
+ body: requestBody,
2408
+ mediaType: "application/json",
2409
+ errors: {
2410
+ 401: `Authentication required or token invalid.`
2411
+ }
2412
+ });
2413
+ }
2414
+ };
2415
+
2416
+ // services/PredictionsService.ts
2417
+ var PredictionsService = class {
2418
+ /**
2419
+ * Retrieve rating forecasts for an app.
2420
+ * @param appUuid
2421
+ * @param horizonDays
2422
+ * @returns PredictionResponse Forecast returned.
2423
+ * @throws ApiError
2424
+ */
2425
+ static getRatingForecast(appUuid, horizonDays) {
2426
+ return request(OpenAPI, {
2427
+ method: "GET",
2428
+ url: "/api/v1/predictions/rating-forecast",
2429
+ query: {
2430
+ "app_uuid": appUuid,
2431
+ "horizon_days": horizonDays
2432
+ },
2433
+ errors: {
2434
+ 400: `Request validation failed.`,
2435
+ 401: `Authentication required or token invalid.`,
2436
+ 404: `Resource not found.`
2437
+ }
2438
+ });
2439
+ }
2440
+ /**
2441
+ * Compute predicted driver impact for product features.
2442
+ * @param requestBody
2443
+ * @returns PredictionResponse Feature impact predicted.
2444
+ * @throws ApiError
2445
+ */
2446
+ static postFeatureImpactPrediction(requestBody) {
2447
+ return request(OpenAPI, {
2448
+ method: "POST",
2449
+ url: "/api/v1/predictions/feature-impact",
2450
+ body: requestBody,
2451
+ mediaType: "application/json",
2452
+ errors: {
2453
+ 400: `Request validation failed.`,
2454
+ 401: `Authentication required or token invalid.`,
2455
+ 503: `Upstream model temporarily unavailable.`
2456
+ }
2457
+ });
2458
+ }
2459
+ /**
2460
+ * Predict severity for issues detected in reviews.
2461
+ * @param requestBody
2462
+ * @returns PredictionResponse Severity predictions returned.
2463
+ * @throws ApiError
2464
+ */
2465
+ static postIssueSeverityPrediction(requestBody) {
2466
+ return request(OpenAPI, {
2467
+ method: "POST",
2468
+ url: "/api/v1/predictions/issue-severity",
2469
+ body: requestBody,
2470
+ mediaType: "application/json",
2471
+ errors: {
2472
+ 400: `Request validation failed.`,
2473
+ 401: `Authentication required or token invalid.`,
2474
+ 503: `Upstream model temporarily unavailable.`
2475
+ }
2476
+ });
2477
+ }
2478
+ /**
2479
+ * Retrieve AI analysis engine status.
2480
+ * Returns the status of the LLM-based analysis system (Claude via AWS Bedrock).
2481
+ * @returns any AI analysis engine status returned.
2482
+ * @throws ApiError
2483
+ */
2484
+ static getModelStatus() {
2485
+ return request(OpenAPI, {
2486
+ method: "GET",
2487
+ url: "/api/v1/predictions/model-status",
2488
+ errors: {
2489
+ 401: `Authentication required or token invalid.`
2490
+ }
2491
+ });
2492
+ }
2493
+ };
2494
+
2495
+ // services/RatingsService.ts
2496
+ var RatingsService = class {
2497
+ /**
2498
+ * Historical rating snapshots for an app.
2499
+ * @param appUuid
2500
+ * @param limit
2501
+ * @param cursor
2502
+ * @param order
2503
+ * @param platform
2504
+ * @param startDate
2505
+ * @param endDate
2506
+ * @returns any Rating history returned.
2507
+ * @throws ApiError
2508
+ */
2509
+ static getRatingsHistory(appUuid, limit, cursor, order, platform, startDate, endDate) {
2510
+ return request(OpenAPI, {
2511
+ method: "GET",
2512
+ url: "/api/v1/apps/{appUuid}/ratings/history",
2513
+ path: {
2514
+ "appUuid": appUuid
2515
+ },
2516
+ query: {
2517
+ "limit": limit,
2518
+ "cursor": cursor,
2519
+ "order": order,
2520
+ "platform": platform,
2521
+ "start_date": startDate,
2522
+ "end_date": endDate
2523
+ },
2524
+ errors: {
2525
+ 401: `Authentication required or token invalid.`,
2526
+ 403: `Request not permitted for this user.`,
2527
+ 404: `Resource not found.`
2528
+ }
2529
+ });
2530
+ }
2531
+ /**
2532
+ * Latest rating snapshot for an app.
2533
+ * @param appUuid
2534
+ * @param platform
2535
+ * @returns RatingSummary Rating summary returned.
2536
+ * @throws ApiError
2537
+ */
2538
+ static getRatingsSummary(appUuid, platform) {
2539
+ return request(OpenAPI, {
2540
+ method: "GET",
2541
+ url: "/api/v1/apps/{appUuid}/ratings/summary",
2542
+ path: {
2543
+ "appUuid": appUuid
2544
+ },
2545
+ query: {
2546
+ "platform": platform
2547
+ },
2548
+ errors: {
2549
+ 401: `Authentication required or token invalid.`,
2550
+ 403: `Request not permitted for this user.`,
2551
+ 404: `Resource not found.`
2552
+ }
2553
+ });
2554
+ }
2555
+ /**
2556
+ * Compare app ratings against competitors.
2557
+ * @param appUuid
2558
+ * @param platform
2559
+ * @returns RatingsComparison Comparison returned.
2560
+ * @throws ApiError
2561
+ */
2562
+ static getRatingsComparison(appUuid, platform) {
2563
+ return request(OpenAPI, {
2564
+ method: "GET",
2565
+ url: "/api/v1/apps/{appUuid}/ratings/comparison",
2566
+ path: {
2567
+ "appUuid": appUuid
2568
+ },
2569
+ query: {
2570
+ "platform": platform
2571
+ },
2572
+ errors: {
2573
+ 401: `Authentication required or token invalid.`,
2574
+ 403: `Request not permitted for this user.`,
2575
+ 404: `Resource not found.`
2576
+ }
2577
+ });
2578
+ }
2579
+ };
2580
+
2581
+ // services/ReplyTemplatesService.ts
2582
+ var ReplyTemplatesService = class {
2583
+ /**
2584
+ * List system and custom reply templates.
2585
+ * @returns any Templates returned.
2586
+ * @throws ApiError
2587
+ */
2588
+ static getReplyTemplates() {
2589
+ return request(OpenAPI, {
2590
+ method: "GET",
2591
+ url: "/api/v1/reply-templates",
2592
+ errors: {
2593
+ 401: `Authentication required or token invalid.`
2594
+ }
2595
+ });
2596
+ }
2597
+ /**
2598
+ * Create a custom reply template.
2599
+ * @param requestBody
2600
+ * @returns ReplyTemplate Template created.
2601
+ * @throws ApiError
2602
+ */
2603
+ static postReplyTemplate(requestBody) {
2604
+ return request(OpenAPI, {
2605
+ method: "POST",
2606
+ url: "/api/v1/reply-templates",
2607
+ body: requestBody,
2608
+ mediaType: "application/json",
2609
+ errors: {
2610
+ 400: `Request validation failed.`,
2611
+ 401: `Authentication required or token invalid.`
2612
+ }
2613
+ });
2614
+ }
2615
+ /**
2616
+ * Replace a reply template.
2617
+ * @param templateId
2618
+ * @param requestBody
2619
+ * @returns ReplyTemplate Template updated.
2620
+ * @throws ApiError
2621
+ */
2622
+ static putReplyTemplate(templateId, requestBody) {
2623
+ return request(OpenAPI, {
2624
+ method: "PUT",
2625
+ url: "/api/v1/reply-templates/{templateId}",
2626
+ path: {
2627
+ "templateId": templateId
2628
+ },
2629
+ body: requestBody,
2630
+ mediaType: "application/json",
2631
+ errors: {
2632
+ 400: `Request validation failed.`,
2633
+ 401: `Authentication required or token invalid.`,
2634
+ 404: `Resource not found.`
2635
+ }
2636
+ });
2637
+ }
2638
+ /**
2639
+ * Patch fields on a reply template.
2640
+ * @param templateId
2641
+ * @param requestBody
2642
+ * @returns ReplyTemplate Template updated.
2643
+ * @throws ApiError
2644
+ */
2645
+ static patchReplyTemplate(templateId, requestBody) {
2646
+ return request(OpenAPI, {
2647
+ method: "PATCH",
2648
+ url: "/api/v1/reply-templates/{templateId}",
2649
+ path: {
2650
+ "templateId": templateId
2651
+ },
2652
+ body: requestBody,
2653
+ mediaType: "application/json",
2654
+ errors: {
2655
+ 400: `Request validation failed.`,
2656
+ 401: `Authentication required or token invalid.`,
2657
+ 404: `Resource not found.`
2658
+ }
2659
+ });
2660
+ }
2661
+ /**
2662
+ * Remove a custom reply template.
2663
+ * @param templateId
2664
+ * @returns void
2665
+ * @throws ApiError
2666
+ */
2667
+ static deleteReplyTemplate(templateId) {
2668
+ return request(OpenAPI, {
2669
+ method: "DELETE",
2670
+ url: "/api/v1/reply-templates/{templateId}",
2671
+ path: {
2672
+ "templateId": templateId
2673
+ },
2674
+ errors: {
2675
+ 401: `Authentication required or token invalid.`,
2676
+ 404: `Resource not found.`
2677
+ }
2678
+ });
2679
+ }
2680
+ /**
2681
+ * List reply template performance metrics.
2682
+ * @param days
2683
+ * @param templateId
2684
+ * @returns any Template analytics returned.
2685
+ * @throws ApiError
2686
+ */
2687
+ static getTemplatePerformance(days = 90, templateId) {
2688
+ return request(OpenAPI, {
2689
+ method: "GET",
2690
+ url: "/api/v1/reply-templates/performance",
2691
+ query: {
2692
+ "days": days,
2693
+ "template_id": templateId
2694
+ },
2695
+ errors: {
2696
+ 401: `Authentication required or token invalid.`,
2697
+ 403: `Request not permitted for this user.`
2698
+ }
2699
+ });
2700
+ }
2701
+ /**
2702
+ * Alias for template performance listing.
2703
+ * @returns any Template analytics returned.
2704
+ * @throws ApiError
2705
+ */
2706
+ static getTemplateComparison() {
2707
+ return request(OpenAPI, {
2708
+ method: "GET",
2709
+ url: "/api/v1/reply-templates/comparison",
2710
+ errors: {
2711
+ 401: `Authentication required or token invalid.`,
2712
+ 403: `Request not permitted for this user.`
2713
+ }
2714
+ });
2715
+ }
2716
+ };
2717
+
2718
+ // services/ReviewsService.ts
2719
+ var ReviewsService = class {
2720
+ /**
2721
+ * Paginated reviews for an app.
2722
+ * @param appUuid
2723
+ * @param limit
2724
+ * @param cursor
2725
+ * @param sentiment
2726
+ * @param platform
2727
+ * @returns any Reviews returned.
2728
+ * @throws ApiError
2729
+ */
2730
+ static getAppReviews(appUuid, limit, cursor, sentiment, platform) {
2731
+ return request(OpenAPI, {
2732
+ method: "GET",
2733
+ url: "/api/v1/apps/{appUuid}/reviews",
2734
+ path: {
2735
+ "appUuid": appUuid
2736
+ },
2737
+ query: {
2738
+ "limit": limit,
2739
+ "cursor": cursor,
2740
+ "sentiment": sentiment,
2741
+ "platform": platform
2742
+ },
2743
+ errors: {
2744
+ 401: `Authentication required or token invalid.`,
2745
+ 403: `Request not permitted for this user.`,
2746
+ 404: `Resource not found.`
2747
+ }
2748
+ });
2749
+ }
2750
+ /**
2751
+ * Retrieve stored reply metadata for a review.
2752
+ * @param appUuid
2753
+ * @param reviewId
2754
+ * @returns ReviewReplyStatus Reply status returned.
2755
+ * @throws ApiError
2756
+ */
2757
+ static getReviewReply(appUuid, reviewId) {
2758
+ return request(OpenAPI, {
2759
+ method: "GET",
2760
+ url: "/api/v1/apps/{appUuid}/reviews/{reviewId}/reply",
2761
+ path: {
2762
+ "appUuid": appUuid,
2763
+ "reviewId": reviewId
2764
+ },
2765
+ errors: {
2766
+ 401: `Authentication required or token invalid.`,
2767
+ 403: `Request not permitted for this user.`,
2768
+ 404: `Resource not found.`
2769
+ }
2770
+ });
2771
+ }
2772
+ /**
2773
+ * Generate an AI-generated reply draft for a review.
2774
+ * @param appUuid
2775
+ * @param reviewId
2776
+ * @param requestBody
2777
+ * @returns ReviewReplyDraft Draft generated.
2778
+ * @throws ApiError
2779
+ */
2780
+ static postGenerateReviewReply(appUuid, reviewId, requestBody) {
2781
+ return request(OpenAPI, {
2782
+ method: "POST",
2783
+ url: "/api/v1/apps/{appUuid}/reviews/{reviewId}/reply/generate",
2784
+ path: {
2785
+ "appUuid": appUuid,
2786
+ "reviewId": reviewId
2787
+ },
2788
+ body: requestBody,
2789
+ mediaType: "application/json",
2790
+ errors: {
2791
+ 400: `Request validation failed.`,
2792
+ 401: `Authentication required or token invalid.`,
2793
+ 403: `Request not permitted for this user.`,
2794
+ 404: `Resource not found.`
2795
+ }
2796
+ });
2797
+ }
2798
+ /**
2799
+ * Publish a reply back to the originating store.
2800
+ * @param appUuid
2801
+ * @param reviewId
2802
+ * @param requestBody
2803
+ * @returns ReviewReplyStatus Reply posted.
2804
+ * @throws ApiError
2805
+ */
2806
+ static postReviewReply(appUuid, reviewId, requestBody) {
2807
+ return request(OpenAPI, {
2808
+ method: "POST",
2809
+ url: "/api/v1/apps/{appUuid}/reviews/{reviewId}/reply/post",
2810
+ path: {
2811
+ "appUuid": appUuid,
2812
+ "reviewId": reviewId
2813
+ },
2814
+ body: requestBody,
2815
+ mediaType: "application/json",
2816
+ errors: {
2817
+ 400: `Request validation failed.`,
2818
+ 401: `Authentication required or token invalid.`,
2819
+ 403: `Request not permitted for this user.`,
2820
+ 404: `Resource not found.`
2821
+ }
2822
+ });
2823
+ }
2824
+ /**
2825
+ * Aggregate reply performance metrics for an app.
2826
+ * @param appUuid
2827
+ * @returns ReplyAnalytics Reply analytics returned.
2828
+ * @throws ApiError
2829
+ */
2830
+ static getReplyAnalytics(appUuid) {
2831
+ return request(OpenAPI, {
2832
+ method: "GET",
2833
+ url: "/api/v1/apps/{appUuid}/replies/analytics",
2834
+ path: {
2835
+ "appUuid": appUuid
2836
+ },
2837
+ errors: {
2838
+ 401: `Authentication required or token invalid.`,
2839
+ 403: `Request not permitted for this user.`,
2840
+ 404: `Resource not found.`
2841
+ }
2842
+ });
2843
+ }
2844
+ /**
2845
+ * Discover reviews across all connected apps.
2846
+ * @param limit
2847
+ * @param cursor
2848
+ * @param appUuid
2849
+ * @param sentiment
2850
+ * @returns any Reviews returned.
2851
+ * @throws ApiError
2852
+ */
2853
+ static getTenantReviews(limit, cursor, appUuid, sentiment) {
2854
+ return request(OpenAPI, {
2855
+ method: "GET",
2856
+ url: "/api/v1/reviews",
2857
+ query: {
2858
+ "limit": limit,
2859
+ "cursor": cursor,
2860
+ "app_uuid": appUuid,
2861
+ "sentiment": sentiment
2862
+ },
2863
+ errors: {
2864
+ 401: `Authentication required or token invalid.`
2865
+ }
2866
+ });
2867
+ }
2868
+ /**
2869
+ * Retrieve reviews tied to a specific segment.
2870
+ * @param appUuid App UUID assigned by Tritonium.
2871
+ * @param segmentType
2872
+ * @returns any Reviews returned.
2873
+ * @throws ApiError
2874
+ */
2875
+ static getSegmentReviews(appUuid, segmentType) {
2876
+ return request(OpenAPI, {
2877
+ method: "GET",
2878
+ url: "/api/v1/apps/{app_uuid}/segments/{segment_type}/reviews",
2879
+ path: {
2880
+ "app_uuid": appUuid,
2881
+ "segment_type": segmentType
2882
+ },
2883
+ errors: {
2884
+ 401: `Authentication required or token invalid.`,
2885
+ 403: `Request not permitted for this user.`
2886
+ }
2887
+ });
2888
+ }
2889
+ /**
2890
+ * List reviews with viral engagement.
2891
+ * @param appUuid App UUID assigned by Tritonium.
2892
+ * @param lookbackHours
2893
+ * @param minEngagement
2894
+ * @param sentiment
2895
+ * @returns any Viral review payload.
2896
+ * @throws ApiError
2897
+ */
2898
+ static getViralReviews(appUuid, lookbackHours = 48, minEngagement = 50, sentiment) {
2899
+ return request(OpenAPI, {
2900
+ method: "GET",
2901
+ url: "/api/v1/apps/{app_uuid}/reviews/viral",
2902
+ path: {
2903
+ "app_uuid": appUuid
2904
+ },
2905
+ query: {
2906
+ "lookback_hours": lookbackHours,
2907
+ "min_engagement": minEngagement,
2908
+ "sentiment": sentiment
2909
+ },
2910
+ errors: {
2911
+ 401: `Authentication required or token invalid.`,
2912
+ 403: `Request not permitted for this user.`
2913
+ }
2914
+ });
2915
+ }
2916
+ /**
2917
+ * Retrieve engagement history for a review.
2918
+ * @param reviewId
2919
+ * @param appUuid
2920
+ * @returns any History returned.
2921
+ * @throws ApiError
2922
+ */
2923
+ static getReviewEngagementHistory(reviewId, appUuid) {
2924
+ return request(OpenAPI, {
2925
+ method: "GET",
2926
+ url: "/api/v1/reviews/{review_id}/engagement/history",
2927
+ path: {
2928
+ "review_id": reviewId
2929
+ },
2930
+ query: {
2931
+ "app_uuid": appUuid
2932
+ },
2933
+ errors: {
2934
+ 401: `Authentication required or token invalid.`,
2935
+ 403: `Request not permitted for this user.`
2936
+ }
2937
+ });
2938
+ }
2939
+ };
2940
+
2941
+ // services/UsersService.ts
2942
+ var UsersService = class {
2943
+ /**
2944
+ * Retrieve the authenticated user's profile.
2945
+ * @returns UserSummary Profile details.
2946
+ * @throws ApiError
2947
+ */
2948
+ static getMe() {
2949
+ return request(OpenAPI, {
2950
+ method: "GET",
2951
+ url: "/api/v1/me",
2952
+ errors: {
2953
+ 401: `Authentication required or token invalid.`
2954
+ }
2955
+ });
2956
+ }
2957
+ /**
2958
+ * Update profile attributes for the active user.
2959
+ * @param requestBody
2960
+ * @returns UserSummary Profile updated.
2961
+ * @throws ApiError
2962
+ */
2963
+ static patchProfile(requestBody) {
2964
+ return request(OpenAPI, {
2965
+ method: "PATCH",
2966
+ url: "/api/v1/profile",
2967
+ body: requestBody,
2968
+ mediaType: "application/json",
2969
+ errors: {
2970
+ 400: `Request validation failed.`
2971
+ }
2972
+ });
2973
+ }
2974
+ /**
2975
+ * Mark onboarding tour completion for the signed-in user.
2976
+ * @param requestBody
2977
+ * @returns any User updated.
2978
+ * @throws ApiError
2979
+ */
2980
+ static postUserOnboardingState(requestBody) {
2981
+ return request(OpenAPI, {
2982
+ method: "POST",
2983
+ url: "/api/v1/users/me/onboarding",
2984
+ body: requestBody,
2985
+ mediaType: "application/json",
2986
+ errors: {
2987
+ 400: `Request validation failed.`,
2988
+ 401: `Authentication required or token invalid.`
2989
+ }
2990
+ });
2991
+ }
2992
+ /**
2993
+ * Replace profile attributes for the active user.
2994
+ * @param requestBody
2995
+ * @returns UserSummary Profile updated.
2996
+ * @throws ApiError
2997
+ */
2998
+ static putProfile(requestBody) {
2999
+ return request(OpenAPI, {
3000
+ method: "PUT",
3001
+ url: "/api/v1/users/me/onboarding",
3002
+ body: requestBody,
3003
+ mediaType: "application/json",
3004
+ errors: {
3005
+ 400: `Request validation failed.`,
3006
+ 401: `Authentication required or token invalid.`
3007
+ }
3008
+ });
3009
+ }
3010
+ };
3011
+
3012
+ exports.AlertsService = AlertsService;
3013
+ exports.ApiError = ApiError;
3014
+ exports.AppsService = AppsService;
3015
+ exports.AuthService = AuthService;
3016
+ exports.BillingService = BillingService;
3017
+ exports.CancelError = CancelError;
3018
+ exports.CancelablePromise = CancelablePromise;
3019
+ exports.CredentialsService = CredentialsService;
3020
+ exports.EventTypes = EventTypes;
3021
+ exports.HealthService = HealthService;
3022
+ exports.InsightsService = InsightsService;
3023
+ exports.IntegrationsService = IntegrationsService;
3024
+ exports.InternalService = InternalService;
3025
+ exports.OpenAPI = OpenAPI;
3026
+ exports.PredictionsService = PredictionsService;
3027
+ exports.RatingsService = RatingsService;
3028
+ exports.ReplyTemplatesService = ReplyTemplatesService;
3029
+ exports.ReviewsService = ReviewsService;
3030
+ exports.UsersService = UsersService;
3031
+ exports.WebhookExpiredError = WebhookExpiredError;
3032
+ exports.WebhookSignatureError = WebhookSignatureError;
3033
+ exports.WebhookVerificationError = WebhookVerificationError;
3034
+ exports.clearAuth = clearAuth;
3035
+ exports.configure = configure;
3036
+ exports.configureApiKey = configureApiKey;
3037
+ exports.configureBearerToken = configureBearerToken;
3038
+ exports.constructEvent = constructEvent;
3039
+ exports.getConfiguration = getConfiguration;
3040
+ exports.isWebhookError = isWebhookError;
3041
+ exports.verifySignature = verifySignature;
3042
+ exports.verifyTimestamp = verifyTimestamp;
3043
+ exports.verifyWebhook = verifyWebhook;
3044
+ //# sourceMappingURL=index.js.map
3045
+ //# sourceMappingURL=index.js.map