@alphabite/medusa-sdk 0.6.6 → 0.6.8

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
@@ -1,7 +1,6 @@
1
1
  import Medusa, { ClientHeaders } from '@medusajs/js-sdk';
2
2
  import { BaseProductVariant, BaseProduct } from '@medusajs/types/dist/http/product/common';
3
3
  import { FindParams, RemoteQueryFunctionReturnPagination, PriceDTO, StoreCartAddress, StoreCartLineItem, CustomerDTO, ProductDTO, FileDTO } from '@medusajs/types';
4
- import { City, Quarter } from '@alphabite/econt-types';
5
4
 
6
5
  /**
7
6
  * Standard paginated response structure for list endpoints
@@ -338,6 +337,158 @@ declare const reviewsPlugin: Plugin<'reviews', ReviewsEndpoints>;
338
337
  * Currently supports Bulgaria, can be extended with additional countries
339
338
  */
340
339
  type CountryCode = 'BGR';
340
+ /**
341
+ * Econt City entity returned from the API
342
+ */
343
+ interface EcontCity {
344
+ /**
345
+ * Medusa-generated ID with prefix (e.g., "ecty_...")
346
+ */
347
+ id: string;
348
+ /**
349
+ * Econt API ID
350
+ */
351
+ econtId: number;
352
+ /**
353
+ * City name in local language
354
+ */
355
+ name: string;
356
+ /**
357
+ * City name in English
358
+ */
359
+ nameEn: string;
360
+ /**
361
+ * ISO 3166-1 alpha-3 country code
362
+ */
363
+ countryCode: string;
364
+ /**
365
+ * Postal code for the city
366
+ */
367
+ postalCode: string;
368
+ }
369
+ /**
370
+ * Econt Quarter entity returned from the API
371
+ */
372
+ interface EcontQuarter {
373
+ /**
374
+ * Medusa-generated ID with prefix (e.g., "eqtr_...")
375
+ */
376
+ id: string;
377
+ /**
378
+ * Econt quarter ID (can be null for auto-extracted quarters)
379
+ */
380
+ econtId: string | null;
381
+ /**
382
+ * Quarter name in local language
383
+ */
384
+ name: string;
385
+ /**
386
+ * Quarter name in English
387
+ */
388
+ nameEn: string;
389
+ /**
390
+ * Econt city ID
391
+ */
392
+ econtCityId: number;
393
+ }
394
+ /**
395
+ * Econt Office entity returned from the API
396
+ */
397
+ interface EcontOffice {
398
+ /**
399
+ * Medusa-generated ID with prefix (e.g., "eofc_...")
400
+ */
401
+ id: string;
402
+ /**
403
+ * Econt office ID
404
+ */
405
+ econtId: number;
406
+ /**
407
+ * Econt office code
408
+ */
409
+ econtCode: string;
410
+ /**
411
+ * Office name in local language
412
+ */
413
+ name: string;
414
+ /**
415
+ * Office name in English
416
+ */
417
+ nameEn: string;
418
+ /**
419
+ * Econt city ID
420
+ */
421
+ econtCityId: number;
422
+ /**
423
+ * Econt quarter ID
424
+ */
425
+ econtQuarterId?: string | null;
426
+ /**
427
+ * Full address string
428
+ */
429
+ fullAddress?: string;
430
+ /**
431
+ * Full address string in English
432
+ */
433
+ fullAddressEn?: string;
434
+ /**
435
+ * Latitude coordinate
436
+ */
437
+ latitude?: number;
438
+ /**
439
+ * Longitude coordinate
440
+ */
441
+ longitude?: number;
442
+ /**
443
+ * Array of phone numbers
444
+ */
445
+ phones: string[];
446
+ /**
447
+ * Additional information
448
+ */
449
+ info?: string | null;
450
+ /**
451
+ * Normal business hours start time (ISO 8601)
452
+ */
453
+ normalBusinessHoursFrom: string | Date;
454
+ /**
455
+ * Normal business hours end time (ISO 8601)
456
+ */
457
+ normalBusinessHoursTo: string | Date;
458
+ /**
459
+ * Half day business hours start time (ISO 8601)
460
+ */
461
+ halfDayBusinessHoursFrom?: string | Date | null;
462
+ /**
463
+ * Half day business hours end time (ISO 8601)
464
+ */
465
+ halfDayBusinessHoursTo?: string | Date | null;
466
+ }
467
+ /**
468
+ * Econt Street entity returned from the API
469
+ */
470
+ interface EcontStreet {
471
+ /**
472
+ * Medusa-generated ID with prefix (e.g., "estr_...")
473
+ */
474
+ id: string;
475
+ /**
476
+ * Econt street ID
477
+ */
478
+ econtId: number;
479
+ /**
480
+ * Econt city ID
481
+ */
482
+ econtCityId: number;
483
+ /**
484
+ * Street name in local language
485
+ */
486
+ name: string;
487
+ /**
488
+ * Street name in English
489
+ */
490
+ nameEn: string | null;
491
+ }
341
492
  /**
342
493
  * Address city information for validation
343
494
  */
@@ -411,7 +562,7 @@ interface ValidatedAddress {
411
562
  /**
412
563
  * Validated city with full details (includes id, name, etc.)
413
564
  */
414
- city: City;
565
+ city: EcontCity;
415
566
  /**
416
567
  * Full formatted address string
417
568
  */
@@ -477,10 +628,10 @@ interface ListCitiesInput {
477
628
  */
478
629
  interface ListCitiesOutput {
479
630
  /**
480
- * Array of cities with full details from Econt
481
- * Includes: id, name, nameEn, postCode, region, etc.
631
+ * Array of cities with standard fields
632
+ * Includes: id, econtId, name, nameEn, countryCode
482
633
  */
483
- cities: City[];
634
+ cities: EcontCity[];
484
635
  /**
485
636
  * Total count of cities matching the query
486
637
  */
@@ -504,10 +655,10 @@ interface ListQuartersInput {
504
655
  */
505
656
  countryCode?: CountryCode;
506
657
  /**
507
- * ID of the city to get quarters for
658
+ * Econt City ID to get quarters for
508
659
  * Required parameter
509
660
  */
510
- cityId: string;
661
+ econtCityId: string;
511
662
  /**
512
663
  * Search query to filter quarters by name or nameEn
513
664
  */
@@ -534,10 +685,10 @@ interface ListQuartersInput {
534
685
  */
535
686
  interface ListQuartersOutput {
536
687
  /**
537
- * Array of quarters with details from Econt
538
- * Includes: id, cityID, name, nameEn
688
+ * Array of quarters with standard fields
689
+ * Includes: id, econtId, name, nameEn, econtCityId
539
690
  */
540
- quarters: Quarter[];
691
+ quarters: EcontQuarter[];
541
692
  /**
542
693
  * Total count of quarters matching the query
543
694
  */
@@ -561,24 +712,17 @@ interface ListOfficesInput {
561
712
  */
562
713
  countryCode?: CountryCode;
563
714
  /**
564
- * ID of the city to filter offices by
565
- * At least cityId or officeCode should be provided
566
- */
567
- cityId?: string;
568
- /**
569
- * ID of the quarter to filter offices by
715
+ * Econt City ID to filter offices by
570
716
  */
571
- quarterId?: string;
717
+ econtCityId?: string;
572
718
  /**
573
- * Quarter name to filter offices by
574
- * Only works when cityId is also provided
719
+ * Econt Quarter ID to filter offices by
575
720
  */
576
- quarter?: string;
721
+ econtQuarterId?: string;
577
722
  /**
578
- * Specific office code to retrieve
579
- * Can be used alone or with cityId for faster filtering
723
+ * Specific Econt office code to retrieve
580
724
  */
581
- officeCode?: string;
725
+ econtOfficeCode?: string;
582
726
  /**
583
727
  * Search query to filter offices by name or nameEn
584
728
  */
@@ -601,80 +745,67 @@ interface ListOfficesInput {
601
745
  order?: string;
602
746
  }
603
747
  /**
604
- * Flattened office structure with address fields at top level
748
+ * Response containing list of Econt offices
605
749
  */
606
- interface FlattenedOffice {
607
- /**
608
- * Office code
609
- */
610
- code: string;
611
- /**
612
- * Office name
613
- */
614
- name: string;
615
- /**
616
- * Office name in English
617
- */
618
- nameEn: string;
619
- /**
620
- * City ID
621
- */
622
- cityId: number;
750
+ interface ListOfficesOutput {
623
751
  /**
624
- * Quarter ID
752
+ * Array of offices with standard fields
753
+ * Includes: id, econtId, econtCode, name, nameEn, econtCityId, econtQuarterId, fullAddress, etc.
625
754
  */
626
- quarterId?: string;
755
+ offices: EcontOffice[];
627
756
  /**
628
- * Full address string
757
+ * Total count of offices matching the query
629
758
  */
630
- fullAddress: string;
759
+ count: number;
631
760
  /**
632
- * Full address string in English
761
+ * Maximum number of results per page
633
762
  */
634
- fullAddressEn: string;
763
+ limit: number;
635
764
  /**
636
- * Latitude coordinate
765
+ * Number of results skipped
637
766
  */
638
- latitude: number;
767
+ offset: number;
768
+ }
769
+ /**
770
+ * Input for listing Econt streets with optional filtering
771
+ */
772
+ interface ListStreetsInput {
639
773
  /**
640
- * Longitude coordinate
774
+ * Econt City ID - Required to filter streets by city
641
775
  */
642
- longitude: number;
776
+ econtCityId: string;
643
777
  /**
644
- * Array of phone numbers
778
+ * Search query to filter streets by name or nameEn
645
779
  */
646
- phones: string[];
647
- /**
648
- * Additional information
649
- */
650
- info?: string;
780
+ q?: string;
651
781
  /**
652
- * Normal business hours start time (ISO 8601)
782
+ * Comma-separated list of fields to include
653
783
  */
654
- normalBusinessHoursFrom: string;
784
+ fields?: string;
655
785
  /**
656
- * Normal business hours end time (ISO 8601)
786
+ * Maximum number of results (1-500, default: 50)
657
787
  */
658
- normalBusinessHoursTo: string;
788
+ limit?: number;
659
789
  /**
660
- * Half day business hours start time (ISO 8601)
790
+ * Number of results to skip (default: 0)
661
791
  */
662
- halfDayBusinessHoursFrom?: string;
792
+ offset?: number;
663
793
  /**
664
- * Half day business hours end time (ISO 8601)
794
+ * Sort order (e.g., "name", "-name" for descending)
665
795
  */
666
- halfDayBusinessHoursTo?: string;
796
+ order?: string;
667
797
  }
668
798
  /**
669
- * Response containing list of Econt offices
799
+ * Response containing list of Econt streets
670
800
  */
671
- interface ListOfficesOutput {
801
+ interface ListStreetsOutput {
672
802
  /**
673
- * Array of offices with flattened structure and address fields at top level
803
+ * Array of streets with standard fields
804
+ * Includes: id, econtId, econtCityId, name, nameEn
674
805
  */
675
- offices: FlattenedOffice[];
806
+ streets: EcontStreet[];
676
807
  /**
677
- * Total count of offices matching the query
808
+ * Total count of streets matching the query
678
809
  */
679
810
  count: number;
680
811
  /**
@@ -711,6 +842,11 @@ type EcontEndpoints = {
711
842
  * All data is served from hierarchical cache for instant responses
712
843
  */
713
844
  listOffices: (input: ListOfficesInput, headers?: ClientHeaders) => Promise<ListOfficesOutput>;
845
+ /**
846
+ * Lists Econt streets for a specific city with optional filtering and pagination
847
+ * Requires econtCityId to filter streets by city
848
+ */
849
+ listStreets: (input: ListStreetsInput, headers?: ClientHeaders) => Promise<ListStreetsOutput>;
714
850
  };
715
851
  /**
716
852
  * Econt fulfillment provider plugin
@@ -785,4 +921,4 @@ declare class AlphabiteMedusaSdk<TPlugins extends readonly Plugin<any, any>[], T
785
921
  constructor(medusaOptions: AlphabiteMedusaConfig, plugins: TPlugins, options?: TOptions);
786
922
  }
787
923
 
788
- export { type AddItemToWishlistInput, type AddItemToWishlistOutput, type AggregateCounts, type AggregateCountsInput, type AggregateCountsOutput, type AlphabiteClientOptions, type AlphabiteMedusaConfig, AlphabiteMedusaSdk, type CountryCode, type CreateClientTokenOutput, type CreateReviewInput, type CreateReviewOutput, type CreateWishlistInput, type CreateWishlistOutput, type DeleteReviewInput, type DeleteReviewOutput, type DeleteWishlistInput, type DeleteWishlistOutput, type FlattenedOffice, type ImportWishlistInput, type ImportWishlistOutput, type ListCitiesInput, type ListCitiesOutput, type ListItemsInput, type ListItemsOutput, type ListOfficesInput, type ListOfficesOutput, type ListProductReviewsInput, type ListProductReviewsOutput, type ListQuartersInput, type ListQuartersOutput, type ListReviewsInput, type ListReviewsOutput, type ListWishlistsInput, type ListWishlistsOutput, type PaypalPaymentSessionInputData, type Plugin, type PluginsToAlphabite, type ProductCategoryImage, type ProductCollectionImage, type ProductVariantImage, type RemoveItemFromWishlistInput, type RemoveItemFromWishlistOutput, type RetrieveWishlistInput, type RetrieveWishlistOutput, type Review, type ShareWishlistInput, type ShareWishlistOutput, type TotalItemsCountInput, type TotalItemsCountOutput, type TransferWishlistInput, type TransferWishlistOutput, type UpdateWishlistInput, type UpdateWishlistOutput, type UploadImageFilesInput, type ValidateAddressCity, type ValidateAddressInput, type ValidateAddressInputAddress, type ValidateAddressLocation, type ValidateAddressOutput, type ValidatedAddress, type Wishlist, type WishlistItem, econtPlugin, paypalPlugin, reviewsPlugin, wishlistPlugin };
924
+ export { type AddItemToWishlistInput, type AddItemToWishlistOutput, type AggregateCounts, type AggregateCountsInput, type AggregateCountsOutput, type AlphabiteClientOptions, type AlphabiteMedusaConfig, AlphabiteMedusaSdk, type CountryCode, type CreateClientTokenOutput, type CreateReviewInput, type CreateReviewOutput, type CreateWishlistInput, type CreateWishlistOutput, type DeleteReviewInput, type DeleteReviewOutput, type DeleteWishlistInput, type DeleteWishlistOutput, type EcontCity, type EcontOffice, type EcontQuarter, type EcontStreet, type ImportWishlistInput, type ImportWishlistOutput, type ListCitiesInput, type ListCitiesOutput, type ListItemsInput, type ListItemsOutput, type ListOfficesInput, type ListOfficesOutput, type ListProductReviewsInput, type ListProductReviewsOutput, type ListQuartersInput, type ListQuartersOutput, type ListReviewsInput, type ListReviewsOutput, type ListStreetsInput, type ListStreetsOutput, type ListWishlistsInput, type ListWishlistsOutput, type PaypalPaymentSessionInputData, type Plugin, type PluginsToAlphabite, type ProductCategoryImage, type ProductCollectionImage, type ProductVariantImage, type RemoveItemFromWishlistInput, type RemoveItemFromWishlistOutput, type RetrieveWishlistInput, type RetrieveWishlistOutput, type Review, type ShareWishlistInput, type ShareWishlistOutput, type TotalItemsCountInput, type TotalItemsCountOutput, type TransferWishlistInput, type TransferWishlistOutput, type UpdateWishlistInput, type UpdateWishlistOutput, type UploadImageFilesInput, type ValidateAddressCity, type ValidateAddressInput, type ValidateAddressInputAddress, type ValidateAddressLocation, type ValidateAddressOutput, type ValidatedAddress, type Wishlist, type WishlistItem, econtPlugin, paypalPlugin, reviewsPlugin, wishlistPlugin };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import Medusa, { ClientHeaders } from '@medusajs/js-sdk';
2
2
  import { BaseProductVariant, BaseProduct } from '@medusajs/types/dist/http/product/common';
3
3
  import { FindParams, RemoteQueryFunctionReturnPagination, PriceDTO, StoreCartAddress, StoreCartLineItem, CustomerDTO, ProductDTO, FileDTO } from '@medusajs/types';
4
- import { City, Quarter } from '@alphabite/econt-types';
5
4
 
6
5
  /**
7
6
  * Standard paginated response structure for list endpoints
@@ -338,6 +337,158 @@ declare const reviewsPlugin: Plugin<'reviews', ReviewsEndpoints>;
338
337
  * Currently supports Bulgaria, can be extended with additional countries
339
338
  */
340
339
  type CountryCode = 'BGR';
340
+ /**
341
+ * Econt City entity returned from the API
342
+ */
343
+ interface EcontCity {
344
+ /**
345
+ * Medusa-generated ID with prefix (e.g., "ecty_...")
346
+ */
347
+ id: string;
348
+ /**
349
+ * Econt API ID
350
+ */
351
+ econtId: number;
352
+ /**
353
+ * City name in local language
354
+ */
355
+ name: string;
356
+ /**
357
+ * City name in English
358
+ */
359
+ nameEn: string;
360
+ /**
361
+ * ISO 3166-1 alpha-3 country code
362
+ */
363
+ countryCode: string;
364
+ /**
365
+ * Postal code for the city
366
+ */
367
+ postalCode: string;
368
+ }
369
+ /**
370
+ * Econt Quarter entity returned from the API
371
+ */
372
+ interface EcontQuarter {
373
+ /**
374
+ * Medusa-generated ID with prefix (e.g., "eqtr_...")
375
+ */
376
+ id: string;
377
+ /**
378
+ * Econt quarter ID (can be null for auto-extracted quarters)
379
+ */
380
+ econtId: string | null;
381
+ /**
382
+ * Quarter name in local language
383
+ */
384
+ name: string;
385
+ /**
386
+ * Quarter name in English
387
+ */
388
+ nameEn: string;
389
+ /**
390
+ * Econt city ID
391
+ */
392
+ econtCityId: number;
393
+ }
394
+ /**
395
+ * Econt Office entity returned from the API
396
+ */
397
+ interface EcontOffice {
398
+ /**
399
+ * Medusa-generated ID with prefix (e.g., "eofc_...")
400
+ */
401
+ id: string;
402
+ /**
403
+ * Econt office ID
404
+ */
405
+ econtId: number;
406
+ /**
407
+ * Econt office code
408
+ */
409
+ econtCode: string;
410
+ /**
411
+ * Office name in local language
412
+ */
413
+ name: string;
414
+ /**
415
+ * Office name in English
416
+ */
417
+ nameEn: string;
418
+ /**
419
+ * Econt city ID
420
+ */
421
+ econtCityId: number;
422
+ /**
423
+ * Econt quarter ID
424
+ */
425
+ econtQuarterId?: string | null;
426
+ /**
427
+ * Full address string
428
+ */
429
+ fullAddress?: string;
430
+ /**
431
+ * Full address string in English
432
+ */
433
+ fullAddressEn?: string;
434
+ /**
435
+ * Latitude coordinate
436
+ */
437
+ latitude?: number;
438
+ /**
439
+ * Longitude coordinate
440
+ */
441
+ longitude?: number;
442
+ /**
443
+ * Array of phone numbers
444
+ */
445
+ phones: string[];
446
+ /**
447
+ * Additional information
448
+ */
449
+ info?: string | null;
450
+ /**
451
+ * Normal business hours start time (ISO 8601)
452
+ */
453
+ normalBusinessHoursFrom: string | Date;
454
+ /**
455
+ * Normal business hours end time (ISO 8601)
456
+ */
457
+ normalBusinessHoursTo: string | Date;
458
+ /**
459
+ * Half day business hours start time (ISO 8601)
460
+ */
461
+ halfDayBusinessHoursFrom?: string | Date | null;
462
+ /**
463
+ * Half day business hours end time (ISO 8601)
464
+ */
465
+ halfDayBusinessHoursTo?: string | Date | null;
466
+ }
467
+ /**
468
+ * Econt Street entity returned from the API
469
+ */
470
+ interface EcontStreet {
471
+ /**
472
+ * Medusa-generated ID with prefix (e.g., "estr_...")
473
+ */
474
+ id: string;
475
+ /**
476
+ * Econt street ID
477
+ */
478
+ econtId: number;
479
+ /**
480
+ * Econt city ID
481
+ */
482
+ econtCityId: number;
483
+ /**
484
+ * Street name in local language
485
+ */
486
+ name: string;
487
+ /**
488
+ * Street name in English
489
+ */
490
+ nameEn: string | null;
491
+ }
341
492
  /**
342
493
  * Address city information for validation
343
494
  */
@@ -411,7 +562,7 @@ interface ValidatedAddress {
411
562
  /**
412
563
  * Validated city with full details (includes id, name, etc.)
413
564
  */
414
- city: City;
565
+ city: EcontCity;
415
566
  /**
416
567
  * Full formatted address string
417
568
  */
@@ -477,10 +628,10 @@ interface ListCitiesInput {
477
628
  */
478
629
  interface ListCitiesOutput {
479
630
  /**
480
- * Array of cities with full details from Econt
481
- * Includes: id, name, nameEn, postCode, region, etc.
631
+ * Array of cities with standard fields
632
+ * Includes: id, econtId, name, nameEn, countryCode
482
633
  */
483
- cities: City[];
634
+ cities: EcontCity[];
484
635
  /**
485
636
  * Total count of cities matching the query
486
637
  */
@@ -504,10 +655,10 @@ interface ListQuartersInput {
504
655
  */
505
656
  countryCode?: CountryCode;
506
657
  /**
507
- * ID of the city to get quarters for
658
+ * Econt City ID to get quarters for
508
659
  * Required parameter
509
660
  */
510
- cityId: string;
661
+ econtCityId: string;
511
662
  /**
512
663
  * Search query to filter quarters by name or nameEn
513
664
  */
@@ -534,10 +685,10 @@ interface ListQuartersInput {
534
685
  */
535
686
  interface ListQuartersOutput {
536
687
  /**
537
- * Array of quarters with details from Econt
538
- * Includes: id, cityID, name, nameEn
688
+ * Array of quarters with standard fields
689
+ * Includes: id, econtId, name, nameEn, econtCityId
539
690
  */
540
- quarters: Quarter[];
691
+ quarters: EcontQuarter[];
541
692
  /**
542
693
  * Total count of quarters matching the query
543
694
  */
@@ -561,24 +712,17 @@ interface ListOfficesInput {
561
712
  */
562
713
  countryCode?: CountryCode;
563
714
  /**
564
- * ID of the city to filter offices by
565
- * At least cityId or officeCode should be provided
566
- */
567
- cityId?: string;
568
- /**
569
- * ID of the quarter to filter offices by
715
+ * Econt City ID to filter offices by
570
716
  */
571
- quarterId?: string;
717
+ econtCityId?: string;
572
718
  /**
573
- * Quarter name to filter offices by
574
- * Only works when cityId is also provided
719
+ * Econt Quarter ID to filter offices by
575
720
  */
576
- quarter?: string;
721
+ econtQuarterId?: string;
577
722
  /**
578
- * Specific office code to retrieve
579
- * Can be used alone or with cityId for faster filtering
723
+ * Specific Econt office code to retrieve
580
724
  */
581
- officeCode?: string;
725
+ econtOfficeCode?: string;
582
726
  /**
583
727
  * Search query to filter offices by name or nameEn
584
728
  */
@@ -601,80 +745,67 @@ interface ListOfficesInput {
601
745
  order?: string;
602
746
  }
603
747
  /**
604
- * Flattened office structure with address fields at top level
748
+ * Response containing list of Econt offices
605
749
  */
606
- interface FlattenedOffice {
607
- /**
608
- * Office code
609
- */
610
- code: string;
611
- /**
612
- * Office name
613
- */
614
- name: string;
615
- /**
616
- * Office name in English
617
- */
618
- nameEn: string;
619
- /**
620
- * City ID
621
- */
622
- cityId: number;
750
+ interface ListOfficesOutput {
623
751
  /**
624
- * Quarter ID
752
+ * Array of offices with standard fields
753
+ * Includes: id, econtId, econtCode, name, nameEn, econtCityId, econtQuarterId, fullAddress, etc.
625
754
  */
626
- quarterId?: string;
755
+ offices: EcontOffice[];
627
756
  /**
628
- * Full address string
757
+ * Total count of offices matching the query
629
758
  */
630
- fullAddress: string;
759
+ count: number;
631
760
  /**
632
- * Full address string in English
761
+ * Maximum number of results per page
633
762
  */
634
- fullAddressEn: string;
763
+ limit: number;
635
764
  /**
636
- * Latitude coordinate
765
+ * Number of results skipped
637
766
  */
638
- latitude: number;
767
+ offset: number;
768
+ }
769
+ /**
770
+ * Input for listing Econt streets with optional filtering
771
+ */
772
+ interface ListStreetsInput {
639
773
  /**
640
- * Longitude coordinate
774
+ * Econt City ID - Required to filter streets by city
641
775
  */
642
- longitude: number;
776
+ econtCityId: string;
643
777
  /**
644
- * Array of phone numbers
778
+ * Search query to filter streets by name or nameEn
645
779
  */
646
- phones: string[];
647
- /**
648
- * Additional information
649
- */
650
- info?: string;
780
+ q?: string;
651
781
  /**
652
- * Normal business hours start time (ISO 8601)
782
+ * Comma-separated list of fields to include
653
783
  */
654
- normalBusinessHoursFrom: string;
784
+ fields?: string;
655
785
  /**
656
- * Normal business hours end time (ISO 8601)
786
+ * Maximum number of results (1-500, default: 50)
657
787
  */
658
- normalBusinessHoursTo: string;
788
+ limit?: number;
659
789
  /**
660
- * Half day business hours start time (ISO 8601)
790
+ * Number of results to skip (default: 0)
661
791
  */
662
- halfDayBusinessHoursFrom?: string;
792
+ offset?: number;
663
793
  /**
664
- * Half day business hours end time (ISO 8601)
794
+ * Sort order (e.g., "name", "-name" for descending)
665
795
  */
666
- halfDayBusinessHoursTo?: string;
796
+ order?: string;
667
797
  }
668
798
  /**
669
- * Response containing list of Econt offices
799
+ * Response containing list of Econt streets
670
800
  */
671
- interface ListOfficesOutput {
801
+ interface ListStreetsOutput {
672
802
  /**
673
- * Array of offices with flattened structure and address fields at top level
803
+ * Array of streets with standard fields
804
+ * Includes: id, econtId, econtCityId, name, nameEn
674
805
  */
675
- offices: FlattenedOffice[];
806
+ streets: EcontStreet[];
676
807
  /**
677
- * Total count of offices matching the query
808
+ * Total count of streets matching the query
678
809
  */
679
810
  count: number;
680
811
  /**
@@ -711,6 +842,11 @@ type EcontEndpoints = {
711
842
  * All data is served from hierarchical cache for instant responses
712
843
  */
713
844
  listOffices: (input: ListOfficesInput, headers?: ClientHeaders) => Promise<ListOfficesOutput>;
845
+ /**
846
+ * Lists Econt streets for a specific city with optional filtering and pagination
847
+ * Requires econtCityId to filter streets by city
848
+ */
849
+ listStreets: (input: ListStreetsInput, headers?: ClientHeaders) => Promise<ListStreetsOutput>;
714
850
  };
715
851
  /**
716
852
  * Econt fulfillment provider plugin
@@ -785,4 +921,4 @@ declare class AlphabiteMedusaSdk<TPlugins extends readonly Plugin<any, any>[], T
785
921
  constructor(medusaOptions: AlphabiteMedusaConfig, plugins: TPlugins, options?: TOptions);
786
922
  }
787
923
 
788
- export { type AddItemToWishlistInput, type AddItemToWishlistOutput, type AggregateCounts, type AggregateCountsInput, type AggregateCountsOutput, type AlphabiteClientOptions, type AlphabiteMedusaConfig, AlphabiteMedusaSdk, type CountryCode, type CreateClientTokenOutput, type CreateReviewInput, type CreateReviewOutput, type CreateWishlistInput, type CreateWishlistOutput, type DeleteReviewInput, type DeleteReviewOutput, type DeleteWishlistInput, type DeleteWishlistOutput, type FlattenedOffice, type ImportWishlistInput, type ImportWishlistOutput, type ListCitiesInput, type ListCitiesOutput, type ListItemsInput, type ListItemsOutput, type ListOfficesInput, type ListOfficesOutput, type ListProductReviewsInput, type ListProductReviewsOutput, type ListQuartersInput, type ListQuartersOutput, type ListReviewsInput, type ListReviewsOutput, type ListWishlistsInput, type ListWishlistsOutput, type PaypalPaymentSessionInputData, type Plugin, type PluginsToAlphabite, type ProductCategoryImage, type ProductCollectionImage, type ProductVariantImage, type RemoveItemFromWishlistInput, type RemoveItemFromWishlistOutput, type RetrieveWishlistInput, type RetrieveWishlistOutput, type Review, type ShareWishlistInput, type ShareWishlistOutput, type TotalItemsCountInput, type TotalItemsCountOutput, type TransferWishlistInput, type TransferWishlistOutput, type UpdateWishlistInput, type UpdateWishlistOutput, type UploadImageFilesInput, type ValidateAddressCity, type ValidateAddressInput, type ValidateAddressInputAddress, type ValidateAddressLocation, type ValidateAddressOutput, type ValidatedAddress, type Wishlist, type WishlistItem, econtPlugin, paypalPlugin, reviewsPlugin, wishlistPlugin };
924
+ export { type AddItemToWishlistInput, type AddItemToWishlistOutput, type AggregateCounts, type AggregateCountsInput, type AggregateCountsOutput, type AlphabiteClientOptions, type AlphabiteMedusaConfig, AlphabiteMedusaSdk, type CountryCode, type CreateClientTokenOutput, type CreateReviewInput, type CreateReviewOutput, type CreateWishlistInput, type CreateWishlistOutput, type DeleteReviewInput, type DeleteReviewOutput, type DeleteWishlistInput, type DeleteWishlistOutput, type EcontCity, type EcontOffice, type EcontQuarter, type EcontStreet, type ImportWishlistInput, type ImportWishlistOutput, type ListCitiesInput, type ListCitiesOutput, type ListItemsInput, type ListItemsOutput, type ListOfficesInput, type ListOfficesOutput, type ListProductReviewsInput, type ListProductReviewsOutput, type ListQuartersInput, type ListQuartersOutput, type ListReviewsInput, type ListReviewsOutput, type ListStreetsInput, type ListStreetsOutput, type ListWishlistsInput, type ListWishlistsOutput, type PaypalPaymentSessionInputData, type Plugin, type PluginsToAlphabite, type ProductCategoryImage, type ProductCollectionImage, type ProductVariantImage, type RemoveItemFromWishlistInput, type RemoveItemFromWishlistOutput, type RetrieveWishlistInput, type RetrieveWishlistOutput, type Review, type ShareWishlistInput, type ShareWishlistOutput, type TotalItemsCountInput, type TotalItemsCountOutput, type TransferWishlistInput, type TransferWishlistOutput, type UpdateWishlistInput, type UpdateWishlistOutput, type UploadImageFilesInput, type ValidateAddressCity, type ValidateAddressInput, type ValidateAddressInputAddress, type ValidateAddressLocation, type ValidateAddressOutput, type ValidatedAddress, type Wishlist, type WishlistItem, econtPlugin, paypalPlugin, reviewsPlugin, wishlistPlugin };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- 'use strict';var u=require('@medusajs/js-sdk');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var u__default=/*#__PURE__*/_interopDefault(u);var l={name:"wishlist",endpoints:(r,s)=>({create:async({...t},e)=>r.client.fetch("/store/wishlists",{method:"POST",body:t,headers:{...await s?.getAuthHeader?.(),...e}}),list:async({limit:t=10,offset:e=0,...i},n)=>r.client.fetch("/store/wishlists",{method:"GET",headers:{...await s?.getAuthHeader?.(),...n},query:{limit:t,offset:e,...i}}),retrieve:async({id:t,...e},i)=>r.client.fetch(`/store/wishlists/${t}`,{method:"GET",headers:{...await s?.getAuthHeader?.(),...i},query:e}),update:async({id:t,...e},i)=>r.client.fetch(`/store/wishlists/${t}`,{method:"PUT",body:e,headers:{...await s?.getAuthHeader?.(),...i}}),delete:async({id:t},e)=>r.client.fetch(`/store/wishlists/${t}`,{method:"DELETE",headers:{...await s?.getAuthHeader?.(),...e}}),totalItemsCount:async({wishlist_id:t},e)=>r.client.fetch("store/wishlists/total-items-count",{method:"GET",headers:{...await s?.getAuthHeader?.(),...e},query:{wishlist_id:t}}),transfer:async({id:t},e)=>r.client.fetch(`/store/wishlists/${t}/transfer`,{method:"POST",headers:{...await s?.getAuthHeader?.(),...e}}),share:async({id:t},e)=>r.client.fetch(`/store/wishlists/${t}/share`,{method:"POST",headers:{...await s?.getAuthHeader?.(),...e}}),import:async(t,e)=>r.client.fetch("/store/wishlists/import",{method:"POST",body:t,headers:{...await s?.getAuthHeader?.(),...e}}),addItem:async({id:t,...e},i)=>r.client.fetch(`/store/wishlists/${t}/add-item`,{method:"POST",body:e,headers:{...await s?.getAuthHeader?.(),...i}}),listItems:async({id:t,limit:e=10,offset:i=0,...n},a)=>r.client.fetch(`/store/wishlists/${t}/items`,{method:"GET",headers:{...await s?.getAuthHeader?.(),...a},query:{limit:e,offset:i,...n}}),removeItem:async({wishlist_item_id:t,id:e},i)=>r.client.fetch(`/store/wishlists/${e}/items/${t}`,{method:"DELETE",headers:{...await s?.getAuthHeader?.(),...i}})})};var c={name:"paypal",endpoints:(r,s)=>({createClientToken:async t=>r.client.fetch("/store/paypal/client-token",{method:"POST",headers:{...await s?.getAuthHeader?.(),...t}})})};var m={name:"reviews",endpoints:(r,s,t)=>({create:async(e,i)=>r.client.fetch("/store/reviews",{method:"POST",body:e,headers:{...await s?.getAuthHeader?.(),...i}}),list:async({...e},i)=>r.client.fetch("/store/products/reviews",{method:"GET",headers:{...await s?.getAuthHeader?.(),...i},query:e}),listProductReviews:async({product_id:e,...i},n)=>r.client.fetch(`/store/reviews/product/${e}`,{method:"GET",query:i,headers:{...await s?.getAuthHeader?.(),...n}}),aggregateCounts:async({product_id:e,...i},n)=>r.client.fetch(`/store/reviews/product/${e}/aggregate-counts`,{method:"GET",query:i,headers:{...await s?.getAuthHeader?.(),...n}}),delete:async({id:e},i)=>r.client.fetch(`/store/reviews/${e}`,{method:"DELETE",headers:{...await s?.getAuthHeader?.(),...i}}),uploadImageFiles:async(e,i)=>{let n=t?.baseUrl,a=t?.publishableKey;if(!n||!a)throw new Error("Missing baseUrl or publishableKey");return await(await fetch(`${n}/store/reviews/files/images/upload`,{method:"POST",body:e.formData,headers:{...i,"x-publishable-api-key":a}})).json()}})};var f={name:"econt",endpoints:(r,s)=>({validateAddress:async(t,e)=>r.client.fetch("/store/econt/validate-address",{method:"POST",body:t,headers:{...await s?.getAuthHeader?.(),...e}}),listCities:async({countryCode:t="BGR",...e},i)=>r.client.fetch("/store/econt/cities",{method:"GET",headers:{...await s?.getAuthHeader?.(),...i},query:{countryCode:t,...e}}),listQuarters:async({cityId:t,countryCode:e="BGR",...i},n)=>r.client.fetch("/store/econt/quarters",{method:"GET",headers:{...await s?.getAuthHeader?.(),...n},query:{cityId:t,countryCode:e,...i}}),listOffices:async({countryCode:t="BGR",...e},i)=>r.client.fetch("/store/econt/offices",{method:"GET",headers:{...await s?.getAuthHeader?.(),...i},query:{countryCode:t,...e}})})};var o=class extends u__default.default{constructor(s,t,e){super(s),this.options=e,this.medusaConfig=s;let i={};t.forEach(n=>{i[n.name]=n.endpoints(this,this.options,this.medusaConfig);}),this.alphabite=i;}};exports.AlphabiteMedusaSdk=o;exports.econtPlugin=f;exports.paypalPlugin=c;exports.reviewsPlugin=m;exports.wishlistPlugin=l;
1
+ 'use strict';var u=require('@medusajs/js-sdk');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var u__default=/*#__PURE__*/_interopDefault(u);var l={name:"wishlist",endpoints:(r,s)=>({create:async({...t},e)=>r.client.fetch("/store/wishlists",{method:"POST",body:t,headers:{...await s?.getAuthHeader?.(),...e}}),list:async({limit:t=10,offset:e=0,...i},n)=>r.client.fetch("/store/wishlists",{method:"GET",headers:{...await s?.getAuthHeader?.(),...n},query:{limit:t,offset:e,...i}}),retrieve:async({id:t,...e},i)=>r.client.fetch(`/store/wishlists/${t}`,{method:"GET",headers:{...await s?.getAuthHeader?.(),...i},query:e}),update:async({id:t,...e},i)=>r.client.fetch(`/store/wishlists/${t}`,{method:"PUT",body:e,headers:{...await s?.getAuthHeader?.(),...i}}),delete:async({id:t},e)=>r.client.fetch(`/store/wishlists/${t}`,{method:"DELETE",headers:{...await s?.getAuthHeader?.(),...e}}),totalItemsCount:async({wishlist_id:t},e)=>r.client.fetch("store/wishlists/total-items-count",{method:"GET",headers:{...await s?.getAuthHeader?.(),...e},query:{wishlist_id:t}}),transfer:async({id:t},e)=>r.client.fetch(`/store/wishlists/${t}/transfer`,{method:"POST",headers:{...await s?.getAuthHeader?.(),...e}}),share:async({id:t},e)=>r.client.fetch(`/store/wishlists/${t}/share`,{method:"POST",headers:{...await s?.getAuthHeader?.(),...e}}),import:async(t,e)=>r.client.fetch("/store/wishlists/import",{method:"POST",body:t,headers:{...await s?.getAuthHeader?.(),...e}}),addItem:async({id:t,...e},i)=>r.client.fetch(`/store/wishlists/${t}/add-item`,{method:"POST",body:e,headers:{...await s?.getAuthHeader?.(),...i}}),listItems:async({id:t,limit:e=10,offset:i=0,...n},a)=>r.client.fetch(`/store/wishlists/${t}/items`,{method:"GET",headers:{...await s?.getAuthHeader?.(),...a},query:{limit:e,offset:i,...n}}),removeItem:async({wishlist_item_id:t,id:e},i)=>r.client.fetch(`/store/wishlists/${e}/items/${t}`,{method:"DELETE",headers:{...await s?.getAuthHeader?.(),...i}})})};var c={name:"paypal",endpoints:(r,s)=>({createClientToken:async t=>r.client.fetch("/store/paypal/client-token",{method:"POST",headers:{...await s?.getAuthHeader?.(),...t}})})};var h={name:"reviews",endpoints:(r,s,t)=>({create:async(e,i)=>r.client.fetch("/store/reviews",{method:"POST",body:e,headers:{...await s?.getAuthHeader?.(),...i}}),list:async({...e},i)=>r.client.fetch("/store/products/reviews",{method:"GET",headers:{...await s?.getAuthHeader?.(),...i},query:e}),listProductReviews:async({product_id:e,...i},n)=>r.client.fetch(`/store/reviews/product/${e}`,{method:"GET",query:i,headers:{...await s?.getAuthHeader?.(),...n}}),aggregateCounts:async({product_id:e,...i},n)=>r.client.fetch(`/store/reviews/product/${e}/aggregate-counts`,{method:"GET",query:i,headers:{...await s?.getAuthHeader?.(),...n}}),delete:async({id:e},i)=>r.client.fetch(`/store/reviews/${e}`,{method:"DELETE",headers:{...await s?.getAuthHeader?.(),...i}}),uploadImageFiles:async(e,i)=>{let n=t?.baseUrl,a=t?.publishableKey;if(!n||!a)throw new Error("Missing baseUrl or publishableKey");return await(await fetch(`${n}/store/reviews/files/images/upload`,{method:"POST",body:e.formData,headers:{...i,"x-publishable-api-key":a}})).json()}})};var f={name:"econt",endpoints:(r,s)=>({validateAddress:async(t,e)=>r.client.fetch("/store/econt/validate-address",{method:"POST",body:t,headers:{...await s?.getAuthHeader?.(),...e}}),listCities:async({countryCode:t="BGR",...e},i)=>r.client.fetch("/store/econt/cities",{method:"GET",headers:{...await s?.getAuthHeader?.(),...i},query:{countryCode:t,...e}}),listQuarters:async({econtCityId:t,countryCode:e="BGR",...i},n)=>r.client.fetch("/store/econt/quarters",{method:"GET",headers:{...await s?.getAuthHeader?.(),...n},query:{econtCityId:t,countryCode:e,...i}}),listOffices:async({countryCode:t="BGR",...e},i)=>r.client.fetch("/store/econt/offices",{method:"GET",headers:{...await s?.getAuthHeader?.(),...i},query:{countryCode:t,...e}}),listStreets:async(t,e)=>r.client.fetch("/store/econt/streets",{method:"GET",headers:{...await s?.getAuthHeader?.(),...e},query:t})})};var o=class extends u__default.default{constructor(s,t,e){super(s),this.options=e,this.medusaConfig=s;let i={};t.forEach(n=>{i[n.name]=n.endpoints(this,this.options,this.medusaConfig);}),this.alphabite=i;}};exports.AlphabiteMedusaSdk=o;exports.econtPlugin=f;exports.paypalPlugin=c;exports.reviewsPlugin=h;exports.wishlistPlugin=l;
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import u from'@medusajs/js-sdk';var l={name:"wishlist",endpoints:(r,s)=>({create:async({...t},e)=>r.client.fetch("/store/wishlists",{method:"POST",body:t,headers:{...await s?.getAuthHeader?.(),...e}}),list:async({limit:t=10,offset:e=0,...i},n)=>r.client.fetch("/store/wishlists",{method:"GET",headers:{...await s?.getAuthHeader?.(),...n},query:{limit:t,offset:e,...i}}),retrieve:async({id:t,...e},i)=>r.client.fetch(`/store/wishlists/${t}`,{method:"GET",headers:{...await s?.getAuthHeader?.(),...i},query:e}),update:async({id:t,...e},i)=>r.client.fetch(`/store/wishlists/${t}`,{method:"PUT",body:e,headers:{...await s?.getAuthHeader?.(),...i}}),delete:async({id:t},e)=>r.client.fetch(`/store/wishlists/${t}`,{method:"DELETE",headers:{...await s?.getAuthHeader?.(),...e}}),totalItemsCount:async({wishlist_id:t},e)=>r.client.fetch("store/wishlists/total-items-count",{method:"GET",headers:{...await s?.getAuthHeader?.(),...e},query:{wishlist_id:t}}),transfer:async({id:t},e)=>r.client.fetch(`/store/wishlists/${t}/transfer`,{method:"POST",headers:{...await s?.getAuthHeader?.(),...e}}),share:async({id:t},e)=>r.client.fetch(`/store/wishlists/${t}/share`,{method:"POST",headers:{...await s?.getAuthHeader?.(),...e}}),import:async(t,e)=>r.client.fetch("/store/wishlists/import",{method:"POST",body:t,headers:{...await s?.getAuthHeader?.(),...e}}),addItem:async({id:t,...e},i)=>r.client.fetch(`/store/wishlists/${t}/add-item`,{method:"POST",body:e,headers:{...await s?.getAuthHeader?.(),...i}}),listItems:async({id:t,limit:e=10,offset:i=0,...n},a)=>r.client.fetch(`/store/wishlists/${t}/items`,{method:"GET",headers:{...await s?.getAuthHeader?.(),...a},query:{limit:e,offset:i,...n}}),removeItem:async({wishlist_item_id:t,id:e},i)=>r.client.fetch(`/store/wishlists/${e}/items/${t}`,{method:"DELETE",headers:{...await s?.getAuthHeader?.(),...i}})})};var c={name:"paypal",endpoints:(r,s)=>({createClientToken:async t=>r.client.fetch("/store/paypal/client-token",{method:"POST",headers:{...await s?.getAuthHeader?.(),...t}})})};var m={name:"reviews",endpoints:(r,s,t)=>({create:async(e,i)=>r.client.fetch("/store/reviews",{method:"POST",body:e,headers:{...await s?.getAuthHeader?.(),...i}}),list:async({...e},i)=>r.client.fetch("/store/products/reviews",{method:"GET",headers:{...await s?.getAuthHeader?.(),...i},query:e}),listProductReviews:async({product_id:e,...i},n)=>r.client.fetch(`/store/reviews/product/${e}`,{method:"GET",query:i,headers:{...await s?.getAuthHeader?.(),...n}}),aggregateCounts:async({product_id:e,...i},n)=>r.client.fetch(`/store/reviews/product/${e}/aggregate-counts`,{method:"GET",query:i,headers:{...await s?.getAuthHeader?.(),...n}}),delete:async({id:e},i)=>r.client.fetch(`/store/reviews/${e}`,{method:"DELETE",headers:{...await s?.getAuthHeader?.(),...i}}),uploadImageFiles:async(e,i)=>{let n=t?.baseUrl,a=t?.publishableKey;if(!n||!a)throw new Error("Missing baseUrl or publishableKey");return await(await fetch(`${n}/store/reviews/files/images/upload`,{method:"POST",body:e.formData,headers:{...i,"x-publishable-api-key":a}})).json()}})};var f={name:"econt",endpoints:(r,s)=>({validateAddress:async(t,e)=>r.client.fetch("/store/econt/validate-address",{method:"POST",body:t,headers:{...await s?.getAuthHeader?.(),...e}}),listCities:async({countryCode:t="BGR",...e},i)=>r.client.fetch("/store/econt/cities",{method:"GET",headers:{...await s?.getAuthHeader?.(),...i},query:{countryCode:t,...e}}),listQuarters:async({cityId:t,countryCode:e="BGR",...i},n)=>r.client.fetch("/store/econt/quarters",{method:"GET",headers:{...await s?.getAuthHeader?.(),...n},query:{cityId:t,countryCode:e,...i}}),listOffices:async({countryCode:t="BGR",...e},i)=>r.client.fetch("/store/econt/offices",{method:"GET",headers:{...await s?.getAuthHeader?.(),...i},query:{countryCode:t,...e}})})};var o=class extends u{constructor(s,t,e){super(s),this.options=e,this.medusaConfig=s;let i={};t.forEach(n=>{i[n.name]=n.endpoints(this,this.options,this.medusaConfig);}),this.alphabite=i;}};export{o as AlphabiteMedusaSdk,f as econtPlugin,c as paypalPlugin,m as reviewsPlugin,l as wishlistPlugin};
1
+ import u from'@medusajs/js-sdk';var l={name:"wishlist",endpoints:(r,s)=>({create:async({...t},e)=>r.client.fetch("/store/wishlists",{method:"POST",body:t,headers:{...await s?.getAuthHeader?.(),...e}}),list:async({limit:t=10,offset:e=0,...i},n)=>r.client.fetch("/store/wishlists",{method:"GET",headers:{...await s?.getAuthHeader?.(),...n},query:{limit:t,offset:e,...i}}),retrieve:async({id:t,...e},i)=>r.client.fetch(`/store/wishlists/${t}`,{method:"GET",headers:{...await s?.getAuthHeader?.(),...i},query:e}),update:async({id:t,...e},i)=>r.client.fetch(`/store/wishlists/${t}`,{method:"PUT",body:e,headers:{...await s?.getAuthHeader?.(),...i}}),delete:async({id:t},e)=>r.client.fetch(`/store/wishlists/${t}`,{method:"DELETE",headers:{...await s?.getAuthHeader?.(),...e}}),totalItemsCount:async({wishlist_id:t},e)=>r.client.fetch("store/wishlists/total-items-count",{method:"GET",headers:{...await s?.getAuthHeader?.(),...e},query:{wishlist_id:t}}),transfer:async({id:t},e)=>r.client.fetch(`/store/wishlists/${t}/transfer`,{method:"POST",headers:{...await s?.getAuthHeader?.(),...e}}),share:async({id:t},e)=>r.client.fetch(`/store/wishlists/${t}/share`,{method:"POST",headers:{...await s?.getAuthHeader?.(),...e}}),import:async(t,e)=>r.client.fetch("/store/wishlists/import",{method:"POST",body:t,headers:{...await s?.getAuthHeader?.(),...e}}),addItem:async({id:t,...e},i)=>r.client.fetch(`/store/wishlists/${t}/add-item`,{method:"POST",body:e,headers:{...await s?.getAuthHeader?.(),...i}}),listItems:async({id:t,limit:e=10,offset:i=0,...n},a)=>r.client.fetch(`/store/wishlists/${t}/items`,{method:"GET",headers:{...await s?.getAuthHeader?.(),...a},query:{limit:e,offset:i,...n}}),removeItem:async({wishlist_item_id:t,id:e},i)=>r.client.fetch(`/store/wishlists/${e}/items/${t}`,{method:"DELETE",headers:{...await s?.getAuthHeader?.(),...i}})})};var c={name:"paypal",endpoints:(r,s)=>({createClientToken:async t=>r.client.fetch("/store/paypal/client-token",{method:"POST",headers:{...await s?.getAuthHeader?.(),...t}})})};var h={name:"reviews",endpoints:(r,s,t)=>({create:async(e,i)=>r.client.fetch("/store/reviews",{method:"POST",body:e,headers:{...await s?.getAuthHeader?.(),...i}}),list:async({...e},i)=>r.client.fetch("/store/products/reviews",{method:"GET",headers:{...await s?.getAuthHeader?.(),...i},query:e}),listProductReviews:async({product_id:e,...i},n)=>r.client.fetch(`/store/reviews/product/${e}`,{method:"GET",query:i,headers:{...await s?.getAuthHeader?.(),...n}}),aggregateCounts:async({product_id:e,...i},n)=>r.client.fetch(`/store/reviews/product/${e}/aggregate-counts`,{method:"GET",query:i,headers:{...await s?.getAuthHeader?.(),...n}}),delete:async({id:e},i)=>r.client.fetch(`/store/reviews/${e}`,{method:"DELETE",headers:{...await s?.getAuthHeader?.(),...i}}),uploadImageFiles:async(e,i)=>{let n=t?.baseUrl,a=t?.publishableKey;if(!n||!a)throw new Error("Missing baseUrl or publishableKey");return await(await fetch(`${n}/store/reviews/files/images/upload`,{method:"POST",body:e.formData,headers:{...i,"x-publishable-api-key":a}})).json()}})};var f={name:"econt",endpoints:(r,s)=>({validateAddress:async(t,e)=>r.client.fetch("/store/econt/validate-address",{method:"POST",body:t,headers:{...await s?.getAuthHeader?.(),...e}}),listCities:async({countryCode:t="BGR",...e},i)=>r.client.fetch("/store/econt/cities",{method:"GET",headers:{...await s?.getAuthHeader?.(),...i},query:{countryCode:t,...e}}),listQuarters:async({econtCityId:t,countryCode:e="BGR",...i},n)=>r.client.fetch("/store/econt/quarters",{method:"GET",headers:{...await s?.getAuthHeader?.(),...n},query:{econtCityId:t,countryCode:e,...i}}),listOffices:async({countryCode:t="BGR",...e},i)=>r.client.fetch("/store/econt/offices",{method:"GET",headers:{...await s?.getAuthHeader?.(),...i},query:{countryCode:t,...e}}),listStreets:async(t,e)=>r.client.fetch("/store/econt/streets",{method:"GET",headers:{...await s?.getAuthHeader?.(),...e},query:t})})};var o=class extends u{constructor(s,t,e){super(s),this.options=e,this.medusaConfig=s;let i={};t.forEach(n=>{i[n.name]=n.endpoints(this,this.options,this.medusaConfig);}),this.alphabite=i;}};export{o as AlphabiteMedusaSdk,f as econtPlugin,c as paypalPlugin,h as reviewsPlugin,l as wishlistPlugin};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alphabite/medusa-sdk",
3
- "version": "0.6.6",
3
+ "version": "0.6.8",
4
4
  "description": "Extended Medusa utility sdk client, that adds Alphabite's plugins endpoints",
5
5
  "author": "Alphabite",
6
6
  "license": "MIT",
@@ -46,7 +46,5 @@
46
46
  "url": "git+ssh://git@github.com/alphabite-soft/medusa-sdk.git"
47
47
  },
48
48
  "packageManager": "yarn@1.22.22+sha1.ac34549e6aa8e7ead463a7407e1c7390f61a6610",
49
- "dependencies": {
50
- "@alphabite/econt-types": "^1.1.0"
51
- }
49
+ "dependencies": {}
52
50
  }