Files
dashlibstorage/API.google_auth.md
seb aefd97a171 Rewrite store JSDoc, split quote/order into modules, and generate typed API docs
- Rewrite JSDoc across all store methods to document the actual async
  methods (real params, returns, throws) instead of the internal wrappers
- Split quote/order into individual module files backed by shared
  manifestDoc helpers; remove the createStore factory and thin wrappers
- Deduplicate manifest line helpers into src/store/manifestLines.js
- Extend generate-api-doc.js to render parameter/return/throws types and
  emit per-namespace API.<module>.md files with an API.md index
- Regenerate all API docs
2026-08-07 06:23:17 +02:00

165 lines
3.2 KiB
Markdown

# google_auth
This document is auto-generated from the JSDoc comments in `src/store` by running `npm run api-doc`.
## `google_auth.add`
*Source: `src/store/google_auth/add.js`*
Adds a new allowed Google auth email.
**Parameters**
| Name | Type | Description |
| --- | --- | --- |
| `email` | `string` | The email address to allow. |
**Returns**
`Promise<number>` — The id of the created Google auth row.
**Example**
```js
const id = await store.google_auth.add('user@example.com');
// => 1
```
## `google_auth.getByEmail`
*Source: `src/store/google_auth/getByEmail.js`*
Returns a Google auth row by email.
**Parameters**
| Name | Type | Description |
| --- | --- | --- |
| `email` | `string` | The email address. |
**Returns**
`Promise<object|undefined>` — The Google auth row, or `undefined` if not found.
**Example**
```js
const auth = await store.google_auth.getByEmail('user@example.com');
// => { id, email, ... }
```
## `google_auth.getById`
*Source: `src/store/google_auth/getById.js`*
Returns a Google auth row by its id.
**Parameters**
| Name | Type | Description |
| --- | --- | --- |
| `googleAuthId` | `number` | The id of the Google auth row. |
**Returns**
`Promise<object|undefined>` — The Google auth row, or `undefined` if not found.
**Example**
```js
const auth = await store.google_auth.getById(42);
// => { id, email, ... }
```
## `google_auth.listAllowedEmails`
*Source: `src/store/google_auth/listAllowedEmails.js`*
Lists all allowed Google auth emails.
**Returns**
`Promise<Array<{id: number, email: string}>>` — The allowed emails.
**Example**
```js
const emails = await store.google_auth.listAllowedEmails();
// => [{ id, email }]
```
## `google_auth.removeAllowedEmail`
*Source: `src/store/google_auth/removeAllowedEmail.js`*
Removes an allowed Google auth email.
**Parameters**
| Name | Type | Description |
| --- | --- | --- |
| `email` | `string` | The email address to remove. |
**Returns**
`Promise<void>`
**Example**
```js
await store.google_auth.removeAllowedEmail('user@example.com');
```
## `google_auth.setProfile`
*Source: `src/store/google_auth/setProfile.js`*
Updates the profile (picture, picture binary, sub) of a Google auth user.
**Parameters**
| Name | Type | Description |
| --- | --- | --- |
| `googleAuthId` | `number` | The id of the Google auth user. |
| `input` | `object` | The profile input. |
| `[input.picture]` | `string` | The picture URL. |
| `[input.pictureBinary]` | `Buffer` | The picture binary. |
| `[input.sub]` | `string` | The Google sub identifier. |
**Returns**
`Promise<void>`
**Throws**
`Error` — If the user is not found or the picture binary is invalid.
**Example**
```js
await store.google_auth.setProfile(42, { picture: 'url', pictureBinary: buffer, sub: 'sub' });
```
## `google_auth.setSelectedCompany`
*Source: `src/store/google_auth/setSelectedCompany.js`*
Sets the currently selected company for a Google auth user.
**Parameters**
| Name | Type | Description |
| --- | --- | --- |
| `googleAuthId` | `number` | The id of the Google auth user. |
| `companyId` | `number` | The id of the company to select. |
**Returns**
`Promise<void>`
**Example**
```js
await store.google_auth.setSelectedCompany(42, 1);
```