@marteye/studiojs 1.1.47 → 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/README.md +124 -23
- package/dist/index.d.ts +241 -10
- package/dist/index.esm.js +117 -79
- package/dist/index.js +117 -79
- package/dist/resources/broadcast.d.ts +7 -0
- package/dist/resources/reports.d.ts +8 -0
- package/dist/resources/sales.d.ts +2 -0
- package/dist/resources.d.ts +11 -4
- package/dist/studio.d.ts +11 -4
- package/dist/types.d.ts +185 -0
- package/package.json +3 -2
- package/dist/resources/sms.d.ts +0 -7
package/dist/resources.d.ts
CHANGED
|
@@ -5,6 +5,10 @@ export default function resources(httpClient: HttpClient): {
|
|
|
5
5
|
list: (marketId: string, params?: import("./resources/activity").ActivityListParams | undefined) => Promise<import("./resources/activity").ActivityListResponse>;
|
|
6
6
|
get: (marketId: string, activityId: string) => Promise<import("./types").ActivityLog>;
|
|
7
7
|
};
|
|
8
|
+
broadcast: {
|
|
9
|
+
send: (marketId: string, data: import("./types").BroadcastPayload) => Promise<import("./types").BroadcastSendResponse>;
|
|
10
|
+
get: (marketId: string, type: import("./types").BroadcastType, taskId: string) => Promise<import("./types").BroadcastTask>;
|
|
11
|
+
};
|
|
8
12
|
markets: {
|
|
9
13
|
get: (marketId: string, options?: import("./types").ReadOptions | undefined) => Promise<import("./types").Market>;
|
|
10
14
|
};
|
|
@@ -33,6 +37,7 @@ export default function resources(httpClient: HttpClient): {
|
|
|
33
37
|
image?: string | null | undefined;
|
|
34
38
|
cover?: string | null | undefined;
|
|
35
39
|
templateId?: string | null | undefined;
|
|
40
|
+
enableLotGrouping?: boolean | undefined;
|
|
36
41
|
attributeDefaults?: {
|
|
37
42
|
[attributekey: string]: string | number | boolean;
|
|
38
43
|
} | undefined;
|
|
@@ -46,6 +51,7 @@ export default function resources(httpClient: HttpClient): {
|
|
|
46
51
|
defaultProductCode?: string | undefined;
|
|
47
52
|
attributeDefaults?: Record<string, any> | undefined;
|
|
48
53
|
publishStatus?: import("./types").SalePublishStatus | undefined;
|
|
54
|
+
enableLotGrouping?: boolean | undefined;
|
|
49
55
|
marteyeSettings?: {
|
|
50
56
|
description?: string | undefined;
|
|
51
57
|
image?: string | undefined;
|
|
@@ -261,6 +267,11 @@ export default function resources(httpClient: HttpClient): {
|
|
|
261
267
|
get: (marketId: string, payoutId: string) => Promise<import("./types").Payout>;
|
|
262
268
|
create: (marketId: string, data: import("./resources/payouts").CreatePayoutRequest) => Promise<import("./resources/payouts").PayoutCreateResponse>;
|
|
263
269
|
};
|
|
270
|
+
reports: {
|
|
271
|
+
getDebtOperationalOverview: (marketId: string, options?: import("./types").DebtOperationalOverviewOptions | undefined) => Promise<import("./types").DebtOperationalOverviewResponse>;
|
|
272
|
+
getDebtBehavior: (marketId: string, options?: import("./types").DebtOperationalOverviewOptions | undefined) => Promise<import("./types").DebtBehaviorResponse>;
|
|
273
|
+
getDebtProduct: (marketId: string, options?: import("./types").DebtProductOptions | undefined) => Promise<import("./types").DebtProductResponse>;
|
|
274
|
+
};
|
|
264
275
|
search: {
|
|
265
276
|
query: (marketId: string, query: string) => Promise<import("./resources/search").SearchResult>;
|
|
266
277
|
};
|
|
@@ -294,8 +305,4 @@ export default function resources(httpClient: HttpClient): {
|
|
|
294
305
|
getLatestTransaction: (marketId: string, account: string) => Promise<import("./resources/ledger").LedgerTransaction>;
|
|
295
306
|
listTransactions: (marketId: string, params: import("./resources/ledger").ListTransactionsParams) => Promise<import("./resources/ledger").TransactionsListResponse>;
|
|
296
307
|
};
|
|
297
|
-
sms: {
|
|
298
|
-
sendSMS: (marketId: string, data: import("./types").SendSMSPayload) => Promise<import("./types").SMSTask>;
|
|
299
|
-
getSMS: (marketId: string, smsId: string) => Promise<import("./types").SMSTask>;
|
|
300
|
-
};
|
|
301
308
|
};
|
package/dist/studio.d.ts
CHANGED
|
@@ -14,6 +14,10 @@ export declare function Studio(info?: {
|
|
|
14
14
|
list: (marketId: string, params?: import("./resources/activity").ActivityListParams | undefined) => Promise<import("./resources/activity").ActivityListResponse>;
|
|
15
15
|
get: (marketId: string, activityId: string) => Promise<import("./types").ActivityLog>;
|
|
16
16
|
};
|
|
17
|
+
broadcast: {
|
|
18
|
+
send: (marketId: string, data: import("./types").BroadcastPayload) => Promise<import("./types").BroadcastSendResponse>;
|
|
19
|
+
get: (marketId: string, type: import("./types").BroadcastType, taskId: string) => Promise<import("./types").BroadcastTask>;
|
|
20
|
+
};
|
|
17
21
|
markets: {
|
|
18
22
|
get: (marketId: string, options?: import("./types").ReadOptions | undefined) => Promise<import("./types").Market>;
|
|
19
23
|
};
|
|
@@ -42,6 +46,7 @@ export declare function Studio(info?: {
|
|
|
42
46
|
image?: string | null | undefined;
|
|
43
47
|
cover?: string | null | undefined;
|
|
44
48
|
templateId?: string | null | undefined;
|
|
49
|
+
enableLotGrouping?: boolean | undefined;
|
|
45
50
|
attributeDefaults?: {
|
|
46
51
|
[attributekey: string]: string | number | boolean;
|
|
47
52
|
} | undefined;
|
|
@@ -55,6 +60,7 @@ export declare function Studio(info?: {
|
|
|
55
60
|
defaultProductCode?: string | undefined;
|
|
56
61
|
attributeDefaults?: Record<string, any> | undefined;
|
|
57
62
|
publishStatus?: import("./types").SalePublishStatus | undefined;
|
|
63
|
+
enableLotGrouping?: boolean | undefined;
|
|
58
64
|
marteyeSettings?: {
|
|
59
65
|
description?: string | undefined;
|
|
60
66
|
image?: string | undefined;
|
|
@@ -270,6 +276,11 @@ export declare function Studio(info?: {
|
|
|
270
276
|
get: (marketId: string, payoutId: string) => Promise<import("./types").Payout>;
|
|
271
277
|
create: (marketId: string, data: import("./resources/payouts").CreatePayoutRequest) => Promise<import("./resources/payouts").PayoutCreateResponse>;
|
|
272
278
|
};
|
|
279
|
+
reports: {
|
|
280
|
+
getDebtOperationalOverview: (marketId: string, options?: import("./types").DebtOperationalOverviewOptions | undefined) => Promise<import("./types").DebtOperationalOverviewResponse>;
|
|
281
|
+
getDebtBehavior: (marketId: string, options?: import("./types").DebtOperationalOverviewOptions | undefined) => Promise<import("./types").DebtBehaviorResponse>;
|
|
282
|
+
getDebtProduct: (marketId: string, options?: import("./types").DebtProductOptions | undefined) => Promise<import("./types").DebtProductResponse>;
|
|
283
|
+
};
|
|
273
284
|
search: {
|
|
274
285
|
query: (marketId: string, query: string) => Promise<import("./resources/search").SearchResult>;
|
|
275
286
|
};
|
|
@@ -303,8 +314,4 @@ export declare function Studio(info?: {
|
|
|
303
314
|
getLatestTransaction: (marketId: string, account: string) => Promise<import("./resources/ledger").LedgerTransaction>;
|
|
304
315
|
listTransactions: (marketId: string, params: import("./resources/ledger").ListTransactionsParams) => Promise<import("./resources/ledger").TransactionsListResponse>;
|
|
305
316
|
};
|
|
306
|
-
sms: {
|
|
307
|
-
sendSMS: (marketId: string, data: import("./types").SendSMSPayload) => Promise<import("./types").SMSTask>;
|
|
308
|
-
getSMS: (marketId: string, smsId: string) => Promise<import("./types").SMSTask>;
|
|
309
|
-
};
|
|
310
317
|
};
|
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.
|
|
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",
|
package/dist/resources/sms.d.ts
DELETED
|
@@ -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>;
|