@medusajs/js-sdk 2.0.0-preview-20241022100028 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. package/dist/admin/api-key.d.ts +144 -1
  2. package/dist/admin/api-key.d.ts.map +1 -1
  3. package/dist/admin/api-key.js +143 -0
  4. package/dist/admin/api-key.js.map +1 -1
  5. package/dist/admin/campaign.d.ts +135 -0
  6. package/dist/admin/campaign.d.ts.map +1 -1
  7. package/dist/admin/campaign.js +135 -0
  8. package/dist/admin/campaign.js.map +1 -1
  9. package/dist/admin/claim.d.ts +542 -19
  10. package/dist/admin/claim.d.ts.map +1 -1
  11. package/dist/admin/claim.js +523 -0
  12. package/dist/admin/claim.js.map +1 -1
  13. package/dist/admin/currency.d.ts +80 -1
  14. package/dist/admin/currency.d.ts.map +1 -1
  15. package/dist/admin/currency.js +81 -2
  16. package/dist/admin/currency.js.map +1 -1
  17. package/dist/admin/customer-group.d.ts +152 -2
  18. package/dist/admin/customer-group.d.ts.map +1 -1
  19. package/dist/admin/customer-group.js +150 -0
  20. package/dist/admin/customer-group.js.map +1 -1
  21. package/dist/admin/customer.d.ts +135 -13
  22. package/dist/admin/customer.d.ts.map +1 -1
  23. package/dist/admin/customer.js +130 -0
  24. package/dist/admin/customer.js.map +1 -1
  25. package/dist/admin/exchange.d.ts +471 -16
  26. package/dist/admin/exchange.d.ts.map +1 -1
  27. package/dist/admin/exchange.js +455 -0
  28. package/dist/admin/exchange.js.map +1 -1
  29. package/dist/admin/fulfillment-provider.d.ts +47 -0
  30. package/dist/admin/fulfillment-provider.d.ts.map +1 -1
  31. package/dist/admin/fulfillment-provider.js +47 -0
  32. package/dist/admin/fulfillment-provider.js.map +1 -1
  33. package/dist/admin/fulfillment-set.d.ts +122 -0
  34. package/dist/admin/fulfillment-set.d.ts.map +1 -1
  35. package/dist/admin/fulfillment-set.js +122 -0
  36. package/dist/admin/fulfillment-set.js.map +1 -1
  37. package/dist/admin/fulfillment.d.ts +74 -0
  38. package/dist/admin/fulfillment.d.ts.map +1 -1
  39. package/dist/admin/fulfillment.js +75 -0
  40. package/dist/admin/fulfillment.js.map +1 -1
  41. package/dist/admin/inventory-item.d.ts +252 -1
  42. package/dist/admin/inventory-item.d.ts.map +1 -1
  43. package/dist/admin/inventory-item.js +251 -0
  44. package/dist/admin/inventory-item.js.map +1 -1
  45. package/dist/admin/invite.d.ts +170 -15
  46. package/dist/admin/invite.d.ts.map +1 -1
  47. package/dist/admin/invite.js +162 -0
  48. package/dist/admin/invite.js.map +1 -1
  49. package/dist/esm/admin/api-key.d.ts +144 -1
  50. package/dist/esm/admin/api-key.d.ts.map +1 -1
  51. package/dist/esm/admin/api-key.js +143 -0
  52. package/dist/esm/admin/api-key.js.map +1 -1
  53. package/dist/esm/admin/campaign.d.ts +135 -0
  54. package/dist/esm/admin/campaign.d.ts.map +1 -1
  55. package/dist/esm/admin/campaign.js +135 -0
  56. package/dist/esm/admin/campaign.js.map +1 -1
  57. package/dist/esm/admin/claim.d.ts +542 -19
  58. package/dist/esm/admin/claim.d.ts.map +1 -1
  59. package/dist/esm/admin/claim.js +523 -0
  60. package/dist/esm/admin/claim.js.map +1 -1
  61. package/dist/esm/admin/currency.d.ts +80 -1
  62. package/dist/esm/admin/currency.d.ts.map +1 -1
  63. package/dist/esm/admin/currency.js +81 -2
  64. package/dist/esm/admin/currency.js.map +1 -1
  65. package/dist/esm/admin/customer-group.d.ts +152 -2
  66. package/dist/esm/admin/customer-group.d.ts.map +1 -1
  67. package/dist/esm/admin/customer-group.js +150 -0
  68. package/dist/esm/admin/customer-group.js.map +1 -1
  69. package/dist/esm/admin/customer.d.ts +135 -13
  70. package/dist/esm/admin/customer.d.ts.map +1 -1
  71. package/dist/esm/admin/customer.js +130 -0
  72. package/dist/esm/admin/customer.js.map +1 -1
  73. package/dist/esm/admin/exchange.d.ts +471 -16
  74. package/dist/esm/admin/exchange.d.ts.map +1 -1
  75. package/dist/esm/admin/exchange.js +455 -0
  76. package/dist/esm/admin/exchange.js.map +1 -1
  77. package/dist/esm/admin/fulfillment-provider.d.ts +47 -0
  78. package/dist/esm/admin/fulfillment-provider.d.ts.map +1 -1
  79. package/dist/esm/admin/fulfillment-provider.js +47 -0
  80. package/dist/esm/admin/fulfillment-provider.js.map +1 -1
  81. package/dist/esm/admin/fulfillment-set.d.ts +122 -0
  82. package/dist/esm/admin/fulfillment-set.d.ts.map +1 -1
  83. package/dist/esm/admin/fulfillment-set.js +122 -0
  84. package/dist/esm/admin/fulfillment-set.js.map +1 -1
  85. package/dist/esm/admin/fulfillment.d.ts +74 -0
  86. package/dist/esm/admin/fulfillment.d.ts.map +1 -1
  87. package/dist/esm/admin/fulfillment.js +75 -0
  88. package/dist/esm/admin/fulfillment.js.map +1 -1
  89. package/dist/esm/admin/inventory-item.d.ts +252 -1
  90. package/dist/esm/admin/inventory-item.d.ts.map +1 -1
  91. package/dist/esm/admin/inventory-item.js +251 -0
  92. package/dist/esm/admin/inventory-item.js.map +1 -1
  93. package/dist/esm/admin/invite.d.ts +170 -15
  94. package/dist/esm/admin/invite.d.ts.map +1 -1
  95. package/dist/esm/admin/invite.js +162 -0
  96. package/dist/esm/admin/invite.js.map +1 -1
  97. package/dist/esm/store/index.d.ts +1 -1
  98. package/dist/esm/store/index.js +1 -1
  99. package/dist/store/index.d.ts +1 -1
  100. package/dist/store/index.js +1 -1
  101. package/package.json +2 -2
@@ -10,23 +10,178 @@ export declare class Invite {
10
10
  * @ignore
11
11
  */
12
12
  constructor(client: Client);
13
+ /**
14
+ * This method accepts an invite. It requires sending a previous request to
15
+ * the {@link Auth.register}.
16
+ *
17
+ * This method sends a request to the [Accept Invite]
18
+ * (https://docs.medusajs.com/v2/api/admin#invites_postinvitesaccept)
19
+ * API route.
20
+ *
21
+ * @param input - The details of the user to create.
22
+ * @param query - Configure the fields to retrieve in the user.
23
+ * @param headers - Headers to pass in the request
24
+ * @returns The user's details.
25
+ *
26
+ * @example
27
+ * const token = await sdk.auth.register("user", "emailpass", {
28
+ * email: "user@gmail.com",
29
+ * password: "supersecret"
30
+ * })
31
+ *
32
+ * sdk.admin.invite.accept(
33
+ * {
34
+ * email: "user@gmail.com",
35
+ * first_name: "John",
36
+ * last_name: "Smith",
37
+ * invite_token: "12345..."
38
+ * },
39
+ * {
40
+ * Authorization: `Bearer ${token}`
41
+ * }
42
+ * )
43
+ * .then(({ user }) => {
44
+ * console.log(user)
45
+ * })
46
+ */
13
47
  accept(input: HttpTypes.AdminAcceptInvite & {
48
+ /**
49
+ * The invite's token.
50
+ */
14
51
  invite_token: string;
15
- }, query?: SelectParams, headers?: ClientHeaders): Promise<{
16
- user: HttpTypes.AdminUserResponse;
17
- }>;
18
- create(body: HttpTypes.AdminCreateInvite, query?: SelectParams, headers?: ClientHeaders): Promise<{
19
- invite: HttpTypes.AdminInviteResponse;
20
- }>;
21
- retrieve(id: string, query?: SelectParams, headers?: ClientHeaders): Promise<{
22
- invite: HttpTypes.AdminInviteResponse;
23
- }>;
24
- list(queryParams?: FindParams, headers?: ClientHeaders): Promise<HttpTypes.PaginatedResponse<{
25
- invites: HttpTypes.AdminInviteResponse[];
26
- }>>;
27
- resend(id: string, headers?: ClientHeaders): Promise<{
28
- invite: HttpTypes.AdminInviteResponse;
29
- }>;
52
+ }, query?: SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminAcceptInviteResponse>;
53
+ /**
54
+ * This method creates an invite. It sends a request to the
55
+ * [Create Invite](https://docs.medusajs.com/v2/api/admin#invites_postinvites)
56
+ * API route.
57
+ *
58
+ * @param body - The invite's details.
59
+ * @param query - Configure the fields to retrieve in the invite.
60
+ * @param headers - Headers to pass in the request
61
+ * @returns The invite's details.
62
+ *
63
+ * @example
64
+ * sdk.admin.invite.create({
65
+ * email: "user@gmail.com",
66
+ * })
67
+ * .then(({ invite }) => {
68
+ * console.log(invite)
69
+ * })
70
+ */
71
+ create(body: HttpTypes.AdminCreateInvite, query?: SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminInviteResponse>;
72
+ /**
73
+ * This method retrieves an invite by its ID. It sends a request to the
74
+ * [Get Invite](https://docs.medusajs.com/v2/api/admin#invites_getinvitesid)
75
+ * API route.
76
+ *
77
+ * @param id - The invite's ID.
78
+ * @param query - Configure the fields to retrieve in the invite.
79
+ * @param headers - Headers to pass in the request
80
+ * @returns The invite's details.
81
+ *
82
+ * @example
83
+ * To retrieve an invite its ID:
84
+ *
85
+ * ```ts
86
+ * sdk.admin.invite.retrieve("invite_123")
87
+ * .then(({ invite }) => {
88
+ * console.log(invite)
89
+ * })
90
+ * ```
91
+ *
92
+ * To specify the fields and relations to retrieve:
93
+ *
94
+ * ```ts
95
+ * sdk.admin.invite.retrieve("invite_123", {
96
+ * fields: "id,email"
97
+ * })
98
+ * .then(({ invite }) => {
99
+ * console.log(invite)
100
+ * })
101
+ * ```
102
+ *
103
+ * Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/v2/api/store#select-fields-and-relations).
104
+ */
105
+ retrieve(id: string, query?: SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminInviteResponse>;
106
+ /**
107
+ * This method retrieves a paginated list of invites. It sends a request to the
108
+ * [List Invites](https://docs.medusajs.com/v2/api/admin#invites_getinvites)
109
+ * API route.
110
+ *
111
+ * @param queryParams - Filters and pagination configurations.
112
+ * @param headers - Headers to pass in the request.
113
+ * @returns The paginated list of invites.
114
+ *
115
+ * @example
116
+ * To retrieve the list of invites:
117
+ *
118
+ * ```ts
119
+ * sdk.admin.invite.list()
120
+ * .then(({ invites, count, limit, offset }) => {
121
+ * console.log(invites)
122
+ * })
123
+ * ```
124
+ *
125
+ * To configure the pagination, pass the `limit` and `offset` query parameters.
126
+ *
127
+ * For example, to retrieve only 10 items and skip 10 items:
128
+ *
129
+ * ```ts
130
+ * sdk.admin.invite.list({
131
+ * limit: 10,
132
+ * offset: 10
133
+ * })
134
+ * .then(({ invites, count, limit, offset }) => {
135
+ * console.log(invites)
136
+ * })
137
+ * ```
138
+ *
139
+ * Using the `fields` query parameter, you can specify the fields and relations to retrieve
140
+ * in each invite:
141
+ *
142
+ * ```ts
143
+ * sdk.admin.invite.list({
144
+ * fields: "id,email"
145
+ * })
146
+ * .then(({ invites, count, limit, offset }) => {
147
+ * console.log(invites)
148
+ * })
149
+ * ```
150
+ *
151
+ * Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/v2/api/store#select-fields-and-relations).
152
+ */
153
+ list(queryParams?: FindParams, headers?: ClientHeaders): Promise<HttpTypes.AdminInviteListResponse>;
154
+ /**
155
+ * This method refreshes the token of an invite. It sends a request to the
156
+ * [Refresh Invite Token](https://docs.medusajs.com/v2/api/admin#invites_postinvitesidresend)
157
+ * API route.
158
+ *
159
+ * @param id - The invite's ID.
160
+ * @param headers - Headers to pass in the request.
161
+ * @returns The invite's details.
162
+ *
163
+ * @example
164
+ * sdk.admin.invite.resend("invite_123")
165
+ * .then(({ invite }) => {
166
+ * console.log(invite)
167
+ * })
168
+ */
169
+ resend(id: string, headers?: ClientHeaders): Promise<HttpTypes.AdminInviteResponse>;
170
+ /**
171
+ * This method deletes an invite. It sends a request to the
172
+ * [Delete Invite](https://docs.medusajs.com/v2/api/admin#invites_deleteinvitesid)
173
+ * API route.
174
+ *
175
+ * @param id - The invite's ID.
176
+ * @param headers - Headers to pass in the request.
177
+ * @returns The deletion's details.
178
+ *
179
+ * @example
180
+ * sdk.admin.invite.delete("invite_123")
181
+ * .then(({ deleted }) => {
182
+ * console.log(deleted)
183
+ * })
184
+ */
30
185
  delete(id: string, headers?: ClientHeaders): Promise<HttpTypes.AdminInviteDeleteResponse>;
31
186
  }
32
187
  //# sourceMappingURL=invite.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"invite.d.ts","sourceRoot":"","sources":["../../../src/admin/invite.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EAET,YAAY,EACb,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,EAAE,aAAa,EAA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;;;OAiCG;IACG,MAAM,CACV,KAAK,EAAE,SAAS,CAAC,iBAAiB,GAAG;QACnC;;WAEG;QACH,YAAY,EAAE,MAAM,CAAA;KACrB,EACD,KAAK,CAAC,EAAE,YAAY,EACpB,OAAO,CAAC,EAAE,aAAa;IAczB;;;;;;;;;;;;;;;;;OAiBG;IACG,MAAM,CACV,IAAI,EAAE,SAAS,CAAC,iBAAiB,EACjC,KAAK,CAAC,EAAE,YAAY,EACpB,OAAO,CAAC,EAAE,aAAa;IAazB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACG,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,aAAa;IAUxE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8CG;IACG,IAAI,CAAC,WAAW,CAAC,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,aAAa;IAS5D;;;;;;;;;;;;;;OAcG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa;IAUhD;;;;;;;;;;;;;;OAcG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa;CASjD"}
@@ -25,6 +25,40 @@ export class Invite {
25
25
  constructor(client) {
26
26
  this.client = client;
27
27
  }
28
+ /**
29
+ * This method accepts an invite. It requires sending a previous request to
30
+ * the {@link Auth.register}.
31
+ *
32
+ * This method sends a request to the [Accept Invite]
33
+ * (https://docs.medusajs.com/v2/api/admin#invites_postinvitesaccept)
34
+ * API route.
35
+ *
36
+ * @param input - The details of the user to create.
37
+ * @param query - Configure the fields to retrieve in the user.
38
+ * @param headers - Headers to pass in the request
39
+ * @returns The user's details.
40
+ *
41
+ * @example
42
+ * const token = await sdk.auth.register("user", "emailpass", {
43
+ * email: "user@gmail.com",
44
+ * password: "supersecret"
45
+ * })
46
+ *
47
+ * sdk.admin.invite.accept(
48
+ * {
49
+ * email: "user@gmail.com",
50
+ * first_name: "John",
51
+ * last_name: "Smith",
52
+ * invite_token: "12345..."
53
+ * },
54
+ * {
55
+ * Authorization: `Bearer ${token}`
56
+ * }
57
+ * )
58
+ * .then(({ user }) => {
59
+ * console.log(user)
60
+ * })
61
+ */
28
62
  accept(input, query, headers) {
29
63
  return __awaiter(this, void 0, void 0, function* () {
30
64
  const { invite_token } = input, rest = __rest(input, ["invite_token"]);
@@ -36,6 +70,24 @@ export class Invite {
36
70
  });
37
71
  });
38
72
  }
73
+ /**
74
+ * This method creates an invite. It sends a request to the
75
+ * [Create Invite](https://docs.medusajs.com/v2/api/admin#invites_postinvites)
76
+ * API route.
77
+ *
78
+ * @param body - The invite's details.
79
+ * @param query - Configure the fields to retrieve in the invite.
80
+ * @param headers - Headers to pass in the request
81
+ * @returns The invite's details.
82
+ *
83
+ * @example
84
+ * sdk.admin.invite.create({
85
+ * email: "user@gmail.com",
86
+ * })
87
+ * .then(({ invite }) => {
88
+ * console.log(invite)
89
+ * })
90
+ */
39
91
  create(body, query, headers) {
40
92
  return __awaiter(this, void 0, void 0, function* () {
41
93
  return yield this.client.fetch(`/admin/invites`, {
@@ -46,6 +98,39 @@ export class Invite {
46
98
  });
47
99
  });
48
100
  }
101
+ /**
102
+ * This method retrieves an invite by its ID. It sends a request to the
103
+ * [Get Invite](https://docs.medusajs.com/v2/api/admin#invites_getinvitesid)
104
+ * API route.
105
+ *
106
+ * @param id - The invite's ID.
107
+ * @param query - Configure the fields to retrieve in the invite.
108
+ * @param headers - Headers to pass in the request
109
+ * @returns The invite's details.
110
+ *
111
+ * @example
112
+ * To retrieve an invite its ID:
113
+ *
114
+ * ```ts
115
+ * sdk.admin.invite.retrieve("invite_123")
116
+ * .then(({ invite }) => {
117
+ * console.log(invite)
118
+ * })
119
+ * ```
120
+ *
121
+ * To specify the fields and relations to retrieve:
122
+ *
123
+ * ```ts
124
+ * sdk.admin.invite.retrieve("invite_123", {
125
+ * fields: "id,email"
126
+ * })
127
+ * .then(({ invite }) => {
128
+ * console.log(invite)
129
+ * })
130
+ * ```
131
+ *
132
+ * Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/v2/api/store#select-fields-and-relations).
133
+ */
49
134
  retrieve(id, query, headers) {
50
135
  return __awaiter(this, void 0, void 0, function* () {
51
136
  return yield this.client.fetch(`/admin/invites/${id}`, {
@@ -54,6 +139,53 @@ export class Invite {
54
139
  });
55
140
  });
56
141
  }
142
+ /**
143
+ * This method retrieves a paginated list of invites. It sends a request to the
144
+ * [List Invites](https://docs.medusajs.com/v2/api/admin#invites_getinvites)
145
+ * API route.
146
+ *
147
+ * @param queryParams - Filters and pagination configurations.
148
+ * @param headers - Headers to pass in the request.
149
+ * @returns The paginated list of invites.
150
+ *
151
+ * @example
152
+ * To retrieve the list of invites:
153
+ *
154
+ * ```ts
155
+ * sdk.admin.invite.list()
156
+ * .then(({ invites, count, limit, offset }) => {
157
+ * console.log(invites)
158
+ * })
159
+ * ```
160
+ *
161
+ * To configure the pagination, pass the `limit` and `offset` query parameters.
162
+ *
163
+ * For example, to retrieve only 10 items and skip 10 items:
164
+ *
165
+ * ```ts
166
+ * sdk.admin.invite.list({
167
+ * limit: 10,
168
+ * offset: 10
169
+ * })
170
+ * .then(({ invites, count, limit, offset }) => {
171
+ * console.log(invites)
172
+ * })
173
+ * ```
174
+ *
175
+ * Using the `fields` query parameter, you can specify the fields and relations to retrieve
176
+ * in each invite:
177
+ *
178
+ * ```ts
179
+ * sdk.admin.invite.list({
180
+ * fields: "id,email"
181
+ * })
182
+ * .then(({ invites, count, limit, offset }) => {
183
+ * console.log(invites)
184
+ * })
185
+ * ```
186
+ *
187
+ * Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/v2/api/store#select-fields-and-relations).
188
+ */
57
189
  list(queryParams, headers) {
58
190
  return __awaiter(this, void 0, void 0, function* () {
59
191
  return yield this.client.fetch(`/admin/invites`, {
@@ -62,6 +194,21 @@ export class Invite {
62
194
  });
63
195
  });
64
196
  }
197
+ /**
198
+ * This method refreshes the token of an invite. It sends a request to the
199
+ * [Refresh Invite Token](https://docs.medusajs.com/v2/api/admin#invites_postinvitesidresend)
200
+ * API route.
201
+ *
202
+ * @param id - The invite's ID.
203
+ * @param headers - Headers to pass in the request.
204
+ * @returns The invite's details.
205
+ *
206
+ * @example
207
+ * sdk.admin.invite.resend("invite_123")
208
+ * .then(({ invite }) => {
209
+ * console.log(invite)
210
+ * })
211
+ */
65
212
  resend(id, headers) {
66
213
  return __awaiter(this, void 0, void 0, function* () {
67
214
  return yield this.client.fetch(`/admin/invites/${id}/resend`, {
@@ -70,6 +217,21 @@ export class Invite {
70
217
  });
71
218
  });
72
219
  }
220
+ /**
221
+ * This method deletes an invite. It sends a request to the
222
+ * [Delete Invite](https://docs.medusajs.com/v2/api/admin#invites_deleteinvitesid)
223
+ * API route.
224
+ *
225
+ * @param id - The invite's ID.
226
+ * @param headers - Headers to pass in the request.
227
+ * @returns The deletion's details.
228
+ *
229
+ * @example
230
+ * sdk.admin.invite.delete("invite_123")
231
+ * .then(({ deleted }) => {
232
+ * console.log(deleted)
233
+ * })
234
+ */
73
235
  delete(id, headers) {
74
236
  return __awaiter(this, void 0, void 0, function* () {
75
237
  return yield this.client.fetch(`/admin/invites/${id}`, {
@@ -1 +1 @@
1
- {"version":3,"file":"invite.js","sourceRoot":"","sources":["../../../src/admin/invite.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AASA,MAAM,OAAO,MAAM;IAKjB;;OAEG;IACH,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAEK,MAAM,CACV,KAA6D,EAC7D,KAAoB,EACpB,OAAuB;;YAEvB,MAAM,EAAE,YAAY,KAAc,KAAK,EAAd,IAAI,UAAK,KAAK,EAAjC,gBAAyB,CAAQ,CAAA;YACvC,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,+BAA+B,KAAK,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ACG,MAAM,CAAC,EAAU,EAAE,OAAuB;;YAC9C,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,kBAAkB,EAAE,SAAS,EAC7B;gBACE,MAAM,EAAE,MAAM;gBACd,OAAO;aACR,CACF,CAAA;QACH,CAAC;KAAA;IAED;;;;;;;;;;;;;;OAcG;IACG,MAAM,CAAC,EAAU,EAAE,OAAuB;;YAC9C,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,kBAAkB,EAAE,EAAE,EACtB;gBACE,MAAM,EAAE,QAAQ;gBAChB,OAAO;aACR,CACF,CAAA;QACH,CAAC;KAAA;CACF"}
@@ -787,7 +787,7 @@ export declare class Store {
787
787
  * },
788
788
  * {},
789
789
  * {
790
- * authorization: `Bearer ${token}`
790
+ * Authorization: `Bearer ${token}`
791
791
  * }
792
792
  * )
793
793
  * .then(({ customer }) => {
@@ -917,7 +917,7 @@ export class Store {
917
917
  * },
918
918
  * {},
919
919
  * {
920
- * authorization: `Bearer ${token}`
920
+ * Authorization: `Bearer ${token}`
921
921
  * }
922
922
  * )
923
923
  * .then(({ customer }) => {
@@ -787,7 +787,7 @@ export declare class Store {
787
787
  * },
788
788
  * {},
789
789
  * {
790
- * authorization: `Bearer ${token}`
790
+ * Authorization: `Bearer ${token}`
791
791
  * }
792
792
  * )
793
793
  * .then(({ customer }) => {
@@ -910,7 +910,7 @@ class Store {
910
910
  * },
911
911
  * {},
912
912
  * {
913
- * authorization: `Bearer ${token}`
913
+ * Authorization: `Bearer ${token}`
914
914
  * }
915
915
  * )
916
916
  * .then(({ customer }) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@medusajs/js-sdk",
3
- "version": "2.0.0-preview-20241022100028",
3
+ "version": "2.0.0",
4
4
  "description": "SDK for the Medusa API",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -35,7 +35,7 @@
35
35
  "typescript": "^5.6.2"
36
36
  },
37
37
  "dependencies": {
38
- "@medusajs/types": "2.0.0-preview-20241022100028",
38
+ "@medusajs/types": "^2.0.0",
39
39
  "fetch-event-stream": "^0.1.5",
40
40
  "qs": "^6.12.1"
41
41
  },