@alphabite/medusa-sdk 0.6.6 → 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 +203 -71
- package/dist/index.d.ts +203 -71
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +2 -4
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,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:
|
|
561
|
+
city: EcontCity;
|
|
415
562
|
/**
|
|
416
563
|
* Full formatted address string
|
|
417
564
|
*/
|
|
@@ -477,10 +624,10 @@ interface ListCitiesInput {
|
|
|
477
624
|
*/
|
|
478
625
|
interface ListCitiesOutput {
|
|
479
626
|
/**
|
|
480
|
-
* Array of cities with
|
|
481
|
-
* Includes: id, name, nameEn,
|
|
627
|
+
* Array of cities with standard fields
|
|
628
|
+
* Includes: id, econtId, name, nameEn, countryCode
|
|
482
629
|
*/
|
|
483
|
-
cities:
|
|
630
|
+
cities: EcontCity[];
|
|
484
631
|
/**
|
|
485
632
|
* Total count of cities matching the query
|
|
486
633
|
*/
|
|
@@ -504,10 +651,10 @@ interface ListQuartersInput {
|
|
|
504
651
|
*/
|
|
505
652
|
countryCode?: CountryCode;
|
|
506
653
|
/**
|
|
507
|
-
*
|
|
654
|
+
* Econt City ID to get quarters for
|
|
508
655
|
* Required parameter
|
|
509
656
|
*/
|
|
510
|
-
|
|
657
|
+
econtCityId: string;
|
|
511
658
|
/**
|
|
512
659
|
* Search query to filter quarters by name or nameEn
|
|
513
660
|
*/
|
|
@@ -534,10 +681,10 @@ interface ListQuartersInput {
|
|
|
534
681
|
*/
|
|
535
682
|
interface ListQuartersOutput {
|
|
536
683
|
/**
|
|
537
|
-
* Array of quarters with
|
|
538
|
-
* Includes: id,
|
|
684
|
+
* Array of quarters with standard fields
|
|
685
|
+
* Includes: id, econtId, name, nameEn, econtCityId
|
|
539
686
|
*/
|
|
540
|
-
quarters:
|
|
687
|
+
quarters: EcontQuarter[];
|
|
541
688
|
/**
|
|
542
689
|
* Total count of quarters matching the query
|
|
543
690
|
*/
|
|
@@ -561,24 +708,17 @@ interface ListOfficesInput {
|
|
|
561
708
|
*/
|
|
562
709
|
countryCode?: CountryCode;
|
|
563
710
|
/**
|
|
564
|
-
*
|
|
565
|
-
* At least cityId or officeCode should be provided
|
|
566
|
-
*/
|
|
567
|
-
cityId?: string;
|
|
568
|
-
/**
|
|
569
|
-
* ID of the quarter to filter offices by
|
|
711
|
+
* Econt City ID to filter offices by
|
|
570
712
|
*/
|
|
571
|
-
|
|
713
|
+
econtCityId?: string;
|
|
572
714
|
/**
|
|
573
|
-
* Quarter
|
|
574
|
-
* Only works when cityId is also provided
|
|
715
|
+
* Econt Quarter ID to filter offices by
|
|
575
716
|
*/
|
|
576
|
-
|
|
717
|
+
econtQuarterId?: string;
|
|
577
718
|
/**
|
|
578
|
-
* Specific office code to retrieve
|
|
579
|
-
* Can be used alone or with cityId for faster filtering
|
|
719
|
+
* Specific Econt office code to retrieve
|
|
580
720
|
*/
|
|
581
|
-
|
|
721
|
+
econtOfficeCode?: string;
|
|
582
722
|
/**
|
|
583
723
|
* Search query to filter offices by name or nameEn
|
|
584
724
|
*/
|
|
@@ -601,80 +741,67 @@ interface ListOfficesInput {
|
|
|
601
741
|
order?: string;
|
|
602
742
|
}
|
|
603
743
|
/**
|
|
604
|
-
*
|
|
744
|
+
* Response containing list of Econt offices
|
|
605
745
|
*/
|
|
606
|
-
interface
|
|
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;
|
|
623
|
-
/**
|
|
624
|
-
* Quarter ID
|
|
625
|
-
*/
|
|
626
|
-
quarterId?: string;
|
|
746
|
+
interface ListOfficesOutput {
|
|
627
747
|
/**
|
|
628
|
-
*
|
|
748
|
+
* Array of offices with standard fields
|
|
749
|
+
* Includes: id, econtId, econtCode, name, nameEn, econtCityId, econtQuarterId, fullAddress, etc.
|
|
629
750
|
*/
|
|
630
|
-
|
|
751
|
+
offices: EcontOffice[];
|
|
631
752
|
/**
|
|
632
|
-
*
|
|
753
|
+
* Total count of offices matching the query
|
|
633
754
|
*/
|
|
634
|
-
|
|
755
|
+
count: number;
|
|
635
756
|
/**
|
|
636
|
-
*
|
|
757
|
+
* Maximum number of results per page
|
|
637
758
|
*/
|
|
638
|
-
|
|
759
|
+
limit: number;
|
|
639
760
|
/**
|
|
640
|
-
*
|
|
761
|
+
* Number of results skipped
|
|
641
762
|
*/
|
|
642
|
-
|
|
763
|
+
offset: number;
|
|
764
|
+
}
|
|
765
|
+
/**
|
|
766
|
+
* Input for listing Econt streets with optional filtering
|
|
767
|
+
*/
|
|
768
|
+
interface ListStreetsInput {
|
|
643
769
|
/**
|
|
644
|
-
*
|
|
770
|
+
* Econt City ID - Required to filter streets by city
|
|
645
771
|
*/
|
|
646
|
-
|
|
772
|
+
econtCityId: string;
|
|
647
773
|
/**
|
|
648
|
-
*
|
|
774
|
+
* Search query to filter streets by name or nameEn
|
|
649
775
|
*/
|
|
650
|
-
|
|
776
|
+
q?: string;
|
|
651
777
|
/**
|
|
652
|
-
*
|
|
778
|
+
* Comma-separated list of fields to include
|
|
653
779
|
*/
|
|
654
|
-
|
|
780
|
+
fields?: string;
|
|
655
781
|
/**
|
|
656
|
-
*
|
|
782
|
+
* Maximum number of results (1-500, default: 50)
|
|
657
783
|
*/
|
|
658
|
-
|
|
784
|
+
limit?: number;
|
|
659
785
|
/**
|
|
660
|
-
*
|
|
786
|
+
* Number of results to skip (default: 0)
|
|
661
787
|
*/
|
|
662
|
-
|
|
788
|
+
offset?: number;
|
|
663
789
|
/**
|
|
664
|
-
*
|
|
790
|
+
* Sort order (e.g., "name", "-name" for descending)
|
|
665
791
|
*/
|
|
666
|
-
|
|
792
|
+
order?: string;
|
|
667
793
|
}
|
|
668
794
|
/**
|
|
669
|
-
* Response containing list of Econt
|
|
795
|
+
* Response containing list of Econt streets
|
|
670
796
|
*/
|
|
671
|
-
interface
|
|
797
|
+
interface ListStreetsOutput {
|
|
672
798
|
/**
|
|
673
|
-
* Array of
|
|
799
|
+
* Array of streets with standard fields
|
|
800
|
+
* Includes: id, econtId, econtCityId, name, nameEn
|
|
674
801
|
*/
|
|
675
|
-
|
|
802
|
+
streets: EcontStreet[];
|
|
676
803
|
/**
|
|
677
|
-
* Total count of
|
|
804
|
+
* Total count of streets matching the query
|
|
678
805
|
*/
|
|
679
806
|
count: number;
|
|
680
807
|
/**
|
|
@@ -711,6 +838,11 @@ type EcontEndpoints = {
|
|
|
711
838
|
* All data is served from hierarchical cache for instant responses
|
|
712
839
|
*/
|
|
713
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>;
|
|
714
846
|
};
|
|
715
847
|
/**
|
|
716
848
|
* Econt fulfillment provider plugin
|
|
@@ -785,4 +917,4 @@ declare class AlphabiteMedusaSdk<TPlugins extends readonly Plugin<any, any>[], T
|
|
|
785
917
|
constructor(medusaOptions: AlphabiteMedusaConfig, plugins: TPlugins, options?: TOptions);
|
|
786
918
|
}
|
|
787
919
|
|
|
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
|
|
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 } 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:
|
|
561
|
+
city: EcontCity;
|
|
415
562
|
/**
|
|
416
563
|
* Full formatted address string
|
|
417
564
|
*/
|
|
@@ -477,10 +624,10 @@ interface ListCitiesInput {
|
|
|
477
624
|
*/
|
|
478
625
|
interface ListCitiesOutput {
|
|
479
626
|
/**
|
|
480
|
-
* Array of cities with
|
|
481
|
-
* Includes: id, name, nameEn,
|
|
627
|
+
* Array of cities with standard fields
|
|
628
|
+
* Includes: id, econtId, name, nameEn, countryCode
|
|
482
629
|
*/
|
|
483
|
-
cities:
|
|
630
|
+
cities: EcontCity[];
|
|
484
631
|
/**
|
|
485
632
|
* Total count of cities matching the query
|
|
486
633
|
*/
|
|
@@ -504,10 +651,10 @@ interface ListQuartersInput {
|
|
|
504
651
|
*/
|
|
505
652
|
countryCode?: CountryCode;
|
|
506
653
|
/**
|
|
507
|
-
*
|
|
654
|
+
* Econt City ID to get quarters for
|
|
508
655
|
* Required parameter
|
|
509
656
|
*/
|
|
510
|
-
|
|
657
|
+
econtCityId: string;
|
|
511
658
|
/**
|
|
512
659
|
* Search query to filter quarters by name or nameEn
|
|
513
660
|
*/
|
|
@@ -534,10 +681,10 @@ interface ListQuartersInput {
|
|
|
534
681
|
*/
|
|
535
682
|
interface ListQuartersOutput {
|
|
536
683
|
/**
|
|
537
|
-
* Array of quarters with
|
|
538
|
-
* Includes: id,
|
|
684
|
+
* Array of quarters with standard fields
|
|
685
|
+
* Includes: id, econtId, name, nameEn, econtCityId
|
|
539
686
|
*/
|
|
540
|
-
quarters:
|
|
687
|
+
quarters: EcontQuarter[];
|
|
541
688
|
/**
|
|
542
689
|
* Total count of quarters matching the query
|
|
543
690
|
*/
|
|
@@ -561,24 +708,17 @@ interface ListOfficesInput {
|
|
|
561
708
|
*/
|
|
562
709
|
countryCode?: CountryCode;
|
|
563
710
|
/**
|
|
564
|
-
*
|
|
565
|
-
* At least cityId or officeCode should be provided
|
|
566
|
-
*/
|
|
567
|
-
cityId?: string;
|
|
568
|
-
/**
|
|
569
|
-
* ID of the quarter to filter offices by
|
|
711
|
+
* Econt City ID to filter offices by
|
|
570
712
|
*/
|
|
571
|
-
|
|
713
|
+
econtCityId?: string;
|
|
572
714
|
/**
|
|
573
|
-
* Quarter
|
|
574
|
-
* Only works when cityId is also provided
|
|
715
|
+
* Econt Quarter ID to filter offices by
|
|
575
716
|
*/
|
|
576
|
-
|
|
717
|
+
econtQuarterId?: string;
|
|
577
718
|
/**
|
|
578
|
-
* Specific office code to retrieve
|
|
579
|
-
* Can be used alone or with cityId for faster filtering
|
|
719
|
+
* Specific Econt office code to retrieve
|
|
580
720
|
*/
|
|
581
|
-
|
|
721
|
+
econtOfficeCode?: string;
|
|
582
722
|
/**
|
|
583
723
|
* Search query to filter offices by name or nameEn
|
|
584
724
|
*/
|
|
@@ -601,80 +741,67 @@ interface ListOfficesInput {
|
|
|
601
741
|
order?: string;
|
|
602
742
|
}
|
|
603
743
|
/**
|
|
604
|
-
*
|
|
744
|
+
* Response containing list of Econt offices
|
|
605
745
|
*/
|
|
606
|
-
interface
|
|
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;
|
|
623
|
-
/**
|
|
624
|
-
* Quarter ID
|
|
625
|
-
*/
|
|
626
|
-
quarterId?: string;
|
|
746
|
+
interface ListOfficesOutput {
|
|
627
747
|
/**
|
|
628
|
-
*
|
|
748
|
+
* Array of offices with standard fields
|
|
749
|
+
* Includes: id, econtId, econtCode, name, nameEn, econtCityId, econtQuarterId, fullAddress, etc.
|
|
629
750
|
*/
|
|
630
|
-
|
|
751
|
+
offices: EcontOffice[];
|
|
631
752
|
/**
|
|
632
|
-
*
|
|
753
|
+
* Total count of offices matching the query
|
|
633
754
|
*/
|
|
634
|
-
|
|
755
|
+
count: number;
|
|
635
756
|
/**
|
|
636
|
-
*
|
|
757
|
+
* Maximum number of results per page
|
|
637
758
|
*/
|
|
638
|
-
|
|
759
|
+
limit: number;
|
|
639
760
|
/**
|
|
640
|
-
*
|
|
761
|
+
* Number of results skipped
|
|
641
762
|
*/
|
|
642
|
-
|
|
763
|
+
offset: number;
|
|
764
|
+
}
|
|
765
|
+
/**
|
|
766
|
+
* Input for listing Econt streets with optional filtering
|
|
767
|
+
*/
|
|
768
|
+
interface ListStreetsInput {
|
|
643
769
|
/**
|
|
644
|
-
*
|
|
770
|
+
* Econt City ID - Required to filter streets by city
|
|
645
771
|
*/
|
|
646
|
-
|
|
772
|
+
econtCityId: string;
|
|
647
773
|
/**
|
|
648
|
-
*
|
|
774
|
+
* Search query to filter streets by name or nameEn
|
|
649
775
|
*/
|
|
650
|
-
|
|
776
|
+
q?: string;
|
|
651
777
|
/**
|
|
652
|
-
*
|
|
778
|
+
* Comma-separated list of fields to include
|
|
653
779
|
*/
|
|
654
|
-
|
|
780
|
+
fields?: string;
|
|
655
781
|
/**
|
|
656
|
-
*
|
|
782
|
+
* Maximum number of results (1-500, default: 50)
|
|
657
783
|
*/
|
|
658
|
-
|
|
784
|
+
limit?: number;
|
|
659
785
|
/**
|
|
660
|
-
*
|
|
786
|
+
* Number of results to skip (default: 0)
|
|
661
787
|
*/
|
|
662
|
-
|
|
788
|
+
offset?: number;
|
|
663
789
|
/**
|
|
664
|
-
*
|
|
790
|
+
* Sort order (e.g., "name", "-name" for descending)
|
|
665
791
|
*/
|
|
666
|
-
|
|
792
|
+
order?: string;
|
|
667
793
|
}
|
|
668
794
|
/**
|
|
669
|
-
* Response containing list of Econt
|
|
795
|
+
* Response containing list of Econt streets
|
|
670
796
|
*/
|
|
671
|
-
interface
|
|
797
|
+
interface ListStreetsOutput {
|
|
672
798
|
/**
|
|
673
|
-
* Array of
|
|
799
|
+
* Array of streets with standard fields
|
|
800
|
+
* Includes: id, econtId, econtCityId, name, nameEn
|
|
674
801
|
*/
|
|
675
|
-
|
|
802
|
+
streets: EcontStreet[];
|
|
676
803
|
/**
|
|
677
|
-
* Total count of
|
|
804
|
+
* Total count of streets matching the query
|
|
678
805
|
*/
|
|
679
806
|
count: number;
|
|
680
807
|
/**
|
|
@@ -711,6 +838,11 @@ type EcontEndpoints = {
|
|
|
711
838
|
* All data is served from hierarchical cache for instant responses
|
|
712
839
|
*/
|
|
713
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>;
|
|
714
846
|
};
|
|
715
847
|
/**
|
|
716
848
|
* Econt fulfillment provider plugin
|
|
@@ -785,4 +917,4 @@ declare class AlphabiteMedusaSdk<TPlugins extends readonly Plugin<any, any>[], T
|
|
|
785
917
|
constructor(medusaOptions: AlphabiteMedusaConfig, plugins: TPlugins, options?: TOptions);
|
|
786
918
|
}
|
|
787
919
|
|
|
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
|
|
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 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
|
|
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
|
|
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.
|
|
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
|
}
|