@alphabite/medusa-sdk 0.6.5 → 0.6.7

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, Office } from '@alphabite/econt-types';
5
4
 
6
5
  /**
7
6
  * Standard paginated response structure for list endpoints
@@ -338,6 +337,154 @@ 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
+ /**
366
+ * Econt Quarter entity returned from the API
367
+ */
368
+ interface EcontQuarter {
369
+ /**
370
+ * Medusa-generated ID with prefix (e.g., "eqtr_...")
371
+ */
372
+ id: string;
373
+ /**
374
+ * Econt quarter ID (can be null for auto-extracted quarters)
375
+ */
376
+ econtId: string | null;
377
+ /**
378
+ * Quarter name in local language
379
+ */
380
+ name: string;
381
+ /**
382
+ * Quarter name in English
383
+ */
384
+ nameEn: string;
385
+ /**
386
+ * Econt city ID
387
+ */
388
+ econtCityId: number;
389
+ }
390
+ /**
391
+ * Econt Office entity returned from the API
392
+ */
393
+ interface EcontOffice {
394
+ /**
395
+ * Medusa-generated ID with prefix (e.g., "eofc_...")
396
+ */
397
+ id: string;
398
+ /**
399
+ * Econt office ID
400
+ */
401
+ econtId: number;
402
+ /**
403
+ * Econt office code
404
+ */
405
+ econtCode: string;
406
+ /**
407
+ * Office name in local language
408
+ */
409
+ name: string;
410
+ /**
411
+ * Office name in English
412
+ */
413
+ nameEn: string;
414
+ /**
415
+ * Econt city ID
416
+ */
417
+ econtCityId: number;
418
+ /**
419
+ * Econt quarter ID
420
+ */
421
+ econtQuarterId?: string | null;
422
+ /**
423
+ * Full address string
424
+ */
425
+ fullAddress?: string;
426
+ /**
427
+ * Full address string in English
428
+ */
429
+ fullAddressEn?: string;
430
+ /**
431
+ * Latitude coordinate
432
+ */
433
+ latitude?: number;
434
+ /**
435
+ * Longitude coordinate
436
+ */
437
+ longitude?: number;
438
+ /**
439
+ * Array of phone numbers
440
+ */
441
+ phones: string[];
442
+ /**
443
+ * Additional information
444
+ */
445
+ info?: string | null;
446
+ /**
447
+ * Normal business hours start time (ISO 8601)
448
+ */
449
+ normalBusinessHoursFrom: string | Date;
450
+ /**
451
+ * Normal business hours end time (ISO 8601)
452
+ */
453
+ normalBusinessHoursTo: string | Date;
454
+ /**
455
+ * Half day business hours start time (ISO 8601)
456
+ */
457
+ halfDayBusinessHoursFrom?: string | Date | null;
458
+ /**
459
+ * Half day business hours end time (ISO 8601)
460
+ */
461
+ halfDayBusinessHoursTo?: string | Date | null;
462
+ }
463
+ /**
464
+ * Econt Street entity returned from the API
465
+ */
466
+ interface EcontStreet {
467
+ /**
468
+ * Medusa-generated ID with prefix (e.g., "estr_...")
469
+ */
470
+ id: string;
471
+ /**
472
+ * Econt street ID
473
+ */
474
+ econtId: number;
475
+ /**
476
+ * Econt city ID
477
+ */
478
+ econtCityId: number;
479
+ /**
480
+ * Street name in local language
481
+ */
482
+ name: string;
483
+ /**
484
+ * Street name in English
485
+ */
486
+ nameEn: string | null;
487
+ }
341
488
  /**
342
489
  * Address city information for validation
343
490
  */
@@ -411,7 +558,7 @@ interface ValidatedAddress {
411
558
  /**
412
559
  * Validated city with full details (includes id, name, etc.)
413
560
  */
414
- city: City;
561
+ city: EcontCity;
415
562
  /**
416
563
  * Full formatted address string
417
564
  */
@@ -460,7 +607,7 @@ interface ListCitiesInput {
460
607
  */
461
608
  fields?: string;
462
609
  /**
463
- * Maximum number of results (1-100, default: 15)
610
+ * Maximum number of results (1-500, default: 15)
464
611
  */
465
612
  limit?: number;
466
613
  /**
@@ -477,10 +624,22 @@ interface ListCitiesInput {
477
624
  */
478
625
  interface ListCitiesOutput {
479
626
  /**
480
- * Array of cities with full details from Econt
481
- * Includes: id, name, nameEn, postCode, region, etc.
627
+ * Array of cities with standard fields
628
+ * Includes: id, econtId, name, nameEn, countryCode
629
+ */
630
+ cities: EcontCity[];
631
+ /**
632
+ * Total count of cities matching the query
633
+ */
634
+ count: number;
635
+ /**
636
+ * Maximum number of results per page
637
+ */
638
+ limit: number;
639
+ /**
640
+ * Number of results skipped
482
641
  */
483
- cities: City[];
642
+ offset: number;
484
643
  }
485
644
  /**
486
645
  * Input for listing quarters (neighborhoods) in a city
@@ -492,10 +651,10 @@ interface ListQuartersInput {
492
651
  */
493
652
  countryCode?: CountryCode;
494
653
  /**
495
- * ID of the city to get quarters for
654
+ * Econt City ID to get quarters for
496
655
  * Required parameter
497
656
  */
498
- cityId: string;
657
+ econtCityId: string;
499
658
  /**
500
659
  * Search query to filter quarters by name or nameEn
501
660
  */
@@ -505,7 +664,7 @@ interface ListQuartersInput {
505
664
  */
506
665
  fields?: string;
507
666
  /**
508
- * Maximum number of results (1-100, default: 15)
667
+ * Maximum number of results (1-500, default: 15)
509
668
  */
510
669
  limit?: number;
511
670
  /**
@@ -522,10 +681,22 @@ interface ListQuartersInput {
522
681
  */
523
682
  interface ListQuartersOutput {
524
683
  /**
525
- * Array of quarters with details from Econt
526
- * Includes: id, cityID, name, nameEn
684
+ * Array of quarters with standard fields
685
+ * Includes: id, econtId, name, nameEn, econtCityId
686
+ */
687
+ quarters: EcontQuarter[];
688
+ /**
689
+ * Total count of quarters matching the query
690
+ */
691
+ count: number;
692
+ /**
693
+ * Maximum number of results per page
694
+ */
695
+ limit: number;
696
+ /**
697
+ * Number of results skipped
527
698
  */
528
- quarters: Quarter[];
699
+ offset: number;
529
700
  }
530
701
  /**
531
702
  * Input for listing Econt offices with optional filtering
@@ -537,24 +708,17 @@ interface ListOfficesInput {
537
708
  */
538
709
  countryCode?: CountryCode;
539
710
  /**
540
- * ID of the city to filter offices by
541
- * At least cityId or officeCode should be provided
711
+ * Econt City ID to filter offices by
542
712
  */
543
- cityId?: string;
713
+ econtCityId?: string;
544
714
  /**
545
- * ID of the quarter to filter offices by
715
+ * Econt Quarter ID to filter offices by
546
716
  */
547
- quarterId?: string;
717
+ econtQuarterId?: string;
548
718
  /**
549
- * Quarter name to filter offices by
550
- * Only works when cityId is also provided
719
+ * Specific Econt office code to retrieve
551
720
  */
552
- quarter?: string;
553
- /**
554
- * Specific office code to retrieve
555
- * Can be used alone or with cityId for faster filtering
556
- */
557
- officeCode?: string;
721
+ econtOfficeCode?: string;
558
722
  /**
559
723
  * Search query to filter offices by name or nameEn
560
724
  */
@@ -564,7 +728,7 @@ interface ListOfficesInput {
564
728
  */
565
729
  fields?: string;
566
730
  /**
567
- * Maximum number of results (1-100, default: 15)
731
+ * Maximum number of results (1-500, default: 15)
568
732
  */
569
733
  limit?: number;
570
734
  /**
@@ -581,10 +745,73 @@ interface ListOfficesInput {
581
745
  */
582
746
  interface ListOfficesOutput {
583
747
  /**
584
- * Array of offices with full details from Econt
585
- * Includes: code, name, address, phones, workingHours, etc.
748
+ * Array of offices with standard fields
749
+ * Includes: id, econtId, econtCode, name, nameEn, econtCityId, econtQuarterId, fullAddress, etc.
750
+ */
751
+ offices: EcontOffice[];
752
+ /**
753
+ * Total count of offices matching the query
754
+ */
755
+ count: number;
756
+ /**
757
+ * Maximum number of results per page
758
+ */
759
+ limit: number;
760
+ /**
761
+ * Number of results skipped
586
762
  */
587
- offices: Office[];
763
+ offset: number;
764
+ }
765
+ /**
766
+ * Input for listing Econt streets with optional filtering
767
+ */
768
+ interface ListStreetsInput {
769
+ /**
770
+ * Econt City ID - Required to filter streets by city
771
+ */
772
+ econtCityId: string;
773
+ /**
774
+ * Search query to filter streets by name or nameEn
775
+ */
776
+ q?: string;
777
+ /**
778
+ * Comma-separated list of fields to include
779
+ */
780
+ fields?: string;
781
+ /**
782
+ * Maximum number of results (1-500, default: 50)
783
+ */
784
+ limit?: number;
785
+ /**
786
+ * Number of results to skip (default: 0)
787
+ */
788
+ offset?: number;
789
+ /**
790
+ * Sort order (e.g., "name", "-name" for descending)
791
+ */
792
+ order?: string;
793
+ }
794
+ /**
795
+ * Response containing list of Econt streets
796
+ */
797
+ interface ListStreetsOutput {
798
+ /**
799
+ * Array of streets with standard fields
800
+ * Includes: id, econtId, econtCityId, name, nameEn
801
+ */
802
+ streets: EcontStreet[];
803
+ /**
804
+ * Total count of streets matching the query
805
+ */
806
+ count: number;
807
+ /**
808
+ * Maximum number of results per page
809
+ */
810
+ limit: number;
811
+ /**
812
+ * Number of results skipped
813
+ */
814
+ offset: number;
588
815
  }
589
816
  /**
590
817
  * Available Econt plugin endpoints
@@ -611,6 +838,11 @@ type EcontEndpoints = {
611
838
  * All data is served from hierarchical cache for instant responses
612
839
  */
613
840
  listOffices: (input: ListOfficesInput, headers?: ClientHeaders) => Promise<ListOfficesOutput>;
841
+ /**
842
+ * Lists Econt streets for a specific city with optional filtering and pagination
843
+ * Requires econtCityId to filter streets by city
844
+ */
845
+ listStreets: (input: ListStreetsInput, headers?: ClientHeaders) => Promise<ListStreetsOutput>;
614
846
  };
615
847
  /**
616
848
  * Econt fulfillment provider plugin
@@ -685,4 +917,4 @@ declare class AlphabiteMedusaSdk<TPlugins extends readonly Plugin<any, any>[], T
685
917
  constructor(medusaOptions: AlphabiteMedusaConfig, plugins: TPlugins, options?: TOptions);
686
918
  }
687
919
 
688
- 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 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 };
920
+ 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, Office } from '@alphabite/econt-types';
5
4
 
6
5
  /**
7
6
  * Standard paginated response structure for list endpoints
@@ -338,6 +337,154 @@ 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
+ /**
366
+ * Econt Quarter entity returned from the API
367
+ */
368
+ interface EcontQuarter {
369
+ /**
370
+ * Medusa-generated ID with prefix (e.g., "eqtr_...")
371
+ */
372
+ id: string;
373
+ /**
374
+ * Econt quarter ID (can be null for auto-extracted quarters)
375
+ */
376
+ econtId: string | null;
377
+ /**
378
+ * Quarter name in local language
379
+ */
380
+ name: string;
381
+ /**
382
+ * Quarter name in English
383
+ */
384
+ nameEn: string;
385
+ /**
386
+ * Econt city ID
387
+ */
388
+ econtCityId: number;
389
+ }
390
+ /**
391
+ * Econt Office entity returned from the API
392
+ */
393
+ interface EcontOffice {
394
+ /**
395
+ * Medusa-generated ID with prefix (e.g., "eofc_...")
396
+ */
397
+ id: string;
398
+ /**
399
+ * Econt office ID
400
+ */
401
+ econtId: number;
402
+ /**
403
+ * Econt office code
404
+ */
405
+ econtCode: string;
406
+ /**
407
+ * Office name in local language
408
+ */
409
+ name: string;
410
+ /**
411
+ * Office name in English
412
+ */
413
+ nameEn: string;
414
+ /**
415
+ * Econt city ID
416
+ */
417
+ econtCityId: number;
418
+ /**
419
+ * Econt quarter ID
420
+ */
421
+ econtQuarterId?: string | null;
422
+ /**
423
+ * Full address string
424
+ */
425
+ fullAddress?: string;
426
+ /**
427
+ * Full address string in English
428
+ */
429
+ fullAddressEn?: string;
430
+ /**
431
+ * Latitude coordinate
432
+ */
433
+ latitude?: number;
434
+ /**
435
+ * Longitude coordinate
436
+ */
437
+ longitude?: number;
438
+ /**
439
+ * Array of phone numbers
440
+ */
441
+ phones: string[];
442
+ /**
443
+ * Additional information
444
+ */
445
+ info?: string | null;
446
+ /**
447
+ * Normal business hours start time (ISO 8601)
448
+ */
449
+ normalBusinessHoursFrom: string | Date;
450
+ /**
451
+ * Normal business hours end time (ISO 8601)
452
+ */
453
+ normalBusinessHoursTo: string | Date;
454
+ /**
455
+ * Half day business hours start time (ISO 8601)
456
+ */
457
+ halfDayBusinessHoursFrom?: string | Date | null;
458
+ /**
459
+ * Half day business hours end time (ISO 8601)
460
+ */
461
+ halfDayBusinessHoursTo?: string | Date | null;
462
+ }
463
+ /**
464
+ * Econt Street entity returned from the API
465
+ */
466
+ interface EcontStreet {
467
+ /**
468
+ * Medusa-generated ID with prefix (e.g., "estr_...")
469
+ */
470
+ id: string;
471
+ /**
472
+ * Econt street ID
473
+ */
474
+ econtId: number;
475
+ /**
476
+ * Econt city ID
477
+ */
478
+ econtCityId: number;
479
+ /**
480
+ * Street name in local language
481
+ */
482
+ name: string;
483
+ /**
484
+ * Street name in English
485
+ */
486
+ nameEn: string | null;
487
+ }
341
488
  /**
342
489
  * Address city information for validation
343
490
  */
@@ -411,7 +558,7 @@ interface ValidatedAddress {
411
558
  /**
412
559
  * Validated city with full details (includes id, name, etc.)
413
560
  */
414
- city: City;
561
+ city: EcontCity;
415
562
  /**
416
563
  * Full formatted address string
417
564
  */
@@ -460,7 +607,7 @@ interface ListCitiesInput {
460
607
  */
461
608
  fields?: string;
462
609
  /**
463
- * Maximum number of results (1-100, default: 15)
610
+ * Maximum number of results (1-500, default: 15)
464
611
  */
465
612
  limit?: number;
466
613
  /**
@@ -477,10 +624,22 @@ interface ListCitiesInput {
477
624
  */
478
625
  interface ListCitiesOutput {
479
626
  /**
480
- * Array of cities with full details from Econt
481
- * Includes: id, name, nameEn, postCode, region, etc.
627
+ * Array of cities with standard fields
628
+ * Includes: id, econtId, name, nameEn, countryCode
629
+ */
630
+ cities: EcontCity[];
631
+ /**
632
+ * Total count of cities matching the query
633
+ */
634
+ count: number;
635
+ /**
636
+ * Maximum number of results per page
637
+ */
638
+ limit: number;
639
+ /**
640
+ * Number of results skipped
482
641
  */
483
- cities: City[];
642
+ offset: number;
484
643
  }
485
644
  /**
486
645
  * Input for listing quarters (neighborhoods) in a city
@@ -492,10 +651,10 @@ interface ListQuartersInput {
492
651
  */
493
652
  countryCode?: CountryCode;
494
653
  /**
495
- * ID of the city to get quarters for
654
+ * Econt City ID to get quarters for
496
655
  * Required parameter
497
656
  */
498
- cityId: string;
657
+ econtCityId: string;
499
658
  /**
500
659
  * Search query to filter quarters by name or nameEn
501
660
  */
@@ -505,7 +664,7 @@ interface ListQuartersInput {
505
664
  */
506
665
  fields?: string;
507
666
  /**
508
- * Maximum number of results (1-100, default: 15)
667
+ * Maximum number of results (1-500, default: 15)
509
668
  */
510
669
  limit?: number;
511
670
  /**
@@ -522,10 +681,22 @@ interface ListQuartersInput {
522
681
  */
523
682
  interface ListQuartersOutput {
524
683
  /**
525
- * Array of quarters with details from Econt
526
- * Includes: id, cityID, name, nameEn
684
+ * Array of quarters with standard fields
685
+ * Includes: id, econtId, name, nameEn, econtCityId
686
+ */
687
+ quarters: EcontQuarter[];
688
+ /**
689
+ * Total count of quarters matching the query
690
+ */
691
+ count: number;
692
+ /**
693
+ * Maximum number of results per page
694
+ */
695
+ limit: number;
696
+ /**
697
+ * Number of results skipped
527
698
  */
528
- quarters: Quarter[];
699
+ offset: number;
529
700
  }
530
701
  /**
531
702
  * Input for listing Econt offices with optional filtering
@@ -537,24 +708,17 @@ interface ListOfficesInput {
537
708
  */
538
709
  countryCode?: CountryCode;
539
710
  /**
540
- * ID of the city to filter offices by
541
- * At least cityId or officeCode should be provided
711
+ * Econt City ID to filter offices by
542
712
  */
543
- cityId?: string;
713
+ econtCityId?: string;
544
714
  /**
545
- * ID of the quarter to filter offices by
715
+ * Econt Quarter ID to filter offices by
546
716
  */
547
- quarterId?: string;
717
+ econtQuarterId?: string;
548
718
  /**
549
- * Quarter name to filter offices by
550
- * Only works when cityId is also provided
719
+ * Specific Econt office code to retrieve
551
720
  */
552
- quarter?: string;
553
- /**
554
- * Specific office code to retrieve
555
- * Can be used alone or with cityId for faster filtering
556
- */
557
- officeCode?: string;
721
+ econtOfficeCode?: string;
558
722
  /**
559
723
  * Search query to filter offices by name or nameEn
560
724
  */
@@ -564,7 +728,7 @@ interface ListOfficesInput {
564
728
  */
565
729
  fields?: string;
566
730
  /**
567
- * Maximum number of results (1-100, default: 15)
731
+ * Maximum number of results (1-500, default: 15)
568
732
  */
569
733
  limit?: number;
570
734
  /**
@@ -581,10 +745,73 @@ interface ListOfficesInput {
581
745
  */
582
746
  interface ListOfficesOutput {
583
747
  /**
584
- * Array of offices with full details from Econt
585
- * Includes: code, name, address, phones, workingHours, etc.
748
+ * Array of offices with standard fields
749
+ * Includes: id, econtId, econtCode, name, nameEn, econtCityId, econtQuarterId, fullAddress, etc.
750
+ */
751
+ offices: EcontOffice[];
752
+ /**
753
+ * Total count of offices matching the query
754
+ */
755
+ count: number;
756
+ /**
757
+ * Maximum number of results per page
758
+ */
759
+ limit: number;
760
+ /**
761
+ * Number of results skipped
586
762
  */
587
- offices: Office[];
763
+ offset: number;
764
+ }
765
+ /**
766
+ * Input for listing Econt streets with optional filtering
767
+ */
768
+ interface ListStreetsInput {
769
+ /**
770
+ * Econt City ID - Required to filter streets by city
771
+ */
772
+ econtCityId: string;
773
+ /**
774
+ * Search query to filter streets by name or nameEn
775
+ */
776
+ q?: string;
777
+ /**
778
+ * Comma-separated list of fields to include
779
+ */
780
+ fields?: string;
781
+ /**
782
+ * Maximum number of results (1-500, default: 50)
783
+ */
784
+ limit?: number;
785
+ /**
786
+ * Number of results to skip (default: 0)
787
+ */
788
+ offset?: number;
789
+ /**
790
+ * Sort order (e.g., "name", "-name" for descending)
791
+ */
792
+ order?: string;
793
+ }
794
+ /**
795
+ * Response containing list of Econt streets
796
+ */
797
+ interface ListStreetsOutput {
798
+ /**
799
+ * Array of streets with standard fields
800
+ * Includes: id, econtId, econtCityId, name, nameEn
801
+ */
802
+ streets: EcontStreet[];
803
+ /**
804
+ * Total count of streets matching the query
805
+ */
806
+ count: number;
807
+ /**
808
+ * Maximum number of results per page
809
+ */
810
+ limit: number;
811
+ /**
812
+ * Number of results skipped
813
+ */
814
+ offset: number;
588
815
  }
589
816
  /**
590
817
  * Available Econt plugin endpoints
@@ -611,6 +838,11 @@ type EcontEndpoints = {
611
838
  * All data is served from hierarchical cache for instant responses
612
839
  */
613
840
  listOffices: (input: ListOfficesInput, headers?: ClientHeaders) => Promise<ListOfficesOutput>;
841
+ /**
842
+ * Lists Econt streets for a specific city with optional filtering and pagination
843
+ * Requires econtCityId to filter streets by city
844
+ */
845
+ listStreets: (input: ListStreetsInput, headers?: ClientHeaders) => Promise<ListStreetsOutput>;
614
846
  };
615
847
  /**
616
848
  * Econt fulfillment provider plugin
@@ -685,4 +917,4 @@ declare class AlphabiteMedusaSdk<TPlugins extends readonly Plugin<any, any>[], T
685
917
  constructor(medusaOptions: AlphabiteMedusaConfig, plugins: TPlugins, options?: TOptions);
686
918
  }
687
919
 
688
- 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 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 };
920
+ 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 d=require('@medusajs/js-sdk');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var d__default=/*#__PURE__*/_interopDefault(d);var p={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 d__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=p;
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 d from'@medusajs/js-sdk';var p={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 d{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,p 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.5",
3
+ "version": "0.6.7",
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
  }