@commercejs/types 0.1.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.
Files changed (105) hide show
  1. package/dist/adapter.d.ts +310 -0
  2. package/dist/adapter.d.ts.map +1 -0
  3. package/dist/adapter.js +12 -0
  4. package/dist/adapter.js.map +1 -0
  5. package/dist/auction.d.ts +59 -0
  6. package/dist/auction.d.ts.map +1 -0
  7. package/dist/auction.js +5 -0
  8. package/dist/auction.js.map +1 -0
  9. package/dist/brand.d.ts +16 -0
  10. package/dist/brand.d.ts.map +1 -0
  11. package/dist/brand.js +5 -0
  12. package/dist/brand.js.map +1 -0
  13. package/dist/cart.d.ts +42 -0
  14. package/dist/cart.d.ts.map +1 -0
  15. package/dist/cart.js +5 -0
  16. package/dist/cart.js.map +1 -0
  17. package/dist/category.d.ts +13 -0
  18. package/dist/category.d.ts.map +1 -0
  19. package/dist/category.js +5 -0
  20. package/dist/category.js.map +1 -0
  21. package/dist/common.d.ts +81 -0
  22. package/dist/common.d.ts.map +1 -0
  23. package/dist/common.js +27 -0
  24. package/dist/common.js.map +1 -0
  25. package/dist/country.d.ts +16 -0
  26. package/dist/country.d.ts.map +1 -0
  27. package/dist/country.js +5 -0
  28. package/dist/country.js.map +1 -0
  29. package/dist/customer.d.ts +48 -0
  30. package/dist/customer.d.ts.map +1 -0
  31. package/dist/customer.js +5 -0
  32. package/dist/customer.js.map +1 -0
  33. package/dist/gift-card.d.ts +64 -0
  34. package/dist/gift-card.d.ts.map +1 -0
  35. package/dist/gift-card.js +5 -0
  36. package/dist/gift-card.js.map +1 -0
  37. package/dist/index.d.ts +27 -0
  38. package/dist/index.d.ts.map +1 -0
  39. package/dist/index.js +6 -0
  40. package/dist/index.js.map +1 -0
  41. package/dist/location.d.ts +56 -0
  42. package/dist/location.d.ts.map +1 -0
  43. package/dist/location.js +5 -0
  44. package/dist/location.js.map +1 -0
  45. package/dist/order-input.d.ts +46 -0
  46. package/dist/order-input.d.ts.map +1 -0
  47. package/dist/order-input.js +9 -0
  48. package/dist/order-input.js.map +1 -0
  49. package/dist/order-status.d.ts +55 -0
  50. package/dist/order-status.d.ts.map +1 -0
  51. package/dist/order-status.js +5 -0
  52. package/dist/order-status.js.map +1 -0
  53. package/dist/order.d.ts +62 -0
  54. package/dist/order.d.ts.map +1 -0
  55. package/dist/order.js +5 -0
  56. package/dist/order.js.map +1 -0
  57. package/dist/payment-provider.d.ts +117 -0
  58. package/dist/payment-provider.d.ts.map +1 -0
  59. package/dist/payment-provider.js +10 -0
  60. package/dist/payment-provider.js.map +1 -0
  61. package/dist/payment.d.ts +22 -0
  62. package/dist/payment.d.ts.map +1 -0
  63. package/dist/payment.js +5 -0
  64. package/dist/payment.js.map +1 -0
  65. package/dist/product.d.ts +162 -0
  66. package/dist/product.d.ts.map +1 -0
  67. package/dist/product.js +5 -0
  68. package/dist/product.js.map +1 -0
  69. package/dist/promotion.d.ts +65 -0
  70. package/dist/promotion.d.ts.map +1 -0
  71. package/dist/promotion.js +5 -0
  72. package/dist/promotion.js.map +1 -0
  73. package/dist/rental.d.ts +84 -0
  74. package/dist/rental.d.ts.map +1 -0
  75. package/dist/rental.js +5 -0
  76. package/dist/rental.js.map +1 -0
  77. package/dist/return.d.ts +64 -0
  78. package/dist/return.d.ts.map +1 -0
  79. package/dist/return.js +5 -0
  80. package/dist/return.js.map +1 -0
  81. package/dist/review.d.ts +31 -0
  82. package/dist/review.d.ts.map +1 -0
  83. package/dist/review.js +5 -0
  84. package/dist/review.js.map +1 -0
  85. package/dist/search.d.ts +38 -0
  86. package/dist/search.d.ts.map +1 -0
  87. package/dist/search.js +5 -0
  88. package/dist/search.js.map +1 -0
  89. package/dist/shipping.d.ts +17 -0
  90. package/dist/shipping.d.ts.map +1 -0
  91. package/dist/shipping.js +5 -0
  92. package/dist/shipping.js.map +1 -0
  93. package/dist/store.d.ts +36 -0
  94. package/dist/store.d.ts.map +1 -0
  95. package/dist/store.js +5 -0
  96. package/dist/store.js.map +1 -0
  97. package/dist/wholesale.d.ts +89 -0
  98. package/dist/wholesale.d.ts.map +1 -0
  99. package/dist/wholesale.js +5 -0
  100. package/dist/wholesale.js.map +1 -0
  101. package/dist/wishlist.d.ts +18 -0
  102. package/dist/wishlist.d.ts.map +1 -0
  103. package/dist/wishlist.js +5 -0
  104. package/dist/wishlist.js.map +1 -0
  105. package/package.json +27 -0
package/dist/common.js ADDED
@@ -0,0 +1,27 @@
1
+ // ---------------------------------------------------------------------------
2
+ // Common primitives used across all domain types
3
+ // ---------------------------------------------------------------------------
4
+ /**
5
+ * Typed error class for all commerce operations.
6
+ * Adapters must throw CommerceError (not raw errors)
7
+ * so consumers can handle failures in a typed, platform-agnostic way.
8
+ */
9
+ export class CommerceError extends Error {
10
+ code;
11
+ statusCode;
12
+ cause;
13
+ name = 'CommerceError';
14
+ constructor(message, code, statusCode, cause) {
15
+ super(message);
16
+ this.code = code;
17
+ this.statusCode = statusCode;
18
+ this.cause = cause;
19
+ // Restore prototype chain for instanceof checks after transpilation
20
+ Object.setPrototypeOf(this, new.target.prototype);
21
+ }
22
+ }
23
+ /** Type guard — narrows unknown errors to CommerceError */
24
+ export function isCommerceError(err) {
25
+ return err instanceof CommerceError;
26
+ }
27
+ //# sourceMappingURL=common.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.js","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,iDAAiD;AACjD,8EAA8E;AAwF9E;;;;GAIG;AACH,MAAM,OAAO,aAAc,SAAQ,KAAK;IAKpB;IACA;IACA;IANF,IAAI,GAAG,eAAe,CAAA;IAEtC,YACE,OAAe,EACC,IAAuB,EACvB,UAAmB,EACnB,KAAe;QAE/B,KAAK,CAAC,OAAO,CAAC,CAAA;QAJE,SAAI,GAAJ,IAAI,CAAmB;QACvB,eAAU,GAAV,UAAU,CAAS;QACnB,UAAK,GAAL,KAAK,CAAU;QAG/B,oEAAoE;QACpE,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;IACnD,CAAC;CACF;AAED,2DAA2D;AAC3D,MAAM,UAAU,eAAe,CAAC,GAAY;IAC1C,OAAO,GAAG,YAAY,aAAa,CAAA;AACrC,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { Id, LocalizedString, Maybe } from './common.js';
2
+ /** A country supported by the store */
3
+ export interface Country {
4
+ id: Id;
5
+ /** ISO 3166-1 alpha-2 code (e.g., "SA", "AE") */
6
+ code: string;
7
+ /** Display name */
8
+ name: LocalizedString;
9
+ /** Phone calling code (e.g., "+966") */
10
+ callingCode: Maybe<string>;
11
+ /** Default currency code (e.g., "SAR") */
12
+ currency: Maybe<string>;
13
+ /** Capital city name */
14
+ capital: Maybe<string>;
15
+ }
16
+ //# sourceMappingURL=country.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"country.d.ts","sourceRoot":"","sources":["../src/country.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAE7D,uCAAuC;AACvC,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,EAAE,CAAA;IACN,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAA;IACZ,mBAAmB;IACnB,IAAI,EAAE,eAAe,CAAA;IACrB,wCAAwC;IACxC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IAC1B,0CAA0C;IAC1C,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IACvB,wBAAwB;IACxB,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CACvB"}
@@ -0,0 +1,5 @@
1
+ // ---------------------------------------------------------------------------
2
+ // Country types — for address forms and locale resolution
3
+ // ---------------------------------------------------------------------------
4
+ export {};
5
+ //# sourceMappingURL=country.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"country.js","sourceRoot":"","sources":["../src/country.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,0DAA0D;AAC1D,8EAA8E"}
@@ -0,0 +1,48 @@
1
+ import type { Id, Maybe, DeepPartial } from './common.js';
2
+ /** Physical address — includes GCC-specific fields */
3
+ export interface Address {
4
+ id: Id;
5
+ firstName: string;
6
+ lastName: string;
7
+ phone: Maybe<string>;
8
+ street: string;
9
+ /** Additional street line (apartment, floor, etc.) */
10
+ street2: Maybe<string>;
11
+ city: string;
12
+ state: Maybe<string>;
13
+ country: string;
14
+ postalCode: Maybe<string>;
15
+ /** حي — neighborhood/district (common in Saudi addresses) */
16
+ district: Maybe<string>;
17
+ /** العنوان الوطني — Saudi National Address */
18
+ nationalAddress: Maybe<string>;
19
+ /** الرقم الإضافي — Saudi additional number */
20
+ additionalNumber: Maybe<string>;
21
+ isDefault: boolean;
22
+ }
23
+ /** Customer entity */
24
+ export interface Customer {
25
+ id: Id;
26
+ email: string;
27
+ firstName: Maybe<string>;
28
+ lastName: Maybe<string>;
29
+ phone: Maybe<string>;
30
+ addresses: Address[];
31
+ defaultAddressId: Maybe<Id>;
32
+ createdAt: string;
33
+ updatedAt: string;
34
+ }
35
+ /** Input for customer registration */
36
+ export interface RegisterInput {
37
+ email: string;
38
+ password: string;
39
+ firstName?: string;
40
+ lastName?: string;
41
+ phone?: string;
42
+ }
43
+ /**
44
+ * Input for updating customer profile.
45
+ * Uses DeepPartial to allow nested partial updates (e.g., updating a single address field).
46
+ */
47
+ export type UpdateCustomerInput = DeepPartial<Omit<Customer, 'id' | 'createdAt' | 'updatedAt'>>;
48
+ //# sourceMappingURL=customer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customer.d.ts","sourceRoot":"","sources":["../src/customer.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAEzD,sDAAsD;AACtD,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,EA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AAM,mBAAmB,GAAG,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,GAAG,WAAW,GAAG,WAAW,CAAC,CAAC,CAAA"}
@@ -0,0 +1,5 @@
1
+ // ---------------------------------------------------------------------------
2
+ // Customer domain types
3
+ // ---------------------------------------------------------------------------
4
+ export {};
5
+ //# sourceMappingURL=customer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customer.js","sourceRoot":"","sources":["../src/customer.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,wBAAwB;AACxB,8EAA8E"}
@@ -0,0 +1,64 @@
1
+ import type { Id, LocalizedString, Maybe, Price } from './common.js';
2
+ /** Gift card status */
3
+ export type GiftCardStatus = 'active' | 'inactive' | 'redeemed' | 'expired' | 'cancelled';
4
+ /** A gift card entity */
5
+ export interface GiftCard {
6
+ id: Id;
7
+ /** Unique gift card code */
8
+ code: string;
9
+ status: GiftCardStatus;
10
+ /** Original loaded amount */
11
+ initialBalance: Price;
12
+ /** Current remaining balance */
13
+ currentBalance: Price;
14
+ /** Currency code (gift cards are currency-specific) */
15
+ currency: string;
16
+ /** Recipient name */
17
+ recipientName: Maybe<string>;
18
+ /** Recipient email */
19
+ recipientEmail: Maybe<string>;
20
+ /** Sender name */
21
+ senderName: Maybe<string>;
22
+ /** Personal message from sender */
23
+ message: Maybe<LocalizedString>;
24
+ /** Expiry date (ISO 8601, null = never expires) */
25
+ expiresAt: Maybe<string>;
26
+ /** Whether this is a digital (emailed) or physical card */
27
+ isDigital: boolean;
28
+ createdAt: string;
29
+ }
30
+ /** Transaction on a gift card */
31
+ export interface GiftCardTransaction {
32
+ id: Id;
33
+ giftCardId: Id;
34
+ /** Positive = credit (load), Negative = debit (redemption) */
35
+ amount: Price;
36
+ /** Balance after this transaction */
37
+ balanceAfter: Price;
38
+ /** Transaction type */
39
+ type: 'load' | 'redemption' | 'refund' | 'expiry';
40
+ /** Related order ID (for redemptions) */
41
+ orderId: Maybe<Id>;
42
+ createdAt: string;
43
+ }
44
+ /** Input for purchasing a gift card */
45
+ export interface PurchaseGiftCardInput {
46
+ /** Amount to load */
47
+ amount: number;
48
+ currency: string;
49
+ /** Recipient details (for sending as a gift) */
50
+ recipientEmail?: string;
51
+ recipientName?: string;
52
+ senderName?: string;
53
+ message?: string;
54
+ /** Whether to send a digital card via email */
55
+ isDigital?: boolean;
56
+ }
57
+ /** Input for redeeming a gift card at checkout */
58
+ export interface RedeemGiftCardInput {
59
+ /** Gift card code */
60
+ code: string;
61
+ /** Amount to apply (null = apply full balance) */
62
+ amount?: number;
63
+ }
64
+ //# sourceMappingURL=gift-card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gift-card.d.ts","sourceRoot":"","sources":["../src/gift-card.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAEpE,uBAAuB;AACvB,MAAM,MAAM,cAAc,GACtB,QAAQ,GACR,UAAU,GACV,UAAU,GACV,SAAS,GACT,WAAW,CAAA;AAEf,yBAAyB;AACzB,MAAM,WAAW,QAAQ;IACvB,EAAE,EAAE,EAAE,CAAA;IACN,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,cAAc,CAAA;IACtB,6BAA6B;IAC7B,cAAc,EAAE,KAAK,CAAA;IACrB,gCAAgC;IAChC,cAAc,EAAE,KAAK,CAAA;IACrB,uDAAuD;IACvD,QAAQ,EAAE,MAAM,CAAA;IAChB,qBAAqB;IACrB,aAAa,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IAC5B,sBAAsB;IACtB,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IAC7B,kBAAkB;IAClB,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IACzB,mCAAmC;IACnC,OAAO,EAAE,KAAK,CAAC,eAAe,CAAC,CAAA;IAC/B,mDAAmD;IACnD,SAAS,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IACxB,2DAA2D;IAC3D,SAAS,EAAE,OAAO,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,iCAAiC;AACjC,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,EAAE,CAAA;IACN,UAAU,EAAE,EAAE,CAAA;IACd,8DAA8D;IAC9D,MAAM,EAAE,KAAK,CAAA;IACb,qCAAqC;IACrC,YAAY,EAAE,KAAK,CAAA;IACnB,uBAAuB;IACvB,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,QAAQ,GAAG,QAAQ,CAAA;IACjD,yCAAyC;IACzC,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED,uCAAuC;AACvC,MAAM,WAAW,qBAAqB;IACpC,qBAAqB;IACrB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,gDAAgD;IAChD,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,+CAA+C;IAC/C,SAAS,CAAC,EAAE,OAAO,CAAA;CACpB;AAED,kDAAkD;AAClD,MAAM,WAAW,mBAAmB;IAClC,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,kDAAkD;IAClD,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB"}
@@ -0,0 +1,5 @@
1
+ // ---------------------------------------------------------------------------
2
+ // Gift card types
3
+ // ---------------------------------------------------------------------------
4
+ export {};
5
+ //# sourceMappingURL=gift-card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gift-card.js","sourceRoot":"","sources":["../src/gift-card.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,kBAAkB;AAClB,8EAA8E"}
@@ -0,0 +1,27 @@
1
+ export type { Maybe, Id, LocalizedString, PaginatedResult, PaginationParams, Price, DiscountablePrice, Image, DeepPartial, CommerceErrorCode, TaxStrategy } from './common.js';
2
+ export { CommerceError, isCommerceError } from './common.js';
3
+ export type { Product, ProductVariant, ProductOption, Attribute, ProductType, DigitalProductMeta, ServiceProductMeta, EventProductMeta, SubscriptionProductMeta, PreOrderMeta } from './product.js';
4
+ export type { Category } from './category.js';
5
+ export type { Brand } from './brand.js';
6
+ export type { Cart, CartItem, CartTotals } from './cart.js';
7
+ export type { Customer, Address, RegisterInput, UpdateCustomerInput } from './customer.js';
8
+ export type { Order, OrderItem, OrderStatus, FulfillmentStatus } from './order.js';
9
+ export type { CreateOrderInput, OrderItemInput } from './order-input.js';
10
+ export type { OrderStatusInfo, OrderHistoryEntry, UpdateOrderStatusInput } from './order-status.js';
11
+ export type { ShippingMethod, ShippingProvider } from './shipping.js';
12
+ export type { PaymentMethod, PaymentType, Installment } from './payment.js';
13
+ export type { PaymentProvider, PaymentSession, PaymentSessionStatus, CreatePaymentSessionInput, RefundInput, PaymentWebhookEvent, } from './payment-provider.js';
14
+ export type { SearchParams, SearchResult, Facet, FacetValue, SortOption, SortDirection } from './search.js';
15
+ export type { Wishlist, WishlistItem } from './wishlist.js';
16
+ export type { Review, ReviewInput, ReviewSummary } from './review.js';
17
+ export type { StoreInfo, StoreCurrency, StoreLocale } from './store.js';
18
+ export type { Country } from './country.js';
19
+ export type { StoreLocation, Coordinates, LocationContact, WorkingHoursEntry } from './location.js';
20
+ export type { Promotion, Coupon, DiscountType, PromotionTarget, PromotionCondition } from './promotion.js';
21
+ export type { ReturnRequest, ReturnItem, CreateReturnInput, ReturnReason, ReturnStatus, RefundMethod } from './return.js';
22
+ export type { PriceTier, CustomerGroup, CustomerGroupPrice, QuoteRequest, QuoteLineItem, QuoteStatus, CreateQuoteInput, PaymentTerms, PaymentTermsType } from './wholesale.js';
23
+ export type { AuctionProductMeta, AuctionType, AuctionStatus, Bid, PlaceBidInput } from './auction.js';
24
+ export type { RentalProductMeta, RentalPricingUnit, RentalPricingTier, AvailabilitySlot, RentalBooking, RentalBookingStatus, CreateRentalBookingInput } from './rental.js';
25
+ export type { GiftCard, GiftCardStatus, GiftCardTransaction, PurchaseGiftCardInput, RedeemGiftCardInput } from './gift-card.js';
26
+ export type { CommerceAdapter, CatalogAdapter, CartAdapter, CheckoutAdapter, CustomerAdapter, OrderAdapter, WishlistAdapter, ReviewAdapter, StoreAdapter, PromotionAdapter, ReturnAdapter, WholesaleAdapter, AuctionAdapter, RentalAdapter, GiftCardAdapter, BrandAdapter, CountryAdapter, LocationAdapter, GetProductParams, GetCategoriesParams, AddToCartInput, AdapterDomain, } from './adapter.js';
27
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,YAAY,EAAE,KAAK,EAAE,EAAE,EAAE,eAAe,EAAE,eAAe,EAAE,gBAAgB,EAAE,KAAK,EAAE,iBAAiB,EAAE,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC9K,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAG5D,YAAY,EAAE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAGnM,YAAY,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAG7C,YAAY,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAGvC,YAAY,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAG3D,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAA;AAG1F,YAAY,EAAE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gBAAgB,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAG9K,YAAY,EAAE,kBAAkB,EAAE,WAAW,EAAE,aAAa,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAGtG,YAAY,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,aAAa,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AAG1K,YAAY,EAAE,QAAQ,EAAE,cAAc,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAG/H,YAAY,EACV,eAAe,EACf,cAAc,EACd,WAAW,EACX,eAAe,EACf,eAAe,EACf,YAAY,EACZ,eAAe,EACf,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,eAAe,EACf,YAAY,EACZ,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,mBAAmB,EACnB,cAAc,EACd,aAAa,GACd,MAAM,cAAc,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,6 @@
1
+ // ---------------------------------------------------------------------------
2
+ // @commercejs/types — Unified Data Model for eCommerce
3
+ // ---------------------------------------------------------------------------
4
+ // Barrel export — re-exports all domain types
5
+ export { CommerceError, isCommerceError } from './common.js';
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,uDAAuD;AACvD,8EAA8E;AAC9E,8CAA8C;AAI9C,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA"}
@@ -0,0 +1,56 @@
1
+ import type { Id, LocalizedString, Maybe } from './common.js';
2
+ /** Geographic coordinates */
3
+ export interface Coordinates {
4
+ lat: number;
5
+ lng: number;
6
+ }
7
+ /** Working hours for a single day */
8
+ export interface WorkingHoursEntry {
9
+ day: string;
10
+ from: Maybe<string>;
11
+ to: Maybe<string>;
12
+ isClosed: boolean;
13
+ }
14
+ /** Contact information for a store location */
15
+ export interface LocationContact {
16
+ phone: Maybe<string>;
17
+ whatsapp: Maybe<string>;
18
+ telephone: Maybe<string>;
19
+ }
20
+ /** A physical store location or branch */
21
+ export interface StoreLocation {
22
+ id: Id;
23
+ /** Branch / location name */
24
+ name: LocalizedString;
25
+ /** Whether this location is active */
26
+ isActive: boolean;
27
+ /** Default branch flag */
28
+ isDefault: boolean;
29
+ /** Geographic coordinates */
30
+ coordinates: Maybe<Coordinates>;
31
+ /** Short address summary */
32
+ shortAddress: Maybe<string>;
33
+ /** Full street address */
34
+ street: Maybe<string>;
35
+ /** Postal / ZIP code */
36
+ postalCode: Maybe<string>;
37
+ /** City name */
38
+ city: Maybe<LocalizedString>;
39
+ /** Region / state name */
40
+ region: Maybe<LocalizedString>;
41
+ /** Country code */
42
+ countryCode: Maybe<string>;
43
+ /** Contact info */
44
+ contacts: Maybe<LocationContact>;
45
+ /** Weekly working hours */
46
+ workingHours: WorkingHoursEntry[];
47
+ /** Whether currently open */
48
+ isOpen: boolean;
49
+ /** Supports in-store pickup */
50
+ isPickupEnabled: boolean;
51
+ /** Supports shipping from this location */
52
+ isShippingEnabled: boolean;
53
+ /** Supports cash-on-delivery */
54
+ isCodAvailable: boolean;
55
+ }
56
+ //# sourceMappingURL=location.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"location.d.ts","sourceRoot":"","sources":["../src/location.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAE7D,6BAA6B;AAC7B,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,qCAAqC;AACrC,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE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AE,OAAO,CAAA;IAC1B,gCAAgC;IAChC,cAAc,EAAE,OAAO,CAAA;CACxB"}
@@ -0,0 +1,5 @@
1
+ // ---------------------------------------------------------------------------
2
+ // Store Location / Branch types — for pickup and store locator
3
+ // ---------------------------------------------------------------------------
4
+ export {};
5
+ //# sourceMappingURL=location.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"location.js","sourceRoot":"","sources":["../src/location.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,+DAA+D;AAC/D,8EAA8E"}
@@ -0,0 +1,46 @@
1
+ import type { Id, Maybe, Price } from './common.js';
2
+ import type { Address } from './customer.js';
3
+ /** A single item to include in the order */
4
+ export interface OrderItemInput {
5
+ productId: Id;
6
+ variantId?: Maybe<Id>;
7
+ quantity: number;
8
+ /** Unit price at time of order (for validation) */
9
+ unitPrice: Price;
10
+ /** Optional notes on the line item */
11
+ notes?: Maybe<string>;
12
+ }
13
+ /** Input for creating a new order via the adapter */
14
+ export interface CreateOrderInput {
15
+ /** Items to include in the order */
16
+ items: OrderItemInput[];
17
+ /** Customer ID if known (existing customer) */
18
+ customerId?: Maybe<Id>;
19
+ /** Receiver info if no customerId (guest checkout) */
20
+ receiver?: Maybe<{
21
+ firstName: string;
22
+ lastName: string;
23
+ email: string;
24
+ phone?: string;
25
+ }>;
26
+ /** Shipping address */
27
+ shippingAddress: Omit<Address, 'id' | 'isDefault'>;
28
+ /** Billing address (defaults to shipping if not provided) */
29
+ billingAddress?: Maybe<Omit<Address, 'id' | 'isDefault'>>;
30
+ /** Selected shipping method ID */
31
+ shippingMethodId?: Maybe<string>;
32
+ /** Payment method or reference */
33
+ payment?: Maybe<{
34
+ /** Payment method ID or type */
35
+ methodId: string;
36
+ /** External transaction reference (e.g., Stripe PaymentIntent ID) */
37
+ transactionId?: string;
38
+ }>;
39
+ /** Coupon or discount code applied */
40
+ couponCode?: Maybe<string>;
41
+ /** Customer-facing order note */
42
+ note?: Maybe<string>;
43
+ /** Custom metadata (adapter-specific extensions) */
44
+ metadata?: Maybe<Record<string, unknown>>;
45
+ }
46
+ //# sourceMappingURL=order-input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"order-input.d.ts","sourceRoot":"","sources":["../src/order-input.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAE5C,4CAA4C;AAC5C,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,EAAE,CAAA;IACb,SAAS,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,CAAA;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,mDAAmD;IACnD,SAAS,EAAE,KAAK,CAAA;IAChB,sCAAsC;IACtC,KAAK,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;CACtB;AAED,qDAAqD;AACrD,MAAM,WAAW,gBAAgB;IAC/B,oCAAoC;IACpC,KAAK,EAAE,cAAc,EAAE,CAAA;IAEvB,+CAA+C;IAC/C,UAAU,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,CAAA;IAEtB,sDAAsD;IACtD,QAAQ,CAAC,EAAE,KAAK,CAAC;QACf,SAAS,EAAE,MAAM,CAAA;QACjB,QAAQ,EAAE,MAAM,CAAA;QAChB,KAAK,EAAE,MAAM,CAAA;QACb,KAAK,CAAC,EAAE,MAAM,CAAA;KACf,CAAC,CAAA;IAEF,uBAAuB;IACvB,eAAe,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,GAAG,WAAW,CAAC,CAAA;IAElD,6DAA6D;IAC7D,cAAc,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,GAAG,WAAW,CAAC,CAAC,CAAA;IAEzD,kCAAkC;IAClC,gBAAgB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IAEhC,kCAAkC;IAClC,OAAO,CAAC,EAAE,KAAK,CAAC;QACd,gCAAgC;QAChC,QAAQ,EAAE,MAAM,CAAA;QAChB,qEAAqE;QACrE,aAAa,CAAC,EAAE,MAAM,CAAA;KACvB,CAAC,CAAA;IAEF,sCAAsC;IACtC,UAAU,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IAE1B,iCAAiC;IACjC,IAAI,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IAEpB,oDAAoD;IACpD,QAAQ,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;CAC1C"}
@@ -0,0 +1,9 @@
1
+ // ---------------------------------------------------------------------------
2
+ // Order creation input types
3
+ // ---------------------------------------------------------------------------
4
+ // Used by OrderAdapter.createOrder() — platform-agnostic order creation.
5
+ // The checkout engine (or any caller) builds this from cart + session data
6
+ // and the adapter maps it to the platform's API shape.
7
+ // ---------------------------------------------------------------------------
8
+ export {};
9
+ //# sourceMappingURL=order-input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"order-input.js","sourceRoot":"","sources":["../src/order-input.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,6BAA6B;AAC7B,8EAA8E;AAC9E,yEAAyE;AACzE,2EAA2E;AAC3E,uDAAuD;AACvD,8EAA8E"}
@@ -0,0 +1,55 @@
1
+ import type { Maybe } from './common.js';
2
+ /**
3
+ * Rich order status metadata — for displaying statuses on order tracking pages.
4
+ *
5
+ * Distinct from the `OrderStatus` string union (used for `Order.status`),
6
+ * this captures platform-specific display data like colors, icons, and
7
+ * custom sub-statuses.
8
+ */
9
+ export interface OrderStatusInfo {
10
+ id: string;
11
+ name: string;
12
+ slug: string;
13
+ /** Whether this is a built-in or merchant-created status */
14
+ type: 'original' | 'custom';
15
+ /** Hex color for status badge display */
16
+ color: Maybe<string>;
17
+ /** Icon identifier (platform-specific) */
18
+ icon: Maybe<string>;
19
+ /** Whether this status is active in the store's workflow */
20
+ isActive: boolean;
21
+ /** Parent status (for custom sub-statuses under an original status) */
22
+ parent: Maybe<{
23
+ id: string;
24
+ name: string;
25
+ }>;
26
+ /** Child sub-statuses (custom statuses grouped under this status) */
27
+ children: OrderStatusInfo[];
28
+ }
29
+ /**
30
+ * A single entry in an order's status change timeline.
31
+ *
32
+ * Used for order tracking — shows the history of status changes,
33
+ * notes, and actions taken on an order.
34
+ */
35
+ export interface OrderHistoryEntry {
36
+ id: string;
37
+ orderId: string;
38
+ /** The action/status change that occurred */
39
+ action: string;
40
+ /** Optional note from merchant or system */
41
+ note: Maybe<string>;
42
+ createdAt: string;
43
+ }
44
+ /**
45
+ * Input for updating an order's status.
46
+ */
47
+ export interface UpdateOrderStatusInput {
48
+ /** Status slug (e.g., 'canceled', 'in_progress') or custom status ID */
49
+ status: string;
50
+ /** Optional note to attach to the status change */
51
+ note?: string;
52
+ /** Whether to restore stock for canceled/returned items */
53
+ restoreItems?: boolean;
54
+ }
55
+ //# sourceMappingURL=order-status.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"order-status.d.ts","sourceRoot":"","sources":["../src/order-status.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAExC;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,4DAA4D;IAC5D,IAAI,EAAE,UAAU,GAAG,QAAQ,CAAA;IAC3B,yCAAyC;IACzC,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IACpB,0CAA0C;IAC1C,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IACnB,4DAA4D;IAC5D,QAAQ,EAAE,OAAO,CAAA;IACjB,uEAAuE;IACvE,MAAM,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IAC3C,qEAAqE;IACrE,QAAQ,EAAE,eAAe,EAAE,CAAA;CAC5B;AAED;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,6CAA6C;IAC7C,MAAM,EAAE,MAAM,CAAA;IACd,4CAA4C;IAC5C,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,wEAAwE;IACxE,MAAM,EAAE,MAAM,CAAA;IACd,mDAAmD;IACnD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,2DAA2D;IAC3D,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB"}
@@ -0,0 +1,5 @@
1
+ // ---------------------------------------------------------------------------
2
+ // Order status & history types — rich metadata for display & tracking
3
+ // ---------------------------------------------------------------------------
4
+ export {};
5
+ //# sourceMappingURL=order-status.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"order-status.js","sourceRoot":"","sources":["../src/order-status.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,sEAAsE;AACtE,8EAA8E"}
@@ -0,0 +1,62 @@
1
+ import type { Id, Image, LocalizedString, Maybe, Price } from './common.js';
2
+ import type { Address } from './customer.js';
3
+ import type { ShippingMethod } from './shipping.js';
4
+ import type { PaymentMethod } from './payment.js';
5
+ import type { CartTotals } from './cart.js';
6
+ import type { ProductType, DigitalProductMeta, EventProductMeta } from './product.js';
7
+ import type { PaymentTerms } from './wholesale.js';
8
+ /** Order status lifecycle */
9
+ export type OrderStatus = 'pending' | 'processing' | 'shipped' | 'delivered' | 'cancelled' | 'refunded' | 'returned';
10
+ /** Fulfillment status per line item */
11
+ export type FulfillmentStatus = 'unfulfilled' | 'partially_fulfilled' | 'fulfilled' | 'returned' | 'download_ready' | 'license_sent' | 'access_granted' | 'ticket_issued';
12
+ /** A single item within an order */
13
+ export interface OrderItem {
14
+ id: Id;
15
+ productId: Id;
16
+ variantId: Maybe<Id>;
17
+ name: LocalizedString;
18
+ image: Maybe<Image>;
19
+ quantity: number;
20
+ price: Price;
21
+ totalPrice: Price;
22
+ fulfillmentStatus: FulfillmentStatus;
23
+ /** Product type — drives post-purchase UX (download button vs tracking) */
24
+ productType: ProductType;
25
+ /** Digital fulfillment details (populated after purchase for digital products) */
26
+ digital: Maybe<DigitalProductMeta>;
27
+ /** Event/ticket details (populated for event products) */
28
+ event: Maybe<EventProductMeta>;
29
+ }
30
+ /** Order entity */
31
+ export interface Order {
32
+ id: Id;
33
+ orderNumber: string;
34
+ status: OrderStatus;
35
+ items: OrderItem[];
36
+ totals: CartTotals;
37
+ shippingAddress: Maybe<Address>;
38
+ billingAddress: Maybe<Address>;
39
+ shippingMethod: Maybe<ShippingMethod>;
40
+ paymentMethod: Maybe<PaymentMethod>;
41
+ /** Tracking number from shipping provider */
42
+ trackingNumber: Maybe<string>;
43
+ /** Tracking URL */
44
+ trackingUrl: Maybe<string>;
45
+ note: Maybe<string>;
46
+ customerId: Maybe<Id>;
47
+ /** Whether any item in this order requires physical shipping */
48
+ requiresShipping: boolean;
49
+ createdAt: string;
50
+ updatedAt: string;
51
+ /** Payment terms for B2B orders (null = standard payment) */
52
+ paymentTerms: Maybe<PaymentTerms>;
53
+ /** Buyer's purchase order number reference */
54
+ purchaseOrderNumber: Maybe<string>;
55
+ /** Company name for B2B orders */
56
+ companyName: Maybe<string>;
57
+ /** Gift card codes applied to this order */
58
+ giftCardCodesApplied: string[];
59
+ /** Total gift card amount deducted */
60
+ giftCardAmountApplied: Maybe<Price>;
61
+ }
62
+ //# sourceMappingURL=order.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"order.d.ts","sourceRoot":"","sources":["../src/order.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,KA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ACpB,EAAE,EAAE,EAAE,CAAA;IACN,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,WAAW,CAAA;IACnB,KAAK,EAAE,SAAS,EAAE,CAAA;IAClB,MAAM,EAAE,UAAU,CAAA;IAClB,eAAe,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;IAC/B,cAAc,EAAE,KAAK,CAAC,OAAO,CAAC,CAAA;IAC9B,cAAc,EAAE,KAAK,CAAC,cAAc,CAAC,CAAA;IACrC,aAAa,EAAE,KAAK,CAAC,aAAa,CAAC,CAAA;IACnC,6CAA6C;IAC7C,cAAc,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IAC7B,mBAAmB;IACnB,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IAC1B,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IACnB,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,CAAA;IACrB,gEAAgE;IAChE,gBAAgB,EAAE,OAAO,CAAA;IACzB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IAIjB,6DAA6D;IAC7D,YAAY,EAAE,KAAK,CAAC,YAAY,CAAC,CAAA;IAEjC,8CAA8C;IAC9C,mBAAmB,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IAElC,kCAAkC;IAClC,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC,CAAA;IAI1B,4CAA4C;IAC5C,oBAAoB,EAAE,MAAM,EAAE,CAAA;IAE9B,sCAAsC;IACtC,qBAAqB,EAAE,KAAK,CAAC,KAAK,CAAC,CAAA;CACpC"}
package/dist/order.js ADDED
@@ -0,0 +1,5 @@
1
+ // ---------------------------------------------------------------------------
2
+ // Order domain types
3
+ // ---------------------------------------------------------------------------
4
+ export {};
5
+ //# sourceMappingURL=order.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"order.js","sourceRoot":"","sources":["../src/order.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,qBAAqB;AACrB,8EAA8E"}