@medusajs/js-sdk 2.0.0-preview-20241022100028 → 2.0.0-rc-20241022183311
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/admin/api-key.d.ts +144 -1
- package/dist/admin/api-key.d.ts.map +1 -1
- package/dist/admin/api-key.js +143 -0
- package/dist/admin/api-key.js.map +1 -1
- package/dist/admin/campaign.d.ts +135 -0
- package/dist/admin/campaign.d.ts.map +1 -1
- package/dist/admin/campaign.js +135 -0
- package/dist/admin/campaign.js.map +1 -1
- package/dist/admin/claim.d.ts +542 -19
- package/dist/admin/claim.d.ts.map +1 -1
- package/dist/admin/claim.js +523 -0
- package/dist/admin/claim.js.map +1 -1
- package/dist/admin/currency.d.ts +80 -1
- package/dist/admin/currency.d.ts.map +1 -1
- package/dist/admin/currency.js +81 -2
- package/dist/admin/currency.js.map +1 -1
- package/dist/admin/customer-group.d.ts +152 -2
- package/dist/admin/customer-group.d.ts.map +1 -1
- package/dist/admin/customer-group.js +150 -0
- package/dist/admin/customer-group.js.map +1 -1
- package/dist/admin/customer.d.ts +135 -13
- package/dist/admin/customer.d.ts.map +1 -1
- package/dist/admin/customer.js +130 -0
- package/dist/admin/customer.js.map +1 -1
- package/dist/admin/exchange.d.ts +471 -16
- package/dist/admin/exchange.d.ts.map +1 -1
- package/dist/admin/exchange.js +455 -0
- package/dist/admin/exchange.js.map +1 -1
- package/dist/admin/fulfillment-provider.d.ts +47 -0
- package/dist/admin/fulfillment-provider.d.ts.map +1 -1
- package/dist/admin/fulfillment-provider.js +47 -0
- package/dist/admin/fulfillment-provider.js.map +1 -1
- package/dist/admin/fulfillment-set.d.ts +122 -0
- package/dist/admin/fulfillment-set.d.ts.map +1 -1
- package/dist/admin/fulfillment-set.js +122 -0
- package/dist/admin/fulfillment-set.js.map +1 -1
- package/dist/admin/fulfillment.d.ts +74 -0
- package/dist/admin/fulfillment.d.ts.map +1 -1
- package/dist/admin/fulfillment.js +75 -0
- package/dist/admin/fulfillment.js.map +1 -1
- package/dist/admin/inventory-item.d.ts +252 -1
- package/dist/admin/inventory-item.d.ts.map +1 -1
- package/dist/admin/inventory-item.js +251 -0
- package/dist/admin/inventory-item.js.map +1 -1
- package/dist/admin/invite.d.ts +170 -15
- package/dist/admin/invite.d.ts.map +1 -1
- package/dist/admin/invite.js +162 -0
- package/dist/admin/invite.js.map +1 -1
- package/dist/esm/admin/api-key.d.ts +144 -1
- package/dist/esm/admin/api-key.d.ts.map +1 -1
- package/dist/esm/admin/api-key.js +143 -0
- package/dist/esm/admin/api-key.js.map +1 -1
- package/dist/esm/admin/campaign.d.ts +135 -0
- package/dist/esm/admin/campaign.d.ts.map +1 -1
- package/dist/esm/admin/campaign.js +135 -0
- package/dist/esm/admin/campaign.js.map +1 -1
- package/dist/esm/admin/claim.d.ts +542 -19
- package/dist/esm/admin/claim.d.ts.map +1 -1
- package/dist/esm/admin/claim.js +523 -0
- package/dist/esm/admin/claim.js.map +1 -1
- package/dist/esm/admin/currency.d.ts +80 -1
- package/dist/esm/admin/currency.d.ts.map +1 -1
- package/dist/esm/admin/currency.js +81 -2
- package/dist/esm/admin/currency.js.map +1 -1
- package/dist/esm/admin/customer-group.d.ts +152 -2
- package/dist/esm/admin/customer-group.d.ts.map +1 -1
- package/dist/esm/admin/customer-group.js +150 -0
- package/dist/esm/admin/customer-group.js.map +1 -1
- package/dist/esm/admin/customer.d.ts +135 -13
- package/dist/esm/admin/customer.d.ts.map +1 -1
- package/dist/esm/admin/customer.js +130 -0
- package/dist/esm/admin/customer.js.map +1 -1
- package/dist/esm/admin/exchange.d.ts +471 -16
- package/dist/esm/admin/exchange.d.ts.map +1 -1
- package/dist/esm/admin/exchange.js +455 -0
- package/dist/esm/admin/exchange.js.map +1 -1
- package/dist/esm/admin/fulfillment-provider.d.ts +47 -0
- package/dist/esm/admin/fulfillment-provider.d.ts.map +1 -1
- package/dist/esm/admin/fulfillment-provider.js +47 -0
- package/dist/esm/admin/fulfillment-provider.js.map +1 -1
- package/dist/esm/admin/fulfillment-set.d.ts +122 -0
- package/dist/esm/admin/fulfillment-set.d.ts.map +1 -1
- package/dist/esm/admin/fulfillment-set.js +122 -0
- package/dist/esm/admin/fulfillment-set.js.map +1 -1
- package/dist/esm/admin/fulfillment.d.ts +74 -0
- package/dist/esm/admin/fulfillment.d.ts.map +1 -1
- package/dist/esm/admin/fulfillment.js +75 -0
- package/dist/esm/admin/fulfillment.js.map +1 -1
- package/dist/esm/admin/inventory-item.d.ts +252 -1
- package/dist/esm/admin/inventory-item.d.ts.map +1 -1
- package/dist/esm/admin/inventory-item.js +251 -0
- package/dist/esm/admin/inventory-item.js.map +1 -1
- package/dist/esm/admin/invite.d.ts +170 -15
- package/dist/esm/admin/invite.d.ts.map +1 -1
- package/dist/esm/admin/invite.js +162 -0
- package/dist/esm/admin/invite.js.map +1 -1
- package/dist/esm/store/index.d.ts +1 -1
- package/dist/esm/store/index.js +1 -1
- package/dist/store/index.d.ts +1 -1
- package/dist/store/index.js +1 -1
- package/package.json +2 -2
package/dist/admin/invite.d.ts
CHANGED
@@ -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
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
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,
|
1
|
+
{"version":3,"file":"invite.d.ts","sourceRoot":"","sources":["../../src/admin/invite.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,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,MAAM;IACjB;;OAEG;IACH,OAAO,CAAC,MAAM,CAAQ;IACtB;;OAEG;gBACS,MAAM,EAAE,MAAM;IAI1B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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"}
|
package/dist/admin/invite.js
CHANGED
@@ -8,6 +8,40 @@ class Invite {
|
|
8
8
|
constructor(client) {
|
9
9
|
this.client = client;
|
10
10
|
}
|
11
|
+
/**
|
12
|
+
* This method accepts an invite. It requires sending a previous request to
|
13
|
+
* the {@link Auth.register}.
|
14
|
+
*
|
15
|
+
* This method sends a request to the [Accept Invite]
|
16
|
+
* (https://docs.medusajs.com/v2/api/admin#invites_postinvitesaccept)
|
17
|
+
* API route.
|
18
|
+
*
|
19
|
+
* @param input - The details of the user to create.
|
20
|
+
* @param query - Configure the fields to retrieve in the user.
|
21
|
+
* @param headers - Headers to pass in the request
|
22
|
+
* @returns The user's details.
|
23
|
+
*
|
24
|
+
* @example
|
25
|
+
* const token = await sdk.auth.register("user", "emailpass", {
|
26
|
+
* email: "user@gmail.com",
|
27
|
+
* password: "supersecret"
|
28
|
+
* })
|
29
|
+
*
|
30
|
+
* sdk.admin.invite.accept(
|
31
|
+
* {
|
32
|
+
* email: "user@gmail.com",
|
33
|
+
* first_name: "John",
|
34
|
+
* last_name: "Smith",
|
35
|
+
* invite_token: "12345..."
|
36
|
+
* },
|
37
|
+
* {
|
38
|
+
* Authorization: `Bearer ${token}`
|
39
|
+
* }
|
40
|
+
* )
|
41
|
+
* .then(({ user }) => {
|
42
|
+
* console.log(user)
|
43
|
+
* })
|
44
|
+
*/
|
11
45
|
async accept(input, query, headers) {
|
12
46
|
const { invite_token, ...rest } = input;
|
13
47
|
return await this.client.fetch(`/admin/invites/accept?token=${input.invite_token}`, {
|
@@ -17,6 +51,24 @@ class Invite {
|
|
17
51
|
query,
|
18
52
|
});
|
19
53
|
}
|
54
|
+
/**
|
55
|
+
* This method creates an invite. It sends a request to the
|
56
|
+
* [Create Invite](https://docs.medusajs.com/v2/api/admin#invites_postinvites)
|
57
|
+
* API route.
|
58
|
+
*
|
59
|
+
* @param body - The invite's details.
|
60
|
+
* @param query - Configure the fields to retrieve in the invite.
|
61
|
+
* @param headers - Headers to pass in the request
|
62
|
+
* @returns The invite's details.
|
63
|
+
*
|
64
|
+
* @example
|
65
|
+
* sdk.admin.invite.create({
|
66
|
+
* email: "user@gmail.com",
|
67
|
+
* })
|
68
|
+
* .then(({ invite }) => {
|
69
|
+
* console.log(invite)
|
70
|
+
* })
|
71
|
+
*/
|
20
72
|
async create(body, query, headers) {
|
21
73
|
return await this.client.fetch(`/admin/invites`, {
|
22
74
|
method: "POST",
|
@@ -25,24 +77,134 @@ class Invite {
|
|
25
77
|
query,
|
26
78
|
});
|
27
79
|
}
|
80
|
+
/**
|
81
|
+
* This method retrieves an invite by its ID. It sends a request to the
|
82
|
+
* [Get Invite](https://docs.medusajs.com/v2/api/admin#invites_getinvitesid)
|
83
|
+
* API route.
|
84
|
+
*
|
85
|
+
* @param id - The invite's ID.
|
86
|
+
* @param query - Configure the fields to retrieve in the invite.
|
87
|
+
* @param headers - Headers to pass in the request
|
88
|
+
* @returns The invite's details.
|
89
|
+
*
|
90
|
+
* @example
|
91
|
+
* To retrieve an invite its ID:
|
92
|
+
*
|
93
|
+
* ```ts
|
94
|
+
* sdk.admin.invite.retrieve("invite_123")
|
95
|
+
* .then(({ invite }) => {
|
96
|
+
* console.log(invite)
|
97
|
+
* })
|
98
|
+
* ```
|
99
|
+
*
|
100
|
+
* To specify the fields and relations to retrieve:
|
101
|
+
*
|
102
|
+
* ```ts
|
103
|
+
* sdk.admin.invite.retrieve("invite_123", {
|
104
|
+
* fields: "id,email"
|
105
|
+
* })
|
106
|
+
* .then(({ invite }) => {
|
107
|
+
* console.log(invite)
|
108
|
+
* })
|
109
|
+
* ```
|
110
|
+
*
|
111
|
+
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/v2/api/store#select-fields-and-relations).
|
112
|
+
*/
|
28
113
|
async retrieve(id, query, headers) {
|
29
114
|
return await this.client.fetch(`/admin/invites/${id}`, {
|
30
115
|
headers,
|
31
116
|
query,
|
32
117
|
});
|
33
118
|
}
|
119
|
+
/**
|
120
|
+
* This method retrieves a paginated list of invites. It sends a request to the
|
121
|
+
* [List Invites](https://docs.medusajs.com/v2/api/admin#invites_getinvites)
|
122
|
+
* API route.
|
123
|
+
*
|
124
|
+
* @param queryParams - Filters and pagination configurations.
|
125
|
+
* @param headers - Headers to pass in the request.
|
126
|
+
* @returns The paginated list of invites.
|
127
|
+
*
|
128
|
+
* @example
|
129
|
+
* To retrieve the list of invites:
|
130
|
+
*
|
131
|
+
* ```ts
|
132
|
+
* sdk.admin.invite.list()
|
133
|
+
* .then(({ invites, count, limit, offset }) => {
|
134
|
+
* console.log(invites)
|
135
|
+
* })
|
136
|
+
* ```
|
137
|
+
*
|
138
|
+
* To configure the pagination, pass the `limit` and `offset` query parameters.
|
139
|
+
*
|
140
|
+
* For example, to retrieve only 10 items and skip 10 items:
|
141
|
+
*
|
142
|
+
* ```ts
|
143
|
+
* sdk.admin.invite.list({
|
144
|
+
* limit: 10,
|
145
|
+
* offset: 10
|
146
|
+
* })
|
147
|
+
* .then(({ invites, count, limit, offset }) => {
|
148
|
+
* console.log(invites)
|
149
|
+
* })
|
150
|
+
* ```
|
151
|
+
*
|
152
|
+
* Using the `fields` query parameter, you can specify the fields and relations to retrieve
|
153
|
+
* in each invite:
|
154
|
+
*
|
155
|
+
* ```ts
|
156
|
+
* sdk.admin.invite.list({
|
157
|
+
* fields: "id,email"
|
158
|
+
* })
|
159
|
+
* .then(({ invites, count, limit, offset }) => {
|
160
|
+
* console.log(invites)
|
161
|
+
* })
|
162
|
+
* ```
|
163
|
+
*
|
164
|
+
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/v2/api/store#select-fields-and-relations).
|
165
|
+
*/
|
34
166
|
async list(queryParams, headers) {
|
35
167
|
return await this.client.fetch(`/admin/invites`, {
|
36
168
|
headers,
|
37
169
|
query: queryParams,
|
38
170
|
});
|
39
171
|
}
|
172
|
+
/**
|
173
|
+
* This method refreshes the token of an invite. It sends a request to the
|
174
|
+
* [Refresh Invite Token](https://docs.medusajs.com/v2/api/admin#invites_postinvitesidresend)
|
175
|
+
* API route.
|
176
|
+
*
|
177
|
+
* @param id - The invite's ID.
|
178
|
+
* @param headers - Headers to pass in the request.
|
179
|
+
* @returns The invite's details.
|
180
|
+
*
|
181
|
+
* @example
|
182
|
+
* sdk.admin.invite.resend("invite_123")
|
183
|
+
* .then(({ invite }) => {
|
184
|
+
* console.log(invite)
|
185
|
+
* })
|
186
|
+
*/
|
40
187
|
async resend(id, headers) {
|
41
188
|
return await this.client.fetch(`/admin/invites/${id}/resend`, {
|
42
189
|
method: "POST",
|
43
190
|
headers,
|
44
191
|
});
|
45
192
|
}
|
193
|
+
/**
|
194
|
+
* This method deletes an invite. It sends a request to the
|
195
|
+
* [Delete Invite](https://docs.medusajs.com/v2/api/admin#invites_deleteinvitesid)
|
196
|
+
* API route.
|
197
|
+
*
|
198
|
+
* @param id - The invite's ID.
|
199
|
+
* @param headers - Headers to pass in the request.
|
200
|
+
* @returns The deletion's details.
|
201
|
+
*
|
202
|
+
* @example
|
203
|
+
* sdk.admin.invite.delete("invite_123")
|
204
|
+
* .then(({ deleted }) => {
|
205
|
+
* console.log(deleted)
|
206
|
+
* })
|
207
|
+
*/
|
46
208
|
async delete(id, headers) {
|
47
209
|
return await this.client.fetch(`/admin/invites/${id}`, {
|
48
210
|
method: "DELETE",
|
package/dist/admin/invite.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"invite.js","sourceRoot":"","sources":["../../src/admin/invite.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"invite.js","sourceRoot":"","sources":["../../src/admin/invite.ts"],"names":[],"mappings":";;;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G;IACH,KAAK,CAAC,MAAM,CAAC,EAAU,EAAE,OAAuB;QAC9C,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,kBAAkB,EAAE,SAAS,EAC7B;YACE,MAAM,EAAE,MAAM;YACd,OAAO;SACR,CACF,CAAA;IACH,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,KAAK,CAAC,MAAM,CAAC,EAAU,EAAE,OAAuB;QAC9C,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,kBAAkB,EAAE,EAAE,EACtB;YACE,MAAM,EAAE,QAAQ;YAChB,OAAO;SACR,CACF,CAAA;IACH,CAAC;CACF;AA1PD,wBA0PC"}
|
@@ -10,12 +10,155 @@ export declare class ApiKey {
|
|
10
10
|
* @ignore
|
11
11
|
*/
|
12
12
|
constructor(client: Client);
|
13
|
-
|
13
|
+
/**
|
14
|
+
* This methods retrieves a paginated list of API keys. It sends a request to the
|
15
|
+
* [List API Keys](https://docs.medusajs.com/v2/api/admin#api-keys_getapikeys) API route.
|
16
|
+
*
|
17
|
+
* @param queryParams - Filters and pagination configurations.
|
18
|
+
* @param headers - Headers to pass in the request.
|
19
|
+
* @returns The paginated list of API keys.
|
20
|
+
*
|
21
|
+
* @example
|
22
|
+
* To retrieve the list of API keys:
|
23
|
+
*
|
24
|
+
* ```ts
|
25
|
+
* sdk.admin.apiKey.list()
|
26
|
+
* .then(({ api_keys, count, limit, offset }) => {
|
27
|
+
* console.log(api_keys)
|
28
|
+
* })
|
29
|
+
* ```
|
30
|
+
*
|
31
|
+
* To configure the pagination, pass the `limit` and `offset` query parameters.
|
32
|
+
*
|
33
|
+
* For example, to retrieve only 10 items and skip 10 items:
|
34
|
+
*
|
35
|
+
* ```ts
|
36
|
+
* sdk.admin.apiKey.list({
|
37
|
+
* limit: 10,
|
38
|
+
* offset: 10
|
39
|
+
* })
|
40
|
+
* .then(({ api_keys, count, limit, offset }) => {
|
41
|
+
* console.log(api_keys)
|
42
|
+
* })
|
43
|
+
* ```
|
44
|
+
*
|
45
|
+
* Using the `fields` query parameter, you can specify the fields and relations to retrieve
|
46
|
+
* in each API key:
|
47
|
+
*
|
48
|
+
* ```ts
|
49
|
+
* sdk.admin.apiKey.list({
|
50
|
+
* fields: "id,*sales_channels"
|
51
|
+
* })
|
52
|
+
* .then(({ api_keys, count, limit, offset }) => {
|
53
|
+
* console.log(api_keys)
|
54
|
+
* })
|
55
|
+
* ```
|
56
|
+
*
|
57
|
+
* Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/v2/api/store#select-fields-and-relations).
|
58
|
+
*/
|
59
|
+
list(queryParams?: HttpTypes.AdminGetApiKeysParams, headers?: ClientHeaders): Promise<HttpTypes.AdminApiKeyListResponse>;
|
60
|
+
/**
|
61
|
+
* This method creates an API key. It sends a request to the [Create API Key](https://docs.medusajs.com/v2/api/admin#api-keys_postapikeys)
|
62
|
+
* API route.
|
63
|
+
*
|
64
|
+
* @param body - The API key's details.
|
65
|
+
* @param query - Configure the fields to retrieve in the created API key.
|
66
|
+
* @param headers - Headers to pass in the request
|
67
|
+
* @returns The created API key
|
68
|
+
*
|
69
|
+
* @example
|
70
|
+
* sdk.admin.apiKey.create({
|
71
|
+
* title: "Development",
|
72
|
+
* type: "publishable"
|
73
|
+
* })
|
74
|
+
* .then(({ api_key }) => {
|
75
|
+
* console.log(api_key)
|
76
|
+
* })
|
77
|
+
*/
|
14
78
|
create(body: HttpTypes.AdminCreateApiKey, query?: HttpTypes.AdminGetApiKeysParams, headers?: ClientHeaders): Promise<HttpTypes.AdminApiKeyResponse>;
|
79
|
+
/**
|
80
|
+
* This method revokes an API key. It sends a request to the
|
81
|
+
* [Revoke API Key](https://docs.medusajs.com/v2/api/admin#api-keys_postapikeysidrevoke) API route.
|
82
|
+
*
|
83
|
+
* @param id - The API key's ID.
|
84
|
+
* @param headers - Headers to pass in the request.
|
85
|
+
* @returns The API key's details.
|
86
|
+
*
|
87
|
+
* @example
|
88
|
+
* sdk.admin.apiKey.revoke("apk_123")
|
89
|
+
* .then(({ api_key }) => {
|
90
|
+
* console.log(api_key)
|
91
|
+
* })
|
92
|
+
*/
|
15
93
|
revoke(id: string, headers?: ClientHeaders): Promise<HttpTypes.AdminApiKeyResponse>;
|
94
|
+
/**
|
95
|
+
* This method retrieves an API key's details. It sends a request to the
|
96
|
+
* [Get API key](https://docs.medusajs.com/v2/api/admin#api-keys_getapikeysid) API route.
|
97
|
+
*
|
98
|
+
* @param id - The API key's ID.
|
99
|
+
* @param headers - Headers to pass in the request.
|
100
|
+
* @returns The API key's details.
|
101
|
+
*
|
102
|
+
* @example
|
103
|
+
* sdk.admin.apiKey.retrieve("apk_123")
|
104
|
+
* .then(({ api_key }) => {
|
105
|
+
* console.log(api_key)
|
106
|
+
* })
|
107
|
+
*/
|
16
108
|
retrieve(id: string, headers?: ClientHeaders): Promise<HttpTypes.AdminApiKeyResponse>;
|
109
|
+
/**
|
110
|
+
* This method updates an API key's details. It sends a request to the
|
111
|
+
* [Update API Key](https://docs.medusajs.com/v2/api/admin#api-keys_postapikeysid) API route.
|
112
|
+
*
|
113
|
+
* @param id - The API key's ID.
|
114
|
+
* @param body - The data to update in the API key.
|
115
|
+
* @param query - Configure the fields to retrieve in the API key.
|
116
|
+
* @param headers - Headers to pass in the request.
|
117
|
+
* @returns The API key's details.
|
118
|
+
*
|
119
|
+
* @example
|
120
|
+
* sdk.admin.apiKey.update("apk_123", {
|
121
|
+
* title: "Development"
|
122
|
+
* })
|
123
|
+
* .then(({ api_key }) => {
|
124
|
+
* console.log(api_key)
|
125
|
+
* })
|
126
|
+
*/
|
17
127
|
update(id: string, body: HttpTypes.AdminUpdateApiKey, query?: HttpTypes.AdminGetApiKeysParams, headers?: ClientHeaders): Promise<HttpTypes.AdminApiKeyResponse>;
|
128
|
+
/**
|
129
|
+
* This method deletes an API key by its ID. It sends a request to the
|
130
|
+
* [Delete API Key](https://docs.medusajs.com/v2/api/admin#api-keys_deleteapikeysid) API route.
|
131
|
+
*
|
132
|
+
* @param id - The API key's ID.
|
133
|
+
* @param headers - Headers to pass in the request.
|
134
|
+
* @returns The deletion's details.
|
135
|
+
*
|
136
|
+
* @example
|
137
|
+
* sdk.admin.apiKey.delete("apk_123")
|
138
|
+
* .then(({ deleted }) => {
|
139
|
+
* console.log(deleted)
|
140
|
+
* })
|
141
|
+
*/
|
18
142
|
delete(id: string, headers?: ClientHeaders): Promise<HttpTypes.AdminApiKeyDeleteResponse>;
|
143
|
+
/**
|
144
|
+
* This method manages the sales channels associated with a publishable API key to either add
|
145
|
+
* or remove associations. It sends a request to the [Manage Sales Channels](https://docs.medusajs.com/v2/api/admin#api-keys_postapikeysidsaleschannels)
|
146
|
+
* API route.
|
147
|
+
*
|
148
|
+
* @param id - The API key's ID.
|
149
|
+
* @param body - The sales channels to add or remove from the API key.
|
150
|
+
* @param headers - Headers to pass in the request.
|
151
|
+
* @returns The API key's details.
|
152
|
+
*
|
153
|
+
* @example
|
154
|
+
* sdk.admin.apiKey.batchSalesChannels("apk_123", {
|
155
|
+
* add: ["sc_123"],
|
156
|
+
* remove: ["sc_321"]
|
157
|
+
* })
|
158
|
+
* .then(({ api_key }) => {
|
159
|
+
* console.log(api_key)
|
160
|
+
* })
|
161
|
+
*/
|
19
162
|
batchSalesChannels(id: string, body: HttpTypes.AdminBatchLink, headers?: ClientHeaders): Promise<HttpTypes.AdminApiKeyResponse>;
|
20
163
|
}
|
21
164
|
//# sourceMappingURL=api-key.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"api-key.d.ts","sourceRoot":"","sources":["../../../src/admin/api-key.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,
|
1
|
+
{"version":3,"file":"api-key.d.ts","sourceRoot":"","sources":["../../../src/admin/api-key.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,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