Skip to content

Commit

Permalink
update link
Browse files Browse the repository at this point in the history
  • Loading branch information
pilcrowonpaper committed Oct 25, 2024
1 parent 4c7867d commit a198864
Show file tree
Hide file tree
Showing 47 changed files with 119 additions and 119 deletions.
2 changes: 1 addition & 1 deletion docs/malta.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"title": "API reference",
"pages": [
["Rest API", "/api-reference/rest"],
["JavaScript SDK", "/api-reference/js"]
["JavaScript SDK", "/api-reference/sdk-js"]
]
},
{
Expand Down
72 changes: 0 additions & 72 deletions docs/pages/api-reference/js/main/Faroe/index.md

This file was deleted.

30 changes: 0 additions & 30 deletions docs/pages/api-reference/js/main/index.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ npm install @faroe/sdk

## Modules

- [`@faroe/sdk`](/api-reference/js/main)
- [`@faroe/sdk`](/api-reference/sdk-js/main)
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Authenticates a user with email and password. It will temporary block the IP add
## Definition

```ts
//$ FaroeUser=/api-reference/js/main/FaroeUser
//$ FaroeUser=/api-reference/sdk-js/main/FaroeUser
async function authenticateWithPassword(
email: string,
password: string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Send the created reset request's code to the email address.
## Definition

```ts
//$ FaroePasswordResetRequest=/api-reference/js/main/$$FaroePasswordResetRequest
//$ FaroePasswordResetRequest=/api-reference/sdk-js/main/$$FaroePasswordResetRequest
async function createPasswordResetRequest(
email: string,
clientIP: string | null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ We highly recommend putting a Captcha or equivalent in front for spam and bot de
## Definition

```ts
//$ FaroeUser=/api-reference/js/main/FaroeUser
//$ FaroeUser=/api-reference/sdk-js/main/FaroeUser
async function createUser(
email: string,
password: string,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Creates a new email verification request for a user. This can only be called 3 t
## Definition

```ts
//$ $$FaroeEmailUpdateRequest=/api-reference/js/main/$$FaroeEmailUpdateRequest
//$ $$FaroeEmailUpdateRequest=/api-reference/sdk-js/main/$$FaroeEmailUpdateRequest
async function createUserEmailUpdateRequest(
userId: string,
email: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Creates a new email verification request for a user. This can only be called 3 t
## Definition

```ts
//$ FaroeUserEmailVerificationRequest=/api-reference/js/main/FaroeUserEmailVerificationRequest
//$ FaroeUserEmailVerificationRequest=/api-reference/sdk-js/main/FaroeUserEmailVerificationRequest
async function createUserEmailVerificationRequest(
userId: string
): Promise<$$FaroeUserEmailVerificationRequest>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Gets a email update request. Returns `null` if the request doesn't exist or has
## Definition

```ts
//$ FaroeEmailUpdateRequest=/api-reference/js/main/FaroeEmailUpdateRequest
//$ FaroeEmailUpdateRequest=/api-reference/sdk-js/main/FaroeEmailUpdateRequest
async function getEmailUpdateRequest(
requestId: string
): Promise<$$FaroeEmailUpdateRequest | null>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Gets a password reset request. Returns `null` if the request doesn't exist.
## Definition

```ts
//$ FaroePasswordResetRequest=/api-reference/js/main/FaroePasswordResetRequest
//$ FaroePasswordResetRequest=/api-reference/sdk-js/main/FaroePasswordResetRequest
async function getPasswordResetRequest(
requestId: string
): Promise<$$FaroePasswordResetRequest | null>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Gets a user. Returns `null` if the user doesn't exist.
## Definition

```ts
//$ FaroeUser=/api-reference/js/main/FaroeUser
//$ FaroeUser=/api-reference/sdk-js/main/FaroeUser
async function getUser(userId: string): Promise<$$FaroeUser | null>
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Gets an array of a user's valid email update requests. Returns an empty array if
## Definition

```ts
//$ FaroeEmailUpdateRequest=/api-reference/js/main/FaroeEmailUpdateRequest
//$ FaroeEmailUpdateRequest=/api-reference/sdk-js/main/FaroeEmailUpdateRequest
async function getUserEmailUpdateRequests(
userId: string
): Promise<$$FaroeEmailUpdateRequest[] | null>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Gets a user's email verification request. Returns `null` if the request doesn't
## Definition

```ts
//$ FaroeUserEmailVerificationRequest=/api-reference/js/main/FaroeUserEmailVerificationRequest
//$ FaroeUserEmailVerificationRequest=/api-reference/sdk-js/main/FaroeUserEmailVerificationRequest
async function getUserEmailVerificationRequest(
userId: string
): Promise<$$FaroeUserEmailVerificationRequest | null>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Gets an array of a user's valid password reset requests. Returns an empty array
## Definition

```ts
//$ FaroePasswordResetRequest=/api-reference/js/main/FaroePasswordResetRequest
//$ FaroePasswordResetRequest=/api-reference/sdk-js/main/FaroePasswordResetRequest
async function getUserPasswordResetRequests(
userId: string
): Promise<$$FaroePasswordResetRequest[] | null>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Gets a user's TOTP credential. Returns `null` if the user doesn't exist or if th
## Definition

```ts
//$ FaroeUserTOTPCredential=/api-reference/js/main/FaroeUserTOTPCredential
//$ FaroeUserTOTPCredential=/api-reference/sdk-js/main/FaroeUserTOTPCredential
async function getUserTOTPCredential(userId: string): Promise<$$FaroeUserTOTPCredential | null>
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Gets an array of users. Returns an empty array if there are no users.
## Definition

```ts
//$ PaginationResult=/api-reference/js/main/PaginationResult
//$ FaroeUser=/api-reference/js/main/FaroeUser
//$ PaginationResult=/api-reference/sdk-js/main/PaginationResult
//$ FaroeUser=/api-reference/sdk-js/main/FaroeUser
async function getUsers(options?: {
sortBy: UserSortBy = UserSortBy.CreatedAt,
sortOrder: SortOrder = SortOrder.Ascending,
Expand Down
72 changes: 72 additions & 0 deletions docs/pages/api-reference/sdk-js/main/Faroe/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
---
title: "Faroe"
---

# Faroe

Represents a Faroe server client.

Server errors are thrown as [`FaroeError`](/api-reference/sdk-js/main/FaroeError). The error code is available from `FaroeError.code`. See each method for a list of possible error codes.

```ts
import { Faroe, FaroeError } from "@faroe/sdk"

const faroe = new Faroe(url, secret);

try {
await faroe.createUser(username, password, clientIP);
} catch (e) {
if (e instanceof FaroeError) {
const errorCode = e.code;
}
}
```

Errors caused by `fetch()` are wrapped as [`FaroeFetchError`](/api-reference/sdk-js/main/FaroeFetchError).

## Constructor

```ts
function constructor(url: string, credential: string): this
```

### Parameters

- `url`: The base URL of the Faroe server (e.g. `https://your-domain.com`).
- `credential`: The server credential.

## Methods

- [`authenticateWithPassword()`](/api-reference/sdk-js/main/Faroe/authenticateWithPassword)
- [`createPasswordResetRequest()`](/api-reference/sdk-js/main/Faroe/createPasswordResetRequest)
- [`createUser()`](/api-reference/sdk-js/main/Faroe/createUser)
- [`createUserEmailVerificationRequest()`](/api-reference/sdk-js/main/Faroe/createUserEmailVerificationRequest)
- [`deletePasswordResetRequest()`](/api-reference/sdk-js/main/Faroe/deletePasswordResetRequest)
- [`deleteUser()`](/api-reference/sdk-js/main/Faroe/deleteUser)
- [`deleteUserEmailUpdateRequests()`](/api-reference/sdk-js/main/Faroe/deleteUserEmailUpdateRequests)
- [`deleteUserEmailVerificationRequest()`](/api-reference/sdk-js/main/Faroe/deleteUserEmailVerificationRequest)
- [`deleteUserPasswordResetRequests()`](/api-reference/sdk-js/main/Faroe/deleteUserPasswordResetRequests)
- [`deleteUserTOTPCredential()`](/api-reference/sdk-js/main/Faroe/deleteUserTOTPCredential)
- [`getPasswordResetRequest()`](/api-reference/sdk-js/main/Faroe/getPasswordResetRequest)
- [`getUser()`](/api-reference/sdk-js/main/Faroe/getUser)
- [`getUserEmailUpdateRequests()`](/api-reference/sdk-js/main/Faroe/getUserEmailUpdateRequests)
- [`getUserEmailVerificationRequest()`](/api-reference/sdk-js/main/Faroe/getUserEmailVerificationRequest)
- [`getUserPasswordResetRequests()`](/api-reference/sdk-js/main/Faroe/getUserPasswordResetRequests)
- [`getUsers()`](/api-reference/sdk-js/main/Faroe/getUsers)
- [`getUserTOTPCredential()`](/api-reference/sdk-js/main/Faroe/getUserTOTPCredential)
- [`regenerateUserRecoveryCode()`](/api-reference/sdk-js/main/Faroe/regenerateUserRecoveryCode)
- [`registerUserTOTPCredential()`](/api-reference/sdk-js/main/Faroe/registerUserTOTPCredential)
- [`resetUser2FA()`](/api-reference/sdk-js/main/Faroe/resetUser2FA)
- [`resetUserPassword()`](/api-reference/sdk-js/main/Faroe/resetUserPassword)
- [`updateUserPassword()`](/api-reference/sdk-js/main/Faroe/updateUserPassword)
- [`verifyPasswordResetRequestEmail()`](/api-reference/sdk-js/main/Faroe/verifyPasswordResetRequestEmail)
- [`verifyUser2FAWithTOTP()`](/api-reference/sdk-js/main/Faroe/verifyUser2FAWithTOTP)
- [`verifyUserEmail()`](/api-reference/sdk-js/main/Faroe/verifyUserEmail)

## Example

```ts
import { Faroe } from "@faroe/sdk"
const faroe = new Faroe("https://your-domain.com", process.env.FAROE_CREDENTIAL);
```
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Registers a TOTP (SHA-1, 6 digits, 30 seconds interval) credential to a user.
## Definition

```ts
//$ FaroeUserTOTPCredential=/api-reference/js/main/FaroeUserTOTPCredential
//$ FaroeUserTOTPCredential=/api-reference/sdk-js/main/FaroeUserTOTPCredential
async function registerUserTOTPCredential(
userId: string,
totpKey: Uint8Array,
Expand Down
30 changes: 30 additions & 0 deletions docs/pages/api-reference/sdk-js/main/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
title: "@faroe/sdk"
---

# @faroe/sdk

## Functions

- [`verifyEmailInput()`](/api-reference/sdk-js/main/verifyEmailInput)
- [`verifyPasswordInput()`](/api-reference/sdk-js/main/verifyPasswordInput)

## Classes

- [`Faroe`](/api-reference/sdk-js/main/Faroe)
- [`FaroeError`](/api-reference/sdk-js/main/FaroeError)
- [`FaroeFetchError`](/api-reference/sdk-js/main/FaroeFetchError)

## Interfaces

- [`FaroeEmailUpdateRequest`](/api-reference/sdk-js/main/FaroeEmailUpdateRequest)
- [`FaroePasswordResetRequest`](/api-reference/sdk-js/main/FaroePasswordResetRequest)
- [`FaroeUserEmailVerificationRequest`](/api-reference/sdk-js/main/FaroeUserEmailVerificationRequest)
- [`FaroeUserTOTPCredential`](/api-reference/sdk-js/main/FaroeUserTOTPCredential)
- [`FaroeUser`](/api-reference/sdk-js/main/FaroeUser)
- [`PaginationResult`](/api-reference/sdk-js/main/PaginationResult)

## Enums

- [`UserSortBy`](/api-reference/sdk-js/main/UserSortBy)
- [`SortOrder`](/api-reference/sdk-js/main/SortOrder)

0 comments on commit a198864

Please sign in to comment.