@final-commerce/common 2.11.0 → 2.11.1-online.10
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 +20 -0
- package/bin/gate-done.mjs +76 -54
- package/bin/lib/budget.mjs +71 -0
- 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 {
|
|
@@ -724,6 +759,8 @@ interface Category extends BaseEntity {
|
|
|
724
759
|
parentId?: string;
|
|
725
760
|
menuOrder?: number;
|
|
726
761
|
source?: string;
|
|
762
|
+
taxType?: string | null;
|
|
763
|
+
taxExceptions?: TaxException[] | null;
|
|
727
764
|
}
|
|
728
765
|
|
|
729
766
|
interface CompanyExtension extends BaseEntity {
|
|
@@ -814,6 +851,7 @@ interface Customer extends BaseEntity {
|
|
|
814
851
|
shipping?: Address$1;
|
|
815
852
|
metadata?: Metadata[];
|
|
816
853
|
notes?: Note[];
|
|
854
|
+
verifiedShopperAt?: string;
|
|
817
855
|
}
|
|
818
856
|
|
|
819
857
|
interface DeviceEnvAttribute extends BaseDocument {
|
|
@@ -866,7 +904,7 @@ interface FlowWebApp extends BaseDocument {
|
|
|
866
904
|
}
|
|
867
905
|
|
|
868
906
|
type PaymentState = 'unpaid' | 'payment_pending' | 'partially_paid' | 'paid' | 'partially_refunded' | 'refunded' | 'voided';
|
|
869
|
-
type FulfillmentState = 'draft' | 'pending' | 'on_hold' | 'in_progress' | 'fulfilled' | 'partially_fulfilled' | 'returned' | 'partially_returned' | 'cancelled';
|
|
907
|
+
type FulfillmentState = 'draft' | 'pending' | 'on_hold' | 'in_progress' | 'fulfilled' | 'partially_fulfilled' | 'return_pending' | 'returned' | 'partially_returned' | 'cancelled';
|
|
870
908
|
interface StatePair {
|
|
871
909
|
payment: PaymentState;
|
|
872
910
|
fulfillment: FulfillmentState;
|
|
@@ -984,6 +1022,7 @@ interface Order extends BaseEntity {
|
|
|
984
1022
|
completedAt?: string;
|
|
985
1023
|
customerId?: string;
|
|
986
1024
|
source: string;
|
|
1025
|
+
contactEmail?: string;
|
|
987
1026
|
sessionId?: string;
|
|
988
1027
|
balance: number;
|
|
989
1028
|
externalId?: string;
|
|
@@ -1007,6 +1046,8 @@ interface Order extends BaseEntity {
|
|
|
1007
1046
|
billing?: Address$1;
|
|
1008
1047
|
shipping?: Address$1;
|
|
1009
1048
|
shippingLine?: OrderShippingLine;
|
|
1049
|
+
taxPlace?: string;
|
|
1050
|
+
taxTableVersion?: string;
|
|
1010
1051
|
lineItems: Partial<OrderLineItem>[];
|
|
1011
1052
|
customSales?: OrderCustomSale[];
|
|
1012
1053
|
nonRevenueItems?: NonRevenueItem$1[];
|
|
@@ -1061,6 +1102,8 @@ interface Product extends BaseEntity {
|
|
|
1061
1102
|
maxPrice?: number;
|
|
1062
1103
|
supplier?: string;
|
|
1063
1104
|
taxTable?: string | null;
|
|
1105
|
+
taxType?: string | null;
|
|
1106
|
+
taxExceptions?: TaxException[] | null;
|
|
1064
1107
|
defaultVariantId?: string;
|
|
1065
1108
|
categories?: string[];
|
|
1066
1109
|
outlets?: string[];
|
|
@@ -1294,6 +1337,9 @@ interface Tax {
|
|
|
1294
1337
|
taxTableId: string;
|
|
1295
1338
|
compounding?: boolean;
|
|
1296
1339
|
priority?: number;
|
|
1340
|
+
source?: TaxSource | `${TaxSource}`;
|
|
1341
|
+
code?: string;
|
|
1342
|
+
place?: string;
|
|
1297
1343
|
}
|
|
1298
1344
|
interface Tip {
|
|
1299
1345
|
amount: number;
|
|
@@ -1547,6 +1593,10 @@ interface LineItem {
|
|
|
1547
1593
|
stockQuantity?: number;
|
|
1548
1594
|
unitRatioToBase?: number;
|
|
1549
1595
|
stockVariantId?: string;
|
|
1596
|
+
taxType?: string | null;
|
|
1597
|
+
taxCategoryIds?: string[];
|
|
1598
|
+
taxTableId?: string;
|
|
1599
|
+
taxSkipped?: OrderTaxSkip[];
|
|
1550
1600
|
}
|
|
1551
1601
|
|
|
1552
1602
|
interface TipPayment {
|
|
@@ -1795,6 +1845,8 @@ interface FullProduct {
|
|
|
1795
1845
|
companyId?: string;
|
|
1796
1846
|
externalId: string;
|
|
1797
1847
|
taxTable: string;
|
|
1848
|
+
taxType?: string | null;
|
|
1849
|
+
taxExceptions?: TaxException[] | null;
|
|
1798
1850
|
name: string;
|
|
1799
1851
|
description?: string;
|
|
1800
1852
|
shortDescription?: string;
|
|
@@ -1911,6 +1963,9 @@ interface ActiveProduct {
|
|
|
1911
1963
|
price: number;
|
|
1912
1964
|
images: string[];
|
|
1913
1965
|
taxTableId: string;
|
|
1966
|
+
taxType?: string | null;
|
|
1967
|
+
taxExceptions?: TaxException[] | null;
|
|
1968
|
+
taxCategoryIds?: string[];
|
|
1914
1969
|
quantity: number;
|
|
1915
1970
|
note?: string;
|
|
1916
1971
|
discounts?: Discount[];
|
|
@@ -1963,6 +2018,8 @@ interface ShippingOptionRule {
|
|
|
1963
2018
|
freeOver?: number | null;
|
|
1964
2019
|
minDays?: number | null;
|
|
1965
2020
|
maxDays?: number | null;
|
|
2021
|
+
minMinutes?: number | null;
|
|
2022
|
+
maxMinutes?: number | null;
|
|
1966
2023
|
channels: (ShippingChannel | `${ShippingChannel}`)[];
|
|
1967
2024
|
outletId?: string | null;
|
|
1968
2025
|
}
|
|
@@ -1987,6 +2044,8 @@ interface CartShipping {
|
|
|
1987
2044
|
taxes?: Tax[];
|
|
1988
2045
|
minDays: number | null;
|
|
1989
2046
|
maxDays: number | null;
|
|
2047
|
+
minMinutes?: number | null;
|
|
2048
|
+
maxMinutes?: number | null;
|
|
1990
2049
|
outletId: string | null;
|
|
1991
2050
|
rule?: Pick<ShippingOptionRule, 'price' | 'priceByTotal' | 'freeOver'>;
|
|
1992
2051
|
}
|
|
@@ -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 {
|
|
@@ -724,6 +759,8 @@ interface Category extends BaseEntity {
|
|
|
724
759
|
parentId?: string;
|
|
725
760
|
menuOrder?: number;
|
|
726
761
|
source?: string;
|
|
762
|
+
taxType?: string | null;
|
|
763
|
+
taxExceptions?: TaxException[] | null;
|
|
727
764
|
}
|
|
728
765
|
|
|
729
766
|
interface CompanyExtension extends BaseEntity {
|
|
@@ -814,6 +851,7 @@ interface Customer extends BaseEntity {
|
|
|
814
851
|
shipping?: Address$1;
|
|
815
852
|
metadata?: Metadata[];
|
|
816
853
|
notes?: Note[];
|
|
854
|
+
verifiedShopperAt?: string;
|
|
817
855
|
}
|
|
818
856
|
|
|
819
857
|
interface DeviceEnvAttribute extends BaseDocument {
|
|
@@ -866,7 +904,7 @@ interface FlowWebApp extends BaseDocument {
|
|
|
866
904
|
}
|
|
867
905
|
|
|
868
906
|
type PaymentState = 'unpaid' | 'payment_pending' | 'partially_paid' | 'paid' | 'partially_refunded' | 'refunded' | 'voided';
|
|
869
|
-
type FulfillmentState = 'draft' | 'pending' | 'on_hold' | 'in_progress' | 'fulfilled' | 'partially_fulfilled' | 'returned' | 'partially_returned' | 'cancelled';
|
|
907
|
+
type FulfillmentState = 'draft' | 'pending' | 'on_hold' | 'in_progress' | 'fulfilled' | 'partially_fulfilled' | 'return_pending' | 'returned' | 'partially_returned' | 'cancelled';
|
|
870
908
|
interface StatePair {
|
|
871
909
|
payment: PaymentState;
|
|
872
910
|
fulfillment: FulfillmentState;
|
|
@@ -984,6 +1022,7 @@ interface Order extends BaseEntity {
|
|
|
984
1022
|
completedAt?: string;
|
|
985
1023
|
customerId?: string;
|
|
986
1024
|
source: string;
|
|
1025
|
+
contactEmail?: string;
|
|
987
1026
|
sessionId?: string;
|
|
988
1027
|
balance: number;
|
|
989
1028
|
externalId?: string;
|
|
@@ -1007,6 +1046,8 @@ interface Order extends BaseEntity {
|
|
|
1007
1046
|
billing?: Address$1;
|
|
1008
1047
|
shipping?: Address$1;
|
|
1009
1048
|
shippingLine?: OrderShippingLine;
|
|
1049
|
+
taxPlace?: string;
|
|
1050
|
+
taxTableVersion?: string;
|
|
1010
1051
|
lineItems: Partial<OrderLineItem>[];
|
|
1011
1052
|
customSales?: OrderCustomSale[];
|
|
1012
1053
|
nonRevenueItems?: NonRevenueItem$1[];
|
|
@@ -1061,6 +1102,8 @@ interface Product extends BaseEntity {
|
|
|
1061
1102
|
maxPrice?: number;
|
|
1062
1103
|
supplier?: string;
|
|
1063
1104
|
taxTable?: string | null;
|
|
1105
|
+
taxType?: string | null;
|
|
1106
|
+
taxExceptions?: TaxException[] | null;
|
|
1064
1107
|
defaultVariantId?: string;
|
|
1065
1108
|
categories?: string[];
|
|
1066
1109
|
outlets?: string[];
|
|
@@ -1294,6 +1337,9 @@ interface Tax {
|
|
|
1294
1337
|
taxTableId: string;
|
|
1295
1338
|
compounding?: boolean;
|
|
1296
1339
|
priority?: number;
|
|
1340
|
+
source?: TaxSource | `${TaxSource}`;
|
|
1341
|
+
code?: string;
|
|
1342
|
+
place?: string;
|
|
1297
1343
|
}
|
|
1298
1344
|
interface Tip {
|
|
1299
1345
|
amount: number;
|
|
@@ -1547,6 +1593,10 @@ interface LineItem {
|
|
|
1547
1593
|
stockQuantity?: number;
|
|
1548
1594
|
unitRatioToBase?: number;
|
|
1549
1595
|
stockVariantId?: string;
|
|
1596
|
+
taxType?: string | null;
|
|
1597
|
+
taxCategoryIds?: string[];
|
|
1598
|
+
taxTableId?: string;
|
|
1599
|
+
taxSkipped?: OrderTaxSkip[];
|
|
1550
1600
|
}
|
|
1551
1601
|
|
|
1552
1602
|
interface TipPayment {
|
|
@@ -1795,6 +1845,8 @@ interface FullProduct {
|
|
|
1795
1845
|
companyId?: string;
|
|
1796
1846
|
externalId: string;
|
|
1797
1847
|
taxTable: string;
|
|
1848
|
+
taxType?: string | null;
|
|
1849
|
+
taxExceptions?: TaxException[] | null;
|
|
1798
1850
|
name: string;
|
|
1799
1851
|
description?: string;
|
|
1800
1852
|
shortDescription?: string;
|
|
@@ -1911,6 +1963,9 @@ interface ActiveProduct {
|
|
|
1911
1963
|
price: number;
|
|
1912
1964
|
images: string[];
|
|
1913
1965
|
taxTableId: string;
|
|
1966
|
+
taxType?: string | null;
|
|
1967
|
+
taxExceptions?: TaxException[] | null;
|
|
1968
|
+
taxCategoryIds?: string[];
|
|
1914
1969
|
quantity: number;
|
|
1915
1970
|
note?: string;
|
|
1916
1971
|
discounts?: Discount[];
|
|
@@ -1963,6 +2018,8 @@ interface ShippingOptionRule {
|
|
|
1963
2018
|
freeOver?: number | null;
|
|
1964
2019
|
minDays?: number | null;
|
|
1965
2020
|
maxDays?: number | null;
|
|
2021
|
+
minMinutes?: number | null;
|
|
2022
|
+
maxMinutes?: number | null;
|
|
1966
2023
|
channels: (ShippingChannel | `${ShippingChannel}`)[];
|
|
1967
2024
|
outletId?: string | null;
|
|
1968
2025
|
}
|
|
@@ -1987,6 +2044,8 @@ interface CartShipping {
|
|
|
1987
2044
|
taxes?: Tax[];
|
|
1988
2045
|
minDays: number | null;
|
|
1989
2046
|
maxDays: number | null;
|
|
2047
|
+
minMinutes?: number | null;
|
|
2048
|
+
maxMinutes?: number | null;
|
|
1990
2049
|
outletId: string | null;
|
|
1991
2050
|
rule?: Pick<ShippingOptionRule, 'price' | 'priceByTotal' | 'freeOver'>;
|
|
1992
2051
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@final-commerce/common",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.1-online.10",
|
|
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": {
|