@azlib/cms 0.4.0 → 0.6.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 +132 -42
- package/dist/index.cjs +3500 -47
- package/dist/index.d.cts +885 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +885 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +3444 -48
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
package/dist/index.d.cts
CHANGED
|
@@ -1449,5 +1449,889 @@ declare const ecommercePlugin: (options?: void | EcommercePluginOptions | undefi
|
|
|
1449
1449
|
*/
|
|
1450
1450
|
declare function getEcommerceService(engine: CMSEngine, options?: EcommercePluginOptions): EcommerceService;
|
|
1451
1451
|
//#endregion
|
|
1452
|
-
|
|
1452
|
+
//#region src/plugins/hrms/types.d.ts
|
|
1453
|
+
type EmployerStatus = "active" | "inactive";
|
|
1454
|
+
interface EmployerWorkSchedule {
|
|
1455
|
+
readonly startTime: string;
|
|
1456
|
+
readonly endTime: string;
|
|
1457
|
+
readonly standardHoursPerDay: number;
|
|
1458
|
+
readonly gracePeriodMinutes?: number;
|
|
1459
|
+
readonly workDays?: number[];
|
|
1460
|
+
}
|
|
1461
|
+
interface EmployerData extends Record<string, unknown> {
|
|
1462
|
+
companyName: string;
|
|
1463
|
+
legalName?: string;
|
|
1464
|
+
taxId?: string;
|
|
1465
|
+
email?: string;
|
|
1466
|
+
phone?: string;
|
|
1467
|
+
website?: string;
|
|
1468
|
+
logo?: string;
|
|
1469
|
+
address?: string | Record<string, unknown>;
|
|
1470
|
+
timezone?: string;
|
|
1471
|
+
workSchedule?: EmployerWorkSchedule;
|
|
1472
|
+
status: EmployerStatus;
|
|
1473
|
+
}
|
|
1474
|
+
type EmployerItem = ContentItem<EmployerData>;
|
|
1475
|
+
type EmploymentType = "full_time" | "part_time" | "contractor" | "intern";
|
|
1476
|
+
type EmployeeStatus = "active" | "on_leave" | "terminated" | "suspended";
|
|
1477
|
+
interface EmployeeEmergencyContact {
|
|
1478
|
+
readonly name: string;
|
|
1479
|
+
readonly relationship: string;
|
|
1480
|
+
readonly phone: string;
|
|
1481
|
+
readonly email?: string;
|
|
1482
|
+
}
|
|
1483
|
+
interface EmployeeDocument {
|
|
1484
|
+
readonly id?: string;
|
|
1485
|
+
readonly title: string;
|
|
1486
|
+
readonly fileUrl: string;
|
|
1487
|
+
readonly category?: string;
|
|
1488
|
+
readonly uploadedAt?: string;
|
|
1489
|
+
}
|
|
1490
|
+
interface EmployeeData extends Record<string, unknown> {
|
|
1491
|
+
employerId: string;
|
|
1492
|
+
userId?: string;
|
|
1493
|
+
employeeNumber: string;
|
|
1494
|
+
firstName: string;
|
|
1495
|
+
lastName: string;
|
|
1496
|
+
email: string;
|
|
1497
|
+
phone?: string;
|
|
1498
|
+
avatar?: string;
|
|
1499
|
+
jobTitle?: string;
|
|
1500
|
+
employmentType: EmploymentType;
|
|
1501
|
+
status: EmployeeStatus;
|
|
1502
|
+
hireDate: string;
|
|
1503
|
+
terminationDate?: string;
|
|
1504
|
+
managerId?: string;
|
|
1505
|
+
emergencyContact?: EmployeeEmergencyContact;
|
|
1506
|
+
documents?: EmployeeDocument[];
|
|
1507
|
+
salary?: number;
|
|
1508
|
+
notes?: string;
|
|
1509
|
+
}
|
|
1510
|
+
type EmployeeItem = ContentItem<EmployeeData>;
|
|
1511
|
+
type AttendanceStatus = "present" | "late" | "half_day" | "absent" | "on_leave";
|
|
1512
|
+
interface AttendanceData extends Record<string, unknown> {
|
|
1513
|
+
employerId: string;
|
|
1514
|
+
employeeId: string;
|
|
1515
|
+
date: string;
|
|
1516
|
+
checkInAt: string;
|
|
1517
|
+
checkOutAt?: string;
|
|
1518
|
+
totalHours?: number;
|
|
1519
|
+
overtimeHours?: number;
|
|
1520
|
+
status: AttendanceStatus;
|
|
1521
|
+
location?: string;
|
|
1522
|
+
notes?: string;
|
|
1523
|
+
}
|
|
1524
|
+
type AttendanceItem = ContentItem<AttendanceData>;
|
|
1525
|
+
interface LeaveTypeData extends Record<string, unknown> {
|
|
1526
|
+
employerId?: string;
|
|
1527
|
+
name: string;
|
|
1528
|
+
code: string;
|
|
1529
|
+
daysAllowedPerYear: number;
|
|
1530
|
+
paid: boolean;
|
|
1531
|
+
requiresApproval: boolean;
|
|
1532
|
+
color?: string;
|
|
1533
|
+
description?: string;
|
|
1534
|
+
}
|
|
1535
|
+
type LeaveTypeItem = ContentItem<LeaveTypeData>;
|
|
1536
|
+
type LeaveRequestStatus = "pending" | "approved" | "rejected" | "cancelled";
|
|
1537
|
+
interface LeaveRequestData extends Record<string, unknown> {
|
|
1538
|
+
employerId: string;
|
|
1539
|
+
employeeId: string;
|
|
1540
|
+
leaveTypeId: string;
|
|
1541
|
+
startDate: string;
|
|
1542
|
+
endDate: string;
|
|
1543
|
+
daysCount: number;
|
|
1544
|
+
reason?: string;
|
|
1545
|
+
status: LeaveRequestStatus;
|
|
1546
|
+
approvedBy?: string;
|
|
1547
|
+
approvedAt?: string;
|
|
1548
|
+
rejectionReason?: string;
|
|
1549
|
+
}
|
|
1550
|
+
type LeaveRequestItem = ContentItem<LeaveRequestData>;
|
|
1551
|
+
interface LeaveBalanceItem {
|
|
1552
|
+
readonly leaveTypeId: string;
|
|
1553
|
+
readonly leaveTypeName: string;
|
|
1554
|
+
readonly leaveTypeCode: string;
|
|
1555
|
+
readonly allocatedDays: number;
|
|
1556
|
+
readonly usedDays: number;
|
|
1557
|
+
readonly pendingDays: number;
|
|
1558
|
+
readonly remainingDays: number;
|
|
1559
|
+
}
|
|
1560
|
+
interface EmployeeLeaveBalanceReport {
|
|
1561
|
+
readonly employeeId: string;
|
|
1562
|
+
readonly year: number;
|
|
1563
|
+
readonly balances: readonly LeaveBalanceItem[];
|
|
1564
|
+
readonly totalAllocated: number;
|
|
1565
|
+
readonly totalUsed: number;
|
|
1566
|
+
readonly totalRemaining: number;
|
|
1567
|
+
}
|
|
1568
|
+
interface CreateEmployerInput {
|
|
1569
|
+
companyName: string;
|
|
1570
|
+
legalName?: string;
|
|
1571
|
+
taxId?: string;
|
|
1572
|
+
email?: string;
|
|
1573
|
+
phone?: string;
|
|
1574
|
+
website?: string;
|
|
1575
|
+
logo?: string;
|
|
1576
|
+
address?: string | Record<string, unknown>;
|
|
1577
|
+
timezone?: string;
|
|
1578
|
+
workSchedule?: EmployerWorkSchedule;
|
|
1579
|
+
status?: EmployerStatus;
|
|
1580
|
+
}
|
|
1581
|
+
interface UpdateEmployerInput {
|
|
1582
|
+
companyName?: string;
|
|
1583
|
+
legalName?: string;
|
|
1584
|
+
taxId?: string;
|
|
1585
|
+
email?: string;
|
|
1586
|
+
phone?: string;
|
|
1587
|
+
website?: string;
|
|
1588
|
+
logo?: string;
|
|
1589
|
+
address?: string | Record<string, unknown>;
|
|
1590
|
+
timezone?: string;
|
|
1591
|
+
workSchedule?: EmployerWorkSchedule;
|
|
1592
|
+
status?: EmployerStatus;
|
|
1593
|
+
}
|
|
1594
|
+
interface CreateEmployeeInput {
|
|
1595
|
+
employerId: string;
|
|
1596
|
+
userId?: string;
|
|
1597
|
+
employeeNumber: string;
|
|
1598
|
+
firstName: string;
|
|
1599
|
+
lastName: string;
|
|
1600
|
+
email: string;
|
|
1601
|
+
phone?: string;
|
|
1602
|
+
avatar?: string;
|
|
1603
|
+
jobTitle?: string;
|
|
1604
|
+
departmentSlug?: string;
|
|
1605
|
+
employmentType?: EmploymentType;
|
|
1606
|
+
status?: EmployeeStatus;
|
|
1607
|
+
hireDate: string;
|
|
1608
|
+
managerId?: string;
|
|
1609
|
+
emergencyContact?: EmployeeEmergencyContact;
|
|
1610
|
+
documents?: EmployeeDocument[];
|
|
1611
|
+
salary?: number;
|
|
1612
|
+
notes?: string;
|
|
1613
|
+
}
|
|
1614
|
+
interface UpdateEmployeeInput {
|
|
1615
|
+
employerId?: string;
|
|
1616
|
+
userId?: string;
|
|
1617
|
+
employeeNumber?: string;
|
|
1618
|
+
firstName?: string;
|
|
1619
|
+
lastName?: string;
|
|
1620
|
+
email?: string;
|
|
1621
|
+
phone?: string;
|
|
1622
|
+
avatar?: string;
|
|
1623
|
+
jobTitle?: string;
|
|
1624
|
+
departmentSlug?: string;
|
|
1625
|
+
employmentType?: EmploymentType;
|
|
1626
|
+
status?: EmployeeStatus;
|
|
1627
|
+
hireDate?: string;
|
|
1628
|
+
terminationDate?: string;
|
|
1629
|
+
managerId?: string;
|
|
1630
|
+
emergencyContact?: EmployeeEmergencyContact;
|
|
1631
|
+
documents?: EmployeeDocument[];
|
|
1632
|
+
salary?: number;
|
|
1633
|
+
notes?: string;
|
|
1634
|
+
}
|
|
1635
|
+
interface CheckInInput {
|
|
1636
|
+
employeeId: string;
|
|
1637
|
+
timestamp?: string | Date;
|
|
1638
|
+
location?: string;
|
|
1639
|
+
notes?: string;
|
|
1640
|
+
}
|
|
1641
|
+
interface CheckOutInput {
|
|
1642
|
+
employeeId: string;
|
|
1643
|
+
timestamp?: string | Date;
|
|
1644
|
+
location?: string;
|
|
1645
|
+
notes?: string;
|
|
1646
|
+
}
|
|
1647
|
+
interface RecordAttendanceManualInput {
|
|
1648
|
+
employerId: string;
|
|
1649
|
+
employeeId: string;
|
|
1650
|
+
date: string;
|
|
1651
|
+
checkInAt: string;
|
|
1652
|
+
checkOutAt?: string;
|
|
1653
|
+
totalHours?: number;
|
|
1654
|
+
overtimeHours?: number;
|
|
1655
|
+
status?: AttendanceStatus;
|
|
1656
|
+
location?: string;
|
|
1657
|
+
notes?: string;
|
|
1658
|
+
}
|
|
1659
|
+
interface CreateLeaveTypeInput {
|
|
1660
|
+
employerId?: string;
|
|
1661
|
+
name: string;
|
|
1662
|
+
code: string;
|
|
1663
|
+
daysAllowedPerYear: number;
|
|
1664
|
+
paid?: boolean;
|
|
1665
|
+
requiresApproval?: boolean;
|
|
1666
|
+
color?: string;
|
|
1667
|
+
description?: string;
|
|
1668
|
+
}
|
|
1669
|
+
interface CreateLeaveRequestInput {
|
|
1670
|
+
employerId?: string;
|
|
1671
|
+
employeeId: string;
|
|
1672
|
+
leaveTypeId: string;
|
|
1673
|
+
startDate: string;
|
|
1674
|
+
endDate: string;
|
|
1675
|
+
daysCount?: number;
|
|
1676
|
+
reason?: string;
|
|
1677
|
+
}
|
|
1678
|
+
interface ApproveLeaveInput {
|
|
1679
|
+
requestId: string;
|
|
1680
|
+
approverId: string;
|
|
1681
|
+
}
|
|
1682
|
+
interface RejectLeaveInput {
|
|
1683
|
+
requestId: string;
|
|
1684
|
+
approverId: string;
|
|
1685
|
+
reason?: string;
|
|
1686
|
+
}
|
|
1687
|
+
interface HRMSEmployeeQuery {
|
|
1688
|
+
employerId?: string;
|
|
1689
|
+
department?: string;
|
|
1690
|
+
employmentType?: EmploymentType;
|
|
1691
|
+
status?: EmployeeStatus;
|
|
1692
|
+
search?: string;
|
|
1693
|
+
page?: number;
|
|
1694
|
+
limit?: number;
|
|
1695
|
+
}
|
|
1696
|
+
interface HRMSAttendanceQuery {
|
|
1697
|
+
employerId?: string;
|
|
1698
|
+
employeeId?: string;
|
|
1699
|
+
date?: string;
|
|
1700
|
+
startDate?: string;
|
|
1701
|
+
endDate?: string;
|
|
1702
|
+
status?: AttendanceStatus;
|
|
1703
|
+
page?: number;
|
|
1704
|
+
limit?: number;
|
|
1705
|
+
}
|
|
1706
|
+
interface HRMSLeaveQuery {
|
|
1707
|
+
employerId?: string;
|
|
1708
|
+
employeeId?: string;
|
|
1709
|
+
leaveTypeId?: string;
|
|
1710
|
+
status?: LeaveRequestStatus;
|
|
1711
|
+
year?: number;
|
|
1712
|
+
page?: number;
|
|
1713
|
+
limit?: number;
|
|
1714
|
+
}
|
|
1715
|
+
interface HRMSPluginOptions {
|
|
1716
|
+
employerCollectionSlug?: string;
|
|
1717
|
+
employeeCollectionSlug?: string;
|
|
1718
|
+
attendanceCollectionSlug?: string;
|
|
1719
|
+
leaveTypeCollectionSlug?: string;
|
|
1720
|
+
leaveRequestCollectionSlug?: string;
|
|
1721
|
+
departmentsTaxonomySlug?: string;
|
|
1722
|
+
designationsTaxonomySlug?: string;
|
|
1723
|
+
apiPrefix?: string;
|
|
1724
|
+
standardWorkDayHours?: number;
|
|
1725
|
+
workScheduleStart?: string;
|
|
1726
|
+
workScheduleEnd?: string;
|
|
1727
|
+
gracePeriodMinutes?: number;
|
|
1728
|
+
enableEmployers?: boolean;
|
|
1729
|
+
enableAttendance?: boolean;
|
|
1730
|
+
enableLeaves?: boolean;
|
|
1731
|
+
}
|
|
1732
|
+
//#endregion
|
|
1733
|
+
//#region src/plugins/hrms/service.d.ts
|
|
1734
|
+
declare class HRMSService {
|
|
1735
|
+
readonly engine: CMSEngine;
|
|
1736
|
+
readonly options: HRMSPluginOptions;
|
|
1737
|
+
readonly employerSlug: string;
|
|
1738
|
+
readonly employeeSlug: string;
|
|
1739
|
+
readonly attendanceSlug: string;
|
|
1740
|
+
readonly leaveTypeSlug: string;
|
|
1741
|
+
readonly leaveRequestSlug: string;
|
|
1742
|
+
readonly departmentsTaxonomy: string;
|
|
1743
|
+
readonly designationsTaxonomy: string;
|
|
1744
|
+
readonly standardWorkDayHours: number;
|
|
1745
|
+
readonly workScheduleStart: string;
|
|
1746
|
+
readonly workScheduleEnd: string;
|
|
1747
|
+
readonly gracePeriodMinutes: number;
|
|
1748
|
+
constructor(engine: CMSEngine, options?: HRMSPluginOptions);
|
|
1749
|
+
private get employersCollection();
|
|
1750
|
+
private get employeesCollection();
|
|
1751
|
+
private get attendanceCollection();
|
|
1752
|
+
private get leaveTypesCollection();
|
|
1753
|
+
private get leaveRequestsCollection();
|
|
1754
|
+
createEmployer(input: CreateEmployerInput, authorId?: string | null): Promise<EmployerItem>;
|
|
1755
|
+
getEmployer(id: string): Promise<EmployerItem | null>;
|
|
1756
|
+
getEmployerBySlug(slug: string): Promise<EmployerItem | null>;
|
|
1757
|
+
updateEmployer(id: string, input: UpdateEmployerInput, authorId?: string | null): Promise<EmployerItem | null>;
|
|
1758
|
+
listEmployers(query?: {
|
|
1759
|
+
status?: "active" | "inactive";
|
|
1760
|
+
page?: number;
|
|
1761
|
+
limit?: number;
|
|
1762
|
+
}): Promise<PaginatedResult<EmployerItem>>;
|
|
1763
|
+
createEmployee(input: CreateEmployeeInput, authorId?: string | null): Promise<EmployeeItem>;
|
|
1764
|
+
getEmployee(id: string): Promise<EmployeeItem | null>;
|
|
1765
|
+
getEmployeeByNumber(employerId: string, employeeNumber: string): Promise<EmployeeItem | null>;
|
|
1766
|
+
updateEmployee(id: string, input: UpdateEmployeeInput, authorId?: string | null): Promise<EmployeeItem | null>;
|
|
1767
|
+
deleteEmployee(id: string): Promise<boolean>;
|
|
1768
|
+
listEmployees(query?: HRMSEmployeeQuery): Promise<PaginatedResult<EmployeeItem>>;
|
|
1769
|
+
getDirectReports(managerId: string): Promise<EmployeeItem[]>;
|
|
1770
|
+
private parseTimeToMinutes;
|
|
1771
|
+
private formatDateString;
|
|
1772
|
+
private getHoursAndMinutes;
|
|
1773
|
+
/**
|
|
1774
|
+
* Check in an employee for today (or specified timestamp).
|
|
1775
|
+
*/
|
|
1776
|
+
checkIn(input: CheckInInput): Promise<AttendanceItem>;
|
|
1777
|
+
/**
|
|
1778
|
+
* Check out an employee for today (or specified timestamp).
|
|
1779
|
+
*/
|
|
1780
|
+
checkOut(input: CheckOutInput): Promise<AttendanceItem>;
|
|
1781
|
+
getDailyAttendance(employeeId: string, date: string): Promise<AttendanceItem | null>;
|
|
1782
|
+
recordAttendanceManual(input: RecordAttendanceManualInput): Promise<AttendanceItem>;
|
|
1783
|
+
listAttendance(query?: HRMSAttendanceQuery): Promise<PaginatedResult<AttendanceItem>>;
|
|
1784
|
+
createLeaveType(input: CreateLeaveTypeInput, authorId?: string | null): Promise<LeaveTypeItem>;
|
|
1785
|
+
getLeaveType(id: string): Promise<LeaveTypeItem | null>;
|
|
1786
|
+
listLeaveTypes(employerId?: string): Promise<LeaveTypeItem[]>;
|
|
1787
|
+
/**
|
|
1788
|
+
* Calculate leave balance report for an employee for a given year.
|
|
1789
|
+
*/
|
|
1790
|
+
calculateLeaveBalance(employeeId: string, year?: number): Promise<EmployeeLeaveBalanceReport>;
|
|
1791
|
+
/**
|
|
1792
|
+
* Submit a new leave request.
|
|
1793
|
+
*/
|
|
1794
|
+
requestLeave(input: CreateLeaveRequestInput, authorId?: string | null): Promise<LeaveRequestItem>;
|
|
1795
|
+
/**
|
|
1796
|
+
* Approve a pending leave request.
|
|
1797
|
+
*/
|
|
1798
|
+
approveLeave(input: ApproveLeaveInput): Promise<LeaveRequestItem>;
|
|
1799
|
+
/**
|
|
1800
|
+
* Reject a pending leave request.
|
|
1801
|
+
*/
|
|
1802
|
+
rejectLeave(input: RejectLeaveInput): Promise<LeaveRequestItem>;
|
|
1803
|
+
/**
|
|
1804
|
+
* Cancel a leave request.
|
|
1805
|
+
*/
|
|
1806
|
+
cancelLeave(requestId: string): Promise<LeaveRequestItem>;
|
|
1807
|
+
listLeaveRequests(query?: HRMSLeaveQuery): Promise<PaginatedResult<LeaveRequestItem>>;
|
|
1808
|
+
}
|
|
1809
|
+
//#endregion
|
|
1810
|
+
//#region src/plugins/hrms/schemas.d.ts
|
|
1811
|
+
/**
|
|
1812
|
+
* Creates the collection configuration for Employers (Organizations / Companies).
|
|
1813
|
+
*/
|
|
1814
|
+
declare function createEmployerCollection(options?: HRMSPluginOptions): CollectionConfig;
|
|
1815
|
+
/**
|
|
1816
|
+
* Creates the collection configuration for Employees.
|
|
1817
|
+
*/
|
|
1818
|
+
declare function createEmployeeCollection(options?: HRMSPluginOptions): CollectionConfig;
|
|
1819
|
+
/**
|
|
1820
|
+
* Creates the collection configuration for Daily Attendance.
|
|
1821
|
+
*/
|
|
1822
|
+
declare function createAttendanceCollection(options?: HRMSPluginOptions): CollectionConfig;
|
|
1823
|
+
/**
|
|
1824
|
+
* Creates the collection configuration for Leave Types.
|
|
1825
|
+
*/
|
|
1826
|
+
declare function createLeaveTypeCollection(options?: HRMSPluginOptions): CollectionConfig;
|
|
1827
|
+
/**
|
|
1828
|
+
* Creates the collection configuration for Leave Requests.
|
|
1829
|
+
*/
|
|
1830
|
+
declare function createLeaveRequestCollection(options?: HRMSPluginOptions): CollectionConfig;
|
|
1831
|
+
/**
|
|
1832
|
+
* Creates the standard HRMS taxonomies: departments and designations.
|
|
1833
|
+
*/
|
|
1834
|
+
declare function createHRMSTaxonomies(options?: HRMSPluginOptions): TaxonomyConfig[];
|
|
1835
|
+
//#endregion
|
|
1836
|
+
//#region src/plugins/hrms/client.d.ts
|
|
1837
|
+
declare class HRMSClient {
|
|
1838
|
+
private client;
|
|
1839
|
+
private options;
|
|
1840
|
+
private service?;
|
|
1841
|
+
private prefix;
|
|
1842
|
+
constructor(client: CMSClient, options?: HRMSPluginOptions);
|
|
1843
|
+
readonly employers: {
|
|
1844
|
+
find: (query?: {
|
|
1845
|
+
status?: "active" | "inactive";
|
|
1846
|
+
page?: number;
|
|
1847
|
+
limit?: number;
|
|
1848
|
+
}) => Promise<PaginatedResult<EmployerItem>>;
|
|
1849
|
+
get: (id: string) => Promise<EmployerItem | null>;
|
|
1850
|
+
create: (input: CreateEmployerInput) => Promise<EmployerItem>;
|
|
1851
|
+
update: (id: string, input: UpdateEmployerInput) => Promise<EmployerItem | null>;
|
|
1852
|
+
};
|
|
1853
|
+
readonly employees: {
|
|
1854
|
+
find: (query?: HRMSEmployeeQuery) => Promise<PaginatedResult<EmployeeItem>>;
|
|
1855
|
+
get: (id: string) => Promise<EmployeeItem | null>;
|
|
1856
|
+
getByNumber: (employerId: string, employeeNumber: string) => Promise<EmployeeItem | null>;
|
|
1857
|
+
create: (input: CreateEmployeeInput) => Promise<EmployeeItem>;
|
|
1858
|
+
update: (id: string, input: UpdateEmployeeInput) => Promise<EmployeeItem | null>;
|
|
1859
|
+
delete: (id: string) => Promise<boolean>;
|
|
1860
|
+
getLeaveBalance: (employeeId: string, year?: number) => Promise<EmployeeLeaveBalanceReport>;
|
|
1861
|
+
getDirectReports: (managerId: string) => Promise<EmployeeItem[]>;
|
|
1862
|
+
};
|
|
1863
|
+
readonly attendance: {
|
|
1864
|
+
checkIn: (input: CheckInInput) => Promise<AttendanceItem>;
|
|
1865
|
+
checkOut: (input: CheckOutInput) => Promise<AttendanceItem>;
|
|
1866
|
+
getDaily: (employeeId: string, date: string) => Promise<AttendanceItem | null>;
|
|
1867
|
+
find: (query?: HRMSAttendanceQuery) => Promise<PaginatedResult<AttendanceItem>>;
|
|
1868
|
+
recordManual: (input: RecordAttendanceManualInput) => Promise<AttendanceItem>;
|
|
1869
|
+
};
|
|
1870
|
+
readonly leaves: {
|
|
1871
|
+
listTypes: (employerId?: string) => Promise<LeaveTypeItem[]>;
|
|
1872
|
+
createType: (input: CreateLeaveTypeInput) => Promise<LeaveTypeItem>;
|
|
1873
|
+
getType: (id: string) => Promise<LeaveTypeItem | null>;
|
|
1874
|
+
findRequests: (query?: HRMSLeaveQuery) => Promise<PaginatedResult<LeaveRequestItem>>;
|
|
1875
|
+
request: (input: CreateLeaveRequestInput) => Promise<LeaveRequestItem>;
|
|
1876
|
+
approve: (input: ApproveLeaveInput) => Promise<LeaveRequestItem>;
|
|
1877
|
+
reject: (input: RejectLeaveInput) => Promise<LeaveRequestItem>;
|
|
1878
|
+
cancel: (requestId: string) => Promise<LeaveRequestItem>;
|
|
1879
|
+
};
|
|
1880
|
+
}
|
|
1881
|
+
/**
|
|
1882
|
+
* Get or create an HRMSClient adapter for a CMSClient.
|
|
1883
|
+
*/
|
|
1884
|
+
declare function getHRMSClient(client: CMSClient, options?: HRMSPluginOptions): HRMSClient;
|
|
1885
|
+
//#endregion
|
|
1886
|
+
//#region src/plugins/hrms/index.d.ts
|
|
1887
|
+
/**
|
|
1888
|
+
* Built-in HRMS plugin factory for @azlib/cms.
|
|
1889
|
+
* Equips the CMS engine with multi-tenant employers, employee profiles,
|
|
1890
|
+
* daily attendance check-in/out tracking, and leave quota approval workflows.
|
|
1891
|
+
*/
|
|
1892
|
+
declare const hrmsPlugin: (options?: void | HRMSPluginOptions | undefined) => CMSPlugin;
|
|
1893
|
+
/**
|
|
1894
|
+
* Retrieve the active HRMSService instance associated with a CMSEngine.
|
|
1895
|
+
*/
|
|
1896
|
+
declare function getHRMSService(engine: CMSEngine, options?: HRMSPluginOptions): HRMSService;
|
|
1897
|
+
//#endregion
|
|
1898
|
+
//#region src/plugins/transfer/types.d.ts
|
|
1899
|
+
type SourceFormat = "json" | "excel" | "csv";
|
|
1900
|
+
type InferredFieldType = "string" | "number" | "boolean" | "date" | "object" | "array" | "unknown";
|
|
1901
|
+
interface SourceFieldSchema {
|
|
1902
|
+
name: string;
|
|
1903
|
+
inferredType: InferredFieldType;
|
|
1904
|
+
sampleValues: unknown[];
|
|
1905
|
+
nullCount: number;
|
|
1906
|
+
totalCount: number;
|
|
1907
|
+
}
|
|
1908
|
+
interface CollectionFieldSummary {
|
|
1909
|
+
name: string;
|
|
1910
|
+
label: string;
|
|
1911
|
+
type: string;
|
|
1912
|
+
required: boolean;
|
|
1913
|
+
unique?: boolean;
|
|
1914
|
+
description?: string;
|
|
1915
|
+
defaultValue?: unknown;
|
|
1916
|
+
targetCollection?: string;
|
|
1917
|
+
options?: readonly (string | {
|
|
1918
|
+
label: string;
|
|
1919
|
+
value: string | number;
|
|
1920
|
+
})[];
|
|
1921
|
+
}
|
|
1922
|
+
interface CollectionSchemaSummary {
|
|
1923
|
+
slug: string;
|
|
1924
|
+
label: string;
|
|
1925
|
+
singularLabel: string;
|
|
1926
|
+
description?: string;
|
|
1927
|
+
fields: CollectionFieldSummary[];
|
|
1928
|
+
taxonomies: readonly string[];
|
|
1929
|
+
}
|
|
1930
|
+
interface SuggestedMappingRule {
|
|
1931
|
+
sourceField: string;
|
|
1932
|
+
targetField: string;
|
|
1933
|
+
confidence: number;
|
|
1934
|
+
}
|
|
1935
|
+
interface SourceInspectionResult {
|
|
1936
|
+
format: SourceFormat;
|
|
1937
|
+
sheets?: string[];
|
|
1938
|
+
selectedSheet?: string;
|
|
1939
|
+
totalRows: number;
|
|
1940
|
+
sourceFields: SourceFieldSchema[];
|
|
1941
|
+
targetSchema?: CollectionSchemaSummary;
|
|
1942
|
+
suggestedMapping?: SuggestedMappingRule[];
|
|
1943
|
+
previewRows: Record<string, unknown>[];
|
|
1944
|
+
}
|
|
1945
|
+
type FieldTransformPreset = "trim" | "lowercase" | "uppercase" | "number" | "boolean" | "date" | "json" | "slug" | "split_comma" | "identity";
|
|
1946
|
+
type FieldTransformFn = (value: unknown, record: Record<string, unknown>) => unknown;
|
|
1947
|
+
interface FieldMappingRule {
|
|
1948
|
+
/** Column / property name in source data */
|
|
1949
|
+
sourceField: string;
|
|
1950
|
+
/** Field name in target CMS collection */
|
|
1951
|
+
targetField: string;
|
|
1952
|
+
/** Transformation preset or custom transform callback */
|
|
1953
|
+
transform?: FieldTransformPreset | FieldTransformFn;
|
|
1954
|
+
/** Default fallback value if source value is null, undefined, or empty string */
|
|
1955
|
+
defaultValue?: unknown;
|
|
1956
|
+
/** If true, this field must be present and valid */
|
|
1957
|
+
required?: boolean;
|
|
1958
|
+
}
|
|
1959
|
+
interface MappingOptions {
|
|
1960
|
+
/** Strip/ignore source fields that are not explicitly mapped (default: true) */
|
|
1961
|
+
ignoreUnmappedFields?: boolean;
|
|
1962
|
+
/** Default content item status: 'draft' | 'published' | 'archived' */
|
|
1963
|
+
defaultStatus?: "draft" | "published" | "archived";
|
|
1964
|
+
/** Mapped field that supplies status value */
|
|
1965
|
+
statusField?: string;
|
|
1966
|
+
/** Auto generate unique slug from title if no slug is mapped (default: true) */
|
|
1967
|
+
autoGenerateSlug?: boolean;
|
|
1968
|
+
/** Worksheet name for multi-sheet Excel files */
|
|
1969
|
+
sheetName?: string;
|
|
1970
|
+
/** Date format parsing hint */
|
|
1971
|
+
dateFormat?: string;
|
|
1972
|
+
/** Action when duplicate unique field is encountered */
|
|
1973
|
+
onDuplicate?: "error" | "update" | "skip";
|
|
1974
|
+
/** Key field to identify existing record when updating (defaults to id, slug, or unique field) */
|
|
1975
|
+
uniqueIdentifierField?: string;
|
|
1976
|
+
/** Abort entire import on first error (default: false) */
|
|
1977
|
+
abortOnError?: boolean;
|
|
1978
|
+
}
|
|
1979
|
+
interface DataMappingDefinition {
|
|
1980
|
+
id?: string;
|
|
1981
|
+
name?: string;
|
|
1982
|
+
collectionSlug: string;
|
|
1983
|
+
fields: FieldMappingRule[];
|
|
1984
|
+
options?: MappingOptions;
|
|
1985
|
+
}
|
|
1986
|
+
type TransferErrorCode = "REQUIRED_FIELD_MISSING" | "INVALID_DATA_TYPE" | "INVALID_SELECT_OPTION" | "CONSTRAINT_UNIQUE_VIOLATION" | "CONSTRAINT_FOREIGN_KEY_VIOLATION" | "VALIDATION_RULE_FAILED" | "TRANSFORM_ERROR" | "PARSE_ERROR";
|
|
1987
|
+
interface TransferErrorDetail {
|
|
1988
|
+
rowNumber: number;
|
|
1989
|
+
field?: string;
|
|
1990
|
+
value?: unknown;
|
|
1991
|
+
code: TransferErrorCode;
|
|
1992
|
+
reason: string;
|
|
1993
|
+
}
|
|
1994
|
+
interface ValidationPreviewRow {
|
|
1995
|
+
rowNumber: number;
|
|
1996
|
+
raw: Record<string, unknown>;
|
|
1997
|
+
mapped: Record<string, unknown>;
|
|
1998
|
+
valid: boolean;
|
|
1999
|
+
errors?: TransferErrorDetail[];
|
|
2000
|
+
}
|
|
2001
|
+
interface ValidationResult {
|
|
2002
|
+
valid: boolean;
|
|
2003
|
+
totalRows: number;
|
|
2004
|
+
validCount: number;
|
|
2005
|
+
errorCount: number;
|
|
2006
|
+
errors: TransferErrorDetail[];
|
|
2007
|
+
previewRows: ValidationPreviewRow[];
|
|
2008
|
+
}
|
|
2009
|
+
interface TransferImportOptions {
|
|
2010
|
+
onDuplicate?: "error" | "update" | "skip";
|
|
2011
|
+
uniqueIdentifierField?: string;
|
|
2012
|
+
abortOnError?: boolean;
|
|
2013
|
+
authorId?: string | null;
|
|
2014
|
+
revisionNote?: string;
|
|
2015
|
+
dryRun?: boolean;
|
|
2016
|
+
}
|
|
2017
|
+
interface TransferImportResult {
|
|
2018
|
+
success: boolean;
|
|
2019
|
+
collectionSlug: string;
|
|
2020
|
+
totalRows: number;
|
|
2021
|
+
importedCount: number;
|
|
2022
|
+
updatedCount: number;
|
|
2023
|
+
skippedCount: number;
|
|
2024
|
+
failedCount: number;
|
|
2025
|
+
createdIds: string[];
|
|
2026
|
+
updatedIds: string[];
|
|
2027
|
+
errors: TransferErrorDetail[];
|
|
2028
|
+
}
|
|
2029
|
+
interface TransferExportOptions {
|
|
2030
|
+
collectionSlug?: string;
|
|
2031
|
+
format?: SourceFormat;
|
|
2032
|
+
mapping?: DataMappingDefinition;
|
|
2033
|
+
fields?: string[];
|
|
2034
|
+
query?: ContentQueryOptions;
|
|
2035
|
+
fileName?: string;
|
|
2036
|
+
sheetName?: string;
|
|
2037
|
+
includeId?: boolean;
|
|
2038
|
+
includeTimestamps?: boolean;
|
|
2039
|
+
}
|
|
2040
|
+
interface TransferExportResult {
|
|
2041
|
+
format: SourceFormat;
|
|
2042
|
+
data: Uint8Array | string;
|
|
2043
|
+
mimeType: string;
|
|
2044
|
+
fileName: string;
|
|
2045
|
+
totalRecords: number;
|
|
2046
|
+
}
|
|
2047
|
+
interface TransferPluginOptions {
|
|
2048
|
+
apiPrefix?: string;
|
|
2049
|
+
maxBatchSize?: number;
|
|
2050
|
+
enableRoutes?: boolean;
|
|
2051
|
+
}
|
|
2052
|
+
//#endregion
|
|
2053
|
+
//#region src/plugins/transfer/parsers/json.d.ts
|
|
2054
|
+
/**
|
|
2055
|
+
* @azlib/cms - Universal JSON Data Parser
|
|
2056
|
+
*/
|
|
2057
|
+
declare function parseJsonSource(input: string | Uint8Array | Buffer | unknown): Record<string, unknown>[];
|
|
2058
|
+
//#endregion
|
|
2059
|
+
//#region src/plugins/transfer/parsers/csv.d.ts
|
|
2060
|
+
/**
|
|
2061
|
+
* @azlib/cms - Universal RFC 4180 CSV Data Parser
|
|
2062
|
+
*/
|
|
2063
|
+
declare function parseCsvSource(input: string | Uint8Array | Buffer): Record<string, unknown>[];
|
|
2064
|
+
//#endregion
|
|
2065
|
+
//#region src/plugins/transfer/parsers/excel.d.ts
|
|
2066
|
+
/**
|
|
2067
|
+
* @azlib/cms - Universal Excel (.xlsx) Data Parser using ExcelJS
|
|
2068
|
+
*/
|
|
2069
|
+
interface ParseExcelResult {
|
|
2070
|
+
sheets: string[];
|
|
2071
|
+
selectedSheet: string;
|
|
2072
|
+
records: Record<string, unknown>[];
|
|
2073
|
+
}
|
|
2074
|
+
declare function parseExcelSource(input: Buffer | Uint8Array | ArrayBuffer, options?: {
|
|
2075
|
+
sheetName?: string;
|
|
2076
|
+
}): Promise<ParseExcelResult>;
|
|
2077
|
+
//#endregion
|
|
2078
|
+
//#region src/plugins/transfer/parsers/index.d.ts
|
|
2079
|
+
interface ParseSourceOptions {
|
|
2080
|
+
format?: SourceFormat;
|
|
2081
|
+
fileName?: string;
|
|
2082
|
+
sheetName?: string;
|
|
2083
|
+
}
|
|
2084
|
+
interface ParsedSourceResult {
|
|
2085
|
+
format: SourceFormat;
|
|
2086
|
+
sheets?: string[];
|
|
2087
|
+
selectedSheet?: string;
|
|
2088
|
+
records: Record<string, unknown>[];
|
|
2089
|
+
}
|
|
2090
|
+
/**
|
|
2091
|
+
* Detect the format of an input payload if not explicitly provided.
|
|
2092
|
+
*/
|
|
2093
|
+
declare function detectFormat(input: unknown, fileName?: string): SourceFormat;
|
|
2094
|
+
/**
|
|
2095
|
+
* Universal source parser that handles JSON, CSV, and Excel (.xlsx).
|
|
2096
|
+
*/
|
|
2097
|
+
declare function parseSource(input: unknown, options?: ParseSourceOptions): Promise<ParsedSourceResult>;
|
|
2098
|
+
//#endregion
|
|
2099
|
+
//#region src/plugins/transfer/service.d.ts
|
|
2100
|
+
declare class TransferService {
|
|
2101
|
+
readonly engine: CMSEngine;
|
|
2102
|
+
readonly options: TransferPluginOptions;
|
|
2103
|
+
private presets;
|
|
2104
|
+
constructor(engine: CMSEngine, options?: TransferPluginOptions);
|
|
2105
|
+
/**
|
|
2106
|
+
* List all registered collections across all active plugins in the engine.
|
|
2107
|
+
*/
|
|
2108
|
+
listCollections(): CollectionSchemaSummary[];
|
|
2109
|
+
/**
|
|
2110
|
+
* Get the collection schema summary for a specific collection slug.
|
|
2111
|
+
*/
|
|
2112
|
+
getCollectionSchema(collectionSlug: string): CollectionSchemaSummary;
|
|
2113
|
+
/**
|
|
2114
|
+
* Register a reusable data mapping preset.
|
|
2115
|
+
*/
|
|
2116
|
+
registerPreset(preset: DataMappingDefinition): void;
|
|
2117
|
+
/**
|
|
2118
|
+
* Get a registered preset by ID.
|
|
2119
|
+
*/
|
|
2120
|
+
getPreset(id: string): DataMappingDefinition | undefined;
|
|
2121
|
+
/**
|
|
2122
|
+
* Get all registered presets, optionally filtered by target collection.
|
|
2123
|
+
*/
|
|
2124
|
+
getPresets(collectionSlug?: string): DataMappingDefinition[];
|
|
2125
|
+
/**
|
|
2126
|
+
* Generate a 1:1 default mapping template for any collection.
|
|
2127
|
+
*/
|
|
2128
|
+
getMappingTemplate(collectionSlug: string): DataMappingDefinition;
|
|
2129
|
+
/**
|
|
2130
|
+
* Inspect any source payload or file (JSON, Excel, CSV) to extract headers,
|
|
2131
|
+
* infer data types, and generate auto-mapping suggestions against a target collection.
|
|
2132
|
+
*/
|
|
2133
|
+
inspectSource(input: unknown, options?: ParseSourceOptions & {
|
|
2134
|
+
collectionSlug?: string;
|
|
2135
|
+
previewLimit?: number;
|
|
2136
|
+
}): Promise<SourceInspectionResult>;
|
|
2137
|
+
/**
|
|
2138
|
+
* Dry-run validation of a source batch against a target collection's schema
|
|
2139
|
+
* and live database constraints without committing any changes.
|
|
2140
|
+
*/
|
|
2141
|
+
validateImport(collectionSlug: string, input: unknown, mapping?: DataMappingDefinition, options?: ParseSourceOptions & {
|
|
2142
|
+
onDuplicate?: "error" | "update" | "skip";
|
|
2143
|
+
previewLimit?: number;
|
|
2144
|
+
}): Promise<ValidationResult>;
|
|
2145
|
+
/**
|
|
2146
|
+
* Execute an import batch from raw data or an external file (JSON, Excel, CSV)
|
|
2147
|
+
* into a target CMS collection.
|
|
2148
|
+
*/
|
|
2149
|
+
importData(collectionSlug: string, input: unknown, mapping?: DataMappingDefinition, options?: TransferImportOptions & ParseSourceOptions): Promise<TransferImportResult>;
|
|
2150
|
+
/**
|
|
2151
|
+
* Export CMS collection records to JSON, Excel (.xlsx), or CSV.
|
|
2152
|
+
*/
|
|
2153
|
+
exportData(collectionSlug: string, options?: TransferExportOptions): Promise<TransferExportResult>;
|
|
2154
|
+
private getCollectionConfigOrThrow;
|
|
2155
|
+
private detectUniqueField;
|
|
2156
|
+
}
|
|
2157
|
+
//#endregion
|
|
2158
|
+
//#region src/plugins/transfer/client.d.ts
|
|
2159
|
+
declare class TransferClient {
|
|
2160
|
+
private client;
|
|
2161
|
+
private options;
|
|
2162
|
+
private service?;
|
|
2163
|
+
private prefix;
|
|
2164
|
+
constructor(client: CMSClient, options?: TransferPluginOptions);
|
|
2165
|
+
/**
|
|
2166
|
+
* List all registered collections across all active plugins.
|
|
2167
|
+
*/
|
|
2168
|
+
listCollections(): Promise<CollectionSchemaSummary[]>;
|
|
2169
|
+
/**
|
|
2170
|
+
* Get the collection schema and default mapping template.
|
|
2171
|
+
*/
|
|
2172
|
+
getSchema(collectionSlug: string): Promise<{
|
|
2173
|
+
schema: CollectionSchemaSummary;
|
|
2174
|
+
template: DataMappingDefinition;
|
|
2175
|
+
}>;
|
|
2176
|
+
/**
|
|
2177
|
+
* Inspect a source file or payload.
|
|
2178
|
+
*/
|
|
2179
|
+
inspect(data: unknown, options?: {
|
|
2180
|
+
collectionSlug?: string;
|
|
2181
|
+
format?: SourceFormat;
|
|
2182
|
+
fileName?: string;
|
|
2183
|
+
sheetName?: string;
|
|
2184
|
+
}): Promise<SourceInspectionResult>;
|
|
2185
|
+
/**
|
|
2186
|
+
* Dry-run validation of a source batch against a target collection and database constraints.
|
|
2187
|
+
*/
|
|
2188
|
+
preview(collectionSlug: string, data: unknown, mapping?: DataMappingDefinition, options?: {
|
|
2189
|
+
format?: SourceFormat;
|
|
2190
|
+
fileName?: string;
|
|
2191
|
+
sheetName?: string;
|
|
2192
|
+
onDuplicate?: "error" | "update" | "skip";
|
|
2193
|
+
}): Promise<ValidationResult>;
|
|
2194
|
+
/**
|
|
2195
|
+
* Execute an import batch into a target collection.
|
|
2196
|
+
*/
|
|
2197
|
+
import(collectionSlug: string, data: unknown, mapping?: DataMappingDefinition, options?: TransferImportOptions & {
|
|
2198
|
+
format?: SourceFormat;
|
|
2199
|
+
fileName?: string;
|
|
2200
|
+
sheetName?: string;
|
|
2201
|
+
}): Promise<TransferImportResult>;
|
|
2202
|
+
/**
|
|
2203
|
+
* Export collection records to JSON, Excel, or CSV.
|
|
2204
|
+
*/
|
|
2205
|
+
export(collectionSlug: string, options?: TransferExportOptions): Promise<TransferExportResult>;
|
|
2206
|
+
}
|
|
2207
|
+
/**
|
|
2208
|
+
* Access or instantiate the TransferClient associated with a CMSClient instance.
|
|
2209
|
+
*/
|
|
2210
|
+
declare function getTransferClient(client: CMSClient, options?: TransferPluginOptions): TransferClient;
|
|
2211
|
+
//#endregion
|
|
2212
|
+
//#region src/plugins/transfer/mapping.d.ts
|
|
2213
|
+
/**
|
|
2214
|
+
* Apply a mapping definition to transform an external raw record into a CMS content payload.
|
|
2215
|
+
*/
|
|
2216
|
+
declare function mapSourceRecord(rawRecord: Record<string, unknown>, mapping: DataMappingDefinition): {
|
|
2217
|
+
data: Record<string, unknown>;
|
|
2218
|
+
title?: string;
|
|
2219
|
+
slug?: string;
|
|
2220
|
+
status?: string;
|
|
2221
|
+
};
|
|
2222
|
+
/**
|
|
2223
|
+
* Applies transform preset or custom function to a field value.
|
|
2224
|
+
*/
|
|
2225
|
+
declare function applyFieldTransform(rule: FieldMappingRule, value: unknown, rawRecord: Record<string, unknown>): unknown;
|
|
2226
|
+
/**
|
|
2227
|
+
* Reverse mapping for export: transforms a CMS ContentItem into an external export record.
|
|
2228
|
+
*/
|
|
2229
|
+
declare function mapCmsItemForExport(item: ContentItem<Record<string, unknown>>, mapping?: DataMappingDefinition, options?: {
|
|
2230
|
+
includeId?: boolean;
|
|
2231
|
+
includeTimestamps?: boolean;
|
|
2232
|
+
}): Record<string, unknown>;
|
|
2233
|
+
//#endregion
|
|
2234
|
+
//#region src/plugins/transfer/inspect.d.ts
|
|
2235
|
+
interface InspectOptions extends ParseSourceOptions {
|
|
2236
|
+
collectionConfig?: CollectionConfig;
|
|
2237
|
+
previewLimit?: number;
|
|
2238
|
+
}
|
|
2239
|
+
/**
|
|
2240
|
+
* Inspect an uploaded source file or payload to discover its schema,
|
|
2241
|
+
* infer column types, and generate auto-mapping suggestions against a target collection.
|
|
2242
|
+
*/
|
|
2243
|
+
declare function inspectSource(input: unknown, options?: InspectOptions): Promise<SourceInspectionResult>;
|
|
2244
|
+
/**
|
|
2245
|
+
* Summarize a CMS CollectionConfig into consumer-friendly schema details.
|
|
2246
|
+
*/
|
|
2247
|
+
declare function summarizeCollection(config: CollectionConfig): CollectionSchemaSummary;
|
|
2248
|
+
/**
|
|
2249
|
+
* Generates intelligent auto-mapping suggestions matching source headers to CMS fields.
|
|
2250
|
+
*/
|
|
2251
|
+
declare function generateSuggestedMapping(sourceHeaders: string[], targetSchema: CollectionSchemaSummary): SuggestedMappingRule[];
|
|
2252
|
+
//#endregion
|
|
2253
|
+
//#region src/plugins/transfer/validator.d.ts
|
|
2254
|
+
interface ValidateTransferOptions {
|
|
2255
|
+
storage?: CMSStorageAdapter;
|
|
2256
|
+
onDuplicate?: "error" | "update" | "skip";
|
|
2257
|
+
previewLimit?: number;
|
|
2258
|
+
}
|
|
2259
|
+
/**
|
|
2260
|
+
* Validates a batch of source records against a target CMS collection configuration
|
|
2261
|
+
* and live database constraints.
|
|
2262
|
+
*/
|
|
2263
|
+
declare function validateTransferBatch(rawRecords: Record<string, unknown>[], mapping: DataMappingDefinition, collectionConfig: CollectionConfig, options?: ValidateTransferOptions): Promise<ValidationResult>;
|
|
2264
|
+
//#endregion
|
|
2265
|
+
//#region src/plugins/transfer/serializers/json.d.ts
|
|
2266
|
+
/**
|
|
2267
|
+
* @azlib/cms - Universal JSON Serializer
|
|
2268
|
+
*/
|
|
2269
|
+
interface SerializeJsonOptions {
|
|
2270
|
+
pretty?: boolean;
|
|
2271
|
+
}
|
|
2272
|
+
declare function serializeJson(records: Record<string, unknown>[], options?: SerializeJsonOptions): string;
|
|
2273
|
+
//#endregion
|
|
2274
|
+
//#region src/plugins/transfer/serializers/csv.d.ts
|
|
2275
|
+
/**
|
|
2276
|
+
* @azlib/cms - Universal RFC 4180 CSV Serializer
|
|
2277
|
+
*/
|
|
2278
|
+
interface SerializeCsvOptions {
|
|
2279
|
+
columns?: {
|
|
2280
|
+
key: string;
|
|
2281
|
+
header: string;
|
|
2282
|
+
}[];
|
|
2283
|
+
}
|
|
2284
|
+
declare function serializeCsv(records: Record<string, unknown>[], options?: SerializeCsvOptions): string;
|
|
2285
|
+
//#endregion
|
|
2286
|
+
//#region src/plugins/transfer/serializers/excel.d.ts
|
|
2287
|
+
/**
|
|
2288
|
+
* @azlib/cms - Universal Excel (.xlsx) Serializer using ExcelJS
|
|
2289
|
+
*/
|
|
2290
|
+
interface SerializeExcelOptions {
|
|
2291
|
+
sheetName?: string;
|
|
2292
|
+
columns?: {
|
|
2293
|
+
key: string;
|
|
2294
|
+
header: string;
|
|
2295
|
+
width?: number;
|
|
2296
|
+
}[];
|
|
2297
|
+
}
|
|
2298
|
+
declare function serializeExcel(records: Record<string, unknown>[], options?: SerializeExcelOptions): Promise<Uint8Array>;
|
|
2299
|
+
//#endregion
|
|
2300
|
+
//#region src/plugins/transfer/serializers/index.d.ts
|
|
2301
|
+
interface SerializeSourceOptions {
|
|
2302
|
+
format?: SourceFormat;
|
|
2303
|
+
fileName?: string;
|
|
2304
|
+
sheetName?: string;
|
|
2305
|
+
columns?: {
|
|
2306
|
+
key: string;
|
|
2307
|
+
header: string;
|
|
2308
|
+
width?: number;
|
|
2309
|
+
}[];
|
|
2310
|
+
}
|
|
2311
|
+
declare function serializeSource(records: Record<string, unknown>[], options?: SerializeSourceOptions): Promise<TransferExportResult>;
|
|
2312
|
+
//#endregion
|
|
2313
|
+
//#region src/plugins/transfer/presets/hrms.d.ts
|
|
2314
|
+
/**
|
|
2315
|
+
* Preconfigured mapping definition for importing and exporting HRMS Employers.
|
|
2316
|
+
*/
|
|
2317
|
+
declare const HRMS_EMPLOYER_TRANSFER_PRESET: DataMappingDefinition;
|
|
2318
|
+
/**
|
|
2319
|
+
* Preconfigured mapping definition for importing and exporting HRMS Employees.
|
|
2320
|
+
*/
|
|
2321
|
+
declare const HRMS_EMPLOYEE_TRANSFER_PRESET: DataMappingDefinition;
|
|
2322
|
+
//#endregion
|
|
2323
|
+
//#region src/plugins/transfer/index.d.ts
|
|
2324
|
+
/**
|
|
2325
|
+
* Built-in Universal Data Transfer plugin factory for @azlib/cms.
|
|
2326
|
+
* Equips the CMS engine with dynamic, schema-driven import and export capabilities
|
|
2327
|
+
* across all collections, featuring file schema discovery, definition mapping,
|
|
2328
|
+
* multi-level data validation, database constraint verification, and multi-format support.
|
|
2329
|
+
*/
|
|
2330
|
+
declare const transferPlugin: (options?: void | TransferPluginOptions | undefined) => CMSPlugin;
|
|
2331
|
+
/**
|
|
2332
|
+
* Retrieve the active TransferService instance associated with a CMSEngine.
|
|
2333
|
+
*/
|
|
2334
|
+
declare function getTransferService(engine: CMSEngine, options?: TransferPluginOptions): TransferService;
|
|
2335
|
+
//#endregion
|
|
2336
|
+
export { type ActionCallback, ApproveLeaveInput, AttendanceData, AttendanceItem, AttendanceStatus, type BooleanFieldOptions, CMSCapability, CMSClient, type CMSClientOptions, CMSConfig, CMSEngine, type CMSPlugin, type CMSPluginContext, CMSRouter, type CMSStorageAdapter, CMSUser, CartCalculationInput, CartCalculationResult, CartItemInput, CheckInInput, CheckOutInput, type ClientCollectionApi, CollectionConfig, CollectionFieldSummary, type CollectionOptions, CollectionSchemaSummary, type CollectionService, ContentItem, ContentLifecycle, ContentQueryOptions, ContentStatus, type CreateContentInput, CreateDiscountInput, CreateEmployeeInput, CreateEmployerInput, CreateLeaveRequestInput, CreateLeaveTypeInput, CreateOrderInput, CreateProductInput, type CustomRouteHandler, DEFAULT_COLLECTIONS, DEFAULT_ROLE_CAPABILITIES, DataMappingDefinition, type DateFieldOptions, DiscountData, DiscountItem, DiscountStatus, DiscountType, DiscountValidationResult, EcommerceClient, EcommercePluginOptions, EcommerceProductQuery, EcommerceService, EmployeeData, EmployeeDocument, EmployeeEmergencyContact, EmployeeItem, EmployeeLeaveBalanceReport, EmployeeStatus, EmployerData, EmployerItem, EmployerStatus, EmployerWorkSchedule, EmploymentType, FieldDefinition, FieldMappingRule, FieldTransformFn, FieldTransformPreset, FieldType, type FilterCallback, HRMSAttendanceQuery, HRMSClient, HRMSEmployeeQuery, HRMSLeaveQuery, HRMSPluginOptions, HRMSService, HRMS_EMPLOYEE_TRANSFER_PRESET, HRMS_EMPLOYER_TRANSFER_PRESET, type HookEntry, HooksManager, type ImageFieldOptions, InferredFieldType, InspectOptions, type JsonFieldOptions, LeaveBalanceItem, LeaveRequestData, LeaveRequestItem, LeaveRequestStatus, LeaveTypeData, LeaveTypeItem, MappingOptions, MediaItem, MediaManager, type MediaUploadInput, MemoryStorageAdapter, type NumberFieldOptions, OptionItem, OptionsManager, OrderAddress, OrderData, OrderItem, OrderLineItem, OrderStatus, PaginatedResult, ParseExcelResult, ParseSourceOptions, ParsedSourceResult, ProductData, ProductImage, ProductItem, ProductStatus, ProductVariant, RBACManager, RecordAttendanceManualInput, RejectLeaveInput, type RelationshipFieldOptions, type RepeaterFieldOptions, RevisionDiff, RevisionDiffField, RevisionManager, RevisionRecord, type RichTextFieldOptions, type RouteContext, type SelectFieldOptions, SelectOption, SerializeCsvOptions, SerializeExcelOptions, SerializeJsonOptions, SerializeSourceOptions, SiteConfig, type SlugFieldOptions, SourceFieldSchema, SourceFormat, SourceInspectionResult, SuggestedMappingRule, type SyncFilterCallback, TaxonomyConfig, type TaxonomyFieldOptions, TaxonomyManager, TermItem, TermTreeItem, type TextFieldOptions, TransferClient, TransferErrorCode, TransferErrorDetail, TransferExportOptions, TransferExportResult, TransferImportOptions, TransferImportResult, TransferPluginOptions, TransferService, type UpdateContentInput, UpdateEmployeeInput, UpdateEmployerInput, UpdateProductInput, UserRole, VALID_STATUS_TRANSITIONS, ValidateTransferOptions, ValidationPreviewRow, ValidationResult, applyFieldTransform, collection, createAttendanceCollection, createCMSEngine, createCMSRouter, createCmsClient, createDiscountCollection, createEcommerceTaxonomies, createEmployeeCollection, createEmployerCollection, createHRMSTaxonomies, createLeaveRequestCollection, createLeaveTypeCollection, createOrderCollection, createProductCollection, defaultHooks, defineConfig, definePlugin, detectFormat, ecommercePlugin, fields, generateSuggestedMapping, getEcommerceClient, getEcommerceService, getHRMSClient, getHRMSService, getTransferClient, getTransferService, hrmsPlugin, inspectSource, mapCmsItemForExport, mapSourceRecord, normalizeConfig, parseCsvSource, parseExcelSource, parseJsonSource, parseSource, resolveUniqueSlug, serializeCsv, serializeExcel, serializeJson, serializeSource, slugify, summarizeCollection, transferPlugin, validateAndNormalizeData, validateTransferBatch };
|
|
1453
2337
|
//# sourceMappingURL=index.d.cts.map
|