@marteye/studiojs 1.1.47-beta.0 → 1.1.48-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/types.d.ts CHANGED
@@ -46,6 +46,7 @@ export interface SettingsMarketDefaults {
46
46
  defaultUnitOfSale: UnitOfSale;
47
47
  defaultSuperType?: SuperType | null;
48
48
  defaultSettleDebtsFirst?: boolean;
49
+ showInvoiceAveragesAndStats?: boolean;
49
50
  liveEmailsEnabled?: boolean;
50
51
  lotDescriptionTemplateMap?: {
51
52
  default: string | undefined;
@@ -211,6 +212,7 @@ export interface Sale {
211
212
  */
212
213
  publishStatus?: SalePublishStatus;
213
214
  enableLuckMoney?: boolean;
215
+ enableLotGrouping?: boolean;
214
216
  }
215
217
  export interface TemplateSaleData {
216
218
  name?: string;
@@ -225,6 +227,7 @@ export interface TemplateSaleData {
225
227
  };
226
228
  marteyeSettings?: MartEyeTimedSaleSettings | MartEyeLiveSaleSettings | null;
227
229
  enableLuckMoney?: boolean;
230
+ enableLotGrouping?: boolean;
228
231
  }
229
232
  export interface SaleTemplate {
230
233
  id: string;
@@ -1196,12 +1199,55 @@ export interface SendSMSPayload {
1196
1199
  reference?: string;
1197
1200
  senderName?: string;
1198
1201
  }
1202
+ export type BroadcastType = "sms" | "email";
1203
+ export type BroadcastKind = "broadcast" | "statement";
1204
+ export interface BroadcastRecipient {
1205
+ customerId: string;
1206
+ displayName?: string;
1207
+ accountNumber?: string;
1208
+ phoneNumbers?: string[];
1209
+ emails?: string[];
1210
+ }
1211
+ export interface SMSBroadcastPayload {
1212
+ type: "sms";
1213
+ kind?: BroadcastKind;
1214
+ message?: string;
1215
+ senderName?: string;
1216
+ recipients: BroadcastRecipient[];
1217
+ }
1218
+ export interface EmailBroadcastPayload {
1219
+ type: "email";
1220
+ kind?: BroadcastKind;
1221
+ message?: string;
1222
+ subject?: string;
1223
+ subdomain?: string;
1224
+ recipients: BroadcastRecipient[];
1225
+ }
1226
+ export type BroadcastPayload = SMSBroadcastPayload | EmailBroadcastPayload;
1227
+ export interface BroadcastSendResultItem {
1228
+ customerId: string;
1229
+ taskId?: string;
1230
+ status: "queued" | "skipped" | "failed";
1231
+ recipientCount: number;
1232
+ reason?: string;
1233
+ }
1234
+ export interface BroadcastSendResponse {
1235
+ success: boolean;
1236
+ type: BroadcastType;
1237
+ kind: BroadcastKind;
1238
+ broadcastId: string;
1239
+ sent: number;
1240
+ skipped: number;
1241
+ results: BroadcastSendResultItem[];
1242
+ }
1199
1243
  export interface SMSTask {
1200
1244
  id: string;
1201
1245
  marketId: string;
1246
+ broadcastId?: string;
1202
1247
  to: string[];
1203
1248
  message: string;
1204
1249
  customerId?: string;
1250
+ accountNumber?: string;
1205
1251
  reference?: string;
1206
1252
  senderName?: string;
1207
1253
  metadata?: Record<string, any>;
@@ -1224,4 +1270,143 @@ export interface SMSTask {
1224
1270
  };
1225
1271
  };
1226
1272
  }
1273
+ export interface EmailTask {
1274
+ id: string;
1275
+ marketId: string;
1276
+ broadcastId?: string;
1277
+ marketName: string;
1278
+ replyTo: string;
1279
+ customerId: string;
1280
+ accountNumber?: string;
1281
+ templateId: string;
1282
+ to: string[];
1283
+ documents?: string[];
1284
+ data: Record<string, any>;
1285
+ status: "failed" | "pending" | "sent" | "delivered" | "opened" | "bounced" | "spam-complaint";
1286
+ errorCode?: number;
1287
+ errorMessage?: string;
1288
+ providerMessageId?: string;
1289
+ createdAt: Timestamp;
1290
+ updatedAt: Timestamp;
1291
+ sentAt?: Timestamp;
1292
+ deliveredAt?: Timestamp;
1293
+ openedAt?: Timestamp;
1294
+ bouncedAt?: Timestamp;
1295
+ subject?: string;
1296
+ events?: {
1297
+ id: string;
1298
+ timestamp: Timestamp;
1299
+ type: string;
1300
+ recipient: string;
1301
+ }[];
1302
+ }
1303
+ export type BroadcastTask = SMSTask | EmailTask;
1304
+ export interface DebtOperationalOverviewOptions {
1305
+ comparisonDays?: number;
1306
+ }
1307
+ export interface DebtPaymentHistoryPoint {
1308
+ date: string;
1309
+ daysToPay: number;
1310
+ }
1311
+ export interface DebtRecentPaymentInfo {
1312
+ date: string;
1313
+ amountInCents: number;
1314
+ daysToPay: number;
1315
+ }
1316
+ export interface DebtPaymentBehavior {
1317
+ avgDaysToPay: number | null;
1318
+ paymentConsistency: "consistent" | "variable" | "erratic" | null;
1319
+ recentTrend: "improving" | "stable" | "worsening" | null;
1320
+ paymentHistory: DebtPaymentHistoryPoint[];
1321
+ lastPayments: DebtRecentPaymentInfo[];
1322
+ debtorDaysDSO: number | null;
1323
+ debtorDaysDSO30DaysAgo: number | null;
1324
+ }
1325
+ export interface DebtOutstandingInvoice {
1326
+ invoiceId: string;
1327
+ issuedAtSeconds: number;
1328
+ amountDueInCents: number;
1329
+ riskCategory?: "low" | "medium" | "high" | "critical";
1330
+ }
1331
+ export interface DebtOperationalCustomer {
1332
+ customerId: string;
1333
+ displayName: string | null;
1334
+ accountNumber: string | null;
1335
+ balanceInCents: number;
1336
+ balanceXDaysAgoInCents: number | null;
1337
+ balanceChangeInCents: number | null;
1338
+ balanceChangePercent: number | null;
1339
+ lastPaymentDateSeconds: number | null;
1340
+ daysSinceLastPayment: number | null;
1341
+ outstandingInvoices: DebtOutstandingInvoice[];
1342
+ warningSignCodes: Array<"paying_slower" | "buying_more_paying_less" | "stopped_paying" | "late_payments" | "high_risk_invoice">;
1343
+ warningSignLabels: string[];
1344
+ gmvLast30DaysInCents: number;
1345
+ paymentsLast30DaysInCents: number;
1346
+ ageBucket0to6: number;
1347
+ ageBucket7to13: number;
1348
+ ageBucket14to20: number;
1349
+ ageBucket21to27: number;
1350
+ ageBucket28to34: number;
1351
+ ageBucket35plus: number;
1352
+ avgDaysToPayRecent: number | null;
1353
+ avgDaysToPayBaseline: number | null;
1354
+ hasHighRiskInvoice: boolean;
1355
+ invoiceCount: number;
1356
+ paymentBehavior: DebtPaymentBehavior;
1357
+ }
1358
+ export interface DebtOperationalInvoice {
1359
+ invoiceId: string;
1360
+ customerId: string;
1361
+ issuedAtSeconds: number;
1362
+ amountDueInCents: number;
1363
+ daysOutstanding: number;
1364
+ expectedPayDays: number | null;
1365
+ daysOverdue: number | null;
1366
+ riskCategory: "low" | "medium" | "high" | "critical";
1367
+ customerWarnings: Array<"paying_slower" | "buying_more_paying_less" | "stopped_paying" | "late_payments" | "high_risk_invoice">;
1368
+ customerAvgDaysToPay: number | null;
1369
+ }
1370
+ export interface DebtOperationalOverviewResponse {
1371
+ customers: DebtOperationalCustomer[];
1372
+ invoices: DebtOperationalInvoice[];
1373
+ }
1374
+ export interface DebtBehaviorCustomer {
1375
+ customerId: string;
1376
+ displayName: string | null;
1377
+ accountNumber: string | null;
1378
+ balanceInCents: number;
1379
+ balanceXDaysAgoInCents: number | null;
1380
+ balanceChangeInCents: number | null;
1381
+ balanceChangePercent: number | null;
1382
+ paymentBehavior: DebtPaymentBehavior;
1383
+ warningSignCodes: DebtOperationalCustomer["warningSignCodes"];
1384
+ warningSignLabels: string[];
1385
+ }
1386
+ export interface DebtBehaviorResponse {
1387
+ customers: DebtBehaviorCustomer[];
1388
+ }
1389
+ export interface DebtProductOptions {
1390
+ limit?: number;
1391
+ }
1392
+ export interface DebtProductInvoice {
1393
+ invoiceId: string;
1394
+ outstandingInMilliCents: number;
1395
+ issuedAtSeconds: number;
1396
+ }
1397
+ export interface DebtProductCustomer {
1398
+ owner: string | null;
1399
+ customerId: string | null;
1400
+ outstandingInMilliCents: number;
1401
+ invoices: DebtProductInvoice[];
1402
+ }
1403
+ export interface DebtProductRow {
1404
+ productCode: string | null;
1405
+ totalOutstandingInMilliCents: number;
1406
+ customers: DebtProductCustomer[];
1407
+ }
1408
+ export interface DebtProductResponse {
1409
+ outstandingByProduct: DebtProductRow[];
1410
+ overallOutstandingInMilliCents: number;
1411
+ }
1227
1412
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marteye/studiojs",
3
- "version": "1.1.47-beta.0",
3
+ "version": "1.1.48-beta.0",
4
4
  "description": "MartEye Studio JavaScript SDK",
5
5
  "license": "MIT",
6
6
  "source": "src/index.ts",
@@ -27,7 +27,8 @@
27
27
  "test": "jest --coverage",
28
28
  "test:watch": "jest --watch",
29
29
  "build:types": "tsc --emitDeclarationOnly",
30
- "build:publish": "npm run build && npm publish --access public"
30
+ "build:publish": "npm run build && npm publish --access public",
31
+ "build:publish:beta": "npm run build && npm publish --tag beta --access public"
31
32
  },
32
33
  "devDependencies": {
33
34
  "@rollup/plugin-commonjs": "^25.0.0",
@@ -1,7 +0,0 @@
1
- import { HttpClient } from "../net/http";
2
- import { SendSMSPayload, SMSTask } from "../types";
3
- export default function create(httpClient: HttpClient): {
4
- sendSMS: (marketId: string, data: SendSMSPayload) => Promise<SMSTask>;
5
- getSMS: (marketId: string, smsId: string) => Promise<SMSTask>;
6
- };
7
- export type SMS = ReturnType<typeof create>;