qarpeo 0.2.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (260) hide show
  1. package/dist/chunks/tools.mjs +993 -31
  2. package/dist/cli/index.mjs +1102 -31
  3. package/dist/fate/index.d.ts +9 -1
  4. package/dist/fate/index.mjs +20 -3
  5. package/dist/module.mjs +296 -753
  6. package/dist/runtime/browser.mjs +2 -2
  7. package/dist/runtime/comments-server.d.ts +3 -0
  8. package/dist/runtime/comments-server.mjs +2 -0
  9. package/dist/runtime/comments.d.ts +0 -2
  10. package/dist/runtime/comments.mjs +0 -2
  11. package/dist/runtime/db.d.ts +10 -9
  12. package/dist/runtime/db.mjs +79 -8
  13. package/dist/runtime/drizzle.mjs +21 -6
  14. package/dist/runtime/index.d.ts +4 -0
  15. package/dist/runtime/realtime-server.d.ts +4 -0
  16. package/dist/runtime/realtime-server.mjs +13 -0
  17. package/dist/runtime/realtime.d.ts +1 -4
  18. package/dist/runtime/realtime.mjs +0 -13
  19. package/dist/runtime/replica.d.ts +27 -0
  20. package/dist/runtime/replica.mjs +229 -0
  21. package/dist/runtime/server/durable-objects/agent.mjs +14 -2
  22. package/dist/runtime/server/durable-objects/room.d.ts +10 -0
  23. package/dist/runtime/server/durable-objects/room.mjs +119 -28
  24. package/dist/runtime/server/middleware/devtools.mjs +1 -1
  25. package/dist/runtime/server/middleware/tenancy.mjs +7 -4
  26. package/dist/runtime/server/plugins/store.mjs +1 -1
  27. package/dist/runtime/server/routes/__qarpeo/mail/track/click/[id].get.mjs +57 -17
  28. package/dist/runtime/server/routes/agents/[agent]/chat.post.mjs +19 -12
  29. package/dist/runtime/server/routes/agents/[agent]/clear.post.mjs +8 -9
  30. package/dist/runtime/server/routes/agents/[agent]/history.get.mjs +8 -9
  31. package/dist/runtime/server/routes/analytics/events.get.mjs +12 -2
  32. package/dist/runtime/server/routes/analytics/pageviews.get.mjs +10 -1
  33. package/dist/runtime/server/routes/analytics/summary.get.mjs +10 -1
  34. package/dist/runtime/server/routes/auth/2fa/disable.post.mjs +11 -2
  35. package/dist/runtime/server/routes/auth/2fa/setup.post.mjs +7 -0
  36. package/dist/runtime/server/routes/auth/2fa/verify.post.mjs +11 -2
  37. package/dist/runtime/server/routes/auth/account.delete.mjs +7 -0
  38. package/dist/runtime/server/routes/auth/magic-link/verify.get.mjs +5 -3
  39. package/dist/runtime/server/routes/auth/organization/sso/index.post.mjs +10 -0
  40. package/dist/runtime/server/routes/auth/otp/verify.post.mjs +5 -3
  41. package/dist/runtime/server/routes/auth/sso/saml/acs.post.mjs +18 -0
  42. package/dist/runtime/server/routes/auth/webauthn/login/options.post.d.ts +1 -1
  43. package/dist/runtime/server/routes/auth/webauthn/login/options.post.mjs +11 -2
  44. package/dist/runtime/server/routes/auth/webauthn/login/verify.post.mjs +10 -1
  45. package/dist/runtime/server/routes/auth/webauthn/register/options.post.d.ts +1 -1
  46. package/dist/runtime/server/routes/auth/webauthn/register/options.post.mjs +10 -1
  47. package/dist/runtime/server/routes/auth/webauthn/register/verify.post.mjs +10 -1
  48. package/dist/runtime/server/routes/browser/crawl.post.mjs +13 -0
  49. package/dist/runtime/server/routes/browser/invoice.post.mjs +15 -1
  50. package/dist/runtime/server/routes/browser/og-image.post.mjs +13 -0
  51. package/dist/runtime/server/routes/browser/pdf.post.mjs +15 -1
  52. package/dist/runtime/server/routes/browser/screenshot.post.mjs +13 -0
  53. package/dist/runtime/server/routes/cms/[collection]/[id]/preview-token.post.mjs +23 -8
  54. package/dist/runtime/server/routes/cms/[collection]/[id]/publish.post.mjs +2 -1
  55. package/dist/runtime/server/routes/cms/[collection]/[id]/review.post.mjs +2 -1
  56. package/dist/runtime/server/routes/cms/[collection]/[id]/revisions/[revId]/restore.post.mjs +2 -1
  57. package/dist/runtime/server/routes/cms/[collection]/[id].delete.mjs +2 -1
  58. package/dist/runtime/server/routes/cms/[collection]/[id].put.mjs +2 -1
  59. package/dist/runtime/server/routes/cms/[collection]/index.post.mjs +2 -1
  60. package/dist/runtime/server/routes/cms/categories/[id].delete.mjs +2 -1
  61. package/dist/runtime/server/routes/cms/categories/[id].put.mjs +2 -1
  62. package/dist/runtime/server/routes/cms/categories.post.mjs +2 -1
  63. package/dist/runtime/server/routes/cms/collections/[id].delete.mjs +2 -1
  64. package/dist/runtime/server/routes/cms/collections/[id].put.mjs +2 -1
  65. package/dist/runtime/server/routes/cms/collections/index.post.mjs +2 -1
  66. package/dist/runtime/server/routes/cms/export.post.mjs +1 -1
  67. package/dist/runtime/server/routes/cms/subscribers/[id].delete.mjs +2 -1
  68. package/dist/runtime/server/routes/cms/subscribers/[id].patch.mjs +2 -1
  69. package/dist/runtime/server/routes/cms/tags/[id].delete.mjs +2 -1
  70. package/dist/runtime/server/routes/cms/tags.post.mjs +2 -1
  71. package/dist/runtime/server/routes/comments/[id]/react.post.mjs +7 -3
  72. package/dist/runtime/server/routes/comments/[id]/report.post.mjs +3 -0
  73. package/dist/runtime/server/routes/comments/[id].delete.mjs +1 -1
  74. package/dist/runtime/server/routes/comments/[id].get.mjs +13 -0
  75. package/dist/runtime/server/routes/comments/[id].patch.mjs +1 -1
  76. package/dist/runtime/server/routes/fate.d.ts +6 -0
  77. package/dist/runtime/server/routes/fate.mjs +32 -3
  78. package/dist/runtime/server/routes/mail/bounce.post.mjs +14 -2
  79. package/dist/runtime/server/routes/mail/unsubscribe.mjs +2 -1
  80. package/dist/runtime/server/routes/mail/webhooks.post.mjs +18 -4
  81. package/dist/runtime/server/routes/notifications/[id].get.mjs +3 -4
  82. package/dist/runtime/server/routes/notifications/index.get.mjs +4 -2
  83. package/dist/runtime/server/routes/notifications/push/subscribe.post.mjs +3 -1
  84. package/dist/runtime/server/routes/notifications/push/unsubscribe.post.mjs +5 -3
  85. package/dist/runtime/server/routes/notifications/read-all.post.mjs +6 -2
  86. package/dist/runtime/server/routes/notifications/send.post.mjs +13 -2
  87. package/dist/runtime/server/routes/payments/cancel.post.mjs +1 -1
  88. package/dist/runtime/server/routes/payments/change-plan.post.mjs +1 -1
  89. package/dist/runtime/server/routes/payments/checkout.post.mjs +1 -1
  90. package/dist/runtime/server/routes/payments/pause.post.mjs +1 -1
  91. package/dist/runtime/server/routes/payments/portal.post.mjs +1 -1
  92. package/dist/runtime/server/routes/payments/subscription.get.mjs +1 -1
  93. package/dist/runtime/server/routes/payments/usage.get.mjs +1 -1
  94. package/dist/runtime/server/routes/payments/usage.post.mjs +1 -1
  95. package/dist/runtime/server/routes/payments/webhook.post.mjs +8 -1
  96. package/dist/runtime/server/routes/realtime/broadcast.post.mjs +3 -2
  97. package/dist/runtime/server/routes/realtime/history.delete.mjs +2 -2
  98. package/dist/runtime/server/routes/realtime/history.get.mjs +2 -2
  99. package/dist/runtime/server/routes/realtime/presence.get.mjs +3 -3
  100. package/dist/runtime/server/routes/realtime/state.get.mjs +3 -3
  101. package/dist/runtime/server/routes/realtime/state.post.mjs +13 -4
  102. package/dist/runtime/server/routes/realtime/ws.get.mjs +2 -2
  103. package/dist/runtime/server/routes/storage/file/[...key].delete.mjs +1 -1
  104. package/dist/runtime/server/routes/storage/file/[...key].get.mjs +7 -0
  105. package/dist/runtime/server/routes/storage/files.get.d.ts +1 -1
  106. package/dist/runtime/server/routes/storage/files.get.mjs +24 -4
  107. package/dist/runtime/server/routes/storage/multipart/abort.post.mjs +16 -1
  108. package/dist/runtime/server/routes/storage/multipart/complete.post.d.ts +1 -1
  109. package/dist/runtime/server/routes/storage/multipart/complete.post.mjs +15 -1
  110. package/dist/runtime/server/routes/storage/multipart/create.post.mjs +7 -0
  111. package/dist/runtime/server/routes/storage/multipart/part.put.mjs +15 -1
  112. package/dist/runtime/server/routes/storage/presigned-r2.post.mjs +8 -1
  113. package/dist/runtime/server/routes/storage/presigned.post.d.ts +1 -1
  114. package/dist/runtime/server/routes/storage/presigned.post.mjs +8 -1
  115. package/dist/runtime/server/routes/storage/sign.post.mjs +7 -0
  116. package/dist/runtime/server/routes/storage/upload.post.d.ts +2 -2
  117. package/dist/runtime/server/routes/store/cart/index.delete.mjs +3 -4
  118. package/dist/runtime/server/routes/store/cart/index.get.mjs +3 -10
  119. package/dist/runtime/server/routes/store/cart/items/[id].delete.mjs +6 -4
  120. package/dist/runtime/server/routes/store/cart/items/[id].patch.mjs +12 -4
  121. package/dist/runtime/server/routes/store/cart/items.post.mjs +9 -10
  122. package/dist/runtime/server/routes/store/categories/index.get.mjs +4 -2
  123. package/dist/runtime/server/routes/store/checkout.post.mjs +13 -3
  124. package/dist/runtime/server/routes/store/coupons/apply.post.mjs +6 -5
  125. package/dist/runtime/server/routes/store/orders/[id].get.mjs +2 -2
  126. package/dist/runtime/server/routes/store/orders/download/[token].get.mjs +6 -3
  127. package/dist/runtime/server/routes/store/orders/index.get.mjs +1 -1
  128. package/dist/runtime/server/routes/store/products/[slug].get.mjs +2 -2
  129. package/dist/runtime/server/routes/store/products/index.get.mjs +1 -1
  130. package/dist/runtime/server/routes/store/tax/calculate.post.mjs +10 -0
  131. package/dist/runtime/server/routes/tenants/[tenant]/domains/[domain]/index.delete.mjs +26 -25
  132. package/dist/runtime/server/routes/tenants/[tenant]/domains/[domain]/verify.post.mjs +26 -25
  133. package/dist/runtime/server/utils/ai.d.ts +6 -0
  134. package/dist/runtime/server/utils/ai.mjs +12 -2
  135. package/dist/runtime/server/utils/analytics-query.mjs +8 -4
  136. package/dist/runtime/server/utils/browser-utils.d.ts +9 -0
  137. package/dist/runtime/server/utils/browser-utils.mjs +135 -0
  138. package/dist/runtime/server/utils/cms/cache.d.ts +13 -0
  139. package/dist/runtime/server/utils/cms/cache.mjs +95 -0
  140. package/dist/runtime/server/utils/cms/common.mjs +1 -1
  141. package/dist/runtime/server/utils/cms/markdown.mjs +38 -8
  142. package/dist/runtime/server/utils/cms/mutations.d.ts +26 -0
  143. package/dist/runtime/server/utils/cms/mutations.mjs +569 -0
  144. package/dist/runtime/server/utils/cms/path.d.ts +8 -0
  145. package/dist/runtime/server/utils/cms/path.mjs +23 -0
  146. package/dist/runtime/server/utils/cms/queries.d.ts +27 -0
  147. package/dist/runtime/server/utils/cms/queries.mjs +366 -0
  148. package/dist/runtime/server/utils/cms/references.d.ts +48 -0
  149. package/dist/runtime/server/utils/cms/references.mjs +309 -0
  150. package/dist/runtime/server/utils/cms/revisions.d.ts +7 -0
  151. package/dist/runtime/server/utils/cms/revisions.mjs +60 -0
  152. package/dist/runtime/server/utils/cms/sync.mjs +3 -3
  153. package/dist/runtime/server/utils/cms.d.ts +5 -82
  154. package/dist/runtime/server/utils/cms.mjs +28 -1367
  155. package/dist/runtime/server/utils/comments.d.ts +11 -0
  156. package/dist/runtime/server/utils/comments.mjs +65 -17
  157. package/dist/runtime/server/utils/crypto.mjs +1 -1
  158. package/dist/runtime/server/utils/domains.mjs +9 -0
  159. package/dist/runtime/server/utils/drizzle.d.ts +26 -1
  160. package/dist/runtime/server/utils/drizzle.mjs +78 -19
  161. package/dist/runtime/server/utils/email-inbound.mjs +9 -1
  162. package/dist/runtime/server/utils/impersonation.mjs +58 -1
  163. package/dist/runtime/server/utils/lock.d.ts +11 -0
  164. package/dist/runtime/server/utils/lock.mjs +4 -0
  165. package/dist/runtime/server/utils/mail-suppression.mjs +48 -13
  166. package/dist/runtime/server/utils/mail.d.ts +2 -1
  167. package/dist/runtime/server/utils/mail.mjs +17 -11
  168. package/dist/runtime/server/utils/notifications.d.ts +13 -4
  169. package/dist/runtime/server/utils/notifications.mjs +20 -4
  170. package/dist/runtime/server/utils/organization.mjs +36 -1
  171. package/dist/runtime/server/utils/passwordless.mjs +8 -0
  172. package/dist/runtime/server/utils/payments/checkout.d.ts +34 -0
  173. package/dist/runtime/server/utils/payments/checkout.mjs +158 -0
  174. package/dist/runtime/server/utils/payments/common.d.ts +45 -0
  175. package/dist/runtime/server/utils/payments/common.mjs +234 -0
  176. package/dist/runtime/server/utils/payments/index.d.ts +9 -0
  177. package/dist/runtime/server/utils/payments/index.mjs +21 -0
  178. package/dist/runtime/server/utils/payments/lemonsqueezy.d.ts +7 -0
  179. package/dist/runtime/server/utils/payments/lemonsqueezy.mjs +55 -0
  180. package/dist/runtime/server/utils/payments/paddle.d.ts +7 -0
  181. package/dist/runtime/server/utils/payments/paddle.mjs +92 -0
  182. package/dist/runtime/server/utils/payments/polar.d.ts +11 -0
  183. package/dist/runtime/server/utils/payments/polar.mjs +66 -0
  184. package/dist/runtime/server/utils/payments/stripe.d.ts +7 -0
  185. package/dist/runtime/server/utils/payments/stripe.mjs +159 -0
  186. package/dist/runtime/server/utils/payments/subscriptions.d.ts +89 -0
  187. package/dist/runtime/server/utils/payments/subscriptions.mjs +236 -0
  188. package/dist/runtime/server/utils/payments/usage.d.ts +12 -0
  189. package/dist/runtime/server/utils/payments/usage.mjs +143 -0
  190. package/dist/runtime/server/utils/payments/webhooks.d.ts +10 -0
  191. package/dist/runtime/server/utils/payments/webhooks.mjs +200 -0
  192. package/dist/runtime/server/utils/payments.d.ts +1 -158
  193. package/dist/runtime/server/utils/payments.mjs +1 -1289
  194. package/dist/runtime/server/utils/queue.d.ts +2 -0
  195. package/dist/runtime/server/utils/queue.mjs +34 -21
  196. package/dist/runtime/server/utils/rag.mjs +30 -17
  197. package/dist/runtime/server/utils/realtime.d.ts +5 -1
  198. package/dist/runtime/server/utils/realtime.mjs +43 -7
  199. package/dist/runtime/server/utils/session.mjs +16 -3
  200. package/dist/runtime/server/utils/sso.d.ts +3 -0
  201. package/dist/runtime/server/utils/sso.mjs +43 -0
  202. package/dist/runtime/server/utils/storage.mjs +12 -1
  203. package/dist/runtime/server/utils/store/cart.d.ts +63 -0
  204. package/dist/runtime/server/utils/store/cart.mjs +542 -0
  205. package/dist/runtime/server/utils/store/checkout.d.ts +14 -0
  206. package/dist/runtime/server/utils/store/checkout.mjs +118 -0
  207. package/dist/runtime/server/utils/store/common.d.ts +29 -0
  208. package/dist/runtime/server/utils/store/common.mjs +479 -0
  209. package/dist/runtime/server/utils/store/index.d.ts +7 -0
  210. package/dist/runtime/server/utils/store/index.mjs +30 -0
  211. package/dist/runtime/server/utils/store/inventory.d.ts +25 -0
  212. package/dist/runtime/server/utils/store/inventory.mjs +190 -0
  213. package/dist/runtime/server/utils/store/orders.d.ts +60 -0
  214. package/dist/runtime/server/utils/store/orders.mjs +590 -0
  215. package/dist/runtime/server/utils/store/products.d.ts +35 -0
  216. package/dist/runtime/server/utils/store/products.mjs +461 -0
  217. package/dist/runtime/server/utils/store/vendor.d.ts +18 -0
  218. package/dist/runtime/server/utils/store/vendor.mjs +68 -0
  219. package/dist/runtime/server/utils/store.d.ts +1 -207
  220. package/dist/runtime/server/utils/store.mjs +1 -2227
  221. package/dist/runtime/server/utils/string.d.ts +1 -1
  222. package/dist/runtime/server/utils/string.mjs +12 -4
  223. package/dist/runtime/server/utils/tenant.mjs +19 -5
  224. package/dist/runtime/server/utils/tracker.mjs +2 -0
  225. package/dist/runtime/server.d.ts +3 -3
  226. package/dist/runtime/server.mjs +4 -4
  227. package/dist/runtime/storage-server.d.ts +2 -0
  228. package/dist/runtime/storage-server.mjs +1 -0
  229. package/dist/runtime/storage.d.ts +1 -1
  230. package/dist/runtime/storage.mjs +0 -1
  231. package/dist/runtime/store.d.ts +0 -1
  232. package/dist/runtime/store.mjs +0 -1
  233. package/dist/runtime/test-utils.d.ts +4 -0
  234. package/dist/runtime/test-utils.mjs +54 -0
  235. package/dist/runtime/types/d1.d.ts +43 -0
  236. package/dist/runtime/types/drizzle.d.ts +6 -0
  237. package/dist/runtime/types/store.d.ts +1 -1
  238. package/dist/types/analytics.d.ts +80 -0
  239. package/dist/types/auth.d.ts +282 -0
  240. package/dist/types/cache.d.ts +55 -0
  241. package/dist/types/comments.d.ts +130 -0
  242. package/dist/types/db.d.ts +29 -0
  243. package/dist/types/email.d.ts +182 -0
  244. package/dist/types/index.d.ts +22 -0
  245. package/dist/types/jobs.d.ts +58 -0
  246. package/dist/types/notifications.d.ts +77 -0
  247. package/dist/types/options.d.ts +363 -0
  248. package/dist/types/payments.d.ts +145 -0
  249. package/dist/types/ratelimit.d.ts +71 -0
  250. package/dist/types/realtime.d.ts +136 -0
  251. package/dist/types/site.d.ts +121 -0
  252. package/dist/types/storage.d.ts +164 -0
  253. package/dist/types/store-options.d.ts +199 -0
  254. package/dist/types/tenant.d.ts +100 -0
  255. package/dist/types.d.ts +1 -2174
  256. package/dist/utils/migration-lock.d.ts +139 -0
  257. package/dist/utils/pkg.d.ts +14 -1
  258. package/dist/utils/schema-diff.d.ts +39 -0
  259. package/package.json +55 -17
  260. package/dist/chunks/auth-schema.mjs +0 -364
@@ -1,207 +1 @@
1
- import type { RequestEvent } from "nuxt/server";
2
- import type { StoreOptions } from "../../../types";
3
- import type { StoreProduct, StoreProductVariant, StoreInventory, StoreCategory, StoreCart, StoreCartItem, StoreCartTotals, StoreCustomerAddress, StoreOrder, StoreOrderItem, StoreOrderStatus, StoreDiscount, StoreDiscountType, StoreAddressType, StoreQueryProductsOptions, StoreQueryOrdersOptions, StoreQueryDiscountsOptions, StoreLowStockItem, StoreMetrics, StoreVendorMetrics } from "../../types/store";
4
- export declare function storeProductTbl(event?: RequestEvent): string;
5
- export declare function storeVariantTbl(event?: RequestEvent): string;
6
- export declare function storeInventoryTbl(event?: RequestEvent): string;
7
- export declare function storeCategoryTbl(event?: RequestEvent): string;
8
- export declare function storeCartTbl(event?: RequestEvent): string;
9
- export declare function storeCartItemTbl(event?: RequestEvent): string;
10
- export declare function storeOrderTbl(event?: RequestEvent): string;
11
- export declare function storeOrderItemTbl(event?: RequestEvent): string;
12
- export declare function storeDiscountTbl(event?: RequestEvent): string;
13
- export declare function storeAddressTbl(event?: RequestEvent): string;
14
- export declare function getStoreConfig(event?: RequestEvent): StoreOptions;
15
- export declare function rowToProduct(row: Record<string, any>): StoreProduct;
16
- export declare function rowToVariant(row: Record<string, any>): StoreProductVariant;
17
- export declare function rowToInventory(row: Record<string, any>): StoreInventory;
18
- export declare function rowToCategory(row: Record<string, any>): StoreCategory;
19
- export declare function rowToCartItem(row: Record<string, any>): StoreCartItem;
20
- export declare function rowToCart(row: Record<string, any>, items?: StoreCartItem[]): StoreCart;
21
- export declare function rowToOrderItem(row: Record<string, any>): StoreOrderItem;
22
- export declare function rowToOrder(row: Record<string, any>, items?: StoreOrderItem[]): StoreOrder;
23
- export declare function rowToDiscount(row: Record<string, any>): StoreDiscount;
24
- export declare function rowToAddress(row: Record<string, any>): StoreCustomerAddress;
25
- export declare function ensureStoreTables(event?: RequestEvent): Promise<void>;
26
- export declare function queryStoreProducts(opts?: StoreQueryProductsOptions, event?: RequestEvent): Promise<{
27
- products: StoreProduct[];
28
- total: number;
29
- }>;
30
- export declare function getStoreProduct(idOrSlug: string, event?: RequestEvent, opts?: {
31
- tenantId?: string;
32
- }): Promise<StoreProduct | null>;
33
- export declare function createStoreProduct(data: Partial<StoreProduct> & {
34
- title: string;
35
- basePrice: number;
36
- slug?: string;
37
- }, event?: RequestEvent): Promise<StoreProduct>;
38
- export declare function updateStoreProduct(id: string, data: Partial<StoreProduct>, event?: RequestEvent): Promise<StoreProduct | null>;
39
- export declare function deleteStoreProduct(id: string, event?: RequestEvent): Promise<boolean>;
40
- export declare function createStoreVariant(productId: string, data: Partial<StoreProductVariant> & {
41
- sku: string;
42
- title: string;
43
- }, event?: RequestEvent): Promise<StoreProductVariant>;
44
- export declare function updateStoreVariant(id: string, data: Partial<StoreProductVariant>, event?: RequestEvent): Promise<StoreProductVariant | null>;
45
- export declare function deleteStoreVariant(id: string, event?: RequestEvent): Promise<boolean>;
46
- export declare function queryStoreCategories(opts?: {
47
- parentId?: string | null;
48
- tenantId?: string;
49
- }, event?: RequestEvent): Promise<StoreCategory[]>;
50
- export declare function getStoreCategory(idOrSlug: string, event?: RequestEvent, opts?: {
51
- tenantId?: string;
52
- }): Promise<StoreCategory | null>;
53
- export declare function createStoreCategory(data: Partial<StoreCategory> & {
54
- name: string;
55
- slug?: string;
56
- }, event?: RequestEvent): Promise<StoreCategory>;
57
- export declare function updateStoreCategory(id: string, data: Partial<StoreCategory>, event?: RequestEvent): Promise<StoreCategory | null>;
58
- export declare function deleteStoreCategory(id: string, event?: RequestEvent): Promise<boolean>;
59
- export declare function getStoreInventory(variantId: string, event?: RequestEvent): Promise<StoreInventory | null>;
60
- export declare function adjustStoreStock(variantId: string, delta: number, event?: RequestEvent): Promise<StoreInventory>;
61
- export declare function setStoreStock(variantId: string, quantity: number, reservedQuantity?: number, event?: RequestEvent): Promise<StoreInventory>;
62
- export declare function updateStoreInventory(variantId: string, updates: {
63
- stockQuantity?: number;
64
- reservedQuantity?: number;
65
- allowBackorder?: boolean;
66
- lowStockThreshold?: number;
67
- }, event?: RequestEvent): Promise<StoreInventory>;
68
- export declare function getStoreProductInventory(productId: string, event?: RequestEvent): Promise<StoreInventory[]>;
69
- export declare function queryLowStockInventory(opts?: {
70
- threshold?: number;
71
- tenantId?: string;
72
- limit?: number;
73
- offset?: number;
74
- }, event?: RequestEvent): Promise<{
75
- items: StoreLowStockItem[];
76
- total: number;
77
- }>;
78
- export declare function reserveStoreStock(cartId: string, event?: RequestEvent): Promise<boolean>;
79
- export declare function releaseStoreStock(cartId: string, event?: RequestEvent): Promise<boolean>;
80
- export declare function commitStoreStock(orderId: string, event?: RequestEvent): Promise<boolean>;
81
- export declare function releaseStoreOrderStock(orderId: string, event?: RequestEvent): Promise<boolean>;
82
- export declare function getOrCreateStoreCart(sessionToken?: string, event?: RequestEvent): Promise<StoreCart>;
83
- export declare function getStoreCart(cartIdOrToken: string, event?: RequestEvent): Promise<StoreCart | null>;
84
- export declare function addToStoreCart(cartId: string, item: {
85
- productId: string;
86
- variantId: string;
87
- quantity: number;
88
- customAttributes?: Record<string, any>;
89
- }, event?: RequestEvent): Promise<StoreCartItem>;
90
- export declare function updateStoreCartItem(itemId: string, quantity: number, event?: RequestEvent): Promise<StoreCartItem | null>;
91
- export declare function removeStoreCartItem(itemId: string, event?: RequestEvent): Promise<boolean>;
92
- export declare function clearStoreCart(cartId: string, event?: RequestEvent): Promise<boolean>;
93
- export declare function calculateStoreCartTotals(cartId: string, event?: RequestEvent): Promise<StoreCartTotals>;
94
- export declare function mergeGuestCartOnLogin(guestSessionToken: string, userId: string, event?: RequestEvent): Promise<StoreCart>;
95
- export declare function validateStoreDiscount(code: string, subtotal: number, event?: RequestEvent, opts?: {
96
- tenantId?: string;
97
- }): Promise<{
98
- valid: boolean;
99
- discount?: StoreDiscount;
100
- discountAmount: number;
101
- message?: string;
102
- }>;
103
- export declare function applyStoreDiscount(cartId: string, code: string, event?: RequestEvent): Promise<{
104
- success: boolean;
105
- totals: StoreCartTotals;
106
- message?: string;
107
- }>;
108
- export declare function createStoreDiscount(data: Partial<StoreDiscount> & {
109
- code: string;
110
- type: StoreDiscountType;
111
- value: number;
112
- }, event?: RequestEvent): Promise<StoreDiscount>;
113
- export declare function getStoreDiscount(idOrCode: string, event?: RequestEvent): Promise<StoreDiscount | null>;
114
- export declare function updateStoreDiscount(id: string, updates: Partial<StoreDiscount>, event?: RequestEvent): Promise<StoreDiscount | null>;
115
- export declare function deleteStoreDiscount(id: string, event?: RequestEvent): Promise<boolean>;
116
- export declare function queryStoreDiscounts(opts?: StoreQueryDiscountsOptions, event?: RequestEvent): Promise<{
117
- discounts: StoreDiscount[];
118
- total: number;
119
- }>;
120
- export declare function removeStoreDiscount(cartId: string, event?: RequestEvent): Promise<{
121
- success: boolean;
122
- totals: StoreCartTotals;
123
- }>;
124
- export declare function createStoreOrder(input: {
125
- cartId: string;
126
- customerEmail: string;
127
- customerName?: string;
128
- shippingAddress?: StoreCustomerAddress;
129
- billingAddress?: StoreCustomerAddress;
130
- metadata?: Record<string, any>;
131
- }, event?: RequestEvent): Promise<StoreOrder>;
132
- export declare function getStoreOrder(idOrNumber: string, event?: RequestEvent, opts?: {
133
- tenantId?: string;
134
- }): Promise<StoreOrder | null>;
135
- export declare function queryStoreOrders(opts?: StoreQueryOrdersOptions, event?: RequestEvent): Promise<{
136
- orders: StoreOrder[];
137
- total: number;
138
- }>;
139
- export declare function updateStoreOrderStatus(id: string, status: StoreOrderStatus, optsOrEvent?: RequestEvent | {
140
- paymentProvider?: string;
141
- paymentIntentId?: string;
142
- event?: RequestEvent;
143
- }, maybeEvent?: RequestEvent): Promise<StoreOrder | null>;
144
- export declare function refundStoreOrder(orderId: string, opts?: {
145
- reason?: string;
146
- amount?: number;
147
- restock?: boolean;
148
- }, event?: RequestEvent): Promise<StoreOrder | null>;
149
- export declare function fulfillStoreOrder(orderId: string, opts?: {
150
- trackingNumber?: string;
151
- carrier?: string;
152
- trackingUrl?: string;
153
- notifyCustomer?: boolean;
154
- }, event?: RequestEvent): Promise<StoreOrder | null>;
155
- export declare function cancelStoreOrder(orderId: string, opts?: {
156
- reason?: string;
157
- restock?: boolean;
158
- }, event?: RequestEvent): Promise<StoreOrder | null>;
159
- export declare function deleteStoreOrder(orderId: string, event?: RequestEvent): Promise<boolean>;
160
- export declare function generateDownloadUrl(orderItemId: string, event?: RequestEvent): Promise<{
161
- downloadUrl: string;
162
- expiresAt: number;
163
- }>;
164
- export declare function getStoreAddresses(userId: string, event?: RequestEvent): Promise<StoreCustomerAddress[]>;
165
- export declare function saveStoreAddress(address: Partial<StoreCustomerAddress> & {
166
- userId: string;
167
- line1: string;
168
- city: string;
169
- postalCode: string;
170
- country: string;
171
- }, event?: RequestEvent): Promise<StoreCustomerAddress>;
172
- export declare function deleteStoreAddress(id: string, userId: string, event?: RequestEvent): Promise<boolean>;
173
- export declare function setDefaultStoreAddress(id: string, userId: string, type: StoreAddressType, event?: RequestEvent): Promise<boolean>;
174
- export declare function getStoreDefaultAddress(userId: string, type: StoreAddressType, event?: RequestEvent): Promise<StoreCustomerAddress | null>;
175
- export declare function getStoreMetrics(opts?: {
176
- tenantId?: string;
177
- startDate?: number;
178
- endDate?: number;
179
- }, event?: RequestEvent): Promise<StoreMetrics>;
180
- export declare function createStoreCheckoutSession(cartId: string, opts?: {
181
- customerEmail?: string;
182
- customerName?: string;
183
- shippingAddress?: StoreCustomerAddress;
184
- billingAddress?: StoreCustomerAddress;
185
- successUrl?: string;
186
- cancelUrl?: string;
187
- }, event?: RequestEvent): Promise<{
188
- sessionId: string;
189
- checkoutUrl?: string;
190
- order: StoreOrder;
191
- }>;
192
- export declare function isMultiVendorStore(event?: RequestEvent): boolean;
193
- export declare function getStoreVendorMetrics(vendorId: string, opts?: {
194
- tenantId?: string;
195
- }, event?: RequestEvent): Promise<StoreVendorMetrics>;
196
- export declare function queryVendorProducts(vendorId: string, opts?: Omit<StoreQueryProductsOptions, "vendorId">, event?: RequestEvent): Promise<{
197
- products: StoreProduct[];
198
- total: number;
199
- }>;
200
- export declare function queryVendorOrderItems(vendorId: string, opts?: {
201
- tenantId?: string;
202
- limit?: number;
203
- offset?: number;
204
- }, event?: RequestEvent): Promise<{
205
- items: StoreOrderItem[];
206
- total: number;
207
- }>;
1
+ export * from "./store/index";