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
This commit is contained in:
@@ -6,22 +6,52 @@ This document is auto-generated from the JSDoc comments in `src/store` by runnin
|
||||
|
||||
*Source: `src/store/companysetting/delete.js`*
|
||||
|
||||
Deletes a company setting by key.
|
||||
Deletes a company setting by key for the user's selected company.
|
||||
|
||||
**Parameters**
|
||||
|
||||
| Name | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| `googleAuthId` | `number` | The id of the Google auth user. |
|
||||
| `key` | `string` | The setting key. |
|
||||
|
||||
**Returns**
|
||||
|
||||
`Promise<void>`
|
||||
|
||||
**Throws**
|
||||
|
||||
`Error` — If the setting is not found.
|
||||
|
||||
**Example**
|
||||
|
||||
```js
|
||||
const fn = del(pool);
|
||||
await fn(42, 'theme');
|
||||
await store.companysetting.delete(42, 'theme');
|
||||
```
|
||||
|
||||
## `companysetting.get`
|
||||
|
||||
*Source: `src/store/companysetting/get.js`*
|
||||
|
||||
Returns a single company setting by key.
|
||||
Returns a single company setting by key for the user's selected company.
|
||||
|
||||
**Parameters**
|
||||
|
||||
| Name | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| `googleAuthId` | `number` | The id of the Google auth user. |
|
||||
| `key` | `string` | The setting key. |
|
||||
| `[options]` | `object` | Optional options. |
|
||||
| `[options.frontendOnly]` | `boolean` | Only return the setting if it is frontend-visible. |
|
||||
|
||||
**Returns**
|
||||
|
||||
`Promise<{key: string, value: string, frontend: boolean}|undefined>` — The setting, or `undefined` if not found.
|
||||
|
||||
**Example**
|
||||
|
||||
```js
|
||||
const fn = get(pool);
|
||||
const setting = await fn(42, 'theme');
|
||||
const setting = await store.companysetting.get(42, 'theme');
|
||||
// => { key, value, frontend }
|
||||
```
|
||||
|
||||
@@ -29,11 +59,24 @@ const setting = await fn(42, 'theme');
|
||||
|
||||
*Source: `src/store/companysetting/list.js`*
|
||||
|
||||
Lists the settings of a company, optionally only frontend-visible ones.
|
||||
Lists the settings of the user's selected company, optionally only frontend-visible ones.
|
||||
|
||||
**Parameters**
|
||||
|
||||
| Name | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| `googleAuthId` | `number` | The id of the Google auth user. |
|
||||
| `[options]` | `object` | Optional options. |
|
||||
| `[options.frontendOnly]` | `boolean` | Only return frontend-visible settings. |
|
||||
|
||||
**Returns**
|
||||
|
||||
`Promise<Array<{key: string, value: string, frontend: boolean}>>` — The settings.
|
||||
|
||||
**Example**
|
||||
|
||||
```js
|
||||
const fn = list(pool);
|
||||
const settings = await fn(42, { frontendOnly: true });
|
||||
const settings = await store.companysetting.list(42, { frontendOnly: true });
|
||||
// => [{ key, value, frontend }]
|
||||
```
|
||||
|
||||
@@ -41,10 +84,29 @@ const settings = await fn(42, { frontendOnly: true });
|
||||
|
||||
*Source: `src/store/companysetting/set.js`*
|
||||
|
||||
Sets (upserts) a company setting by key.
|
||||
Sets (upserts) a company setting by key for the user's selected company.
|
||||
|
||||
**Parameters**
|
||||
|
||||
| Name | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| `googleAuthId` | `number` | The id of the Google auth user. |
|
||||
| `input` | `object` | The setting input. |
|
||||
| `input.key` | `string` | The setting key. |
|
||||
| `input.value` | `string` | The setting value. |
|
||||
| `[input.frontend]` | `boolean` | Whether the setting is frontend-visible. |
|
||||
|
||||
**Returns**
|
||||
|
||||
`Promise<{key: string, value: string, frontend: boolean}>` — The upserted setting.
|
||||
|
||||
**Throws**
|
||||
|
||||
`Error` — If the input is invalid.
|
||||
|
||||
**Example**
|
||||
|
||||
```js
|
||||
const fn = set(pool);
|
||||
const setting = await fn(42, { key: 'theme', value: 'dark', frontend: true });
|
||||
const setting = await store.companysetting.set(42, { key: 'theme', value: 'dark', frontend: true });
|
||||
// => { key, value, frontend }
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user