@elqnt/types 2.0.8 → 2.0.10
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.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +265 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +188 -0
- package/dist/index.mjs.map +1 -1
- package/dist/models/index.d.mts +1596 -35
- package/dist/models/index.d.ts +1596 -35
- package/dist/models/index.js +265 -0
- package/dist/models/index.js.map +1 -1
- package/dist/models/index.mjs +188 -0
- package/dist/models/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/models/index.d.mts
CHANGED
|
@@ -457,7 +457,6 @@ interface OrgProvisioning {
|
|
|
457
457
|
error?: string;
|
|
458
458
|
}
|
|
459
459
|
interface OrgSubscription {
|
|
460
|
-
id: string;
|
|
461
460
|
plan: string;
|
|
462
461
|
platform: SubscriptionPlatform;
|
|
463
462
|
status: OrgSubscriptionStatus;
|
|
@@ -466,6 +465,9 @@ interface OrgSubscription {
|
|
|
466
465
|
seats?: number;
|
|
467
466
|
stripeCustomerId?: string;
|
|
468
467
|
stripeSubscriptionId?: string;
|
|
468
|
+
cancelledAt?: number;
|
|
469
|
+
cancelReason?: string;
|
|
470
|
+
gracePeriodEndsAt?: number;
|
|
469
471
|
}
|
|
470
472
|
type OrgSubscriptionStatus = string;
|
|
471
473
|
declare const OrgSubscriptionStatusTrialing: OrgSubscriptionStatus;
|
|
@@ -978,6 +980,7 @@ interface PaymentSessionInput {
|
|
|
978
980
|
seats: number;
|
|
979
981
|
successUrl: string;
|
|
980
982
|
cancelUrl: string;
|
|
983
|
+
affiliateCode?: string;
|
|
981
984
|
}
|
|
982
985
|
/**
|
|
983
986
|
* PaymentSessionResult contains the result of creating a payment session
|
|
@@ -1015,49 +1018,1607 @@ declare const AdminTeamsGetOne = "admin.teams.getOne";
|
|
|
1015
1018
|
declare const AdminTeamsGetForOrg = "admin.teams.getTeamsForOrg";
|
|
1016
1019
|
declare const AdminTeamsUpdateOnboarding = "admin.teams.updateOnboardingData";
|
|
1017
1020
|
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1021
|
+
/**
|
|
1022
|
+
* Billing event handlers
|
|
1023
|
+
*/
|
|
1024
|
+
declare const BillingRecordEvent = "billing.events.record";
|
|
1025
|
+
/**
|
|
1026
|
+
* NATS Subject constants
|
|
1027
|
+
*/
|
|
1028
|
+
declare const BillingGetUsageReport = "billing.usage.report";
|
|
1029
|
+
/**
|
|
1030
|
+
* NATS Subject constants
|
|
1031
|
+
*/
|
|
1032
|
+
declare const BillingGetInvoice = "billing.invoice.get";
|
|
1033
|
+
/**
|
|
1034
|
+
* NATS Subject constants
|
|
1035
|
+
*/
|
|
1036
|
+
declare const BillingProcessBillingPeriod = "billing.period.process";
|
|
1037
|
+
/**
|
|
1038
|
+
* Usage handlers
|
|
1039
|
+
*/
|
|
1040
|
+
declare const UsageGetCurrentUsage = "billing.usage.current";
|
|
1041
|
+
/**
|
|
1042
|
+
* NATS Subject constants
|
|
1043
|
+
*/
|
|
1044
|
+
declare const UsageGetUsageHistory = "billing.usage.history";
|
|
1045
|
+
/**
|
|
1046
|
+
* NATS Subject constants
|
|
1047
|
+
*/
|
|
1048
|
+
declare const UsageGetCostBreakdown = "billing.usage.breakdown";
|
|
1049
|
+
/**
|
|
1050
|
+
* NATS Subject constants
|
|
1051
|
+
*/
|
|
1052
|
+
declare const UsageGetTopCostCenters = "billing.usage.top_centers";
|
|
1053
|
+
/**
|
|
1054
|
+
* Rules handlers
|
|
1055
|
+
*/
|
|
1056
|
+
declare const RulesGetBillingRules = "billing.rules.get";
|
|
1057
|
+
/**
|
|
1058
|
+
* NATS Subject constants
|
|
1059
|
+
*/
|
|
1060
|
+
declare const RulesCreateBillingRule = "billing.rules.create";
|
|
1061
|
+
/**
|
|
1062
|
+
* NATS Subject constants
|
|
1063
|
+
*/
|
|
1064
|
+
declare const RulesUpdateBillingRule = "billing.rules.update";
|
|
1065
|
+
/**
|
|
1066
|
+
* NATS Subject constants
|
|
1067
|
+
*/
|
|
1068
|
+
declare const RulesDeleteBillingRule = "billing.rules.delete";
|
|
1069
|
+
interface BillingEvent {
|
|
1070
|
+
/**
|
|
1071
|
+
* Core identifiers
|
|
1072
|
+
*/
|
|
1073
|
+
org_id: string;
|
|
1074
|
+
event_id: string;
|
|
1075
|
+
user_id: string;
|
|
1076
|
+
customer_id: string;
|
|
1077
|
+
/**
|
|
1078
|
+
* Event details
|
|
1079
|
+
*/
|
|
1080
|
+
event_type: string;
|
|
1081
|
+
event_subtype: string;
|
|
1082
|
+
timestamp: string;
|
|
1083
|
+
/**
|
|
1084
|
+
* Billing metrics
|
|
1085
|
+
*/
|
|
1086
|
+
billable_units: number;
|
|
1087
|
+
unit_type: string;
|
|
1088
|
+
cost_per_unit: number;
|
|
1089
|
+
total_cost: number;
|
|
1090
|
+
/**
|
|
1091
|
+
* Context
|
|
1092
|
+
*/
|
|
1093
|
+
service_name: string;
|
|
1094
|
+
session_id: string;
|
|
1095
|
+
parent_event_id: string;
|
|
1096
|
+
/**
|
|
1097
|
+
* Resource consumption
|
|
1098
|
+
*/
|
|
1099
|
+
input_tokens: number;
|
|
1100
|
+
output_tokens: number;
|
|
1101
|
+
processing_time_ms: number;
|
|
1102
|
+
/**
|
|
1103
|
+
* Product context
|
|
1104
|
+
*/
|
|
1105
|
+
product_tier: string;
|
|
1106
|
+
feature_name: string;
|
|
1107
|
+
plan_id: string;
|
|
1108
|
+
/**
|
|
1109
|
+
* Metadata
|
|
1110
|
+
*/
|
|
1111
|
+
metadata: {
|
|
1022
1112
|
[key: string]: any;
|
|
1023
1113
|
};
|
|
1024
|
-
|
|
1025
|
-
|
|
1114
|
+
created_by: string;
|
|
1115
|
+
}
|
|
1116
|
+
interface UsageReport {
|
|
1117
|
+
org_id: string;
|
|
1118
|
+
period_start: string;
|
|
1119
|
+
period_end: string;
|
|
1120
|
+
total_cost: number;
|
|
1121
|
+
currency: string;
|
|
1122
|
+
service_breakdowns: ServiceUsage[];
|
|
1123
|
+
generated_at: string;
|
|
1124
|
+
}
|
|
1125
|
+
interface ServiceUsage {
|
|
1126
|
+
service_name: string;
|
|
1127
|
+
event_type: string;
|
|
1128
|
+
unit_type: string;
|
|
1129
|
+
total_units: number;
|
|
1130
|
+
total_cost: number;
|
|
1131
|
+
total_events: number;
|
|
1132
|
+
unique_users: number;
|
|
1133
|
+
unique_sessions: number;
|
|
1134
|
+
total_input_tokens: number;
|
|
1135
|
+
total_output_tokens: number;
|
|
1136
|
+
total_processing_time: number;
|
|
1137
|
+
}
|
|
1138
|
+
interface BillingRule {
|
|
1139
|
+
rule_id: string;
|
|
1140
|
+
org_id: string;
|
|
1141
|
+
service_name: string;
|
|
1142
|
+
event_type: string;
|
|
1143
|
+
unit_type: string;
|
|
1144
|
+
/**
|
|
1145
|
+
* Tiered pricing
|
|
1146
|
+
*/
|
|
1147
|
+
base_cost: number;
|
|
1148
|
+
tier_1_threshold: number;
|
|
1149
|
+
tier_1_cost: number;
|
|
1150
|
+
tier_2_threshold: number;
|
|
1151
|
+
tier_2_cost: number;
|
|
1152
|
+
tier_3_threshold: number;
|
|
1153
|
+
tier_3_cost: number;
|
|
1154
|
+
/**
|
|
1155
|
+
* Validity
|
|
1156
|
+
*/
|
|
1157
|
+
effective_from: string;
|
|
1158
|
+
effective_to: string;
|
|
1159
|
+
is_active: boolean;
|
|
1160
|
+
created_at: string;
|
|
1161
|
+
updated_at: string;
|
|
1026
1162
|
}
|
|
1027
|
-
interface
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1163
|
+
interface BillingPeriod {
|
|
1164
|
+
period_id: string;
|
|
1165
|
+
org_id: string;
|
|
1166
|
+
period_start: string;
|
|
1167
|
+
period_end: string;
|
|
1168
|
+
status: string;
|
|
1169
|
+
billing_cycle: string;
|
|
1170
|
+
created_at: string;
|
|
1171
|
+
}
|
|
1172
|
+
interface Invoice {
|
|
1173
|
+
invoice_id: string;
|
|
1174
|
+
org_id: string;
|
|
1175
|
+
period_id: string;
|
|
1176
|
+
period_start: string;
|
|
1177
|
+
period_end: string;
|
|
1178
|
+
line_items: InvoiceLineItem[];
|
|
1179
|
+
subtotal_amount: number;
|
|
1180
|
+
tax_amount: number;
|
|
1181
|
+
total_amount: number;
|
|
1182
|
+
currency: string;
|
|
1183
|
+
status: string;
|
|
1184
|
+
generated_at: string;
|
|
1185
|
+
due_date: string;
|
|
1186
|
+
payment_method_id: string;
|
|
1187
|
+
}
|
|
1188
|
+
interface InvoiceLineItem {
|
|
1189
|
+
line_item_id: string;
|
|
1190
|
+
service_name: string;
|
|
1191
|
+
event_type: string;
|
|
1192
|
+
unit_type: string;
|
|
1193
|
+
description: string;
|
|
1194
|
+
quantity: number;
|
|
1195
|
+
unit_price: number;
|
|
1196
|
+
total_price: number;
|
|
1197
|
+
}
|
|
1198
|
+
interface BillingEventRequest {
|
|
1199
|
+
BillingEvent: BillingEvent;
|
|
1200
|
+
}
|
|
1201
|
+
interface BillingEventResponse {
|
|
1202
|
+
success: boolean;
|
|
1203
|
+
error?: string;
|
|
1204
|
+
}
|
|
1205
|
+
interface UsageReportRequest {
|
|
1206
|
+
org_id: string;
|
|
1207
|
+
period_start: string;
|
|
1208
|
+
period_end: string;
|
|
1209
|
+
}
|
|
1210
|
+
interface UsageReportResponse {
|
|
1211
|
+
success: boolean;
|
|
1212
|
+
data?: UsageReport;
|
|
1213
|
+
error?: string;
|
|
1214
|
+
}
|
|
1215
|
+
interface CurrentUsageRequest {
|
|
1216
|
+
org_id: string;
|
|
1217
|
+
service_name: string;
|
|
1218
|
+
event_type: string;
|
|
1219
|
+
}
|
|
1220
|
+
interface CurrentUsageResponse {
|
|
1221
|
+
success: boolean;
|
|
1222
|
+
data?: {
|
|
1031
1223
|
[key: string]: any;
|
|
1032
1224
|
};
|
|
1033
|
-
|
|
1034
|
-
to: string;
|
|
1225
|
+
error?: string;
|
|
1035
1226
|
}
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
total_chunks: number;
|
|
1042
|
-
page_count: number;
|
|
1043
|
-
from_page: number;
|
|
1044
|
-
to_page: number;
|
|
1045
|
-
status: string;
|
|
1046
|
-
model: string;
|
|
1047
|
-
owner_email: string;
|
|
1048
|
-
visibility_level: string;
|
|
1049
|
-
created_at: string;
|
|
1050
|
-
updated_at: string;
|
|
1227
|
+
interface CostBreakdownRequest {
|
|
1228
|
+
org_id: string;
|
|
1229
|
+
period_start: string;
|
|
1230
|
+
period_end: string;
|
|
1231
|
+
group_by: string;
|
|
1051
1232
|
}
|
|
1052
|
-
interface
|
|
1053
|
-
|
|
1233
|
+
interface CostBreakdownResponse {
|
|
1234
|
+
success: boolean;
|
|
1235
|
+
data?: CostBreakdown[];
|
|
1236
|
+
error?: string;
|
|
1237
|
+
}
|
|
1238
|
+
interface CostBreakdown {
|
|
1239
|
+
group_value: string;
|
|
1240
|
+
total_cost: number;
|
|
1241
|
+
total_units: number;
|
|
1242
|
+
event_count: number;
|
|
1243
|
+
}
|
|
1244
|
+
interface BillingRuleRequest {
|
|
1245
|
+
BillingRule: BillingRule;
|
|
1246
|
+
}
|
|
1247
|
+
interface BillingRuleResponse {
|
|
1248
|
+
success: boolean;
|
|
1249
|
+
data?: BillingRule;
|
|
1250
|
+
error?: string;
|
|
1251
|
+
}
|
|
1252
|
+
interface BillingRulesRequest {
|
|
1253
|
+
org_id: string;
|
|
1254
|
+
service_name: string;
|
|
1255
|
+
event_type: string;
|
|
1256
|
+
}
|
|
1257
|
+
interface BillingRulesResponse {
|
|
1258
|
+
success: boolean;
|
|
1259
|
+
data?: (BillingRule | undefined)[];
|
|
1260
|
+
error?: string;
|
|
1261
|
+
}
|
|
1262
|
+
interface InvoiceRequest {
|
|
1263
|
+
org_id: string;
|
|
1264
|
+
period_id: string;
|
|
1265
|
+
invoice_id: string;
|
|
1266
|
+
}
|
|
1267
|
+
interface InvoiceResponse {
|
|
1268
|
+
success: boolean;
|
|
1269
|
+
data?: Invoice;
|
|
1270
|
+
error?: string;
|
|
1271
|
+
}
|
|
1272
|
+
interface BillingPeriodProcessRequest {
|
|
1273
|
+
org_id: string;
|
|
1274
|
+
period_id: string;
|
|
1275
|
+
}
|
|
1276
|
+
interface BillingPeriodProcessResponse {
|
|
1054
1277
|
success: boolean;
|
|
1278
|
+
invoice_id?: string;
|
|
1279
|
+
error?: string;
|
|
1280
|
+
}
|
|
1281
|
+
interface UsageAggregation {
|
|
1282
|
+
org_id: string;
|
|
1283
|
+
period_id: string;
|
|
1284
|
+
date: string;
|
|
1285
|
+
hour: number;
|
|
1286
|
+
service_name: string;
|
|
1287
|
+
event_type: string;
|
|
1288
|
+
unit_type: string;
|
|
1289
|
+
total_units: number;
|
|
1290
|
+
total_events: number;
|
|
1291
|
+
total_cost: number;
|
|
1292
|
+
unique_users: number;
|
|
1293
|
+
unique_sessions: number;
|
|
1294
|
+
total_input_tokens: number;
|
|
1295
|
+
total_output_tokens: number;
|
|
1296
|
+
total_processing_time: number;
|
|
1297
|
+
created_at: string;
|
|
1298
|
+
}
|
|
1299
|
+
interface TopCostCenter {
|
|
1300
|
+
service_name: string;
|
|
1301
|
+
event_type: string;
|
|
1302
|
+
total_cost: number;
|
|
1303
|
+
total_units: number;
|
|
1304
|
+
event_count: number;
|
|
1305
|
+
percentage: number;
|
|
1306
|
+
}
|
|
1307
|
+
interface UsageHistory {
|
|
1308
|
+
date: string;
|
|
1309
|
+
total_cost: number;
|
|
1310
|
+
total_units: number;
|
|
1311
|
+
event_count: number;
|
|
1312
|
+
unique_users: number;
|
|
1313
|
+
}
|
|
1314
|
+
interface UserUsage {
|
|
1315
|
+
user_id: string;
|
|
1316
|
+
total_cost: number;
|
|
1317
|
+
total_units: number;
|
|
1318
|
+
event_count: number;
|
|
1319
|
+
last_activity: string;
|
|
1320
|
+
}
|
|
1321
|
+
/**
|
|
1322
|
+
* Usage trends and analytics models
|
|
1323
|
+
*/
|
|
1324
|
+
interface UsageTrends {
|
|
1325
|
+
org_id: string;
|
|
1326
|
+
days: number;
|
|
1327
|
+
trend: string;
|
|
1328
|
+
direction: string;
|
|
1329
|
+
change_percent: number;
|
|
1330
|
+
recent_week_cost: number;
|
|
1331
|
+
previous_week_cost: number;
|
|
1332
|
+
}
|
|
1333
|
+
interface UsageAlert {
|
|
1334
|
+
type: string;
|
|
1335
|
+
severity: string;
|
|
1055
1336
|
message: string;
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1337
|
+
current_value: number;
|
|
1338
|
+
threshold_value: number;
|
|
1339
|
+
created_at: string;
|
|
1340
|
+
}
|
|
1341
|
+
/**
|
|
1342
|
+
* Cost preview models
|
|
1343
|
+
*/
|
|
1344
|
+
interface CostPreview {
|
|
1345
|
+
units: number;
|
|
1346
|
+
total_cost: number;
|
|
1347
|
+
cost_per_unit: number;
|
|
1348
|
+
tier_breakdown: TierCost[];
|
|
1349
|
+
rule?: BillingRule;
|
|
1350
|
+
}
|
|
1351
|
+
interface TierCost {
|
|
1352
|
+
tier: string;
|
|
1353
|
+
units: number;
|
|
1354
|
+
rate: number;
|
|
1355
|
+
cost: number;
|
|
1356
|
+
}
|
|
1357
|
+
/**
|
|
1358
|
+
* Rule coverage models
|
|
1359
|
+
*/
|
|
1360
|
+
interface RuleCoverage {
|
|
1361
|
+
org_id: string;
|
|
1362
|
+
total_services: number;
|
|
1363
|
+
covered_services: {
|
|
1364
|
+
[key: string]: boolean;
|
|
1365
|
+
};
|
|
1366
|
+
missing_rules: string[];
|
|
1367
|
+
rule_count: number;
|
|
1368
|
+
coverage_percentage: number;
|
|
1369
|
+
}
|
|
1370
|
+
/**
|
|
1371
|
+
* Generic Response
|
|
1372
|
+
*/
|
|
1373
|
+
interface BillingResponse {
|
|
1374
|
+
success: boolean;
|
|
1375
|
+
data?: any;
|
|
1376
|
+
error?: string;
|
|
1377
|
+
}
|
|
1378
|
+
/**
|
|
1379
|
+
* Subscription management
|
|
1380
|
+
*/
|
|
1381
|
+
declare const SubscriptionCreate = "billing.subscription.create";
|
|
1382
|
+
/**
|
|
1383
|
+
* NATS Subjects for Stripe/Subscription operations
|
|
1384
|
+
*/
|
|
1385
|
+
declare const SubscriptionGet = "billing.subscription.get";
|
|
1386
|
+
/**
|
|
1387
|
+
* NATS Subjects for Stripe/Subscription operations
|
|
1388
|
+
*/
|
|
1389
|
+
declare const SubscriptionUpdate = "billing.subscription.update";
|
|
1390
|
+
/**
|
|
1391
|
+
* NATS Subjects for Stripe/Subscription operations
|
|
1392
|
+
*/
|
|
1393
|
+
declare const SubscriptionCancel = "billing.subscription.cancel";
|
|
1394
|
+
/**
|
|
1395
|
+
* NATS Subjects for Stripe/Subscription operations
|
|
1396
|
+
*/
|
|
1397
|
+
declare const SubscriptionList = "billing.subscription.list";
|
|
1398
|
+
/**
|
|
1399
|
+
* NATS Subjects for Stripe/Subscription operations
|
|
1400
|
+
*/
|
|
1401
|
+
declare const SubscriptionCheckout = "billing.subscription.checkout";
|
|
1402
|
+
/**
|
|
1403
|
+
* Payment links
|
|
1404
|
+
*/
|
|
1405
|
+
declare const PaymentLinkCreate = "billing.payment-link.create";
|
|
1406
|
+
/**
|
|
1407
|
+
* NATS Subjects for Stripe/Subscription operations
|
|
1408
|
+
*/
|
|
1409
|
+
declare const PaymentLinkList = "billing.payment-link.list";
|
|
1410
|
+
/**
|
|
1411
|
+
* Customer portal
|
|
1412
|
+
*/
|
|
1413
|
+
declare const PortalSessionCreate = "billing.portal.create";
|
|
1414
|
+
/**
|
|
1415
|
+
* Customer management
|
|
1416
|
+
*/
|
|
1417
|
+
declare const CustomerCreate = "billing.customer.create";
|
|
1418
|
+
/**
|
|
1419
|
+
* NATS Subjects for Stripe/Subscription operations
|
|
1420
|
+
*/
|
|
1421
|
+
declare const CustomerGet = "billing.customer.get";
|
|
1422
|
+
/**
|
|
1423
|
+
* NATS Subjects for Stripe/Subscription operations
|
|
1424
|
+
*/
|
|
1425
|
+
declare const CustomerUpdate = "billing.customer.update";
|
|
1426
|
+
/**
|
|
1427
|
+
* Credits
|
|
1428
|
+
*/
|
|
1429
|
+
declare const CreditsBalance = "billing.credits.balance";
|
|
1430
|
+
/**
|
|
1431
|
+
* NATS Subjects for Stripe/Subscription operations
|
|
1432
|
+
*/
|
|
1433
|
+
declare const CreditsPurchase = "billing.credits.purchase";
|
|
1434
|
+
/**
|
|
1435
|
+
* NATS Subjects for Stripe/Subscription operations
|
|
1436
|
+
*/
|
|
1437
|
+
declare const CreditsConsume = "billing.credits.consume";
|
|
1438
|
+
/**
|
|
1439
|
+
* Plans
|
|
1440
|
+
*/
|
|
1441
|
+
declare const PlansGet = "billing.plans.get";
|
|
1442
|
+
/**
|
|
1443
|
+
* NATS Subjects for Stripe/Subscription operations
|
|
1444
|
+
*/
|
|
1445
|
+
declare const PlansGetAll = "billing.plans.list";
|
|
1446
|
+
/**
|
|
1447
|
+
* Usage alerts
|
|
1448
|
+
*/
|
|
1449
|
+
declare const UsageAlertThreshold = "billing.usage.alert";
|
|
1450
|
+
/**
|
|
1451
|
+
* Webhooks (internal events)
|
|
1452
|
+
*/
|
|
1453
|
+
declare const WebhookSubscriptionCreated = "billing.webhook.subscription.created";
|
|
1454
|
+
/**
|
|
1455
|
+
* NATS Subjects for Stripe/Subscription operations
|
|
1456
|
+
*/
|
|
1457
|
+
declare const WebhookSubscriptionUpdated = "billing.webhook.subscription.updated";
|
|
1458
|
+
/**
|
|
1459
|
+
* NATS Subjects for Stripe/Subscription operations
|
|
1460
|
+
*/
|
|
1461
|
+
declare const WebhookSubscriptionCanceled = "billing.webhook.subscription.canceled";
|
|
1462
|
+
/**
|
|
1463
|
+
* NATS Subjects for Stripe/Subscription operations
|
|
1464
|
+
*/
|
|
1465
|
+
declare const WebhookInvoicePaid = "billing.webhook.invoice.paid";
|
|
1466
|
+
/**
|
|
1467
|
+
* NATS Subjects for Stripe/Subscription operations
|
|
1468
|
+
*/
|
|
1469
|
+
declare const WebhookInvoiceFailed = "billing.webhook.invoice.failed";
|
|
1470
|
+
/**
|
|
1471
|
+
* NATS Subjects for Stripe/Subscription operations
|
|
1472
|
+
*/
|
|
1473
|
+
declare const WebhookPaymentSucceeded = "billing.webhook.payment.succeeded";
|
|
1474
|
+
/**
|
|
1475
|
+
* Affiliates
|
|
1476
|
+
*/
|
|
1477
|
+
declare const AffiliateCreate = "billing.affiliate.create";
|
|
1478
|
+
/**
|
|
1479
|
+
* NATS Subjects for Stripe/Subscription operations
|
|
1480
|
+
*/
|
|
1481
|
+
declare const AffiliateGet = "billing.affiliate.get";
|
|
1482
|
+
/**
|
|
1483
|
+
* NATS Subjects for Stripe/Subscription operations
|
|
1484
|
+
*/
|
|
1485
|
+
declare const AffiliateList = "billing.affiliate.list";
|
|
1486
|
+
/**
|
|
1487
|
+
* NATS Subjects for Stripe/Subscription operations
|
|
1488
|
+
*/
|
|
1489
|
+
declare const AffiliateUpdate = "billing.affiliate.update";
|
|
1490
|
+
/**
|
|
1491
|
+
* NATS Subjects for Stripe/Subscription operations
|
|
1492
|
+
*/
|
|
1493
|
+
declare const AffiliateOnboard = "billing.affiliate.onboard";
|
|
1494
|
+
/**
|
|
1495
|
+
* NATS Subjects for Stripe/Subscription operations
|
|
1496
|
+
*/
|
|
1497
|
+
declare const AffiliateCommissions = "billing.affiliate.commissions";
|
|
1498
|
+
/**
|
|
1499
|
+
* Analytics
|
|
1500
|
+
*/
|
|
1501
|
+
declare const AnalyticsRevenue = "billing.analytics.revenue";
|
|
1502
|
+
/**
|
|
1503
|
+
* NATS Subjects for Stripe/Subscription operations
|
|
1504
|
+
*/
|
|
1505
|
+
declare const AnalyticsUsage = "billing.analytics.usage";
|
|
1506
|
+
/**
|
|
1507
|
+
* NATS Subjects for Stripe/Subscription operations
|
|
1508
|
+
*/
|
|
1509
|
+
declare const AnalyticsChurn = "billing.analytics.churn";
|
|
1510
|
+
/**
|
|
1511
|
+
* Plan represents a subscription plan
|
|
1512
|
+
*/
|
|
1513
|
+
interface Plan {
|
|
1514
|
+
id: string;
|
|
1515
|
+
stripeProductId?: string;
|
|
1516
|
+
stripePriceId?: string;
|
|
1517
|
+
name: string;
|
|
1518
|
+
tier: string;
|
|
1519
|
+
priceCents: number;
|
|
1520
|
+
currency: string;
|
|
1521
|
+
billingInterval: string;
|
|
1522
|
+
chatSessionsLimit: number;
|
|
1523
|
+
tokenAllowance: number;
|
|
1524
|
+
agentsLimit: number;
|
|
1525
|
+
usersLimit: number;
|
|
1526
|
+
knowledgeGraphMb: number;
|
|
1527
|
+
tokenOverageRateCents: number;
|
|
1528
|
+
sessionOverageRateCents: number;
|
|
1529
|
+
features: {
|
|
1530
|
+
[key: string]: any;
|
|
1531
|
+
};
|
|
1532
|
+
isActive: boolean;
|
|
1533
|
+
createdAt: string;
|
|
1534
|
+
updatedAt: string;
|
|
1535
|
+
}
|
|
1536
|
+
/**
|
|
1537
|
+
* OrganizationBilling represents an organization's billing info
|
|
1538
|
+
*/
|
|
1539
|
+
interface OrganizationBilling {
|
|
1540
|
+
orgId: string;
|
|
1541
|
+
stripeCustomerId?: string;
|
|
1542
|
+
stripeSubscriptionId?: string;
|
|
1543
|
+
planId?: string;
|
|
1544
|
+
plan?: Plan;
|
|
1545
|
+
status: string;
|
|
1546
|
+
currentPeriodStart?: string;
|
|
1547
|
+
currentPeriodEnd?: string;
|
|
1548
|
+
trialStart?: string;
|
|
1549
|
+
trialEnd?: string;
|
|
1550
|
+
billingEmail?: string;
|
|
1551
|
+
billingName?: string;
|
|
1552
|
+
affiliateCode?: string;
|
|
1553
|
+
createdAt: string;
|
|
1554
|
+
updatedAt: string;
|
|
1555
|
+
}
|
|
1556
|
+
/**
|
|
1557
|
+
* CreditBalance represents a credit balance entry
|
|
1558
|
+
*/
|
|
1559
|
+
interface CreditBalance {
|
|
1560
|
+
id: string;
|
|
1561
|
+
orgId: string;
|
|
1562
|
+
creditType: string;
|
|
1563
|
+
amount: number;
|
|
1564
|
+
remaining: number;
|
|
1565
|
+
description?: string;
|
|
1566
|
+
expiresAt?: string;
|
|
1567
|
+
stripePaymentId?: string;
|
|
1568
|
+
createdAt: string;
|
|
1569
|
+
}
|
|
1570
|
+
/**
|
|
1571
|
+
* CreditPackage represents a purchasable credit package
|
|
1572
|
+
*/
|
|
1573
|
+
interface CreditPackage {
|
|
1574
|
+
id: string;
|
|
1575
|
+
stripeProductId?: string;
|
|
1576
|
+
stripePriceId?: string;
|
|
1577
|
+
name: string;
|
|
1578
|
+
tokens: number;
|
|
1579
|
+
priceCents: number;
|
|
1580
|
+
currency: string;
|
|
1581
|
+
bonusTokens: number;
|
|
1582
|
+
isActive: boolean;
|
|
1583
|
+
createdAt: string;
|
|
1584
|
+
}
|
|
1585
|
+
/**
|
|
1586
|
+
* UsagePeriod represents usage within a billing period
|
|
1587
|
+
*/
|
|
1588
|
+
interface UsagePeriod {
|
|
1589
|
+
id: string;
|
|
1590
|
+
orgId: string;
|
|
1591
|
+
periodStart: string;
|
|
1592
|
+
periodEnd: string;
|
|
1593
|
+
tokensUsed: number;
|
|
1594
|
+
sessionsUsed: number;
|
|
1595
|
+
tokensAllowance: number;
|
|
1596
|
+
sessionsAllowance: number;
|
|
1597
|
+
tokensOverage: number;
|
|
1598
|
+
sessionsOverage: number;
|
|
1599
|
+
overageChargedCents: number;
|
|
1600
|
+
status: string;
|
|
1601
|
+
stripeUsageRecordId?: string;
|
|
1602
|
+
createdAt: string;
|
|
1603
|
+
updatedAt: string;
|
|
1604
|
+
}
|
|
1605
|
+
/**
|
|
1606
|
+
* UsageSummary provides a summary of current usage
|
|
1607
|
+
*/
|
|
1608
|
+
interface UsageSummary {
|
|
1609
|
+
orgId: string;
|
|
1610
|
+
planTier: string;
|
|
1611
|
+
billingPeriodStart: string;
|
|
1612
|
+
billingPeriodEnd: string;
|
|
1613
|
+
daysRemaining: number;
|
|
1614
|
+
/**
|
|
1615
|
+
* Token usage
|
|
1616
|
+
*/
|
|
1617
|
+
tokensUsed: number;
|
|
1618
|
+
tokensAllowance: number;
|
|
1619
|
+
tokensPercentage: number;
|
|
1620
|
+
tokensRemaining: number;
|
|
1621
|
+
/**
|
|
1622
|
+
* Session usage
|
|
1623
|
+
*/
|
|
1624
|
+
sessionsUsed: number;
|
|
1625
|
+
sessionsAllowance: number;
|
|
1626
|
+
sessionsPercentage: number;
|
|
1627
|
+
sessionsRemaining: number;
|
|
1628
|
+
/**
|
|
1629
|
+
* Credits
|
|
1630
|
+
*/
|
|
1631
|
+
creditsRemaining: number;
|
|
1632
|
+
/**
|
|
1633
|
+
* Projected overage
|
|
1634
|
+
*/
|
|
1635
|
+
projectedTokenOverage: number;
|
|
1636
|
+
projectedSessionOverage: number;
|
|
1637
|
+
projectedOverageCents: number;
|
|
1638
|
+
}
|
|
1639
|
+
/**
|
|
1640
|
+
* Affiliate represents an affiliate partner
|
|
1641
|
+
*/
|
|
1642
|
+
interface Affiliate {
|
|
1643
|
+
id: string;
|
|
1644
|
+
name: string;
|
|
1645
|
+
email: string;
|
|
1646
|
+
stripeAccountId?: string;
|
|
1647
|
+
status: string;
|
|
1648
|
+
commissionRate: number;
|
|
1649
|
+
commissionType: string;
|
|
1650
|
+
referralCode: string;
|
|
1651
|
+
referralLink: string;
|
|
1652
|
+
totalEarningsCents: number;
|
|
1653
|
+
pendingPayoutCents: number;
|
|
1654
|
+
onboardingCompleted: boolean;
|
|
1655
|
+
onboardingCompletedAt?: string;
|
|
1656
|
+
country?: string;
|
|
1657
|
+
phone?: string;
|
|
1658
|
+
createdAt: string;
|
|
1659
|
+
updatedAt: string;
|
|
1660
|
+
}
|
|
1661
|
+
/**
|
|
1662
|
+
* AffiliateReferral represents a customer referred by an affiliate
|
|
1663
|
+
*/
|
|
1664
|
+
interface AffiliateReferral {
|
|
1665
|
+
id: string;
|
|
1666
|
+
affiliateId: string;
|
|
1667
|
+
customerOrgId: string;
|
|
1668
|
+
stripeCustomerId?: string;
|
|
1060
1669
|
status: string;
|
|
1670
|
+
firstPurchaseAt?: string;
|
|
1671
|
+
totalRevenueCents: number;
|
|
1672
|
+
totalCommissionCents: number;
|
|
1673
|
+
createdAt: string;
|
|
1674
|
+
updatedAt: string;
|
|
1675
|
+
}
|
|
1676
|
+
/**
|
|
1677
|
+
* AffiliateCommission represents a commission payment to an affiliate
|
|
1678
|
+
*/
|
|
1679
|
+
interface AffiliateCommission {
|
|
1680
|
+
id: string;
|
|
1681
|
+
affiliateId: string;
|
|
1682
|
+
referralId: string;
|
|
1683
|
+
stripePaymentId?: string;
|
|
1684
|
+
stripeTransferId?: string;
|
|
1685
|
+
stripeInvoiceId?: string;
|
|
1686
|
+
grossAmountCents: number;
|
|
1687
|
+
commissionAmountCents: number;
|
|
1688
|
+
commissionRate: number;
|
|
1689
|
+
currency: string;
|
|
1690
|
+
status: string;
|
|
1691
|
+
createdAt: string;
|
|
1692
|
+
paidAt?: string;
|
|
1693
|
+
}
|
|
1694
|
+
/**
|
|
1695
|
+
* Payment represents a payment record
|
|
1696
|
+
*/
|
|
1697
|
+
interface Payment {
|
|
1698
|
+
id: string;
|
|
1699
|
+
orgId: string;
|
|
1700
|
+
stripePaymentIntentId?: string;
|
|
1701
|
+
stripeInvoiceId?: string;
|
|
1702
|
+
stripeSubscriptionId?: string;
|
|
1703
|
+
amountCents: number;
|
|
1704
|
+
currency: string;
|
|
1705
|
+
status: string;
|
|
1706
|
+
paymentType: string;
|
|
1707
|
+
customerEmail?: string;
|
|
1708
|
+
paymentMethod?: string;
|
|
1709
|
+
description?: string;
|
|
1710
|
+
metadata?: {
|
|
1711
|
+
[key: string]: any;
|
|
1712
|
+
};
|
|
1713
|
+
createdAt: string;
|
|
1714
|
+
updatedAt: string;
|
|
1715
|
+
}
|
|
1716
|
+
/**
|
|
1717
|
+
* CreatePaymentLinkRequest is the request to create a payment link
|
|
1718
|
+
*/
|
|
1719
|
+
interface CreatePaymentLinkRequest {
|
|
1720
|
+
orgId: string;
|
|
1721
|
+
priceId: string;
|
|
1722
|
+
successUrl: string;
|
|
1723
|
+
cancelUrl: string;
|
|
1724
|
+
customerEmail?: string;
|
|
1725
|
+
affiliateCode?: string;
|
|
1726
|
+
quantity?: number;
|
|
1727
|
+
metadata?: {
|
|
1728
|
+
[key: string]: string;
|
|
1729
|
+
};
|
|
1730
|
+
}
|
|
1731
|
+
/**
|
|
1732
|
+
* CreatePaymentLinkResponse is the response from creating a payment link
|
|
1733
|
+
*/
|
|
1734
|
+
interface CreatePaymentLinkResponse {
|
|
1735
|
+
success: boolean;
|
|
1736
|
+
url?: string;
|
|
1737
|
+
paymentLinkId?: string;
|
|
1738
|
+
error?: string;
|
|
1739
|
+
}
|
|
1740
|
+
/**
|
|
1741
|
+
* CreatePortalSessionRequest is the request to create a billing portal session
|
|
1742
|
+
*/
|
|
1743
|
+
interface CreatePortalSessionRequest {
|
|
1744
|
+
orgId: string;
|
|
1745
|
+
returnUrl: string;
|
|
1746
|
+
}
|
|
1747
|
+
/**
|
|
1748
|
+
* CreatePortalSessionResponse is the response from creating a portal session
|
|
1749
|
+
*/
|
|
1750
|
+
interface CreatePortalSessionResponse {
|
|
1751
|
+
success: boolean;
|
|
1752
|
+
url?: string;
|
|
1753
|
+
error?: string;
|
|
1754
|
+
}
|
|
1755
|
+
/**
|
|
1756
|
+
* CreateCheckoutSessionRequest is the request to create a checkout session
|
|
1757
|
+
*/
|
|
1758
|
+
interface CreateCheckoutSessionRequest {
|
|
1759
|
+
orgId: string;
|
|
1760
|
+
priceId: string;
|
|
1761
|
+
successUrl: string;
|
|
1762
|
+
cancelUrl: string;
|
|
1763
|
+
customerEmail?: string;
|
|
1764
|
+
affiliateCode?: string;
|
|
1765
|
+
trialDays?: number;
|
|
1766
|
+
metadata?: {
|
|
1767
|
+
[key: string]: string;
|
|
1768
|
+
};
|
|
1769
|
+
}
|
|
1770
|
+
/**
|
|
1771
|
+
* CreateCheckoutSessionResponse is the response from creating a checkout session
|
|
1772
|
+
*/
|
|
1773
|
+
interface CreateCheckoutSessionResponse {
|
|
1774
|
+
success: boolean;
|
|
1775
|
+
sessionId?: string;
|
|
1776
|
+
url?: string;
|
|
1777
|
+
error?: string;
|
|
1778
|
+
}
|
|
1779
|
+
/**
|
|
1780
|
+
* GetSubscriptionRequest is the request to get subscription info
|
|
1781
|
+
*/
|
|
1782
|
+
interface GetSubscriptionRequest {
|
|
1783
|
+
orgId: string;
|
|
1784
|
+
}
|
|
1785
|
+
/**
|
|
1786
|
+
* GetSubscriptionResponse is the response with subscription info
|
|
1787
|
+
*/
|
|
1788
|
+
interface GetSubscriptionResponse {
|
|
1789
|
+
success: boolean;
|
|
1790
|
+
subscription?: OrganizationBilling;
|
|
1791
|
+
usage?: UsageSummary;
|
|
1792
|
+
error?: string;
|
|
1793
|
+
}
|
|
1794
|
+
/**
|
|
1795
|
+
* CancelSubscriptionRequest is the request to cancel a subscription
|
|
1796
|
+
*/
|
|
1797
|
+
interface CancelSubscriptionRequest {
|
|
1798
|
+
orgId: string;
|
|
1799
|
+
cancelAtEnd: boolean;
|
|
1800
|
+
reason?: string;
|
|
1801
|
+
}
|
|
1802
|
+
/**
|
|
1803
|
+
* CancelSubscriptionResponse is the response from canceling a subscription
|
|
1804
|
+
*/
|
|
1805
|
+
interface CancelSubscriptionResponse {
|
|
1806
|
+
success: boolean;
|
|
1807
|
+
cancelAt?: string;
|
|
1808
|
+
error?: string;
|
|
1809
|
+
}
|
|
1810
|
+
/**
|
|
1811
|
+
* GetCreditsRequest is the request to get credit balance
|
|
1812
|
+
*/
|
|
1813
|
+
interface GetCreditsRequest {
|
|
1814
|
+
orgId: string;
|
|
1815
|
+
}
|
|
1816
|
+
/**
|
|
1817
|
+
* GetCreditsResponse is the response with credit balance
|
|
1818
|
+
*/
|
|
1819
|
+
interface GetCreditsResponse {
|
|
1820
|
+
success: boolean;
|
|
1821
|
+
totalRemaining: number;
|
|
1822
|
+
balances?: (CreditBalance | undefined)[];
|
|
1823
|
+
error?: string;
|
|
1824
|
+
}
|
|
1825
|
+
/**
|
|
1826
|
+
* PurchaseCreditsRequest is the request to purchase credits
|
|
1827
|
+
*/
|
|
1828
|
+
interface PurchaseCreditsRequest {
|
|
1829
|
+
orgId: string;
|
|
1830
|
+
packageId: string;
|
|
1831
|
+
successUrl: string;
|
|
1832
|
+
cancelUrl: string;
|
|
1833
|
+
}
|
|
1834
|
+
/**
|
|
1835
|
+
* PurchaseCreditsResponse is the response from purchasing credits
|
|
1836
|
+
*/
|
|
1837
|
+
interface PurchaseCreditsResponse {
|
|
1838
|
+
success: boolean;
|
|
1839
|
+
sessionId?: string;
|
|
1840
|
+
url?: string;
|
|
1841
|
+
error?: string;
|
|
1842
|
+
}
|
|
1843
|
+
/**
|
|
1844
|
+
* ConsumeCreditsRequest is the request to consume credits
|
|
1845
|
+
*/
|
|
1846
|
+
interface ConsumeCreditsRequest {
|
|
1847
|
+
orgId: string;
|
|
1848
|
+
amount: number;
|
|
1849
|
+
reason?: string;
|
|
1850
|
+
}
|
|
1851
|
+
/**
|
|
1852
|
+
* ConsumeCreditsResponse is the response from consuming credits
|
|
1853
|
+
*/
|
|
1854
|
+
interface ConsumeCreditsResponse {
|
|
1855
|
+
success: boolean;
|
|
1856
|
+
consumed: number;
|
|
1857
|
+
remaining: number;
|
|
1858
|
+
error?: string;
|
|
1859
|
+
}
|
|
1860
|
+
/**
|
|
1861
|
+
* GetPlansRequest is the request to get available plans
|
|
1862
|
+
*/
|
|
1863
|
+
interface GetPlansRequest {
|
|
1864
|
+
activeOnly: boolean;
|
|
1865
|
+
}
|
|
1866
|
+
/**
|
|
1867
|
+
* GetPlansResponse is the response with available plans
|
|
1868
|
+
*/
|
|
1869
|
+
interface GetPlansResponse {
|
|
1870
|
+
success: boolean;
|
|
1871
|
+
plans?: (Plan | undefined)[];
|
|
1872
|
+
error?: string;
|
|
1873
|
+
}
|
|
1874
|
+
/**
|
|
1875
|
+
* CreateAffiliateRequest is the request to create an affiliate
|
|
1876
|
+
*/
|
|
1877
|
+
interface CreateAffiliateRequest {
|
|
1878
|
+
name: string;
|
|
1879
|
+
email: string;
|
|
1880
|
+
country: string;
|
|
1881
|
+
commissionRate?: number;
|
|
1882
|
+
phone?: string;
|
|
1883
|
+
}
|
|
1884
|
+
/**
|
|
1885
|
+
* CreateAffiliateResponse is the response from creating an affiliate
|
|
1886
|
+
*/
|
|
1887
|
+
interface CreateAffiliateResponse {
|
|
1888
|
+
success: boolean;
|
|
1889
|
+
affiliate?: Affiliate;
|
|
1890
|
+
error?: string;
|
|
1891
|
+
}
|
|
1892
|
+
/**
|
|
1893
|
+
* GetAffiliateRequest is the request to get an affiliate
|
|
1894
|
+
*/
|
|
1895
|
+
interface GetAffiliateRequest {
|
|
1896
|
+
affiliateId?: string;
|
|
1897
|
+
referralCode?: string;
|
|
1898
|
+
}
|
|
1899
|
+
/**
|
|
1900
|
+
* GetAffiliateResponse is the response with affiliate info
|
|
1901
|
+
*/
|
|
1902
|
+
interface GetAffiliateResponse {
|
|
1903
|
+
success: boolean;
|
|
1904
|
+
affiliate?: Affiliate;
|
|
1905
|
+
error?: string;
|
|
1906
|
+
}
|
|
1907
|
+
/**
|
|
1908
|
+
* ListAffiliatesRequest is the request to list affiliates
|
|
1909
|
+
*/
|
|
1910
|
+
interface ListAffiliatesRequest {
|
|
1911
|
+
status?: string;
|
|
1912
|
+
page?: number;
|
|
1913
|
+
pageSize?: number;
|
|
1914
|
+
}
|
|
1915
|
+
/**
|
|
1916
|
+
* ListAffiliatesResponse is the response with affiliate list
|
|
1917
|
+
*/
|
|
1918
|
+
interface ListAffiliatesResponse {
|
|
1919
|
+
success: boolean;
|
|
1920
|
+
affiliates?: (Affiliate | undefined)[];
|
|
1921
|
+
total: number;
|
|
1922
|
+
page: number;
|
|
1923
|
+
pageSize: number;
|
|
1924
|
+
error?: string;
|
|
1925
|
+
}
|
|
1926
|
+
/**
|
|
1927
|
+
* CreateAffiliateOnboardingLinkRequest is the request to create an onboarding link
|
|
1928
|
+
*/
|
|
1929
|
+
interface CreateAffiliateOnboardingLinkRequest {
|
|
1930
|
+
affiliateId: string;
|
|
1931
|
+
refreshUrl: string;
|
|
1932
|
+
returnUrl: string;
|
|
1933
|
+
}
|
|
1934
|
+
/**
|
|
1935
|
+
* CreateAffiliateOnboardingLinkResponse is the response with onboarding link
|
|
1936
|
+
*/
|
|
1937
|
+
interface CreateAffiliateOnboardingLinkResponse {
|
|
1938
|
+
success: boolean;
|
|
1939
|
+
url?: string;
|
|
1940
|
+
error?: string;
|
|
1941
|
+
}
|
|
1942
|
+
/**
|
|
1943
|
+
* GetAffiliateCommissionsRequest is the request to get affiliate commissions
|
|
1944
|
+
*/
|
|
1945
|
+
interface GetAffiliateCommissionsRequest {
|
|
1946
|
+
affiliateId: string;
|
|
1947
|
+
startDate?: string;
|
|
1948
|
+
endDate?: string;
|
|
1949
|
+
status?: string;
|
|
1950
|
+
page?: number;
|
|
1951
|
+
pageSize?: number;
|
|
1952
|
+
}
|
|
1953
|
+
/**
|
|
1954
|
+
* GetAffiliateCommissionsResponse is the response with affiliate commissions
|
|
1955
|
+
*/
|
|
1956
|
+
interface GetAffiliateCommissionsResponse {
|
|
1957
|
+
success: boolean;
|
|
1958
|
+
commissions?: (AffiliateCommission | undefined)[];
|
|
1959
|
+
total: number;
|
|
1960
|
+
totalAmount: number;
|
|
1961
|
+
page: number;
|
|
1962
|
+
pageSize: number;
|
|
1963
|
+
error?: string;
|
|
1964
|
+
}
|
|
1965
|
+
/**
|
|
1966
|
+
* GetAffiliateAnalyticsRequest is the request to get affiliate analytics
|
|
1967
|
+
*/
|
|
1968
|
+
interface GetAffiliateAnalyticsRequest {
|
|
1969
|
+
affiliateId: string;
|
|
1970
|
+
period?: string;
|
|
1971
|
+
startDate?: string;
|
|
1972
|
+
endDate?: string;
|
|
1973
|
+
}
|
|
1974
|
+
/**
|
|
1975
|
+
* NATS Subjects for Stripe/Subscription operations
|
|
1976
|
+
*/
|
|
1977
|
+
declare const AffiliateAnalytics = "billing.affiliate.analytics";
|
|
1978
|
+
/**
|
|
1979
|
+
* AffiliateAnalytics represents affiliate analytics data
|
|
1980
|
+
*/
|
|
1981
|
+
interface AffiliateAnalytics {
|
|
1982
|
+
affiliateId: string;
|
|
1983
|
+
period: string;
|
|
1984
|
+
totalReferrals: number;
|
|
1985
|
+
activeReferrals: number;
|
|
1986
|
+
churnedReferrals: number;
|
|
1987
|
+
totalRevenueCents: number;
|
|
1988
|
+
totalCommissionsCents: number;
|
|
1989
|
+
conversionRate: number;
|
|
1990
|
+
avgCustomerLtvCents: number;
|
|
1991
|
+
}
|
|
1992
|
+
/**
|
|
1993
|
+
* GetAffiliateAnalyticsResponse is the response with affiliate analytics
|
|
1994
|
+
*/
|
|
1995
|
+
interface GetAffiliateAnalyticsResponse {
|
|
1996
|
+
success: boolean;
|
|
1997
|
+
analytics?: AffiliateAnalytics;
|
|
1998
|
+
error?: string;
|
|
1999
|
+
}
|
|
2000
|
+
/**
|
|
2001
|
+
* RevenueAnalyticsRequest is the request to get revenue analytics
|
|
2002
|
+
*/
|
|
2003
|
+
interface RevenueAnalyticsRequest {
|
|
2004
|
+
period?: string;
|
|
2005
|
+
startDate?: string;
|
|
2006
|
+
endDate?: string;
|
|
2007
|
+
}
|
|
2008
|
+
/**
|
|
2009
|
+
* RevenueAnalytics represents revenue analytics data
|
|
2010
|
+
*/
|
|
2011
|
+
interface RevenueAnalytics {
|
|
2012
|
+
period: string;
|
|
2013
|
+
mrrCents: number;
|
|
2014
|
+
arrCents: number;
|
|
2015
|
+
newMrrCents: number;
|
|
2016
|
+
churnedMrrCents: number;
|
|
2017
|
+
expansionMrrCents: number;
|
|
2018
|
+
contractionMrrCents: number;
|
|
2019
|
+
netMrrCents: number;
|
|
2020
|
+
totalCustomers: number;
|
|
2021
|
+
newCustomers: number;
|
|
2022
|
+
churnedCustomers: number;
|
|
2023
|
+
churnRate: number;
|
|
2024
|
+
}
|
|
2025
|
+
/**
|
|
2026
|
+
* RevenueAnalyticsResponse is the response with revenue analytics
|
|
2027
|
+
*/
|
|
2028
|
+
interface RevenueAnalyticsResponse {
|
|
2029
|
+
success: boolean;
|
|
2030
|
+
analytics?: RevenueAnalytics;
|
|
2031
|
+
error?: string;
|
|
2032
|
+
}
|
|
2033
|
+
/**
|
|
2034
|
+
* Webhook event types
|
|
2035
|
+
*/
|
|
2036
|
+
interface StripeWebhookEvent {
|
|
2037
|
+
type: string;
|
|
2038
|
+
data: {
|
|
2039
|
+
[key: string]: any;
|
|
2040
|
+
};
|
|
2041
|
+
eventId: string;
|
|
2042
|
+
createdAt: string;
|
|
2043
|
+
}
|
|
2044
|
+
/**
|
|
2045
|
+
* Base subject prefix
|
|
2046
|
+
*/
|
|
2047
|
+
declare const BillingSubjectPrefix = "billing";
|
|
2048
|
+
/**
|
|
2049
|
+
* Event recording subjects
|
|
2050
|
+
*/
|
|
2051
|
+
declare const BillingEventsRecord = "billing.events.record";
|
|
2052
|
+
/**
|
|
2053
|
+
* Usage reporting subjects
|
|
2054
|
+
*/
|
|
2055
|
+
declare const BillingUsageReport = "billing.usage.report";
|
|
2056
|
+
declare const BillingUsageCurrent = "billing.usage.current";
|
|
2057
|
+
declare const BillingUsageHistory = "billing.usage.history";
|
|
2058
|
+
declare const BillingUsageCostBreakdown = "billing.usage.breakdown";
|
|
2059
|
+
declare const BillingUsageTopCenters = "billing.usage.top_centers";
|
|
2060
|
+
/**
|
|
2061
|
+
* Invoice subjects
|
|
2062
|
+
*/
|
|
2063
|
+
declare const BillingInvoiceGet = "billing.invoice.get";
|
|
2064
|
+
declare const BillingInvoiceCreate = "billing.invoice.create";
|
|
2065
|
+
declare const BillingInvoiceProcess = "billing.invoice.process";
|
|
2066
|
+
/**
|
|
2067
|
+
* Billing period subjects
|
|
2068
|
+
*/
|
|
2069
|
+
declare const BillingPeriodCreate = "billing.period.create";
|
|
2070
|
+
declare const BillingPeriodClose = "billing.period.close";
|
|
2071
|
+
declare const BillingPeriodProcess = "billing.period.process";
|
|
2072
|
+
/**
|
|
2073
|
+
* Billing rules subjects
|
|
2074
|
+
*/
|
|
2075
|
+
declare const BillingRulesGet = "billing.rules.get";
|
|
2076
|
+
declare const BillingRulesCreate = "billing.rules.create";
|
|
2077
|
+
declare const BillingRulesUpdate = "billing.rules.update";
|
|
2078
|
+
declare const BillingRulesDelete = "billing.rules.delete";
|
|
2079
|
+
/**
|
|
2080
|
+
* Organization provisioning
|
|
2081
|
+
*/
|
|
2082
|
+
declare const BillingOrgProvision = "billing.org.provision";
|
|
2083
|
+
/**
|
|
2084
|
+
* Health check
|
|
2085
|
+
*/
|
|
2086
|
+
declare const BillingHealthCheck = "billing.health.check";
|
|
2087
|
+
|
|
2088
|
+
interface KGNode {
|
|
2089
|
+
id: string;
|
|
2090
|
+
label: string;
|
|
2091
|
+
fields: {
|
|
2092
|
+
[key: string]: any;
|
|
2093
|
+
};
|
|
2094
|
+
relationships?: KGEdge[];
|
|
2095
|
+
score?: number;
|
|
2096
|
+
}
|
|
2097
|
+
interface KGEdge {
|
|
2098
|
+
id: string;
|
|
2099
|
+
label: string;
|
|
2100
|
+
fields: {
|
|
2101
|
+
[key: string]: any;
|
|
2102
|
+
};
|
|
2103
|
+
from: string;
|
|
2104
|
+
to: string;
|
|
2105
|
+
}
|
|
2106
|
+
|
|
2107
|
+
interface DocumentMetadata {
|
|
2108
|
+
doc_id: string;
|
|
2109
|
+
title: string;
|
|
2110
|
+
doc_url: string;
|
|
2111
|
+
total_chunks: number;
|
|
2112
|
+
page_count: number;
|
|
2113
|
+
from_page: number;
|
|
2114
|
+
to_page: number;
|
|
2115
|
+
status: string;
|
|
2116
|
+
model: string;
|
|
2117
|
+
owner_email: string;
|
|
2118
|
+
visibility_level: string;
|
|
2119
|
+
created_at: string;
|
|
2120
|
+
updated_at: string;
|
|
2121
|
+
}
|
|
2122
|
+
interface DocumentAnalysisResult {
|
|
2123
|
+
docId: string;
|
|
2124
|
+
success: boolean;
|
|
2125
|
+
message: string;
|
|
2126
|
+
metadata: DocumentMetadata;
|
|
2127
|
+
totalChunks: number;
|
|
2128
|
+
successCount: number;
|
|
2129
|
+
errorCount: number;
|
|
2130
|
+
status: string;
|
|
2131
|
+
}
|
|
2132
|
+
|
|
2133
|
+
type IntegrationProvider = string;
|
|
2134
|
+
declare const IntegrationProviderGoogle: IntegrationProvider;
|
|
2135
|
+
declare const IntegrationProviderMicrosoft: IntegrationProvider;
|
|
2136
|
+
type IntegrationProviderTS = "google" | "microsoft";
|
|
2137
|
+
type IntegrationType = string;
|
|
2138
|
+
declare const IntegrationTypeEmail: IntegrationType;
|
|
2139
|
+
declare const IntegrationTypeCalendar: IntegrationType;
|
|
2140
|
+
declare const IntegrationTypeDrive: IntegrationType;
|
|
2141
|
+
type IntegrationTypeTS = "email" | "calendar" | "drive";
|
|
2142
|
+
type IntegrationStatus = string;
|
|
2143
|
+
declare const IntegrationStatusActive: IntegrationStatus;
|
|
2144
|
+
declare const IntegrationStatusExpired: IntegrationStatus;
|
|
2145
|
+
declare const IntegrationStatusRevoked: IntegrationStatus;
|
|
2146
|
+
declare const IntegrationStatusError: IntegrationStatus;
|
|
2147
|
+
type IntegrationStatusTS = "active" | "expired" | "revoked" | "error";
|
|
2148
|
+
type IntegrationMode = string;
|
|
2149
|
+
declare const IntegrationModeServicePrincipal: IntegrationMode;
|
|
2150
|
+
declare const IntegrationModeDomainDelegation: IntegrationMode;
|
|
2151
|
+
interface UserIntegration {
|
|
2152
|
+
id: string;
|
|
2153
|
+
org_id: string;
|
|
2154
|
+
user_id: string;
|
|
2155
|
+
provider: IntegrationProvider;
|
|
2156
|
+
integration_type: IntegrationType;
|
|
2157
|
+
account_email: string;
|
|
2158
|
+
account_name?: string;
|
|
2159
|
+
status: IntegrationStatus;
|
|
2160
|
+
scopes: string[];
|
|
2161
|
+
triage_enabled: boolean;
|
|
2162
|
+
last_used_at?: string;
|
|
2163
|
+
last_error?: string;
|
|
2164
|
+
created_at: string;
|
|
2165
|
+
updated_at: string;
|
|
2166
|
+
expires_at?: string;
|
|
2167
|
+
}
|
|
2168
|
+
interface TokenData {
|
|
2169
|
+
access_token: string;
|
|
2170
|
+
refresh_token: string;
|
|
2171
|
+
token_type: string;
|
|
2172
|
+
expires_at: string;
|
|
2173
|
+
scopes: string[];
|
|
2174
|
+
}
|
|
2175
|
+
interface OrgIntegration {
|
|
2176
|
+
id: string;
|
|
2177
|
+
org_id: string;
|
|
2178
|
+
provider: IntegrationProvider;
|
|
2179
|
+
integration_type: IntegrationType;
|
|
2180
|
+
mode: IntegrationMode;
|
|
2181
|
+
domain?: string;
|
|
2182
|
+
enabled: boolean;
|
|
2183
|
+
config?: Record<string, unknown>;
|
|
2184
|
+
scopes: string[];
|
|
2185
|
+
created_by: string;
|
|
2186
|
+
created_at: string;
|
|
2187
|
+
updated_at: string;
|
|
2188
|
+
}
|
|
2189
|
+
interface ListUserIntegrationsRequest {
|
|
2190
|
+
org_id: string;
|
|
2191
|
+
user_id: string;
|
|
2192
|
+
}
|
|
2193
|
+
interface ListUserIntegrationsResponse {
|
|
2194
|
+
integrations: UserIntegration[];
|
|
2195
|
+
total: number;
|
|
2196
|
+
metadata: ResponseMetadata;
|
|
2197
|
+
}
|
|
2198
|
+
interface GetUserIntegrationRequest {
|
|
2199
|
+
org_id: string;
|
|
2200
|
+
user_id: string;
|
|
2201
|
+
provider: IntegrationProvider;
|
|
2202
|
+
integration_type: IntegrationType;
|
|
2203
|
+
}
|
|
2204
|
+
interface GetUserIntegrationResponse {
|
|
2205
|
+
integration?: UserIntegration;
|
|
2206
|
+
metadata: ResponseMetadata;
|
|
2207
|
+
}
|
|
2208
|
+
interface ConnectIntegrationRequest {
|
|
2209
|
+
org_id: string;
|
|
2210
|
+
user_id: string;
|
|
2211
|
+
provider: IntegrationProvider;
|
|
2212
|
+
integration_type: IntegrationType;
|
|
2213
|
+
redirect_uri: string;
|
|
2214
|
+
}
|
|
2215
|
+
interface ConnectIntegrationResponse {
|
|
2216
|
+
auth_url: string;
|
|
2217
|
+
state: string;
|
|
2218
|
+
metadata: ResponseMetadata;
|
|
2219
|
+
}
|
|
2220
|
+
interface IntegrationCallbackRequest {
|
|
2221
|
+
org_id: string;
|
|
2222
|
+
user_id: string;
|
|
2223
|
+
state: string;
|
|
2224
|
+
code: string;
|
|
2225
|
+
error?: string;
|
|
2226
|
+
}
|
|
2227
|
+
interface IntegrationCallbackResponse {
|
|
2228
|
+
integration?: UserIntegration;
|
|
2229
|
+
metadata: ResponseMetadata;
|
|
2230
|
+
}
|
|
2231
|
+
interface DisconnectIntegrationRequest {
|
|
2232
|
+
org_id: string;
|
|
2233
|
+
user_id: string;
|
|
2234
|
+
provider: IntegrationProvider;
|
|
2235
|
+
integration_type: IntegrationType;
|
|
2236
|
+
}
|
|
2237
|
+
interface DisconnectIntegrationResponse {
|
|
2238
|
+
metadata: ResponseMetadata;
|
|
2239
|
+
}
|
|
2240
|
+
interface RefreshIntegrationRequest {
|
|
2241
|
+
org_id: string;
|
|
2242
|
+
user_id: string;
|
|
2243
|
+
provider: IntegrationProvider;
|
|
2244
|
+
integration_type: IntegrationType;
|
|
2245
|
+
}
|
|
2246
|
+
interface RefreshIntegrationResponse {
|
|
2247
|
+
integration?: UserIntegration;
|
|
2248
|
+
metadata: ResponseMetadata;
|
|
2249
|
+
}
|
|
2250
|
+
interface UpdateTriageEnabledRequest {
|
|
2251
|
+
org_id: string;
|
|
2252
|
+
user_id: string;
|
|
2253
|
+
provider: IntegrationProvider;
|
|
2254
|
+
integration_type: IntegrationType;
|
|
2255
|
+
triage_enabled: boolean;
|
|
2256
|
+
}
|
|
2257
|
+
interface UpdateTriageEnabledResponse {
|
|
2258
|
+
integration?: UserIntegration;
|
|
2259
|
+
metadata: ResponseMetadata;
|
|
2260
|
+
}
|
|
2261
|
+
interface ListOrgIntegrationsRequest {
|
|
2262
|
+
org_id: string;
|
|
2263
|
+
}
|
|
2264
|
+
interface ListOrgIntegrationsResponse {
|
|
2265
|
+
integrations: OrgIntegration[];
|
|
2266
|
+
total: number;
|
|
2267
|
+
metadata: ResponseMetadata;
|
|
2268
|
+
}
|
|
2269
|
+
interface SearchEmailsRequest {
|
|
2270
|
+
org_id: string;
|
|
2271
|
+
user_id: string;
|
|
2272
|
+
query: string;
|
|
2273
|
+
from?: string;
|
|
2274
|
+
to?: string;
|
|
2275
|
+
subject?: string;
|
|
2276
|
+
date_range?: string;
|
|
2277
|
+
limit?: number;
|
|
2278
|
+
}
|
|
2279
|
+
interface SearchEmailsResponse {
|
|
2280
|
+
emails: EmailSummary[];
|
|
2281
|
+
total: number;
|
|
2282
|
+
metadata: ResponseMetadata;
|
|
2283
|
+
}
|
|
2284
|
+
interface EmailSummary {
|
|
2285
|
+
id: string;
|
|
2286
|
+
thread_id?: string;
|
|
2287
|
+
from: string;
|
|
2288
|
+
from_name?: string;
|
|
2289
|
+
to: string[];
|
|
2290
|
+
cc?: string[];
|
|
2291
|
+
subject: string;
|
|
2292
|
+
snippet: string;
|
|
2293
|
+
date: string;
|
|
2294
|
+
has_attachments: boolean;
|
|
2295
|
+
is_read: boolean;
|
|
2296
|
+
labels?: string[];
|
|
2297
|
+
web_link?: string;
|
|
2298
|
+
provider?: IntegrationProviderTS;
|
|
2299
|
+
}
|
|
2300
|
+
interface GetEmailRequest {
|
|
2301
|
+
org_id: string;
|
|
2302
|
+
user_id: string;
|
|
2303
|
+
email_id: string;
|
|
2304
|
+
include_attachments?: boolean;
|
|
2305
|
+
}
|
|
2306
|
+
interface GetEmailResponse {
|
|
2307
|
+
email?: EmailDetails;
|
|
2308
|
+
metadata: ResponseMetadata;
|
|
2309
|
+
}
|
|
2310
|
+
interface EmailDetails {
|
|
2311
|
+
id: string;
|
|
2312
|
+
thread_id?: string;
|
|
2313
|
+
from: string;
|
|
2314
|
+
from_name?: string;
|
|
2315
|
+
to: string[];
|
|
2316
|
+
cc?: string[];
|
|
2317
|
+
bcc?: string[];
|
|
2318
|
+
subject: string;
|
|
2319
|
+
body: string;
|
|
2320
|
+
body_html?: string;
|
|
2321
|
+
date: string;
|
|
2322
|
+
attachments?: EmailAttachment[];
|
|
2323
|
+
labels?: string[];
|
|
2324
|
+
is_read: boolean;
|
|
2325
|
+
web_link?: string;
|
|
2326
|
+
provider?: IntegrationProviderTS;
|
|
2327
|
+
}
|
|
2328
|
+
interface EmailAttachment {
|
|
2329
|
+
id: string;
|
|
2330
|
+
filename: string;
|
|
2331
|
+
mime_type: string;
|
|
2332
|
+
size: number;
|
|
2333
|
+
}
|
|
2334
|
+
interface GetEmailThreadRequest {
|
|
2335
|
+
org_id: string;
|
|
2336
|
+
user_id: string;
|
|
2337
|
+
thread_id: string;
|
|
2338
|
+
}
|
|
2339
|
+
interface GetEmailThreadResponse {
|
|
2340
|
+
thread: EmailDetails[];
|
|
2341
|
+
metadata: ResponseMetadata;
|
|
2342
|
+
}
|
|
2343
|
+
interface ListCalendarEventsRequest {
|
|
2344
|
+
org_id: string;
|
|
2345
|
+
user_id: string;
|
|
2346
|
+
query?: string;
|
|
2347
|
+
date_range?: string;
|
|
2348
|
+
start_date?: string;
|
|
2349
|
+
end_date?: string;
|
|
2350
|
+
limit?: number;
|
|
2351
|
+
}
|
|
2352
|
+
interface ListCalendarEventsResponse {
|
|
2353
|
+
events: CalendarEvent[];
|
|
2354
|
+
total: number;
|
|
2355
|
+
metadata: ResponseMetadata;
|
|
2356
|
+
}
|
|
2357
|
+
interface CalendarEvent {
|
|
2358
|
+
id: string;
|
|
2359
|
+
title: string;
|
|
2360
|
+
description?: string;
|
|
2361
|
+
location?: string;
|
|
2362
|
+
start: string;
|
|
2363
|
+
end: string;
|
|
2364
|
+
is_all_day: boolean;
|
|
2365
|
+
organizer?: string;
|
|
2366
|
+
organizer_name?: string;
|
|
2367
|
+
attendees?: EventAttendee[];
|
|
2368
|
+
status?: string;
|
|
2369
|
+
response_status?: string;
|
|
2370
|
+
recurrence_rule?: string;
|
|
2371
|
+
conference_url?: string;
|
|
2372
|
+
calendar_id?: string;
|
|
2373
|
+
}
|
|
2374
|
+
interface EventAttendee {
|
|
2375
|
+
email: string;
|
|
2376
|
+
name?: string;
|
|
2377
|
+
response_status?: string;
|
|
2378
|
+
is_organizer?: boolean;
|
|
2379
|
+
}
|
|
2380
|
+
interface GetCalendarEventRequest {
|
|
2381
|
+
org_id: string;
|
|
2382
|
+
user_id: string;
|
|
2383
|
+
event_id: string;
|
|
2384
|
+
}
|
|
2385
|
+
interface GetCalendarEventResponse {
|
|
2386
|
+
event?: CalendarEvent;
|
|
2387
|
+
metadata: ResponseMetadata;
|
|
2388
|
+
}
|
|
2389
|
+
interface FileSummary {
|
|
2390
|
+
id: string;
|
|
2391
|
+
name: string;
|
|
2392
|
+
mime_type: string;
|
|
2393
|
+
size: number;
|
|
2394
|
+
modified_time: string;
|
|
2395
|
+
created_time?: string;
|
|
2396
|
+
owner?: string;
|
|
2397
|
+
owner_email?: string;
|
|
2398
|
+
web_link?: string;
|
|
2399
|
+
icon_link?: string;
|
|
2400
|
+
thumbnail_link?: string;
|
|
2401
|
+
is_folder: boolean;
|
|
2402
|
+
parent_id?: string;
|
|
2403
|
+
provider?: IntegrationProviderTS;
|
|
2404
|
+
}
|
|
2405
|
+
interface FileDetails {
|
|
2406
|
+
id: string;
|
|
2407
|
+
name: string;
|
|
2408
|
+
mime_type: string;
|
|
2409
|
+
size: number;
|
|
2410
|
+
modified_time: string;
|
|
2411
|
+
created_time?: string;
|
|
2412
|
+
owner?: string;
|
|
2413
|
+
owner_email?: string;
|
|
2414
|
+
description?: string;
|
|
2415
|
+
web_link?: string;
|
|
2416
|
+
download_link?: string;
|
|
2417
|
+
icon_link?: string;
|
|
2418
|
+
thumbnail_link?: string;
|
|
2419
|
+
is_folder: boolean;
|
|
2420
|
+
parent_id?: string;
|
|
2421
|
+
parent_name?: string;
|
|
2422
|
+
shared_with?: FilePermission[];
|
|
2423
|
+
provider?: IntegrationProviderTS;
|
|
2424
|
+
}
|
|
2425
|
+
interface FilePermission {
|
|
2426
|
+
email: string;
|
|
2427
|
+
name?: string;
|
|
2428
|
+
role: string;
|
|
2429
|
+
}
|
|
2430
|
+
interface DateFilter {
|
|
2431
|
+
from?: string;
|
|
2432
|
+
to?: string;
|
|
2433
|
+
}
|
|
2434
|
+
interface TaskMetrics {
|
|
2435
|
+
total_tasks: number;
|
|
2436
|
+
ai_used_count: number;
|
|
2437
|
+
autonomy_assist: number;
|
|
2438
|
+
autonomy_coedit: number;
|
|
2439
|
+
autonomy_autonomous: number;
|
|
2440
|
+
contained_count: number;
|
|
2441
|
+
escalated_count: number;
|
|
2442
|
+
reopened_count: number;
|
|
2443
|
+
avg_duration_s: number;
|
|
2444
|
+
total_input_tokens: number;
|
|
2445
|
+
total_output_tokens: number;
|
|
2446
|
+
total_tool_calls: number;
|
|
2447
|
+
total_cost_usd: number;
|
|
2448
|
+
avg_quality_score?: number;
|
|
2449
|
+
avg_csat_score?: number;
|
|
2450
|
+
}
|
|
2451
|
+
interface EmployeeExperienceChat {
|
|
2452
|
+
chat_id: string;
|
|
2453
|
+
chat_title: string;
|
|
2454
|
+
employee_id: string;
|
|
2455
|
+
start_time: string;
|
|
2456
|
+
end_time: string;
|
|
2457
|
+
status: string;
|
|
2458
|
+
category: string;
|
|
2459
|
+
department: string;
|
|
2460
|
+
summary: string;
|
|
2461
|
+
satisfaction_score: number;
|
|
2462
|
+
device: Record<string, unknown>;
|
|
2463
|
+
employee: Record<string, unknown>;
|
|
2464
|
+
message_count: number;
|
|
2465
|
+
total_tokens: number;
|
|
2466
|
+
avg_response_time: number;
|
|
2467
|
+
input_tokens: number;
|
|
2468
|
+
output_tokens: number;
|
|
2469
|
+
ticket_created: boolean;
|
|
2470
|
+
ticket_id?: string;
|
|
2471
|
+
resolution_type: string;
|
|
2472
|
+
}
|
|
2473
|
+
interface ChatMetricsResponse {
|
|
2474
|
+
success: boolean;
|
|
2475
|
+
data?: EmployeeExperienceChat[];
|
|
2476
|
+
error?: string;
|
|
2477
|
+
}
|
|
2478
|
+
interface AnalyticsRequest {
|
|
2479
|
+
org_id: string;
|
|
2480
|
+
date_filter: DateFilter;
|
|
2481
|
+
chat_id?: string;
|
|
2482
|
+
department?: string;
|
|
2483
|
+
employee_id?: string;
|
|
2484
|
+
ticket_id?: string;
|
|
2485
|
+
}
|
|
2486
|
+
interface AnalyticsResponse {
|
|
2487
|
+
success: boolean;
|
|
2488
|
+
data?: unknown;
|
|
2489
|
+
error?: string;
|
|
2490
|
+
}
|
|
2491
|
+
interface OrgSettings {
|
|
2492
|
+
id: string;
|
|
2493
|
+
org_id: string;
|
|
2494
|
+
title: string;
|
|
2495
|
+
description: string;
|
|
2496
|
+
logo_url: string;
|
|
2497
|
+
default_lang: string;
|
|
2498
|
+
timezone: string;
|
|
2499
|
+
additional_settings: Record<string, unknown>;
|
|
2500
|
+
created_at: string;
|
|
2501
|
+
updated_at: string;
|
|
2502
|
+
created_by: string;
|
|
2503
|
+
updated_by: string;
|
|
2504
|
+
}
|
|
2505
|
+
interface OrgSettingsRequest {
|
|
2506
|
+
org_id: string;
|
|
2507
|
+
settings?: OrgSettings;
|
|
2508
|
+
}
|
|
2509
|
+
interface OrgSettingsResponse {
|
|
2510
|
+
success: boolean;
|
|
2511
|
+
settings?: OrgSettings;
|
|
2512
|
+
error?: string;
|
|
2513
|
+
}
|
|
2514
|
+
interface ServiceDeskAdmin {
|
|
2515
|
+
id: string;
|
|
2516
|
+
name: string;
|
|
2517
|
+
email: string;
|
|
2518
|
+
department: string;
|
|
2519
|
+
role: string;
|
|
2520
|
+
assignedBy: string;
|
|
2521
|
+
assignedAt: string;
|
|
2522
|
+
customFields?: Record<string, unknown>;
|
|
2523
|
+
}
|
|
2524
|
+
interface ListServiceDeskAdminsRequest {
|
|
2525
|
+
orgId: string;
|
|
2526
|
+
department?: string;
|
|
2527
|
+
}
|
|
2528
|
+
interface ListServiceDeskAdminsResponse {
|
|
2529
|
+
admins: ServiceDeskAdmin[];
|
|
2530
|
+
metadata: ResponseMetadata;
|
|
2531
|
+
}
|
|
2532
|
+
interface RunEmailTriageRequest {
|
|
2533
|
+
org_id: string;
|
|
2534
|
+
user_id: string;
|
|
2535
|
+
}
|
|
2536
|
+
interface RunEmailTriageResponse {
|
|
2537
|
+
success: boolean;
|
|
2538
|
+
emails_found: number;
|
|
2539
|
+
instances_created: number;
|
|
2540
|
+
message: string;
|
|
2541
|
+
metadata: {
|
|
2542
|
+
success: boolean;
|
|
2543
|
+
error?: string;
|
|
2544
|
+
};
|
|
2545
|
+
}
|
|
2546
|
+
declare const HubSubjects: {
|
|
2547
|
+
readonly userList: "hub.integrations.user.list";
|
|
2548
|
+
readonly userGet: "hub.integrations.user.get";
|
|
2549
|
+
readonly userConnect: "hub.integrations.user.connect";
|
|
2550
|
+
readonly userCallback: "hub.integrations.user.callback";
|
|
2551
|
+
readonly userDisconnect: "hub.integrations.user.disconnect";
|
|
2552
|
+
readonly userRefresh: "hub.integrations.user.refresh";
|
|
2553
|
+
readonly userUpdateTriage: "hub.integrations.user.triage.update";
|
|
2554
|
+
readonly emailTriageRun: "hub.email.triage.run";
|
|
2555
|
+
readonly orgList: "hub.integrations.org.list";
|
|
2556
|
+
readonly orgConfigure: "hub.integrations.org.configure";
|
|
2557
|
+
readonly orgDisable: "hub.integrations.org.disable";
|
|
2558
|
+
readonly emailSearch: "hub.integrations.email.search";
|
|
2559
|
+
readonly emailGet: "hub.integrations.email.get";
|
|
2560
|
+
readonly emailThread: "hub.integrations.email.thread";
|
|
2561
|
+
readonly calendarList: "hub.integrations.calendar.list";
|
|
2562
|
+
readonly calendarGet: "hub.integrations.calendar.get";
|
|
2563
|
+
readonly driveSearch: "hub.integrations.drive.search";
|
|
2564
|
+
readonly driveGet: "hub.integrations.drive.get";
|
|
2565
|
+
readonly orgSettingsGet: "hub.org-settings.get";
|
|
2566
|
+
readonly orgSettingsCreate: "hub.org-settings.create";
|
|
2567
|
+
readonly orgSettingsUpdate: "hub.org-settings.update";
|
|
2568
|
+
readonly featureFlagsCheck: "hub.feature-flags.check";
|
|
2569
|
+
};
|
|
2570
|
+
interface OnboardingGuideStep {
|
|
2571
|
+
id: string;
|
|
2572
|
+
title: string;
|
|
2573
|
+
subtitle: string;
|
|
2574
|
+
description: string;
|
|
2575
|
+
instructions: string;
|
|
2576
|
+
user_action: string;
|
|
2577
|
+
details: unknown;
|
|
2578
|
+
}
|
|
2579
|
+
interface BoardSummary {
|
|
2580
|
+
id: string;
|
|
2581
|
+
title: string;
|
|
2582
|
+
boardType: string;
|
|
2583
|
+
createdAt: string;
|
|
2584
|
+
updatedAt?: string;
|
|
2585
|
+
description?: string;
|
|
2586
|
+
}
|
|
2587
|
+
interface BoardDetails extends BoardSummary {
|
|
2588
|
+
content?: unknown;
|
|
2589
|
+
contentRef?: string;
|
|
2590
|
+
elementCount?: number;
|
|
2591
|
+
}
|
|
2592
|
+
interface MarkdownDocumentSummary {
|
|
2593
|
+
id: string;
|
|
2594
|
+
filename: string;
|
|
2595
|
+
title: string;
|
|
2596
|
+
createdAt: string;
|
|
2597
|
+
}
|
|
2598
|
+
interface MarkdownDocumentDetails extends MarkdownDocumentSummary {
|
|
2599
|
+
content: string;
|
|
2600
|
+
size?: number;
|
|
2601
|
+
}
|
|
2602
|
+
interface AddFieldRequest {
|
|
2603
|
+
orgId: string;
|
|
2604
|
+
department: string;
|
|
2605
|
+
fieldName: string;
|
|
2606
|
+
displayName: string;
|
|
2607
|
+
fieldType: string;
|
|
2608
|
+
required?: boolean;
|
|
2609
|
+
description?: string;
|
|
2610
|
+
}
|
|
2611
|
+
interface AddFieldResponse {
|
|
2612
|
+
fieldName: string;
|
|
2613
|
+
metadata: ResponseMetadata;
|
|
2614
|
+
}
|
|
2615
|
+
interface DeleteFieldRequest {
|
|
2616
|
+
orgId: string;
|
|
2617
|
+
fieldName: string;
|
|
2618
|
+
}
|
|
2619
|
+
interface DeleteFieldResponse {
|
|
2620
|
+
fieldName: string;
|
|
2621
|
+
metadata: ResponseMetadata;
|
|
1061
2622
|
}
|
|
1062
2623
|
|
|
1063
|
-
export { type APIError, type APIResponse, type Address, AdminOrgCreate, AdminOrgCreated, AdminOrgDelete, AdminOrgGet, AdminOrgGetByDomain, AdminOrgGetInfo, AdminOrgList, AdminOrgListByMetadata, AdminOrgRolesCreate, AdminOrgRolesDelete, AdminOrgRolesGet, AdminOrgRolesUpdate, AdminOrgUpdate, AdminTeamsCreate, AdminTeamsGetForOrg, AdminTeamsGetOne, AdminTeamsUpdateOnboarding, AdminUsersCreate, AdminUsersDelete, AdminUsersGet, AdminUsersGetForOrg, AdminUsersGetOne, AdminUsersGetOneByEmail, AdminUsersGetSettings, AdminUsersUpdate, AdminUsersUpdateSettings, type AgentInfo, type AgentInput, type AgentResult, type AggregateType, AggregateTypeAverage, AggregateTypeCount, AggregateTypeDistinct, AggregateTypeMax, AggregateTypeMin, AggregateTypeSum, type AzureSettings, type ChartSettings, type ChartType, ChartTypeBar, ChartTypeDoughnut, ChartTypeLine, ChartTypeMetic, ChartTypePie, type DataType, DataTypeArray, DataTypeBoolean, DataTypeDate, DataTypeFile, DataTypeFloat, DataTypeInputFields, DataTypeInt, DataTypeJSON, DataTypeObjectList, DataTypeString, type DateValue, type DocumentAnalysisResult, type DocumentMetadata, type Invite, type InviteInput, type InviteResponse, type InviteSentStatus, type InviteStatus, InviteStatusAccepted, InviteStatusExpired, type InviteStatusOptionTS, InviteStatusPending, InviteStatusRevoked, type InviteStatusTS, InviteStatuses, type InvitesResult, type JSONSchema, type KGEdge, type KGNode, type KnowledgeGraphInfo, type KnowledgeInput, type KnowledgeResult, type ListInvitesResponse, type ListOrgRolesResponse, type ListOrgsResponse, type ListUsersResponse, type MetricResult, type NotificationPreferences, type OnboardingCompleteResult, type OnboardingState, type OnboardingStateResponse, type OnboardingStatus, OnboardingStatusCompleted, OnboardingStatusInProgress, OnboardingStatusLegacy, type OnboardingStatusOptionTS, OnboardingStatusPending, OnboardingStatusSkipped, type OnboardingStatusTS, OnboardingStatuses, type OnboardingStep, type Org, type OrgInfo, type OrgInfoResponse, type OrgInput, type OrgOnboarding, type OrgProvisioning, type OrgResponse, type OrgResult, type OrgRole, type OrgRoleResponse, type OrgSize, OrgSizeEnterprise, OrgSizeLarge, OrgSizeMedium, type OrgSizeOptionTS, OrgSizeSmall, OrgSizeSolo, type OrgSizeTS, OrgSizes, type OrgStatus, OrgStatusActive, type OrgStatusOptionTS, OrgStatusSuspended, type OrgStatusTS, OrgStatuses, type OrgSubscription, type OrgSubscriptionStatus, OrgSubscriptionStatusActive, OrgSubscriptionStatusCancelled, type OrgSubscriptionStatusOptionTS, OrgSubscriptionStatusPastDue, type OrgSubscriptionStatusTS, OrgSubscriptionStatusTrialing, OrgSubscriptionStatusUnpaid, OrgSubscriptionStatuses, type OrgTemplate, type OrgType, OrgTypeEnterprise, type OrgTypeOptionTS, OrgTypeSelfServe, type OrgTypeTS, OrgTypes, type PaymentSessionInput, type PaymentSessionResult, type Permission, type ProductName, ProductNameDocBrain, ProductNameDoneProjects, ProductNameFinance, ProductNameHub, ProductNameLegal, type ProductNameOptionTS, ProductNamePublicSector, ProductNameQuickMind, ProductNameRealEstate, ProductNameShopAssist, type ProductNameTS, ProductNames, type ProvisioningStatus, ProvisioningStatusCompleted, ProvisioningStatusFailed, type ProvisioningStatusOptionTS, ProvisioningStatusPending, ProvisioningStatusRunning, type ProvisioningStatusTS, ProvisioningStatuses, type ResponseMetadata, type ServiceEvent, type ServiceEventMetadata, type SubscriptionPlatform, SubscriptionPlatformCustom, SubscriptionPlatformStripe, type SystemApp, SystemAppAdmin, SystemAppAnalytics, SystemAppCRM, SystemAppDocumentProcessor, SystemAppHelpdesk, SystemAppKnowledgeGraph, SystemAppMarketing, type SystemAppOptionTS, type SystemAppTS, SystemAppWorkflow, SystemApps, type Team, type ThemeOptionTS, ThemeOptions, type UpdateUserSettingsRequest, type UpdateUserStatusRequest, type UpdateUserStatusResponse, UpdateUserStatusSubject, type User, type UserOnboarding, type UserOrgAccess, type UserResponse, type UserSettings, type UserSettingsResponse, type UserSource, UserSourceAPI, UserSourceInvite, type UserSourceOptionTS, UserSourceSSO, UserSourceSignup, type UserSourceTS, UserSources, type UserStatusTS, type Variable, type VariableReference, type VariableScope, VariableScopeEdge, VariableScopeGlobal, VariableScopeNode, type VariableValidation, type Widget, type WidgetType, WidgetTypeAccounts, WidgetTypeActivities, WidgetTypeCalendar, WidgetTypeChart, WidgetTypeContacts, WidgetTypeEmail, WidgetTypeFiles, WidgetTypeLeads, WidgetTypeNotes, WidgetTypeOpportunities, WidgetTypeOrders, WidgetTypeTasks, type WorkspaceInput, type WorkspaceResult };
|
|
2624
|
+
export { type APIError, type APIResponse, type AddFieldRequest, type AddFieldResponse, type Address, AdminOrgCreate, AdminOrgCreated, AdminOrgDelete, AdminOrgGet, AdminOrgGetByDomain, AdminOrgGetInfo, AdminOrgList, AdminOrgListByMetadata, AdminOrgRolesCreate, AdminOrgRolesDelete, AdminOrgRolesGet, AdminOrgRolesUpdate, AdminOrgUpdate, AdminTeamsCreate, AdminTeamsGetForOrg, AdminTeamsGetOne, AdminTeamsUpdateOnboarding, AdminUsersCreate, AdminUsersDelete, AdminUsersGet, AdminUsersGetForOrg, AdminUsersGetOne, AdminUsersGetOneByEmail, AdminUsersGetSettings, AdminUsersUpdate, AdminUsersUpdateSettings, type Affiliate, AffiliateAnalytics, type AffiliateCommission, AffiliateCommissions, AffiliateCreate, AffiliateGet, AffiliateList, AffiliateOnboard, type AffiliateReferral, AffiliateUpdate, type AgentInfo, type AgentInput, type AgentResult, type AggregateType, AggregateTypeAverage, AggregateTypeCount, AggregateTypeDistinct, AggregateTypeMax, AggregateTypeMin, AggregateTypeSum, AnalyticsChurn, type AnalyticsRequest, type AnalyticsResponse, AnalyticsRevenue, AnalyticsUsage, type AzureSettings, type BillingEvent, type BillingEventRequest, type BillingEventResponse, BillingEventsRecord, BillingGetInvoice, BillingGetUsageReport, BillingHealthCheck, BillingInvoiceCreate, BillingInvoiceGet, BillingInvoiceProcess, BillingOrgProvision, type BillingPeriod, BillingPeriodClose, BillingPeriodCreate, BillingPeriodProcess, type BillingPeriodProcessRequest, type BillingPeriodProcessResponse, BillingProcessBillingPeriod, BillingRecordEvent, type BillingResponse, type BillingRule, type BillingRuleRequest, type BillingRuleResponse, BillingRulesCreate, BillingRulesDelete, BillingRulesGet, type BillingRulesRequest, type BillingRulesResponse, BillingRulesUpdate, BillingSubjectPrefix, BillingUsageCostBreakdown, BillingUsageCurrent, BillingUsageHistory, BillingUsageReport, BillingUsageTopCenters, type BoardDetails, type BoardSummary, type CalendarEvent, type CancelSubscriptionRequest, type CancelSubscriptionResponse, type ChartSettings, type ChartType, ChartTypeBar, ChartTypeDoughnut, ChartTypeLine, ChartTypeMetic, ChartTypePie, type ChatMetricsResponse, type ConnectIntegrationRequest, type ConnectIntegrationResponse, type ConsumeCreditsRequest, type ConsumeCreditsResponse, type CostBreakdown, type CostBreakdownRequest, type CostBreakdownResponse, type CostPreview, type CreateAffiliateOnboardingLinkRequest, type CreateAffiliateOnboardingLinkResponse, type CreateAffiliateRequest, type CreateAffiliateResponse, type CreateCheckoutSessionRequest, type CreateCheckoutSessionResponse, type CreatePaymentLinkRequest, type CreatePaymentLinkResponse, type CreatePortalSessionRequest, type CreatePortalSessionResponse, type CreditBalance, type CreditPackage, CreditsBalance, CreditsConsume, CreditsPurchase, type CurrentUsageRequest, type CurrentUsageResponse, CustomerCreate, CustomerGet, CustomerUpdate, type DataType, DataTypeArray, DataTypeBoolean, DataTypeDate, DataTypeFile, DataTypeFloat, DataTypeInputFields, DataTypeInt, DataTypeJSON, DataTypeObjectList, DataTypeString, type DateFilter, type DateValue, type DeleteFieldRequest, type DeleteFieldResponse, type DisconnectIntegrationRequest, type DisconnectIntegrationResponse, type DocumentAnalysisResult, type DocumentMetadata, type EmailAttachment, type EmailDetails, type EmailSummary, type EmployeeExperienceChat, type EventAttendee, type FileDetails, type FilePermission, type FileSummary, type GetAffiliateAnalyticsRequest, type GetAffiliateAnalyticsResponse, type GetAffiliateCommissionsRequest, type GetAffiliateCommissionsResponse, type GetAffiliateRequest, type GetAffiliateResponse, type GetCalendarEventRequest, type GetCalendarEventResponse, type GetCreditsRequest, type GetCreditsResponse, type GetEmailRequest, type GetEmailResponse, type GetEmailThreadRequest, type GetEmailThreadResponse, type GetPlansRequest, type GetPlansResponse, type GetSubscriptionRequest, type GetSubscriptionResponse, type GetUserIntegrationRequest, type GetUserIntegrationResponse, HubSubjects, type IntegrationCallbackRequest, type IntegrationCallbackResponse, type IntegrationMode, IntegrationModeDomainDelegation, IntegrationModeServicePrincipal, type IntegrationProvider, IntegrationProviderGoogle, IntegrationProviderMicrosoft, type IntegrationProviderTS, type IntegrationStatus, IntegrationStatusActive, IntegrationStatusError, IntegrationStatusExpired, IntegrationStatusRevoked, type IntegrationStatusTS, type IntegrationType, IntegrationTypeCalendar, IntegrationTypeDrive, IntegrationTypeEmail, type IntegrationTypeTS, type Invite, type InviteInput, type InviteResponse, type InviteSentStatus, type InviteStatus, InviteStatusAccepted, InviteStatusExpired, type InviteStatusOptionTS, InviteStatusPending, InviteStatusRevoked, type InviteStatusTS, InviteStatuses, type InvitesResult, type Invoice, type InvoiceLineItem, type InvoiceRequest, type InvoiceResponse, type JSONSchema, type KGEdge, type KGNode, type KnowledgeGraphInfo, type KnowledgeInput, type KnowledgeResult, type ListAffiliatesRequest, type ListAffiliatesResponse, type ListCalendarEventsRequest, type ListCalendarEventsResponse, type ListInvitesResponse, type ListOrgIntegrationsRequest, type ListOrgIntegrationsResponse, type ListOrgRolesResponse, type ListOrgsResponse, type ListServiceDeskAdminsRequest, type ListServiceDeskAdminsResponse, type ListUserIntegrationsRequest, type ListUserIntegrationsResponse, type ListUsersResponse, type MarkdownDocumentDetails, type MarkdownDocumentSummary, type MetricResult, type NotificationPreferences, type OnboardingCompleteResult, type OnboardingGuideStep, type OnboardingState, type OnboardingStateResponse, type OnboardingStatus, OnboardingStatusCompleted, OnboardingStatusInProgress, OnboardingStatusLegacy, type OnboardingStatusOptionTS, OnboardingStatusPending, OnboardingStatusSkipped, type OnboardingStatusTS, OnboardingStatuses, type OnboardingStep, type Org, type OrgInfo, type OrgInfoResponse, type OrgInput, type OrgIntegration, type OrgOnboarding, type OrgProvisioning, type OrgResponse, type OrgResult, type OrgRole, type OrgRoleResponse, type OrgSettings, type OrgSettingsRequest, type OrgSettingsResponse, type OrgSize, OrgSizeEnterprise, OrgSizeLarge, OrgSizeMedium, type OrgSizeOptionTS, OrgSizeSmall, OrgSizeSolo, type OrgSizeTS, OrgSizes, type OrgStatus, OrgStatusActive, type OrgStatusOptionTS, OrgStatusSuspended, type OrgStatusTS, OrgStatuses, type OrgSubscription, type OrgSubscriptionStatus, OrgSubscriptionStatusActive, OrgSubscriptionStatusCancelled, type OrgSubscriptionStatusOptionTS, OrgSubscriptionStatusPastDue, type OrgSubscriptionStatusTS, OrgSubscriptionStatusTrialing, OrgSubscriptionStatusUnpaid, OrgSubscriptionStatuses, type OrgTemplate, type OrgType, OrgTypeEnterprise, type OrgTypeOptionTS, OrgTypeSelfServe, type OrgTypeTS, OrgTypes, type OrganizationBilling, type Payment, PaymentLinkCreate, PaymentLinkList, type PaymentSessionInput, type PaymentSessionResult, type Permission, type Plan, PlansGet, PlansGetAll, PortalSessionCreate, type ProductName, ProductNameDocBrain, ProductNameDoneProjects, ProductNameFinance, ProductNameHub, ProductNameLegal, type ProductNameOptionTS, ProductNamePublicSector, ProductNameQuickMind, ProductNameRealEstate, ProductNameShopAssist, type ProductNameTS, ProductNames, type ProvisioningStatus, ProvisioningStatusCompleted, ProvisioningStatusFailed, type ProvisioningStatusOptionTS, ProvisioningStatusPending, ProvisioningStatusRunning, type ProvisioningStatusTS, ProvisioningStatuses, type PurchaseCreditsRequest, type PurchaseCreditsResponse, type RefreshIntegrationRequest, type RefreshIntegrationResponse, type ResponseMetadata, type RevenueAnalytics, type RevenueAnalyticsRequest, type RevenueAnalyticsResponse, type RuleCoverage, RulesCreateBillingRule, RulesDeleteBillingRule, RulesGetBillingRules, RulesUpdateBillingRule, type RunEmailTriageRequest, type RunEmailTriageResponse, type SearchEmailsRequest, type SearchEmailsResponse, type ServiceDeskAdmin, type ServiceEvent, type ServiceEventMetadata, type ServiceUsage, type StripeWebhookEvent, SubscriptionCancel, SubscriptionCheckout, SubscriptionCreate, SubscriptionGet, SubscriptionList, type SubscriptionPlatform, SubscriptionPlatformCustom, SubscriptionPlatformStripe, SubscriptionUpdate, type SystemApp, SystemAppAdmin, SystemAppAnalytics, SystemAppCRM, SystemAppDocumentProcessor, SystemAppHelpdesk, SystemAppKnowledgeGraph, SystemAppMarketing, type SystemAppOptionTS, type SystemAppTS, SystemAppWorkflow, SystemApps, type TaskMetrics, type Team, type ThemeOptionTS, ThemeOptions, type TierCost, type TokenData, type TopCostCenter, type UpdateTriageEnabledRequest, type UpdateTriageEnabledResponse, type UpdateUserSettingsRequest, type UpdateUserStatusRequest, type UpdateUserStatusResponse, UpdateUserStatusSubject, type UsageAggregation, type UsageAlert, UsageAlertThreshold, UsageGetCostBreakdown, UsageGetCurrentUsage, UsageGetTopCostCenters, UsageGetUsageHistory, type UsageHistory, type UsagePeriod, type UsageReport, type UsageReportRequest, type UsageReportResponse, type UsageSummary, type UsageTrends, type User, type UserIntegration, type UserOnboarding, type UserOrgAccess, type UserResponse, type UserSettings, type UserSettingsResponse, type UserSource, UserSourceAPI, UserSourceInvite, type UserSourceOptionTS, UserSourceSSO, UserSourceSignup, type UserSourceTS, UserSources, type UserStatusTS, type UserUsage, type Variable, type VariableReference, type VariableScope, VariableScopeEdge, VariableScopeGlobal, VariableScopeNode, type VariableValidation, WebhookInvoiceFailed, WebhookInvoicePaid, WebhookPaymentSucceeded, WebhookSubscriptionCanceled, WebhookSubscriptionCreated, WebhookSubscriptionUpdated, type Widget, type WidgetType, WidgetTypeAccounts, WidgetTypeActivities, WidgetTypeCalendar, WidgetTypeChart, WidgetTypeContacts, WidgetTypeEmail, WidgetTypeFiles, WidgetTypeLeads, WidgetTypeNotes, WidgetTypeOpportunities, WidgetTypeOrders, WidgetTypeTasks, type WorkspaceInput, type WorkspaceResult };
|