@medusajs/js-sdk 0.0.2-snapshot-20241018092943 → 0.0.2-snapshot-20241021145551
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/admin/claim.d.ts +0 -1
- package/dist/admin/claim.d.ts.map +1 -1
- package/dist/admin/claim.js +0 -7
- package/dist/admin/claim.js.map +1 -1
- package/dist/admin/exchange.d.ts +0 -4
- package/dist/admin/exchange.d.ts.map +1 -1
- package/dist/admin/exchange.js +0 -30
- package/dist/admin/exchange.js.map +1 -1
- package/dist/admin/order.d.ts +1 -0
- package/dist/admin/order.d.ts.map +1 -1
- package/dist/admin/order.js +6 -0
- package/dist/admin/order.js.map +1 -1
- package/dist/auth/index.d.ts +156 -0
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +152 -1
- package/dist/auth/index.js.map +1 -1
- package/dist/esm/admin/claim.d.ts +0 -1
- package/dist/esm/admin/claim.d.ts.map +1 -1
- package/dist/esm/admin/claim.js +0 -9
- package/dist/esm/admin/claim.js.map +1 -1
- package/dist/esm/admin/exchange.d.ts +0 -4
- package/dist/esm/admin/exchange.d.ts.map +1 -1
- package/dist/esm/admin/exchange.js +0 -38
- package/dist/esm/admin/exchange.js.map +1 -1
- package/dist/esm/admin/order.d.ts +1 -0
- package/dist/esm/admin/order.d.ts.map +1 -1
- package/dist/esm/admin/order.js +8 -0
- package/dist/esm/admin/order.js.map +1 -1
- package/dist/esm/auth/index.d.ts +156 -0
- package/dist/esm/auth/index.d.ts.map +1 -1
- package/dist/esm/auth/index.js +152 -1
- package/dist/esm/auth/index.js.map +1 -1
- package/dist/esm/store/index.d.ts +973 -83
- package/dist/esm/store/index.d.ts.map +1 -1
- package/dist/esm/store/index.js +946 -0
- package/dist/esm/store/index.js.map +1 -1
- package/dist/esm/types.d.ts +5 -0
- package/dist/esm/types.d.ts.map +1 -1
- package/dist/store/index.d.ts +973 -83
- package/dist/store/index.d.ts.map +1 -1
- package/dist/store/index.js +946 -0
- package/dist/store/index.js.map +1 -1
- package/dist/types.d.ts +5 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/esm/admin/claim.js
CHANGED
@@ -49,15 +49,6 @@ export class Claim {
|
|
49
49
|
});
|
50
50
|
});
|
51
51
|
}
|
52
|
-
delete(id, query, headers) {
|
53
|
-
return __awaiter(this, void 0, void 0, function* () {
|
54
|
-
return yield this.client.fetch(`/admin/claims/${id}`, {
|
55
|
-
method: "DELETE",
|
56
|
-
headers,
|
57
|
-
query,
|
58
|
-
});
|
59
|
-
});
|
60
|
-
}
|
61
52
|
addItems(id, body, query, headers) {
|
62
53
|
return __awaiter(this, void 0, void 0, function* () {
|
63
54
|
return yield this.client.fetch(`/admin/claims/${id}/claim-items`, {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"claim.js","sourceRoot":"","sources":["../../../src/admin/claim.ts"],"names":[],"mappings":";;;;;;;;;AAKA,MAAM,OAAO,KAAK;IAKhB;;OAEG;IACH,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAEK,IAAI,CAAC,KAAsC,EAAE,OAAuB;;YACxE,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,eAAe,EACf;gBACE,KAAK;gBACL,OAAO;aACR,CACF,CAAA;QACH,CAAC;KAAA;IAEK,QAAQ,CACZ,EAAU,EACV,KAAkC,EAClC,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,iBAAiB,EAAE,EAAE,EACrB;gBACE,KAAK;gBACL,OAAO;aACR,CACF,CAAA;QACH,CAAC;KAAA;IAEK,MAAM,CACV,IAAgC,EAChC,KAA8B,EAC9B,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,eAAe,EACf;gBACE,MAAM,EAAE,MAAM;gBACd,OAAO;gBACP,IAAI;gBACJ,KAAK;aACN,CACF,CAAA;QACH,CAAC;KAAA;IAEK,MAAM,CACV,E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QAAQ,EAAE,EAC1D;gBACE,MAAM,EAAE,QAAQ;gBAChB,OAAO;gBACP,KAAK;aACN,CACF,CAAA;QACH,CAAC;KAAA;IAEK,OAAO,CACX,EAAU,EACV,IAAiC,EACjC,KAA8B,EAC9B,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,iBAAiB,EAAE,UAAU,EAC7B;gBACE,MAAM,EAAE,MAAM;gBACd,OAAO;gBACP,IAAI;gBACJ,KAAK;aACN,CACF,CAAA;QACH,CAAC;KAAA;IAEK,aAAa,CACjB,EAAU,EACV,KAA8B,EAC9B,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,iBAAiB,EAAE,UAAU,EAC7B;gBACE,MAAM,EAAE,QAAQ;gBAChB,OAAO;gBACP,KAAK;aACN,CACF,CAAA;QACH,CAAC;KAAA;CACF"}
|
@@ -14,10 +14,6 @@ export declare class Exchange {
|
|
14
14
|
retrieve(id: string, query?: HttpTypes.AdminExchangeParams, headers?: ClientHeaders): Promise<HttpTypes.AdminExchangeResponse>;
|
15
15
|
create(body: HttpTypes.AdminCreateExchange, query?: HttpTypes.SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminExchangeResponse>;
|
16
16
|
cancel(id: string, query?: HttpTypes.SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminExchangeResponse>;
|
17
|
-
delete(id: string, query?: HttpTypes.SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminExchangeDeleteResponse>;
|
18
|
-
addItems(id: string, body: HttpTypes.AdminAddExchangeItems, query?: HttpTypes.SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminExchangeResponse>;
|
19
|
-
updateItem(id: string, actionId: string, body: HttpTypes.AdminUpdateExchangeItem, query?: HttpTypes.SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminExchangeResponse>;
|
20
|
-
removeItem(id: string, actionId: string, query?: HttpTypes.SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminReturnResponse>;
|
21
17
|
addInboundItems(id: string, body: HttpTypes.AdminAddExchangeInboundItems, query?: HttpTypes.SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminExchangeResponse>;
|
22
18
|
updateInboundItem(id: string, actionId: string, body: HttpTypes.AdminUpdateExchangeInboundItem, query?: HttpTypes.SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminExchangeResponse>;
|
23
19
|
removeInboundItem(id: string, actionId: string, query?: HttpTypes.SelectParams, headers?: ClientHeaders): Promise<HttpTypes.AdminExchangeResponse>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"exchange.d.ts","sourceRoot":"","sources":["../../../src/admin/exchange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAE3C,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;IAIpB,IAAI,CACR,KAAK,CAAC,EAAE,SAAS,CAAC,uBAAuB,EACzC,OAAO,CAAC,EAAE,aAAa;IAWnB,QAAQ,CACZ,EAAE,EAAE,MAAM,EACV,KAAK,CAAC,EAAE,SAAS,CAAC,mBAAmB,EACrC,OAAO,CAAC,EAAE,aAAa;IAWnB,MAAM,CACV,IAAI,EAAE,SAAS,CAAC,mBAAmB,EACnC,KAAK,CAAC,EAAE,SAAS,CAAC,YAAY,EAC9B,OAAO,CAAC,EAAE,aAAa;IAanB,MAAM,CACV,EAAE,EAAE,MAAM,EACV,KAAK,CAAC,EAAE,SAAS,CAAC,YAAY,EAC9B,OAAO,CAAC,EAAE,aAAa;IAYnB,
|
1
|
+
{"version":3,"file":"exchange.d.ts","sourceRoot":"","sources":["../../../src/admin/exchange.ts"],"names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,EAChB,KAAK,CAAC,EAAE,SAAS,CAAC,YAAY,EAC9B,OAAO,CAAC,EAAE,aAAa;IAYnB,OAAO,CACX,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,SAAS,CAAC,oBAAoB,EACpC,KAAK,CAAC,EAAE,SAAS,CAAC,YAAY,EAC9B,OAAO,CAAC,EAAE,aAAa;IAanB,aAAa,CACjB,EAAE,EAAE,MAAM,EACV,KAAK,CAAC,EAAE,SAAS,CAAC,YAAY,EAC9B,OAAO,CAAC,EAAE,aAAa;CAW1B"}
|
@@ -49,44 +49,6 @@ export class Exchange {
|
|
49
49
|
});
|
50
50
|
});
|
51
51
|
}
|
52
|
-
delete(id, query, headers) {
|
53
|
-
return __awaiter(this, void 0, void 0, function* () {
|
54
|
-
return yield this.client.fetch(`/admin/exchanges/${id}`, {
|
55
|
-
method: "DELETE",
|
56
|
-
headers,
|
57
|
-
query,
|
58
|
-
});
|
59
|
-
});
|
60
|
-
}
|
61
|
-
addItems(id, body, query, headers) {
|
62
|
-
return __awaiter(this, void 0, void 0, function* () {
|
63
|
-
return yield this.client.fetch(`/admin/exchanges/${id}/exchange-items`, {
|
64
|
-
method: "POST",
|
65
|
-
headers,
|
66
|
-
body,
|
67
|
-
query,
|
68
|
-
});
|
69
|
-
});
|
70
|
-
}
|
71
|
-
updateItem(id, actionId, body, query, headers) {
|
72
|
-
return __awaiter(this, void 0, void 0, function* () {
|
73
|
-
return yield this.client.fetch(`/admin/exchanges/${id}/exchange-items/${actionId}`, {
|
74
|
-
method: "POST",
|
75
|
-
headers,
|
76
|
-
body,
|
77
|
-
query,
|
78
|
-
});
|
79
|
-
});
|
80
|
-
}
|
81
|
-
removeItem(id, actionId, query, headers) {
|
82
|
-
return __awaiter(this, void 0, void 0, function* () {
|
83
|
-
return yield this.client.fetch(`/admin/exchanges/${id}/exchange-items/${actionId}`, {
|
84
|
-
method: "DELETE",
|
85
|
-
headers,
|
86
|
-
query,
|
87
|
-
});
|
88
|
-
});
|
89
|
-
}
|
90
52
|
addInboundItems(id, body, query, headers) {
|
91
53
|
return __awaiter(this, void 0, void 0, function* () {
|
92
54
|
return yield this.client.fetch(`/admin/exchanges/${id}/inbound/items`, {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"exchange.js","sourceRoot":"","sources":["../../../src/admin/exchange.ts"],"names":[],"mappings":";;;;;;;;;AAKA,MAAM,OAAO,QAAQ;IAKnB;;OAEG;IACH,YAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAEK,IAAI,CACR,KAAyC,EACzC,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,kBAAkB,EAClB;gBACE,KAAK;gBACL,OAAO;aACR,CACF,CAAA;QACH,CAAC;KAAA;IAEK,QAAQ,CACZ,EAAU,EACV,KAAqC,EACrC,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,oBAAoB,EAAE,EAAE,EACxB;gBACE,KAAK;gBACL,OAAO;aACR,CACF,CAAA;QACH,CAAC;KAAA;IAEK,MAAM,CACV,IAAmC,EACnC,KAA8B,EAC9B,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,kBAAkB,EAClB;gBACE,MAAM,EAAE,MAAM;gBACd,OAAO;gBACP,IAAI;gBACJ,KAAK;aACN,CACF,CAAA;QACH,CAAC;KAAA;IAEK,MAAM,CACV,EAAU,EACV,KAA8B,EAC9B,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,oBAAoB,EAAE,SAAS,EAC/B;gBACE,MAAM,EAAE,MAAM;gBACd,OAAO;gBACP,KAAK;aACN,CACF,CAAA;QACH,CAAC;KAAA;IAEK,
|
1
|
+
{"version":3,"file":"exchange.js","sourceRoot":"","sources":["../../../src/admin/exchange.ts"],"names":[],"mappings":";;;;;;;;;AAKA,M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aACN,CACF,CAAA;QACH,CAAC;KAAA;IAEK,sBAAsB,CAC1B,EAAU,EACV,QAAgB,EAChB,KAA8B,EAC9B,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,oBAAoB,EAAE,6BAA6B,QAAQ,EAAE,EAC7D;gBACE,MAAM,EAAE,QAAQ;gBAChB,OAAO;gBACP,KAAK;aACN,CACF,CAAA;QACH,CAAC;KAAA;IAEK,OAAO,CACX,EAAU,EACV,IAAoC,EACpC,KAA8B,EAC9B,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,oBAAoB,EAAE,UAAU,EAChC;gBACE,MAAM,EAAE,MAAM;gBACd,OAAO;gBACP,IAAI;gBACJ,KAAK;aACN,CACF,CAAA;QACH,CAAC;KAAA;IAEK,aAAa,CACjB,EAAU,EACV,KAA8B,EAC9B,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,oBAAoB,EAAE,UAAU,EAChC;gBACE,MAAM,EAAE,QAAQ;gBAChB,OAAO;gBACP,KAAK;aACN,CACF,CAAA;QACH,CAAC;KAAA;CACF"}
|
@@ -33,5 +33,6 @@ export declare class Order {
|
|
33
33
|
order: HttpTypes.AdminOrder;
|
34
34
|
}>;
|
35
35
|
listChanges(id: string, queryParams?: FindParams & HttpTypes.AdminOrderChangesFilters, headers?: ClientHeaders): Promise<HttpTypes.PaginatedResponse<HttpTypes.AdminOrderChangesResponse>>;
|
36
|
+
listLineItems(id: string, queryParams?: FindParams & HttpTypes.AdminOrderItemsFilters, headers?: ClientHeaders): Promise<HttpTypes.PaginatedResponse<HttpTypes.AdminOrderLineItemsListResponse>>;
|
36
37
|
}
|
37
38
|
//# sourceMappingURL=order.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"order.d.ts","sourceRoot":"","sources":["../../../src/admin/order.ts"],"names":[],"mappings":"AAAA,OAAO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EAAE,aAAa;eAEiB,SAAS,CAAC,UAAU;;IAWxD,iBAAiB,CACrB,EAAE,EAAE,MAAM,EACV,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,SAAS,CAAC,2BAA2B,EAC3C,OAAO,CAAC,EAAE,aAAa;eAEiB,SAAS,CAAC,UAAU;;IAUxD,cAAc,CAClB,EAAE,EAAE,MAAM,EACV,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,SAAS,CAAC,wBAAwB,EACxC,KAAK,CAAC,EAAE,YAAY,EACpB,OAAO,CAAC,EAAE,aAAa;eAEiB,SAAS,CAAC,UAAU;;IAWxD,eAAe,CACnB,EAAE,EAAE,MAAM,EACV,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE,SAAS,CAAC,oCAAoC,EACpD,KAAK,CAAC,EAAE,YAAY,EACpB,OAAO,CAAC,EAAE,aAAa;eAEiB,SAAS,CAAC,UAAU;;IAWxD,WAAW,CACf,EAAE,EAAE,MAAM,EACV,WAAW,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC,wBAAwB,EAC7D,OAAO,CAAC,EAAE,aAAa;IAUnB,aAAa,CACjB,EAAE,EAAE,MAAM,EACV,WAAW,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC,sBAAsB,EAC3D,OAAO,CAAC,EAAE,aAAa;CAS1B"}
|
package/dist/esm/admin/order.js
CHANGED
@@ -93,5 +93,13 @@ export class Order {
|
|
93
93
|
});
|
94
94
|
});
|
95
95
|
}
|
96
|
+
listLineItems(id, queryParams, headers) {
|
97
|
+
return __awaiter(this, void 0, void 0, function* () {
|
98
|
+
return yield this.client.fetch(`/admin/orders/${id}/line-items`, {
|
99
|
+
query: queryParams,
|
100
|
+
headers,
|
101
|
+
});
|
102
|
+
});
|
103
|
+
}
|
96
104
|
}
|
97
105
|
//# sourceMappingURL=order.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"order.js","sourceRoot":"","sources":["../../../src/admin/order.ts"],"names":[],"mappings":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iB,EAAE,iBAAiB,aAAa,YAAY,EAC7D;gBACE,MAAM,EAAE,MAAM;gBACd,OAAO;gBACP,IAAI;gBACJ,KAAK;aACN,CACF,CAAA;QACH,CAAC;KAAA;IAEK,eAAe,CACnB,EAAU,EACV,aAAqB,EACrB,IAAoD,EACpD,KAAoB,EACpB,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAC5B,iBAAiB,EAAE,iBAAiB,aAAa,oBAAoB,EACrE;gBACE,MAAM,EAAE,MAAM;gBACd,OAAO;gBACP,IAAI;gBACJ,KAAK;aACN,CACF,CAAA;QACH,CAAC;KAAA;IAEK,WAAW,CACf,EAAU,EACV,WAA6D,EAC7D,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAE5B,iBAAiB,EAAE,UAAU,EAAE;gBAC/B,KAAK,EAAE,WAAW;gBAClB,OAAO;aACR,CAAC,CAAA;QACJ,CAAC;KAAA;IAEK,aAAa,CACjB,EAAU,EACV,WAA2D,EAC3D,OAAuB;;YAEvB,OAAO,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAE5B,iBAAiB,EAAE,aAAa,EAAE;gBAClC,KAAK,EAAE,WAAW;gBAClB,OAAO;aACR,CAAC,CAAA;QACJ,CAAC;KAAA;CACF"}
|
package/dist/esm/auth/index.d.ts
CHANGED
@@ -5,17 +5,173 @@ export declare class Auth {
|
|
5
5
|
private client;
|
6
6
|
private config;
|
7
7
|
constructor(client: Client, config: Config);
|
8
|
+
/**
|
9
|
+
* This method is used to retrieve a registration JWT token for a user, customer, or custom actor type. It sends a request to the
|
10
|
+
* [Retrieve Registration Token API route](https://docs.medusajs.com/v2/api/store#auth_postactor_typeauth_provider_register).
|
11
|
+
*
|
12
|
+
* @param actor - The actor type. For example, `user` for admin user, or `customer` for customer.
|
13
|
+
* @param method - The authentication provider to use. For example, `emailpass` or `google`.
|
14
|
+
* @param payload - The data to pass in the request's body for authentication. When using the `emailpass` provider,
|
15
|
+
* you pass the email and password.
|
16
|
+
* @returns The JWT token used for registration later.
|
17
|
+
*
|
18
|
+
* @example
|
19
|
+
* sdk.auth.register(
|
20
|
+
* "customer",
|
21
|
+
* "emailpass",
|
22
|
+
* {
|
23
|
+
* email: "customer@gmail.com",
|
24
|
+
* password: "supersecret"
|
25
|
+
* }
|
26
|
+
* ).then((token) => {
|
27
|
+
* console.log(token)
|
28
|
+
* })
|
29
|
+
*/
|
8
30
|
register: (actor: string, method: string, payload: HttpTypes.AdminSignUpWithEmailPassword) => Promise<string>;
|
31
|
+
/**
|
32
|
+
* This method retrieves the JWT authenticated token for an admin user, customer, or custom
|
33
|
+
* actor type. It sends a request to the [Authenticate API Route](https://docs.medusajs.com/v2/api/admin#auth_postactor_typeauth_provider).
|
34
|
+
*
|
35
|
+
* If the `auth.type` of the SDK is set to `session`, this method will also send a request to the
|
36
|
+
* [Set Authentication Session API route](https://docs.medusajs.com/v2/api/admin#auth_postsession).
|
37
|
+
*
|
38
|
+
* Subsequent requests using the SDK will automatically have the necessary authentication headers / session
|
39
|
+
* set.
|
40
|
+
*
|
41
|
+
* @param actor - The actor type. For example, `user` for admin user, or `customer` for customer.
|
42
|
+
* @param method - The authentication provider to use. For example, `emailpass` or `google`.
|
43
|
+
* @param payload - The data to pass in the request's body for authentication. When using the `emailpass` provider,
|
44
|
+
* you pass the email and password.
|
45
|
+
* @returns The authentication JWT token
|
46
|
+
*
|
47
|
+
* @example
|
48
|
+
* sdk.auth.login(
|
49
|
+
* "customer",
|
50
|
+
* "emailpass",
|
51
|
+
* {
|
52
|
+
* email: "customer@gmail.com",
|
53
|
+
* password: "supersecret"
|
54
|
+
* }
|
55
|
+
* ).then((token) => {
|
56
|
+
* console.log(token)
|
57
|
+
* })
|
58
|
+
*/
|
9
59
|
login: (actor: string, method: string, payload: HttpTypes.AdminSignInWithEmailPassword | Record<string, unknown>) => Promise<string | {
|
10
60
|
location: string;
|
11
61
|
}>;
|
62
|
+
/**
|
63
|
+
* This method is used to validate an Oauth callback from a third-party service, such as Google, for an admin user, customer, or custom actor types.
|
64
|
+
* It sends a request to the [Validate Authentication Callback](https://docs.medusajs.com/v2/api/admin#auth_postactor_typeauth_providercallback).
|
65
|
+
*
|
66
|
+
* @param actor - The actor type. For example, `user` for admin user, or `customer` for customer.
|
67
|
+
* @param method - The authentication provider to use. For example, `google`.
|
68
|
+
* @param query - The query parameters from the Oauth callback, which should be passed to the API route.
|
69
|
+
* @returns The authentication JWT token
|
70
|
+
*
|
71
|
+
* @example
|
72
|
+
* sdk.auth.callback(
|
73
|
+
* "customer",
|
74
|
+
* "google",
|
75
|
+
* {
|
76
|
+
* code: "123",
|
77
|
+
* }
|
78
|
+
* ).then((token) => {
|
79
|
+
* console.log(token)
|
80
|
+
* })
|
81
|
+
*
|
82
|
+
*
|
83
|
+
* @privateRemarks
|
84
|
+
* The callback expects all query parameters from the Oauth callback to be passed to
|
85
|
+
* the backend, and the provider is in charge of parsing and validating them
|
86
|
+
*/
|
12
87
|
callback: (actor: string, method: string, query?: Record<string, unknown>) => Promise<string>;
|
88
|
+
/**
|
89
|
+
* This method refreshes a JWT authentication token, which is useful after validating the Oauth callback
|
90
|
+
* with {@link callback}. It sends a request to the [Refresh Authentication Token API route](https://docs.medusajs.com/v2/api/admin#auth_postadminauthtokenrefresh).
|
91
|
+
*
|
92
|
+
* @returns The refreshed JWT authentication token.
|
93
|
+
*
|
94
|
+
* @example
|
95
|
+
* sdk.auth.refresh()
|
96
|
+
* .then((token) => {
|
97
|
+
* console.log(token)
|
98
|
+
* })
|
99
|
+
*/
|
13
100
|
refresh: () => Promise<string>;
|
101
|
+
/**
|
102
|
+
* This method deletes the authentication session of the currently logged-in user to log them out.
|
103
|
+
* It sends a request to the [Delete Authentication Session API route](https://docs.medusajs.com/v2/api/admin#auth_deletesession).
|
104
|
+
*
|
105
|
+
* @example
|
106
|
+
* sdk.auth.logout()
|
107
|
+
* .then(() => {
|
108
|
+
* // user is logged out
|
109
|
+
* })
|
110
|
+
*/
|
14
111
|
logout: () => Promise<void>;
|
112
|
+
/**
|
113
|
+
* This method requests a reset password token for an admin user, customer, or custom actor type.
|
114
|
+
* It sends a request to the [Generate Reset Password Token API route](https://docs.medusajs.com/v2/api/admin#auth_postactor_typeauth_providerresetpassword).
|
115
|
+
*
|
116
|
+
* To reset the password later using the token delivered to the user, use the {@link updateProvider} method.
|
117
|
+
*
|
118
|
+
* Related guide: [How to allow customers to reset their passwords in a storefront](https://docs.medusajs.com/v2/resources/storefront-development/customers/reset-password).
|
119
|
+
*
|
120
|
+
* @param actor - The actor type. For example, `user` for admin user, or `customer` for customer.
|
121
|
+
* @param provider - The authentication provider to use. For example, `emailpass`.
|
122
|
+
* @param body - The data required to identify the user.
|
123
|
+
*
|
124
|
+
* @example
|
125
|
+
* sdk.auth.resetPassword(
|
126
|
+
* "customer",
|
127
|
+
* "emailpass",
|
128
|
+
* {
|
129
|
+
* identifier: "customer@gmail.com"
|
130
|
+
* }
|
131
|
+
* )
|
132
|
+
* .then(() => {
|
133
|
+
* // user receives token
|
134
|
+
* })
|
135
|
+
*/
|
15
136
|
resetPassword: (actor: string, provider: string, body: {
|
137
|
+
/**
|
138
|
+
* The user's identifier. For example, when using the `emailpass` provider,
|
139
|
+
* this would be the user's email.
|
140
|
+
*/
|
16
141
|
identifier: string;
|
17
142
|
}) => Promise<void>;
|
143
|
+
/**
|
144
|
+
* This method is used to update user-related data authentication data.
|
145
|
+
*
|
146
|
+
* More specifically, use this method when updating the password of an admin user, customer, or
|
147
|
+
* custom actor type after requesting to reset their password with {@link resetPassword}.
|
148
|
+
*
|
149
|
+
* This method sends a request to [this API route](https://docs.medusajs.com/v2/api/admin#auth_postactor_typeauth_providerupdate).
|
150
|
+
*
|
151
|
+
* Related guide: [How to allow customers to reset their passwords in a storefront](https://docs.medusajs.com/v2/resources/storefront-development/customers/reset-password).
|
152
|
+
*
|
153
|
+
* @param actor - The actor type. For example, `user` for admin user, or `customer` for customer.
|
154
|
+
* @param provider - The authentication provider to use. For example, `emailpass`.
|
155
|
+
* @param body - The data necessary to update the user's authentication data. When resetting the user's password,
|
156
|
+
* send the `email` and `password` properties.
|
157
|
+
*
|
158
|
+
* @example
|
159
|
+
* sdk.auth.updateProvider(
|
160
|
+
* "customer",
|
161
|
+
* "emailpass",
|
162
|
+
* {
|
163
|
+
* email: "customer@gmail.com",
|
164
|
+
* password: "supersecret"
|
165
|
+
* }
|
166
|
+
* )
|
167
|
+
* .then(() => {
|
168
|
+
* // password updated
|
169
|
+
* })
|
170
|
+
*/
|
18
171
|
updateProvider: (actor: string, provider: string, body: Record<string, unknown>) => Promise<void>;
|
172
|
+
/**
|
173
|
+
* @ignore
|
174
|
+
*/
|
19
175
|
private setToken_;
|
20
176
|
}
|
21
177
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,qBAAa,IAAI;IACf,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,MAAM,CAAQ;gBAEV,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAK1C,QAAQ,UACC,MAAM,UACL,MAAM,WACL,SAAS,CAAC,4BAA4B,qBAahD;IAED,KAAK,UACI,MAAM,UACL,MAAM,WACL,SAAS,CAAC,4BAA4B,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;OAmB1E;
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/auth/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,qBAAa,IAAI;IACf,OAAO,CAAC,MAAM,CAAQ;IACtB,OAAO,CAAC,MAAM,CAAQ;gBAEV,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAK1C;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,QAAQ,UACC,MAAM,UACL,MAAM,WACL,SAAS,CAAC,4BAA4B,qBAahD;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,KAAK,UACI,MAAM,UACL,MAAM,WACL,SAAS,CAAC,4BAA4B,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;;OAmB1E;IAED;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,QAAQ,UACC,MAAM,UACL,MAAM,UACN,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,qBAYhC;IAED;;;;;;;;;;;OAWG;IACH,OAAO,wBAYN;IAED;;;;;;;;;OASG;IACH,MAAM,sBAQL;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,aAAa,UACJ,MAAM,YACH,MAAM,QACV;QACJ;;;WAGG;QACH,UAAU,EAAE,MAAM,CAAA;KACnB,mBAOF;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2BG;IACH,cAAc,UACL,MAAM,YACH,MAAM,QACV,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,mBAM9B;IAED;;OAEG;IACH,OAAO,CAAC,SAAS,CAUhB;CACF"}
|
package/dist/esm/auth/index.js
CHANGED
@@ -9,6 +9,28 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
9
9
|
};
|
10
10
|
export class Auth {
|
11
11
|
constructor(client, config) {
|
12
|
+
/**
|
13
|
+
* This method is used to retrieve a registration JWT token for a user, customer, or custom actor type. It sends a request to the
|
14
|
+
* [Retrieve Registration Token API route](https://docs.medusajs.com/v2/api/store#auth_postactor_typeauth_provider_register).
|
15
|
+
*
|
16
|
+
* @param actor - The actor type. For example, `user` for admin user, or `customer` for customer.
|
17
|
+
* @param method - The authentication provider to use. For example, `emailpass` or `google`.
|
18
|
+
* @param payload - The data to pass in the request's body for authentication. When using the `emailpass` provider,
|
19
|
+
* you pass the email and password.
|
20
|
+
* @returns The JWT token used for registration later.
|
21
|
+
*
|
22
|
+
* @example
|
23
|
+
* sdk.auth.register(
|
24
|
+
* "customer",
|
25
|
+
* "emailpass",
|
26
|
+
* {
|
27
|
+
* email: "customer@gmail.com",
|
28
|
+
* password: "supersecret"
|
29
|
+
* }
|
30
|
+
* ).then((token) => {
|
31
|
+
* console.log(token)
|
32
|
+
* })
|
33
|
+
*/
|
12
34
|
this.register = (actor, method, payload) => __awaiter(this, void 0, void 0, function* () {
|
13
35
|
const { token } = yield this.client.fetch(`/auth/${actor}/${method}/register`, {
|
14
36
|
method: "POST",
|
@@ -17,6 +39,34 @@ export class Auth {
|
|
17
39
|
this.client.setToken(token);
|
18
40
|
return token;
|
19
41
|
});
|
42
|
+
/**
|
43
|
+
* This method retrieves the JWT authenticated token for an admin user, customer, or custom
|
44
|
+
* actor type. It sends a request to the [Authenticate API Route](https://docs.medusajs.com/v2/api/admin#auth_postactor_typeauth_provider).
|
45
|
+
*
|
46
|
+
* If the `auth.type` of the SDK is set to `session`, this method will also send a request to the
|
47
|
+
* [Set Authentication Session API route](https://docs.medusajs.com/v2/api/admin#auth_postsession).
|
48
|
+
*
|
49
|
+
* Subsequent requests using the SDK will automatically have the necessary authentication headers / session
|
50
|
+
* set.
|
51
|
+
*
|
52
|
+
* @param actor - The actor type. For example, `user` for admin user, or `customer` for customer.
|
53
|
+
* @param method - The authentication provider to use. For example, `emailpass` or `google`.
|
54
|
+
* @param payload - The data to pass in the request's body for authentication. When using the `emailpass` provider,
|
55
|
+
* you pass the email and password.
|
56
|
+
* @returns The authentication JWT token
|
57
|
+
*
|
58
|
+
* @example
|
59
|
+
* sdk.auth.login(
|
60
|
+
* "customer",
|
61
|
+
* "emailpass",
|
62
|
+
* {
|
63
|
+
* email: "customer@gmail.com",
|
64
|
+
* password: "supersecret"
|
65
|
+
* }
|
66
|
+
* ).then((token) => {
|
67
|
+
* console.log(token)
|
68
|
+
* })
|
69
|
+
*/
|
20
70
|
this.login = (actor, method, payload) => __awaiter(this, void 0, void 0, function* () {
|
21
71
|
// There will either be token or location returned from the backend.
|
22
72
|
const { token, location } = yield this.client.fetch(`/auth/${actor}/${method}`, {
|
@@ -31,7 +81,31 @@ export class Auth {
|
|
31
81
|
yield this.setToken_(token);
|
32
82
|
return token;
|
33
83
|
});
|
34
|
-
|
84
|
+
/**
|
85
|
+
* This method is used to validate an Oauth callback from a third-party service, such as Google, for an admin user, customer, or custom actor types.
|
86
|
+
* It sends a request to the [Validate Authentication Callback](https://docs.medusajs.com/v2/api/admin#auth_postactor_typeauth_providercallback).
|
87
|
+
*
|
88
|
+
* @param actor - The actor type. For example, `user` for admin user, or `customer` for customer.
|
89
|
+
* @param method - The authentication provider to use. For example, `google`.
|
90
|
+
* @param query - The query parameters from the Oauth callback, which should be passed to the API route.
|
91
|
+
* @returns The authentication JWT token
|
92
|
+
*
|
93
|
+
* @example
|
94
|
+
* sdk.auth.callback(
|
95
|
+
* "customer",
|
96
|
+
* "google",
|
97
|
+
* {
|
98
|
+
* code: "123",
|
99
|
+
* }
|
100
|
+
* ).then((token) => {
|
101
|
+
* console.log(token)
|
102
|
+
* })
|
103
|
+
*
|
104
|
+
*
|
105
|
+
* @privateRemarks
|
106
|
+
* The callback expects all query parameters from the Oauth callback to be passed to
|
107
|
+
* the backend, and the provider is in charge of parsing and validating them
|
108
|
+
*/
|
35
109
|
this.callback = (actor, method, query) => __awaiter(this, void 0, void 0, function* () {
|
36
110
|
const { token } = yield this.client.fetch(`/auth/${actor}/${method}/callback`, {
|
37
111
|
method: "GET",
|
@@ -40,6 +114,18 @@ export class Auth {
|
|
40
114
|
yield this.setToken_(token);
|
41
115
|
return token;
|
42
116
|
});
|
117
|
+
/**
|
118
|
+
* This method refreshes a JWT authentication token, which is useful after validating the Oauth callback
|
119
|
+
* with {@link callback}. It sends a request to the [Refresh Authentication Token API route](https://docs.medusajs.com/v2/api/admin#auth_postadminauthtokenrefresh).
|
120
|
+
*
|
121
|
+
* @returns The refreshed JWT authentication token.
|
122
|
+
*
|
123
|
+
* @example
|
124
|
+
* sdk.auth.refresh()
|
125
|
+
* .then((token) => {
|
126
|
+
* console.log(token)
|
127
|
+
* })
|
128
|
+
*/
|
43
129
|
this.refresh = () => __awaiter(this, void 0, void 0, function* () {
|
44
130
|
const { token } = yield this.client.fetch("/auth/token/refresh", {
|
45
131
|
method: "POST",
|
@@ -49,6 +135,16 @@ export class Auth {
|
|
49
135
|
yield this.setToken_(token);
|
50
136
|
return token;
|
51
137
|
});
|
138
|
+
/**
|
139
|
+
* This method deletes the authentication session of the currently logged-in user to log them out.
|
140
|
+
* It sends a request to the [Delete Authentication Session API route](https://docs.medusajs.com/v2/api/admin#auth_deletesession).
|
141
|
+
*
|
142
|
+
* @example
|
143
|
+
* sdk.auth.logout()
|
144
|
+
* .then(() => {
|
145
|
+
* // user is logged out
|
146
|
+
* })
|
147
|
+
*/
|
52
148
|
this.logout = () => __awaiter(this, void 0, void 0, function* () {
|
53
149
|
var _a, _b;
|
54
150
|
if (((_b = (_a = this.config) === null || _a === void 0 ? void 0 : _a.auth) === null || _b === void 0 ? void 0 : _b.type) === "session") {
|
@@ -58,6 +154,30 @@ export class Auth {
|
|
58
154
|
}
|
59
155
|
this.client.clearToken();
|
60
156
|
});
|
157
|
+
/**
|
158
|
+
* This method requests a reset password token for an admin user, customer, or custom actor type.
|
159
|
+
* It sends a request to the [Generate Reset Password Token API route](https://docs.medusajs.com/v2/api/admin#auth_postactor_typeauth_providerresetpassword).
|
160
|
+
*
|
161
|
+
* To reset the password later using the token delivered to the user, use the {@link updateProvider} method.
|
162
|
+
*
|
163
|
+
* Related guide: [How to allow customers to reset their passwords in a storefront](https://docs.medusajs.com/v2/resources/storefront-development/customers/reset-password).
|
164
|
+
*
|
165
|
+
* @param actor - The actor type. For example, `user` for admin user, or `customer` for customer.
|
166
|
+
* @param provider - The authentication provider to use. For example, `emailpass`.
|
167
|
+
* @param body - The data required to identify the user.
|
168
|
+
*
|
169
|
+
* @example
|
170
|
+
* sdk.auth.resetPassword(
|
171
|
+
* "customer",
|
172
|
+
* "emailpass",
|
173
|
+
* {
|
174
|
+
* identifier: "customer@gmail.com"
|
175
|
+
* }
|
176
|
+
* )
|
177
|
+
* .then(() => {
|
178
|
+
* // user receives token
|
179
|
+
* })
|
180
|
+
*/
|
61
181
|
this.resetPassword = (actor, provider, body) => __awaiter(this, void 0, void 0, function* () {
|
62
182
|
yield this.client.fetch(`/auth/${actor}/${provider}/reset-password`, {
|
63
183
|
method: "POST",
|
@@ -65,12 +185,43 @@ export class Auth {
|
|
65
185
|
headers: { accept: "text/plain" }, // 201 Created response
|
66
186
|
});
|
67
187
|
});
|
188
|
+
/**
|
189
|
+
* This method is used to update user-related data authentication data.
|
190
|
+
*
|
191
|
+
* More specifically, use this method when updating the password of an admin user, customer, or
|
192
|
+
* custom actor type after requesting to reset their password with {@link resetPassword}.
|
193
|
+
*
|
194
|
+
* This method sends a request to [this API route](https://docs.medusajs.com/v2/api/admin#auth_postactor_typeauth_providerupdate).
|
195
|
+
*
|
196
|
+
* Related guide: [How to allow customers to reset their passwords in a storefront](https://docs.medusajs.com/v2/resources/storefront-development/customers/reset-password).
|
197
|
+
*
|
198
|
+
* @param actor - The actor type. For example, `user` for admin user, or `customer` for customer.
|
199
|
+
* @param provider - The authentication provider to use. For example, `emailpass`.
|
200
|
+
* @param body - The data necessary to update the user's authentication data. When resetting the user's password,
|
201
|
+
* send the `email` and `password` properties.
|
202
|
+
*
|
203
|
+
* @example
|
204
|
+
* sdk.auth.updateProvider(
|
205
|
+
* "customer",
|
206
|
+
* "emailpass",
|
207
|
+
* {
|
208
|
+
* email: "customer@gmail.com",
|
209
|
+
* password: "supersecret"
|
210
|
+
* }
|
211
|
+
* )
|
212
|
+
* .then(() => {
|
213
|
+
* // password updated
|
214
|
+
* })
|
215
|
+
*/
|
68
216
|
this.updateProvider = (actor, provider, body) => __awaiter(this, void 0, void 0, function* () {
|
69
217
|
yield this.client.fetch(`/auth/${actor}/${provider}/update`, {
|
70
218
|
method: "POST",
|
71
219
|
body,
|
72
220
|
});
|
73
221
|
});
|
222
|
+
/**
|
223
|
+
* @ignore
|
224
|
+
*/
|
74
225
|
this.setToken_ = (token) => __awaiter(this, void 0, void 0, function* () {
|
75
226
|
var _a, _b;
|
76
227
|
// By default we just set the token in the configured storage, if configured to use sessions we convert it into session storage instead.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/auth/index.ts"],"names":[],"mappings":";;;;;;;;;AAIA,MAAM,OAAO,IAAI;IAIf,YAAY,MAAc,EAAE,MAAc;QAK1C,aAAQ,GAAG,CACT,KAAa,EACb,MAAc,EACd,OAA+C,EAC/C,EAAE;YACF,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CACvC,SAAS,KAAK,IAAI,MAAM,WAAW,EACnC;gBACE,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,OAAO;aACd,CACF,CAAA;YAED,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;YAE3B,OAAO,KAAK,CAAA;QACd,CAAC,CAAA,CAAA;QAED,UAAK,GAAG,CACN,KAAa,EACb,MAAc,EACd,OAAyE,EACzE,EAAE;YACF,oEAAoE;YACpE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAGhD,SAAS,KAAK,IAAI,MAAM,EAAE,EAAE;gBAC7B,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,OAAO;aACd,CAAC,CAAA;YAEF,gFAAgF;YAChF,4EAA4E;YAC5E,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