@medusajs/js-sdk 0.0.2-snapshot-20240516152256 → 0.0.2-snapshot-20240520162050

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,22 @@
1
+ import { DeleteResponse, FindParams, HttpTypes, SelectParams } from "@medusajs/types";
1
2
  import { Client } from "../client";
3
+ import { ClientHeaders } from "../types";
2
4
  export declare class Admin {
3
5
  private client;
4
6
  constructor(client: Client);
7
+ region: {
8
+ create: (body: HttpTypes.AdminCreateRegion, query?: SelectParams, headers?: ClientHeaders) => Promise<{
9
+ region: HttpTypes.AdminRegion;
10
+ }>;
11
+ update: (id: string, body: HttpTypes.AdminUpdateRegion, query?: SelectParams, headers?: ClientHeaders) => Promise<{
12
+ region: HttpTypes.AdminRegion;
13
+ }>;
14
+ list: (queryParams?: FindParams & HttpTypes.AdminRegionFilters, headers?: ClientHeaders) => Promise<HttpTypes.PaginatedResponse<{
15
+ regions: HttpTypes.AdminRegion[];
16
+ }>>;
17
+ retrieve: (id: string, query?: SelectParams, headers?: ClientHeaders) => Promise<{
18
+ region: HttpTypes.AdminRegion;
19
+ }>;
20
+ delete: (id: string, headers?: ClientHeaders) => Promise<DeleteResponse<"region">>;
21
+ };
5
22
  }
@@ -1,5 +1,41 @@
1
1
  export class Admin {
2
2
  constructor(client) {
3
+ this.region = {
4
+ create: async (body, query, headers) => {
5
+ return this.client.fetch(`/admin/regions`, {
6
+ method: "POST",
7
+ headers,
8
+ body,
9
+ query,
10
+ });
11
+ },
12
+ update: async (id, body, query, headers) => {
13
+ return this.client.fetch(`/admin/regions/${id}`, {
14
+ method: "POST",
15
+ headers,
16
+ body,
17
+ query,
18
+ });
19
+ },
20
+ list: async (queryParams, headers) => {
21
+ return this.client.fetch(`/admin/regions`, {
22
+ query: queryParams,
23
+ headers,
24
+ });
25
+ },
26
+ retrieve: async (id, query, headers) => {
27
+ return this.client.fetch(`/admin/regions/${id}`, {
28
+ query,
29
+ headers,
30
+ });
31
+ },
32
+ delete: async (id, headers) => {
33
+ return this.client.fetch(`/admin/regions/${id}`, {
34
+ method: "DELETE",
35
+ headers,
36
+ });
37
+ },
38
+ };
3
39
  this.client = client;
4
40
  }
5
41
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/admin/index.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,KAAK;IAEhB,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;CACF"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/admin/index.ts"],"names":[],"mappings":"AAUA,MAAM,OAAO,KAAK;IAEhB,YAAY,MAAc;QAInB,WAAM,GAAG;YACd,MAAM,EAAE,KAAK,EACX,IAAiC,EACjC,KAAoB,EACpB,OAAuB,EACvB,EAAE;gBACF,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CACtB,gBAAgB,EAChB;oBACE,MAAM,EAAE,MAAM;oBACd,OAAO;oBACP,IAAI;oBACJ,KAAK;iBACN,CACF,CAAA;YACH,CAAC;YACD,MAAM,EAAE,KAAK,EACX,EAAU,EACV,IAAiC,EACjC,KAAoB,EACpB,OAAuB,EACvB,EAAE;gBACF,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CACtB,kBAAkB,EAAE,EAAE,EACtB;oBACE,MAAM,EAAE,MAAM;oBACd,OAAO;oBACP,IAAI;oBACJ,KAAK;iBACN,CACF,CAAA;YACH,CAAC;YACD,IAAI,EAAE,KAAK,EACT,WAAuD,EACvD,OAAuB,EACvB,EAAE;gBACF,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAEtB,gBAAgB,EAAE;oBAClB,KAAK,EAAE,WAAW;oBAClB,OAAO;iBACR,CAAC,CAAA;YACJ,CAAC;YACD,QAAQ,EAAE,KAAK,EACb,EAAU,EACV,KAAoB,EACpB,OAAuB,EACvB,EAAE;gBACF,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CACtB,kBAAkB,EAAE,EAAE,EACtB;oBACE,KAAK;oBACL,OAAO;iBACR,CACF,CAAA;YACH,CAAC;YACD,MAAM,EAAE,KAAK,EAAE,EAAU,EAAE,OAAuB,EAAE,EAAE;gBACpD,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CACtB,kBAAkB,EAAE,EAAE,EACtB;oBACE,MAAM,EAAE,QAAQ;oBAChB,OAAO;iBACR,CACF,CAAA;YACH,CAAC;SACF,CAAA;QApEC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;CAoEF"}
@@ -4,8 +4,9 @@ export declare class Auth {
4
4
  private client;
5
5
  private config;
6
6
  constructor(client: Client, config: Config);
7
- login: (payload: {
7
+ login: (scope: "admin" | "store", method: "emailpass", payload: {
8
8
  email: string;
9
9
  password: string;
10
10
  }) => Promise<void>;
11
+ logout: () => Promise<void>;
11
12
  }
@@ -1,8 +1,7 @@
1
1
  export class Auth {
2
2
  constructor(client, config) {
3
- this.login = async (payload) => {
4
- // TODO: It is a bit strange to eg. require to pass `scope` in `login`, it might be better for us to have auth methods in both `admin` and `store` classes instead?
5
- const { token } = await this.client.fetch("/auth/admin/emailpass", {
3
+ this.login = async (scope, method, payload) => {
4
+ const { token } = await this.client.fetch(`/auth/${scope}/${method}`, {
6
5
  method: "POST",
7
6
  body: payload,
8
7
  });
@@ -17,6 +16,14 @@ export class Auth {
17
16
  this.client.setToken(token);
18
17
  }
19
18
  };
19
+ this.logout = async () => {
20
+ if (this.config?.auth?.type === "session") {
21
+ await this.client.fetch("/auth/session", {
22
+ method: "DELETE",
23
+ });
24
+ }
25
+ this.client.clearToken();
26
+ };
20
27
  this.client = client;
21
28
  this.config = config;
22
29
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,IAAI;IAIf,YAAY,MAAc,EAAE,MAAc;QAK1C,UAAK,GAAG,KAAK,EAAE,OAA4C,EAAE,EAAE;YAC7D,mKAAmK;YACnK,MAAM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EAAE,EAAE;iBAC9C,CAAC,CAAA;YACJ,CAAC;iBAAM,CAAC;gBACN,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;YAC7B,CAAC;QACH,CAAC,CAAA;QAED,WAAM,GAAG,KAAK,IAAI,EAAE;YAClB,IAAI,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,KAAK,SAAS,EAAE,CAAC;gBAC1C,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,eAAe,EAAE;oBACvC,MAAM,EAAE,QAAQ;iBACjB,CAAC,CAAA;YACJ,CAAC;YAED,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAA;QAC1B,CAAC,CAAA;QApCC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;CAmCF"}
package/dist/client.d.ts CHANGED
@@ -24,6 +24,8 @@ export declare class Client {
24
24
  */
25
25
  fetch<T extends any>(input: FetchInput, init?: FetchArgs): Promise<T>;
26
26
  setToken(token: string): void;
27
+ clearToken(): void;
28
+ protected clearToken_(): void;
27
29
  protected initClient(): ClientFetch;
28
30
  protected getApiKeyHeader_: () => {
29
31
  Authorization: string;
package/dist/client.js CHANGED
@@ -100,13 +100,14 @@ export class Client {
100
100
  return;
101
101
  };
102
102
  this.getTokenStorageInfo_ = () => {
103
- const storageMethod = this.config.auth?.jwtTokenStorageMethod ||
104
- (hasStorage("localStorage") ? "local" : "memory");
103
+ const hasLocal = hasStorage("localStorage");
104
+ const hasSession = hasStorage("sessionStorage");
105
+ const storageMethod = this.config.auth?.jwtTokenStorageMethod || (hasLocal ? "local" : "memory");
105
106
  const storageKey = this.config.auth?.jwtTokenStorageKey || this.DEFAULT_JWT_STORAGE_KEY;
106
- if (!hasStorage("localStorage") && storageMethod === "local") {
107
+ if (!hasLocal && storageMethod === "local") {
107
108
  throw new Error("Local JWT storage is only available in the browser");
108
109
  }
109
- if (!hasStorage("sessionStorage") && storageMethod === "session") {
110
+ if (!hasSession && storageMethod === "session") {
110
111
  throw new Error("Session JWT storage is only available in the browser");
111
112
  }
112
113
  return {
@@ -145,6 +146,26 @@ export class Client {
145
146
  setToken(token) {
146
147
  this.setToken_(token);
147
148
  }
149
+ clearToken() {
150
+ this.clearToken_();
151
+ }
152
+ clearToken_() {
153
+ const { storageMethod, storageKey } = this.getTokenStorageInfo_();
154
+ switch (storageMethod) {
155
+ case "local": {
156
+ window.localStorage.removeItem(storageKey);
157
+ break;
158
+ }
159
+ case "session": {
160
+ window.sessionStorage.removeItem(storageKey);
161
+ break;
162
+ }
163
+ case "memory": {
164
+ this.token = "";
165
+ break;
166
+ }
167
+ }
168
+ }
148
169
  initClient() {
149
170
  const defaultHeaders = new Headers({
150
171
  "content-type": "application/json",
@@ -153,7 +174,7 @@ export class Client {
153
174
  ...this.getPublishableKeyHeader_(),
154
175
  });
155
176
  this.logger.debug("Initiating Medusa client with default headers:\n", `${JSON.stringify(sanitizeHeaders(defaultHeaders), null, 2)}\n`);
156
- return (input, init) => {
177
+ return async (input, init) => {
157
178
  // We always want to fetch the up-to-date JWT token before firing off a request.
158
179
  const headers = new Headers(defaultHeaders);
159
180
  const customHeaders = {
@@ -176,7 +197,7 @@ export class Client {
176
197
  }
177
198
  this.logger.debug("Performing request to:\n", `URL: ${normalizedInput.toString()}\n`, `Headers: ${JSON.stringify(sanitizeHeaders(headers), null, 2)}\n`);
178
199
  // Any non-request errors (eg. invalid JSON in the response) will be thrown as-is.
179
- return fetch(normalizedInput, normalizeRequest(init, headers, this.config)).then((resp) => {
200
+ return await fetch(normalizedInput, normalizeRequest(init, headers, this.config)).then((resp) => {
180
201
  this.logger.debug(`Received response with status ${resp.status}\n`);
181
202
  return normalizeResponse(resp, headers);
182
203
  });
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAA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AAC,KAAK,CAAC,iCAAiC,IAAI,CAAC,MAAM,IAAI,CAAC,CAAA;gBACnE,OAAO,iBAAiB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;YACzC,CAAC,CAAC,CAAA;QACJ,CAAC,CAAA;IACH,CAAC;CAkFF"}
@@ -1,42 +1,59 @@
1
+ import { FindParams, HttpTypes, SelectParams } from "@medusajs/types";
1
2
  import { Client } from "../client";
2
3
  import { ClientHeaders } from "../types";
3
4
  export declare class Store {
4
5
  private client;
5
6
  constructor(client: Client);
6
7
  region: {
7
- list: (queryParams?: Record<string, any>, headers?: ClientHeaders) => Promise<any>;
8
- retrieve: (id: string, queryParams?: Record<string, any>, headers?: ClientHeaders) => Promise<any>;
8
+ list: (query?: FindParams & HttpTypes.StoreRegionFilters, headers?: ClientHeaders) => Promise<HttpTypes.PaginatedResponse<{
9
+ regions: HttpTypes.StoreRegion[];
10
+ }>>;
11
+ retrieve: (id: string, query?: SelectParams, headers?: ClientHeaders) => Promise<{
12
+ region: HttpTypes.StoreRegion;
13
+ }>;
9
14
  };
10
15
  collection: {
11
- list: (queryParams?: Record<string, any>, headers?: ClientHeaders) => Promise<any>;
12
- retrieve: (id: string, queryParams?: Record<string, any>, headers?: ClientHeaders) => Promise<any>;
16
+ list: (query?: FindParams & HttpTypes.StoreCollectionFilters, headers?: ClientHeaders) => Promise<HttpTypes.PaginatedResponse<{
17
+ collections: HttpTypes.StoreCollection;
18
+ }>>;
19
+ retrieve: (id: string, query?: SelectParams, headers?: ClientHeaders) => Promise<{
20
+ collection: HttpTypes.StoreCollection;
21
+ }>;
13
22
  };
14
23
  category: {
15
- list: (queryParams?: Record<string, any>, headers?: ClientHeaders) => Promise<any>;
16
- retrieve: (id: string, queryParams?: Record<string, any>, headers?: ClientHeaders) => Promise<any>;
24
+ list: (query?: FindParams & HttpTypes.StoreProductCategoryFilters, headers?: ClientHeaders) => Promise<HttpTypes.PaginatedResponse<{
25
+ categories: HttpTypes.StoreProductCategory;
26
+ }>>;
27
+ retrieve: (id: string, query?: SelectParams, headers?: ClientHeaders) => Promise<{
28
+ category: HttpTypes.StoreProductCategory;
29
+ }>;
17
30
  };
18
31
  product: {
19
- list: (queryParams?: Record<string, any>, headers?: ClientHeaders) => Promise<any>;
20
- retrieve: (id: string, queryParams?: Record<string, any>, headers?: ClientHeaders) => Promise<any>;
32
+ list: (query?: FindParams & HttpTypes.StoreProductFilters, headers?: ClientHeaders) => Promise<HttpTypes.PaginatedResponse<{
33
+ products: HttpTypes.StoreProduct;
34
+ }>>;
35
+ retrieve: (id: string, query?: SelectParams, headers?: ClientHeaders) => Promise<{
36
+ product: HttpTypes.StoreProduct;
37
+ }>;
21
38
  };
22
39
  order: {
23
- retrieve: (id: string, queryParams?: Record<string, any>, headers?: ClientHeaders) => Promise<any>;
40
+ retrieve: (id: string, query?: SelectParams, headers?: ClientHeaders) => Promise<any>;
24
41
  };
25
42
  cart: {
26
- create: (body: any, headers?: ClientHeaders) => Promise<any>;
27
- update: (id: string, body: any, headers?: ClientHeaders) => Promise<any>;
28
- retrieve: (id: string, queryParams?: Record<string, any>, headers?: ClientHeaders) => Promise<any>;
29
- createLineItem: (cartId: string, body: any, headers?: ClientHeaders) => Promise<any>;
30
- updateLineItem: (cartId: string, lineItemId: string, body: any, headers?: ClientHeaders) => Promise<any>;
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>;
31
48
  deleteLineItem: (cartId: string, lineItemId: string, headers?: ClientHeaders) => Promise<any>;
32
- addShippingMethod: (cartId: string, body: any, headers?: ClientHeaders) => Promise<any>;
33
- complete: (cartId: 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>;
34
51
  };
35
52
  fulfillment: {
36
- listCartOptions: (queryParams?: Record<string, any>, headers?: ClientHeaders) => Promise<any>;
53
+ listCartOptions: (query?: Record<string, any>, headers?: ClientHeaders) => Promise<any>;
37
54
  };
38
55
  payment: {
39
- listPaymentProviders: (queryParams?: Record<string, any>, headers?: ClientHeaders) => Promise<any>;
40
- initiatePaymentSession: (cart: any, body: Record<string, any>, headers?: ClientHeaders) => Promise<any>;
56
+ listPaymentProviders: (query?: Record<string, any>, headers?: ClientHeaders) => Promise<any>;
57
+ initiatePaymentSession: (cart: any, body: Record<string, any>, query?: SelectParams, headers?: ClientHeaders) => Promise<any>;
41
58
  };
42
59
  }
@@ -1,140 +1,146 @@
1
1
  export class Store {
2
2
  constructor(client) {
3
3
  this.region = {
4
- list: async (queryParams, headers) => {
4
+ list: async (query, headers) => {
5
5
  return this.client.fetch(`/store/regions`, {
6
- query: queryParams,
6
+ query,
7
7
  headers,
8
8
  });
9
9
  },
10
- retrieve: async (id, queryParams, headers) => {
10
+ retrieve: async (id, query, headers) => {
11
11
  return this.client.fetch(`/store/regions/${id}`, {
12
- query: queryParams,
12
+ query,
13
13
  headers,
14
14
  });
15
15
  },
16
16
  };
17
17
  this.collection = {
18
- list: async (queryParams, headers) => {
18
+ list: async (query, headers) => {
19
19
  return this.client.fetch(`/store/collections`, {
20
- query: queryParams,
20
+ query,
21
21
  headers,
22
22
  });
23
23
  },
24
- retrieve: async (id, queryParams, headers) => {
24
+ retrieve: async (id, query, headers) => {
25
25
  return this.client.fetch(`/store/collections/${id}`, {
26
- query: queryParams,
26
+ query,
27
27
  headers,
28
28
  });
29
29
  },
30
30
  };
31
31
  this.category = {
32
- list: async (queryParams, headers) => {
32
+ list: async (query, headers) => {
33
33
  return this.client.fetch(`/store/product-categories`, {
34
- query: queryParams,
34
+ query,
35
35
  headers,
36
36
  });
37
37
  },
38
- retrieve: async (id, queryParams, headers) => {
38
+ retrieve: async (id, query, headers) => {
39
39
  return this.client.fetch(`/store/product-categories/${id}`, {
40
- query: queryParams,
40
+ query,
41
41
  headers,
42
42
  });
43
43
  },
44
44
  };
45
45
  this.product = {
46
- list: async (queryParams, headers) => {
46
+ list: async (query, headers) => {
47
47
  return this.client.fetch(`/store/products`, {
48
- query: queryParams,
48
+ query,
49
49
  headers,
50
50
  });
51
51
  },
52
- retrieve: async (id, queryParams, headers) => {
52
+ retrieve: async (id, query, headers) => {
53
53
  return this.client.fetch(`/store/products/${id}`, {
54
- query: queryParams,
54
+ query,
55
55
  headers,
56
56
  });
57
57
  },
58
58
  };
59
59
  this.order = {
60
- retrieve: async (id, queryParams, headers) => {
60
+ retrieve: async (id, query, headers) => {
61
61
  return this.client.fetch(`/store/orders/${id}`, {
62
- query: queryParams,
62
+ query,
63
63
  headers,
64
64
  });
65
65
  },
66
66
  };
67
67
  this.cart = {
68
- create: async (body, headers) => {
68
+ create: async (body, query, headers) => {
69
69
  return this.client.fetch(`/store/carts`, {
70
- headers,
71
70
  method: "POST",
71
+ headers,
72
72
  body,
73
+ query,
73
74
  });
74
75
  },
75
- update: async (id, body, headers) => {
76
+ update: async (id, body, query, headers) => {
76
77
  return this.client.fetch(`/store/carts/${id}`, {
77
- headers,
78
78
  method: "POST",
79
+ headers,
79
80
  body,
81
+ query,
80
82
  });
81
83
  },
82
- retrieve: async (id, queryParams, headers) => {
84
+ retrieve: async (id, query, headers) => {
83
85
  return this.client.fetch(`/store/carts/${id}`, {
84
- query: queryParams,
85
86
  headers,
87
+ query,
86
88
  });
87
89
  },
88
- createLineItem: async (cartId, body, headers) => {
90
+ createLineItem: async (cartId, body, query, headers) => {
89
91
  return this.client.fetch(`/store/carts/${cartId}/line-items`, {
90
- headers,
91
92
  method: "POST",
93
+ headers,
92
94
  body,
95
+ query,
93
96
  });
94
97
  },
95
- updateLineItem: async (cartId, lineItemId, body, headers) => {
98
+ updateLineItem: async (cartId, lineItemId, body, query, headers) => {
96
99
  return this.client.fetch(`/store/carts/${cartId}/line-items/${lineItemId}`, {
97
- headers,
98
100
  method: "POST",
101
+ headers,
99
102
  body,
103
+ query,
100
104
  });
101
105
  },
102
106
  deleteLineItem: async (cartId, lineItemId, headers) => {
103
107
  return this.client.fetch(`/store/carts/${cartId}/line-items/${lineItemId}`, {
104
- headers,
105
108
  method: "DELETE",
109
+ headers,
106
110
  });
107
111
  },
108
- addShippingMethod: async (cartId, body, headers) => {
112
+ addShippingMethod: async (cartId, body, query, headers) => {
109
113
  return this.client.fetch(`/store/carts/${cartId}/shipping-methods`, {
110
- headers,
111
114
  method: "POST",
115
+ headers,
112
116
  body,
117
+ query,
113
118
  });
114
119
  },
115
- complete: async (cartId, headers) => {
120
+ complete: async (cartId, query, headers) => {
116
121
  return this.client.fetch(`/store/carts/${cartId}/complete`, {
117
- headers,
118
122
  method: "POST",
123
+ headers,
124
+ query,
119
125
  });
120
126
  },
121
127
  };
122
128
  this.fulfillment = {
123
- listCartOptions: async (queryParams, headers) => {
129
+ listCartOptions: async (query, headers) => {
124
130
  return this.client.fetch(`/store/shipping-options`, {
125
- query: queryParams,
131
+ query,
126
132
  headers,
127
133
  });
128
134
  },
129
135
  };
130
136
  this.payment = {
131
- listPaymentProviders: async (queryParams, headers) => {
137
+ listPaymentProviders: async (query, headers) => {
132
138
  return this.client.fetch(`/store/payment-providers`, {
133
- query: queryParams,
139
+ query,
134
140
  headers,
135
141
  });
136
142
  },
137
- initiatePaymentSession: async (cart, body, headers) => {
143
+ initiatePaymentSession: async (cart, body, query, headers) => {
138
144
  let paymentCollectionId = cart.payment_collection?.id;
139
145
  if (!paymentCollectionId) {
140
146
  const collectionBody = {
@@ -144,15 +150,16 @@ export class Store {
144
150
  amount: cart.total,
145
151
  };
146
152
  paymentCollectionId = (await this.client.fetch(`/store/payment-collections`, {
147
- headers,
148
153
  method: "POST",
154
+ headers,
149
155
  body: collectionBody,
150
156
  })).payment_collection.id;
151
157
  }
152
158
  return this.client.fetch(`/store/payment-collections/${paymentCollectionId}/payment-sessions`, {
153
- headers,
154
159
  method: "POST",
160
+ headers,
155
161
  body,
162
+ query,
156
163
  });
157
164
  },
158
165
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/store/index.ts"],"names":[],"mappings":"AAGA,MAAM,OAAO,KAAK;IAGhB,YAAY,MAAc;QAInB,WAAM,GAAG;YACd,IAAI,EAAE,KAAK,EACT,WAAiC,EACjC,OAAuB,EACvB,EAAE;gBACF,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAM,gBAAgB,EAAE;oBAC9C,KAAK,EAAE,WAAW;oBAClB,OAAO;iBACR,CAAC,CAAA;YACJ,CAAC;YACD,QAAQ,EAAE,KAAK,EACb,EAAU,EACV,WAAiC,EACjC,OAAuB,EACvB,EAAE;gBACF,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAM,kBAAkB,EAAE,EAAE,EAAE;oBACpD,KAAK,EAAE,WAAW;oBAClB,OAAO;iBACR,CAAC,CAAA;YACJ,CAAC;SACF,CAAA;QAEM,eAAU,GAAG;YAClB,IAAI,EAAE,KAAK,EACT,WAAiC,EACjC,OAAuB,EACvB,EAAE;gBACF,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAM,oBAAoB,EAAE;oBAClD,KAAK,EAAE,WAAW;oBAClB,OAAO;iBACR,CAAC,CAAA;YACJ,CAAC;YACD,QAAQ,EAAE,KAAK,EACb,EAAU,EACV,WAAiC,EACjC,OAAuB,EACvB,EAAE;gBACF,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAM,sBAAsB,EAAE,EAAE,EAAE;oBACxD,KAAK,EAAE,WAAW;oBAClB,OAAO;iBACR,CAAC,CAAA;YACJ,CAAC;SACF,CAAA;QAEM,aAAQ,GAAG;YAChB,IAAI,EAAE,K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ACD,mBAAmB,GAAG,CACpB,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAM,4BAA4B,EAAE;wBACzD,OAAO;wBACP,MAAM,EAAE,MAAM;wBACd,IAAI,EAAE,cAAc;qBACrB,CAAC,CACH,CAAC,kBAAkB,CAAC,EAAE,CAAA;gBACzB,CAAC;gBAED,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CACtB,8BAA8B,mBAAmB,mBAAmB,EACpE;oBACE,OAAO;oBACP,MAAM,EAAE,MAAM;oBACd,IAAI;iBACL,CACF,CAAA;YACH,CAAC;SACF,CAAA;QAjPC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;CAiPF"}
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,KAAK;oBACL,OAAO;iBACR,CAAC,CAAA;YACJ,CAAC;YACD,QAAQ,EAAE,KAAK,EACb,EAAU,EACV,KAAoB,EACpB,OAAuB,EACvB,EAAE;gBACF,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CACtB,kBAAkB,EAAE,EAAE,EACtB;oBACE,KAAK;oBACL,OAAO;iBACR,CACF,CAAA;YACH,CAAC;SACF,CAAA;QAEM,eAAU,GAAG;YAClB,IAAI,EAAE,KAAK,EACT,KAAqD,EACrD,OAAuB,EACvB,EAAE;gBACF,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAEtB,oBAAoB,EAAE;oBACtB,KAAK;oBACL,OAAO;iBACR,CAAC,CAAA;YACJ,CAAC;YACD,QAAQ,EAAE,KAAK,EACb,EAAU,EACV,KAAoB,EACpB,OAAuB,EACvB,EAAE;gBACF,OAAO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AC,mBAAmB,EAAE,CAAC;oBACzB,MAAM,cAAc,GAAG;wBACrB,OAAO,EAAE,IAAI,CAAC,EAAE;wBAChB,SAAS,EAAE,IAAI,CAAC,SAAS;wBACzB,aAAa,EAAE,IAAI,CAAC,aAAa;wBACjC,MAAM,EAAE,IAAI,CAAC,KAAK;qBACnB,CAAA;oBACD,mBAAmB,GAAG,CACpB,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAM,4BAA4B,EAAE;wBACzD,MAAM,EAAE,MAAM;wBACd,OAAO;wBACP,IAAI,EAAE,cAAc;qBACrB,CAAC,CACH,CAAC,kBAAkB,CAAC,EAAE,CAAA;gBACzB,CAAC;gBAED,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CACtB,8BAA8B,mBAAmB,mBAAmB,EACpE;oBACE,MAAM,EAAE,MAAM;oBACd,OAAO;oBACP,IAAI;oBACJ,KAAK;iBACN,CACF,CAAA;YACH,CAAC;SACF,CAAA;QA7RC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;CA6RF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medusajs/js-sdk",
3
- "version": "0.0.2-snapshot-20240516152256",
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-20240516152256",
31
+ "@medusajs/types": "1.12.0-snapshot-20240520162050",
32
32
  "qs": "^6.12.1"
33
33
  },
34
34
  "scripts": {