@alphabite/medusa-sdk 0.6.13 → 0.6.15
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 +10 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -88,6 +88,7 @@ interface WishlistItem {
|
|
|
88
88
|
created_at: string;
|
|
89
89
|
updated_at: string;
|
|
90
90
|
deleted_at: string | null;
|
|
91
|
+
product_variant_id: string;
|
|
91
92
|
product_variant: (Omit<BaseProductVariant, 'product'> & {
|
|
92
93
|
product: Pick<BaseProduct, 'id' | 'thumbnail'>;
|
|
93
94
|
prices: PriceDTO[];
|
|
@@ -365,6 +366,14 @@ interface EcontCity {
|
|
|
365
366
|
* Postal code for the city
|
|
366
367
|
*/
|
|
367
368
|
postCode: string;
|
|
369
|
+
/**
|
|
370
|
+
* Region name in local language
|
|
371
|
+
*/
|
|
372
|
+
regionName: string;
|
|
373
|
+
/**
|
|
374
|
+
* Region name in English
|
|
375
|
+
*/
|
|
376
|
+
regionNameEn: string;
|
|
368
377
|
}
|
|
369
378
|
/**
|
|
370
379
|
* Econt Quarter entity returned from the API
|
|
@@ -650,7 +659,7 @@ interface ListCitiesInput {
|
|
|
650
659
|
interface ListCitiesOutput {
|
|
651
660
|
/**
|
|
652
661
|
* Array of cities with standard fields
|
|
653
|
-
* Includes: id, econtId, name, nameEn, countryCode
|
|
662
|
+
* Includes: id, econtId, name, nameEn, countryCode, postCode, regionName, regionNameEn
|
|
654
663
|
*/
|
|
655
664
|
cities: EcontCity[];
|
|
656
665
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -88,6 +88,7 @@ interface WishlistItem {
|
|
|
88
88
|
created_at: string;
|
|
89
89
|
updated_at: string;
|
|
90
90
|
deleted_at: string | null;
|
|
91
|
+
product_variant_id: string;
|
|
91
92
|
product_variant: (Omit<BaseProductVariant, 'product'> & {
|
|
92
93
|
product: Pick<BaseProduct, 'id' | 'thumbnail'>;
|
|
93
94
|
prices: PriceDTO[];
|
|
@@ -365,6 +366,14 @@ interface EcontCity {
|
|
|
365
366
|
* Postal code for the city
|
|
366
367
|
*/
|
|
367
368
|
postCode: string;
|
|
369
|
+
/**
|
|
370
|
+
* Region name in local language
|
|
371
|
+
*/
|
|
372
|
+
regionName: string;
|
|
373
|
+
/**
|
|
374
|
+
* Region name in English
|
|
375
|
+
*/
|
|
376
|
+
regionNameEn: string;
|
|
368
377
|
}
|
|
369
378
|
/**
|
|
370
379
|
* Econt Quarter entity returned from the API
|
|
@@ -650,7 +659,7 @@ interface ListCitiesInput {
|
|
|
650
659
|
interface ListCitiesOutput {
|
|
651
660
|
/**
|
|
652
661
|
* Array of cities with standard fields
|
|
653
|
-
* Includes: id, econtId, name, nameEn, countryCode
|
|
662
|
+
* Includes: id, econtId, name, nameEn, countryCode, postCode, regionName, regionNameEn
|
|
654
663
|
*/
|
|
655
664
|
cities: EcontCity[];
|
|
656
665
|
/**
|
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 g={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}),listRegions:async(t,e)=>r.client.fetch("/store/econt/regions",{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=g;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 g={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}),listRegions:async(t,e)=>r.client.fetch("/store/econt/regions",{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,g as reviewsPlugin,l as wishlistPlugin};
|