@goweekdays/core 1.1.6 → 1.1.8
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/CHANGELOG.md +12 -0
- package/dist/index.d.ts +33 -70
- package/dist/index.js +1167 -326
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1300 -448
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -50,13 +50,13 @@ declare function useVerificationRepo(): {
|
|
|
50
50
|
type?: string | string[] | undefined;
|
|
51
51
|
email?: string | undefined;
|
|
52
52
|
app?: string | undefined;
|
|
53
|
-
}) => Promise<{
|
|
53
|
+
}) => Promise<TVerification[] | {
|
|
54
54
|
items: any[];
|
|
55
55
|
pages: number;
|
|
56
56
|
pageRange: string;
|
|
57
57
|
}>;
|
|
58
58
|
getById: (_id: ObjectId | string) => Promise<TVerification | null>;
|
|
59
|
-
getByIdByType: (type: string) => Promise<TVerification[][]>;
|
|
59
|
+
getByIdByType: (type: string) => Promise<TVerification[] | TVerification[][]>;
|
|
60
60
|
updateStatusById: (_id: ObjectId | string, status: string, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
|
|
61
61
|
};
|
|
62
62
|
|
|
@@ -80,7 +80,7 @@ declare function useVerificationService(): {
|
|
|
80
80
|
email?: string | undefined;
|
|
81
81
|
limit?: number | undefined;
|
|
82
82
|
app?: string | undefined;
|
|
83
|
-
}) => Promise<{
|
|
83
|
+
}) => Promise<TVerification[] | {
|
|
84
84
|
items: any[];
|
|
85
85
|
pages: number;
|
|
86
86
|
pageRange: string;
|
|
@@ -118,7 +118,7 @@ declare function useTokenRepo(): {
|
|
|
118
118
|
token: string;
|
|
119
119
|
user: string | ObjectId;
|
|
120
120
|
}) => Promise<string>;
|
|
121
|
-
getToken: (token: string) => Promise<
|
|
121
|
+
getToken: (token: string) => Promise<any>;
|
|
122
122
|
deleteToken: (token: string) => Promise<mongodb.DeleteResult>;
|
|
123
123
|
};
|
|
124
124
|
|
|
@@ -368,7 +368,7 @@ declare class MFile implements TFile {
|
|
|
368
368
|
declare function useFileRepo(): {
|
|
369
369
|
createFile: (value: TFile, session?: ClientSession) => Promise<string>;
|
|
370
370
|
deleteFileById: (_id: string | ObjectId, session?: ClientSession) => Promise<string>;
|
|
371
|
-
getAllDraftedFiles: () => Promise<
|
|
371
|
+
getAllDraftedFiles: () => Promise<any[]>;
|
|
372
372
|
};
|
|
373
373
|
|
|
374
374
|
declare function useFileService(): {
|
|
@@ -423,11 +423,7 @@ declare function useEntityRepo(): {
|
|
|
423
423
|
page?: number | undefined;
|
|
424
424
|
limit?: number | undefined;
|
|
425
425
|
sort?: {} | undefined;
|
|
426
|
-
}) => Promise<
|
|
427
|
-
items: any[];
|
|
428
|
-
pages: number;
|
|
429
|
-
pageRange: string;
|
|
430
|
-
}>;
|
|
426
|
+
}) => Promise<Record<string, any>>;
|
|
431
427
|
updateEntityFieldById: ({ _id, field, value }?: {
|
|
432
428
|
_id: string | ObjectId;
|
|
433
429
|
field: string;
|
|
@@ -486,11 +482,7 @@ declare function useSubscriptionRepo(): {
|
|
|
486
482
|
limit?: number | undefined;
|
|
487
483
|
sort?: {} | undefined;
|
|
488
484
|
status?: string | undefined;
|
|
489
|
-
}) => Promise<
|
|
490
|
-
items: any[];
|
|
491
|
-
pages: number;
|
|
492
|
-
pageRange: string;
|
|
493
|
-
}>;
|
|
485
|
+
}) => Promise<Record<string, any>>;
|
|
494
486
|
updateStatus: (_id: string | ObjectId, status: string) => Promise<string>;
|
|
495
487
|
getByOrgId: (org: string | ObjectId) => Promise<TSubscription | null>;
|
|
496
488
|
getByAffiliateUserId: (user: string | ObjectId) => Promise<TSubscription | null>;
|
|
@@ -1234,11 +1226,7 @@ declare function useMemberRepo(): {
|
|
|
1234
1226
|
org?: string | ObjectId | undefined;
|
|
1235
1227
|
type: string;
|
|
1236
1228
|
status: string;
|
|
1237
|
-
}) => Promise<
|
|
1238
|
-
items: any[];
|
|
1239
|
-
pages: number;
|
|
1240
|
-
pageRange: string;
|
|
1241
|
-
} | TMember[]>;
|
|
1229
|
+
}) => Promise<Record<string, any>>;
|
|
1242
1230
|
getOrgsByUserId: ({ search, page, limit, sort, user, status, }?: {
|
|
1243
1231
|
user: string | ObjectId;
|
|
1244
1232
|
page: number;
|
|
@@ -1316,11 +1304,7 @@ declare function usePromoCodeRepo(): {
|
|
|
1316
1304
|
sort?: {} | undefined;
|
|
1317
1305
|
status?: string | undefined;
|
|
1318
1306
|
type?: string | undefined;
|
|
1319
|
-
}) => Promise<
|
|
1320
|
-
items: any[];
|
|
1321
|
-
pages: number;
|
|
1322
|
-
pageRange: string;
|
|
1323
|
-
}>;
|
|
1307
|
+
}) => Promise<Record<string, any>>;
|
|
1324
1308
|
assignByUserId: ({ user, code }?: {
|
|
1325
1309
|
user: string | ObjectId;
|
|
1326
1310
|
code: string;
|
|
@@ -1369,11 +1353,7 @@ declare function useOrderRepo(): {
|
|
|
1369
1353
|
status?: string | undefined;
|
|
1370
1354
|
type?: string | undefined;
|
|
1371
1355
|
id?: string | undefined;
|
|
1372
|
-
}) => Promise<
|
|
1373
|
-
items: any[];
|
|
1374
|
-
pages: number;
|
|
1375
|
-
pageRange: string;
|
|
1376
|
-
}>;
|
|
1356
|
+
}) => Promise<Record<string, any>>;
|
|
1377
1357
|
};
|
|
1378
1358
|
|
|
1379
1359
|
declare function useOrderController(): {
|
|
@@ -1452,9 +1432,6 @@ declare const TInvoice: z.ZodObject<{
|
|
|
1452
1432
|
}, "strip", z.ZodTypeAny, {
|
|
1453
1433
|
type: "organization-subscription" | "affiliate-subscription" | "one-time-payment" | "other";
|
|
1454
1434
|
status: "pending" | "cancelled" | "paid" | "overdue";
|
|
1455
|
-
amount: number;
|
|
1456
|
-
invoiceNumber: string;
|
|
1457
|
-
dueDate: Date;
|
|
1458
1435
|
items: {
|
|
1459
1436
|
description: string;
|
|
1460
1437
|
unitPrice: number;
|
|
@@ -1462,6 +1439,9 @@ declare const TInvoice: z.ZodObject<{
|
|
|
1462
1439
|
total: number;
|
|
1463
1440
|
seats?: number | undefined;
|
|
1464
1441
|
}[];
|
|
1442
|
+
amount: number;
|
|
1443
|
+
invoiceNumber: string;
|
|
1444
|
+
dueDate: Date;
|
|
1465
1445
|
_id?: ObjectId | undefined;
|
|
1466
1446
|
updatedAt?: Date | undefined;
|
|
1467
1447
|
createdAt?: Date | undefined;
|
|
@@ -1475,9 +1455,6 @@ declare const TInvoice: z.ZodObject<{
|
|
|
1475
1455
|
billingCycle?: "monthly" | "yearly" | "quarterly" | undefined;
|
|
1476
1456
|
} | undefined;
|
|
1477
1457
|
}, {
|
|
1478
|
-
amount: number;
|
|
1479
|
-
invoiceNumber: string;
|
|
1480
|
-
dueDate: Date;
|
|
1481
1458
|
items: {
|
|
1482
1459
|
description: string;
|
|
1483
1460
|
unitPrice: number;
|
|
@@ -1485,6 +1462,9 @@ declare const TInvoice: z.ZodObject<{
|
|
|
1485
1462
|
total: number;
|
|
1486
1463
|
seats?: number | undefined;
|
|
1487
1464
|
}[];
|
|
1465
|
+
amount: number;
|
|
1466
|
+
invoiceNumber: string;
|
|
1467
|
+
dueDate: Date;
|
|
1488
1468
|
type?: "organization-subscription" | "affiliate-subscription" | "one-time-payment" | "other" | undefined;
|
|
1489
1469
|
status?: "pending" | "cancelled" | "paid" | "overdue" | undefined;
|
|
1490
1470
|
_id?: string | ObjectId | undefined;
|
|
@@ -1506,9 +1486,6 @@ declare function useInvoiceModel(db: Db): {
|
|
|
1506
1486
|
collection: Collection<{
|
|
1507
1487
|
type: "organization-subscription" | "affiliate-subscription" | "one-time-payment" | "other";
|
|
1508
1488
|
status: "pending" | "cancelled" | "paid" | "overdue";
|
|
1509
|
-
amount: number;
|
|
1510
|
-
invoiceNumber: string;
|
|
1511
|
-
dueDate: Date;
|
|
1512
1489
|
items: {
|
|
1513
1490
|
description: string;
|
|
1514
1491
|
unitPrice: number;
|
|
@@ -1516,6 +1493,9 @@ declare function useInvoiceModel(db: Db): {
|
|
|
1516
1493
|
total: number;
|
|
1517
1494
|
seats?: number | undefined;
|
|
1518
1495
|
}[];
|
|
1496
|
+
amount: number;
|
|
1497
|
+
invoiceNumber: string;
|
|
1498
|
+
dueDate: Date;
|
|
1519
1499
|
_id?: ObjectId | undefined;
|
|
1520
1500
|
updatedAt?: Date | undefined;
|
|
1521
1501
|
createdAt?: Date | undefined;
|
|
@@ -1538,9 +1518,6 @@ declare function useInvoiceRepo(): {
|
|
|
1538
1518
|
getByDueDate: (id: string | ObjectId, dueDate: Date, status?: TInvoice["status"]) => Promise<{
|
|
1539
1519
|
type: "organization-subscription" | "affiliate-subscription" | "one-time-payment" | "other";
|
|
1540
1520
|
status: "pending" | "cancelled" | "paid" | "overdue";
|
|
1541
|
-
amount: number;
|
|
1542
|
-
invoiceNumber: string;
|
|
1543
|
-
dueDate: Date;
|
|
1544
1521
|
items: {
|
|
1545
1522
|
description: string;
|
|
1546
1523
|
unitPrice: number;
|
|
@@ -1548,6 +1525,9 @@ declare function useInvoiceRepo(): {
|
|
|
1548
1525
|
total: number;
|
|
1549
1526
|
seats?: number | undefined;
|
|
1550
1527
|
}[];
|
|
1528
|
+
amount: number;
|
|
1529
|
+
invoiceNumber: string;
|
|
1530
|
+
dueDate: Date;
|
|
1551
1531
|
_id?: ObjectId | undefined;
|
|
1552
1532
|
updatedAt?: Date | undefined;
|
|
1553
1533
|
createdAt?: Date | undefined;
|
|
@@ -1565,9 +1545,6 @@ declare function useInvoiceRepo(): {
|
|
|
1565
1545
|
getOverdueInvoices: (BATCH_SIZE?: number) => Promise<{
|
|
1566
1546
|
type: "organization-subscription" | "affiliate-subscription" | "one-time-payment" | "other";
|
|
1567
1547
|
status: "pending" | "cancelled" | "paid" | "overdue";
|
|
1568
|
-
amount: number;
|
|
1569
|
-
invoiceNumber: string;
|
|
1570
|
-
dueDate: Date;
|
|
1571
1548
|
items: {
|
|
1572
1549
|
description: string;
|
|
1573
1550
|
unitPrice: number;
|
|
@@ -1575,6 +1552,9 @@ declare function useInvoiceRepo(): {
|
|
|
1575
1552
|
total: number;
|
|
1576
1553
|
seats?: number | undefined;
|
|
1577
1554
|
}[];
|
|
1555
|
+
amount: number;
|
|
1556
|
+
invoiceNumber: string;
|
|
1557
|
+
dueDate: Date;
|
|
1578
1558
|
_id?: ObjectId | undefined;
|
|
1579
1559
|
updatedAt?: Date | undefined;
|
|
1580
1560
|
createdAt?: Date | undefined;
|
|
@@ -1602,9 +1582,6 @@ declare function useInvoiceRepo(): {
|
|
|
1602
1582
|
getByNumber: (number: string) => Promise<{
|
|
1603
1583
|
type: "organization-subscription" | "affiliate-subscription" | "one-time-payment" | "other";
|
|
1604
1584
|
status: "pending" | "cancelled" | "paid" | "overdue";
|
|
1605
|
-
amount: number;
|
|
1606
|
-
invoiceNumber: string;
|
|
1607
|
-
dueDate: Date;
|
|
1608
1585
|
items: {
|
|
1609
1586
|
description: string;
|
|
1610
1587
|
unitPrice: number;
|
|
@@ -1612,6 +1589,9 @@ declare function useInvoiceRepo(): {
|
|
|
1612
1589
|
total: number;
|
|
1613
1590
|
seats?: number | undefined;
|
|
1614
1591
|
}[];
|
|
1592
|
+
amount: number;
|
|
1593
|
+
invoiceNumber: string;
|
|
1594
|
+
dueDate: Date;
|
|
1615
1595
|
_id?: ObjectId | undefined;
|
|
1616
1596
|
updatedAt?: Date | undefined;
|
|
1617
1597
|
createdAt?: Date | undefined;
|
|
@@ -1628,9 +1608,6 @@ declare function useInvoiceRepo(): {
|
|
|
1628
1608
|
getByTransactionId: (id: string) => Promise<{
|
|
1629
1609
|
type: "organization-subscription" | "affiliate-subscription" | "one-time-payment" | "other";
|
|
1630
1610
|
status: "pending" | "cancelled" | "paid" | "overdue";
|
|
1631
|
-
amount: number;
|
|
1632
|
-
invoiceNumber: string;
|
|
1633
|
-
dueDate: Date;
|
|
1634
1611
|
items: {
|
|
1635
1612
|
description: string;
|
|
1636
1613
|
unitPrice: number;
|
|
@@ -1638,6 +1615,9 @@ declare function useInvoiceRepo(): {
|
|
|
1638
1615
|
total: number;
|
|
1639
1616
|
seats?: number | undefined;
|
|
1640
1617
|
}[];
|
|
1618
|
+
amount: number;
|
|
1619
|
+
invoiceNumber: string;
|
|
1620
|
+
dueDate: Date;
|
|
1641
1621
|
_id?: ObjectId | undefined;
|
|
1642
1622
|
updatedAt?: Date | undefined;
|
|
1643
1623
|
createdAt?: Date | undefined;
|
|
@@ -2174,14 +2154,7 @@ declare function useCounterRepo(): {
|
|
|
2174
2154
|
createIndex: () => Promise<void>;
|
|
2175
2155
|
createUniqueIndex: () => Promise<void>;
|
|
2176
2156
|
add: (type: string) => Promise<void>;
|
|
2177
|
-
getByType: (type: string) => Promise<
|
|
2178
|
-
type: string;
|
|
2179
|
-
createdAt: Date;
|
|
2180
|
-
count: number;
|
|
2181
|
-
_id?: bson.ObjectId | undefined;
|
|
2182
|
-
updatedAt?: Date | undefined;
|
|
2183
|
-
deletedAt?: Date | undefined;
|
|
2184
|
-
}> | null>;
|
|
2157
|
+
getByType: (type: string) => Promise<any>;
|
|
2185
2158
|
incrementByType: (type: string, session?: ClientSession) => Promise<void>;
|
|
2186
2159
|
};
|
|
2187
2160
|
|
|
@@ -2269,17 +2242,7 @@ declare function usePriceRepo(): {
|
|
|
2269
2242
|
createIndex: () => Promise<void>;
|
|
2270
2243
|
createUniqueIndex: () => Promise<void>;
|
|
2271
2244
|
add: (value: Pick<TPrice, "type" | "name" | "value">) => Promise<void>;
|
|
2272
|
-
getByNameType: (name: string, type: TPriceType) => Promise<
|
|
2273
|
-
type: "one-time-payment" | "other" | "monthly-subscription" | "yearly-subscription";
|
|
2274
|
-
value: number;
|
|
2275
|
-
name: string;
|
|
2276
|
-
_id?: bson.ObjectId | undefined;
|
|
2277
|
-
updatedAt?: Date | undefined;
|
|
2278
|
-
deletedAt?: Date | undefined;
|
|
2279
|
-
createdAt?: Date | undefined;
|
|
2280
|
-
saleValue?: number | undefined;
|
|
2281
|
-
saleExpiry?: Date | undefined;
|
|
2282
|
-
}> | null>;
|
|
2245
|
+
getByNameType: (name: string, type: TPriceType) => Promise<any>;
|
|
2283
2246
|
setSaleValueByType: (value: Pick<TPrice, "type" | "saleValue" | "saleExpiry">, session?: ClientSession) => Promise<void>;
|
|
2284
2247
|
};
|
|
2285
2248
|
|