@medusajs/js-sdk 2.0.0 → 2.0.1-snapshot-20241025090810
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/admin/api-key.d.ts +8 -8
- package/dist/admin/api-key.js +8 -8
- package/dist/admin/campaign.d.ts +8 -8
- package/dist/admin/campaign.js +8 -8
- package/dist/admin/claim.d.ts +22 -22
- package/dist/admin/claim.js +22 -22
- package/dist/admin/currency.d.ts +4 -4
- package/dist/admin/currency.js +4 -4
- package/dist/admin/customer-group.d.ts +8 -8
- package/dist/admin/customer-group.js +8 -8
- package/dist/admin/customer.d.ts +27 -7
- package/dist/admin/customer.d.ts.map +1 -1
- package/dist/admin/customer.js +33 -7
- package/dist/admin/customer.js.map +1 -1
- package/dist/admin/exchange.d.ts +21 -21
- package/dist/admin/exchange.js +21 -21
- package/dist/admin/fulfillment-provider.d.ts +2 -2
- package/dist/admin/fulfillment-provider.js +2 -2
- package/dist/admin/fulfillment-set.d.ts +6 -6
- package/dist/admin/fulfillment-set.js +6 -6
- package/dist/admin/fulfillment.d.ts +3 -3
- package/dist/admin/fulfillment.js +3 -3
- package/dist/admin/inventory-item.d.ts +12 -12
- package/dist/admin/inventory-item.js +12 -12
- package/dist/admin/invite.d.ts +8 -8
- package/dist/admin/invite.js +8 -8
- package/dist/admin/payment-collection.d.ts +0 -2
- package/dist/admin/payment-collection.d.ts.map +1 -1
- package/dist/admin/payment-collection.js +0 -12
- package/dist/admin/payment-collection.js.map +1 -1
- package/dist/auth/index.d.ts +10 -10
- package/dist/auth/index.js +10 -10
- package/dist/esm/admin/api-key.d.ts +8 -8
- package/dist/esm/admin/api-key.js +8 -8
- package/dist/esm/admin/campaign.d.ts +8 -8
- package/dist/esm/admin/campaign.js +8 -8
- package/dist/esm/admin/claim.d.ts +22 -22
- package/dist/esm/admin/claim.js +22 -22
- package/dist/esm/admin/currency.d.ts +4 -4
- package/dist/esm/admin/currency.js +4 -4
- package/dist/esm/admin/customer-group.d.ts +8 -8
- package/dist/esm/admin/customer-group.js +8 -8
- package/dist/esm/admin/customer.d.ts +27 -7
- package/dist/esm/admin/customer.d.ts.map +1 -1
- package/dist/esm/admin/customer.js +35 -7
- package/dist/esm/admin/customer.js.map +1 -1
- package/dist/esm/admin/exchange.d.ts +21 -21
- package/dist/esm/admin/exchange.js +21 -21
- package/dist/esm/admin/fulfillment-provider.d.ts +2 -2
- package/dist/esm/admin/fulfillment-provider.js +2 -2
- package/dist/esm/admin/fulfillment-set.d.ts +6 -6
- package/dist/esm/admin/fulfillment-set.js +6 -6
- package/dist/esm/admin/fulfillment.d.ts +3 -3
- package/dist/esm/admin/fulfillment.js +3 -3
- package/dist/esm/admin/inventory-item.d.ts +12 -12
- package/dist/esm/admin/inventory-item.js +12 -12
- package/dist/esm/admin/invite.d.ts +8 -8
- package/dist/esm/admin/invite.js +8 -8
- package/dist/esm/admin/payment-collection.d.ts +0 -2
- package/dist/esm/admin/payment-collection.d.ts.map +1 -1
- package/dist/esm/admin/payment-collection.js +0 -16
- package/dist/esm/admin/payment-collection.js.map +1 -1
- package/dist/esm/auth/index.d.ts +10 -10
- package/dist/esm/auth/index.js +10 -10
- package/dist/esm/store/index.d.ts +73 -73
- package/dist/esm/store/index.js +73 -73
- package/dist/store/index.d.ts +73 -73
- package/dist/store/index.js +73 -73
- package/package.json +2 -2
@@ -16,7 +16,7 @@ export class Currency {
|
|
16
16
|
}
|
17
17
|
/**
|
18
18
|
* This method retrieves a paginated list of currencies. It sends a request to the
|
19
|
-
* [List Currencies](https://docs.medusajs.com/
|
19
|
+
* [List Currencies](https://docs.medusajs.com/api/admin#currencies_getcurrencies)
|
20
20
|
* API route.
|
21
21
|
*
|
22
22
|
* @param query - Filters and pagination configurations.
|
@@ -59,7 +59,7 @@ export class Currency {
|
|
59
59
|
* })
|
60
60
|
* ```
|
61
61
|
*
|
62
|
-
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/
|
62
|
+
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
63
63
|
*/
|
64
64
|
list(query, headers) {
|
65
65
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -71,7 +71,7 @@ export class Currency {
|
|
71
71
|
}
|
72
72
|
/**
|
73
73
|
* This method retrieves a currency by its code. It sends a request to the
|
74
|
-
* [Get Currency](https://docs.medusajs.com/
|
74
|
+
* [Get Currency](https://docs.medusajs.com/api/admin#currencies_getcurrenciescode) API route.
|
75
75
|
*
|
76
76
|
* @param code - The currency's code.
|
77
77
|
* @param query - Configure the fields to retrieve in the currency.
|
@@ -99,7 +99,7 @@ export class Currency {
|
|
99
99
|
* })
|
100
100
|
* ```
|
101
101
|
*
|
102
|
-
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/
|
102
|
+
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
103
103
|
*/
|
104
104
|
retrieve(code, query, headers) {
|
105
105
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -12,7 +12,7 @@ export declare class CustomerGroup {
|
|
12
12
|
constructor(client: Client);
|
13
13
|
/**
|
14
14
|
* This method retrieves a customer group by its ID. It sends a request to the
|
15
|
-
* [Get Customer Group](https://docs.medusajs.com/
|
15
|
+
* [Get Customer Group](https://docs.medusajs.com/api/admin#customer-groups_getcustomergroupsid) API route.
|
16
16
|
*
|
17
17
|
* @param id - The customer group's ID.
|
18
18
|
* @param query - Configure the fields to retrieve in the customer group.
|
@@ -40,12 +40,12 @@ export declare class CustomerGroup {
|
|
40
40
|
* })
|
41
41
|
* ```
|
42
42
|
*
|
43
|
-
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/
|
43
|
+
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
44
44
|
*/
|
45
45
|
retrieve(id: string, query?: HttpTypes.AdminGetCustomerGroupParams, headers?: ClientHeaders): Promise<HttpTypes.AdminCustomerGroupResponse>;
|
46
46
|
/**
|
47
47
|
* This method retrieves a paginated list of customer groups. It sends a request to the
|
48
|
-
* [List Customer Groups](https://docs.medusajs.com/
|
48
|
+
* [List Customer Groups](https://docs.medusajs.com/api/admin#customer-groups_getcustomergroups)
|
49
49
|
* API route.
|
50
50
|
*
|
51
51
|
* @param query - Filters and pagination configurations.
|
@@ -88,12 +88,12 @@ export declare class CustomerGroup {
|
|
88
88
|
* })
|
89
89
|
* ```
|
90
90
|
*
|
91
|
-
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/
|
91
|
+
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
92
92
|
*/
|
93
93
|
list(query?: HttpTypes.AdminGetCustomerGroupsParams, headers?: ClientHeaders): Promise<HttpTypes.AdminCustomerGroupListResponse>;
|
94
94
|
/**
|
95
95
|
* This method creates a customer group. It sends a request to the
|
96
|
-
* [Create Customer Group](https://docs.medusajs.com/
|
96
|
+
* [Create Customer Group](https://docs.medusajs.com/api/admin#customer-groups_postcustomergroups)
|
97
97
|
* API route.
|
98
98
|
*
|
99
99
|
* @param body - The customer group's details.
|
@@ -112,7 +112,7 @@ export declare class CustomerGroup {
|
|
112
112
|
create(body: HttpTypes.AdminCreateCustomerGroup, query?: HttpTypes.AdminGetCustomerGroupParams, headers?: ClientHeaders): Promise<HttpTypes.AdminCustomerGroupResponse>;
|
113
113
|
/**
|
114
114
|
* This method updates a customer group's details. It sends a request to the
|
115
|
-
* [Update Customer](https://docs.medusajs.com/
|
115
|
+
* [Update Customer](https://docs.medusajs.com/api/admin#customer-groups_postcustomergroupsid)
|
116
116
|
* API route.
|
117
117
|
*
|
118
118
|
* @param id - The customer group's ID.
|
@@ -132,7 +132,7 @@ export declare class CustomerGroup {
|
|
132
132
|
update(id: string, body: HttpTypes.AdminUpdateCustomerGroup, query?: HttpTypes.AdminGetCustomerGroupParams, headers?: ClientHeaders): Promise<HttpTypes.AdminCustomerGroupResponse>;
|
133
133
|
/**
|
134
134
|
* This method deletes a customer group. This method sends a request to the
|
135
|
-
* [Delete Customer Group](https://docs.medusajs.com/
|
135
|
+
* [Delete Customer Group](https://docs.medusajs.com/api/admin#customer-groups_deletecustomergroupsid)
|
136
136
|
* API route.
|
137
137
|
*
|
138
138
|
* @param id - The customer group's ID.
|
@@ -148,7 +148,7 @@ export declare class CustomerGroup {
|
|
148
148
|
delete(id: string, headers?: ClientHeaders): Promise<HttpTypes.AdminCustomerGroupDeleteResponse>;
|
149
149
|
/**
|
150
150
|
* This method manages customers of a group to add or remove them from the group.
|
151
|
-
* It sends a request to the [Manage Customers](https://docs.medusajs.com/
|
151
|
+
* It sends a request to the [Manage Customers](https://docs.medusajs.com/api/admin#customer-groups_postcustomergroupsidcustomers)
|
152
152
|
* API route.
|
153
153
|
*
|
154
154
|
* @param id - The group's ID.
|
@@ -16,7 +16,7 @@ export class CustomerGroup {
|
|
16
16
|
}
|
17
17
|
/**
|
18
18
|
* This method retrieves a customer group by its ID. It sends a request to the
|
19
|
-
* [Get Customer Group](https://docs.medusajs.com/
|
19
|
+
* [Get Customer Group](https://docs.medusajs.com/api/admin#customer-groups_getcustomergroupsid) API route.
|
20
20
|
*
|
21
21
|
* @param id - The customer group's ID.
|
22
22
|
* @param query - Configure the fields to retrieve in the customer group.
|
@@ -44,7 +44,7 @@ export class CustomerGroup {
|
|
44
44
|
* })
|
45
45
|
* ```
|
46
46
|
*
|
47
|
-
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/
|
47
|
+
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
48
48
|
*/
|
49
49
|
retrieve(id, query, headers) {
|
50
50
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -57,7 +57,7 @@ export class CustomerGroup {
|
|
57
57
|
}
|
58
58
|
/**
|
59
59
|
* This method retrieves a paginated list of customer groups. It sends a request to the
|
60
|
-
* [List Customer Groups](https://docs.medusajs.com/
|
60
|
+
* [List Customer Groups](https://docs.medusajs.com/api/admin#customer-groups_getcustomergroups)
|
61
61
|
* API route.
|
62
62
|
*
|
63
63
|
* @param query - Filters and pagination configurations.
|
@@ -100,7 +100,7 @@ export class CustomerGroup {
|
|
100
100
|
* })
|
101
101
|
* ```
|
102
102
|
*
|
103
|
-
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/
|
103
|
+
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
104
104
|
*/
|
105
105
|
list(query, headers) {
|
106
106
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -113,7 +113,7 @@ export class CustomerGroup {
|
|
113
113
|
}
|
114
114
|
/**
|
115
115
|
* This method creates a customer group. It sends a request to the
|
116
|
-
* [Create Customer Group](https://docs.medusajs.com/
|
116
|
+
* [Create Customer Group](https://docs.medusajs.com/api/admin#customer-groups_postcustomergroups)
|
117
117
|
* API route.
|
118
118
|
*
|
119
119
|
* @param body - The customer group's details.
|
@@ -141,7 +141,7 @@ export class CustomerGroup {
|
|
141
141
|
}
|
142
142
|
/**
|
143
143
|
* This method updates a customer group's details. It sends a request to the
|
144
|
-
* [Update Customer](https://docs.medusajs.com/
|
144
|
+
* [Update Customer](https://docs.medusajs.com/api/admin#customer-groups_postcustomergroupsid)
|
145
145
|
* API route.
|
146
146
|
*
|
147
147
|
* @param id - The customer group's ID.
|
@@ -170,7 +170,7 @@ export class CustomerGroup {
|
|
170
170
|
}
|
171
171
|
/**
|
172
172
|
* This method deletes a customer group. This method sends a request to the
|
173
|
-
* [Delete Customer Group](https://docs.medusajs.com/
|
173
|
+
* [Delete Customer Group](https://docs.medusajs.com/api/admin#customer-groups_deletecustomergroupsid)
|
174
174
|
* API route.
|
175
175
|
*
|
176
176
|
* @param id - The customer group's ID.
|
@@ -193,7 +193,7 @@ export class CustomerGroup {
|
|
193
193
|
}
|
194
194
|
/**
|
195
195
|
* This method manages customers of a group to add or remove them from the group.
|
196
|
-
* It sends a request to the [Manage Customers](https://docs.medusajs.com/
|
196
|
+
* It sends a request to the [Manage Customers](https://docs.medusajs.com/api/admin#customer-groups_postcustomergroupsidcustomers)
|
197
197
|
* API route.
|
198
198
|
*
|
199
199
|
* @param id - The group's ID.
|
@@ -12,7 +12,7 @@ export declare class Customer {
|
|
12
12
|
constructor(client: Client);
|
13
13
|
/**
|
14
14
|
* This method creates a customer. It sends a request to the
|
15
|
-
* [Create Customer](https://docs.medusajs.com/
|
15
|
+
* [Create Customer](https://docs.medusajs.com/api/admin#customers_postcustomers) API route.
|
16
16
|
*
|
17
17
|
* @param body - The customer's details.
|
18
18
|
* @param query - Configure the fields to retrieve in the customer.
|
@@ -30,7 +30,7 @@ export declare class Customer {
|
|
30
30
|
create(body: HttpTypes.AdminCreateCustomer, query?: SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminCustomerResponse>;
|
31
31
|
/**
|
32
32
|
* This method updates a customer's details. It sends a request to the
|
33
|
-
* [Update Customer](https://docs.medusajs.com/
|
33
|
+
* [Update Customer](https://docs.medusajs.com/api/admin#customers_postcustomersid) API route.
|
34
34
|
*
|
35
35
|
* @param id - The customer's ID.
|
36
36
|
* @param body - The details to update of the customer.
|
@@ -49,7 +49,7 @@ export declare class Customer {
|
|
49
49
|
update(id: string, body: HttpTypes.AdminUpdateCustomer, query?: SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminCustomerResponse>;
|
50
50
|
/**
|
51
51
|
* This method retrieves a paginated list of customers. It sends a request to the
|
52
|
-
* [List Customers](https://docs.medusajs.com/
|
52
|
+
* [List Customers](https://docs.medusajs.com/api/admin#customers_getcustomers)
|
53
53
|
* API route.
|
54
54
|
*
|
55
55
|
* @param queryParams - Filters and pagination configurations.
|
@@ -92,12 +92,12 @@ export declare class Customer {
|
|
92
92
|
* })
|
93
93
|
* ```
|
94
94
|
*
|
95
|
-
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/
|
95
|
+
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
96
96
|
*/
|
97
97
|
list(queryParams?: HttpTypes.AdminCustomerFilters, headers?: ClientHeaders): Promise<HttpTypes.AdminCustomerListResponse>;
|
98
98
|
/**
|
99
99
|
* This method retrieves a customer by its ID. It sends a request to the
|
100
|
-
* [Get Customer](https://docs.medusajs.com/
|
100
|
+
* [Get Customer](https://docs.medusajs.com/api/admin#customers_getcustomersid)
|
101
101
|
* API route.
|
102
102
|
*
|
103
103
|
* @param id - The customer's ID.
|
@@ -126,12 +126,12 @@ export declare class Customer {
|
|
126
126
|
* })
|
127
127
|
* ```
|
128
128
|
*
|
129
|
-
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/
|
129
|
+
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
130
130
|
*/
|
131
131
|
retrieve(id: string, query?: SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminCustomerResponse>;
|
132
132
|
/**
|
133
133
|
* This method deletes a customer by its ID. It sends a request to the
|
134
|
-
* [Delete Customer](https://docs.medusajs.com/
|
134
|
+
* [Delete Customer](https://docs.medusajs.com/api/admin#customers_deletecustomersid)
|
135
135
|
* API route.
|
136
136
|
*
|
137
137
|
* @param id - The customer's ID.
|
@@ -145,5 +145,25 @@ export declare class Customer {
|
|
145
145
|
* })
|
146
146
|
*/
|
147
147
|
delete(id: string, headers?: ClientHeaders): Promise<HttpTypes.AdminCustomerDeleteResponse>;
|
148
|
+
/**
|
149
|
+
* This method manages customer groups for a customer.
|
150
|
+
* It sends a request to the [Manage Customers](https://docs.medusajs.com/api/admin#customers_postcustomersidcustomergroups)
|
151
|
+
* API route.
|
152
|
+
*
|
153
|
+
* @param id - The customer's ID.
|
154
|
+
* @param body - The groups to add customer to or remove customer from.
|
155
|
+
* @param headers - Headers to pass in the request
|
156
|
+
* @returns The customers details.
|
157
|
+
*
|
158
|
+
* @example
|
159
|
+
* sdk.admin.customer.batchCustomerGroups("cus_123", {
|
160
|
+
* add: ["cusgroup_123"],
|
161
|
+
* remove: ["cusgroup_321"]
|
162
|
+
* })
|
163
|
+
* .then(({ customer }) => {
|
164
|
+
* console.log(customer)
|
165
|
+
* })
|
166
|
+
*/
|
167
|
+
batchCustomerGroups(id: string, body: HttpTypes.AdminBatchLink, headers?: ClientHeaders): Promise<HttpTypes.AdminCustomerResponse>;
|
148
168
|
}
|
149
169
|
//# sourceMappingURL=customer.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"customer.d.ts","sourceRoot":"","sources":["../../../src/admin/customer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,YAAY,EACb,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,qBAAa,QAAQ;IACnB;;OAEG;IACH,OAAO,CAAC,MAAM,CAAQ;IACtB;;OAEG;gBACS,MAAM,EAAE,MAAM;IAI1B;;;;;;;;;;;;;;;;OAgBG;IACG,MAAM,CACV,IAAI,EAAE,SAAS,CAAC,mBAAmB,EACnC,KAAK,CAAC,EAAE,YAAY,EACpB,OAAO,CAAC,EAAE,aAAa;IAYzB;;;;;;;;;;;;;;;;;OAiBG;IACG,MAAM,CACV,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,SAAS,CAAC,mBAAmB,EACnC,KAAK,CAAC,EAAE,YAAY,EACpB,OAAO,CAAC,EAAE,aAAa;IAazB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8CG;IACG,IAAI,CACR,WAAW,CAAC,EAAE,SAAS,CAAC,oBAAoB,EAC5C,OAAO,CAAC,EAAE,aAAa;IAUzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACG,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,aAAa;IAUxE;;;;;;;;;;;;;;OAcG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa;
|
1
|
+
{"version":3,"file":"customer.d.ts","sourceRoot":"","sources":["../../../src/admin/customer.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,YAAY,EACb,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,qBAAa,QAAQ;IACnB;;OAEG;IACH,OAAO,CAAC,MAAM,CAAQ;IACtB;;OAEG;gBACS,MAAM,EAAE,MAAM;IAI1B;;;;;;;;;;;;;;;;OAgBG;IACG,MAAM,CACV,IAAI,EAAE,SAAS,CAAC,mBAAmB,EACnC,KAAK,CAAC,EAAE,YAAY,EACpB,OAAO,CAAC,EAAE,aAAa;IAYzB;;;;;;;;;;;;;;;;;OAiBG;IACG,MAAM,CACV,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,SAAS,CAAC,mBAAmB,EACnC,KAAK,CAAC,EAAE,YAAY,EACpB,OAAO,CAAC,EAAE,aAAa;IAazB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8CG;IACG,IAAI,CACR,WAAW,CAAC,EAAE,SAAS,CAAC,oBAAoB,EAC5C,OAAO,CAAC,EAAE,aAAa;IAUzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACG,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,aAAa;IAUxE;;;;;;;;;;;;;;OAcG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa;IAUhD;;;;;;;;;;;;;;;;;;OAkBG;IACG,mBAAmB,CACvB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,SAAS,CAAC,cAAc,EAC9B,OAAO,CAAC,EAAE,aAAa;CAW1B"}
|
@@ -16,7 +16,7 @@ export class Customer {
|
|
16
16
|
}
|
17
17
|
/**
|
18
18
|
* This method creates a customer. It sends a request to the
|
19
|
-
* [Create Customer](https://docs.medusajs.com/
|
19
|
+
* [Create Customer](https://docs.medusajs.com/api/admin#customers_postcustomers) API route.
|
20
20
|
*
|
21
21
|
* @param body - The customer's details.
|
22
22
|
* @param query - Configure the fields to retrieve in the customer.
|
@@ -43,7 +43,7 @@ export class Customer {
|
|
43
43
|
}
|
44
44
|
/**
|
45
45
|
* This method updates a customer's details. It sends a request to the
|
46
|
-
* [Update Customer](https://docs.medusajs.com/
|
46
|
+
* [Update Customer](https://docs.medusajs.com/api/admin#customers_postcustomersid) API route.
|
47
47
|
*
|
48
48
|
* @param id - The customer's ID.
|
49
49
|
* @param body - The details to update of the customer.
|
@@ -71,7 +71,7 @@ export class Customer {
|
|
71
71
|
}
|
72
72
|
/**
|
73
73
|
* This method retrieves a paginated list of customers. It sends a request to the
|
74
|
-
* [List Customers](https://docs.medusajs.com/
|
74
|
+
* [List Customers](https://docs.medusajs.com/api/admin#customers_getcustomers)
|
75
75
|
* API route.
|
76
76
|
*
|
77
77
|
* @param queryParams - Filters and pagination configurations.
|
@@ -114,7 +114,7 @@ export class Customer {
|
|
114
114
|
* })
|
115
115
|
* ```
|
116
116
|
*
|
117
|
-
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/
|
117
|
+
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
118
118
|
*/
|
119
119
|
list(queryParams, headers) {
|
120
120
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -126,7 +126,7 @@ export class Customer {
|
|
126
126
|
}
|
127
127
|
/**
|
128
128
|
* This method retrieves a customer by its ID. It sends a request to the
|
129
|
-
* [Get Customer](https://docs.medusajs.com/
|
129
|
+
* [Get Customer](https://docs.medusajs.com/api/admin#customers_getcustomersid)
|
130
130
|
* API route.
|
131
131
|
*
|
132
132
|
* @param id - The customer's ID.
|
@@ -155,7 +155,7 @@ export class Customer {
|
|
155
155
|
* })
|
156
156
|
* ```
|
157
157
|
*
|
158
|
-
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/
|
158
|
+
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
159
159
|
*/
|
160
160
|
retrieve(id, query, headers) {
|
161
161
|
return __awaiter(this, void 0, void 0, function* () {
|
@@ -167,7 +167,7 @@ export class Customer {
|
|
167
167
|
}
|
168
168
|
/**
|
169
169
|
* This method deletes a customer by its ID. It sends a request to the
|
170
|
-
* [Delete Customer](https://docs.medusajs.com/
|
170
|
+
* [Delete Customer](https://docs.medusajs.com/api/admin#customers_deletecustomersid)
|
171
171
|
* API route.
|
172
172
|
*
|
173
173
|
* @param id - The customer's ID.
|
@@ -188,5 +188,33 @@ export class Customer {
|
|
188
188
|
});
|
189
189
|
});
|
190
190
|
}
|
191
|
+
/**
|
192
|
+
* This method manages customer groups for a customer.
|
193
|
+
* It sends a request to the [Manage Customers](https://docs.medusajs.com/api/admin#customers_postcustomersidcustomergroups)
|
194
|
+
* API route.
|
195
|
+
*
|
196
|
+
* @param id - The customer's ID.
|
197
|
+
* @param body - The groups to add customer to or remove customer from.
|
198
|
+
* @param headers - Headers to pass in the request
|
199
|
+
* @returns The customers details.
|
200
|
+
*
|
201
|
+
* @example
|
202
|
+
* sdk.admin.customer.batchCustomerGroups("cus_123", {
|
203
|
+
* add: ["cusgroup_123"],
|
204
|
+
* remove: ["cusgroup_321"]
|
205
|
+
* })
|
206
|
+
* .then(({ customer }) => {
|
207
|
+
* console.log(customer)
|
208
|
+
* })
|
209
|
+
*/
|
210
|
+
batchCustomerGroups(id, body, headers) {
|
211
|
+
return __awaiter(this, void 0, void 0, function* () {
|
212
|
+
return yield this.client.fetch(`/admin/customers/${id}/customer-groups`, {
|
213
|
+
method: "POST",
|
214
|
+
headers,
|
215
|
+
body,
|
216
|
+
});
|
217
|
+
});
|
218
|
+
}
|
191
219
|
}
|
192
220
|
//# sourceMappingURL=customer.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"customer.js","sourceRoot":"","sources":["../../../src/admin/customer.ts"],"names":[],"mappings":";;;;;;;;;AAOA,MAAM,OAAO,QAAQ;IAKnB;;OAEG;IACH,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACG,MAAM,CACV,IAAmC,EACnC,KAAoB,EACpB,OAAuB;;YAEvB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAEtB,kBAAkB,EAAE;gBACpB,MAAM,EAAE,MAAM;gBACd,OAAO;gBACP,IAAI;gBACJ,KAAK;aACN,CAAC,CAAA;QACJ,CAAC;KAAA;IAED;;;;;;;;;;;;;;;;;OAiBG;IACG,MAAM,CACV,EAAU,EACV,IAAmC,EACnC,KAAoB,EACpB,OAAuB;;YAEvB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CACtB,oBAAoB,EAAE,EAAE,EACxB;gBACE,MAAM,EAAE,MAAM;gBACd,OAAO;gBACP,IAAI;gBACJ,KAAK;aACN,CACF,CAAA;QACH,CAAC;KAAA;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8CG;IACG,IAAI,CACR,WAA4C,EAC5C,OAAuB;;YAEvB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAEtB,kBAAkB,EAAE;gBACpB,OAAO;gBACP,KAAK,EAAE,WAAW;aACnB,CAAC,CAAA;QACJ,CAAC;KAAA;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACG,QAAQ,CAAC,EAAU,EAAE,KAAoB,EAAE,OAAuB;;YACtE,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CACtB,oBAAoB,EAAE,EAAE,EACxB;gBACE,KAAK;gBACL,OAAO;aACR,CACF,CAAA;QACH,CAAC;KAAA;IAED;;;;;;;;;;;;;;OAcG;IACG,MAAM,CAAC,EAAU,EAAE,OAAuB;;YAC9C,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CACtB,oBAAoB,EAAE,EAAE,EACxB;gBACE,MAAM,EAAE,QAAQ;gBAChB,OAAO;aACR,CACF,CAAA;QACH,CAAC;KAAA;CACF"}
|
1
|
+
{"version":3,"file":"customer.js","sourceRoot":"","sources":["../../../src/admin/customer.ts"],"names":[],"mappings":";;;;;;;;;AAOA,MAAM,OAAO,QAAQ;IAKnB;;OAEG;IACH,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACG,MAAM,CACV,IAAmC,EACnC,KAAoB,EACpB,OAAuB;;YAEvB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAEtB,kBAAkB,EAAE;gBACpB,MAAM,EAAE,MAAM;gBACd,OAAO;gBACP,IAAI;gBACJ,KAAK;aACN,CAAC,CAAA;QACJ,CAAC;KAAA;IAED;;;;;;;;;;;;;;;;;OAiBG;IACG,MAAM,CACV,EAAU,EACV,IAAmC,EACnC,KAAoB,EACpB,OAAuB;;YAEvB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CACtB,oBAAoB,EAAE,EAAE,EACxB;gBACE,MAAM,EAAE,MAAM;gBACd,OAAO;gBACP,IAAI;gBACJ,KAAK;aACN,CACF,CAAA;QACH,CAAC;KAAA;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8CG;IACG,IAAI,CACR,WAA4C,EAC5C,OAAuB;;YAEvB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAEtB,kBAAkB,EAAE;gBACpB,OAAO;gBACP,KAAK,EAAE,WAAW;aACnB,CAAC,CAAA;QACJ,CAAC;KAAA;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAgCG;IACG,QAAQ,CAAC,EAAU,EAAE,KAAoB,EAAE,OAAuB;;YACtE,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CACtB,oBAAoB,EAAE,EAAE,EACxB;gBACE,KAAK;gBACL,OAAO;aACR,CACF,CAAA;QACH,CAAC;KAAA;IAED;;;;;;;;;;;;;;OAcG;IACG,MAAM,CAAC,EAAU,EAAE,OAAuB;;YAC9C,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CACtB,oBAAoB,EAAE,EAAE,EACxB;gBACE,MAAM,EAAE,QAAQ;gBAChB,OAAO;aACR,CACF,CAAA;QACH,CAAC;KAAA;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACG,mBAAmB,CACvB,EAAU,EACV,IAA8B,EAC9B,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,oBAAoB,EAAE,kBAAkB,EACxC;gBACE,MAAM,EAAE,MAAM;gBACd,OAAO;gBACP,IAAI;aACL,CACF,CAAA;QACH,CAAC;KAAA;CACF"}
|
@@ -12,7 +12,7 @@ export declare class Exchange {
|
|
12
12
|
constructor(client: Client);
|
13
13
|
/**
|
14
14
|
* This method retrieves a paginated list of exchanges. It sends a request to the
|
15
|
-
* [List Exchanges](https://docs.medusajs.com/
|
15
|
+
* [List Exchanges](https://docs.medusajs.com/api/admin#exchanges_getexchanges)
|
16
16
|
* API route.
|
17
17
|
*
|
18
18
|
* @param query - Filters and pagination configurations.
|
@@ -55,12 +55,12 @@ export declare class Exchange {
|
|
55
55
|
* })
|
56
56
|
* ```
|
57
57
|
*
|
58
|
-
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/
|
58
|
+
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
59
59
|
*/
|
60
60
|
list(query?: HttpTypes.AdminExchangeListParams, headers?: ClientHeaders): Promise<HttpTypes.AdminExchangeListResponse>;
|
61
61
|
/**
|
62
62
|
* This method retrieves an exchange by its ID. It sends a request to the
|
63
|
-
* [Get Exchange](https://docs.medusajs.com/
|
63
|
+
* [Get Exchange](https://docs.medusajs.com/api/admin#exchanges_getexchangesid)
|
64
64
|
* API route.
|
65
65
|
*
|
66
66
|
* @param id - The exchange's ID.
|
@@ -89,12 +89,12 @@ export declare class Exchange {
|
|
89
89
|
* })
|
90
90
|
* ```
|
91
91
|
*
|
92
|
-
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/
|
92
|
+
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
93
93
|
*/
|
94
94
|
retrieve(id: string, query?: SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminExchangeResponse>;
|
95
95
|
/**
|
96
96
|
* This method creates an admin exchange. It sends a request to the
|
97
|
-
* [Create Exchange](https://docs.medusajs.com/
|
97
|
+
* [Create Exchange](https://docs.medusajs.com/api/admin#exchanges_postexchanges) API route.
|
98
98
|
*
|
99
99
|
* @param body - The exchange's details.
|
100
100
|
* @param query - Configure the fields to retrieve in the exchange.
|
@@ -112,7 +112,7 @@ export declare class Exchange {
|
|
112
112
|
create(body: HttpTypes.AdminCreateExchange, query?: HttpTypes.SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminExchangeResponse>;
|
113
113
|
/**
|
114
114
|
* This method cancels an exchange. It sends a request to the
|
115
|
-
* [Cancel Exchange](https://docs.medusajs.com/
|
115
|
+
* [Cancel Exchange](https://docs.medusajs.com/api/admin#exchanges_postexchangesidcancel) API route.
|
116
116
|
*
|
117
117
|
* @param id - The exchange's ID.
|
118
118
|
* @param query - Configure the fields to retrieve in the exchange.
|
@@ -130,7 +130,7 @@ export declare class Exchange {
|
|
130
130
|
* This method adds inbound (or return) items to an exchange. These inbound items will
|
131
131
|
* have the action `RETURN_ITEM`.
|
132
132
|
*
|
133
|
-
* This method sends a request to the [Add Inbound Items](https://docs.medusajs.com/
|
133
|
+
* This method sends a request to the [Add Inbound Items](https://docs.medusajs.com/api/admin#exchanges_postexchangesidinbounditems)
|
134
134
|
* API route.
|
135
135
|
*
|
136
136
|
* @param id - The exchange's ID.
|
@@ -158,7 +158,7 @@ export declare class Exchange {
|
|
158
158
|
* Every item has an `actions` property, whose value is an array of actions. You can
|
159
159
|
* check the action's name using its `action` property, and use the value of the `id` property.
|
160
160
|
*
|
161
|
-
* This method sends a request to the [Update Inbound Item](https://docs.medusajs.com/
|
161
|
+
* This method sends a request to the [Update Inbound Item](https://docs.medusajs.com/api/admin#exchanges_postexchangesidinbounditemsaction_id)
|
162
162
|
* API route.
|
163
163
|
*
|
164
164
|
* @param id - The exchange's ID.
|
@@ -188,7 +188,7 @@ export declare class Exchange {
|
|
188
188
|
* Every item has an `actions` property, whose value is an array of actions.
|
189
189
|
* You can check the action's name using its `action` property, and use the value of the `id` property.
|
190
190
|
*
|
191
|
-
* This method sends a request to the [Remove Inbound Item](https://docs.medusajs.com/
|
191
|
+
* This method sends a request to the [Remove Inbound Item](https://docs.medusajs.com/api/admin#exchanges_deleteexchangesidinbounditemsaction_id)
|
192
192
|
* API route.
|
193
193
|
*
|
194
194
|
* @param id - The exchange's ID.
|
@@ -211,10 +211,10 @@ export declare class Exchange {
|
|
211
211
|
* This method adds an inbound (or return) shipping method to an exchange.
|
212
212
|
* The inbound shipping method will have a `SHIPPING_ADD` action.
|
213
213
|
*
|
214
|
-
* This method sends a request to the [Add Inbound Shipping](https://docs.medusajs.com/
|
214
|
+
* This method sends a request to the [Add Inbound Shipping](https://docs.medusajs.com/api/admin#exchanges_postexchangesidinboundshippingmethod)
|
215
215
|
* API route.
|
216
216
|
*
|
217
|
-
* This method sends a request to the [Add Inbound Shipping](https://docs.medusajs.com/
|
217
|
+
* This method sends a request to the [Add Inbound Shipping](https://docs.medusajs.com/api/admin#exchanges_postexchangesidinboundshippingmethod)
|
218
218
|
* API route.
|
219
219
|
*
|
220
220
|
* @param id - The exchange's ID.
|
@@ -239,7 +239,7 @@ export declare class Exchange {
|
|
239
239
|
* Every shipping method has an `actions` property, whose value is an array of actions.
|
240
240
|
* You can check the action's name using its `action` property, and use the value of the `id` property.
|
241
241
|
*
|
242
|
-
* This method sends a request to the [Update Inbound Shipping](https://docs.medusajs.com/
|
242
|
+
* This method sends a request to the [Update Inbound Shipping](https://docs.medusajs.com/api/admin#exchanges_postexchangesidinboundshippingmethodaction_id)
|
243
243
|
* API route.
|
244
244
|
*
|
245
245
|
* @param id - The exchange's ID.
|
@@ -269,7 +269,7 @@ export declare class Exchange {
|
|
269
269
|
* Every shipping method has an `actions` property, whose value is an array of actions.
|
270
270
|
* You can check the action's name using its `action` property, and use the value of the `id` property.
|
271
271
|
*
|
272
|
-
* This method sends a request to the [Remove Inbound Shipping](https://docs.medusajs.com/
|
272
|
+
* This method sends a request to the [Remove Inbound Shipping](https://docs.medusajs.com/api/admin#exchanges_deleteexchangesidinboundshippingmethodaction_id)
|
273
273
|
* API route.
|
274
274
|
*
|
275
275
|
* @param id - The exchange's ID.
|
@@ -292,7 +292,7 @@ export declare class Exchange {
|
|
292
292
|
* This method adds outbound (or new) items to an exchange.
|
293
293
|
* These outbound items will have the action `ITEM_ADD`.
|
294
294
|
*
|
295
|
-
* This method sends a request to the [Add Outbound Items](https://docs.medusajs.com/
|
295
|
+
* This method sends a request to the [Add Outbound Items](https://docs.medusajs.com/api/admin#exchanges_postexchangesidoutbounditems)
|
296
296
|
* API route.
|
297
297
|
*
|
298
298
|
* @param id - The exchange's ID.
|
@@ -320,7 +320,7 @@ export declare class Exchange {
|
|
320
320
|
* Every item has an `actions` property, whose value is an array of actions.
|
321
321
|
* You can check the action's name using its `action` property, and use the value of the `id` property.
|
322
322
|
*
|
323
|
-
* This method sends a request to the [Update Inbound Item](https://docs.medusajs.com/
|
323
|
+
* This method sends a request to the [Update Inbound Item](https://docs.medusajs.com/api/admin#exchanges_postexchangesidoutbounditemsaction_id)
|
324
324
|
* API route.
|
325
325
|
*
|
326
326
|
* @param id - The exchange's ID.
|
@@ -350,7 +350,7 @@ export declare class Exchange {
|
|
350
350
|
* Every item has an `actions` property, whose value is an array of actions.
|
351
351
|
* You can check the action's name using its `action` property, and use the value of the `id` property.
|
352
352
|
*
|
353
|
-
* This method sends a request to the [Update Outbound Item](https://docs.medusajs.com/
|
353
|
+
* This method sends a request to the [Update Outbound Item](https://docs.medusajs.com/api/admin#exchanges_deleteexchangesidoutbounditemsaction_id)
|
354
354
|
* API route.
|
355
355
|
*
|
356
356
|
* @param id - The exchange's ID.
|
@@ -373,7 +373,7 @@ export declare class Exchange {
|
|
373
373
|
* This method adds an outbound shipping method to an exchange. The outbound shipping method
|
374
374
|
* will have a `SHIPPING_ADD` action.
|
375
375
|
*
|
376
|
-
* This method sends a request to the [Add Outbound Shipping](https://docs.medusajs.com/
|
376
|
+
* This method sends a request to the [Add Outbound Shipping](https://docs.medusajs.com/api/admin#exchanges_postexchangesidoutboundshippingmethod)
|
377
377
|
* API route.
|
378
378
|
*
|
379
379
|
* @param id - The exchange's ID.
|
@@ -398,7 +398,7 @@ export declare class Exchange {
|
|
398
398
|
* Every shipping method has an `actions` property, whose value is an array of actions.
|
399
399
|
* You can check the action's name using its `action` property, and use the value of the `id` property.
|
400
400
|
*
|
401
|
-
* This method sends a request to the [Update Outbound Shipping](https://docs.medusajs.com/
|
401
|
+
* This method sends a request to the [Update Outbound Shipping](https://docs.medusajs.com/api/admin#exchanges_postexchangesidoutboundshippingmethodaction_id)
|
402
402
|
* API route.
|
403
403
|
*
|
404
404
|
* @param id - The exchange's ID.
|
@@ -428,7 +428,7 @@ export declare class Exchange {
|
|
428
428
|
* Every shipping method has an `actions` property, whose value is an array of actions.
|
429
429
|
* You can check the action's name using its `action` property, and use the value of the `id` property.
|
430
430
|
*
|
431
|
-
* This method sends a request to the [Remove Outbound Shipping](https://docs.medusajs.com/
|
431
|
+
* This method sends a request to the [Remove Outbound Shipping](https://docs.medusajs.com/api/admin#exchanges_deleteexchangesidoutboundshippingmethodaction_id)
|
432
432
|
* API route.
|
433
433
|
*
|
434
434
|
* @param id - The exchange's ID.
|
@@ -450,7 +450,7 @@ export declare class Exchange {
|
|
450
450
|
/**
|
451
451
|
* This method confirms an exchange request, applying its changes on the associated order.
|
452
452
|
*
|
453
|
-
* This method sends a request to the [Confirm Exchange](https://docs.medusajs.com/
|
453
|
+
* This method sends a request to the [Confirm Exchange](https://docs.medusajs.com/api/admin#exchanges_postexchangesidrequest)
|
454
454
|
* API route.
|
455
455
|
*
|
456
456
|
* @param id - The exchange's ID.
|
@@ -468,7 +468,7 @@ export declare class Exchange {
|
|
468
468
|
request(id: string, body: HttpTypes.AdminRequestExchange, query?: HttpTypes.SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminExchangeRequestResponse>;
|
469
469
|
/**
|
470
470
|
* This method cancels an exchange request. It sends a request to the
|
471
|
-
* [Cancel Exchange Request](https://docs.medusajs.com/
|
471
|
+
* [Cancel Exchange Request](https://docs.medusajs.com/api/admin#exchanges_deleteexchangesidrequest)
|
472
472
|
* API route.
|
473
473
|
*
|
474
474
|
* @param id - The exchange's ID.
|