@stacksjs/commerce 0.70.229 → 0.70.230
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/dist/customers/update.d.ts +1 -1
- package/dist/devices/index.d.ts +7 -0
- package/dist/index.js +14 -3
- package/dist/orders/index.d.ts +4 -4
- package/dist/orders/place-order.d.ts +10 -1
- package/dist/payments/index.d.ts +1 -1
- package/dist/payments/update.d.ts +8 -0
- package/dist/products/categories/index.d.ts +1 -0
- package/dist/products/categories/store.d.ts +2 -2
- package/dist/products/categories/types.d.ts +10 -0
- package/dist/products/categories/update.d.ts +3 -2
- package/dist/products/items/update.d.ts +1 -1
- package/dist/products/manufacturers/update.d.ts +1 -1
- package/dist/products/reviews/destroy.d.ts +6 -6
- package/dist/products/reviews/update.d.ts +1 -1
- package/dist/products/units/index.d.ts +1 -0
- package/dist/products/units/store.d.ts +3 -3
- package/dist/products/units/types.d.ts +9 -0
- package/dist/products/units/update.d.ts +2 -1
- package/dist/products/variants/update.d.ts +1 -1
- package/dist/receipts/index.d.ts +5 -0
- package/dist/receipts/timestamp.d.ts +1 -0
- package/dist/receipts/update.d.ts +1 -1
- package/dist/shippings/delivery-routes/index.d.ts +4 -0
- package/dist/shippings/delivery-routes/store.d.ts +6 -1
- package/dist/shippings/delivery-routes/update.d.ts +1 -1
- package/dist/shippings/delivery-routes/validate-write.d.ts +5 -0
- package/dist/shippings/digital-deliveries/update.d.ts +1 -1
- package/dist/shippings/drivers/destroy.d.ts +2 -4
- package/dist/shippings/drivers/update.d.ts +1 -1
- package/dist/shippings/license-keys/index.d.ts +4 -0
- package/dist/shippings/license-keys/update.d.ts +1 -1
- package/dist/shippings/license-keys/validate-write.d.ts +5 -0
- package/dist/shippings/shipping-methods/update.d.ts +1 -1
- package/dist/shippings/shipping-rates/destroy.d.ts +2 -2
- package/dist/shippings/shipping-rates/index.d.ts +4 -0
- package/dist/shippings/shipping-rates/update.d.ts +2 -2
- package/dist/shippings/shipping-rates/validate-write.d.ts +5 -0
- package/dist/shippings/shipping-zones/update.d.ts +1 -1
- package/dist/shippings/write-data.d.ts +9 -0
- package/dist/tax/index.d.ts +2 -0
- package/dist/tax/store.d.ts +3 -3
- package/dist/tax/types.d.ts +10 -0
- package/dist/tax/update.d.ts +10 -2
- package/dist/utils/inventory-adjustment.d.ts +13 -0
- package/dist/utils/mutation-count.d.ts +1 -0
- package/dist/waitlists/products/update.d.ts +3 -3
- package/dist/waitlists/products/write-data.d.ts +1 -0
- package/dist/waitlists/restaurant/update.d.ts +5 -5
- package/dist/waitlists/restaurant/write-data.d.ts +1 -0
- package/package.json +1 -1
package/dist/orders/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { PlaceOrderInput, PlaceOrderResult } from './place-order';
|
|
1
|
+
export type { PlaceOrderInput, PlaceOrderLineItem, PlaceOrderResult } from './place-order';
|
|
2
2
|
export type { OrderStatus } from './events';
|
|
3
3
|
export type {
|
|
4
4
|
RecomputeLineItem,
|
|
@@ -35,9 +35,9 @@ export {
|
|
|
35
35
|
store,
|
|
36
36
|
} from './store';
|
|
37
37
|
// Atomic order placement (stacksjs/stacks#1879 Co-1).
|
|
38
|
-
// Wraps order + payment + inventory
|
|
39
|
-
// transaction so any failure rolls back the rest.
|
|
40
|
-
export { placeOrder } from './place-order';
|
|
38
|
+
// Wraps order + lines + payment + inventory + idempotency in a
|
|
39
|
+
// single transaction so any failure rolls back the rest.
|
|
40
|
+
export { findOrderByIdempotencyKey, placeOrder } from './place-order';
|
|
41
41
|
// Event bus integration + status-transition state machine
|
|
42
42
|
// (stacksjs/stacks#1879 Co-18, Co-4). Emit helpers fire
|
|
43
43
|
// order:created / order:paid / order:shipped / order:delivered /
|
|
@@ -1,12 +1,21 @@
|
|
|
1
|
+
export declare function findOrderByIdempotencyKey(key: string): Promise<OrderJsonResponse | null>;
|
|
1
2
|
export declare function placeOrder(input: PlaceOrderInput): Promise<PlaceOrderResult>;
|
|
3
|
+
export declare interface PlaceOrderLineItem {
|
|
4
|
+
productId: number
|
|
5
|
+
quantity: number
|
|
6
|
+
price: number
|
|
7
|
+
specialInstructions?: string
|
|
8
|
+
}
|
|
2
9
|
export declare interface PlaceOrderInput {
|
|
3
10
|
order: NewOrder
|
|
11
|
+
items?: ReadonlyArray<PlaceOrderLineItem>
|
|
4
12
|
payment?: NewPayment
|
|
5
13
|
inventory?: ReadonlyArray<{ id: number, delta: number }>
|
|
6
14
|
idempotencyKey?: string
|
|
7
15
|
}
|
|
8
16
|
declare type OrderJsonResponse = ModelRow<typeof Order>;
|
|
9
17
|
declare type NewOrder = NewModelData<typeof Order>;
|
|
18
|
+
declare type OrderItemJsonResponse = ModelRow<typeof OrderItem>;
|
|
10
19
|
declare type PaymentJsonResponse = ModelRow<typeof Payment>;
|
|
11
20
|
declare type NewPayment = NewModelData<typeof Payment>;
|
|
12
21
|
/**
|
|
@@ -14,5 +23,5 @@ declare type NewPayment = NewModelData<typeof Payment>;
|
|
|
14
23
|
* inventory all committed; `ok: false` carries a `reason` so the
|
|
15
24
|
* caller can surface a specific error to the user.
|
|
16
25
|
*/
|
|
17
|
-
export type PlaceOrderResult = | { ok: true, order: OrderJsonResponse, payment?: PaymentJsonResponse }
|
|
26
|
+
export type PlaceOrderResult = | { ok: true, order: OrderJsonResponse, items?: OrderItemJsonResponse[], payment?: PaymentJsonResponse }
|
|
18
27
|
| { ok: false, reason: 'out-of-stock' | 'duplicate-payment' | 'duplicate-idempotency-key' | 'unknown', failedAt?: string, error?: unknown }
|
package/dist/payments/index.d.ts
CHANGED
|
@@ -14,5 +14,13 @@
|
|
|
14
14
|
* @returns The updated payment record
|
|
15
15
|
*/
|
|
16
16
|
export declare function update(id: number, data: Omit<PaymentUpdate, 'id'>): Promise<PaymentJsonResponse | undefined>;
|
|
17
|
+
/**
|
|
18
|
+
* Record a processor-confirmed refund against a payment.
|
|
19
|
+
*
|
|
20
|
+
* Amounts are integer minor units. A single conditional update performs the
|
|
21
|
+
* increment and remaining-balance check atomically, so concurrent operators
|
|
22
|
+
* cannot record more than the captured amount.
|
|
23
|
+
*/
|
|
24
|
+
export declare function recordRefund(id: number, amount: number): Promise<PaymentJsonResponse>;
|
|
17
25
|
declare type PaymentJsonResponse = ModelRow<typeof Payment>;
|
|
18
26
|
declare type PaymentUpdate = UpdateModelData<typeof Payment>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { slug } from '@stacksjs/strings';
|
|
2
|
+
import type { CategoryWriteData } from './types';
|
|
2
3
|
/**
|
|
3
4
|
* Create a new category
|
|
4
5
|
*
|
|
5
6
|
* @param data The category data to store
|
|
6
7
|
* @returns The newly created category record
|
|
7
8
|
*/
|
|
8
|
-
export declare function store(data:
|
|
9
|
+
export declare function store(data: CategoryWriteData): Promise<CategoryJsonResponse>;
|
|
9
10
|
export declare function findOrCreateByName(data: Partial<CategorizableTable>): Promise<CategoryJsonResponse>;
|
|
10
11
|
export declare interface CategorizableTable {
|
|
11
12
|
id: number
|
|
@@ -18,4 +19,3 @@ export declare interface CategorizableTable {
|
|
|
18
19
|
updated_at?: string
|
|
19
20
|
}
|
|
20
21
|
declare type CategoryJsonResponse = ModelRow<typeof Category>;
|
|
21
|
-
declare type NewCategory = NewModelData<typeof Category>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import type { CategoryWriteData } from './types';
|
|
1
2
|
/**
|
|
2
3
|
* Update a category by ID
|
|
3
4
|
*
|
|
4
5
|
* @param id The ID of the category to update
|
|
5
|
-
* @param
|
|
6
|
+
* @param data The updated category data
|
|
6
7
|
* @returns The updated category record
|
|
7
8
|
*/
|
|
8
|
-
export declare function update(id: number,
|
|
9
|
+
export declare function update(id: number, data: CategoryWriteData): Promise<CategoryRow | undefined>;
|
|
9
10
|
/**
|
|
10
11
|
* Update category display order
|
|
11
12
|
*
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @param data The product item data to update
|
|
6
6
|
* @returns The updated product item record
|
|
7
7
|
*/
|
|
8
|
-
export declare function update(id: number, data: Omit<ProductUpdate, 'id'>): Promise<ProductJsonResponse>;
|
|
8
|
+
export declare function update(id: number, data: Omit<ProductUpdate, 'id'>): Promise<ProductJsonResponse | undefined>;
|
|
9
9
|
/**
|
|
10
10
|
* Update multiple product items at once
|
|
11
11
|
*
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @param data The manufacturer data to update
|
|
6
6
|
* @returns The updated manufacturer record
|
|
7
7
|
*/
|
|
8
|
-
export declare function update(id: number, data: ManufacturerUpdate): Promise<ManufacturerJsonResponse>;
|
|
8
|
+
export declare function update(id: number, data: ManufacturerUpdate): Promise<ManufacturerJsonResponse | undefined>;
|
|
9
9
|
/**
|
|
10
10
|
* Toggle the featured status of a manufacturer
|
|
11
11
|
*
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Delete
|
|
2
|
+
* Delete a review by ID
|
|
3
3
|
*
|
|
4
|
-
* @param id The ID of the
|
|
5
|
-
* @returns True if the
|
|
4
|
+
* @param id The ID of the review to delete
|
|
5
|
+
* @returns True if the review was deleted, false otherwise
|
|
6
6
|
*/
|
|
7
7
|
export declare function destroy(id: number): Promise<boolean>;
|
|
8
8
|
/**
|
|
9
|
-
* Delete multiple
|
|
9
|
+
* Delete multiple reviews by ID
|
|
10
10
|
*
|
|
11
|
-
* @param ids Array of
|
|
12
|
-
* @returns Number of
|
|
11
|
+
* @param ids Array of review IDs to delete
|
|
12
|
+
* @returns Number of reviews deleted
|
|
13
13
|
*/
|
|
14
14
|
export declare function bulkDestroy(ids: number[]): Promise<number>;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @param data The review data to update
|
|
6
6
|
* @returns The updated review record
|
|
7
7
|
*/
|
|
8
|
-
export declare function update(id: number, data: ReviewUpdate): Promise<ReviewJsonResponse>;
|
|
8
|
+
export declare function update(id: number, data: ReviewUpdate): Promise<ReviewJsonResponse | undefined>;
|
|
9
9
|
/**
|
|
10
10
|
* Update a review's vote counts
|
|
11
11
|
*
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
+
import type { ProductUnitWriteData } from './types';
|
|
1
2
|
/**
|
|
2
3
|
* Create a new product unit
|
|
3
4
|
*
|
|
4
5
|
* @param data The product unit data to store
|
|
5
6
|
* @returns The newly created product unit record
|
|
6
7
|
*/
|
|
7
|
-
export declare function store(data:
|
|
8
|
+
export declare function store(data: ProductUnitWriteData): Promise<ProductUnitJsonResponse>;
|
|
8
9
|
/**
|
|
9
10
|
* Create multiple product units at once
|
|
10
11
|
*
|
|
11
12
|
* @param data Array of product unit data to store
|
|
12
13
|
* @returns Number of product units created
|
|
13
14
|
*/
|
|
14
|
-
export declare function bulkStore(data:
|
|
15
|
+
export declare function bulkStore(data: ProductUnitWriteData[]): Promise<number>;
|
|
15
16
|
/**
|
|
16
17
|
* Format product unit options for dropdown menus or selectors
|
|
17
18
|
*
|
|
@@ -28,4 +29,3 @@ export declare function formatUnitOptions(type?: string): Promise<{ id: string,
|
|
|
28
29
|
export declare function getDefaultUnit(type: string): Promise<ProductUnitJsonResponse | undefined>;
|
|
29
30
|
// Import dependencies
|
|
30
31
|
declare type ProductUnitJsonResponse = ModelRow<typeof ProductUnit>;
|
|
31
|
-
declare type NewProductUnit = NewModelData<typeof ProductUnit>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ProductUnitWriteData } from './types';
|
|
1
2
|
/**
|
|
2
3
|
* Update a product unit
|
|
3
4
|
*
|
|
@@ -5,7 +6,7 @@
|
|
|
5
6
|
* @param data The product unit data to update
|
|
6
7
|
* @returns The updated product unit record
|
|
7
8
|
*/
|
|
8
|
-
export declare function update(id: number, data:
|
|
9
|
+
export declare function update(id: number, data: ProductUnitWriteData): Promise<ProductUnitJsonResponse | undefined>;
|
|
9
10
|
/**
|
|
10
11
|
* Update multiple product units at once
|
|
11
12
|
*
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @param data The product variant data to update
|
|
6
6
|
* @returns The updated product variant record
|
|
7
7
|
*/
|
|
8
|
-
export declare function update(id: number, data: Omit<ProductVariantUpdate, 'id'>): Promise<ProductVariantJsonResponse>;
|
|
8
|
+
export declare function update(id: number, data: Omit<ProductVariantUpdate, 'id'>): Promise<ProductVariantJsonResponse | undefined>;
|
|
9
9
|
/**
|
|
10
10
|
* Update multiple product variants at once
|
|
11
11
|
*
|
package/dist/receipts/index.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function receiptTimestamp(value: unknown): string;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @param data The receipt data to update
|
|
6
6
|
* @returns The updated receipt record
|
|
7
7
|
*/
|
|
8
|
-
export declare function update(id: number, data: ReceiptUpdate): Promise<ReceiptJsonResponse>;
|
|
8
|
+
export declare function update(id: number, data: ReceiptUpdate): Promise<ReceiptJsonResponse | undefined>;
|
|
9
9
|
/**
|
|
10
10
|
* Update a receipt's status
|
|
11
11
|
*
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @param data The delivery route data to store
|
|
5
5
|
* @returns The newly created delivery route record
|
|
6
6
|
*/
|
|
7
|
-
export declare function store(data:
|
|
7
|
+
export declare function store(data: DeliveryRouteInput): Promise<DeliveryRouteJsonResponse>;
|
|
8
8
|
/**
|
|
9
9
|
* Update a delivery route's last active timestamp
|
|
10
10
|
*
|
|
@@ -14,3 +14,8 @@ export declare function store(data: NewDeliveryRoute): Promise<DeliveryRouteJson
|
|
|
14
14
|
export declare function updateLastActive(id: number): Promise<DeliveryRouteJsonResponse>;
|
|
15
15
|
declare type DeliveryRouteJsonResponse = ModelRow<typeof DeliveryRoute>;
|
|
16
16
|
declare type NewDeliveryRoute = NewModelData<typeof DeliveryRoute>;
|
|
17
|
+
declare type DeliveryRouteInput = NewDeliveryRoute & Partial<{
|
|
18
|
+
delivery_time: number
|
|
19
|
+
last_active: number
|
|
20
|
+
total_distance: number
|
|
21
|
+
}>;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @param data The delivery route data to update
|
|
6
6
|
* @returns The updated delivery route record
|
|
7
7
|
*/
|
|
8
|
-
export declare function update(id: number, data: DeliveryRouteUpdate): Promise<DeliveryRouteJsonResponse>;
|
|
8
|
+
export declare function update(id: number, data: DeliveryRouteUpdate): Promise<DeliveryRouteJsonResponse | undefined>;
|
|
9
9
|
/**
|
|
10
10
|
* Update a delivery route's stops count
|
|
11
11
|
*
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function validateDeliveryRouteWrite(input: DeliveryRouteWriteData, current?: DeliveryRouteWriteData): Promise<DeliveryRouteWriteData>;
|
|
2
|
+
declare type DeliveryRouteWriteData = Record<string, unknown>;
|
|
3
|
+
export declare class DeliveryRouteInputError extends TypeError {
|
|
4
|
+
constructor(message: string);
|
|
5
|
+
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @param data The digital delivery data to update
|
|
6
6
|
* @returns The updated digital delivery record
|
|
7
7
|
*/
|
|
8
|
-
export declare function update(id: number, data: DigitalDeliveryUpdate): Promise<DigitalDeliveryJsonResponse>;
|
|
8
|
+
export declare function update(id: number, data: DigitalDeliveryUpdate): Promise<DigitalDeliveryJsonResponse | undefined>;
|
|
9
9
|
/**
|
|
10
10
|
* Update a digital delivery's status
|
|
11
11
|
*
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Delete a driver by ID
|
|
3
3
|
*
|
|
4
4
|
* @param id The ID of the driver to delete
|
|
5
|
-
* @returns
|
|
5
|
+
* @returns True if the driver was deleted, false otherwise
|
|
6
6
|
*/
|
|
7
|
-
export declare function destroy(id: number): Promise<
|
|
7
|
+
export declare function destroy(id: number): Promise<boolean>;
|
|
8
8
|
/**
|
|
9
9
|
* Delete multiple drivers at once
|
|
10
10
|
*
|
|
@@ -12,5 +12,3 @@ export declare function destroy(id: number): Promise<DriverJsonResponse | undefi
|
|
|
12
12
|
* @returns Number of drivers deleted
|
|
13
13
|
*/
|
|
14
14
|
export declare function bulkDestroy(ids: number[]): Promise<number>;
|
|
15
|
-
// Import dependencies
|
|
16
|
-
declare type DriverJsonResponse = ModelRow<typeof Driver>;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @param data The driver data to update
|
|
6
6
|
* @returns The updated driver record
|
|
7
7
|
*/
|
|
8
|
-
export declare function update(id: number, data: DriverUpdate): Promise<DriverJsonResponse>;
|
|
8
|
+
export declare function update(id: number, data: DriverUpdate): Promise<DriverJsonResponse | undefined>;
|
|
9
9
|
/**
|
|
10
10
|
* Update a driver's status
|
|
11
11
|
*
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @param data The license key data to update
|
|
6
6
|
* @returns The updated license key record
|
|
7
7
|
*/
|
|
8
|
-
export declare function update(id: number, data: LicenseKeyUpdate): Promise<LicenseKeyJsonResponse>;
|
|
8
|
+
export declare function update(id: number, data: LicenseKeyUpdate): Promise<LicenseKeyJsonResponse | undefined>;
|
|
9
9
|
/**
|
|
10
10
|
* Update a license key's status
|
|
11
11
|
*
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function validateLicenseKeyWrite(input: LicenseKeyWriteData, current?: LicenseKeyWriteData): Promise<LicenseKeyWriteData>;
|
|
2
|
+
declare type LicenseKeyWriteData = Record<string, unknown>;
|
|
3
|
+
export declare class LicenseKeyInputError extends TypeError {
|
|
4
|
+
constructor(message: string);
|
|
5
|
+
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @param data The shipping method data to update
|
|
6
6
|
* @returns The updated shipping method record
|
|
7
7
|
*/
|
|
8
|
-
export declare function update(id: number, data: ShippingMethodUpdate): Promise<ShippingMethodJsonResponse>;
|
|
8
|
+
export declare function update(id: number, data: ShippingMethodUpdate): Promise<ShippingMethodJsonResponse | undefined>;
|
|
9
9
|
/**
|
|
10
10
|
* Update a shipping method's status
|
|
11
11
|
*
|
|
@@ -18,11 +18,11 @@ export declare function bulkDestroy(ids: number[]): Promise<number>;
|
|
|
18
18
|
* @param zone The zone to delete shipping rates for
|
|
19
19
|
* @returns Number of shipping rates deleted
|
|
20
20
|
*/
|
|
21
|
-
export declare function destroyByZone(zone:
|
|
21
|
+
export declare function destroyByZone(zone: number): Promise<number>;
|
|
22
22
|
/**
|
|
23
23
|
* Delete shipping rates by method
|
|
24
24
|
*
|
|
25
25
|
* @param method The shipping method to delete rates for
|
|
26
26
|
* @returns Number of shipping rates deleted
|
|
27
27
|
*/
|
|
28
|
-
export declare function destroyByMethod(method:
|
|
28
|
+
export declare function destroyByMethod(method: number): Promise<number>;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @param data The shipping rate data to update
|
|
6
6
|
* @returns The updated shipping rate record
|
|
7
7
|
*/
|
|
8
|
-
export declare function update(id: number, data: ShippingRateUpdate): Promise<ShippingRateJsonResponse>;
|
|
8
|
+
export declare function update(id: number, data: ShippingRateUpdate): Promise<ShippingRateJsonResponse | undefined>;
|
|
9
9
|
/**
|
|
10
10
|
* Update multiple shipping rates at once
|
|
11
11
|
*
|
|
@@ -31,6 +31,6 @@ export declare function updateByZone(zone: number, data: ShippingRateUpdate): Pr
|
|
|
31
31
|
* @param data The update data to apply
|
|
32
32
|
* @returns Number of shipping rates updated
|
|
33
33
|
*/
|
|
34
|
-
export declare function updateByMethod(method:
|
|
34
|
+
export declare function updateByMethod(method: number, data: ShippingRateUpdate): Promise<number>;
|
|
35
35
|
declare type ShippingRateJsonResponse = ModelRow<typeof ShippingRate>;
|
|
36
36
|
declare type ShippingRateUpdate = UpdateModelData<typeof ShippingRate>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function validateShippingRateWrite(input: ShippingRateWriteData, current?: ShippingRateWriteData): Promise<void>;
|
|
2
|
+
declare type ShippingRateWriteData = Record<string, unknown>;
|
|
3
|
+
export declare class ShippingRateInputError extends TypeError {
|
|
4
|
+
constructor(message: string);
|
|
5
|
+
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @param data The shipping zone data to update
|
|
6
6
|
* @returns The updated shipping zone record
|
|
7
7
|
*/
|
|
8
|
-
export declare function update(id: number, data: ShippingZoneUpdate): Promise<ShippingZoneJsonResponse>;
|
|
8
|
+
export declare function update(id: number, data: ShippingZoneUpdate): Promise<ShippingZoneJsonResponse | undefined>;
|
|
9
9
|
/**
|
|
10
10
|
* Update a shipping zone's status
|
|
11
11
|
*
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function shippingMethodWriteData(input: ShippingWriteInput): Record<string, unknown>;
|
|
2
|
+
export declare function shippingRateWriteData(input: ShippingWriteInput): Record<string, unknown>;
|
|
3
|
+
export declare function shippingZoneWriteData(input: ShippingWriteInput): Record<string, unknown>;
|
|
4
|
+
export declare function digitalDeliveryWriteData(input: ShippingWriteInput): Record<string, unknown>;
|
|
5
|
+
export declare function licenseKeyWriteData(input: ShippingWriteInput): Record<string, unknown>;
|
|
6
|
+
export declare function driverWriteData(input: ShippingWriteInput): Record<string, unknown>;
|
|
7
|
+
export declare function deliveryRouteWriteData(input: ShippingWriteInput): Record<string, unknown>;
|
|
8
|
+
declare type ShippingWriteInput = Record<string, unknown>;
|
|
9
|
+
declare type ShippingColumnAliases = Readonly<Record<string, readonly string[]>>;
|
package/dist/tax/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export type { TaxRateWriteData } from './types';
|
|
1
2
|
// Functions from destroy.ts
|
|
2
3
|
export {
|
|
3
4
|
bulkDestroy,
|
|
@@ -16,6 +17,7 @@ export {
|
|
|
16
17
|
// Functions from update.ts
|
|
17
18
|
export {
|
|
18
19
|
update,
|
|
20
|
+
updateDefaultStatus,
|
|
19
21
|
updateRate,
|
|
20
22
|
updateStatus,
|
|
21
23
|
} from './update';
|
package/dist/tax/store.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
+
import type { TaxRateWriteData } from './types';
|
|
1
2
|
/**
|
|
2
3
|
* Create a new tax rate
|
|
3
4
|
*
|
|
4
5
|
* @param data Tax rate data to store
|
|
5
6
|
* @returns The newly created tax rate record
|
|
6
7
|
*/
|
|
7
|
-
export declare function store(data:
|
|
8
|
+
export declare function store(data: TaxRateWriteData): Promise<TaxRateJsonResponse>;
|
|
8
9
|
/**
|
|
9
10
|
* Create multiple tax rates at once
|
|
10
11
|
*
|
|
11
12
|
* @param data Array of tax rate data to store
|
|
12
13
|
* @returns Number of tax rates created
|
|
13
14
|
*/
|
|
14
|
-
export declare function bulkStore(data:
|
|
15
|
+
export declare function bulkStore(data: TaxRateWriteData[]): Promise<number>;
|
|
15
16
|
declare type TaxRateJsonResponse = ModelRow<typeof TaxRate>;
|
|
16
|
-
declare type NewTaxRate = NewModelData<typeof TaxRate>;
|
package/dist/tax/update.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { TaxRateWriteData } from './types';
|
|
1
2
|
/**
|
|
2
3
|
* Update a tax rate
|
|
3
4
|
*
|
|
@@ -5,7 +6,7 @@
|
|
|
5
6
|
* @param data The tax rate data to update
|
|
6
7
|
* @returns The updated tax rate record
|
|
7
8
|
*/
|
|
8
|
-
export declare function update(id: number, data:
|
|
9
|
+
export declare function update(id: number, data: TaxRateWriteData): Promise<TaxRateJsonResponse | undefined>;
|
|
9
10
|
/**
|
|
10
11
|
* Update a tax rate's status
|
|
11
12
|
*
|
|
@@ -22,5 +23,12 @@ export declare function updateStatus(id: number, status: 'active' | 'inactive'):
|
|
|
22
23
|
* @returns The updated tax rate
|
|
23
24
|
*/
|
|
24
25
|
export declare function updateRate(id: number, rate: number): Promise<TaxRateJsonResponse>;
|
|
26
|
+
/**
|
|
27
|
+
* Select or clear the default tax rate.
|
|
28
|
+
*
|
|
29
|
+
* @param id The ID of the tax rate
|
|
30
|
+
* @param isDefault Whether the tax rate should be the default
|
|
31
|
+
* @returns True when the tax rate exists and was updated
|
|
32
|
+
*/
|
|
33
|
+
export declare function updateDefaultStatus(id: number, isDefault: boolean): Promise<boolean>;
|
|
25
34
|
declare type TaxRateJsonResponse = ModelRow<typeof TaxRate>;
|
|
26
|
-
declare type TaxRateUpdate = UpdateModelData<typeof TaxRate>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare function inventoryAdjustmentStatement(driver: string, productId: number, delta: number, updatedAt: string): { query: string, parameters: unknown[] };
|
|
2
|
+
/**
|
|
3
|
+
* Apply one guarded inventory delta through the supplied connection.
|
|
4
|
+
*
|
|
5
|
+
* Passing a transaction-scoped connection keeps this write on the reserved
|
|
6
|
+
* transaction connection. The conditional UPDATE is the concurrency guard:
|
|
7
|
+
* an insufficient decrement matches zero rows instead of producing negative
|
|
8
|
+
* stock.
|
|
9
|
+
*/
|
|
10
|
+
export declare function adjustInventoryOnConnection(connection: UnsafeConnection, productId: number, delta: number, updatedAt: string): Promise<number>;
|
|
11
|
+
declare interface UnsafeConnection {
|
|
12
|
+
unsafe: (query: string, parameters?: unknown[]) => unknown
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function mutationCount(result: unknown): number;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @param data The waitlist product data to update
|
|
6
6
|
* @returns The updated waitlist product record
|
|
7
7
|
*/
|
|
8
|
-
export declare function update(id: number, data: WaitlistProductUpdate): Promise<WaitlistProductJsonResponse>;
|
|
8
|
+
export declare function update(id: number, data: WaitlistProductUpdate): Promise<WaitlistProductJsonResponse | undefined>;
|
|
9
9
|
/**
|
|
10
10
|
* Update a waitlist product's status
|
|
11
11
|
*
|
|
@@ -13,7 +13,7 @@ export declare function update(id: number, data: WaitlistProductUpdate): Promise
|
|
|
13
13
|
* @param status The new status
|
|
14
14
|
* @returns The updated waitlist product with the new status
|
|
15
15
|
*/
|
|
16
|
-
export declare function updateStatus(id: number, status: 'waiting' | 'purchased' | 'notified' | 'cancelled'): Promise<WaitlistProductJsonResponse>;
|
|
16
|
+
export declare function updateStatus(id: number, status: 'waiting' | 'purchased' | 'notified' | 'cancelled'): Promise<WaitlistProductJsonResponse | undefined>;
|
|
17
17
|
/**
|
|
18
18
|
* Update party size for a waitlist product
|
|
19
19
|
*
|
|
@@ -21,6 +21,6 @@ export declare function updateStatus(id: number, status: 'waiting' | 'purchased'
|
|
|
21
21
|
* @param partySize The updated party size
|
|
22
22
|
* @returns The updated waitlist product
|
|
23
23
|
*/
|
|
24
|
-
export declare function updatePartySize(id: number, partySize: number): Promise<WaitlistProductJsonResponse>;
|
|
24
|
+
export declare function updatePartySize(id: number, partySize: number): Promise<WaitlistProductJsonResponse | undefined>;
|
|
25
25
|
declare type WaitlistProductJsonResponse = ModelRow<typeof WaitlistProduct>;
|
|
26
26
|
declare type WaitlistProductUpdate = UpdateModelData<typeof WaitlistProduct>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function productWaitlistWriteData(data: Record<string, unknown>, existing?: Record<string, unknown>): Record<string, unknown>;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @param data The restaurant waitlist data to update
|
|
6
6
|
* @returns The updated restaurant waitlist record
|
|
7
7
|
*/
|
|
8
|
-
export declare function update(id: number, data: WaitlistRestaurantUpdate): Promise<WaitlistRestaurantJsonResponse>;
|
|
8
|
+
export declare function update(id: number, data: WaitlistRestaurantUpdate): Promise<WaitlistRestaurantJsonResponse | undefined>;
|
|
9
9
|
/**
|
|
10
10
|
* Update a restaurant waitlist entry's status
|
|
11
11
|
*
|
|
@@ -13,7 +13,7 @@ export declare function update(id: number, data: WaitlistRestaurantUpdate): Prom
|
|
|
13
13
|
* @param status The new status
|
|
14
14
|
* @returns The updated restaurant waitlist entry with the new status
|
|
15
15
|
*/
|
|
16
|
-
export declare function updateStatus(id: number, status: 'waiting' | 'seated'): Promise<WaitlistRestaurantJsonResponse>;
|
|
16
|
+
export declare function updateStatus(id: number, status: 'waiting' | 'seated' | 'cancelled' | 'no_show'): Promise<WaitlistRestaurantJsonResponse | undefined>;
|
|
17
17
|
/**
|
|
18
18
|
* Update party size for a restaurant waitlist entry
|
|
19
19
|
*
|
|
@@ -21,7 +21,7 @@ export declare function updateStatus(id: number, status: 'waiting' | 'seated'):
|
|
|
21
21
|
* @param partySize The updated party size
|
|
22
22
|
* @returns The updated restaurant waitlist entry
|
|
23
23
|
*/
|
|
24
|
-
export declare function updatePartySize(id: number, partySize: number): Promise<WaitlistRestaurantJsonResponse>;
|
|
24
|
+
export declare function updatePartySize(id: number, partySize: number): Promise<WaitlistRestaurantJsonResponse | undefined>;
|
|
25
25
|
/**
|
|
26
26
|
* Update wait times for a restaurant waitlist entry
|
|
27
27
|
*
|
|
@@ -30,7 +30,7 @@ export declare function updatePartySize(id: number, partySize: number): Promise<
|
|
|
30
30
|
* @param actualWaitTime The actual wait time in minutes (optional)
|
|
31
31
|
* @returns The updated restaurant waitlist entry
|
|
32
32
|
*/
|
|
33
|
-
export declare function updateWaitTimes(id: number, quotedWaitTime: number, actualWaitTime?: number): Promise<WaitlistRestaurantJsonResponse>;
|
|
33
|
+
export declare function updateWaitTimes(id: number, quotedWaitTime: number, actualWaitTime?: number): Promise<WaitlistRestaurantJsonResponse | undefined>;
|
|
34
34
|
/**
|
|
35
35
|
* Update queue position for a restaurant waitlist entry
|
|
36
36
|
*
|
|
@@ -38,6 +38,6 @@ export declare function updateWaitTimes(id: number, quotedWaitTime: number, actu
|
|
|
38
38
|
* @param queuePosition The updated queue position
|
|
39
39
|
* @returns The updated restaurant waitlist entry
|
|
40
40
|
*/
|
|
41
|
-
export declare function updateQueuePosition(id: number, queuePosition: number): Promise<WaitlistRestaurantJsonResponse>;
|
|
41
|
+
export declare function updateQueuePosition(id: number, queuePosition: number): Promise<WaitlistRestaurantJsonResponse | undefined>;
|
|
42
42
|
declare type WaitlistRestaurantJsonResponse = ModelRow<typeof WaitlistRestaurant>;
|
|
43
43
|
declare type WaitlistRestaurantUpdate = UpdateModelData<typeof WaitlistRestaurant>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function restaurantWaitlistWriteData(data: Record<string, unknown>, existing?: Record<string, unknown>): Record<string, unknown>;
|