@classytic/commerce-sdk 0.1.1 → 0.2.1
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 +187 -74
- package/dist/accounting/api/account.d.ts +49 -0
- package/dist/accounting/api/account.js +45 -0
- package/dist/accounting/api/budget.d.ts +76 -0
- package/dist/accounting/api/budget.js +82 -0
- package/dist/accounting/api/constants.d.ts +58 -0
- package/dist/accounting/api/constants.js +79 -0
- package/dist/accounting/api/fiscal-period.d.ts +31 -0
- package/dist/accounting/api/fiscal-period.js +30 -0
- package/dist/accounting/api/index.d.ts +7 -0
- package/dist/accounting/api/journal-entry.d.ts +66 -0
- package/dist/accounting/api/journal-entry.js +72 -0
- package/dist/accounting/api/posting.d.ts +55 -0
- package/dist/accounting/api/posting.js +70 -0
- package/dist/accounting/api/reports.d.ts +63 -0
- package/dist/accounting/api/reports.js +81 -0
- package/dist/accounting/hooks/account.d.ts +29 -0
- package/dist/accounting/hooks/account.js +102 -0
- package/dist/accounting/hooks/budget.d.ts +39 -0
- package/dist/accounting/hooks/budget.js +106 -0
- package/dist/accounting/hooks/fiscal-period.d.ts +22 -0
- package/dist/accounting/hooks/fiscal-period.js +52 -0
- package/dist/accounting/hooks/index.d.ts +6 -0
- package/dist/accounting/hooks/journal-entry.d.ts +37 -0
- package/dist/accounting/hooks/journal-entry.js +89 -0
- package/dist/accounting/hooks/posting.d.ts +128 -0
- package/dist/accounting/hooks/posting.js +119 -0
- package/dist/accounting/hooks/reports.d.ts +32 -0
- package/dist/accounting/hooks/reports.js +131 -0
- package/dist/accounting/index.d.ts +15 -0
- package/dist/accounting/index.js +15 -0
- package/dist/accounting/types/index.d.ts +375 -0
- package/dist/analytics/api/analytics.d.ts +16 -0
- package/dist/analytics/api/analytics.js +27 -0
- package/dist/analytics/api/index.d.ts +1 -0
- package/dist/analytics/hooks/analytics.d.ts +12 -0
- package/dist/analytics/hooks/analytics.js +33 -0
- package/dist/analytics/hooks/index.d.ts +1 -0
- package/dist/analytics/index.d.ts +4 -27
- package/dist/analytics/index.js +4 -6
- package/dist/analytics/types.d.ts +46 -0
- package/dist/audit/api/audit.d.ts +17 -0
- package/dist/audit/api/audit.js +21 -0
- package/dist/audit/hooks/audit.d.ts +17 -0
- package/dist/audit/hooks/audit.js +38 -0
- package/dist/audit/index.d.ts +4 -0
- package/dist/audit/index.js +4 -0
- package/dist/audit/types/index.d.ts +32 -0
- package/dist/auth/api/user-data.d.ts +30 -0
- package/dist/auth/api/user-data.js +70 -0
- package/dist/auth/hooks/user-search.d.ts +32 -0
- package/dist/auth/hooks/user-search.js +51 -0
- package/dist/auth/index.d.ts +4 -39
- package/dist/auth/index.js +5 -5
- package/dist/auth/types.d.ts +46 -0
- package/dist/auth/types.js +27 -0
- package/dist/catalog/api/category.d.ts +97 -0
- package/dist/catalog/api/category.js +109 -0
- package/dist/catalog/api/index.d.ts +4 -0
- package/dist/catalog/api/product.d.ts +136 -0
- package/dist/catalog/api/product.js +142 -0
- package/dist/catalog/api/review.d.ts +32 -0
- package/dist/catalog/api/review.js +41 -0
- package/dist/catalog/api/size-guide.d.ts +46 -0
- package/dist/catalog/api/size-guide.js +58 -0
- package/dist/catalog/hooks/category.d.ts +201 -0
- package/dist/catalog/hooks/category.js +295 -0
- package/dist/catalog/hooks/index.d.ts +4 -0
- package/dist/catalog/hooks/product.d.ts +165 -0
- package/dist/catalog/hooks/product.js +267 -0
- package/dist/catalog/hooks/review.d.ts +18 -0
- package/dist/catalog/hooks/review.js +38 -0
- package/dist/catalog/hooks/size-guide.d.ts +136 -0
- package/dist/catalog/hooks/size-guide.js +173 -0
- package/dist/catalog/index.d.ts +13 -571
- package/dist/catalog/index.js +10 -9
- package/dist/catalog/prefetch.d.ts +29 -0
- package/dist/catalog/prefetch.js +32 -0
- package/dist/catalog/types/category.d.ts +168 -0
- package/dist/catalog/types/index.d.ts +4 -0
- package/dist/catalog/types/product.d.ts +261 -0
- package/dist/catalog/types/review.d.ts +48 -0
- package/dist/catalog/types/size-guide.d.ts +118 -0
- package/dist/client.d.ts +138 -0
- package/dist/client.js +129 -0
- package/dist/content/api/cms.d.ts +27 -0
- package/dist/content/api/cms.js +43 -0
- package/dist/content/api/index.d.ts +2 -0
- package/dist/content/api/media.d.ts +74 -0
- package/dist/content/api/media.js +77 -0
- package/dist/content/hooks/cms.d.ts +31 -0
- package/dist/content/hooks/cms.js +62 -0
- package/dist/content/hooks/index.d.ts +2 -0
- package/dist/content/hooks/media.d.ts +74 -0
- package/dist/content/hooks/media.js +153 -0
- package/dist/content/index.d.ts +7 -309
- package/dist/content/index.js +6 -6
- package/dist/content/types/cms.d.ts +390 -0
- package/dist/content/types/media.d.ts +110 -0
- package/dist/core/api-factory.d.ts +17 -0
- package/dist/core/api-factory.js +39 -0
- package/dist/core/api-handler.d.ts +53 -0
- package/dist/core/api-handler.js +89 -0
- package/dist/core/index.d.ts +4 -166
- package/dist/core/index.js +4 -5
- package/dist/core/prefetch.d.ts +2 -0
- package/dist/core/prefetch.js +3 -0
- package/dist/core/react/crud.factory.d.ts +3 -0
- package/dist/core/react/crud.factory.js +5 -0
- package/dist/core/react/index.d.ts +4 -0
- package/dist/core/react/index.js +7 -0
- package/dist/core/react/mutation.factory.d.ts +9 -0
- package/dist/core/react/mutation.factory.js +21 -0
- package/dist/core/react/query.factory.d.ts +12 -0
- package/dist/core/react/query.factory.js +5 -0
- package/dist/core/server-context.d.ts +6 -0
- package/dist/core/server-context.js +12 -0
- package/dist/core/types/shared.d.ts +29 -0
- package/dist/finance/api/finance.d.ts +22 -0
- package/dist/finance/api/finance.js +29 -0
- package/dist/finance/api/index.d.ts +1 -0
- package/dist/finance/hooks/finance.d.ts +32 -0
- package/dist/finance/hooks/finance.js +66 -0
- package/dist/finance/hooks/index.d.ts +1 -0
- package/dist/finance/index.d.ts +4 -81
- package/dist/finance/index.js +4 -5
- package/dist/finance/types/finance.d.ts +82 -0
- package/dist/index.d.ts +139 -32
- package/dist/index.js +113 -29
- package/dist/inventory/api/adjustment.d.ts +123 -0
- package/dist/inventory/api/adjustment.js +120 -0
- package/dist/inventory/api/availability.d.ts +70 -0
- package/dist/inventory/api/availability.js +47 -0
- package/dist/inventory/api/cost.d.ts +58 -0
- package/dist/inventory/api/cost.js +34 -0
- package/dist/inventory/api/index.d.ts +18 -0
- package/dist/inventory/api/lot.d.ts +82 -0
- package/dist/inventory/api/lot.js +46 -0
- package/dist/inventory/api/movement.d.ts +71 -0
- package/dist/inventory/api/movement.js +75 -0
- package/dist/inventory/api/package.d.ts +97 -0
- package/dist/inventory/api/package.js +56 -0
- package/dist/inventory/api/procurement.d.ts +110 -0
- package/dist/inventory/api/procurement.js +59 -0
- package/dist/inventory/api/purchase.d.ts +106 -0
- package/dist/inventory/api/purchase.js +115 -0
- package/dist/inventory/api/replenishment.d.ts +145 -0
- package/dist/inventory/api/replenishment.js +63 -0
- package/dist/inventory/api/report.d.ts +102 -0
- package/dist/inventory/api/report.js +54 -0
- package/dist/inventory/api/request.d.ts +157 -0
- package/dist/inventory/api/request.js +140 -0
- package/dist/inventory/api/reservation.d.ts +77 -0
- package/dist/inventory/api/reservation.js +51 -0
- package/dist/inventory/api/scan.d.ts +29 -0
- package/dist/inventory/api/scan.js +30 -0
- package/dist/inventory/api/supplier.d.ts +9 -0
- package/dist/inventory/api/supplier.js +24 -0
- package/dist/inventory/api/trace.d.ts +71 -0
- package/dist/inventory/api/trace.js +39 -0
- package/dist/inventory/api/transfer.d.ts +162 -0
- package/dist/inventory/api/transfer.js +155 -0
- package/dist/inventory/api/warehouse.d.ts +199 -0
- package/dist/inventory/api/warehouse.js +155 -0
- package/dist/inventory/hooks/adjustment.d.ts +24 -0
- package/dist/inventory/hooks/adjustment.js +30 -0
- package/dist/inventory/hooks/availability.d.ts +16 -0
- package/dist/inventory/hooks/availability.js +35 -0
- package/dist/inventory/hooks/cost.d.ts +21 -0
- package/dist/inventory/hooks/cost.js +50 -0
- package/dist/inventory/hooks/index.d.ts +18 -0
- package/dist/inventory/hooks/inventory.d.ts +130 -0
- package/dist/inventory/hooks/inventory.js +267 -0
- package/dist/inventory/hooks/lot.d.ts +26 -0
- package/dist/inventory/hooks/lot.js +67 -0
- package/dist/inventory/hooks/movement.d.ts +68 -0
- package/dist/inventory/hooks/movement.js +106 -0
- package/dist/inventory/hooks/package.d.ts +32 -0
- package/dist/inventory/hooks/package.js +80 -0
- package/dist/inventory/hooks/procurement.d.ts +28 -0
- package/dist/inventory/hooks/procurement.js +87 -0
- package/dist/inventory/hooks/purchase.d.ts +63 -0
- package/dist/inventory/hooks/purchase.js +119 -0
- package/dist/inventory/hooks/replenishment.d.ts +34 -0
- package/dist/inventory/hooks/replenishment.js +87 -0
- package/dist/inventory/hooks/report.d.ts +37 -0
- package/dist/inventory/hooks/report.js +79 -0
- package/dist/inventory/hooks/request.d.ts +113 -0
- package/dist/inventory/hooks/request.js +218 -0
- package/dist/inventory/hooks/reservation.d.ts +25 -0
- package/dist/inventory/hooks/reservation.js +56 -0
- package/dist/inventory/hooks/scan.d.ts +14 -0
- package/dist/inventory/hooks/scan.js +22 -0
- package/dist/inventory/hooks/supplier.d.ts +24 -0
- package/dist/inventory/hooks/supplier.js +30 -0
- package/dist/inventory/hooks/trace.d.ts +19 -0
- package/dist/inventory/hooks/trace.js +55 -0
- package/dist/inventory/hooks/transfer.d.ts +90 -0
- package/dist/inventory/hooks/transfer.js +197 -0
- package/dist/inventory/hooks/warehouse.d.ts +87 -0
- package/dist/inventory/hooks/warehouse.js +240 -0
- package/dist/inventory/index.d.ts +39 -512
- package/dist/inventory/index.js +37 -16
- package/dist/inventory/types/index.d.ts +3 -0
- package/dist/inventory/types/inventory.d.ts +485 -0
- package/dist/inventory/types/supplier.d.ts +90 -0
- package/dist/inventory/types/warehouse.d.ts +182 -0
- package/dist/logistics/api/index.d.ts +1 -0
- package/dist/logistics/api/logistics.d.ts +260 -0
- package/dist/logistics/api/logistics.js +249 -0
- package/dist/logistics/hooks/index.d.ts +1 -0
- package/dist/logistics/hooks/logistics.d.ts +252 -0
- package/dist/logistics/hooks/logistics.js +370 -0
- package/dist/logistics/index.d.ts +4 -248
- package/dist/logistics/index.js +4 -7
- package/dist/logistics/types/logistics.d.ts +188 -0
- package/dist/node_modules/@tanstack/query-core/build/modern/hydration-C-jfQLut.d.ts +270 -0
- package/dist/notifications/api/notification.d.ts +15 -0
- package/dist/notifications/api/notification.js +43 -0
- package/dist/notifications/hooks/notification.d.ts +34 -0
- package/dist/notifications/hooks/notification.js +86 -0
- package/dist/notifications/hooks/stream.d.ts +22 -0
- package/dist/notifications/hooks/stream.js +80 -0
- package/dist/notifications/index.d.ts +5 -0
- package/dist/notifications/index.js +5 -0
- package/dist/notifications/types/index.d.ts +57 -0
- package/dist/payments/api/index.d.ts +1 -0
- package/dist/payments/api/payment.d.ts +89 -0
- package/dist/payments/api/payment.js +93 -0
- package/dist/payments/hooks/payment.d.ts +53 -0
- package/dist/payments/hooks/payment.js +93 -0
- package/dist/payments/index.d.ts +4 -55
- package/dist/payments/index.js +4 -6
- package/dist/payments/types/payment.d.ts +50 -0
- package/dist/permissions/checker.d.ts +125 -0
- package/dist/permissions/checker.js +150 -0
- package/dist/permissions/index.d.ts +3 -0
- package/dist/permissions/index.js +4 -0
- package/dist/permissions/roles.d.ts +39 -0
- package/dist/permissions/roles.js +66 -0
- package/dist/platform/api/branch.d.ts +57 -0
- package/dist/platform/api/branch.js +73 -0
- package/dist/platform/api/config.d.ts +67 -0
- package/dist/platform/api/config.js +83 -0
- package/dist/platform/api/features.d.ts +15 -0
- package/dist/platform/api/features.js +20 -0
- package/dist/platform/api/index.d.ts +6 -0
- package/dist/platform/api/promo.d.ts +286 -0
- package/dist/platform/api/promo.js +276 -0
- package/dist/platform/api/user.d.ts +10 -0
- package/dist/platform/api/user.js +29 -0
- package/dist/platform/api/webhook.d.ts +102 -0
- package/dist/platform/api/webhook.js +124 -0
- package/dist/platform/hooks/branch.d.ts +24 -0
- package/dist/platform/hooks/branch.js +31 -0
- package/dist/platform/hooks/config.d.ts +61 -0
- package/dist/platform/hooks/config.js +100 -0
- package/dist/platform/hooks/features.d.ts +22 -0
- package/dist/platform/hooks/features.js +75 -0
- package/dist/platform/hooks/index.d.ts +6 -0
- package/dist/platform/hooks/promo.d.ts +218 -0
- package/dist/platform/hooks/promo.js +451 -0
- package/dist/platform/hooks/user.d.ts +24 -0
- package/dist/platform/hooks/user.js +30 -0
- package/dist/platform/index.d.ts +18 -645
- package/dist/platform/index.js +14 -8
- package/dist/platform/prefetch.d.ts +9 -0
- package/dist/platform/prefetch.js +11 -0
- package/dist/platform/types/branch.d.ts +110 -0
- package/dist/platform/types/branch.js +16 -0
- package/dist/platform/types/config.d.ts +137 -0
- package/dist/platform/types/features.d.ts +46 -0
- package/dist/platform/types/promo.d.ts +260 -0
- package/dist/platform/types/user.d.ts +72 -0
- package/dist/platform/types/webhook.d.ts +165 -0
- package/dist/sales/api/cart.d.ts +34 -0
- package/dist/sales/api/cart.js +38 -0
- package/dist/sales/api/customer.d.ts +40 -0
- package/dist/sales/api/customer.js +52 -0
- package/dist/sales/api/earning-rules.d.ts +54 -0
- package/dist/sales/api/earning-rules.js +56 -0
- package/dist/sales/api/index.d.ts +9 -0
- package/dist/sales/api/loyalty.d.ts +54 -0
- package/dist/sales/api/loyalty.js +57 -0
- package/dist/sales/api/order.d.ts +147 -0
- package/dist/sales/api/order.js +69 -0
- package/dist/sales/api/pos.d.ts +81 -0
- package/dist/sales/api/pos.js +95 -0
- package/dist/sales/api/referrals.d.ts +63 -0
- package/dist/sales/api/referrals.js +62 -0
- package/dist/sales/api/tiers.d.ts +66 -0
- package/dist/sales/api/tiers.js +59 -0
- package/dist/sales/hooks/cart.d.ts +50 -0
- package/dist/sales/hooks/cart.js +161 -0
- package/dist/sales/hooks/customer.d.ts +100 -0
- package/dist/sales/hooks/customer.js +130 -0
- package/dist/sales/hooks/earning-rules.d.ts +31 -0
- package/dist/sales/hooks/earning-rules.js +112 -0
- package/dist/sales/hooks/index.d.ts +8 -0
- package/dist/sales/hooks/loyalty.d.ts +51 -0
- package/dist/sales/hooks/loyalty.js +122 -0
- package/dist/sales/hooks/order.d.ts +219 -0
- package/dist/sales/hooks/order.js +401 -0
- package/dist/sales/hooks/pos.d.ts +87 -0
- package/dist/sales/hooks/pos.js +222 -0
- package/dist/sales/hooks/referrals.d.ts +34 -0
- package/dist/sales/hooks/referrals.js +132 -0
- package/dist/sales/hooks/tiers.d.ts +32 -0
- package/dist/sales/hooks/tiers.js +144 -0
- package/dist/sales/index.d.ts +25 -587
- package/dist/sales/index.js +19 -9
- package/dist/sales/prefetch.d.ts +10 -0
- package/dist/sales/prefetch.js +13 -0
- package/dist/sales/types/cart.d.ts +123 -0
- package/dist/sales/types/customer.d.ts +119 -0
- package/dist/sales/types/earning-rules.d.ts +75 -0
- package/dist/sales/types/index.d.ts +8 -0
- package/dist/sales/types/loyalty.d.ts +120 -0
- package/dist/sales/types/order.d.ts +487 -0
- package/dist/sales/types/order.js +22 -0
- package/dist/sales/types/pos.d.ts +227 -0
- package/dist/sales/types/referrals.d.ts +51 -0
- package/dist/sales/types/tiers.d.ts +56 -0
- package/dist/server.d.ts +41 -23
- package/dist/server.js +41 -36
- package/dist/transaction/api/index.d.ts +1 -0
- package/dist/transaction/api/transaction.d.ts +63 -0
- package/dist/transaction/api/transaction.js +84 -0
- package/dist/transaction/hooks/index.d.ts +1 -0
- package/dist/transaction/hooks/transaction.d.ts +106 -0
- package/dist/transaction/hooks/transaction.js +156 -0
- package/dist/transaction/index.d.ts +4 -104
- package/dist/transaction/index.js +5 -8
- package/dist/transaction/types/transaction.d.ts +440 -0
- package/dist/transaction/types/transaction.js +86 -0
- package/package.json +36 -25
- package/dist/adjustment-MNH3AT6S.js +0 -5
- package/dist/adjustment-MNH3AT6S.js.map +0 -1
- package/dist/analytics/index.js.map +0 -1
- package/dist/analytics-DMcD-o8w.d.ts +0 -76
- package/dist/api-factory-B_h4RKBm.d.ts +0 -280
- package/dist/auth/index.js.map +0 -1
- package/dist/catalog/index.js.map +0 -1
- package/dist/chunk-24FDD6UR.js +0 -75
- package/dist/chunk-24FDD6UR.js.map +0 -1
- package/dist/chunk-2TF7QNYV.js +0 -159
- package/dist/chunk-2TF7QNYV.js.map +0 -1
- package/dist/chunk-2YAZ5WG6.js +0 -479
- package/dist/chunk-2YAZ5WG6.js.map +0 -1
- package/dist/chunk-36NLLAVH.js +0 -177
- package/dist/chunk-36NLLAVH.js.map +0 -1
- package/dist/chunk-3OYSJB3P.js +0 -126
- package/dist/chunk-3OYSJB3P.js.map +0 -1
- package/dist/chunk-5E57JODA.js +0 -135
- package/dist/chunk-5E57JODA.js.map +0 -1
- package/dist/chunk-7LZCW4VF.js +0 -13
- package/dist/chunk-7LZCW4VF.js.map +0 -1
- package/dist/chunk-ANYGZ6O5.js +0 -830
- package/dist/chunk-ANYGZ6O5.js.map +0 -1
- package/dist/chunk-AQAISI4F.js +0 -183
- package/dist/chunk-AQAISI4F.js.map +0 -1
- package/dist/chunk-B6MPVOV7.js +0 -328
- package/dist/chunk-B6MPVOV7.js.map +0 -1
- package/dist/chunk-CILP56G2.js +0 -94
- package/dist/chunk-CILP56G2.js.map +0 -1
- package/dist/chunk-ERQ52WHY.js +0 -534
- package/dist/chunk-ERQ52WHY.js.map +0 -1
- package/dist/chunk-FOTUJPM4.js +0 -640
- package/dist/chunk-FOTUJPM4.js.map +0 -1
- package/dist/chunk-IHCBBLLW.js +0 -198
- package/dist/chunk-IHCBBLLW.js.map +0 -1
- package/dist/chunk-J4JBQET2.js +0 -76
- package/dist/chunk-J4JBQET2.js.map +0 -1
- package/dist/chunk-L4OEI4VZ.js +0 -123
- package/dist/chunk-L4OEI4VZ.js.map +0 -1
- package/dist/chunk-LRV7MWWX.js +0 -616
- package/dist/chunk-LRV7MWWX.js.map +0 -1
- package/dist/chunk-N43VE355.js +0 -126
- package/dist/chunk-N43VE355.js.map +0 -1
- package/dist/chunk-PYYLHUV6.js +0 -3
- package/dist/chunk-PYYLHUV6.js.map +0 -1
- package/dist/chunk-QCTXAMLA.js +0 -261
- package/dist/chunk-QCTXAMLA.js.map +0 -1
- package/dist/chunk-RIKAPJNG.js +0 -40
- package/dist/chunk-RIKAPJNG.js.map +0 -1
- package/dist/chunk-U3XT35GZ.js +0 -202
- package/dist/chunk-U3XT35GZ.js.map +0 -1
- package/dist/chunk-W22WB3WZ.js +0 -148
- package/dist/chunk-W22WB3WZ.js.map +0 -1
- package/dist/chunk-WTIJMKML.js +0 -27
- package/dist/chunk-WTIJMKML.js.map +0 -1
- package/dist/chunk-X2CQFJPR.js +0 -75
- package/dist/chunk-X2CQFJPR.js.map +0 -1
- package/dist/chunk-YYFKLOKO.js +0 -769
- package/dist/chunk-YYFKLOKO.js.map +0 -1
- package/dist/client-Cs7E_usr.d.ts +0 -113
- package/dist/content/index.js.map +0 -1
- package/dist/core/index.js.map +0 -1
- package/dist/core/react.d.ts +0 -107
- package/dist/core/react.js +0 -5
- package/dist/core/react.js.map +0 -1
- package/dist/coupon-BZSZ0y3n.d.ts +0 -129
- package/dist/coupon-CDzL4bJG.d.ts +0 -655
- package/dist/crud.factory-DyKaPHcU.d.ts +0 -181
- package/dist/finance/index.js.map +0 -1
- package/dist/finance-BJdfKRw0.d.ts +0 -135
- package/dist/index.js.map +0 -1
- package/dist/inventory/index.js.map +0 -1
- package/dist/inventory-B5pssqRx.d.ts +0 -748
- package/dist/logistics/index.js.map +0 -1
- package/dist/logistics-CrpKadKE.d.ts +0 -410
- package/dist/media-CNLJK93J.d.ts +0 -721
- package/dist/movement-R3CERFAM.js +0 -5
- package/dist/movement-R3CERFAM.js.map +0 -1
- package/dist/order-B3dCvHgK.d.ts +0 -360
- package/dist/payment-BRboLqvU.d.ts +0 -127
- package/dist/payments/index.js.map +0 -1
- package/dist/platform/index.js.map +0 -1
- package/dist/pos-BCqkx2-K.d.ts +0 -527
- package/dist/product-p09zXkXB.d.ts +0 -260
- package/dist/purchase-54PER2PY.js +0 -5
- package/dist/purchase-54PER2PY.js.map +0 -1
- package/dist/request-MP6NV5ZE.js +0 -5
- package/dist/request-MP6NV5ZE.js.map +0 -1
- package/dist/sales/index.js.map +0 -1
- package/dist/server.js.map +0 -1
- package/dist/size-guide-DgjzjM5P.d.ts +0 -554
- package/dist/stock-2LP4HJSB.js +0 -5
- package/dist/stock-2LP4HJSB.js.map +0 -1
- package/dist/stock-CfrU5_Wr.d.ts +0 -632
- package/dist/supplier-BWJTRZ5Z.js +0 -5
- package/dist/supplier-BWJTRZ5Z.js.map +0 -1
- package/dist/transaction/index.js.map +0 -1
- package/dist/transaction-Bf6WjYCh.d.ts +0 -84
- package/dist/transaction-dL3WW-er.d.ts +0 -442
- package/dist/transfer-4XSS6HWT.js +0 -5
- package/dist/transfer-4XSS6HWT.js.map +0 -1
- package/dist/user-data-DdLjAGwO.d.ts +0 -132
package/dist/sales/index.d.ts
CHANGED
|
@@ -1,587 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Get total item count in cart
|
|
28
|
-
*/
|
|
29
|
-
declare function getCartItemCount(items: CartItem[]): number;
|
|
30
|
-
/**
|
|
31
|
-
* Get variant details from a cart item
|
|
32
|
-
*/
|
|
33
|
-
declare function getCartItemVariant(item: CartItem): ProductVariant | null;
|
|
34
|
-
/**
|
|
35
|
-
* Format variant attributes for display
|
|
36
|
-
* @example "Size: M, Color: Red"
|
|
37
|
-
*/
|
|
38
|
-
declare function formatVariantAttributes(attributes?: Record<string, string> | null): string;
|
|
39
|
-
interface UseCartReturn {
|
|
40
|
-
cart: Cart | null | undefined;
|
|
41
|
-
items: CartItem[];
|
|
42
|
-
itemCount: number;
|
|
43
|
-
subtotal: number;
|
|
44
|
-
isLoading: boolean;
|
|
45
|
-
isFetching: boolean;
|
|
46
|
-
isUpdating: boolean;
|
|
47
|
-
error: Error | null;
|
|
48
|
-
addToCart: (data: AddCartItemPayload) => void;
|
|
49
|
-
addToCartAsync: (data: AddCartItemPayload) => Promise<Cart>;
|
|
50
|
-
updateCartItem: (data: UpdateCartItemPayload) => void;
|
|
51
|
-
updateCartItemAsync: (data: UpdateCartItemPayload) => Promise<Cart>;
|
|
52
|
-
removeCartItem: (itemId: string) => void;
|
|
53
|
-
removeCartItemAsync: (itemId: string) => Promise<Cart>;
|
|
54
|
-
clearCart: () => void;
|
|
55
|
-
clearCartAsync: () => Promise<Cart>;
|
|
56
|
-
refetch: () => void;
|
|
57
|
-
getItemPrice: typeof calculateItemPrice;
|
|
58
|
-
}
|
|
59
|
-
interface UseCartCountReturn {
|
|
60
|
-
count: number;
|
|
61
|
-
isLoading: boolean;
|
|
62
|
-
}
|
|
63
|
-
interface CartOptions {
|
|
64
|
-
enabled?: boolean;
|
|
65
|
-
staleTime?: number;
|
|
66
|
-
gcTime?: number;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* Full cart hook with optimistic updates
|
|
70
|
-
*
|
|
71
|
-
* @example
|
|
72
|
-
* ```tsx
|
|
73
|
-
* function CartPage() {
|
|
74
|
-
* const {
|
|
75
|
-
* items,
|
|
76
|
-
* itemCount,
|
|
77
|
-
* subtotal,
|
|
78
|
-
* addToCart,
|
|
79
|
-
* updateCartItem,
|
|
80
|
-
* removeCartItem,
|
|
81
|
-
* clearCart,
|
|
82
|
-
* isLoading,
|
|
83
|
-
* isUpdating,
|
|
84
|
-
* } = useCart(token);
|
|
85
|
-
*
|
|
86
|
-
* // Add item
|
|
87
|
-
* addToCart({ productId: "123", quantity: 2 });
|
|
88
|
-
*
|
|
89
|
-
* // Add variant item
|
|
90
|
-
* addToCart({ productId: "123", variantSku: "SIZE-M", quantity: 1 });
|
|
91
|
-
*
|
|
92
|
-
* // Update quantity
|
|
93
|
-
* updateCartItem({ itemId: "item_id", quantity: 3 });
|
|
94
|
-
*
|
|
95
|
-
* // Remove item
|
|
96
|
-
* removeCartItem("item_id");
|
|
97
|
-
*
|
|
98
|
-
* // Clear cart
|
|
99
|
-
* clearCart();
|
|
100
|
-
* }
|
|
101
|
-
* ```
|
|
102
|
-
*/
|
|
103
|
-
declare function useCart(token: string | null | undefined, options?: CartOptions): UseCartReturn;
|
|
104
|
-
/**
|
|
105
|
-
* Lightweight hook for cart count (header badge)
|
|
106
|
-
*
|
|
107
|
-
* @example
|
|
108
|
-
* ```tsx
|
|
109
|
-
* function CartBadge() {
|
|
110
|
-
* const { count, isLoading } = useCartCount(token);
|
|
111
|
-
* return <Badge>{isLoading ? "..." : count}</Badge>;
|
|
112
|
-
* }
|
|
113
|
-
* ```
|
|
114
|
-
*/
|
|
115
|
-
declare function useCartCount(token: string | null | undefined, options?: CartOptions): UseCartCountReturn;
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Order hooks using createCrudHooks factory
|
|
119
|
-
*
|
|
120
|
-
* Provides:
|
|
121
|
-
* - useOrders: List orders with filtering/pagination
|
|
122
|
-
* - useOrderDetail: Get single order
|
|
123
|
-
* - useOrderActions: Create, update, delete mutations
|
|
124
|
-
* - useOrderNavigation: Navigation between orders
|
|
125
|
-
*/
|
|
126
|
-
declare const orderHooks: CrudHooksReturn<Order, CreateOrderPayload, Partial<Order>>;
|
|
127
|
-
declare const ORDER_KEYS: {
|
|
128
|
-
all: readonly ["orders"];
|
|
129
|
-
lists: () => readonly ["orders", "list"];
|
|
130
|
-
list: (params?: Record<string, unknown>) => readonly ["orders", "list", Record<string, unknown> | undefined];
|
|
131
|
-
details: () => readonly ["orders", "detail"];
|
|
132
|
-
detail: (id: string) => readonly ["orders", "detail", string];
|
|
133
|
-
myOrders: (params?: Record<string, unknown>) => readonly ["orders", "my", Record<string, unknown> | undefined];
|
|
134
|
-
myDetail: (id: string) => readonly ["orders", "my", "detail", string];
|
|
135
|
-
};
|
|
136
|
-
declare const useOrders: (token: string | null, params?: Record<string, unknown>, options?: ListOptions) => ListQueryResult<Order>;
|
|
137
|
-
declare const useOrderDetail: (id: string | null, token: string | null, options?: DetailOptions) => DetailQueryResult<Order>;
|
|
138
|
-
declare const useOrderActions: () => CrudActions<CreateOrderPayload, Partial<Order>>;
|
|
139
|
-
declare const useOrderNavigation: () => NavigateFn<Order>;
|
|
140
|
-
interface QueryOptions$2 {
|
|
141
|
-
enabled?: boolean;
|
|
142
|
-
staleTime?: number;
|
|
143
|
-
}
|
|
144
|
-
interface UseMyOrdersReturn {
|
|
145
|
-
orders: Order[];
|
|
146
|
-
total: number;
|
|
147
|
-
page: number;
|
|
148
|
-
limit: number;
|
|
149
|
-
hasMore: boolean;
|
|
150
|
-
isLoading: boolean;
|
|
151
|
-
isFetching: boolean;
|
|
152
|
-
error: Error | null;
|
|
153
|
-
refetch: () => void;
|
|
154
|
-
}
|
|
155
|
-
interface UseCustomerOrderActionsReturn {
|
|
156
|
-
checkout: (data: CreateOrderPayload) => Promise<Order>;
|
|
157
|
-
isCheckingOut: boolean;
|
|
158
|
-
requestCancel: (params: {
|
|
159
|
-
orderId: string;
|
|
160
|
-
reason?: string;
|
|
161
|
-
}) => Promise<Order>;
|
|
162
|
-
isRequestingCancel: boolean;
|
|
163
|
-
isLoading: boolean;
|
|
164
|
-
}
|
|
165
|
-
interface UseAdminOrderActionsReturn {
|
|
166
|
-
updateStatus: (params: {
|
|
167
|
-
orderId: string;
|
|
168
|
-
status: string;
|
|
169
|
-
note?: string;
|
|
170
|
-
}) => Promise<Order>;
|
|
171
|
-
isUpdatingStatus: boolean;
|
|
172
|
-
fulfillOrder: (params: FulfillOrderPayload & {
|
|
173
|
-
orderId: string;
|
|
174
|
-
}) => Promise<Order>;
|
|
175
|
-
isFulfilling: boolean;
|
|
176
|
-
refundOrder: (params: {
|
|
177
|
-
orderId: string;
|
|
178
|
-
amount?: number;
|
|
179
|
-
reason?: string;
|
|
180
|
-
}) => Promise<Order>;
|
|
181
|
-
isRefunding: boolean;
|
|
182
|
-
cancelOrder: (params: {
|
|
183
|
-
orderId: string;
|
|
184
|
-
reason?: string;
|
|
185
|
-
refund?: boolean;
|
|
186
|
-
}) => Promise<Order>;
|
|
187
|
-
isCancelling: boolean;
|
|
188
|
-
requestShipping: (params: RequestShippingPayload & {
|
|
189
|
-
orderId: string;
|
|
190
|
-
}) => Promise<OrderShipping>;
|
|
191
|
-
isRequestingShipping: boolean;
|
|
192
|
-
updateShipping: (params: UpdateShippingPayload & {
|
|
193
|
-
orderId: string;
|
|
194
|
-
}) => Promise<OrderShipping>;
|
|
195
|
-
isUpdatingShipping: boolean;
|
|
196
|
-
isLoading: boolean;
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
* Get customer's own orders
|
|
200
|
-
*
|
|
201
|
-
* @param token - Auth token
|
|
202
|
-
* @param params - Query params { page, limit, status, sort }
|
|
203
|
-
* @param options - Query options
|
|
204
|
-
*
|
|
205
|
-
* @example
|
|
206
|
-
* ```tsx
|
|
207
|
-
* function MyOrdersPage() {
|
|
208
|
-
* const { orders, isLoading, hasMore } = useMyOrders(token, { limit: 10 });
|
|
209
|
-
*
|
|
210
|
-
* return (
|
|
211
|
-
* <OrderList orders={orders} loading={isLoading} />
|
|
212
|
-
* );
|
|
213
|
-
* }
|
|
214
|
-
* ```
|
|
215
|
-
*/
|
|
216
|
-
declare function useMyOrders(token: string, params?: Record<string, unknown>, options?: QueryOptions$2): UseMyOrdersReturn;
|
|
217
|
-
/**
|
|
218
|
-
* Get customer's own order detail
|
|
219
|
-
*
|
|
220
|
-
* @param token - Auth token
|
|
221
|
-
* @param orderId - Order ID
|
|
222
|
-
* @param options - Query options
|
|
223
|
-
*
|
|
224
|
-
* @example
|
|
225
|
-
* ```tsx
|
|
226
|
-
* function OrderDetailPage({ orderId }) {
|
|
227
|
-
* const { data: order, isLoading } = useMyOrderDetail(token, orderId);
|
|
228
|
-
*
|
|
229
|
-
* if (isLoading) return <Skeleton />;
|
|
230
|
-
* return <OrderDetail order={order} />;
|
|
231
|
-
* }
|
|
232
|
-
* ```
|
|
233
|
-
*/
|
|
234
|
-
declare function useMyOrderDetail(token: string, orderId: string, options?: QueryOptions$2): _tanstack_react_query.UseQueryResult<Order, Error>;
|
|
235
|
-
/**
|
|
236
|
-
* Customer order actions (checkout, request cancellation)
|
|
237
|
-
*
|
|
238
|
-
* @param token - Customer auth token
|
|
239
|
-
*
|
|
240
|
-
* @example
|
|
241
|
-
* ```tsx
|
|
242
|
-
* function CheckoutButton({ cart }) {
|
|
243
|
-
* const { checkout, isCheckingOut } = useCustomerOrderActions(token);
|
|
244
|
-
*
|
|
245
|
-
* const handleCheckout = async () => {
|
|
246
|
-
* const order = await checkout({
|
|
247
|
-
* items: cart.items,
|
|
248
|
-
* shipping: shippingAddress,
|
|
249
|
-
* payment: { method: 'bkash' },
|
|
250
|
-
* });
|
|
251
|
-
* router.push(`/orders/${order._id}`);
|
|
252
|
-
* };
|
|
253
|
-
*
|
|
254
|
-
* return (
|
|
255
|
-
* <Button onClick={handleCheckout} disabled={isCheckingOut}>
|
|
256
|
-
* {isCheckingOut ? 'Processing...' : 'Place Order'}
|
|
257
|
-
* </Button>
|
|
258
|
-
* );
|
|
259
|
-
* }
|
|
260
|
-
* ```
|
|
261
|
-
*/
|
|
262
|
-
declare function useCustomerOrderActions(token: string): UseCustomerOrderActionsReturn;
|
|
263
|
-
/**
|
|
264
|
-
* Admin order actions (status, fulfill, refund, cancel, shipping)
|
|
265
|
-
*
|
|
266
|
-
* @param token - Admin auth token
|
|
267
|
-
*
|
|
268
|
-
* @example
|
|
269
|
-
* ```tsx
|
|
270
|
-
* function OrderActions({ order }) {
|
|
271
|
-
* const {
|
|
272
|
-
* updateStatus,
|
|
273
|
-
* fulfillOrder,
|
|
274
|
-
* cancelOrder,
|
|
275
|
-
* isLoading,
|
|
276
|
-
* } = useAdminOrderActions(token);
|
|
277
|
-
*
|
|
278
|
-
* return (
|
|
279
|
-
* <>
|
|
280
|
-
* <Button onClick={() => updateStatus({ orderId: order._id, status: 'processing' })}>
|
|
281
|
-
* Mark Processing
|
|
282
|
-
* </Button>
|
|
283
|
-
* <Button onClick={() => fulfillOrder({ orderId: order._id, branchId: 'branch_123' })}>
|
|
284
|
-
* Fulfill Order
|
|
285
|
-
* </Button>
|
|
286
|
-
* </>
|
|
287
|
-
* );
|
|
288
|
-
* }
|
|
289
|
-
* ```
|
|
290
|
-
*/
|
|
291
|
-
declare function useAdminOrderActions(token: string): UseAdminOrderActionsReturn;
|
|
292
|
-
|
|
293
|
-
interface QueryOptions$1 {
|
|
294
|
-
enabled?: boolean;
|
|
295
|
-
staleTime?: number;
|
|
296
|
-
}
|
|
297
|
-
type MembershipAction = "enroll" | "deactivate" | "reactivate" | "adjust";
|
|
298
|
-
type PointsType = "bonus" | "correction" | "manual_redemption" | "redemption" | "expiry";
|
|
299
|
-
interface MembershipActionParams {
|
|
300
|
-
id: string;
|
|
301
|
-
action: MembershipAction;
|
|
302
|
-
points?: number;
|
|
303
|
-
reason?: string;
|
|
304
|
-
type?: PointsType;
|
|
305
|
-
}
|
|
306
|
-
interface UseCustomerMembershipReturn {
|
|
307
|
-
membershipAction: (params: MembershipActionParams) => Promise<Customer>;
|
|
308
|
-
isPending: boolean;
|
|
309
|
-
}
|
|
310
|
-
/**
|
|
311
|
-
* Customer hooks using createCrudHooks factory
|
|
312
|
-
*
|
|
313
|
-
* Provides:
|
|
314
|
-
* - useCustomers: List customers with filtering/pagination
|
|
315
|
-
* - useCustomerDetail: Get single customer
|
|
316
|
-
* - useCustomerActions: Create, update, delete mutations
|
|
317
|
-
* - useCustomerNavigation: Navigation between customers
|
|
318
|
-
*/
|
|
319
|
-
declare const customerHooks: CrudHooksReturn<Customer, CustomerPayload, CustomerPayload>;
|
|
320
|
-
declare const CUSTOMER_KEYS: QueryKeys;
|
|
321
|
-
declare const useCustomers: (token: string | null, params?: Record<string, unknown>, options?: ListOptions) => ListQueryResult<Customer>;
|
|
322
|
-
declare const useCustomerDetail: (id: string | null, token: string | null, options?: DetailOptions) => DetailQueryResult<Customer>;
|
|
323
|
-
declare const useCustomerActions: () => CrudActions<CustomerPayload, CustomerPayload>;
|
|
324
|
-
declare const useCustomerNavigation: () => NavigateFn<Customer>;
|
|
325
|
-
/**
|
|
326
|
-
* Get current user's customer profile
|
|
327
|
-
*
|
|
328
|
-
* @param token - Auth token
|
|
329
|
-
* @param options - Query options
|
|
330
|
-
*
|
|
331
|
-
* @example
|
|
332
|
-
* ```tsx
|
|
333
|
-
* function ProfilePage() {
|
|
334
|
-
* const { data: customer, isLoading } = useCurrentCustomer(token);
|
|
335
|
-
*
|
|
336
|
-
* if (isLoading) return <Skeleton />;
|
|
337
|
-
* return (
|
|
338
|
-
* <div>
|
|
339
|
-
* <h1>{customer?.name}</h1>
|
|
340
|
-
* <p>Points: {customer?.membership?.points || 0}</p>
|
|
341
|
-
* </div>
|
|
342
|
-
* );
|
|
343
|
-
* }
|
|
344
|
-
* ```
|
|
345
|
-
*/
|
|
346
|
-
declare function useCurrentCustomer(token: string, options?: QueryOptions$1): _tanstack_react_query.UseQueryResult<Customer, Error>;
|
|
347
|
-
/**
|
|
348
|
-
* Customer membership actions (enroll, deactivate, reactivate, adjust points)
|
|
349
|
-
*
|
|
350
|
-
* @param token - Admin auth token
|
|
351
|
-
*
|
|
352
|
-
* @example
|
|
353
|
-
* ```tsx
|
|
354
|
-
* function MembershipManager({ customer }) {
|
|
355
|
-
* const { membershipAction, isPending } = useCustomerMembership(token);
|
|
356
|
-
*
|
|
357
|
-
* const handleEnroll = async () => {
|
|
358
|
-
* await membershipAction({
|
|
359
|
-
* id: customer._id,
|
|
360
|
-
* action: 'enroll',
|
|
361
|
-
* });
|
|
362
|
-
* };
|
|
363
|
-
*
|
|
364
|
-
* const handleAdjustPoints = async (points: number) => {
|
|
365
|
-
* await membershipAction({
|
|
366
|
-
* id: customer._id,
|
|
367
|
-
* action: 'adjust',
|
|
368
|
-
* points,
|
|
369
|
-
* type: 'bonus',
|
|
370
|
-
* reason: 'Birthday bonus',
|
|
371
|
-
* });
|
|
372
|
-
* };
|
|
373
|
-
*
|
|
374
|
-
* return (
|
|
375
|
-
* <Button onClick={handleEnroll} disabled={isPending}>
|
|
376
|
-
* Enroll in Membership
|
|
377
|
-
* </Button>
|
|
378
|
-
* );
|
|
379
|
-
* }
|
|
380
|
-
* ```
|
|
381
|
-
*/
|
|
382
|
-
declare function useCustomerMembership(token: string): UseCustomerMembershipReturn;
|
|
383
|
-
|
|
384
|
-
declare const POS_KEYS: {
|
|
385
|
-
all: readonly ["pos"];
|
|
386
|
-
products: (branchId?: string) => readonly ["pos", "products", string | undefined];
|
|
387
|
-
productsList: (branchId?: string, params?: Record<string, unknown>) => readonly ["pos", "products", string | undefined, Record<string, unknown> | undefined];
|
|
388
|
-
lookup: (code: string, branchId?: string) => readonly ["pos", "lookup", string, string | undefined];
|
|
389
|
-
orders: () => readonly ["pos", "orders"];
|
|
390
|
-
receipt: (orderId: string) => readonly ["pos", "orders", string, "receipt"];
|
|
391
|
-
};
|
|
392
|
-
interface PosProductFilters {
|
|
393
|
-
category?: string;
|
|
394
|
-
search?: string;
|
|
395
|
-
inStockOnly?: boolean;
|
|
396
|
-
lowStockOnly?: boolean;
|
|
397
|
-
after?: string;
|
|
398
|
-
limit?: number;
|
|
399
|
-
sort?: string;
|
|
400
|
-
[key: string]: unknown;
|
|
401
|
-
}
|
|
402
|
-
interface UsePosProductsReturn {
|
|
403
|
-
products: PosProduct[];
|
|
404
|
-
summary: PosProductsResponse["summary"];
|
|
405
|
-
branch: PosProductsResponse["branch"];
|
|
406
|
-
hasMore: boolean;
|
|
407
|
-
nextCursor: string | null;
|
|
408
|
-
isLoading: boolean;
|
|
409
|
-
isFetching: boolean;
|
|
410
|
-
error: Error | null;
|
|
411
|
-
refetch: () => void;
|
|
412
|
-
}
|
|
413
|
-
interface QueryOptions {
|
|
414
|
-
enabled?: boolean;
|
|
415
|
-
}
|
|
416
|
-
/**
|
|
417
|
-
* Fetch POS products with branch-specific stock
|
|
418
|
-
*
|
|
419
|
-
* @param token - Auth token
|
|
420
|
-
* @param branchId - Branch to get stock for
|
|
421
|
-
* @param filters - Product filters
|
|
422
|
-
* @param options - Query options
|
|
423
|
-
*
|
|
424
|
-
* @example
|
|
425
|
-
* ```tsx
|
|
426
|
-
* function ProductGrid({ branchId }) {
|
|
427
|
-
* const { products, isLoading, summary } = usePosProducts(token, branchId, {
|
|
428
|
-
* category: 'electronics',
|
|
429
|
-
* inStockOnly: true,
|
|
430
|
-
* });
|
|
431
|
-
*
|
|
432
|
-
* return (
|
|
433
|
-
* <Grid>
|
|
434
|
-
* {products.map(product => (
|
|
435
|
-
* <ProductCard key={product._id} product={product} />
|
|
436
|
-
* ))}
|
|
437
|
-
* </Grid>
|
|
438
|
-
* );
|
|
439
|
-
* }
|
|
440
|
-
* ```
|
|
441
|
-
*/
|
|
442
|
-
declare function usePosProducts(token: string, branchId: string | undefined, filters?: PosProductFilters, options?: QueryOptions): UsePosProductsReturn;
|
|
443
|
-
/**
|
|
444
|
-
* Lookup product by barcode/SKU (query-based)
|
|
445
|
-
*
|
|
446
|
-
* @param token - Auth token
|
|
447
|
-
* @param code - Barcode or SKU to lookup
|
|
448
|
-
* @param branchId - Branch for stock info
|
|
449
|
-
* @param options - Query options
|
|
450
|
-
*/
|
|
451
|
-
declare function usePosLookup(token: string, code: string, branchId?: string, options?: QueryOptions): _tanstack_react_query.UseQueryResult<PosLookupResponse, Error>;
|
|
452
|
-
/**
|
|
453
|
-
* Lookup product by barcode/SKU (mutation-based)
|
|
454
|
-
* Preferred for "scan -> act" flows
|
|
455
|
-
*
|
|
456
|
-
* @param token - Auth token
|
|
457
|
-
*
|
|
458
|
-
* @example
|
|
459
|
-
* ```tsx
|
|
460
|
-
* function BarcodeScanner() {
|
|
461
|
-
* const { lookup, isLooking } = usePosLookupMutation(token);
|
|
462
|
-
*
|
|
463
|
-
* const handleScan = async (code: string) => {
|
|
464
|
-
* const result = await lookup({ code, branchId });
|
|
465
|
-
* if (result) addToCart(result.data);
|
|
466
|
-
* };
|
|
467
|
-
* }
|
|
468
|
-
* ```
|
|
469
|
-
*/
|
|
470
|
-
declare function usePosLookupMutation(token: string): {
|
|
471
|
-
lookup: _tanstack_react_query.UseMutateAsyncFunction<PosLookupResponse, Error, {
|
|
472
|
-
code: string;
|
|
473
|
-
branchId?: string;
|
|
474
|
-
}, unknown>;
|
|
475
|
-
isLooking: boolean;
|
|
476
|
-
error: Error | null;
|
|
477
|
-
};
|
|
478
|
-
/**
|
|
479
|
-
* Get receipt for an order
|
|
480
|
-
*
|
|
481
|
-
* @param token - Auth token
|
|
482
|
-
* @param orderId - Order ID
|
|
483
|
-
* @param options - Query options
|
|
484
|
-
*/
|
|
485
|
-
declare function usePosReceipt(token: string, orderId: string, options?: QueryOptions): _tanstack_react_query.UseQueryResult<PosReceiptResponse, Error>;
|
|
486
|
-
interface UsePosOrdersReturn {
|
|
487
|
-
createOrder: (data: PosOrderPayload) => Promise<unknown>;
|
|
488
|
-
isCreatingOrder: boolean;
|
|
489
|
-
}
|
|
490
|
-
/**
|
|
491
|
-
* POS order operations
|
|
492
|
-
*
|
|
493
|
-
* @param token - Auth token
|
|
494
|
-
*
|
|
495
|
-
* @example
|
|
496
|
-
* ```tsx
|
|
497
|
-
* function Checkout({ cart, branchId }) {
|
|
498
|
-
* const { createOrder, isCreatingOrder } = usePosOrders(token);
|
|
499
|
-
*
|
|
500
|
-
* const handleCheckout = async () => {
|
|
501
|
-
* const order = await createOrder({
|
|
502
|
-
* items: cart.items,
|
|
503
|
-
* branchId,
|
|
504
|
-
* payment: { method: 'cash' },
|
|
505
|
-
* });
|
|
506
|
-
* // Handle success (show receipt, clear cart, etc.)
|
|
507
|
-
* };
|
|
508
|
-
* }
|
|
509
|
-
* ```
|
|
510
|
-
*/
|
|
511
|
-
declare function usePosOrders(token: string): UsePosOrdersReturn;
|
|
512
|
-
interface UsePosStockActionsReturn {
|
|
513
|
-
adjustStock: (data: CreateAdjustmentPayload) => Promise<unknown>;
|
|
514
|
-
isAdjusting: boolean;
|
|
515
|
-
setStock: (params: {
|
|
516
|
-
productId: string;
|
|
517
|
-
quantity: number;
|
|
518
|
-
branchId?: string;
|
|
519
|
-
variantSku?: string;
|
|
520
|
-
reason?: string;
|
|
521
|
-
}) => Promise<unknown>;
|
|
522
|
-
isSetting: boolean;
|
|
523
|
-
bulkAdjust: (data: BulkAdjustmentPayload) => Promise<unknown>;
|
|
524
|
-
isBulkAdjusting: boolean;
|
|
525
|
-
isLoading: boolean;
|
|
526
|
-
}
|
|
527
|
-
/**
|
|
528
|
-
* POS stock adjustment actions
|
|
529
|
-
*
|
|
530
|
-
* @param token - Auth token
|
|
531
|
-
* @param branchId - Branch for cache invalidation
|
|
532
|
-
*
|
|
533
|
-
* @example
|
|
534
|
-
* ```tsx
|
|
535
|
-
* function StockAdjuster({ product, branchId }) {
|
|
536
|
-
* const { setStock, isSetting } = usePosStockActions(token, branchId);
|
|
537
|
-
*
|
|
538
|
-
* const handleSetStock = async (newQuantity: number) => {
|
|
539
|
-
* await setStock({
|
|
540
|
-
* productId: product._id,
|
|
541
|
-
* quantity: newQuantity,
|
|
542
|
-
* reason: 'Inventory count',
|
|
543
|
-
* });
|
|
544
|
-
* };
|
|
545
|
-
* }
|
|
546
|
-
* ```
|
|
547
|
-
*/
|
|
548
|
-
declare function usePosStockActions(token: string, branchId?: string): UsePosStockActionsReturn;
|
|
549
|
-
/**
|
|
550
|
-
* Generate idempotency key for POS orders
|
|
551
|
-
* Format: pos_{terminal}_{timestamp}_{counter}
|
|
552
|
-
*/
|
|
553
|
-
declare function generateIdempotencyKey(terminalId?: string): string;
|
|
554
|
-
/**
|
|
555
|
-
* Calculate price for variant product
|
|
556
|
-
*/
|
|
557
|
-
declare function calculateVariantPrice(basePrice: number, priceModifier?: number): number;
|
|
558
|
-
/**
|
|
559
|
-
* Format variant attributes for display
|
|
560
|
-
*/
|
|
561
|
-
declare function formatVariantLabel(attributes?: Record<string, string>): string;
|
|
562
|
-
/**
|
|
563
|
-
* Check if product has variants
|
|
564
|
-
*/
|
|
565
|
-
declare function isVariantProduct(product: PosProduct): boolean;
|
|
566
|
-
/**
|
|
567
|
-
* Get available (active) variants for a product
|
|
568
|
-
*/
|
|
569
|
-
declare function getAvailableVariants(product: PosProduct): ProductVariant[];
|
|
570
|
-
/**
|
|
571
|
-
* Find variant by SKU
|
|
572
|
-
*/
|
|
573
|
-
declare function findVariantBySku(product: PosProduct, sku: string): ProductVariant | null;
|
|
574
|
-
/**
|
|
575
|
-
* Get variant stock for branch
|
|
576
|
-
*/
|
|
577
|
-
declare function getVariantStock(product: PosProduct, variantSku: string): number;
|
|
578
|
-
/**
|
|
579
|
-
* Check if product/variant is in stock
|
|
580
|
-
*/
|
|
581
|
-
declare function isInStock(product: PosProduct, variantSku?: string): boolean;
|
|
582
|
-
/**
|
|
583
|
-
* Get product image URL (thumbnail preferred)
|
|
584
|
-
*/
|
|
585
|
-
declare function getPosProductImage(product: PosProduct): string;
|
|
586
|
-
|
|
587
|
-
export { AddCartItemPayload, CART_KEYS, CUSTOMER_KEYS, Cart, CartItem, type CartOptions, CreateOrderPayload, Customer, CustomerPayload, FulfillOrderPayload, type MembershipActionParams, ORDER_KEYS, Order, OrderShipping, POS_KEYS, PosLookupResponse, PosOrderPayload, PosProduct, type PosProductFilters, PosProductsResponse, PosReceiptResponse, RequestShippingPayload, UpdateCartItemPayload, UpdateShippingPayload, type UseAdminOrderActionsReturn, type UseCartCountReturn, type UseCartReturn, type UseCustomerMembershipReturn, type UseCustomerOrderActionsReturn, type UseMyOrdersReturn, type UsePosOrdersReturn, type UsePosProductsReturn, type UsePosStockActionsReturn, calculateCartSubtotal, calculateItemPrice, calculateItemTotal, calculateVariantPrice, customerHooks, findVariantBySku, formatVariantAttributes, formatVariantLabel, generateIdempotencyKey, getAvailableVariants, getCartItemCount, getCartItemVariant, getPosProductImage, getVariantStock, isInStock, isVariantProduct, orderHooks, useAdminOrderActions, useCart, useCartCount, useCurrentCustomer, useCustomerActions, useCustomerDetail, useCustomerMembership, useCustomerNavigation, useCustomerOrderActions, useCustomers, useMyOrderDetail, useMyOrders, useOrderActions, useOrderDetail, useOrderNavigation, useOrders, usePosLookup, usePosLookupMutation, usePosOrders, usePosProducts, usePosReceipt, usePosStockActions };
|
|
1
|
+
import { AddCartItemPayload, AddToCartPayload, Cart, CartItem, CartItemVariation, CartResponse, CartSummary, PopulatedCartItem, RemoveCartItemPayload, UpdateCartItemPayload } from "./types/cart.js";
|
|
2
|
+
import { CancelOrderPayload, CancelRequestPayload, CancellationRequest, CreateOrderPayload, FulfillOrderPayload, GuestCheckoutItem, GuestCheckoutPayload, GuestInfo, MembershipApplied, Order, OrderAddress, OrderDelivery, OrderItem, OrderParcel, OrderPayment, OrderShipping, OrderShippingCashCollection, OrderShippingCharges, OrderShippingHistory, OrderShippingPickup, OrderStatus, OrderVat, PaymentData, PaymentStatus, PromoApplied, PromoDiscountLine, PromoFreeProduct, RefundOrderPayload, RequestShippingPayload, ShippingProvider, ShippingStatus, UpdateShippingPayload, UpdateStatusPayload } from "./types/order.js";
|
|
3
|
+
import { Customer, CustomerAddress, CustomerGender, CustomerListResponse, CustomerMembership, CustomerPayload, CustomerQueryParams, CustomerResponse, CustomerStats, CustomerTier } from "./types/customer.js";
|
|
4
|
+
import { BranchStock, PaymentOption, PaymentState, PosCartItem, PosCustomer, PosLookupData, PosLookupProduct, PosLookupResponse, PosLookupResult, PosOrderItem, PosOrderPayload, PosPayment, PosPaymentMethod, PosProduct, PosProductsBranch, PosProductsParams, PosProductsResponse, PosProductsSummary, PosReceipt, PosReceiptData, PosReceiptItem, PosReceiptResponse, PosReceiptVat, SplitPaymentEntry, VariantStock } from "./types/pos.js";
|
|
5
|
+
import { AdjustPointsPayload, AdjustPointsResponse, EnrollMemberPayload, LoyaltyBalance, LoyaltyBalanceSummary, LoyaltyHistoryParams, LoyaltyHistoryResponse, LoyaltyMember, LoyaltyMemberDetailResponse, LoyaltyMemberResponse, LoyaltyMemberStatus, LoyaltyMyStatusResponse, LoyaltyTransaction, LoyaltyTransactionType, Redemption, RedemptionStatus, RedemptionValidation, ReserveRedemptionPayload, ValidateRedemptionPayload } from "./types/loyalty.js";
|
|
6
|
+
import { CreateEarningRulePayload, EarningConditions, EarningReward, EarningRule, EarningRuleListParams, EarningRuleListResponse, EarningRuleResponse, EarningRuleStatus, EarningRuleType, UpdateEarningRulePayload } from "./types/earning-rules.js";
|
|
7
|
+
import { CreateTierPayload, TierBenefits, TierDefinition, TierDowngrade, TierEvaluationResponse, TierListResponse, TierQualification, TierResponse, UpdateTierPayload } from "./types/tiers.js";
|
|
8
|
+
import { RecordReferralPayload, Referral, ReferralListParams, ReferralListResponse, ReferralLookupResponse, ReferralResponse, ReferralStatus, RejectReferralPayload, SelfReferralPayload } from "./types/referrals.js";
|
|
9
|
+
import { cartApi } from "./api/cart.js";
|
|
10
|
+
import { orderApi } from "./api/order.js";
|
|
11
|
+
import { CustomerApi, customerApi } from "./api/customer.js";
|
|
12
|
+
import { posApi } from "./api/pos.js";
|
|
13
|
+
import { LoyaltyApi, loyaltyApi } from "./api/loyalty.js";
|
|
14
|
+
import { EarningRulesApi, earningRulesApi } from "./api/earning-rules.js";
|
|
15
|
+
import { TiersApi, tiersApi } from "./api/tiers.js";
|
|
16
|
+
import { ReferralsApi, referralsApi } from "./api/referrals.js";
|
|
17
|
+
import { CART_KEYS, CartOptions, UseCartCountReturn, UseCartReturn, calculateCartSubtotal, calculateItemPrice, calculateItemTotal, formatVariantAttributes, getCartItemCount, getCartItemVariant, useCart, useCartCount } from "./hooks/cart.js";
|
|
18
|
+
import { ORDER_KEYS, UseAdminOrderActionsReturn, UseCustomerOrderActionsReturn, UseGuestCheckoutReturn, UseMyOrdersReturn, orderHooks, useAdminOrderActions, useCustomerOrderActions, useGuestCheckout, useMyOrderDetail, useMyOrders, useOrderActions, useOrderDetail, useOrderNavigation, useOrders } from "./hooks/order.js";
|
|
19
|
+
import { CUSTOMER_KEYS, MembershipActionParams, UseCustomerMembershipReturn, customerHooks, useCurrentCustomer, useCustomerActions, useCustomerDetail, useCustomerMembership, useCustomerNavigation, useCustomers } from "./hooks/customer.js";
|
|
20
|
+
import { POS_KEYS, PosProductFilters, UsePosOrdersReturn, UsePosProductsReturn, UsePosStockActionsReturn, calculateVariantPrice, findVariantBySku, formatVariantLabel, generateIdempotencyKey, getAvailableVariants, getPosProductImage, getVariantStock, isInStock, isVariantProduct, usePosLookup, usePosLookupMutation, usePosOrders, usePosProducts, usePosReceipt, usePosStockActions } from "./hooks/pos.js";
|
|
21
|
+
import { LOYALTY_KEYS, UseLoyaltyActionsReturn, useLoyaltyActions, useLoyaltyHistory, useLoyaltyMember, useMyLoyalty, useSelfEnroll } from "./hooks/loyalty.js";
|
|
22
|
+
import { EARNING_RULE_KEYS, UseEarningRuleActionsReturn, useEarningRuleActions, useEarningRuleDetail, useEarningRules } from "./hooks/earning-rules.js";
|
|
23
|
+
import { TIER_KEYS, UseTierActionsReturn, useLoyaltyTiers, useTierActions } from "./hooks/tiers.js";
|
|
24
|
+
import { REFERRAL_KEYS, UseReferralActionsReturn, useMemberReferrals, useReferralActions, useReferralLookup } from "./hooks/referrals.js";
|
|
25
|
+
export { AddCartItemPayload, AddToCartPayload, AdjustPointsPayload, AdjustPointsResponse, BranchStock, CART_KEYS, CUSTOMER_KEYS, CancelOrderPayload, CancelRequestPayload, CancellationRequest, Cart, CartItem, CartItemVariation, CartOptions, CartResponse, CartSummary, CreateEarningRulePayload, CreateOrderPayload, CreateTierPayload, Customer, CustomerAddress, CustomerApi, CustomerGender, CustomerListResponse, CustomerMembership, CustomerPayload, CustomerQueryParams, CustomerResponse, CustomerStats, CustomerTier, EARNING_RULE_KEYS, EarningConditions, EarningReward, EarningRule, EarningRuleListParams, EarningRuleListResponse, EarningRuleResponse, EarningRuleStatus, EarningRuleType, EarningRulesApi, EnrollMemberPayload, FulfillOrderPayload, GuestCheckoutItem, GuestCheckoutPayload, GuestInfo, LOYALTY_KEYS, LoyaltyApi, LoyaltyBalance, LoyaltyBalanceSummary, LoyaltyHistoryParams, LoyaltyHistoryResponse, LoyaltyMember, LoyaltyMemberDetailResponse, LoyaltyMemberResponse, LoyaltyMemberStatus, LoyaltyMyStatusResponse, LoyaltyTransaction, LoyaltyTransactionType, MembershipActionParams, MembershipApplied, ORDER_KEYS, Order, OrderAddress, OrderDelivery, OrderItem, OrderParcel, OrderPayment, OrderShipping, OrderShippingCashCollection, OrderShippingCharges, OrderShippingHistory, OrderShippingPickup, OrderStatus, OrderVat, POS_KEYS, PaymentData, PaymentOption, PaymentState, PaymentStatus, PopulatedCartItem, PosCartItem, PosCustomer, PosLookupData, PosLookupProduct, PosLookupResponse, PosLookupResult, PosOrderItem, PosOrderPayload, PosPayment, PosPaymentMethod, PosProduct, PosProductFilters, PosProductsBranch, PosProductsParams, PosProductsResponse, PosProductsSummary, PosReceipt, PosReceiptData, PosReceiptItem, PosReceiptResponse, PosReceiptVat, PromoApplied, PromoDiscountLine, PromoFreeProduct, REFERRAL_KEYS, RecordReferralPayload, Redemption, RedemptionStatus, RedemptionValidation, Referral, ReferralListParams, ReferralListResponse, ReferralLookupResponse, ReferralResponse, ReferralStatus, ReferralsApi, RefundOrderPayload, RejectReferralPayload, RemoveCartItemPayload, RequestShippingPayload, ReserveRedemptionPayload, SelfReferralPayload, ShippingProvider, ShippingStatus, SplitPaymentEntry, TIER_KEYS, TierBenefits, TierDefinition, TierDowngrade, TierEvaluationResponse, TierListResponse, TierQualification, TierResponse, TiersApi, UpdateCartItemPayload, UpdateEarningRulePayload, UpdateShippingPayload, UpdateStatusPayload, UpdateTierPayload, UseAdminOrderActionsReturn, UseCartCountReturn, UseCartReturn, UseCustomerMembershipReturn, UseCustomerOrderActionsReturn, UseEarningRuleActionsReturn, UseGuestCheckoutReturn, UseLoyaltyActionsReturn, UseMyOrdersReturn, UsePosOrdersReturn, UsePosProductsReturn, UsePosStockActionsReturn, UseReferralActionsReturn, UseTierActionsReturn, ValidateRedemptionPayload, VariantStock, calculateCartSubtotal, calculateItemPrice, calculateItemTotal, calculateVariantPrice, cartApi, customerApi, customerHooks, earningRulesApi, findVariantBySku, formatVariantAttributes, formatVariantLabel, generateIdempotencyKey, getAvailableVariants, getCartItemCount, getCartItemVariant, getPosProductImage, getVariantStock, isInStock, isVariantProduct, loyaltyApi, orderApi, orderApi as orderApiDefault, orderHooks, posApi, posApi as posApiDefault, referralsApi, tiersApi, useAdminOrderActions, useCart, useCartCount, useCurrentCustomer, useCustomerActions, useCustomerDetail, useCustomerMembership, useCustomerNavigation, useCustomerOrderActions, useCustomers, useEarningRuleActions, useEarningRuleDetail, useEarningRules, useGuestCheckout, useLoyaltyActions, useLoyaltyHistory, useLoyaltyMember, useLoyaltyTiers, useMemberReferrals, useMyLoyalty, useMyOrderDetail, useMyOrders, useOrderActions, useOrderDetail, useOrderNavigation, useOrders, usePosLookup, usePosLookupMutation, usePosOrders, usePosProducts, usePosReceipt, usePosStockActions, useReferralActions, useReferralLookup, useSelfEnroll, useTierActions };
|
package/dist/sales/index.js
CHANGED
|
@@ -1,9 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { OrderStatus, PaymentStatus } from "./types/order.js";
|
|
2
|
+
import { cartApi } from "./api/cart.js";
|
|
3
|
+
import orderApi from "./api/order.js";
|
|
4
|
+
import { CustomerApi, customerApi } from "./api/customer.js";
|
|
5
|
+
import posApi from "./api/pos.js";
|
|
6
|
+
import { LoyaltyApi, loyaltyApi } from "./api/loyalty.js";
|
|
7
|
+
import { EarningRulesApi, earningRulesApi } from "./api/earning-rules.js";
|
|
8
|
+
import { TiersApi, tiersApi } from "./api/tiers.js";
|
|
9
|
+
import { ReferralsApi, referralsApi } from "./api/referrals.js";
|
|
10
|
+
import { CART_KEYS, calculateCartSubtotal, calculateItemPrice, calculateItemTotal, formatVariantAttributes, getCartItemCount, getCartItemVariant, useCart, useCartCount } from "./hooks/cart.js";
|
|
11
|
+
import { ORDER_KEYS, orderHooks, useAdminOrderActions, useCustomerOrderActions, useGuestCheckout, useMyOrderDetail, useMyOrders, useOrderActions, useOrderDetail, useOrderNavigation, useOrders } from "./hooks/order.js";
|
|
12
|
+
import { CUSTOMER_KEYS, customerHooks, useCurrentCustomer, useCustomerActions, useCustomerDetail, useCustomerMembership, useCustomerNavigation, useCustomers } from "./hooks/customer.js";
|
|
13
|
+
import { POS_KEYS, calculateVariantPrice, findVariantBySku, formatVariantLabel, generateIdempotencyKey, getAvailableVariants, getPosProductImage, getVariantStock, isInStock, isVariantProduct, usePosLookup, usePosLookupMutation, usePosOrders, usePosProducts, usePosReceipt, usePosStockActions } from "./hooks/pos.js";
|
|
14
|
+
import { LOYALTY_KEYS, useLoyaltyActions, useLoyaltyHistory, useLoyaltyMember, useMyLoyalty, useSelfEnroll } from "./hooks/loyalty.js";
|
|
15
|
+
import { EARNING_RULE_KEYS, useEarningRuleActions, useEarningRuleDetail, useEarningRules } from "./hooks/earning-rules.js";
|
|
16
|
+
import { TIER_KEYS, useLoyaltyTiers, useTierActions } from "./hooks/tiers.js";
|
|
17
|
+
import { REFERRAL_KEYS, useMemberReferrals, useReferralActions, useReferralLookup } from "./hooks/referrals.js";
|
|
18
|
+
|
|
19
|
+
export { CART_KEYS, CUSTOMER_KEYS, CustomerApi, EARNING_RULE_KEYS, EarningRulesApi, LOYALTY_KEYS, LoyaltyApi, ORDER_KEYS, OrderStatus, POS_KEYS, PaymentStatus, REFERRAL_KEYS, ReferralsApi, TIER_KEYS, TiersApi, calculateCartSubtotal, calculateItemPrice, calculateItemTotal, calculateVariantPrice, cartApi, customerApi, customerHooks, earningRulesApi, findVariantBySku, formatVariantAttributes, formatVariantLabel, generateIdempotencyKey, getAvailableVariants, getCartItemCount, getCartItemVariant, getPosProductImage, getVariantStock, isInStock, isVariantProduct, loyaltyApi, orderApi, orderApi as orderApiDefault, orderHooks, posApi, posApi as posApiDefault, referralsApi, tiersApi, useAdminOrderActions, useCart, useCartCount, useCurrentCustomer, useCustomerActions, useCustomerDetail, useCustomerMembership, useCustomerNavigation, useCustomerOrderActions, useCustomers, useEarningRuleActions, useEarningRuleDetail, useEarningRules, useGuestCheckout, useLoyaltyActions, useLoyaltyHistory, useLoyaltyMember, useLoyaltyTiers, useMemberReferrals, useMyLoyalty, useMyOrderDetail, useMyOrders, useOrderActions, useOrderDetail, useOrderNavigation, useOrders, usePosLookup, usePosLookupMutation, usePosOrders, usePosProducts, usePosReceipt, usePosStockActions, useReferralActions, useReferralLookup, useSelfEnroll, useTierActions };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as _classytic_arc_next_prefetch0 from "@classytic/arc-next/prefetch";
|
|
2
|
+
|
|
3
|
+
//#region src/sales/prefetch.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Sales SSR Prefetchers
|
|
6
|
+
*/
|
|
7
|
+
declare const ordersPrefetcher: _classytic_arc_next_prefetch0.CrudPrefetcher;
|
|
8
|
+
declare const customersPrefetcher: _classytic_arc_next_prefetch0.CrudPrefetcher;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { customersPrefetcher, ordersPrefetcher };
|