@alphabite/medusa-sdk 0.3.3 → 0.4.0
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 +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Medusa, { ClientHeaders } from '@medusajs/js-sdk';
|
|
2
2
|
import { BaseProductVariant, BaseProduct } from '@medusajs/types/dist/http/product/common';
|
|
3
|
-
import { FindParams, RemoteQueryFunctionReturnPagination, PriceDTO, CustomerDTO, ProductDTO } from '@medusajs/types';
|
|
3
|
+
import { FindParams, RemoteQueryFunctionReturnPagination, PriceDTO, StoreCartAddress, StoreCartLineItem, CustomerDTO, ProductDTO } from '@medusajs/types';
|
|
4
4
|
|
|
5
5
|
interface PaginatedOutput<T> extends PaginatedOutputMeta {
|
|
6
6
|
data: T[];
|
|
@@ -125,6 +125,11 @@ declare const wishlistPlugin: Plugin<'wishlist', WishlistEndpoints>;
|
|
|
125
125
|
interface CreateClientTokenOutput {
|
|
126
126
|
client_token: string;
|
|
127
127
|
}
|
|
128
|
+
interface PaypalPaymentSessionInputData {
|
|
129
|
+
shipping_info?: StoreCartAddress;
|
|
130
|
+
items?: StoreCartLineItem[];
|
|
131
|
+
email?: string;
|
|
132
|
+
}
|
|
128
133
|
type PaypalEndpoints = {
|
|
129
134
|
createClientToken: (headers?: ClientHeaders) => Promise<CreateClientTokenOutput>;
|
|
130
135
|
};
|
|
@@ -213,4 +218,4 @@ declare class AlphabiteMedusaSdk<TPlugins extends readonly Plugin<any, any>[], T
|
|
|
213
218
|
constructor(medusaOptions: ConstructorParameters<typeof Medusa>[0], plugins: TPlugins, options?: TOptions);
|
|
214
219
|
}
|
|
215
220
|
|
|
216
|
-
export { type AddItemToWishlistInput, type AddItemToWishlistOutput, type AggregateCounts, type AggregateCountsInput, type AggregateCountsOutput, type AlphabiteClientOptions, AlphabiteMedusaSdk, type CreateClientTokenOutput, type CreateReviewInput, type CreateReviewOutput, type CreateWishlistInput, type CreateWishlistOutput, type DeleteReviewInput, type DeleteReviewOutput, type DeleteWishlistInput, type DeleteWishlistOutput, type ImportWishlistInput, type ImportWishlistOutput, type ListItemsInput, type ListItemsOutput, type ListProductReviewsInput, type ListProductReviewsOutput, type ListReviewsInput, type ListReviewsOutput, type ListWishlistsInput, type ListWishlistsOutput, type Plugin, type PluginsToAlphabite, 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 Wishlist, type WishlistItem, paypalPlugin, reviewsPlugin, wishlistPlugin };
|
|
221
|
+
export { type AddItemToWishlistInput, type AddItemToWishlistOutput, type AggregateCounts, type AggregateCountsInput, type AggregateCountsOutput, type AlphabiteClientOptions, AlphabiteMedusaSdk, type CreateClientTokenOutput, type CreateReviewInput, type CreateReviewOutput, type CreateWishlistInput, type CreateWishlistOutput, type DeleteReviewInput, type DeleteReviewOutput, type DeleteWishlistInput, type DeleteWishlistOutput, type ImportWishlistInput, type ImportWishlistOutput, type ListItemsInput, type ListItemsOutput, type ListProductReviewsInput, type ListProductReviewsOutput, type ListReviewsInput, type ListReviewsOutput, type ListWishlistsInput, type ListWishlistsOutput, type PaypalPaymentSessionInputData, type Plugin, type PluginsToAlphabite, 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 Wishlist, type WishlistItem, paypalPlugin, reviewsPlugin, wishlistPlugin };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Medusa, { ClientHeaders } from '@medusajs/js-sdk';
|
|
2
2
|
import { BaseProductVariant, BaseProduct } from '@medusajs/types/dist/http/product/common';
|
|
3
|
-
import { FindParams, RemoteQueryFunctionReturnPagination, PriceDTO, CustomerDTO, ProductDTO } from '@medusajs/types';
|
|
3
|
+
import { FindParams, RemoteQueryFunctionReturnPagination, PriceDTO, StoreCartAddress, StoreCartLineItem, CustomerDTO, ProductDTO } from '@medusajs/types';
|
|
4
4
|
|
|
5
5
|
interface PaginatedOutput<T> extends PaginatedOutputMeta {
|
|
6
6
|
data: T[];
|
|
@@ -125,6 +125,11 @@ declare const wishlistPlugin: Plugin<'wishlist', WishlistEndpoints>;
|
|
|
125
125
|
interface CreateClientTokenOutput {
|
|
126
126
|
client_token: string;
|
|
127
127
|
}
|
|
128
|
+
interface PaypalPaymentSessionInputData {
|
|
129
|
+
shipping_info?: StoreCartAddress;
|
|
130
|
+
items?: StoreCartLineItem[];
|
|
131
|
+
email?: string;
|
|
132
|
+
}
|
|
128
133
|
type PaypalEndpoints = {
|
|
129
134
|
createClientToken: (headers?: ClientHeaders) => Promise<CreateClientTokenOutput>;
|
|
130
135
|
};
|
|
@@ -213,4 +218,4 @@ declare class AlphabiteMedusaSdk<TPlugins extends readonly Plugin<any, any>[], T
|
|
|
213
218
|
constructor(medusaOptions: ConstructorParameters<typeof Medusa>[0], plugins: TPlugins, options?: TOptions);
|
|
214
219
|
}
|
|
215
220
|
|
|
216
|
-
export { type AddItemToWishlistInput, type AddItemToWishlistOutput, type AggregateCounts, type AggregateCountsInput, type AggregateCountsOutput, type AlphabiteClientOptions, AlphabiteMedusaSdk, type CreateClientTokenOutput, type CreateReviewInput, type CreateReviewOutput, type CreateWishlistInput, type CreateWishlistOutput, type DeleteReviewInput, type DeleteReviewOutput, type DeleteWishlistInput, type DeleteWishlistOutput, type ImportWishlistInput, type ImportWishlistOutput, type ListItemsInput, type ListItemsOutput, type ListProductReviewsInput, type ListProductReviewsOutput, type ListReviewsInput, type ListReviewsOutput, type ListWishlistsInput, type ListWishlistsOutput, type Plugin, type PluginsToAlphabite, 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 Wishlist, type WishlistItem, paypalPlugin, reviewsPlugin, wishlistPlugin };
|
|
221
|
+
export { type AddItemToWishlistInput, type AddItemToWishlistOutput, type AggregateCounts, type AggregateCountsInput, type AggregateCountsOutput, type AlphabiteClientOptions, AlphabiteMedusaSdk, type CreateClientTokenOutput, type CreateReviewInput, type CreateReviewOutput, type CreateWishlistInput, type CreateWishlistOutput, type DeleteReviewInput, type DeleteReviewOutput, type DeleteWishlistInput, type DeleteWishlistOutput, type ImportWishlistInput, type ImportWishlistOutput, type ListItemsInput, type ListItemsOutput, type ListProductReviewsInput, type ListProductReviewsOutput, type ListReviewsInput, type ListReviewsOutput, type ListWishlistsInput, type ListWishlistsOutput, type PaypalPaymentSessionInputData, type Plugin, type PluginsToAlphabite, 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 Wishlist, type WishlistItem, paypalPlugin, reviewsPlugin, wishlistPlugin };
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
'use strict';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 p={name:"wishlist",endpoints:(s,i)=>({create:async({...e},t)=>s.client.fetch("/store/wishlists",{method:"POST",body:e,headers:{...await i?.getAuthHeader?.(),...t}}),list:async({limit:e=10,offset:t=0,...r},n)=>s.client.fetch("/store/wishlists",{method:"GET",headers:{...await i?.getAuthHeader?.(),...n},query:{limit:e,offset:t,...r}}),retrieve:async({id:e,...t},r)=>s.client.fetch(`/store/wishlists/${e}`,{method:"GET",headers:{...await i?.getAuthHeader?.(),...r},query:t}),update:async({id:e,...t},r)=>s.client.fetch(`/store/wishlists/${e}`,{method:"PUT",body:t,headers:{...await i?.getAuthHeader?.(),...r}}),delete:async({id:e},t)=>s.client.fetch(`/store/wishlists/${e}`,{method:"DELETE",headers:{...await i?.getAuthHeader?.(),...t}}),totalItemsCount:async({wishlist_id:e},t)=>s.client.fetch("store/wishlists/total-items-count",{method:"GET",headers:{...await i?.getAuthHeader?.(),...t},query:{wishlist_id:e}}),transfer:async({id:e},t)=>s.client.fetch(`/store/wishlists/${e}/transfer`,{method:"POST",headers:{...await i?.getAuthHeader?.(),...t}}),share:async({id:e},t)=>s.client.fetch(`/store/wishlists/${e}/share`,{method:"POST",headers:{...await i?.getAuthHeader?.(),...t}}),import:async(e,t)=>s.client.fetch("/store/wishlists/import",{method:"POST",body:e,headers:{...await i?.getAuthHeader?.(),...t}}),addItem:async({id:e,...t},r)=>s.client.fetch(`/store/wishlists/${e}/add-item`,{method:"POST",body:t,headers:{...await i?.getAuthHeader?.(),...r}}),listItems:async({id:e,limit:t=10,offset:r=0,...n},o)=>s.client.fetch(`/store/wishlists/${e}/items`,{method:"GET",headers:{...await i?.getAuthHeader?.(),...o},query:{limit:t,offset:r,...n}}),removeItem:async({wishlist_item_id:e,id:t},r)=>s.client.fetch(`/store/wishlists/${t}/items/${e}`,{method:"DELETE",headers:{...await i?.getAuthHeader?.(),...r}})})};var l={name:"paypal",endpoints:(s,i)=>({createClientToken:async e=>s.client.fetch("/store/paypal/client-token",{method:"POST",headers:{...await i?.getAuthHeader?.(),...e}})})};var c={name:"reviews",endpoints:(s,i)=>({create:async(e,t)=>s.client.fetch("/store/reviews",{method:"POST",body:e,headers:{...await i?.getAuthHeader?.(),...t}}),list:async({...e},t)=>s.client.fetch("/store/products/reviews",{method:"GET",headers:{...await i?.getAuthHeader?.(),...t},query:e}),listProductReviews:async({product_id:e,...t},r)=>s.client.fetch(`store/reviews/product/${e}`,{method:"GET",query:t,headers:{...await i?.getAuthHeader?.(),...r}}),aggregateCounts:async({product_id:e,...t},r)=>s.client.fetch(`/store/reviews/product/${e}/aggregate-counts`,{method:"GET",query:t,headers:{...await i?.getAuthHeader?.(),...r}}),delete:async({id:e},t)=>s.client.fetch(`/store/reviews/${e}`,{method:"DELETE",headers:{...await i?.getAuthHeader?.(),...t}})})};var a=class extends u__default.default{constructor(i,e,t){super(i),this.options=t;let r={};e.forEach(n=>{r[n.name]=n.endpoints(this,this.options);}),this.alphabite=r;}};exports.AlphabiteMedusaSdk=a;exports.paypalPlugin=l;exports.reviewsPlugin=c;exports.wishlistPlugin=p;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import u from'@medusajs/js-sdk';var p={name:"wishlist",endpoints:(s,i)=>({create:async({...e},t)=>s.client.fetch("/store/wishlists",{method:"POST",body:e,headers:{...await i?.getAuthHeader?.(),...t}}),list:async({limit:e=10,offset:t=0,...r},n)=>s.client.fetch("/store/wishlists",{method:"GET",headers:{...await i?.getAuthHeader?.(),...n},query:{limit:e,offset:t,...r}}),retrieve:async({id:e,...t},r)=>s.client.fetch(`/store/wishlists/${e}`,{method:"GET",headers:{...await i?.getAuthHeader?.(),...r},query:t}),update:async({id:e,...t},r)=>s.client.fetch(`/store/wishlists/${e}`,{method:"PUT",body:t,headers:{...await i?.getAuthHeader?.(),...r}}),delete:async({id:e},t)=>s.client.fetch(`/store/wishlists/${e}`,{method:"DELETE",headers:{...await i?.getAuthHeader?.(),...t}}),totalItemsCount:async({wishlist_id:e},t)=>s.client.fetch("store/wishlists/total-items-count",{method:"GET",headers:{...await i?.getAuthHeader?.(),...t},query:{wishlist_id:e}}),transfer:async({id:e},t)=>s.client.fetch(`/store/wishlists/${e}/transfer`,{method:"POST",headers:{...await i?.getAuthHeader?.(),...t}}),share:async({id:e},t)=>s.client.fetch(`/store/wishlists/${e}/share`,{method:"POST",headers:{...await i?.getAuthHeader?.(),...t}}),import:async(e,t)=>s.client.fetch("/store/wishlists/import",{method:"POST",body:e,headers:{...await i?.getAuthHeader?.(),...t}}),addItem:async({id:e,...t},r)=>s.client.fetch(`/store/wishlists/${e}/add-item`,{method:"POST",body:t,headers:{...await i?.getAuthHeader?.(),...r}}),listItems:async({id:e,limit:t=10,offset:r=0,...n},o)=>s.client.fetch(`/store/wishlists/${e}/items`,{method:"GET",headers:{...await i?.getAuthHeader?.(),...o},query:{limit:t,offset:r,...n}}),removeItem:async({wishlist_item_id:e,id:t},r)=>s.client.fetch(`/store/wishlists/${t}/items/${e}`,{method:"DELETE",headers:{...await i?.getAuthHeader?.(),...r}})})};var l={name:"paypal",endpoints:(s,i)=>({createClientToken:async e=>s.client.fetch("/store/paypal/client-token",{method:"POST",headers:{...await i?.getAuthHeader?.(),...e}})})};var c={name:"reviews",endpoints:(s,i)=>({create:async(e,t)=>s.client.fetch("/store/reviews",{method:"POST",body:e,headers:{...await i?.getAuthHeader?.(),...t}}),list:async({...e},t)=>s.client.fetch("/store/products/reviews",{method:"GET",headers:{...await i?.getAuthHeader?.(),...t},query:e}),listProductReviews:async({product_id:e,...t},r)=>s.client.fetch(`store/reviews/product/${e}`,{method:"GET",query:t,headers:{...await i?.getAuthHeader?.(),...r}}),aggregateCounts:async({product_id:e,...t},r)=>s.client.fetch(`/store/reviews/product/${e}/aggregate-counts`,{method:"GET",query:t,headers:{...await i?.getAuthHeader?.(),...r}}),delete:async({id:e},t)=>s.client.fetch(`/store/reviews/${e}`,{method:"DELETE",headers:{...await i?.getAuthHeader?.(),...t}})})};var a=class extends u{constructor(i,e,t){super(i),this.options=t;let r={};e.forEach(n=>{r[n.name]=n.endpoints(this,this.options);}),this.alphabite=r;}};export{a as AlphabiteMedusaSdk,l as paypalPlugin,c as reviewsPlugin,p as wishlistPlugin};
|