@final-commerce/command-frame 0.1.10 → 0.1.11
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/actions/add-cart-discount/types.d.ts +3 -0
- package/dist/actions/add-cart-fee/types.d.ts +4 -0
- package/dist/actions/add-customer/types.d.ts +1 -0
- package/dist/actions/add-product-discount/types.d.ts +3 -0
- package/dist/actions/add-product-fee/types.d.ts +3 -0
- package/dist/actions/add-product-note/types.d.ts +1 -0
- package/dist/actions/add-product-to-cart/types.d.ts +5 -0
- package/dist/actions/adjust-inventory/types.d.ts +2 -0
- package/dist/actions/calculate-refund-total/types.d.ts +1 -0
- package/dist/actions/cash-payment/types.d.ts +2 -0
- package/dist/actions/get-categories/types.d.ts +1 -0
- package/dist/actions/get-customers/types.d.ts +3 -0
- package/dist/actions/get-line-items-by-order/types.d.ts +1 -0
- package/dist/actions/get-orders/types.d.ts +5 -0
- package/dist/actions/get-products/types.d.ts +3 -0
- package/dist/actions/get-refunds/types.d.ts +4 -0
- package/dist/actions/initiate-refund/types.d.ts +1 -0
- package/dist/actions/partial-payment/types.d.ts +3 -0
- package/dist/actions/process-partial-refund/types.d.ts +4 -0
- package/dist/actions/select-all-refund-items/types.d.ts +1 -0
- package/dist/actions/set-refund-stock-action/types.d.ts +1 -0
- package/dist/actions/switch-user/types.d.ts +2 -0
- package/dist/actions/tap-to-pay-payment/types.d.ts +1 -0
- package/dist/actions/terminal-payment/types.d.ts +1 -0
- package/dist/actions/trigger-webhook/types.d.ts +4 -0
- package/dist/actions/vendara-payment/types.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export interface AddCartDiscountParams {
|
|
2
|
+
/** The discount amount. If isPercent is true, this is a percentage (0-100). */
|
|
2
3
|
amount: number;
|
|
4
|
+
/** Defaults to `false`. */
|
|
3
5
|
isPercent?: boolean;
|
|
6
|
+
/** Defaults to "Discount". */
|
|
4
7
|
label?: string;
|
|
5
8
|
}
|
|
6
9
|
export interface AddCartDiscountResponse {
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
export interface AddCartFeeParams {
|
|
2
|
+
/** The fee amount. If isPercent is true, this is a percentage. */
|
|
2
3
|
amount: number;
|
|
4
|
+
/** Defaults to `false`. */
|
|
3
5
|
isPercent?: boolean;
|
|
6
|
+
/** Defaults to "Fee". */
|
|
4
7
|
label?: string;
|
|
8
|
+
/** Defaults to `false`. */
|
|
5
9
|
applyTaxes?: boolean;
|
|
6
10
|
taxTableId?: string;
|
|
7
11
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CFCustomer } from "../../CommonTypes";
|
|
2
2
|
export interface AddCustomerParams {
|
|
3
|
+
/** Requires all fields except those generated by the server/database. */
|
|
3
4
|
customer: Omit<CFCustomer, '_id' | 'createdAt' | 'updatedAt'>;
|
|
4
5
|
}
|
|
5
6
|
export interface AddCustomerResponse {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export interface AddProductDiscountParams {
|
|
2
|
+
/** The discount amount. If isPercent is true, this is a percentage. */
|
|
2
3
|
amount: number;
|
|
4
|
+
/** Defaults to `false`. */
|
|
3
5
|
isPercent?: boolean;
|
|
6
|
+
/** Defaults to "Discount". */
|
|
4
7
|
label?: string;
|
|
5
8
|
cartItemId?: string;
|
|
6
9
|
}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import type { AddProductDiscountParams } from "../add-product-discount/types";
|
|
2
2
|
import type { AddProductFeeParams } from "../add-product-fee/types";
|
|
3
3
|
export interface AddProductToCartParams {
|
|
4
|
+
/** ID of the variant to add. Optional but recommended. */
|
|
4
5
|
variantId?: string;
|
|
6
|
+
/** Defaults to 1. */
|
|
5
7
|
quantity?: number;
|
|
8
|
+
/** Array of discounts to apply immediately. */
|
|
6
9
|
discounts?: AddProductDiscountParams[];
|
|
10
|
+
/** Array of fees to apply immediately. */
|
|
7
11
|
fees?: AddProductFeeParams[];
|
|
12
|
+
/** Note or array of notes to add immediately. */
|
|
8
13
|
notes?: string | string[];
|
|
9
14
|
}
|
|
10
15
|
export interface AddProductToCartResponse {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CFRefundedLineItem, CFRefundedCustomSale } from "../../CommonTypes";
|
|
2
2
|
export interface CalculateRefundTotalParams {
|
|
3
|
+
/** Optional order ID to set as the active order context for the calculation. */
|
|
3
4
|
orderId?: string;
|
|
4
5
|
}
|
|
5
6
|
export interface CalculateRefundTotalResponse {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CFCustomer } from "../../CommonTypes";
|
|
2
2
|
export interface GetCustomersParams {
|
|
3
|
+
/** MongoDB-like query object. */
|
|
3
4
|
query?: {
|
|
4
5
|
email?: string | {
|
|
5
6
|
$regex?: string;
|
|
@@ -23,7 +24,9 @@ export interface GetCustomersParams {
|
|
|
23
24
|
outletId?: string;
|
|
24
25
|
[key: string]: any;
|
|
25
26
|
};
|
|
27
|
+
/** Defaults to 0. */
|
|
26
28
|
offset?: number;
|
|
29
|
+
/** Defaults to 100. */
|
|
27
30
|
limit?: number;
|
|
28
31
|
}
|
|
29
32
|
export interface GetCustomersResponse {
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import { CFOrder } from "../../CommonTypes";
|
|
2
2
|
export interface GetOrdersParams {
|
|
3
|
+
/** e.g. 'completed', 'parked', 'refunded'. */
|
|
3
4
|
status?: string;
|
|
4
5
|
customerId?: string;
|
|
5
6
|
sessionId?: string;
|
|
7
|
+
/** Default: 50. */
|
|
6
8
|
limit?: number;
|
|
9
|
+
/** Default: 0. */
|
|
7
10
|
offset?: number;
|
|
8
11
|
searchValue?: string;
|
|
12
|
+
/** Default: 'createdAt'. */
|
|
9
13
|
sortBy?: string;
|
|
14
|
+
/** Default: 'descending'. */
|
|
10
15
|
sortDirection?: 'ascending' | 'descending';
|
|
11
16
|
}
|
|
12
17
|
export interface GetOrdersResponse {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { CFProduct } from "../../CommonTypes";
|
|
2
2
|
export interface GetProductsParams {
|
|
3
|
+
/** MongoDB-like query object. */
|
|
3
4
|
query?: {
|
|
4
5
|
name?: string | {
|
|
5
6
|
$regex?: string;
|
|
@@ -21,7 +22,9 @@ export interface GetProductsParams {
|
|
|
21
22
|
externalId?: string;
|
|
22
23
|
[key: string]: any;
|
|
23
24
|
};
|
|
25
|
+
/** Defaults to 0. */
|
|
24
26
|
offset?: number;
|
|
27
|
+
/** Defaults to 100. */
|
|
25
28
|
limit?: number;
|
|
26
29
|
}
|
|
27
30
|
export interface GetProductsResponse {
|
|
@@ -3,9 +3,13 @@ export interface GetRefundsParams {
|
|
|
3
3
|
orderId?: string;
|
|
4
4
|
sessionId?: string;
|
|
5
5
|
outletId?: string;
|
|
6
|
+
/** Default: 50. */
|
|
6
7
|
limit?: number;
|
|
8
|
+
/** Default: 0. */
|
|
7
9
|
offset?: number;
|
|
10
|
+
/** Default: 'createdAt'. */
|
|
8
11
|
sortBy?: string;
|
|
12
|
+
/** Default: 'desc'. */
|
|
9
13
|
sortDirection?: 'asc' | 'desc';
|
|
10
14
|
}
|
|
11
15
|
export interface GetRefundsResponse {
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { CFOrder } from "../../CommonTypes";
|
|
2
2
|
export interface PartialPaymentParams {
|
|
3
|
+
/** The payment amount (required if openUI is false). */
|
|
3
4
|
amount?: number;
|
|
5
|
+
/** Defaults to false. */
|
|
4
6
|
isPercent?: boolean;
|
|
7
|
+
/** If true, opens the split payment UI. */
|
|
5
8
|
openUI?: boolean;
|
|
6
9
|
}
|
|
7
10
|
export interface PartialPaymentResponse {
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
export interface ProcessPartialRefundParams {
|
|
2
|
+
/** Optional refund reason. */
|
|
2
3
|
reason?: string;
|
|
4
|
+
/** Optional: specify which order to refund (sets it as active). */
|
|
3
5
|
orderId?: string;
|
|
6
|
+
/** Optional items to refund. */
|
|
4
7
|
items?: {
|
|
8
|
+
/** internalId or variantId or customSaleId. */
|
|
5
9
|
itemKey: string;
|
|
6
10
|
quantity: number;
|
|
7
11
|
type?: 'product' | 'customSale' | 'fee' | 'tip';
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
export type TriggerWebhookPresetType = 'product' | 'cart' | 'order' | 'customer';
|
|
2
2
|
export interface TriggerWebhookParams {
|
|
3
3
|
webhookUrl: string;
|
|
4
|
+
/** Public key for authentication. */
|
|
4
5
|
publicKey?: string;
|
|
6
|
+
/** Defaults to false. */
|
|
5
7
|
presetData?: boolean;
|
|
6
8
|
presetType?: TriggerWebhookPresetType;
|
|
9
|
+
/** Defaults to false. */
|
|
7
10
|
isCustomHook?: boolean;
|
|
8
11
|
customHookData?: string;
|
|
12
|
+
/** 'json' or 'form-urlencoded'. Defaults to 'json'. */
|
|
9
13
|
payloadType?: string;
|
|
10
14
|
dynamicDataFields?: unknown[];
|
|
11
15
|
}
|