@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
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
//#region src/content/types/cms.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* CMS Types - Aligned with lib/cms-data.ts structure
|
|
4
|
+
*/
|
|
5
|
+
type CMSPageStatus = "draft" | "published" | "archived";
|
|
6
|
+
interface CMSMetadata {
|
|
7
|
+
title: string;
|
|
8
|
+
description: string;
|
|
9
|
+
keywords: string[];
|
|
10
|
+
ogImage?: string;
|
|
11
|
+
}
|
|
12
|
+
interface CMSPage<T = Record<string, unknown>> {
|
|
13
|
+
_id?: string;
|
|
14
|
+
name: string;
|
|
15
|
+
slug: string;
|
|
16
|
+
status: CMSPageStatus;
|
|
17
|
+
content: T;
|
|
18
|
+
metadata?: CMSMetadata;
|
|
19
|
+
publishedAt?: string;
|
|
20
|
+
createdAt?: string;
|
|
21
|
+
updatedAt?: string;
|
|
22
|
+
}
|
|
23
|
+
interface CMSPagePayload {
|
|
24
|
+
name?: string;
|
|
25
|
+
status?: CMSPageStatus;
|
|
26
|
+
content?: Record<string, unknown>;
|
|
27
|
+
metadata?: Partial<CMSMetadata>;
|
|
28
|
+
}
|
|
29
|
+
interface CTA {
|
|
30
|
+
label: string;
|
|
31
|
+
href: string;
|
|
32
|
+
}
|
|
33
|
+
interface ContactInfo {
|
|
34
|
+
email?: string;
|
|
35
|
+
phone?: string;
|
|
36
|
+
address?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Home Page Content
|
|
40
|
+
*/
|
|
41
|
+
interface HomePageContent {
|
|
42
|
+
hero: {
|
|
43
|
+
badge: string;
|
|
44
|
+
headline: string[];
|
|
45
|
+
highlightedWord?: string;
|
|
46
|
+
description: string;
|
|
47
|
+
primaryCTA: CTA;
|
|
48
|
+
secondaryCTA?: CTA;
|
|
49
|
+
image?: string;
|
|
50
|
+
floatingBadge?: {
|
|
51
|
+
value: string;
|
|
52
|
+
label: string;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
marquee: {
|
|
56
|
+
items: string[];
|
|
57
|
+
};
|
|
58
|
+
brandStory: {
|
|
59
|
+
badge: string;
|
|
60
|
+
headline: string[];
|
|
61
|
+
paragraphs: string[];
|
|
62
|
+
stats: Array<{
|
|
63
|
+
value: string;
|
|
64
|
+
label: string;
|
|
65
|
+
}>;
|
|
66
|
+
images: string[];
|
|
67
|
+
cta: CTA;
|
|
68
|
+
};
|
|
69
|
+
featuredProducts: {
|
|
70
|
+
badge: string;
|
|
71
|
+
headline: string;
|
|
72
|
+
description: string;
|
|
73
|
+
cta: CTA;
|
|
74
|
+
};
|
|
75
|
+
testimonials: {
|
|
76
|
+
badge: string;
|
|
77
|
+
headline: string;
|
|
78
|
+
items: Array<{
|
|
79
|
+
id: number;
|
|
80
|
+
name: string;
|
|
81
|
+
location: string;
|
|
82
|
+
rating: number;
|
|
83
|
+
text: string;
|
|
84
|
+
avatar: string;
|
|
85
|
+
}>;
|
|
86
|
+
};
|
|
87
|
+
instagramFeed: {
|
|
88
|
+
badge: string;
|
|
89
|
+
headline: string;
|
|
90
|
+
description: string;
|
|
91
|
+
images: string[];
|
|
92
|
+
cta: CTA;
|
|
93
|
+
};
|
|
94
|
+
features?: {
|
|
95
|
+
items: Array<{
|
|
96
|
+
icon: string;
|
|
97
|
+
title: string;
|
|
98
|
+
description: string;
|
|
99
|
+
}>;
|
|
100
|
+
};
|
|
101
|
+
promoBanner?: {
|
|
102
|
+
headline: string;
|
|
103
|
+
subheadline: string;
|
|
104
|
+
description: string;
|
|
105
|
+
cta: CTA;
|
|
106
|
+
backgroundImage: string;
|
|
107
|
+
};
|
|
108
|
+
lookbook?: {
|
|
109
|
+
badge: string;
|
|
110
|
+
headline: string;
|
|
111
|
+
description: string;
|
|
112
|
+
items: Array<{
|
|
113
|
+
id: number;
|
|
114
|
+
title: string;
|
|
115
|
+
image: string;
|
|
116
|
+
href: string;
|
|
117
|
+
}>;
|
|
118
|
+
};
|
|
119
|
+
newsletter?: {
|
|
120
|
+
headline: string;
|
|
121
|
+
description: string;
|
|
122
|
+
placeholder: string;
|
|
123
|
+
buttonText: string;
|
|
124
|
+
disclaimer: string;
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Privacy/Terms/Cookies Page Content (Text pages with sections)
|
|
129
|
+
*/
|
|
130
|
+
interface PolicyPageContent {
|
|
131
|
+
title: string;
|
|
132
|
+
lastUpdated: string;
|
|
133
|
+
intro?: string;
|
|
134
|
+
sections: Array<{
|
|
135
|
+
title: string;
|
|
136
|
+
content?: string;
|
|
137
|
+
list?: string[];
|
|
138
|
+
subsections?: Array<{
|
|
139
|
+
title: string;
|
|
140
|
+
content: string;
|
|
141
|
+
}>;
|
|
142
|
+
contact?: ContactInfo;
|
|
143
|
+
}>;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Returns Page Content
|
|
147
|
+
*/
|
|
148
|
+
interface ReturnsPageContent {
|
|
149
|
+
title: string;
|
|
150
|
+
subtitle: string;
|
|
151
|
+
steps: Array<{
|
|
152
|
+
icon: string;
|
|
153
|
+
title: string;
|
|
154
|
+
description: string;
|
|
155
|
+
}>;
|
|
156
|
+
sections: Array<{
|
|
157
|
+
type: "policy" | "grid" | "text";
|
|
158
|
+
title: string;
|
|
159
|
+
highlight?: {
|
|
160
|
+
title: string;
|
|
161
|
+
content: string;
|
|
162
|
+
};
|
|
163
|
+
columns?: Array<{
|
|
164
|
+
title: string;
|
|
165
|
+
variant: "success" | "destructive";
|
|
166
|
+
items: string[];
|
|
167
|
+
}>;
|
|
168
|
+
content?: string;
|
|
169
|
+
paragraphs?: Array<string | {
|
|
170
|
+
text: string;
|
|
171
|
+
bold?: boolean;
|
|
172
|
+
suffix?: string;
|
|
173
|
+
}>;
|
|
174
|
+
list?: string[];
|
|
175
|
+
footer?: string;
|
|
176
|
+
}>;
|
|
177
|
+
contactSection: {
|
|
178
|
+
title: string;
|
|
179
|
+
content: string;
|
|
180
|
+
email: string;
|
|
181
|
+
phone: string;
|
|
182
|
+
hours: string;
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* FAQ Page Content
|
|
187
|
+
*/
|
|
188
|
+
interface FAQPageContent {
|
|
189
|
+
title: string;
|
|
190
|
+
subtitle: string;
|
|
191
|
+
categories: Array<{
|
|
192
|
+
title: string;
|
|
193
|
+
items: Array<{
|
|
194
|
+
question: string;
|
|
195
|
+
answer: string;
|
|
196
|
+
}>;
|
|
197
|
+
}>;
|
|
198
|
+
contactSection: {
|
|
199
|
+
title: string;
|
|
200
|
+
description: string;
|
|
201
|
+
email: string;
|
|
202
|
+
phone: string;
|
|
203
|
+
hours: string;
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* About Page Content
|
|
208
|
+
*/
|
|
209
|
+
interface AboutPageContent {
|
|
210
|
+
hero: {
|
|
211
|
+
badge: string;
|
|
212
|
+
headline: string;
|
|
213
|
+
description: string;
|
|
214
|
+
image: string;
|
|
215
|
+
};
|
|
216
|
+
story: {
|
|
217
|
+
title: string;
|
|
218
|
+
paragraphs: string[];
|
|
219
|
+
};
|
|
220
|
+
values: {
|
|
221
|
+
title: string;
|
|
222
|
+
items: Array<{
|
|
223
|
+
icon: string;
|
|
224
|
+
title: string;
|
|
225
|
+
description: string;
|
|
226
|
+
}>;
|
|
227
|
+
};
|
|
228
|
+
stats: Array<{
|
|
229
|
+
value: string;
|
|
230
|
+
label: string;
|
|
231
|
+
}>;
|
|
232
|
+
team: {
|
|
233
|
+
title: string;
|
|
234
|
+
description: string;
|
|
235
|
+
members: Array<{
|
|
236
|
+
name: string;
|
|
237
|
+
role: string;
|
|
238
|
+
image: string;
|
|
239
|
+
bio: string;
|
|
240
|
+
}>;
|
|
241
|
+
};
|
|
242
|
+
cta: {
|
|
243
|
+
title: string;
|
|
244
|
+
description: string;
|
|
245
|
+
buttonText: string;
|
|
246
|
+
buttonLink: string;
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Contact Page Content
|
|
251
|
+
* Note: contactInfo icons are static (MapPin, Phone, Mail) - no icon field needed
|
|
252
|
+
*/
|
|
253
|
+
interface ContactPageContent {
|
|
254
|
+
title: string;
|
|
255
|
+
subtitle: string;
|
|
256
|
+
contactInfo: Array<{
|
|
257
|
+
title: string;
|
|
258
|
+
lines: string[];
|
|
259
|
+
}>;
|
|
260
|
+
form: {
|
|
261
|
+
title: string;
|
|
262
|
+
description: string;
|
|
263
|
+
fields: Array<{
|
|
264
|
+
name: string;
|
|
265
|
+
label: string;
|
|
266
|
+
type: string;
|
|
267
|
+
placeholder?: string;
|
|
268
|
+
required: boolean;
|
|
269
|
+
options?: string[];
|
|
270
|
+
}>;
|
|
271
|
+
submitText: string;
|
|
272
|
+
};
|
|
273
|
+
faq?: {
|
|
274
|
+
title: string;
|
|
275
|
+
description: string;
|
|
276
|
+
link: string;
|
|
277
|
+
linkText: string;
|
|
278
|
+
};
|
|
279
|
+
socialTitle?: string;
|
|
280
|
+
socials: Array<{
|
|
281
|
+
platform: string;
|
|
282
|
+
handle: string;
|
|
283
|
+
url: string;
|
|
284
|
+
}>;
|
|
285
|
+
map?: {
|
|
286
|
+
title: string;
|
|
287
|
+
embedUrl: string;
|
|
288
|
+
};
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
291
|
+
* Size Guide Page Content
|
|
292
|
+
*/
|
|
293
|
+
interface SizeGuidePageContent {
|
|
294
|
+
title: string;
|
|
295
|
+
subtitle: string;
|
|
296
|
+
howToMeasure: {
|
|
297
|
+
title: string;
|
|
298
|
+
description: string;
|
|
299
|
+
measurements: Array<{
|
|
300
|
+
name: string;
|
|
301
|
+
icon: string;
|
|
302
|
+
instruction: string;
|
|
303
|
+
}>;
|
|
304
|
+
};
|
|
305
|
+
sizeTables: Array<{
|
|
306
|
+
category: string;
|
|
307
|
+
description: string;
|
|
308
|
+
headers: string[];
|
|
309
|
+
rows: string[][];
|
|
310
|
+
}>;
|
|
311
|
+
fitTypes: {
|
|
312
|
+
title: string;
|
|
313
|
+
types: Array<{
|
|
314
|
+
name: string;
|
|
315
|
+
description: string;
|
|
316
|
+
recommendation: string;
|
|
317
|
+
}>;
|
|
318
|
+
};
|
|
319
|
+
tips: {
|
|
320
|
+
title: string;
|
|
321
|
+
items: string[];
|
|
322
|
+
};
|
|
323
|
+
helpSection: {
|
|
324
|
+
title: string;
|
|
325
|
+
description: string;
|
|
326
|
+
email: string;
|
|
327
|
+
phone: string;
|
|
328
|
+
};
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Shipping & Delivery Page Content
|
|
332
|
+
*/
|
|
333
|
+
interface ShippingPageContent {
|
|
334
|
+
title: string;
|
|
335
|
+
subtitle: string;
|
|
336
|
+
deliveryMethods: Array<{
|
|
337
|
+
icon: string;
|
|
338
|
+
name: string;
|
|
339
|
+
duration: string;
|
|
340
|
+
price: string;
|
|
341
|
+
description: string;
|
|
342
|
+
}>;
|
|
343
|
+
deliveryAreas: {
|
|
344
|
+
title: string;
|
|
345
|
+
areas: Array<{
|
|
346
|
+
name: string;
|
|
347
|
+
duration: string;
|
|
348
|
+
cost: string;
|
|
349
|
+
}>;
|
|
350
|
+
};
|
|
351
|
+
orderTracking: {
|
|
352
|
+
title: string;
|
|
353
|
+
description: string;
|
|
354
|
+
steps: Array<{
|
|
355
|
+
title: string;
|
|
356
|
+
description: string;
|
|
357
|
+
}>;
|
|
358
|
+
};
|
|
359
|
+
policies: Array<{
|
|
360
|
+
title: string;
|
|
361
|
+
content: string;
|
|
362
|
+
list?: string[];
|
|
363
|
+
}>;
|
|
364
|
+
faq: Array<{
|
|
365
|
+
question: string;
|
|
366
|
+
answer: string;
|
|
367
|
+
}>;
|
|
368
|
+
contactSection: {
|
|
369
|
+
title: string;
|
|
370
|
+
description: string;
|
|
371
|
+
email: string;
|
|
372
|
+
phone: string;
|
|
373
|
+
hours: string;
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
type CMSContentBySlug = {
|
|
377
|
+
home: HomePageContent;
|
|
378
|
+
"privacy-policy": PolicyPageContent;
|
|
379
|
+
"terms-conditions": PolicyPageContent;
|
|
380
|
+
cookies: PolicyPageContent;
|
|
381
|
+
"returns-refunds": ReturnsPageContent;
|
|
382
|
+
faqs: FAQPageContent;
|
|
383
|
+
"about-us": AboutPageContent;
|
|
384
|
+
contact: ContactPageContent;
|
|
385
|
+
"size-guide": SizeGuidePageContent;
|
|
386
|
+
"shipping-delivery": ShippingPageContent;
|
|
387
|
+
};
|
|
388
|
+
type CMSSlug = keyof CMSContentBySlug;
|
|
389
|
+
//#endregion
|
|
390
|
+
export { AboutPageContent, CMSContentBySlug, CMSMetadata, CMSPage, CMSPagePayload, CMSPageStatus, CMSSlug, ContactPageContent, FAQPageContent, HomePageContent, PolicyPageContent, ReturnsPageContent, ShippingPageContent, SizeGuidePageContent };
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
//#region src/content/types/media.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Media Types
|
|
4
|
+
* Simple types for media upload, management, and retrieval
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Allowed media folders
|
|
8
|
+
*/
|
|
9
|
+
type MediaFolder = "general" | "products" | "categories" | "blog" | "users" | "banners" | "brands";
|
|
10
|
+
/**
|
|
11
|
+
* Image variant names (auto-generated on upload)
|
|
12
|
+
* - thumbnail: 150x200 (for grids, lists)
|
|
13
|
+
* - medium: 600x800 (for detail views)
|
|
14
|
+
*/
|
|
15
|
+
type VariantName = "thumbnail" | "medium";
|
|
16
|
+
/**
|
|
17
|
+
* Image dimensions
|
|
18
|
+
*/
|
|
19
|
+
interface MediaDimensions {
|
|
20
|
+
width: number;
|
|
21
|
+
height: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Image variant (resized version)
|
|
25
|
+
*/
|
|
26
|
+
interface MediaVariant {
|
|
27
|
+
name: VariantName;
|
|
28
|
+
url: string;
|
|
29
|
+
width: number;
|
|
30
|
+
height: number;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Media document (image file with metadata)
|
|
34
|
+
*/
|
|
35
|
+
interface Media {
|
|
36
|
+
_id: string;
|
|
37
|
+
url: string;
|
|
38
|
+
filename: string;
|
|
39
|
+
folder: MediaFolder;
|
|
40
|
+
alt?: string;
|
|
41
|
+
title?: string;
|
|
42
|
+
size: number;
|
|
43
|
+
dimensions: MediaDimensions;
|
|
44
|
+
variants?: MediaVariant[];
|
|
45
|
+
contentType?: string;
|
|
46
|
+
createdAt: string;
|
|
47
|
+
updatedAt?: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Upload single file payload
|
|
51
|
+
*/
|
|
52
|
+
interface UploadPayload {
|
|
53
|
+
file: File | Blob;
|
|
54
|
+
folder?: MediaFolder;
|
|
55
|
+
alt?: string;
|
|
56
|
+
title?: string;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Upload multiple files payload
|
|
60
|
+
*/
|
|
61
|
+
interface UploadMultiplePayload {
|
|
62
|
+
files: (File | Blob)[];
|
|
63
|
+
folder?: MediaFolder;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Update media payload
|
|
67
|
+
*/
|
|
68
|
+
interface UpdateMediaPayload {
|
|
69
|
+
alt?: string;
|
|
70
|
+
title?: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Bulk delete payload
|
|
74
|
+
*/
|
|
75
|
+
interface BulkDeletePayload {
|
|
76
|
+
ids: string[];
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Move files payload
|
|
80
|
+
*/
|
|
81
|
+
interface MoveFilesPayload {
|
|
82
|
+
ids: string[];
|
|
83
|
+
targetFolder: MediaFolder;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Query parameters for media listing
|
|
87
|
+
*/
|
|
88
|
+
interface MediaQueryParams {
|
|
89
|
+
page?: number;
|
|
90
|
+
limit?: number;
|
|
91
|
+
folder?: MediaFolder;
|
|
92
|
+
search?: string;
|
|
93
|
+
sort?: string;
|
|
94
|
+
[key: string]: unknown;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Bulk delete result
|
|
98
|
+
*/
|
|
99
|
+
interface BulkDeleteResult {
|
|
100
|
+
success: string[];
|
|
101
|
+
failed: string[];
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Move files result
|
|
105
|
+
*/
|
|
106
|
+
interface MoveFilesResult {
|
|
107
|
+
modifiedCount: number;
|
|
108
|
+
}
|
|
109
|
+
//#endregion
|
|
110
|
+
export { BulkDeletePayload, BulkDeleteResult, Media, MediaDimensions, MediaFolder, MediaQueryParams, MediaVariant, MoveFilesPayload, MoveFilesResult, UpdateMediaPayload, UploadMultiplePayload, UploadPayload, VariantName };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AggregatePaginationResponse, ApiResponse, BaseApi, BaseApiConfig, BaseApiConfig as BaseApiConfig$1, DeleteResponse, ExtractDoc, FilterOperator, KeysetPaginationResponse, OffsetPaginationResponse, PaginatedResponse, PopulateOption, QueryParams, RequestOptions, SortDirection, SortSpec, isAggregatePagination, isKeysetPagination, isOffsetPagination } from "@classytic/arc-next/api";
|
|
2
|
+
|
|
3
|
+
//#region src/core/api-factory.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Commerce BaseApi — wraps arc-next's BaseApi with auto auth injection.
|
|
6
|
+
*
|
|
7
|
+
* arc-next's handleApiRequest does NOT read from configureAuth().
|
|
8
|
+
* commerce-sdk's handleApiRequest DOES (see api-handler.ts lines 132-148).
|
|
9
|
+
* By passing it as the client.request, every BaseApi.request() / getAll() etc.
|
|
10
|
+
* automatically gets the bearer token and x-organization-id header.
|
|
11
|
+
*/
|
|
12
|
+
declare class BaseApi$1<TDoc = Record<string, unknown>, TCreate = Partial<TDoc>, TUpdate = Partial<TDoc>> extends BaseApi<TDoc, TCreate, TUpdate> {
|
|
13
|
+
constructor(entity: string, config?: BaseApiConfig);
|
|
14
|
+
}
|
|
15
|
+
declare function createCrudApi<TDoc = Record<string, unknown>, TCreate = Partial<TDoc>, TUpdate = Partial<TDoc>>(entity: string, config?: BaseApiConfig): BaseApi$1<TDoc, TCreate, TUpdate>;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { type AggregatePaginationResponse, type ApiResponse, BaseApi$1 as BaseApi, type BaseApiConfig$1 as BaseApiConfig, type DeleteResponse, type ExtractDoc, type FilterOperator, type KeysetPaginationResponse, type OffsetPaginationResponse, type PaginatedResponse, type PopulateOption, type QueryParams, type RequestOptions, type SortDirection, type SortSpec, createCrudApi, isAggregatePagination, isKeysetPagination, isOffsetPagination };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { handleApiRequest } from "./api-handler.js";
|
|
2
|
+
import { BaseApi, isAggregatePagination, isKeysetPagination, isOffsetPagination } from "@classytic/arc-next/api";
|
|
3
|
+
|
|
4
|
+
//#region src/core/api-factory.ts
|
|
5
|
+
/**
|
|
6
|
+
* API Factory — Re-exports from @classytic/arc-next
|
|
7
|
+
*
|
|
8
|
+
* All CRUD API implementations now live in arc-next.
|
|
9
|
+
* This file maintains backwards-compatible exports for domain modules.
|
|
10
|
+
*
|
|
11
|
+
* BaseApi is wrapped so that every request auto-injects auth (token + orgId)
|
|
12
|
+
* from configureAuth() when not explicitly provided. arc-next's BaseApi is a
|
|
13
|
+
* dumb transport — auth injection is the SDK consumer's responsibility.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* Commerce BaseApi — wraps arc-next's BaseApi with auto auth injection.
|
|
17
|
+
*
|
|
18
|
+
* arc-next's handleApiRequest does NOT read from configureAuth().
|
|
19
|
+
* commerce-sdk's handleApiRequest DOES (see api-handler.ts lines 132-148).
|
|
20
|
+
* By passing it as the client.request, every BaseApi.request() / getAll() etc.
|
|
21
|
+
* automatically gets the bearer token and x-organization-id header.
|
|
22
|
+
*/
|
|
23
|
+
var BaseApi$1 = class extends BaseApi {
|
|
24
|
+
constructor(entity, config = {}) {
|
|
25
|
+
super(entity, {
|
|
26
|
+
...config,
|
|
27
|
+
client: config.client ?? {
|
|
28
|
+
request: handleApiRequest,
|
|
29
|
+
config: { baseUrl: "" }
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
function createCrudApi(entity, config = {}) {
|
|
35
|
+
return new BaseApi$1(entity, config);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
export { BaseApi$1 as BaseApi, createCrudApi, isAggregatePagination, isKeysetPagination, isOffsetPagination };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { ApiRequestOptions, ArcApiError, ArcClient, ArcClientConfig, BlobResponse, HttpMethod, TextResponse, createClient, createQueryString, getAuthContext, isArcApiError } from "@classytic/arc-next/client";
|
|
2
|
+
|
|
3
|
+
//#region src/core/api-handler.d.ts
|
|
4
|
+
type HttpMethod$1 = HttpMethod;
|
|
5
|
+
type ApiRequestOptions$1 = ApiRequestOptions;
|
|
6
|
+
type BlobResponse$1 = BlobResponse;
|
|
7
|
+
type TextResponse$1 = TextResponse;
|
|
8
|
+
interface SDKConfig {
|
|
9
|
+
baseUrl: string;
|
|
10
|
+
organizationId?: string;
|
|
11
|
+
getToken?: () => string | null | Promise<string | null>;
|
|
12
|
+
cache?: RequestCache;
|
|
13
|
+
headers?: Record<string, string>;
|
|
14
|
+
credentials?: RequestCredentials;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Configure the Commerce SDK.
|
|
18
|
+
* Wraps arc-next's configureClient + configureAuth.
|
|
19
|
+
*/
|
|
20
|
+
declare function configureSDK(config: SDKConfig): void;
|
|
21
|
+
declare function getSDKConfig(): SDKConfig;
|
|
22
|
+
declare function getBaseUrl(): string;
|
|
23
|
+
declare function setSDKConfigProvider(provider: () => SDKConfig): void;
|
|
24
|
+
/**
|
|
25
|
+
* Commerce-specific API error.
|
|
26
|
+
* Wraps arc-next's ArcApiError with backwards-compatible interface.
|
|
27
|
+
*/
|
|
28
|
+
declare class ApiError extends Error {
|
|
29
|
+
readonly status: number;
|
|
30
|
+
readonly statusText: string;
|
|
31
|
+
readonly body: unknown;
|
|
32
|
+
readonly endpoint: string;
|
|
33
|
+
readonly method: HttpMethod$1;
|
|
34
|
+
constructor(options: {
|
|
35
|
+
message: string;
|
|
36
|
+
status: number;
|
|
37
|
+
statusText: string;
|
|
38
|
+
body: unknown;
|
|
39
|
+
endpoint: string;
|
|
40
|
+
method: HttpMethod$1;
|
|
41
|
+
});
|
|
42
|
+
isClientError(): boolean;
|
|
43
|
+
isServerError(): boolean;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Wrapped handleApiRequest that auto-injects auth token from configureAuth
|
|
47
|
+
* when not explicitly provided. This ensures all SDK API calls (including
|
|
48
|
+
* media uploads, POS, inventory) send the bearer token automatically.
|
|
49
|
+
*/
|
|
50
|
+
declare function handleApiRequest$1<T = unknown>(method: HttpMethod, endpoint: string, options?: ApiRequestOptions): Promise<T>;
|
|
51
|
+
declare const createQueryString$1: typeof createQueryString;
|
|
52
|
+
//#endregion
|
|
53
|
+
export { ApiError, ApiRequestOptions$1 as ApiRequestOptions, ArcApiError, type ArcClient, type ArcClientConfig, BlobResponse$1 as BlobResponse, HttpMethod$1 as HttpMethod, SDKConfig, TextResponse$1 as TextResponse, configureSDK, createClient, createQueryString$1 as createQueryString, getAuthContext, getBaseUrl, getSDKConfig, handleApiRequest$1 as handleApiRequest, isArcApiError, setSDKConfigProvider };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { ArcApiError, configureAuth, configureClient, createClient, createQueryString, getAuthContext, handleApiRequest, isArcApiError } from "@classytic/arc-next/client";
|
|
2
|
+
|
|
3
|
+
//#region src/core/api-handler.ts
|
|
4
|
+
/**
|
|
5
|
+
* API Handler — Commerce-specific config adapter for arc-next
|
|
6
|
+
*
|
|
7
|
+
* Provides configureSDK() which wraps arc-next's configureClient/configureAuth.
|
|
8
|
+
* Re-exports request handler and utilities from arc-next for backwards compat.
|
|
9
|
+
*/
|
|
10
|
+
let _sdkConfig = null;
|
|
11
|
+
let _configProvider = null;
|
|
12
|
+
/**
|
|
13
|
+
* Configure the Commerce SDK.
|
|
14
|
+
* Wraps arc-next's configureClient + configureAuth.
|
|
15
|
+
*/
|
|
16
|
+
function configureSDK(config) {
|
|
17
|
+
_sdkConfig = config;
|
|
18
|
+
configureClient({
|
|
19
|
+
baseUrl: config.baseUrl,
|
|
20
|
+
defaultHeaders: config.headers,
|
|
21
|
+
authMode: "bearer",
|
|
22
|
+
credentials: config.credentials
|
|
23
|
+
});
|
|
24
|
+
configureAuth({
|
|
25
|
+
getToken: config.getToken ? () => {
|
|
26
|
+
const result = config.getToken();
|
|
27
|
+
if (result instanceof Promise) return null;
|
|
28
|
+
return result;
|
|
29
|
+
} : () => null,
|
|
30
|
+
getOrgId: () => config.organizationId || null
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
function getSDKConfig() {
|
|
34
|
+
if (_configProvider) return _configProvider();
|
|
35
|
+
if (!_sdkConfig) throw new Error("SDK not configured. Call configureSDK() first.");
|
|
36
|
+
return _sdkConfig;
|
|
37
|
+
}
|
|
38
|
+
function getBaseUrl() {
|
|
39
|
+
return getSDKConfig().baseUrl;
|
|
40
|
+
}
|
|
41
|
+
function setSDKConfigProvider(provider) {
|
|
42
|
+
_configProvider = provider;
|
|
43
|
+
const config = provider();
|
|
44
|
+
if (config) configureSDK(config);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Commerce-specific API error.
|
|
48
|
+
* Wraps arc-next's ArcApiError with backwards-compatible interface.
|
|
49
|
+
*/
|
|
50
|
+
var ApiError = class extends Error {
|
|
51
|
+
constructor(options) {
|
|
52
|
+
super(options.message);
|
|
53
|
+
this.name = "ApiError";
|
|
54
|
+
this.status = options.status;
|
|
55
|
+
this.statusText = options.statusText;
|
|
56
|
+
this.body = options.body;
|
|
57
|
+
this.endpoint = options.endpoint;
|
|
58
|
+
this.method = options.method;
|
|
59
|
+
}
|
|
60
|
+
isClientError() {
|
|
61
|
+
return this.status >= 400 && this.status < 500;
|
|
62
|
+
}
|
|
63
|
+
isServerError() {
|
|
64
|
+
return this.status >= 500;
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Wrapped handleApiRequest that auto-injects auth token from configureAuth
|
|
69
|
+
* when not explicitly provided. This ensures all SDK API calls (including
|
|
70
|
+
* media uploads, POS, inventory) send the bearer token automatically.
|
|
71
|
+
*/
|
|
72
|
+
function handleApiRequest$1(method, endpoint, options = {}) {
|
|
73
|
+
if (!options.token) {
|
|
74
|
+
const auth = getAuthContext();
|
|
75
|
+
if (auth.token) options = {
|
|
76
|
+
...options,
|
|
77
|
+
token: auth.token
|
|
78
|
+
};
|
|
79
|
+
if (!options.organizationId && auth.organizationId) options = {
|
|
80
|
+
...options,
|
|
81
|
+
organizationId: auth.organizationId
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
return handleApiRequest(method, endpoint, options);
|
|
85
|
+
}
|
|
86
|
+
const createQueryString$1 = createQueryString;
|
|
87
|
+
|
|
88
|
+
//#endregion
|
|
89
|
+
export { ApiError, ArcApiError, configureSDK, createClient, createQueryString$1 as createQueryString, getAuthContext, getBaseUrl, getSDKConfig, handleApiRequest$1 as handleApiRequest, isArcApiError, setSDKConfigProvider };
|