@tallyui/core 3.16.0 → 3.18.0
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/index.d.ts +33 -1
- package/package.json +1 -1
- package/src/index.ts +2 -0
- package/src/types/index.ts +1 -1
- package/src/types/store-settings.ts +31 -0
package/dist/index.d.ts
CHANGED
|
@@ -383,6 +383,8 @@ interface StoreSettings {
|
|
|
383
383
|
compound: boolean;
|
|
384
384
|
shipping: boolean;
|
|
385
385
|
}[]>;
|
|
386
|
+
/** Every tax rate the store defines, wherever it applies, for an app's "all tax rates" table (#669). Display only: the cart reads `taxRatesPpm` and `taxRates`, never this. Absent when the connector did not read the list. */
|
|
387
|
+
allTaxRates?: StoreTaxRate[];
|
|
386
388
|
taxRoundAtSubtotal?: boolean;
|
|
387
389
|
/** WooCommerce's calculate coupon discounts sequentially setting. */
|
|
388
390
|
calcDiscountsSequentially?: boolean;
|
|
@@ -393,6 +395,36 @@ interface StoreSettings {
|
|
|
393
395
|
/** Derived, never read by `storeSettings`: the store's `ServerCapabilities.taxRounding`, which `useStoreSettings` fills in (#324). */
|
|
394
396
|
taxRounding?: TaxRounding;
|
|
395
397
|
}
|
|
398
|
+
/** Where a tax rate applies, in the backend's own terms. A missing field means any; a backend fills only what it has (WooCommerce: country, state as `region`, postcodes, cities). */
|
|
399
|
+
interface StoreTaxRateLocation {
|
|
400
|
+
/** ISO 3166-1 alpha-2, as the backend stores it. */
|
|
401
|
+
country?: string;
|
|
402
|
+
/** State or province code. */
|
|
403
|
+
region?: string;
|
|
404
|
+
/** Codes or patterns, as the backend stores them. */
|
|
405
|
+
postcodes?: string[];
|
|
406
|
+
cities?: string[];
|
|
407
|
+
/** The backend's named tax zone, for a backend that groups its rates by zone. */
|
|
408
|
+
zone?: {
|
|
409
|
+
id: string;
|
|
410
|
+
name: string;
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
/** One of the store's tax rates as the backend defines it. The optional fields are set by a backend that has them. */
|
|
414
|
+
interface StoreTaxRate {
|
|
415
|
+
/** The backend's id, as a string. */
|
|
416
|
+
id: string;
|
|
417
|
+
name: string;
|
|
418
|
+
/** Percent as a decimal string, as the backend sends it ("7.2500"). */
|
|
419
|
+
rate: string;
|
|
420
|
+
location: StoreTaxRateLocation;
|
|
421
|
+
/** The backend's tax class or category key, as `taxClassSlugs` and `taxRates` key it. */
|
|
422
|
+
taxClass?: string;
|
|
423
|
+
priority?: number;
|
|
424
|
+
compound?: boolean;
|
|
425
|
+
/** Whether the rate also applies to shipping. */
|
|
426
|
+
shipping?: boolean;
|
|
427
|
+
}
|
|
396
428
|
/**
|
|
397
429
|
* Picks among several regions, countries or sales channels when the store has more than one.
|
|
398
430
|
* The app persists the choice per store, in its own settings, so it is asked once. A stored
|
|
@@ -1909,4 +1941,4 @@ declare namespace index {
|
|
|
1909
1941
|
export { type index_CouponContext as CouponContext, type index_CouponDiscountConfig as CouponDiscountConfig, type index_CouponInput as CouponInput, type index_CouponLineInput as CouponLineInput, type index_CouponRejection as CouponRejection, type index_CouponRejectionCode as CouponRejectionCode, type index_CouponValidationContext as CouponValidationContext, type index_EngineWarning as EngineWarning, type index_LineItemInput as LineItemInput, type index_OrderTotals as OrderTotals, type index_RecalculateInput as RecalculateInput, type index_RecalculateResult as RecalculateResult, type index_TaxRateInput as TaxRateInput, type index_ValidationResult as ValidationResult, index_calculateOrderTotals as calculateOrderTotals, index_enrichCategoriesWithAncestors as enrichCategoriesWithAncestors, index_recalculateCoupons as recalculateCoupons, index_toCouponConfigs as toCouponConfigs, index_validateCoupon as validateCoupon };
|
|
1910
1942
|
}
|
|
1911
1943
|
|
|
1912
|
-
export { type AuthField, CASHIER_PERMISSIONS, type CaptureMode, type CaptureModeEntry, type Cashier, type CashierPermission, type CatalogueReconcileAdapter, type CatalogueReconcileEntry, type CollectionSync, CommandWarning, type ConnectivityState, type ConnectorAuth, ConnectorProvider, type ConnectorProviderProps, type ConnectorSchemas, type ConnectorTraits, ConnectorUnauthorizedError, type Customer, type CustomerAddress, type CustomerInput, type CustomerPatch, CustomerServiceError, type CustomerTaxId, type CustomerTraits, type ErrorKind, type FailureClass, type FingerprintReconcileAdapter, type IdReconcileAdapter, type KeyedReconcileFeedOptions, type ListOrdersQuery, type Money, type PaymentHardware, type PaymentKind, type PaymentMethodDescriptor, PaymentMethodKind, type PaymentOfflineMode, type PaymentRounding, type PaymentTipsMode, type PaymentTransport, type ProductCategory, type ProductPrice, type ProductTraits, type ReconcileFeed, type ReconcileFeedEntry, type ReconcileFetchEntry, type RegisterInfo, type RemoteIdEntry, type ReplicationAdapter, type ResolvedPrice, STOCK_LEVELS_LAST_PASS, type ServerCapabilities, SignInError, type SignInErrorCode, type SignInResult, type StockLevel, type StockReconcileAdapter, type StockStatus, type StoreOrder, type StoreOrderCharge, type StoreOrderLine, type StoreOrderPage, type StoreOrderPayment, type StoreOrderRefund, type StoreSettings, type StoreSettingsChoice, type StoreSettingsChoices, StoreSettingsError, type StoreSettingsErrorCode, type SyncContext, type SyncNotice, type TallyConnector, type TaxRounding, type TraitContext, type UpdateRequired, type VariantOptionGroup, type VariantSummary, cashierPermissions, classifyFailure, combinePullAdapters, compareIds, createReconcileFeed, currencySymbol, customerTraits, defaultPaymentMethods, errorKind, findVariantByCode, formatMoney, getProductStock, isCashierPermission, isRxdbRemoteVersionMismatch, knownWarnings, minorUnitDigits, moneyFromDecimalString, moneyFromMajor, moneyToMajor, neutralFailureClass, noResponse, parseInfoCapabilities, parseLineTax, parseTaxRounding, paymentMethodOf, resolveCapabilities, resolvePrice, resolvePriceRange, useConnector, useCustomerTraits, useProductStock, useProductTraits, useStockOverlaid, useStockOverlayAsOf, useTraitContext, withStockOverlay, index as woocommerceCoupons, index$1 as woocommerceTax };
|
|
1944
|
+
export { type AuthField, CASHIER_PERMISSIONS, type CaptureMode, type CaptureModeEntry, type Cashier, type CashierPermission, type CatalogueReconcileAdapter, type CatalogueReconcileEntry, type CollectionSync, CommandWarning, type ConnectivityState, type ConnectorAuth, ConnectorProvider, type ConnectorProviderProps, type ConnectorSchemas, type ConnectorTraits, ConnectorUnauthorizedError, type Customer, type CustomerAddress, type CustomerInput, type CustomerPatch, CustomerServiceError, type CustomerTaxId, type CustomerTraits, type ErrorKind, type FailureClass, type FingerprintReconcileAdapter, type IdReconcileAdapter, type KeyedReconcileFeedOptions, type ListOrdersQuery, type Money, type PaymentHardware, type PaymentKind, type PaymentMethodDescriptor, PaymentMethodKind, type PaymentOfflineMode, type PaymentRounding, type PaymentTipsMode, type PaymentTransport, type ProductCategory, type ProductPrice, type ProductTraits, type ReconcileFeed, type ReconcileFeedEntry, type ReconcileFetchEntry, type RegisterInfo, type RemoteIdEntry, type ReplicationAdapter, type ResolvedPrice, STOCK_LEVELS_LAST_PASS, type ServerCapabilities, SignInError, type SignInErrorCode, type SignInResult, type StockLevel, type StockReconcileAdapter, type StockStatus, type StoreOrder, type StoreOrderCharge, type StoreOrderLine, type StoreOrderPage, type StoreOrderPayment, type StoreOrderRefund, type StoreSettings, type StoreSettingsChoice, type StoreSettingsChoices, StoreSettingsError, type StoreSettingsErrorCode, type StoreTaxRate, type StoreTaxRateLocation, type SyncContext, type SyncNotice, type TallyConnector, type TaxRounding, type TraitContext, type UpdateRequired, type VariantOptionGroup, type VariantSummary, cashierPermissions, classifyFailure, combinePullAdapters, compareIds, createReconcileFeed, currencySymbol, customerTraits, defaultPaymentMethods, errorKind, findVariantByCode, formatMoney, getProductStock, isCashierPermission, isRxdbRemoteVersionMismatch, knownWarnings, minorUnitDigits, moneyFromDecimalString, moneyFromMajor, moneyToMajor, neutralFailureClass, noResponse, parseInfoCapabilities, parseLineTax, parseTaxRounding, paymentMethodOf, resolveCapabilities, resolvePrice, resolvePriceRange, useConnector, useCustomerTraits, useProductStock, useProductTraits, useStockOverlaid, useStockOverlayAsOf, useTraitContext, withStockOverlay, index as woocommerceCoupons, index$1 as woocommerceTax };
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -25,6 +25,8 @@ export type {
|
|
|
25
25
|
StockStatus,
|
|
26
26
|
StoreSettings,
|
|
27
27
|
StoreSettingsChoice,
|
|
28
|
+
StoreTaxRate,
|
|
29
|
+
StoreTaxRateLocation,
|
|
28
30
|
} from './types';
|
|
29
31
|
export type { SignInResult, ServerCapabilities, TaxRounding } from './types/connector';
|
|
30
32
|
export type { CatalogueReconcileAdapter, CatalogueReconcileEntry } from './types/reconcile';
|
package/src/types/index.ts
CHANGED
|
@@ -13,7 +13,7 @@ export type { ReplicationAdapter } from './replication';
|
|
|
13
13
|
|
|
14
14
|
export type { FingerprintReconcileAdapter, IdReconcileAdapter, StockReconcileAdapter } from './reconcile';
|
|
15
15
|
|
|
16
|
-
export type { StoreSettings, StoreSettingsChoice } from './store-settings';
|
|
16
|
+
export type { StoreSettings, StoreSettingsChoice, StoreTaxRate, StoreTaxRateLocation } from './store-settings';
|
|
17
17
|
|
|
18
18
|
export type { ProductTraits, TraitContext, VariantSummary, VariantOptionGroup, ProductCategory } from './traits/product';
|
|
19
19
|
|
|
@@ -12,6 +12,8 @@ export interface StoreSettings {
|
|
|
12
12
|
taxRateCodes?: Record<string, string>;
|
|
13
13
|
/** WooCommerce rates already filtered to the store's tax address; the empty class uses `standard`. */
|
|
14
14
|
taxRates?: Record<string, { id: number; code: string; label: string; rate: string; priority: number; compound: boolean; shipping: boolean }[]>;
|
|
15
|
+
/** Every tax rate the store defines, wherever it applies, for an app's "all tax rates" table (#669). Display only: the cart reads `taxRatesPpm` and `taxRates`, never this. Absent when the connector did not read the list. */
|
|
16
|
+
allTaxRates?: StoreTaxRate[];
|
|
15
17
|
taxRoundAtSubtotal?: boolean;
|
|
16
18
|
/** WooCommerce's calculate coupon discounts sequentially setting. */
|
|
17
19
|
calcDiscountsSequentially?: boolean;
|
|
@@ -23,6 +25,35 @@ export interface StoreSettings {
|
|
|
23
25
|
taxRounding?: TaxRounding;
|
|
24
26
|
}
|
|
25
27
|
|
|
28
|
+
/** Where a tax rate applies, in the backend's own terms. A missing field means any; a backend fills only what it has (WooCommerce: country, state as `region`, postcodes, cities). */
|
|
29
|
+
export interface StoreTaxRateLocation {
|
|
30
|
+
/** ISO 3166-1 alpha-2, as the backend stores it. */
|
|
31
|
+
country?: string;
|
|
32
|
+
/** State or province code. */
|
|
33
|
+
region?: string;
|
|
34
|
+
/** Codes or patterns, as the backend stores them. */
|
|
35
|
+
postcodes?: string[];
|
|
36
|
+
cities?: string[];
|
|
37
|
+
/** The backend's named tax zone, for a backend that groups its rates by zone. */
|
|
38
|
+
zone?: { id: string; name: string };
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** One of the store's tax rates as the backend defines it. The optional fields are set by a backend that has them. */
|
|
42
|
+
export interface StoreTaxRate {
|
|
43
|
+
/** The backend's id, as a string. */
|
|
44
|
+
id: string;
|
|
45
|
+
name: string;
|
|
46
|
+
/** Percent as a decimal string, as the backend sends it ("7.2500"). */
|
|
47
|
+
rate: string;
|
|
48
|
+
location: StoreTaxRateLocation;
|
|
49
|
+
/** The backend's tax class or category key, as `taxClassSlugs` and `taxRates` key it. */
|
|
50
|
+
taxClass?: string;
|
|
51
|
+
priority?: number;
|
|
52
|
+
compound?: boolean;
|
|
53
|
+
/** Whether the rate also applies to shipping. */
|
|
54
|
+
shipping?: boolean;
|
|
55
|
+
}
|
|
56
|
+
|
|
26
57
|
/**
|
|
27
58
|
* Picks among several regions, countries or sales channels when the store has more than one.
|
|
28
59
|
* The app persists the choice per store, in its own settings, so it is asked once. A stored
|