@sazito/client-sdk 1.2.8 → 1.2.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/dist/index.d.mts CHANGED
@@ -479,7 +479,69 @@ interface ShippingAssignment {
479
479
  */
480
480
 
481
481
  type OrderPublicId = number | string;
482
- interface OrderInvoiceItem {
482
+ /** Account order item; retained as an alias for existing imports. */
483
+ type OrderInvoiceItem = InvoiceItem;
484
+ interface OrderShippingItem {
485
+ id: OrderPublicId;
486
+ invoiceItemIds: OrderPublicId[];
487
+ rate: {
488
+ id?: OrderPublicId;
489
+ name: string;
490
+ price: number;
491
+ type?: string;
492
+ icon?: string;
493
+ color?: string;
494
+ };
495
+ }
496
+ interface OrderInvoice {
497
+ invoiceItems: InvoiceItem[];
498
+ shippingItems: JsonObject[];
499
+ netTotal?: number;
500
+ finalTotal?: number;
501
+ shippingTotal?: number;
502
+ discountTotal?: number;
503
+ creditTotal?: number;
504
+ vat?: number;
505
+ vatPercent?: number;
506
+ itemsTotalRawPrice?: number;
507
+ itemsDiscount?: number;
508
+ customerProfit?: number;
509
+ customerProfitPercentage?: number;
510
+ discountUsages?: Array<{
511
+ discountCode?: {
512
+ code?: string;
513
+ };
514
+ }>;
515
+ }
516
+ interface Order {
517
+ id: number;
518
+ orderNumber: string;
519
+ orderIdentifier: string;
520
+ invoice: OrderInvoice;
521
+ }
522
+ interface OrdersListResponse {
523
+ orders: Order[];
524
+ pageNumber?: number;
525
+ pageSize?: number;
526
+ totalCount: number;
527
+ totalCountRaw: number;
528
+ totalNotSeen: number;
529
+ totalSeen: number;
530
+ }
531
+ interface OrderFilters {
532
+ pageNumber?: number;
533
+ pageSize?: number;
534
+ filters?: Array<{
535
+ name: string;
536
+ value: JsonValue;
537
+ }>;
538
+ }
539
+
540
+ /**
541
+ * Payment completion order from process_payment_step; independent of account Order.
542
+ */
543
+
544
+ interface CheckoutInvoiceItem {
483
545
  productVariantId: OrderPublicId;
484
546
  name: string;
485
547
  image?: {
@@ -504,7 +566,7 @@ interface OrderInvoiceItem {
504
566
  };
505
567
  };
506
568
  }
507
- interface OrderShippingItem {
569
+ interface CheckoutShippingItem {
508
570
  id: OrderPublicId;
509
571
  invoiceItemIds: OrderPublicId[];
510
572
  rate: {
@@ -516,9 +578,9 @@ interface OrderShippingItem {
516
578
  color?: string;
517
579
  };
518
580
  }
519
- interface OrderInvoice {
520
- invoiceItems: OrderInvoiceItem[];
521
- shippingItems: OrderShippingItem[];
581
+ interface CheckoutInvoice {
582
+ invoiceItems: CheckoutInvoiceItem[];
583
+ shippingItems: CheckoutShippingItem[];
522
584
  netTotal: number;
523
585
  finalTotal: number;
524
586
  shippingTotal?: number;
@@ -536,28 +598,11 @@ interface OrderInvoice {
536
598
  };
537
599
  }>;
538
600
  }
539
- interface Order {
601
+ interface CheckoutOrder {
540
602
  id: OrderPublicId;
541
603
  orderNumber: OrderPublicId;
542
604
  orderIdentifier: string;
543
- invoice: OrderInvoice;
544
- }
545
- interface OrdersListResponse {
546
- orders: Order[];
547
- pageNumber?: number;
548
- pageSize?: number;
549
- totalCount: number;
550
- totalCountRaw: number;
551
- totalNotSeen: number;
552
- totalSeen: number;
553
- }
554
- interface OrderFilters {
555
- pageNumber?: number;
556
- pageSize?: number;
557
- filters?: Array<{
558
- name: string;
559
- value: JsonValue;
560
- }>;
605
+ invoice: CheckoutInvoice;
561
606
  }
562
607
 
563
608
  /**
@@ -608,10 +653,10 @@ type PaymentAction = PaymentActionBase & ({
608
653
  time?: number;
609
654
  } | {
610
655
  action: 'show_order';
611
- order: Order;
656
+ order: CheckoutOrder;
612
657
  } | {
613
658
  action: 'pending';
614
- order: Order;
659
+ order: CheckoutOrder;
615
660
  } | {
616
661
  action: 'payment_fail_error' | 'show_error' | 'FAIL';
617
662
  } | {
@@ -2396,4 +2441,4 @@ declare function transformAddToCartInput(variantId: number, quantity: number, fo
2396
2441
  declare function transformCreateCartInput(input: TransformValue): TransformObject;
2397
2442
 
2398
2443
  export { CredentialsManager, HttpClient, MemoryStorage, SazitoClient, TokenStorage, createBookingAPI as booking, createCartAPI as cart, createCategoriesAPI as categories, createCMSAPI as cms, createBookingAPI, createCMSAPI, createCartAPI, createCategoriesAPI, createDynamicFormsAPI, createEntityRoutesAPI, createFeedbacksAPI, createGeneralAPI, createImagesAPI, createInvoicesAPI, createMenuAPI, createOrdersAPI, createPaymentsAPI, createProductsAPI, createRegionsAPI, createSazitoClient, createSearchAPI, createShippingAPI, createUsersAPI, createVisitsAPI, createWalletAPI, createDynamicFormsAPI as dynamicForms, createEntityRoutesAPI as entityRoutes, createFeedbacksAPI as feedbacks, createGeneralAPI as general, createImagesAPI as images, createInvoicesAPI as invoices, createMenuAPI as menu, createOrdersAPI as orders, createPaymentsAPI as payments, createProductsAPI as products, createRegionsAPI as regions, createSearchAPI as search, createShippingAPI as shipping, toEnglishDigits, transformAddToCartInput, transformApiResponse, transformCartResponse, transformCreateCartInput, transformInvoiceResponse, transformProductListResponse, transformRequestKeys, transformResponseKeys, transformShippingAddressInput, createUsersAPI as users, createVisitsAPI as visits, createWalletAPI as wallet };
2399
- export type { AddToCartInput, ApplicableShippingMethods, BlogPage, BlogPageEntityRoute, CMSPageEntityRoute, CMSPageType, CacheConfig, Cart, CartCredentials, CartProduct, CheckoutProductSnapshot, City$1 as City, CmsPage, CookieOptions, CreateCartInput, CreateInvoiceInput, CreatePaymentInput, EntityRoute, EntityRouteResponse, EntityType, FormAttributeValue, Image, Invoice, InvoiceCredentials, InvoiceItem, InvoiceItemFormAttributes, InvoiceShippingAddress, InvoiceShippingAddressRegion, ItemShippingRate, JsonArray, JsonObject, JsonPrimitive, JsonValue, MenuItem, MenuNode, MenuTree, Order, OrderFilters, OrderInvoice, OrderInvoiceItem, OrderPublicId, OrderShippingItem, OrdersListResponse, PaginatedResponse, Payment, PaymentAction, PaymentCredentials, PaymentGateway, PaymentMethod, PaymentStatus, PaymentStepFormFields, PaymentStepFormValue, PaymentStepInput, Product, ProductAttribute, ProductAttributeValueObject, ProductCategory, ProductCategoryEntityRoute, ProductEntityRoute, ProductFilters, ProductSort, ProductVariant, RefreshInvoiceInput, Region$1 as Region, RequestOptions, RetryConfig, SazitoConfig, SazitoError, SazitoResponse, SchedulerBookingAttributes, SearchFilters, SearchResponse, ShippingAddress, ShippingAddressCity, ShippingAddressCredentials, ShippingAddressInput, ShippingAddressRegion, ShippingAssignment, ShippingItem, ShippingMethod, ShippingRate, StorageAdapter, Tag, UnknownEntityRoute, UploadedFormFileAttribute, User };
2444
+ export type { AddToCartInput, ApplicableShippingMethods, BlogPage, BlogPageEntityRoute, CMSPageEntityRoute, CMSPageType, CacheConfig, Cart, CartCredentials, CartProduct, CheckoutInvoice, CheckoutInvoiceItem, CheckoutOrder, CheckoutProductSnapshot, CheckoutShippingItem, City$1 as City, CmsPage, CookieOptions, CreateCartInput, CreateInvoiceInput, CreatePaymentInput, EntityRoute, EntityRouteResponse, EntityType, FormAttributeValue, Image, Invoice, InvoiceCredentials, InvoiceItem, InvoiceItemFormAttributes, InvoiceShippingAddress, InvoiceShippingAddressRegion, ItemShippingRate, JsonArray, JsonObject, JsonPrimitive, JsonValue, MenuItem, MenuNode, MenuTree, Order, OrderFilters, OrderInvoice, OrderInvoiceItem, OrderPublicId, OrderShippingItem, OrdersListResponse, PaginatedResponse, Payment, PaymentAction, PaymentCredentials, PaymentGateway, PaymentMethod, PaymentStatus, PaymentStepFormFields, PaymentStepFormValue, PaymentStepInput, Product, ProductAttribute, ProductAttributeValueObject, ProductCategory, ProductCategoryEntityRoute, ProductEntityRoute, ProductFilters, ProductSort, ProductVariant, RefreshInvoiceInput, Region$1 as Region, RequestOptions, RetryConfig, SazitoConfig, SazitoError, SazitoResponse, SchedulerBookingAttributes, SearchFilters, SearchResponse, ShippingAddress, ShippingAddressCity, ShippingAddressCredentials, ShippingAddressInput, ShippingAddressRegion, ShippingAssignment, ShippingItem, ShippingMethod, ShippingRate, StorageAdapter, Tag, UnknownEntityRoute, UploadedFormFileAttribute, User };
package/dist/index.d.ts CHANGED
@@ -479,7 +479,69 @@ interface ShippingAssignment {
479
479
  */
480
480
 
481
481
  type OrderPublicId = number | string;
482
- interface OrderInvoiceItem {
482
+ /** Account order item; retained as an alias for existing imports. */
483
+ type OrderInvoiceItem = InvoiceItem;
484
+ interface OrderShippingItem {
485
+ id: OrderPublicId;
486
+ invoiceItemIds: OrderPublicId[];
487
+ rate: {
488
+ id?: OrderPublicId;
489
+ name: string;
490
+ price: number;
491
+ type?: string;
492
+ icon?: string;
493
+ color?: string;
494
+ };
495
+ }
496
+ interface OrderInvoice {
497
+ invoiceItems: InvoiceItem[];
498
+ shippingItems: JsonObject[];
499
+ netTotal?: number;
500
+ finalTotal?: number;
501
+ shippingTotal?: number;
502
+ discountTotal?: number;
503
+ creditTotal?: number;
504
+ vat?: number;
505
+ vatPercent?: number;
506
+ itemsTotalRawPrice?: number;
507
+ itemsDiscount?: number;
508
+ customerProfit?: number;
509
+ customerProfitPercentage?: number;
510
+ discountUsages?: Array<{
511
+ discountCode?: {
512
+ code?: string;
513
+ };
514
+ }>;
515
+ }
516
+ interface Order {
517
+ id: number;
518
+ orderNumber: string;
519
+ orderIdentifier: string;
520
+ invoice: OrderInvoice;
521
+ }
522
+ interface OrdersListResponse {
523
+ orders: Order[];
524
+ pageNumber?: number;
525
+ pageSize?: number;
526
+ totalCount: number;
527
+ totalCountRaw: number;
528
+ totalNotSeen: number;
529
+ totalSeen: number;
530
+ }
531
+ interface OrderFilters {
532
+ pageNumber?: number;
533
+ pageSize?: number;
534
+ filters?: Array<{
535
+ name: string;
536
+ value: JsonValue;
537
+ }>;
538
+ }
539
+
540
+ /**
541
+ * Payment completion order from process_payment_step; independent of account Order.
542
+ */
543
+
544
+ interface CheckoutInvoiceItem {
483
545
  productVariantId: OrderPublicId;
484
546
  name: string;
485
547
  image?: {
@@ -504,7 +566,7 @@ interface OrderInvoiceItem {
504
566
  };
505
567
  };
506
568
  }
507
- interface OrderShippingItem {
569
+ interface CheckoutShippingItem {
508
570
  id: OrderPublicId;
509
571
  invoiceItemIds: OrderPublicId[];
510
572
  rate: {
@@ -516,9 +578,9 @@ interface OrderShippingItem {
516
578
  color?: string;
517
579
  };
518
580
  }
519
- interface OrderInvoice {
520
- invoiceItems: OrderInvoiceItem[];
521
- shippingItems: OrderShippingItem[];
581
+ interface CheckoutInvoice {
582
+ invoiceItems: CheckoutInvoiceItem[];
583
+ shippingItems: CheckoutShippingItem[];
522
584
  netTotal: number;
523
585
  finalTotal: number;
524
586
  shippingTotal?: number;
@@ -536,28 +598,11 @@ interface OrderInvoice {
536
598
  };
537
599
  }>;
538
600
  }
539
- interface Order {
601
+ interface CheckoutOrder {
540
602
  id: OrderPublicId;
541
603
  orderNumber: OrderPublicId;
542
604
  orderIdentifier: string;
543
- invoice: OrderInvoice;
544
- }
545
- interface OrdersListResponse {
546
- orders: Order[];
547
- pageNumber?: number;
548
- pageSize?: number;
549
- totalCount: number;
550
- totalCountRaw: number;
551
- totalNotSeen: number;
552
- totalSeen: number;
553
- }
554
- interface OrderFilters {
555
- pageNumber?: number;
556
- pageSize?: number;
557
- filters?: Array<{
558
- name: string;
559
- value: JsonValue;
560
- }>;
605
+ invoice: CheckoutInvoice;
561
606
  }
562
607
 
563
608
  /**
@@ -608,10 +653,10 @@ type PaymentAction = PaymentActionBase & ({
608
653
  time?: number;
609
654
  } | {
610
655
  action: 'show_order';
611
- order: Order;
656
+ order: CheckoutOrder;
612
657
  } | {
613
658
  action: 'pending';
614
- order: Order;
659
+ order: CheckoutOrder;
615
660
  } | {
616
661
  action: 'payment_fail_error' | 'show_error' | 'FAIL';
617
662
  } | {
@@ -2396,4 +2441,4 @@ declare function transformAddToCartInput(variantId: number, quantity: number, fo
2396
2441
  declare function transformCreateCartInput(input: TransformValue): TransformObject;
2397
2442
 
2398
2443
  export { CredentialsManager, HttpClient, MemoryStorage, SazitoClient, TokenStorage, createBookingAPI as booking, createCartAPI as cart, createCategoriesAPI as categories, createCMSAPI as cms, createBookingAPI, createCMSAPI, createCartAPI, createCategoriesAPI, createDynamicFormsAPI, createEntityRoutesAPI, createFeedbacksAPI, createGeneralAPI, createImagesAPI, createInvoicesAPI, createMenuAPI, createOrdersAPI, createPaymentsAPI, createProductsAPI, createRegionsAPI, createSazitoClient, createSearchAPI, createShippingAPI, createUsersAPI, createVisitsAPI, createWalletAPI, createDynamicFormsAPI as dynamicForms, createEntityRoutesAPI as entityRoutes, createFeedbacksAPI as feedbacks, createGeneralAPI as general, createImagesAPI as images, createInvoicesAPI as invoices, createMenuAPI as menu, createOrdersAPI as orders, createPaymentsAPI as payments, createProductsAPI as products, createRegionsAPI as regions, createSearchAPI as search, createShippingAPI as shipping, toEnglishDigits, transformAddToCartInput, transformApiResponse, transformCartResponse, transformCreateCartInput, transformInvoiceResponse, transformProductListResponse, transformRequestKeys, transformResponseKeys, transformShippingAddressInput, createUsersAPI as users, createVisitsAPI as visits, createWalletAPI as wallet };
2399
- export type { AddToCartInput, ApplicableShippingMethods, BlogPage, BlogPageEntityRoute, CMSPageEntityRoute, CMSPageType, CacheConfig, Cart, CartCredentials, CartProduct, CheckoutProductSnapshot, City$1 as City, CmsPage, CookieOptions, CreateCartInput, CreateInvoiceInput, CreatePaymentInput, EntityRoute, EntityRouteResponse, EntityType, FormAttributeValue, Image, Invoice, InvoiceCredentials, InvoiceItem, InvoiceItemFormAttributes, InvoiceShippingAddress, InvoiceShippingAddressRegion, ItemShippingRate, JsonArray, JsonObject, JsonPrimitive, JsonValue, MenuItem, MenuNode, MenuTree, Order, OrderFilters, OrderInvoice, OrderInvoiceItem, OrderPublicId, OrderShippingItem, OrdersListResponse, PaginatedResponse, Payment, PaymentAction, PaymentCredentials, PaymentGateway, PaymentMethod, PaymentStatus, PaymentStepFormFields, PaymentStepFormValue, PaymentStepInput, Product, ProductAttribute, ProductAttributeValueObject, ProductCategory, ProductCategoryEntityRoute, ProductEntityRoute, ProductFilters, ProductSort, ProductVariant, RefreshInvoiceInput, Region$1 as Region, RequestOptions, RetryConfig, SazitoConfig, SazitoError, SazitoResponse, SchedulerBookingAttributes, SearchFilters, SearchResponse, ShippingAddress, ShippingAddressCity, ShippingAddressCredentials, ShippingAddressInput, ShippingAddressRegion, ShippingAssignment, ShippingItem, ShippingMethod, ShippingRate, StorageAdapter, Tag, UnknownEntityRoute, UploadedFormFileAttribute, User };
2444
+ export type { AddToCartInput, ApplicableShippingMethods, BlogPage, BlogPageEntityRoute, CMSPageEntityRoute, CMSPageType, CacheConfig, Cart, CartCredentials, CartProduct, CheckoutInvoice, CheckoutInvoiceItem, CheckoutOrder, CheckoutProductSnapshot, CheckoutShippingItem, City$1 as City, CmsPage, CookieOptions, CreateCartInput, CreateInvoiceInput, CreatePaymentInput, EntityRoute, EntityRouteResponse, EntityType, FormAttributeValue, Image, Invoice, InvoiceCredentials, InvoiceItem, InvoiceItemFormAttributes, InvoiceShippingAddress, InvoiceShippingAddressRegion, ItemShippingRate, JsonArray, JsonObject, JsonPrimitive, JsonValue, MenuItem, MenuNode, MenuTree, Order, OrderFilters, OrderInvoice, OrderInvoiceItem, OrderPublicId, OrderShippingItem, OrdersListResponse, PaginatedResponse, Payment, PaymentAction, PaymentCredentials, PaymentGateway, PaymentMethod, PaymentStatus, PaymentStepFormFields, PaymentStepFormValue, PaymentStepInput, Product, ProductAttribute, ProductAttributeValueObject, ProductCategory, ProductCategoryEntityRoute, ProductEntityRoute, ProductFilters, ProductSort, ProductVariant, RefreshInvoiceInput, Region$1 as Region, RequestOptions, RetryConfig, SazitoConfig, SazitoError, SazitoResponse, SchedulerBookingAttributes, SearchFilters, SearchResponse, ShippingAddress, ShippingAddressCity, ShippingAddressCredentials, ShippingAddressInput, ShippingAddressRegion, ShippingAssignment, ShippingItem, ShippingMethod, ShippingRate, StorageAdapter, Tag, UnknownEntityRoute, UploadedFormFileAttribute, User };