@retaila/shared-types 1.1.29 → 1.1.31

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.mts CHANGED
@@ -49,6 +49,7 @@ interface Media {
49
49
  declare enum MediaType {
50
50
  IMAGE = "IMAGE",
51
51
  VIDEO = "VIDEO",
52
+ FAVICON = "FAVICON",
52
53
  DOCUMENT = "DOCUMENT",
53
54
  AUDIO = "AUDIO",
54
55
  ARCHIVE = "ARCHIVE",
@@ -75,6 +76,7 @@ declare function getCurrencySymbol(currencyCode: Currency): string;
75
76
  interface Account {
76
77
  id: string;
77
78
  name: string;
79
+ slug: string;
78
80
  address?: string;
79
81
  logoId?: string;
80
82
  currency: string;
@@ -534,6 +536,104 @@ type Fulfillment = {
534
536
  deletedAt?: Date;
535
537
  };
536
538
 
539
+ declare enum PaymentStatus {
540
+ PENDING = "PENDING",// Pendiente
541
+ PREAUTHORIZED = "PREAUTHORIZED",
542
+ APPROVED = "APPROVED",// Pago aprobado online
543
+ PAID = "PAID",// Pago realizado por redes fisicas
544
+ REJECTED = "REJECTED",// Pago rechazado
545
+ REFUND_IN_PROCESS = "REFUND_IN_PROCESS",// En proceso de reembolso con la plataforma de pagos
546
+ PARTIAL_REFUND = "PARTIAL_REFUND",// Pago parcialmente reembolsado
547
+ REFUNDED = "REFUNDED",// Pago reembolsado
548
+ ERROR = "ERROR"
549
+ }
550
+ declare enum PaymentMethodType {
551
+ BANK_TRANSFER = "BANK_TRANSFER",
552
+ CREDIT_CARD = "CREDIT_CARD",
553
+ DEBIT_CARD = "DEBIT_CARD",
554
+ MERCADOPAGO = "MERCADOPAGO",
555
+ PHYSICAL = "PHYSICAL",
556
+ INTERNATIONAL = "INTERNATIONAL",
557
+ PAYPAL = "PAYPAL",
558
+ CASH = "CASH",
559
+ OTHER = "OTHER"
560
+ }
561
+ interface Payment {
562
+ id: string;
563
+ accountId: string;
564
+ orderId: string;
565
+ invoiceId?: string;
566
+ gatewayPaymentId?: string;
567
+ referenceCode?: string;
568
+ paymentMethodType?: PaymentMethodType;
569
+ currency: Currency;
570
+ amount: number;
571
+ amountReceived: number;
572
+ amountRefunded: number;
573
+ paidAt?: string | Date;
574
+ refundedAt?: string | Date;
575
+ status: PaymentStatus;
576
+ cardBrand?: string;
577
+ cardLast4?: string;
578
+ data?: Record<string, unknown>;
579
+ metadata?: Record<string, any>;
580
+ demo: boolean;
581
+ createdAt: string | Date;
582
+ updatedAt: string | Date;
583
+ deletedAt?: string | Date;
584
+ }
585
+ type PaymentProviderKey = 'MERCADOPAGO' | 'MANUAL';
586
+ interface PaymentProviderContext {
587
+ data: Record<string, unknown>;
588
+ }
589
+ interface PaymentProviderInitInput {
590
+ data: Record<string, any>;
591
+ }
592
+ interface PaymentProviderInitOutput {
593
+ data: Record<string, any>;
594
+ status: PaymentStatus;
595
+ }
596
+ interface PaymentProviderCaptureInput {
597
+ data: Record<string, any>;
598
+ }
599
+ interface PaymentProviderCaptureOutput {
600
+ data: Record<string, any>;
601
+ }
602
+ interface PaymentProviderRefundInput {
603
+ amount: number;
604
+ data: Record<string, any>;
605
+ }
606
+ interface PaymentProviderRefundOutput {
607
+ data: Record<string, any>;
608
+ }
609
+ interface PaymentProviderWebhookResult {
610
+ order_code: string | null;
611
+ status: PaymentStatus;
612
+ data: Record<string, unknown>;
613
+ paymentDetails: {
614
+ method?: string;
615
+ last4?: string;
616
+ };
617
+ }
618
+ interface WebhookPayload {
619
+ provider: string;
620
+ accountId: string;
621
+ payload: {
622
+ query: Record<string, unknown>;
623
+ body: Record<string, unknown>;
624
+ headers: Record<string, unknown>;
625
+ };
626
+ }
627
+ interface PaymentProviderAdapter {
628
+ readonly key: PaymentProviderKey;
629
+ initPayment(input: PaymentProviderInitInput): Promise<PaymentProviderInitOutput>;
630
+ capture(input: PaymentProviderCaptureInput): Promise<PaymentProviderCaptureOutput>;
631
+ refund(input: PaymentProviderRefundInput): Promise<PaymentProviderRefundOutput>;
632
+ processWebhook(input: WebhookPayload['payload']): Promise<PaymentProviderWebhookResult>;
633
+ }
634
+
635
+ declare function getPaymentStatusInfo(status: PaymentStatus): StatusInfo;
636
+
537
637
  /**
538
638
  * Entidad Order
539
639
  * Define la orden de compra de un cliente en el sitio web.
@@ -649,6 +749,21 @@ interface OrderItemSnapshot {
649
749
  variantName?: string;
650
750
  media?: Media[];
651
751
  }
752
+ type StatusByType = {
753
+ order: OrderStatus;
754
+ fulfillment: FulfillmentStatus;
755
+ payment: PaymentStatus;
756
+ };
757
+ type StatusFlow<T extends keyof StatusByType = keyof StatusByType> = {
758
+ type: T;
759
+ status: StatusByType[T];
760
+ doneAt: Date | null;
761
+ };
762
+ type NextStatusAction<T extends keyof StatusByType = keyof StatusByType> = {
763
+ type: T;
764
+ status: StatusByType[T];
765
+ text: string;
766
+ };
652
767
 
653
768
  interface OrderCreateFromCartDto {
654
769
  cartId: string;
@@ -814,6 +929,7 @@ interface CartItem {
814
929
  }
815
930
  interface CartItemAttributeDetail {
816
931
  name: string;
932
+ alias: string;
817
933
  value: string;
818
934
  type?: string;
819
935
  }
@@ -835,100 +951,6 @@ declare enum CartDeliveryType {
835
951
  PICKUP = "pickup"
836
952
  }
837
953
 
838
- declare enum PaymentStatus {
839
- PENDING = "PENDING",// Pendiente
840
- PREAUTHORIZED = "PREAUTHORIZED",
841
- APPROVED = "APPROVED",// Pago aprobado online
842
- PAID = "PAID",// Pago realizado por redes fisicas
843
- REJECTED = "REJECTED",// Pago rechazado
844
- REFUND_IN_PROCESS = "REFUND_IN_PROCESS",// En proceso de reembolso con la plataforma de pagos
845
- PARTIAL_REFUND = "PARTIAL_REFUND",// Pago parcialmente reembolsado
846
- REFUNDED = "REFUNDED",// Pago reembolsado
847
- ERROR = "ERROR"
848
- }
849
- declare enum PaymentMethodType {
850
- BANK_TRANSFER = "BANK_TRANSFER",
851
- CREDIT_CARD = "CREDIT_CARD",
852
- DEBIT_CARD = "DEBIT_CARD",
853
- MERCADOPAGO = "MERCADOPAGO",
854
- PHYSICAL = "PHYSICAL",
855
- INTERNATIONAL = "INTERNATIONAL",
856
- PAYPAL = "PAYPAL",
857
- CASH = "CASH",
858
- OTHER = "OTHER"
859
- }
860
- interface Payment {
861
- id: string;
862
- accountId: string;
863
- orderId: string;
864
- invoiceId?: string;
865
- gatewayPaymentId?: string;
866
- referenceCode?: string;
867
- paymentMethodType?: PaymentMethodType;
868
- currency: Currency;
869
- amount: number;
870
- amountReceived: number;
871
- amountRefunded: number;
872
- paidAt?: string | Date;
873
- refundedAt?: string | Date;
874
- status: PaymentStatus;
875
- cardBrand?: string;
876
- cardLast4?: string;
877
- data?: Record<string, unknown>;
878
- metadata?: Record<string, any>;
879
- demo: boolean;
880
- createdAt: string | Date;
881
- updatedAt: string | Date;
882
- deletedAt?: string | Date;
883
- }
884
- type PaymentProviderKey = 'MERCADOPAGO' | 'MANUAL';
885
- interface PaymentProviderContext {
886
- data: Record<string, unknown>;
887
- }
888
- interface PaymentProviderInitInput {
889
- data: Record<string, any>;
890
- }
891
- interface PaymentProviderInitOutput {
892
- data: Record<string, any>;
893
- status: PaymentStatus;
894
- }
895
- interface PaymentProviderCaptureInput {
896
- data: Record<string, any>;
897
- }
898
- interface PaymentProviderCaptureOutput {
899
- data: Record<string, any>;
900
- }
901
- interface PaymentProviderRefundInput {
902
- amount: number;
903
- data: Record<string, any>;
904
- }
905
- interface PaymentProviderRefundOutput {
906
- data: Record<string, any>;
907
- }
908
- interface PaymentProviderWebhookResult {
909
- order_code: string | null;
910
- status: PaymentStatus;
911
- data: Record<string, unknown>;
912
- }
913
- interface WebhookPayload {
914
- provider: string;
915
- accountId: string;
916
- payload: {
917
- query: Record<string, unknown>;
918
- body: Record<string, unknown>;
919
- headers: Record<string, unknown>;
920
- };
921
- }
922
- interface PaymentProviderAdapter {
923
- readonly key: PaymentProviderKey;
924
- initPayment(input: PaymentProviderInitInput): Promise<PaymentProviderInitOutput>;
925
- capture(input: PaymentProviderCaptureInput): Promise<PaymentProviderCaptureOutput>;
926
- refund(input: PaymentProviderRefundInput): Promise<PaymentProviderRefundOutput>;
927
- processWebhook(input: WebhookPayload['payload']): Promise<PaymentProviderWebhookResult>;
928
- }
929
-
930
- declare function getPaymentStatusInfo(status: PaymentStatus): StatusInfo;
931
-
932
954
  /**
933
955
  * Entidad ProductAttribute
934
956
  * Define los atributos disponibles que se pueden asignar a las variantes de producto (ej. Color, Talla).
@@ -1168,4 +1190,103 @@ type CreateFulfillmentDto = {
1168
1190
  data?: Record<string, unknown>;
1169
1191
  };
1170
1192
 
1171
- export { type Account, type AccountBranch, type AccountBranchSchedule, AccountBranchScheduleDay, AccountBranchScheduleStatus, AccountBranchStatus, type AccountDeliveryOption, type AccountDeliveryOptionCalculatedCost, AccountDeliveryOptionPriceLogic, AccountDeliveryOptionStatus, type AccountDeliveryOptionZone, AccountDeliveryOptionZoneStatus, type AccountDomain, AccountDomainStatus, type AccountIntegration, type AccountIntegrationConfigDTO, AccountIntegrationConnectionStatus, AccountIntegrationEnvironment, AccountIntegrationStatus, AccountStatus, type Address, type AdminOrderStatusChangeDto, type BaseEntity, type BaseEntityWithAccount, type BaseEntityWithAccountAndUser, type BaseEntityWithUser, type Cart, type CartConfirmDto, CartDeliveryType, type CartItem, type CartItemAddDto, type CartItemAttributeDetail, CartItemErrorCode, type CartItemRemoveDto, type CartItemUpdateDto, type CartItemValidation, CartSource, CartStatus, type CartUpdateDto, type CreateFulfillmentDto, Currency, type Customer, CustomerStatus, type CustomerUpsertDto, type Fulfillment, FulfillmentStatus, type Integration, IntegrationCategory, IntegrationStatus, type MapPosition, type Media, MediaType, type Order, type OrderCreateFromCartDto, OrderDeliveryType, type OrderItem, type OrderItemSnapshot, OrderPaymentStatus, OrderSource, OrderStatus, type Payment, PaymentMethodType, type PaymentProviderAdapter, type PaymentProviderCaptureInput, type PaymentProviderCaptureOutput, type PaymentProviderContext, type PaymentProviderInitInput, type PaymentProviderInitOutput, type PaymentProviderKey, type PaymentProviderRefundInput, type PaymentProviderRefundOutput, type PaymentProviderWebhookResult, PaymentStatus, type Phone, type Product, type ProductAttribute, type ProductAttributeOption, ProductAttributeStatus, ProductAttributeType, type ProductCategory, ProductCategoryStatus, ProductStatus, ProductType, type ProductVariant, PubSubTopics, type StandardCategory, StandardCategoryStatus, type StatusChangeHistory, type StoreBanner, StoreBannerStatus, type StorePage, StorePageStatus, StorePageType, type SupportConversation, SupportConversationChannel, type SupportConversationMessage, SupportConversationMessageAiAnalysisStatus, SupportConversationMessageDeliveryStatus, SupportConversationMessageDirection, SupportConversationMessageSenderType, SupportConversationPriority, SupportConversationStatus, SupportConversationVisibility, type ThemeConfig, type WebhookPayload, getCurrencySymbol, getOrderStatusInfo, getPaymentStatusInfo, getProductStatusInfo };
1193
+ declare function getFulfillmentStatusInfo(status: FulfillmentStatus): StatusInfo;
1194
+
1195
+ /**
1196
+ * Entidad StoreCustomization
1197
+ * Configuración de la tienda
1198
+ */
1199
+
1200
+ interface StoreCustomization {
1201
+ id: string;
1202
+ accountId: string;
1203
+ layout: {
1204
+ components: StoreCustomizationLayoutComponent[];
1205
+ };
1206
+ pages: StoreCustomizationPage[];
1207
+ theme: {
1208
+ colors: StoreCustomizationThemeColors;
1209
+ typography: StoreCustomizationThemeTypography;
1210
+ buttons: StoreCustomizationThemeButtons;
1211
+ };
1212
+ seo: StoreCustomizationSeo;
1213
+ createdAt: Date;
1214
+ updatedAt: Date;
1215
+ deletedAt?: Date | null;
1216
+ }
1217
+ interface StoreCustomizationLayoutComponent {
1218
+ id: string;
1219
+ type: string;
1220
+ name: string;
1221
+ version: string;
1222
+ settings: StoreCustomizationComponentSettings;
1223
+ }
1224
+ interface StoreCustomizationPageComponent {
1225
+ id: string;
1226
+ type: string;
1227
+ name: string;
1228
+ version: string;
1229
+ settings: StoreCustomizationComponentSettings;
1230
+ }
1231
+ interface StoreCustomizationPage {
1232
+ id: string;
1233
+ name: string;
1234
+ path: string;
1235
+ components: StoreCustomizationPageComponent[];
1236
+ }
1237
+ interface StoreCustomizationComponentSettings {
1238
+ [key: string]: any;
1239
+ }
1240
+ interface StoreCustomizationThemeColors {
1241
+ background: {
1242
+ backgroundColor: string;
1243
+ };
1244
+ text: {
1245
+ titleTextColor: string;
1246
+ bodyTextColor: string;
1247
+ };
1248
+ theme: {
1249
+ primaryColor: string;
1250
+ secondaryColor: string;
1251
+ };
1252
+ }
1253
+ interface StoreCustomizationThemeTypography {
1254
+ headings: {
1255
+ fontFamily: string;
1256
+ fontSizeBase: number;
1257
+ fontUppercase: boolean;
1258
+ };
1259
+ body: {
1260
+ fontFamily: string;
1261
+ fontSizeBase: number;
1262
+ fontUppercase: boolean;
1263
+ };
1264
+ }
1265
+ interface ButtonStyle {
1266
+ backgroundColor: string;
1267
+ textColor: string;
1268
+ borderColor: string;
1269
+ borderRadius: number;
1270
+ shadow: string;
1271
+ hoverBackgroundColor: string;
1272
+ hoverTextColor: string;
1273
+ hoverBorderColor: string;
1274
+ hoverEffect: string;
1275
+ }
1276
+ interface StoreCustomizationThemeButtons {
1277
+ primary: ButtonStyle;
1278
+ secondary: ButtonStyle;
1279
+ success: ButtonStyle;
1280
+ danger: ButtonStyle;
1281
+ }
1282
+ interface StoreCustomizationSeo {
1283
+ pageTitle: string;
1284
+ pageDescription: string;
1285
+ pageKeywords: string;
1286
+ pageImageId?: string | null;
1287
+ pageImage?: Media | null;
1288
+ faviconId?: string | null;
1289
+ favicon?: Media | null;
1290
+ }
1291
+
1292
+ export { type Account, type AccountBranch, type AccountBranchSchedule, AccountBranchScheduleDay, AccountBranchScheduleStatus, AccountBranchStatus, type AccountDeliveryOption, type AccountDeliveryOptionCalculatedCost, AccountDeliveryOptionPriceLogic, AccountDeliveryOptionStatus, type AccountDeliveryOptionZone, AccountDeliveryOptionZoneStatus, type AccountDomain, AccountDomainStatus, type AccountIntegration, type AccountIntegrationConfigDTO, AccountIntegrationConnectionStatus, AccountIntegrationEnvironment, AccountIntegrationStatus, AccountStatus, type Address, type AdminOrderStatusChangeDto, type BaseEntity, type BaseEntityWithAccount, type BaseEntityWithAccountAndUser, type BaseEntityWithUser, type ButtonStyle, type Cart, type CartConfirmDto, CartDeliveryType, type CartItem, type CartItemAddDto, type CartItemAttributeDetail, CartItemErrorCode, type CartItemRemoveDto, type CartItemUpdateDto, type CartItemValidation, CartSource, CartStatus, type CartUpdateDto, type CreateFulfillmentDto, Currency, type Customer, CustomerStatus, type CustomerUpsertDto, type Fulfillment, FulfillmentStatus, type Integration, IntegrationCategory, IntegrationStatus, type MapPosition, type Media, MediaType, type NextStatusAction, type Order, type OrderCreateFromCartDto, OrderDeliveryType, type OrderItem, type OrderItemSnapshot, OrderPaymentStatus, OrderSource, OrderStatus, type Payment, PaymentMethodType, type PaymentProviderAdapter, type PaymentProviderCaptureInput, type PaymentProviderCaptureOutput, type PaymentProviderContext, type PaymentProviderInitInput, type PaymentProviderInitOutput, type PaymentProviderKey, type PaymentProviderRefundInput, type PaymentProviderRefundOutput, type PaymentProviderWebhookResult, PaymentStatus, type Phone, type Product, type ProductAttribute, type ProductAttributeOption, ProductAttributeStatus, ProductAttributeType, type ProductCategory, ProductCategoryStatus, ProductStatus, ProductType, type ProductVariant, PubSubTopics, type StandardCategory, StandardCategoryStatus, type StatusChangeHistory, type StatusFlow, type StoreBanner, StoreBannerStatus, type StoreCustomization, type StoreCustomizationComponentSettings, type StoreCustomizationLayoutComponent, type StoreCustomizationPage, type StoreCustomizationPageComponent, type StoreCustomizationSeo, type StoreCustomizationThemeButtons, type StoreCustomizationThemeColors, type StoreCustomizationThemeTypography, type StorePage, StorePageStatus, StorePageType, type SupportConversation, SupportConversationChannel, type SupportConversationMessage, SupportConversationMessageAiAnalysisStatus, SupportConversationMessageDeliveryStatus, SupportConversationMessageDirection, SupportConversationMessageSenderType, SupportConversationPriority, SupportConversationStatus, SupportConversationVisibility, type ThemeConfig, type WebhookPayload, getCurrencySymbol, getFulfillmentStatusInfo, getOrderStatusInfo, getPaymentStatusInfo, getProductStatusInfo };