@stacksjs/commerce 0.70.36 → 0.70.42

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 (128) hide show
  1. package/dist/src/coupons/destroy.d.ts +17 -0
  2. package/dist/src/coupons/fetch.d.ts +59 -0
  3. package/dist/src/coupons/index.d.ts +25 -0
  4. package/dist/src/coupons/store.d.ts +9 -0
  5. package/dist/src/coupons/update.d.ts +10 -0
  6. package/dist/src/customers/destroy.d.ts +14 -0
  7. package/dist/src/customers/fetch.d.ts +9 -0
  8. package/dist/src/customers/index.d.ts +14 -0
  9. package/dist/src/customers/store.d.ts +9 -0
  10. package/dist/src/customers/update.d.ts +10 -0
  11. package/dist/src/devices/destroy.d.ts +14 -0
  12. package/dist/src/devices/export.d.ts +35 -0
  13. package/dist/src/devices/fetch.d.ts +38 -0
  14. package/dist/src/devices/index.d.ts +27 -0
  15. package/dist/src/devices/store.d.ts +16 -0
  16. package/dist/src/devices/update.d.ts +26 -0
  17. package/dist/src/errors/destroy.d.ts +12 -0
  18. package/dist/src/errors/fetch.d.ts +54 -0
  19. package/dist/src/errors/index.d.ts +25 -0
  20. package/dist/src/errors/update.d.ts +24 -0
  21. package/dist/src/gift-cards/destroy.d.ts +23 -0
  22. package/dist/src/gift-cards/fetch.d.ts +88 -0
  23. package/dist/src/gift-cards/index.d.ts +23 -0
  24. package/dist/src/gift-cards/store.d.ts +9 -0
  25. package/dist/src/gift-cards/update.d.ts +18 -0
  26. package/dist/src/index.d.ts +13 -13
  27. package/dist/src/orders/destroy.d.ts +28 -0
  28. package/dist/src/orders/export.d.ts +32 -0
  29. package/dist/src/orders/fetch.d.ts +76 -0
  30. package/dist/src/orders/index.d.ts +27 -0
  31. package/dist/src/orders/store.d.ts +9 -0
  32. package/dist/src/orders/update.d.ts +27 -0
  33. package/dist/src/payments/destroy.d.ts +14 -0
  34. package/dist/src/payments/fetch.d.ts +55 -0
  35. package/dist/src/payments/index.d.ts +13 -0
  36. package/dist/src/payments/store.d.ts +9 -0
  37. package/dist/src/payments/update.d.ts +18 -0
  38. package/dist/src/products/categories/destroy.d.ts +30 -0
  39. package/dist/src/products/categories/fetch.d.ts +49 -0
  40. package/dist/src/products/categories/index.d.ts +33 -0
  41. package/dist/src/products/categories/store.d.ts +21 -0
  42. package/dist/src/products/categories/update.d.ts +33 -0
  43. package/dist/src/products/index.d.ts +24 -0
  44. package/dist/src/products/items/destroy.d.ts +14 -0
  45. package/dist/src/products/items/fetch.d.ts +66 -0
  46. package/dist/src/products/items/index.d.ts +23 -0
  47. package/dist/src/products/items/store.d.ts +16 -0
  48. package/dist/src/products/items/update.d.ts +45 -0
  49. package/dist/src/products/manufacturers/destroy.d.ts +14 -0
  50. package/dist/src/products/manufacturers/fetch.d.ts +23 -0
  51. package/dist/src/products/manufacturers/index.d.ts +21 -0
  52. package/dist/src/products/manufacturers/store.d.ts +16 -0
  53. package/dist/src/products/manufacturers/update.d.ts +26 -0
  54. package/dist/src/products/reviews/destroy.d.ts +14 -0
  55. package/dist/src/products/reviews/fetch.d.ts +22 -0
  56. package/dist/src/products/reviews/index.d.ts +22 -0
  57. package/dist/src/products/reviews/store.d.ts +9 -0
  58. package/dist/src/products/reviews/update.d.ts +19 -0
  59. package/dist/src/products/units/destroy.d.ts +14 -0
  60. package/dist/src/products/units/fetch.d.ts +9 -0
  61. package/dist/src/products/units/index.d.ts +9 -0
  62. package/dist/src/products/units/store.d.ts +31 -0
  63. package/dist/src/products/units/update.d.ts +25 -0
  64. package/dist/src/products/variants/destroy.d.ts +14 -0
  65. package/dist/src/products/variants/fetch.d.ts +9 -0
  66. package/dist/src/products/variants/index.d.ts +18 -0
  67. package/dist/src/products/variants/store.d.ts +43 -0
  68. package/dist/src/products/variants/update.d.ts +25 -0
  69. package/dist/src/receipts/destroy.d.ts +14 -0
  70. package/dist/src/receipts/fetch.d.ts +80 -0
  71. package/dist/src/receipts/index.d.ts +21 -0
  72. package/dist/src/receipts/store.d.ts +16 -0
  73. package/dist/src/receipts/update.d.ts +28 -0
  74. package/dist/src/shippings/delivery-routes/destroy.d.ts +14 -0
  75. package/dist/src/shippings/delivery-routes/fetch.d.ts +17 -0
  76. package/dist/src/shippings/delivery-routes/index.d.ts +23 -0
  77. package/dist/src/shippings/delivery-routes/store.d.ts +16 -0
  78. package/dist/src/shippings/delivery-routes/update.d.ts +27 -0
  79. package/dist/src/shippings/digital-deliveries/destroy.d.ts +28 -0
  80. package/dist/src/shippings/digital-deliveries/fetch.d.ts +9 -0
  81. package/dist/src/shippings/digital-deliveries/index.d.ts +23 -0
  82. package/dist/src/shippings/digital-deliveries/store.d.ts +16 -0
  83. package/dist/src/shippings/digital-deliveries/update.d.ts +29 -0
  84. package/dist/src/shippings/drivers/destroy.d.ts +16 -0
  85. package/dist/src/shippings/drivers/fetch.d.ts +9 -0
  86. package/dist/src/shippings/drivers/index.d.ts +21 -0
  87. package/dist/src/shippings/drivers/store.d.ts +16 -0
  88. package/dist/src/shippings/drivers/update.d.ts +26 -0
  89. package/dist/src/shippings/index.d.ts +27 -0
  90. package/dist/src/shippings/license-keys/destroy.d.ts +28 -0
  91. package/dist/src/shippings/license-keys/fetch.d.ts +9 -0
  92. package/dist/src/shippings/license-keys/index.d.ts +23 -0
  93. package/dist/src/shippings/license-keys/store.d.ts +17 -0
  94. package/dist/src/shippings/license-keys/update.d.ts +26 -0
  95. package/dist/src/shippings/shipping-methods/destroy.d.ts +28 -0
  96. package/dist/src/shippings/shipping-methods/fetch.d.ts +9 -0
  97. package/dist/src/shippings/shipping-methods/index.d.ts +25 -0
  98. package/dist/src/shippings/shipping-methods/store.d.ts +28 -0
  99. package/dist/src/shippings/shipping-methods/update.d.ts +27 -0
  100. package/dist/src/shippings/shipping-rates/destroy.d.ts +28 -0
  101. package/dist/src/shippings/shipping-rates/fetch.d.ts +37 -0
  102. package/dist/src/shippings/shipping-rates/index.d.ts +27 -0
  103. package/dist/src/shippings/shipping-rates/store.d.ts +17 -0
  104. package/dist/src/shippings/shipping-rates/update.d.ts +36 -0
  105. package/dist/src/shippings/shipping-zones/destroy.d.ts +28 -0
  106. package/dist/src/shippings/shipping-zones/fetch.d.ts +28 -0
  107. package/dist/src/shippings/shipping-zones/index.d.ts +23 -0
  108. package/dist/src/shippings/shipping-zones/store.d.ts +17 -0
  109. package/dist/src/shippings/shipping-zones/update.d.ts +35 -0
  110. package/dist/src/tax/destroy.d.ts +14 -0
  111. package/dist/src/tax/fetch.d.ts +9 -0
  112. package/dist/src/tax/index.d.ts +21 -0
  113. package/dist/src/tax/store.d.ts +16 -0
  114. package/dist/src/tax/update.d.ts +26 -0
  115. package/dist/src/types.d.ts +265 -0
  116. package/dist/src/utils/typed-stats.d.ts +23 -0
  117. package/dist/src/waitlists/index.d.ts +12 -0
  118. package/dist/src/waitlists/products/destroy.d.ts +15 -0
  119. package/dist/src/waitlists/products/fetch.d.ts +100 -0
  120. package/dist/src/waitlists/products/index.d.ts +30 -0
  121. package/dist/src/waitlists/products/store.d.ts +16 -0
  122. package/dist/src/waitlists/products/update.d.ts +26 -0
  123. package/dist/src/waitlists/restaurant/destroy.d.ts +15 -0
  124. package/dist/src/waitlists/restaurant/fetch.d.ts +149 -0
  125. package/dist/src/waitlists/restaurant/index.d.ts +40 -0
  126. package/dist/src/waitlists/restaurant/store.d.ts +16 -0
  127. package/dist/src/waitlists/restaurant/update.d.ts +43 -0
  128. package/package.json +1 -1
@@ -0,0 +1,30 @@
1
+ // Functions from destroy.ts
2
+ export {
3
+ bulkDestroy,
4
+ destroy,
5
+ } from './destroy';
6
+ export {
7
+ fetchAll,
8
+ fetchById,
9
+ fetchCancelledBetweenDates,
10
+ fetchConversionRates,
11
+ fetchCountBetweenDates,
12
+ fetchCountByAllQuantities,
13
+ fetchCountByDate,
14
+ fetchCountByDateGrouped,
15
+ fetchCountByQuantity,
16
+ fetchCountBySource,
17
+ fetchCountByStatus,
18
+ fetchNotifiedBetweenDates,
19
+ fetchPurchasedBetweenDates,
20
+ fetchWaiting,
21
+ } from './fetch';
22
+ export {
23
+ bulkStore,
24
+ store,
25
+ } from './store';
26
+ export {
27
+ update,
28
+ updatePartySize,
29
+ updateStatus,
30
+ } from './update';
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Create a new waitlist product entry
3
+ *
4
+ * @param data Waitlist product data to store
5
+ * @returns The newly created waitlist product record
6
+ */
7
+ export declare function store(data: NewWaitlistProduct): Promise<WaitlistProductJsonResponse>;
8
+ /**
9
+ * Create multiple waitlist product entries at once
10
+ *
11
+ * @param data Array of waitlist product data to store
12
+ * @returns Number of waitlist products created
13
+ */
14
+ export declare function bulkStore(data: NewWaitlistProduct[]): Promise<number>;
15
+ declare type WaitlistProductJsonResponse = ModelRow<typeof WaitlistProduct>;
16
+ declare type NewWaitlistProduct = NewModelData<typeof WaitlistProduct>;
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Update a waitlist product
3
+ *
4
+ * @param id The id of the waitlist product to update
5
+ * @param data The waitlist product data to update
6
+ * @returns The updated waitlist product record
7
+ */
8
+ export declare function update(id: number, data: WaitlistProductUpdate): Promise<WaitlistProductJsonResponse>;
9
+ /**
10
+ * Update a waitlist product's status
11
+ *
12
+ * @param id The ID of the waitlist product
13
+ * @param status The new status
14
+ * @returns The updated waitlist product with the new status
15
+ */
16
+ export declare function updateStatus(id: number, status: 'waiting' | 'purchased' | 'notified' | 'cancelled'): Promise<WaitlistProductJsonResponse>;
17
+ /**
18
+ * Update party size for a waitlist product
19
+ *
20
+ * @param id The ID of the waitlist product
21
+ * @param partySize The updated party size
22
+ * @returns The updated waitlist product
23
+ */
24
+ export declare function updatePartySize(id: number, partySize: number): Promise<WaitlistProductJsonResponse>;
25
+ declare type WaitlistProductJsonResponse = ModelRow<typeof WaitlistProduct>;
26
+ declare type WaitlistProductUpdate = UpdateModelData<typeof WaitlistProduct>;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Delete a restaurant waitlist entry by ID
3
+ *
4
+ * @param id The ID of the restaurant waitlist entry to delete
5
+ * @returns The deleted restaurant waitlist record
6
+ */
7
+ export declare function destroy(id: number): Promise<WaitlistRestaurantJsonResponse | undefined>;
8
+ /**
9
+ * Delete multiple restaurant waitlist entries by their IDs
10
+ *
11
+ * @param ids Array of restaurant waitlist entry IDs to delete
12
+ * @returns Number of restaurant waitlist entries deleted
13
+ */
14
+ export declare function bulkDestroy(ids: number[]): Promise<number>;
15
+ declare type WaitlistRestaurantJsonResponse = ModelRow<typeof WaitlistRestaurant>;
@@ -0,0 +1,149 @@
1
+ /**
2
+ * Fetch a restaurant waitlist entry by ID
3
+ */
4
+ export declare function fetchById(id: number): Promise<WaitlistRestaurantJsonResponse | undefined>;
5
+ /**
6
+ * Fetch all restaurant waitlist entries
7
+ */
8
+ export declare function fetchAll(): Promise<WaitlistRestaurantJsonResponse[]>;
9
+ /**
10
+ * Fetch the count of restaurant waitlist entries grouped by table preference
11
+ * @returns An object containing the count for each table preference
12
+ */
13
+ export declare function fetchCountByTablePreference(): Promise<Record<string, number>>;
14
+ /**
15
+ * Fetch the count of restaurant waitlist entries for a specific date
16
+ * @param date The date to count entries for (defaults to today)
17
+ * @returns The count of entries for the specified date
18
+ */
19
+ export declare function fetchCountByDate(date?: Date): Promise<number>;
20
+ /**
21
+ * Fetch the count of restaurant waitlist entries with a specific party size
22
+ * @param partySize The party size to count entries for
23
+ * @returns The count of entries with the specified party size
24
+ */
25
+ export declare function fetchCountByPartySize(partySize: number): Promise<number>;
26
+ /**
27
+ * Fetch the count of restaurant waitlist entries grouped by party size
28
+ * @returns An object containing the count for each party size
29
+ */
30
+ export declare function fetchCountByAllPartySizes(): Promise<Record<number, number>>;
31
+ /**
32
+ * Fetch restaurant waitlist entries between two dates
33
+ * @param startDate The start date of the range
34
+ * @param endDate The end date of the range
35
+ * @returns Array of waitlist entries within the date range
36
+ */
37
+ export declare function fetchBetweenDates(startDate: Date, _endDate: Date): Promise<WaitlistRestaurantJsonResponse[]>;
38
+ /**
39
+ * Fetch restaurant waitlist entries that were seated between two dates
40
+ * @param startDate The start date of the range
41
+ * @param endDate The end date of the range
42
+ * @returns Array of waitlist entries that were seated within the date range
43
+ */
44
+ export declare function fetchSeatedBetweenDates(startDate: Date, _endDate: Date): Promise<WaitlistRestaurantJsonResponse[]>;
45
+ /**
46
+ * Fetch all restaurant waitlist entries with waiting status
47
+ * @returns Array of waitlist entries with waiting status
48
+ */
49
+ export declare function fetchWaiting(): Promise<WaitlistRestaurantJsonResponse[]>;
50
+ /**
51
+ * Fetch conversion rates for restaurant waitlist entries
52
+ * @returns Object containing total conversion rate and breakdown by status
53
+ */
54
+ export declare function fetchConversionRates(): Promise<{
55
+ totalConversionRate: number
56
+ statusBreakdown: Record<string, { count: number, percentage: number }>
57
+ }>;
58
+ /**
59
+ * Fetch average wait times for restaurant waitlist entries
60
+ * @returns Object containing average quoted and actual wait times
61
+ */
62
+ export declare function fetchAverageWaitTimes(): Promise<{
63
+ averageQuotedWaitTime: number
64
+ averageActualWaitTime: number
65
+ }>;
66
+ /**
67
+ * Fetch all waiting entries with their quoted wait times
68
+ * @returns Array of waiting entries with their quoted wait times
69
+ */
70
+ export declare function fetchWaitingWithQuotedTimes(): Promise<{
71
+ entries: WaitlistRestaurantJsonResponse[]
72
+ totalQuotedWaitTime: number
73
+ averageQuotedWaitTime: number
74
+ }>;
75
+ /**
76
+ * Fetch all waiting entries with party size calculations
77
+ * @returns Object containing waiting entries and party size statistics
78
+ */
79
+ export declare function fetchWaitingWithPartySizes(): Promise<{
80
+ entries: WaitlistRestaurantJsonResponse[]
81
+ totalPartySize: number
82
+ averagePartySize: number
83
+ partySizeBreakdown: Record<number, number>
84
+ }>;
85
+ /**
86
+ * Fetch tables turned statistics for today
87
+ * @returns Object containing tables turned statistics
88
+ */
89
+ export declare function fetchTablesTurnedToday(): Promise<{
90
+ totalTablesTurned: number
91
+ averagePartySize: number
92
+ totalCustomersSeated: number
93
+ breakdownByTablePreference: Record<string, number>
94
+ breakdownByPartySize: Record<number, number>
95
+ }>;
96
+ /**
97
+ * Fetch seating rate statistics
98
+ * @param startDate Start date for filtering entries
99
+ * @param endDate End date for filtering entries
100
+ * @returns Object containing seating rate and status breakdown
101
+ */
102
+ export declare function fetchSeatingRate(_startDate: Date, _endDate: Date): Promise<{
103
+ totalEntries: number
104
+ seatedEntries: number
105
+ seatingRate: number
106
+ statusBreakdown: Record<string, { count: number, percentage: number }>
107
+ }>;
108
+ /**
109
+ * Fetch no-show statistics
110
+ * @param startDate Start date for filtering entries
111
+ * @param endDate End date for filtering entries
112
+ * @returns Object containing no-show statistics and related information
113
+ */
114
+ export declare function fetchNoShowStats(_startDate: Date, _endDate: Date): Promise<{
115
+ totalNoShows: number
116
+ noShowRate: number
117
+ averageQuotedWaitTime: number
118
+ averagePartySize: number
119
+ breakdownByTablePreference: Record<string, number>
120
+ breakdownByPartySize: Record<number, number>
121
+ }>;
122
+ /**
123
+ * Fetch current wait time statistics
124
+ * @returns Object containing average quoted and actual wait times
125
+ */
126
+ export declare function fetchCurrentWaitTimes(): Promise<{
127
+ averageQuoted: number
128
+ averageActual: number
129
+ }>;
130
+ /**
131
+ * Fetch seated statistics for the last 24 hours
132
+ * @returns Object containing total seated count and hourly breakdown
133
+ */
134
+ export declare function fetchSeatedStats(): Promise<{
135
+ total: number
136
+ byHour: Array<{ hour: number, count: number }>
137
+ }>;
138
+ /**
139
+ * Fetch time series statistics for all statuses
140
+ * @returns Object containing daily counts for each status
141
+ */
142
+ export declare function fetchTimeSeriesStats(): Promise<Record<string, {
143
+ total: number
144
+ waiting: number
145
+ seated: number
146
+ cancelled: number
147
+ no_show: number
148
+ }>>;
149
+ declare type WaitlistRestaurantJsonResponse = ModelRow<typeof WaitlistRestaurant>;
@@ -0,0 +1,40 @@
1
+ // Functions from destroy.ts
2
+ export {
3
+ bulkDestroy,
4
+ destroy,
5
+ } from './destroy';
6
+ // Functions from fetch.ts
7
+ export {
8
+ fetchAll,
9
+ fetchAverageWaitTimes,
10
+ fetchBetweenDates,
11
+ fetchById,
12
+ fetchConversionRates,
13
+ fetchCountByAllPartySizes,
14
+ fetchCountByDate,
15
+ fetchCountByPartySize,
16
+ fetchCountByTablePreference,
17
+ fetchCurrentWaitTimes,
18
+ fetchNoShowStats,
19
+ fetchSeatedBetweenDates,
20
+ fetchSeatedStats,
21
+ fetchSeatingRate,
22
+ fetchTablesTurnedToday,
23
+ fetchTimeSeriesStats,
24
+ fetchWaiting,
25
+ fetchWaitingWithPartySizes,
26
+ fetchWaitingWithQuotedTimes,
27
+ } from './fetch';
28
+ // Functions from store.ts
29
+ export {
30
+ bulkStore,
31
+ store,
32
+ } from './store';
33
+ // Functions from update.ts
34
+ export {
35
+ update,
36
+ updatePartySize,
37
+ updateQueuePosition,
38
+ updateStatus,
39
+ updateWaitTimes,
40
+ } from './update';
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Create a new restaurant waitlist entry
3
+ *
4
+ * @param data Restaurant waitlist data to store
5
+ * @returns The newly created restaurant waitlist record
6
+ */
7
+ export declare function store(data: NewWaitlistRestaurant): Promise<WaitlistRestaurantJsonResponse>;
8
+ /**
9
+ * Create multiple restaurant waitlist entries at once
10
+ *
11
+ * @param data Array of restaurant waitlist data to store
12
+ * @returns Number of restaurant waitlist entries created
13
+ */
14
+ export declare function bulkStore(data: NewWaitlistRestaurant[]): Promise<number>;
15
+ declare type WaitlistRestaurantJsonResponse = ModelRow<typeof WaitlistRestaurant>;
16
+ declare type NewWaitlistRestaurant = NewModelData<typeof WaitlistRestaurant>;
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Update a restaurant waitlist entry
3
+ *
4
+ * @param id The id of the restaurant waitlist entry to update
5
+ * @param data The restaurant waitlist data to update
6
+ * @returns The updated restaurant waitlist record
7
+ */
8
+ export declare function update(id: number, data: WaitlistRestaurantUpdate): Promise<WaitlistRestaurantJsonResponse>;
9
+ /**
10
+ * Update a restaurant waitlist entry's status
11
+ *
12
+ * @param id The ID of the restaurant waitlist entry
13
+ * @param status The new status
14
+ * @returns The updated restaurant waitlist entry with the new status
15
+ */
16
+ export declare function updateStatus(id: number, status: 'waiting' | 'seated'): Promise<WaitlistRestaurantJsonResponse>;
17
+ /**
18
+ * Update party size for a restaurant waitlist entry
19
+ *
20
+ * @param id The ID of the restaurant waitlist entry
21
+ * @param partySize The updated party size
22
+ * @returns The updated restaurant waitlist entry
23
+ */
24
+ export declare function updatePartySize(id: number, partySize: number): Promise<WaitlistRestaurantJsonResponse>;
25
+ /**
26
+ * Update wait times for a restaurant waitlist entry
27
+ *
28
+ * @param id The ID of the restaurant waitlist entry
29
+ * @param quotedWaitTime The quoted wait time in minutes
30
+ * @param actualWaitTime The actual wait time in minutes (optional)
31
+ * @returns The updated restaurant waitlist entry
32
+ */
33
+ export declare function updateWaitTimes(id: number, quotedWaitTime: number, actualWaitTime?: number): Promise<WaitlistRestaurantJsonResponse>;
34
+ /**
35
+ * Update queue position for a restaurant waitlist entry
36
+ *
37
+ * @param id The ID of the restaurant waitlist entry
38
+ * @param queuePosition The updated queue position
39
+ * @returns The updated restaurant waitlist entry
40
+ */
41
+ export declare function updateQueuePosition(id: number, queuePosition: number): Promise<WaitlistRestaurantJsonResponse>;
42
+ declare type WaitlistRestaurantJsonResponse = ModelRow<typeof WaitlistRestaurant>;
43
+ declare type WaitlistRestaurantUpdate = UpdateModelData<typeof WaitlistRestaurant>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/commerce",
3
3
  "type": "module",
4
- "version": "0.70.36",
4
+ "version": "0.70.42",
5
5
  "description": "Stacks commerce utilities.",
6
6
  "author": "Chris Breuer",
7
7
  "contributors": [