chore(docs): Generated JS Client Reference (#5334)
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
378ca1b36e
commit
daea35fe73
@@ -1,3 +1,7 @@
|
||||
---
|
||||
displayed_sidebar: jsClientSidebar
|
||||
---
|
||||
|
||||
# Class: AuthResource
|
||||
|
||||
## Hierarchy
|
||||
@@ -10,97 +14,122 @@
|
||||
|
||||
### authenticate
|
||||
|
||||
▸ **authenticate**(`payload`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`StoreAuthRes`](../modules/internal-34.md#storeauthres)\>
|
||||
|
||||
**`Description`**
|
||||
|
||||
Authenticates a customer using email and password combination
|
||||
▸ **authenticate**(`payload`, `customHeaders?`): [`ResponsePromise`](../modules/internal-12.md#responsepromise)<[`StoreAuthRes`](../modules/internal-8.internal.md#storeauthres)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `payload` | [`StorePostAuthReq`](internal-34.StorePostAuthReq.md) | authentication payload |
|
||||
| `customHeaders` | `Record`<`string`, `any`\> | |
|
||||
| `payload` | [`StorePostAuthReq`](internal-8.internal.StorePostAuthReq.md) | authentication payload |
|
||||
| `customHeaders` | [`Record`](../modules/internal.md#record)<`string`, `any`\> | |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ResponsePromise`](../modules/internal.md#responsepromise)<[`StoreAuthRes`](../modules/internal-34.md#storeauthres)\>
|
||||
[`ResponsePromise`](../modules/internal-12.md#responsepromise)<[`StoreAuthRes`](../modules/internal-8.internal.md#storeauthres)\>
|
||||
|
||||
**`Description`**
|
||||
|
||||
Authenticates a customer using email and password combination
|
||||
|
||||
#### Defined in
|
||||
|
||||
[medusa-js/src/resources/auth.ts:16](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/auth.ts#L16)
|
||||
[packages/medusa-js/src/resources/auth.ts:18](https://github.com/medusajs/medusa/blob/c4ac5e6959/packages/medusa-js/src/resources/auth.ts#L18)
|
||||
|
||||
___
|
||||
|
||||
### deleteSession
|
||||
|
||||
▸ **deleteSession**(`customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<`void`\>
|
||||
|
||||
**`Description`**
|
||||
|
||||
Removes authentication session
|
||||
▸ **deleteSession**(`customHeaders?`): [`ResponsePromise`](../modules/internal-12.md#responsepromise)<`void`\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `customHeaders` | `Record`<`string`, `any`\> |
|
||||
| `customHeaders` | [`Record`](../modules/internal.md#record)<`string`, `any`\> |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ResponsePromise`](../modules/internal.md#responsepromise)<`void`\>
|
||||
[`ResponsePromise`](../modules/internal-12.md#responsepromise)<`void`\>
|
||||
|
||||
**`Description`**
|
||||
|
||||
Removes authentication session
|
||||
|
||||
#### Defined in
|
||||
|
||||
[medusa-js/src/resources/auth.ts:25](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/auth.ts#L25)
|
||||
[packages/medusa-js/src/resources/auth.ts:27](https://github.com/medusajs/medusa/blob/c4ac5e6959/packages/medusa-js/src/resources/auth.ts#L27)
|
||||
|
||||
___
|
||||
|
||||
### exists
|
||||
|
||||
▸ **exists**(`email`, `customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`StoreGetAuthEmailRes`](../modules/internal-34.md#storegetauthemailres)\>
|
||||
|
||||
**`Description`**
|
||||
|
||||
Check if email exists
|
||||
▸ **exists**(`email`, `customHeaders?`): [`ResponsePromise`](../modules/internal-12.md#responsepromise)<[`StoreGetAuthEmailRes`](../modules/internal-8.internal.md#storegetauthemailres)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type | Description |
|
||||
| :------ | :------ | :------ |
|
||||
| `email` | `string` | is required |
|
||||
| `customHeaders` | `Record`<`string`, `any`\> | |
|
||||
| `customHeaders` | [`Record`](../modules/internal.md#record)<`string`, `any`\> | |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ResponsePromise`](../modules/internal.md#responsepromise)<[`StoreGetAuthEmailRes`](../modules/internal-34.md#storegetauthemailres)\>
|
||||
[`ResponsePromise`](../modules/internal-12.md#responsepromise)<[`StoreGetAuthEmailRes`](../modules/internal-8.internal.md#storegetauthemailres)\>
|
||||
|
||||
**`Description`**
|
||||
|
||||
Check if email exists
|
||||
|
||||
#### Defined in
|
||||
|
||||
[medusa-js/src/resources/auth.ts:47](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/auth.ts#L47)
|
||||
[packages/medusa-js/src/resources/auth.ts:49](https://github.com/medusajs/medusa/blob/c4ac5e6959/packages/medusa-js/src/resources/auth.ts#L49)
|
||||
|
||||
___
|
||||
|
||||
### getSession
|
||||
|
||||
▸ **getSession**(`customHeaders?`): [`ResponsePromise`](../modules/internal.md#responsepromise)<[`StoreAuthRes`](../modules/internal-34.md#storeauthres)\>
|
||||
▸ **getSession**(`customHeaders?`): [`ResponsePromise`](../modules/internal-12.md#responsepromise)<[`StoreAuthRes`](../modules/internal-8.internal.md#storeauthres)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `customHeaders` | [`Record`](../modules/internal.md#record)<`string`, `any`\> |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ResponsePromise`](../modules/internal-12.md#responsepromise)<[`StoreAuthRes`](../modules/internal-8.internal.md#storeauthres)\>
|
||||
|
||||
**`Description`**
|
||||
|
||||
Retrieves an authenticated session
|
||||
Usually used to check if authenticated session is alive.
|
||||
|
||||
#### Defined in
|
||||
|
||||
[packages/medusa-js/src/resources/auth.ts:38](https://github.com/medusajs/medusa/blob/c4ac5e6959/packages/medusa-js/src/resources/auth.ts#L38)
|
||||
|
||||
___
|
||||
|
||||
### getToken
|
||||
|
||||
▸ **getToken**(`payload`, `customHeaders?`): [`ResponsePromise`](../modules/internal-12.md#responsepromise)<[`StoreBearerAuthRes`](../modules/internal-8.internal.md#storebearerauthres)\>
|
||||
|
||||
#### Parameters
|
||||
|
||||
| Name | Type |
|
||||
| :------ | :------ |
|
||||
| `customHeaders` | `Record`<`string`, `any`\> |
|
||||
| `payload` | [`StorePostAuthReq`](internal-8.internal.StorePostAuthReq.md) |
|
||||
| `customHeaders` | [`Record`](../modules/internal.md#record)<`string`, `any`\> |
|
||||
|
||||
#### Returns
|
||||
|
||||
[`ResponsePromise`](../modules/internal.md#responsepromise)<[`StoreAuthRes`](../modules/internal-34.md#storeauthres)\>
|
||||
[`ResponsePromise`](../modules/internal-12.md#responsepromise)<[`StoreBearerAuthRes`](../modules/internal-8.internal.md#storebearerauthres)\>
|
||||
|
||||
**`Description`**
|
||||
|
||||
Retrieves a new JWT access token
|
||||
|
||||
#### Defined in
|
||||
|
||||
[medusa-js/src/resources/auth.ts:36](https://github.com/medusajs/medusa/blob/29135c051/packages/medusa-js/src/resources/auth.ts#L36)
|
||||
[packages/medusa-js/src/resources/auth.ts:60](https://github.com/medusajs/medusa/blob/c4ac5e6959/packages/medusa-js/src/resources/auth.ts#L60)
|
||||
|
||||
Reference in New Issue
Block a user