@final-commerce/common 2.12.0 → 2.12.1-preprod.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 +6 -6
- package/bin/gate-done.mjs +13 -26
- package/bin/lib/budget.mjs +1 -1
- package/dist/index.d.mts +295 -2
- package/dist/index.d.ts +295 -2
- package/dist/index.js +367 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +341 -9
- package/dist/index.mjs.map +1 -1
- package/dist/pos-types/index.d.mts +72 -13
- package/dist/pos-types/index.d.ts +72 -13
- package/package.json +1 -1
|
@@ -38,18 +38,6 @@ interface VariantInventory {
|
|
|
38
38
|
outletId: string;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
interface OrderTax {
|
|
42
|
-
name: string;
|
|
43
|
-
taxTableId?: string;
|
|
44
|
-
taxTableName?: string;
|
|
45
|
-
id?: string;
|
|
46
|
-
percentage: number;
|
|
47
|
-
amount: number;
|
|
48
|
-
taxableAmount?: number;
|
|
49
|
-
compounding?: boolean;
|
|
50
|
-
priority?: number;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
41
|
declare enum CurrencyCode {
|
|
54
42
|
USD = "USD",
|
|
55
43
|
EUR = "EUR",
|
|
@@ -332,6 +320,26 @@ declare enum ShippingChannel {
|
|
|
332
320
|
POS = "pos"
|
|
333
321
|
}
|
|
334
322
|
|
|
323
|
+
declare enum TaxSource {
|
|
324
|
+
MERCHANT = "merchant",
|
|
325
|
+
AUTOMATIC = "automatic"
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
interface OrderTax {
|
|
329
|
+
name: string;
|
|
330
|
+
taxTableId?: string;
|
|
331
|
+
taxTableName?: string;
|
|
332
|
+
id?: string;
|
|
333
|
+
percentage: number;
|
|
334
|
+
amount: number;
|
|
335
|
+
taxableAmount?: number;
|
|
336
|
+
compounding?: boolean;
|
|
337
|
+
priority?: number;
|
|
338
|
+
source?: TaxSource | `${TaxSource}`;
|
|
339
|
+
code?: string;
|
|
340
|
+
place?: string;
|
|
341
|
+
}
|
|
342
|
+
|
|
335
343
|
interface OrderShippingLine {
|
|
336
344
|
type: ShippingOptionType | `${ShippingOptionType}`;
|
|
337
345
|
name?: string;
|
|
@@ -340,6 +348,8 @@ interface OrderShippingLine {
|
|
|
340
348
|
optionId?: string;
|
|
341
349
|
minDays?: number;
|
|
342
350
|
maxDays?: number;
|
|
351
|
+
minMinutes?: number;
|
|
352
|
+
maxMinutes?: number;
|
|
343
353
|
pickupOutletId?: string;
|
|
344
354
|
taxes?: OrderTax[];
|
|
345
355
|
}
|
|
@@ -453,6 +463,27 @@ interface OrderCustomStatus {
|
|
|
453
463
|
setBy: string | null;
|
|
454
464
|
}
|
|
455
465
|
|
|
466
|
+
declare enum TaxExceptionSource {
|
|
467
|
+
PRODUCT = "product",
|
|
468
|
+
CATEGORY = "category"
|
|
469
|
+
}
|
|
470
|
+
interface TaxException {
|
|
471
|
+
place: string;
|
|
472
|
+
skip: string[];
|
|
473
|
+
reason?: string;
|
|
474
|
+
setBy?: string;
|
|
475
|
+
setAt?: string;
|
|
476
|
+
}
|
|
477
|
+
interface OrderTaxSkip {
|
|
478
|
+
code: string;
|
|
479
|
+
name: string;
|
|
480
|
+
place: string;
|
|
481
|
+
source: TaxExceptionSource | `${TaxExceptionSource}`;
|
|
482
|
+
label: string;
|
|
483
|
+
categoryId?: string;
|
|
484
|
+
reason?: string;
|
|
485
|
+
}
|
|
486
|
+
|
|
456
487
|
interface OrderLineItemDiscount {
|
|
457
488
|
itemDiscounts?: PriceModifierDetail[];
|
|
458
489
|
cartDiscount?: PriceModifierDetail;
|
|
@@ -529,6 +560,10 @@ interface OrderLineItem {
|
|
|
529
560
|
stockQuantity?: number;
|
|
530
561
|
unitRatioToBase?: number;
|
|
531
562
|
stockVariantId?: string;
|
|
563
|
+
taxType?: string | null;
|
|
564
|
+
taxCategoryIds?: string[];
|
|
565
|
+
taxTableId?: string;
|
|
566
|
+
taxSkipped?: OrderTaxSkip[];
|
|
532
567
|
}
|
|
533
568
|
|
|
534
569
|
interface OrderCustomSaleDiscount {
|
|
@@ -747,6 +782,8 @@ interface Category extends BaseEntity {
|
|
|
747
782
|
parentId?: string;
|
|
748
783
|
menuOrder?: number;
|
|
749
784
|
source?: string;
|
|
785
|
+
taxType?: string | null;
|
|
786
|
+
taxExceptions?: TaxException[] | null;
|
|
750
787
|
}
|
|
751
788
|
|
|
752
789
|
interface CompanyExtension extends BaseEntity {
|
|
@@ -837,6 +874,7 @@ interface Customer extends BaseEntity {
|
|
|
837
874
|
shipping?: Address$1;
|
|
838
875
|
metadata?: Metadata[];
|
|
839
876
|
notes?: Note[];
|
|
877
|
+
verifiedShopperAt?: string;
|
|
840
878
|
}
|
|
841
879
|
|
|
842
880
|
interface DeviceEnvAttribute extends BaseDocument {
|
|
@@ -889,7 +927,7 @@ interface FlowWebApp extends BaseDocument {
|
|
|
889
927
|
}
|
|
890
928
|
|
|
891
929
|
type PaymentState = 'unpaid' | 'payment_pending' | 'partially_paid' | 'paid' | 'partially_refunded' | 'refunded' | 'voided';
|
|
892
|
-
type FulfillmentState = 'draft' | 'pending' | 'on_hold' | 'in_progress' | 'fulfilled' | 'partially_fulfilled' | 'returned' | 'partially_returned' | 'cancelled';
|
|
930
|
+
type FulfillmentState = 'draft' | 'pending' | 'on_hold' | 'in_progress' | 'fulfilled' | 'partially_fulfilled' | 'return_pending' | 'returned' | 'partially_returned' | 'cancelled';
|
|
893
931
|
interface StatePair {
|
|
894
932
|
payment: PaymentState;
|
|
895
933
|
fulfillment: FulfillmentState;
|
|
@@ -1007,6 +1045,7 @@ interface Order extends BaseEntity {
|
|
|
1007
1045
|
completedAt?: string;
|
|
1008
1046
|
customerId?: string;
|
|
1009
1047
|
source: string;
|
|
1048
|
+
contactEmail?: string;
|
|
1010
1049
|
sessionId?: string;
|
|
1011
1050
|
balance: number;
|
|
1012
1051
|
externalId?: string;
|
|
@@ -1030,6 +1069,8 @@ interface Order extends BaseEntity {
|
|
|
1030
1069
|
billing?: Address$1;
|
|
1031
1070
|
shipping?: Address$1;
|
|
1032
1071
|
shippingLine?: OrderShippingLine;
|
|
1072
|
+
taxPlace?: string;
|
|
1073
|
+
taxTableVersion?: string;
|
|
1033
1074
|
lineItems: Partial<OrderLineItem>[];
|
|
1034
1075
|
customSales?: OrderCustomSale[];
|
|
1035
1076
|
nonRevenueItems?: NonRevenueItem$1[];
|
|
@@ -1085,6 +1126,8 @@ interface Product extends BaseEntity {
|
|
|
1085
1126
|
maxPrice?: number;
|
|
1086
1127
|
supplier?: string;
|
|
1087
1128
|
taxTable?: string | null;
|
|
1129
|
+
taxType?: string | null;
|
|
1130
|
+
taxExceptions?: TaxException[] | null;
|
|
1088
1131
|
defaultVariantId?: string;
|
|
1089
1132
|
categories?: string[];
|
|
1090
1133
|
outlets?: string[];
|
|
@@ -1319,6 +1362,9 @@ interface Tax {
|
|
|
1319
1362
|
taxTableId: string;
|
|
1320
1363
|
compounding?: boolean;
|
|
1321
1364
|
priority?: number;
|
|
1365
|
+
source?: TaxSource | `${TaxSource}`;
|
|
1366
|
+
code?: string;
|
|
1367
|
+
place?: string;
|
|
1322
1368
|
}
|
|
1323
1369
|
interface Tip {
|
|
1324
1370
|
amount: number;
|
|
@@ -1574,6 +1620,10 @@ interface LineItem {
|
|
|
1574
1620
|
stockQuantity?: number;
|
|
1575
1621
|
unitRatioToBase?: number;
|
|
1576
1622
|
stockVariantId?: string;
|
|
1623
|
+
taxType?: string | null;
|
|
1624
|
+
taxCategoryIds?: string[];
|
|
1625
|
+
taxTableId?: string;
|
|
1626
|
+
taxSkipped?: OrderTaxSkip[];
|
|
1577
1627
|
}
|
|
1578
1628
|
|
|
1579
1629
|
interface TipPayment {
|
|
@@ -1822,6 +1872,8 @@ interface FullProduct {
|
|
|
1822
1872
|
companyId?: string;
|
|
1823
1873
|
externalId: string;
|
|
1824
1874
|
taxTable: string;
|
|
1875
|
+
taxType?: string | null;
|
|
1876
|
+
taxExceptions?: TaxException[] | null;
|
|
1825
1877
|
name: string;
|
|
1826
1878
|
description?: string;
|
|
1827
1879
|
shortDescription?: string;
|
|
@@ -1938,6 +1990,9 @@ interface ActiveProduct {
|
|
|
1938
1990
|
price: number;
|
|
1939
1991
|
images: string[];
|
|
1940
1992
|
taxTableId: string;
|
|
1993
|
+
taxType?: string | null;
|
|
1994
|
+
taxExceptions?: TaxException[] | null;
|
|
1995
|
+
taxCategoryIds?: string[];
|
|
1941
1996
|
quantity: number;
|
|
1942
1997
|
note?: string;
|
|
1943
1998
|
discounts?: Discount[];
|
|
@@ -1990,6 +2045,8 @@ interface ShippingOptionRule {
|
|
|
1990
2045
|
freeOver?: number | null;
|
|
1991
2046
|
minDays?: number | null;
|
|
1992
2047
|
maxDays?: number | null;
|
|
2048
|
+
minMinutes?: number | null;
|
|
2049
|
+
maxMinutes?: number | null;
|
|
1993
2050
|
channels: (ShippingChannel | `${ShippingChannel}`)[];
|
|
1994
2051
|
outletId?: string | null;
|
|
1995
2052
|
}
|
|
@@ -2014,6 +2071,8 @@ interface CartShipping {
|
|
|
2014
2071
|
taxes?: Tax[];
|
|
2015
2072
|
minDays: number | null;
|
|
2016
2073
|
maxDays: number | null;
|
|
2074
|
+
minMinutes?: number | null;
|
|
2075
|
+
maxMinutes?: number | null;
|
|
2017
2076
|
outletId: string | null;
|
|
2018
2077
|
rule?: Pick<ShippingOptionRule, 'price' | 'priceByTotal' | 'freeOver'>;
|
|
2019
2078
|
}
|
|
@@ -38,18 +38,6 @@ interface VariantInventory {
|
|
|
38
38
|
outletId: string;
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
-
interface OrderTax {
|
|
42
|
-
name: string;
|
|
43
|
-
taxTableId?: string;
|
|
44
|
-
taxTableName?: string;
|
|
45
|
-
id?: string;
|
|
46
|
-
percentage: number;
|
|
47
|
-
amount: number;
|
|
48
|
-
taxableAmount?: number;
|
|
49
|
-
compounding?: boolean;
|
|
50
|
-
priority?: number;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
41
|
declare enum CurrencyCode {
|
|
54
42
|
USD = "USD",
|
|
55
43
|
EUR = "EUR",
|
|
@@ -332,6 +320,26 @@ declare enum ShippingChannel {
|
|
|
332
320
|
POS = "pos"
|
|
333
321
|
}
|
|
334
322
|
|
|
323
|
+
declare enum TaxSource {
|
|
324
|
+
MERCHANT = "merchant",
|
|
325
|
+
AUTOMATIC = "automatic"
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
interface OrderTax {
|
|
329
|
+
name: string;
|
|
330
|
+
taxTableId?: string;
|
|
331
|
+
taxTableName?: string;
|
|
332
|
+
id?: string;
|
|
333
|
+
percentage: number;
|
|
334
|
+
amount: number;
|
|
335
|
+
taxableAmount?: number;
|
|
336
|
+
compounding?: boolean;
|
|
337
|
+
priority?: number;
|
|
338
|
+
source?: TaxSource | `${TaxSource}`;
|
|
339
|
+
code?: string;
|
|
340
|
+
place?: string;
|
|
341
|
+
}
|
|
342
|
+
|
|
335
343
|
interface OrderShippingLine {
|
|
336
344
|
type: ShippingOptionType | `${ShippingOptionType}`;
|
|
337
345
|
name?: string;
|
|
@@ -340,6 +348,8 @@ interface OrderShippingLine {
|
|
|
340
348
|
optionId?: string;
|
|
341
349
|
minDays?: number;
|
|
342
350
|
maxDays?: number;
|
|
351
|
+
minMinutes?: number;
|
|
352
|
+
maxMinutes?: number;
|
|
343
353
|
pickupOutletId?: string;
|
|
344
354
|
taxes?: OrderTax[];
|
|
345
355
|
}
|
|
@@ -453,6 +463,27 @@ interface OrderCustomStatus {
|
|
|
453
463
|
setBy: string | null;
|
|
454
464
|
}
|
|
455
465
|
|
|
466
|
+
declare enum TaxExceptionSource {
|
|
467
|
+
PRODUCT = "product",
|
|
468
|
+
CATEGORY = "category"
|
|
469
|
+
}
|
|
470
|
+
interface TaxException {
|
|
471
|
+
place: string;
|
|
472
|
+
skip: string[];
|
|
473
|
+
reason?: string;
|
|
474
|
+
setBy?: string;
|
|
475
|
+
setAt?: string;
|
|
476
|
+
}
|
|
477
|
+
interface OrderTaxSkip {
|
|
478
|
+
code: string;
|
|
479
|
+
name: string;
|
|
480
|
+
place: string;
|
|
481
|
+
source: TaxExceptionSource | `${TaxExceptionSource}`;
|
|
482
|
+
label: string;
|
|
483
|
+
categoryId?: string;
|
|
484
|
+
reason?: string;
|
|
485
|
+
}
|
|
486
|
+
|
|
456
487
|
interface OrderLineItemDiscount {
|
|
457
488
|
itemDiscounts?: PriceModifierDetail[];
|
|
458
489
|
cartDiscount?: PriceModifierDetail;
|
|
@@ -529,6 +560,10 @@ interface OrderLineItem {
|
|
|
529
560
|
stockQuantity?: number;
|
|
530
561
|
unitRatioToBase?: number;
|
|
531
562
|
stockVariantId?: string;
|
|
563
|
+
taxType?: string | null;
|
|
564
|
+
taxCategoryIds?: string[];
|
|
565
|
+
taxTableId?: string;
|
|
566
|
+
taxSkipped?: OrderTaxSkip[];
|
|
532
567
|
}
|
|
533
568
|
|
|
534
569
|
interface OrderCustomSaleDiscount {
|
|
@@ -747,6 +782,8 @@ interface Category extends BaseEntity {
|
|
|
747
782
|
parentId?: string;
|
|
748
783
|
menuOrder?: number;
|
|
749
784
|
source?: string;
|
|
785
|
+
taxType?: string | null;
|
|
786
|
+
taxExceptions?: TaxException[] | null;
|
|
750
787
|
}
|
|
751
788
|
|
|
752
789
|
interface CompanyExtension extends BaseEntity {
|
|
@@ -837,6 +874,7 @@ interface Customer extends BaseEntity {
|
|
|
837
874
|
shipping?: Address$1;
|
|
838
875
|
metadata?: Metadata[];
|
|
839
876
|
notes?: Note[];
|
|
877
|
+
verifiedShopperAt?: string;
|
|
840
878
|
}
|
|
841
879
|
|
|
842
880
|
interface DeviceEnvAttribute extends BaseDocument {
|
|
@@ -889,7 +927,7 @@ interface FlowWebApp extends BaseDocument {
|
|
|
889
927
|
}
|
|
890
928
|
|
|
891
929
|
type PaymentState = 'unpaid' | 'payment_pending' | 'partially_paid' | 'paid' | 'partially_refunded' | 'refunded' | 'voided';
|
|
892
|
-
type FulfillmentState = 'draft' | 'pending' | 'on_hold' | 'in_progress' | 'fulfilled' | 'partially_fulfilled' | 'returned' | 'partially_returned' | 'cancelled';
|
|
930
|
+
type FulfillmentState = 'draft' | 'pending' | 'on_hold' | 'in_progress' | 'fulfilled' | 'partially_fulfilled' | 'return_pending' | 'returned' | 'partially_returned' | 'cancelled';
|
|
893
931
|
interface StatePair {
|
|
894
932
|
payment: PaymentState;
|
|
895
933
|
fulfillment: FulfillmentState;
|
|
@@ -1007,6 +1045,7 @@ interface Order extends BaseEntity {
|
|
|
1007
1045
|
completedAt?: string;
|
|
1008
1046
|
customerId?: string;
|
|
1009
1047
|
source: string;
|
|
1048
|
+
contactEmail?: string;
|
|
1010
1049
|
sessionId?: string;
|
|
1011
1050
|
balance: number;
|
|
1012
1051
|
externalId?: string;
|
|
@@ -1030,6 +1069,8 @@ interface Order extends BaseEntity {
|
|
|
1030
1069
|
billing?: Address$1;
|
|
1031
1070
|
shipping?: Address$1;
|
|
1032
1071
|
shippingLine?: OrderShippingLine;
|
|
1072
|
+
taxPlace?: string;
|
|
1073
|
+
taxTableVersion?: string;
|
|
1033
1074
|
lineItems: Partial<OrderLineItem>[];
|
|
1034
1075
|
customSales?: OrderCustomSale[];
|
|
1035
1076
|
nonRevenueItems?: NonRevenueItem$1[];
|
|
@@ -1085,6 +1126,8 @@ interface Product extends BaseEntity {
|
|
|
1085
1126
|
maxPrice?: number;
|
|
1086
1127
|
supplier?: string;
|
|
1087
1128
|
taxTable?: string | null;
|
|
1129
|
+
taxType?: string | null;
|
|
1130
|
+
taxExceptions?: TaxException[] | null;
|
|
1088
1131
|
defaultVariantId?: string;
|
|
1089
1132
|
categories?: string[];
|
|
1090
1133
|
outlets?: string[];
|
|
@@ -1319,6 +1362,9 @@ interface Tax {
|
|
|
1319
1362
|
taxTableId: string;
|
|
1320
1363
|
compounding?: boolean;
|
|
1321
1364
|
priority?: number;
|
|
1365
|
+
source?: TaxSource | `${TaxSource}`;
|
|
1366
|
+
code?: string;
|
|
1367
|
+
place?: string;
|
|
1322
1368
|
}
|
|
1323
1369
|
interface Tip {
|
|
1324
1370
|
amount: number;
|
|
@@ -1574,6 +1620,10 @@ interface LineItem {
|
|
|
1574
1620
|
stockQuantity?: number;
|
|
1575
1621
|
unitRatioToBase?: number;
|
|
1576
1622
|
stockVariantId?: string;
|
|
1623
|
+
taxType?: string | null;
|
|
1624
|
+
taxCategoryIds?: string[];
|
|
1625
|
+
taxTableId?: string;
|
|
1626
|
+
taxSkipped?: OrderTaxSkip[];
|
|
1577
1627
|
}
|
|
1578
1628
|
|
|
1579
1629
|
interface TipPayment {
|
|
@@ -1822,6 +1872,8 @@ interface FullProduct {
|
|
|
1822
1872
|
companyId?: string;
|
|
1823
1873
|
externalId: string;
|
|
1824
1874
|
taxTable: string;
|
|
1875
|
+
taxType?: string | null;
|
|
1876
|
+
taxExceptions?: TaxException[] | null;
|
|
1825
1877
|
name: string;
|
|
1826
1878
|
description?: string;
|
|
1827
1879
|
shortDescription?: string;
|
|
@@ -1938,6 +1990,9 @@ interface ActiveProduct {
|
|
|
1938
1990
|
price: number;
|
|
1939
1991
|
images: string[];
|
|
1940
1992
|
taxTableId: string;
|
|
1993
|
+
taxType?: string | null;
|
|
1994
|
+
taxExceptions?: TaxException[] | null;
|
|
1995
|
+
taxCategoryIds?: string[];
|
|
1941
1996
|
quantity: number;
|
|
1942
1997
|
note?: string;
|
|
1943
1998
|
discounts?: Discount[];
|
|
@@ -1990,6 +2045,8 @@ interface ShippingOptionRule {
|
|
|
1990
2045
|
freeOver?: number | null;
|
|
1991
2046
|
minDays?: number | null;
|
|
1992
2047
|
maxDays?: number | null;
|
|
2048
|
+
minMinutes?: number | null;
|
|
2049
|
+
maxMinutes?: number | null;
|
|
1993
2050
|
channels: (ShippingChannel | `${ShippingChannel}`)[];
|
|
1994
2051
|
outletId?: string | null;
|
|
1995
2052
|
}
|
|
@@ -2014,6 +2071,8 @@ interface CartShipping {
|
|
|
2014
2071
|
taxes?: Tax[];
|
|
2015
2072
|
minDays: number | null;
|
|
2016
2073
|
maxDays: number | null;
|
|
2074
|
+
minMinutes?: number | null;
|
|
2075
|
+
maxMinutes?: number | null;
|
|
2017
2076
|
outletId: string | null;
|
|
2018
2077
|
rule?: Pick<ShippingOptionRule, 'price' | 'priceByTotal' | 'freeOver'>;
|
|
2019
2078
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@final-commerce/common",
|
|
3
|
-
"version": "2.12.
|
|
3
|
+
"version": "2.12.1-preprod.1",
|
|
4
4
|
"description": "Shared utilities, types, constants, and engineering governance configs for the Final Commerce platform.",
|
|
5
5
|
"homepage": "https://github.com/Final-Commerce/common#readme",
|
|
6
6
|
"bugs": {
|