@elqnt/types 2.0.9 → 2.0.11
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/README.md +190 -0
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +197 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +132 -0
- package/dist/index.mjs.map +1 -1
- package/dist/models/index.d.mts +1057 -34
- package/dist/models/index.d.ts +1057 -34
- package/dist/models/index.js +197 -0
- package/dist/models/index.js.map +1 -1
- package/dist/models/index.mjs +132 -0
- package/dist/models/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/models/index.d.mts
CHANGED
|
@@ -980,6 +980,7 @@ interface PaymentSessionInput {
|
|
|
980
980
|
seats: number;
|
|
981
981
|
successUrl: string;
|
|
982
982
|
cancelUrl: string;
|
|
983
|
+
affiliateCode?: string;
|
|
983
984
|
}
|
|
984
985
|
/**
|
|
985
986
|
* PaymentSessionResult contains the result of creating a payment session
|
|
@@ -1017,50 +1018,1072 @@ declare const AdminTeamsGetOne = "admin.teams.getOne";
|
|
|
1017
1018
|
declare const AdminTeamsGetForOrg = "admin.teams.getTeamsForOrg";
|
|
1018
1019
|
declare const AdminTeamsUpdateOnboarding = "admin.teams.updateOnboardingData";
|
|
1019
1020
|
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
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: {
|
|
1024
1112
|
[key: string]: any;
|
|
1025
1113
|
};
|
|
1026
|
-
|
|
1027
|
-
score?: number;
|
|
1114
|
+
created_by: string;
|
|
1028
1115
|
}
|
|
1029
|
-
interface
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
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;
|
|
1037
1137
|
}
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
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;
|
|
1051
1160
|
created_at: string;
|
|
1052
1161
|
updated_at: string;
|
|
1053
1162
|
}
|
|
1054
|
-
interface
|
|
1055
|
-
|
|
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 {
|
|
1056
1221
|
success: boolean;
|
|
1222
|
+
data?: {
|
|
1223
|
+
[key: string]: any;
|
|
1224
|
+
};
|
|
1225
|
+
error?: string;
|
|
1226
|
+
}
|
|
1227
|
+
interface CostBreakdownRequest {
|
|
1228
|
+
org_id: string;
|
|
1229
|
+
period_start: string;
|
|
1230
|
+
period_end: string;
|
|
1231
|
+
group_by: string;
|
|
1232
|
+
}
|
|
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 {
|
|
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;
|
|
1057
1336
|
message: string;
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
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;
|
|
1062
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;
|
|
1063
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;
|
|
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";
|
|
1064
2087
|
|
|
1065
2088
|
type IntegrationProvider = string;
|
|
1066
2089
|
declare const IntegrationProviderGoogle: IntegrationProvider;
|
|
@@ -1553,4 +2576,4 @@ interface DeleteFieldResponse {
|
|
|
1553
2576
|
metadata: ResponseMetadata;
|
|
1554
2577
|
}
|
|
1555
2578
|
|
|
1556
|
-
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 AgentInfo, type AgentInput, type AgentResult, type AggregateType, AggregateTypeAverage, AggregateTypeCount, AggregateTypeDistinct, AggregateTypeMax, AggregateTypeMin, AggregateTypeSum, type AnalyticsRequest, type AnalyticsResponse, type AzureSettings, type BoardDetails, type BoardSummary, type CalendarEvent, type ChartSettings, type ChartType, ChartTypeBar, ChartTypeDoughnut, ChartTypeLine, ChartTypeMetic, ChartTypePie, type ChatMetricsResponse, type ConnectIntegrationRequest, type ConnectIntegrationResponse, 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
|
|
2579
|
+
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 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 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 };
|