@medusajs/js-sdk 0.0.2-snapshot-20240520151134 → 0.0.2-snapshot-20240520162050
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/store/index.d.ts +14 -43
- package/dist/store/index.js +10 -10
- package/dist/store/index.js.map +1 -1
- package/package.json +2 -2
package/dist/store/index.d.ts
CHANGED
@@ -36,53 +36,24 @@ export declare class Store {
|
|
36
36
|
product: HttpTypes.StoreProduct;
|
37
37
|
}>;
|
38
38
|
};
|
39
|
+
order: {
|
40
|
+
retrieve: (id: string, query?: SelectParams, headers?: ClientHeaders) => Promise<any>;
|
41
|
+
};
|
39
42
|
cart: {
|
40
|
-
create: (body:
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
}>;
|
49
|
-
createLineItem: (cartId: string, body: HttpTypes.StoreAddCartLineItem, query?: SelectParams, headers?: ClientHeaders) => Promise<{
|
50
|
-
cart: HttpTypes.StoreCart;
|
51
|
-
}>;
|
52
|
-
updateLineItem: (cartId: string, lineItemId: string, body: HttpTypes.StoreUpdateCartLineItem, query?: SelectParams, headers?: ClientHeaders) => Promise<{
|
53
|
-
cart: HttpTypes.StoreCart;
|
54
|
-
}>;
|
55
|
-
deleteLineItem: (cartId: string, lineItemId: string, headers?: ClientHeaders) => Promise<HttpTypes.DeleteResponse<"line-item", HttpTypes.StoreCart>>;
|
56
|
-
addShippingMethod: (cartId: string, body: HttpTypes.StoreAddCartShippingMethods, query?: SelectParams, headers?: ClientHeaders) => Promise<{
|
57
|
-
cart: HttpTypes.StoreCart;
|
58
|
-
}>;
|
59
|
-
complete: (cartId: string, query?: SelectParams, headers?: ClientHeaders) => Promise<{
|
60
|
-
type: "order";
|
61
|
-
order: HttpTypes.StoreOrder;
|
62
|
-
} | {
|
63
|
-
type: "cart";
|
64
|
-
cart: HttpTypes.StoreCart;
|
65
|
-
error: {
|
66
|
-
message: string;
|
67
|
-
name: string;
|
68
|
-
type: string;
|
69
|
-
};
|
70
|
-
}>;
|
43
|
+
create: (body: any, query?: SelectParams, headers?: ClientHeaders) => Promise<any>;
|
44
|
+
update: (id: string, body: any, query?: SelectParams, headers?: ClientHeaders) => Promise<any>;
|
45
|
+
retrieve: (id: string, query?: SelectParams, headers?: ClientHeaders) => Promise<any>;
|
46
|
+
createLineItem: (cartId: string, body: any, query?: SelectParams, headers?: ClientHeaders) => Promise<any>;
|
47
|
+
updateLineItem: (cartId: string, lineItemId: string, body: any, query?: SelectParams, headers?: ClientHeaders) => Promise<any>;
|
48
|
+
deleteLineItem: (cartId: string, lineItemId: string, headers?: ClientHeaders) => Promise<any>;
|
49
|
+
addShippingMethod: (cartId: string, body: any, query?: SelectParams, headers?: ClientHeaders) => Promise<any>;
|
50
|
+
complete: (cartId: string, query?: SelectParams, headers?: ClientHeaders) => Promise<any>;
|
71
51
|
};
|
72
52
|
fulfillment: {
|
73
|
-
listCartOptions: (query?:
|
53
|
+
listCartOptions: (query?: Record<string, any>, headers?: ClientHeaders) => Promise<any>;
|
74
54
|
};
|
75
55
|
payment: {
|
76
|
-
listPaymentProviders: (query?:
|
77
|
-
|
78
|
-
}>;
|
79
|
-
initiatePaymentSession: (cart: HttpTypes.StoreCart, body: Record<string, any>, query?: SelectParams, headers?: ClientHeaders) => Promise<{
|
80
|
-
payment_collection: HttpTypes.StorePaymentCollection;
|
81
|
-
}>;
|
82
|
-
};
|
83
|
-
order: {
|
84
|
-
retrieve: (id: string, query?: SelectParams, headers?: ClientHeaders) => Promise<{
|
85
|
-
order: HttpTypes.StoreOrder;
|
86
|
-
}>;
|
56
|
+
listPaymentProviders: (query?: Record<string, any>, headers?: ClientHeaders) => Promise<any>;
|
57
|
+
initiatePaymentSession: (cart: any, body: Record<string, any>, query?: SelectParams, headers?: ClientHeaders) => Promise<any>;
|
87
58
|
};
|
88
59
|
}
|
package/dist/store/index.js
CHANGED
@@ -56,6 +56,14 @@ export class Store {
|
|
56
56
|
});
|
57
57
|
},
|
58
58
|
};
|
59
|
+
this.order = {
|
60
|
+
retrieve: async (id, query, headers) => {
|
61
|
+
return this.client.fetch(`/store/orders/${id}`, {
|
62
|
+
query,
|
63
|
+
headers,
|
64
|
+
});
|
65
|
+
},
|
66
|
+
};
|
59
67
|
this.cart = {
|
60
68
|
create: async (body, query, headers) => {
|
61
69
|
return this.client.fetch(`/store/carts`, {
|
@@ -120,16 +128,16 @@ export class Store {
|
|
120
128
|
this.fulfillment = {
|
121
129
|
listCartOptions: async (query, headers) => {
|
122
130
|
return this.client.fetch(`/store/shipping-options`, {
|
123
|
-
headers,
|
124
131
|
query,
|
132
|
+
headers,
|
125
133
|
});
|
126
134
|
},
|
127
135
|
};
|
128
136
|
this.payment = {
|
129
137
|
listPaymentProviders: async (query, headers) => {
|
130
138
|
return this.client.fetch(`/store/payment-providers`, {
|
131
|
-
headers,
|
132
139
|
query,
|
140
|
+
headers,
|
133
141
|
});
|
134
142
|
},
|
135
143
|
initiatePaymentSession: async (cart, body, query, headers) => {
|
@@ -155,14 +163,6 @@ export class Store {
|
|
155
163
|
});
|
156
164
|
},
|
157
165
|
};
|
158
|
-
this.order = {
|
159
|
-
retrieve: async (id, query, headers) => {
|
160
|
-
return this.client.fetch(`/store/orders/${id}`, {
|
161
|
-
headers,
|
162
|
-
query,
|
163
|
-
});
|
164
|
-
},
|
165
|
-
};
|
166
166
|
this.client = client;
|
167
167
|
}
|
168
168
|
}
|
package/dist/store/index.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"mappings":"AASA,MAAM,OAAO,KAAK;IAGhB,YAAY,MAAc;QAInB,WAAM,GAAG;YACd,IAAI,EAAE,KAAK,EACT,KAAiD,EACjD,OAAuB,EACvB,EAAE;gBACF,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAEtB,gBAAgB,EAAE;oBAClB,KAA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@@
|
|
1
1
|
{
|
2
2
|
"name": "@medusajs/js-sdk",
|
3
|
-
"version": "0.0.2-snapshot-
|
3
|
+
"version": "0.0.2-snapshot-20240520162050",
|
4
4
|
"description": "SDK for the Medusa API",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"repository": {
|
@@ -28,7 +28,7 @@
|
|
28
28
|
"typescript": "^5.1.6"
|
29
29
|
},
|
30
30
|
"dependencies": {
|
31
|
-
"@medusajs/types": "1.12.0-snapshot-
|
31
|
+
"@medusajs/types": "1.12.0-snapshot-20240520162050",
|
32
32
|
"qs": "^6.12.1"
|
33
33
|
},
|
34
34
|
"scripts": {
|