@sazito/client-sdk 1.2.9 → 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,27 +479,8 @@ interface ShippingAssignment {
479
479
  */
480
480
 
481
481
  type OrderPublicId = number | string;
482
- /**
483
- * Keeps the established InvoiceItem contract for patch-level compatibility,
484
- * while exposing direct camelCase checkout fields when the endpoint provides them.
485
- */
486
- interface OrderInvoiceItem extends InvoiceItem {
487
- variantAttributes?: Array<{
488
- name: string;
489
- value: string;
490
- }>;
491
- singleItemPrice?: number;
492
- noOfItems?: number;
493
- totalItemsPrice?: number;
494
- productVariant?: {
495
- commercialFiles?: Array<{
496
- id: OrderPublicId;
497
- }>;
498
- product: {
499
- productType: string;
500
- };
501
- };
502
- }
482
+ /** Account order item; retained as an alias for existing imports. */
483
+ type OrderInvoiceItem = InvoiceItem;
503
484
  interface OrderShippingItem {
504
485
  id: OrderPublicId;
505
486
  invoiceItemIds: OrderPublicId[];
@@ -513,10 +494,10 @@ interface OrderShippingItem {
513
494
  };
514
495
  }
515
496
  interface OrderInvoice {
516
- invoiceItems: OrderInvoiceItem[];
517
- shippingItems: OrderShippingItem[];
518
- netTotal: number;
519
- finalTotal: number;
497
+ invoiceItems: InvoiceItem[];
498
+ shippingItems: JsonObject[];
499
+ netTotal?: number;
500
+ finalTotal?: number;
520
501
  shippingTotal?: number;
521
502
  discountTotal?: number;
522
503
  creditTotal?: number;
@@ -533,8 +514,8 @@ interface OrderInvoice {
533
514
  }>;
534
515
  }
535
516
  interface Order {
536
- id: OrderPublicId;
537
- orderNumber: OrderPublicId;
517
+ id: number;
518
+ orderNumber: string;
538
519
  orderIdentifier: string;
539
520
  invoice: OrderInvoice;
540
521
  }
@@ -556,6 +537,74 @@ interface OrderFilters {
556
537
  }>;
557
538
  }
558
539
 
540
+ /**
541
+ * Payment completion order from process_payment_step; independent of account Order.
542
+ */
543
+
544
+ interface CheckoutInvoiceItem {
545
+ productVariantId: OrderPublicId;
546
+ name: string;
547
+ image?: {
548
+ url?: string;
549
+ };
550
+ variantAttributes: Array<{
551
+ name: string;
552
+ value: string;
553
+ }>;
554
+ singleItemPrice: number;
555
+ noOfItems: number;
556
+ totalItemsPrice: number;
557
+ customerProfit?: number;
558
+ formAttributes?: unknown;
559
+ bookingAttributes?: unknown;
560
+ productVariant: {
561
+ commercialFiles?: Array<{
562
+ id: OrderPublicId;
563
+ }>;
564
+ product: {
565
+ productType: string;
566
+ };
567
+ };
568
+ }
569
+ interface CheckoutShippingItem {
570
+ id: OrderPublicId;
571
+ invoiceItemIds: OrderPublicId[];
572
+ rate: {
573
+ id?: OrderPublicId;
574
+ name: string;
575
+ price: number;
576
+ type?: string;
577
+ icon?: string;
578
+ color?: string;
579
+ };
580
+ }
581
+ interface CheckoutInvoice {
582
+ invoiceItems: CheckoutInvoiceItem[];
583
+ shippingItems: CheckoutShippingItem[];
584
+ netTotal: number;
585
+ finalTotal: number;
586
+ shippingTotal?: number;
587
+ discountTotal?: number;
588
+ creditTotal?: number;
589
+ vat?: number;
590
+ vatPercent?: number;
591
+ itemsTotalRawPrice?: number;
592
+ itemsDiscount?: number;
593
+ customerProfit?: number;
594
+ customerProfitPercentage?: number;
595
+ discountUsages?: Array<{
596
+ discountCode?: {
597
+ code?: string;
598
+ };
599
+ }>;
600
+ }
601
+ interface CheckoutOrder {
602
+ id: OrderPublicId;
603
+ orderNumber: OrderPublicId;
604
+ orderIdentifier: string;
605
+ invoice: CheckoutInvoice;
606
+ }
607
+
559
608
  /**
560
609
  * Payment-related types
561
610
  */
@@ -604,10 +653,10 @@ type PaymentAction = PaymentActionBase & ({
604
653
  time?: number;
605
654
  } | {
606
655
  action: 'show_order';
607
- order: Order;
656
+ order: CheckoutOrder;
608
657
  } | {
609
658
  action: 'pending';
610
- order: Order;
659
+ order: CheckoutOrder;
611
660
  } | {
612
661
  action: 'payment_fail_error' | 'show_error' | 'FAIL';
613
662
  } | {
@@ -2392,4 +2441,4 @@ declare function transformAddToCartInput(variantId: number, quantity: number, fo
2392
2441
  declare function transformCreateCartInput(input: TransformValue): TransformObject;
2393
2442
 
2394
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 };
2395
- 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,27 +479,8 @@ interface ShippingAssignment {
479
479
  */
480
480
 
481
481
  type OrderPublicId = number | string;
482
- /**
483
- * Keeps the established InvoiceItem contract for patch-level compatibility,
484
- * while exposing direct camelCase checkout fields when the endpoint provides them.
485
- */
486
- interface OrderInvoiceItem extends InvoiceItem {
487
- variantAttributes?: Array<{
488
- name: string;
489
- value: string;
490
- }>;
491
- singleItemPrice?: number;
492
- noOfItems?: number;
493
- totalItemsPrice?: number;
494
- productVariant?: {
495
- commercialFiles?: Array<{
496
- id: OrderPublicId;
497
- }>;
498
- product: {
499
- productType: string;
500
- };
501
- };
502
- }
482
+ /** Account order item; retained as an alias for existing imports. */
483
+ type OrderInvoiceItem = InvoiceItem;
503
484
  interface OrderShippingItem {
504
485
  id: OrderPublicId;
505
486
  invoiceItemIds: OrderPublicId[];
@@ -513,10 +494,10 @@ interface OrderShippingItem {
513
494
  };
514
495
  }
515
496
  interface OrderInvoice {
516
- invoiceItems: OrderInvoiceItem[];
517
- shippingItems: OrderShippingItem[];
518
- netTotal: number;
519
- finalTotal: number;
497
+ invoiceItems: InvoiceItem[];
498
+ shippingItems: JsonObject[];
499
+ netTotal?: number;
500
+ finalTotal?: number;
520
501
  shippingTotal?: number;
521
502
  discountTotal?: number;
522
503
  creditTotal?: number;
@@ -533,8 +514,8 @@ interface OrderInvoice {
533
514
  }>;
534
515
  }
535
516
  interface Order {
536
- id: OrderPublicId;
537
- orderNumber: OrderPublicId;
517
+ id: number;
518
+ orderNumber: string;
538
519
  orderIdentifier: string;
539
520
  invoice: OrderInvoice;
540
521
  }
@@ -556,6 +537,74 @@ interface OrderFilters {
556
537
  }>;
557
538
  }
558
539
 
540
+ /**
541
+ * Payment completion order from process_payment_step; independent of account Order.
542
+ */
543
+
544
+ interface CheckoutInvoiceItem {
545
+ productVariantId: OrderPublicId;
546
+ name: string;
547
+ image?: {
548
+ url?: string;
549
+ };
550
+ variantAttributes: Array<{
551
+ name: string;
552
+ value: string;
553
+ }>;
554
+ singleItemPrice: number;
555
+ noOfItems: number;
556
+ totalItemsPrice: number;
557
+ customerProfit?: number;
558
+ formAttributes?: unknown;
559
+ bookingAttributes?: unknown;
560
+ productVariant: {
561
+ commercialFiles?: Array<{
562
+ id: OrderPublicId;
563
+ }>;
564
+ product: {
565
+ productType: string;
566
+ };
567
+ };
568
+ }
569
+ interface CheckoutShippingItem {
570
+ id: OrderPublicId;
571
+ invoiceItemIds: OrderPublicId[];
572
+ rate: {
573
+ id?: OrderPublicId;
574
+ name: string;
575
+ price: number;
576
+ type?: string;
577
+ icon?: string;
578
+ color?: string;
579
+ };
580
+ }
581
+ interface CheckoutInvoice {
582
+ invoiceItems: CheckoutInvoiceItem[];
583
+ shippingItems: CheckoutShippingItem[];
584
+ netTotal: number;
585
+ finalTotal: number;
586
+ shippingTotal?: number;
587
+ discountTotal?: number;
588
+ creditTotal?: number;
589
+ vat?: number;
590
+ vatPercent?: number;
591
+ itemsTotalRawPrice?: number;
592
+ itemsDiscount?: number;
593
+ customerProfit?: number;
594
+ customerProfitPercentage?: number;
595
+ discountUsages?: Array<{
596
+ discountCode?: {
597
+ code?: string;
598
+ };
599
+ }>;
600
+ }
601
+ interface CheckoutOrder {
602
+ id: OrderPublicId;
603
+ orderNumber: OrderPublicId;
604
+ orderIdentifier: string;
605
+ invoice: CheckoutInvoice;
606
+ }
607
+
559
608
  /**
560
609
  * Payment-related types
561
610
  */
@@ -604,10 +653,10 @@ type PaymentAction = PaymentActionBase & ({
604
653
  time?: number;
605
654
  } | {
606
655
  action: 'show_order';
607
- order: Order;
656
+ order: CheckoutOrder;
608
657
  } | {
609
658
  action: 'pending';
610
- order: Order;
659
+ order: CheckoutOrder;
611
660
  } | {
612
661
  action: 'payment_fail_error' | 'show_error' | 'FAIL';
613
662
  } | {
@@ -2392,4 +2441,4 @@ declare function transformAddToCartInput(variantId: number, quantity: number, fo
2392
2441
  declare function transformCreateCartInput(input: TransformValue): TransformObject;
2393
2442
 
2394
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 };
2395
- 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 };