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:
63
API.brand.md
63
API.brand.md
@@ -6,22 +6,49 @@ This document is auto-generated from the JSDoc comments in `src/store` by runnin
|
||||
|
||||
*Source: `src/store/brand/delete.js`*
|
||||
|
||||
Deletes a brand for a company by its id.
|
||||
Deletes a brand for the user's selected company by its id.
|
||||
|
||||
**Parameters**
|
||||
|
||||
| Name | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| `googleAuthId` | `number` | The id of the Google auth user. |
|
||||
| `id` | `number` | The id of the brand to delete. |
|
||||
|
||||
**Returns**
|
||||
|
||||
`Promise<void>`
|
||||
|
||||
**Throws**
|
||||
|
||||
`Error` — If the brand is not found.
|
||||
|
||||
**Example**
|
||||
|
||||
```js
|
||||
const fn = del(pool);
|
||||
await fn(42, 3);
|
||||
await store.brand.delete(42, 3);
|
||||
```
|
||||
|
||||
## `brand.list`
|
||||
|
||||
*Source: `src/store/brand/list.js`*
|
||||
|
||||
Lists the brands of a company.
|
||||
Lists the brands of the user's selected company.
|
||||
|
||||
**Parameters**
|
||||
|
||||
| Name | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| `googleAuthId` | `number` | The id of the Google auth user. |
|
||||
|
||||
**Returns**
|
||||
|
||||
`Promise<Array<{id: number, name: string, gsprpinfo: string|null}>>` — The brands.
|
||||
|
||||
**Example**
|
||||
|
||||
```js
|
||||
const fn = list(pool);
|
||||
const brands = await fn(42);
|
||||
const brands = await store.brand.list(42);
|
||||
// => [{ id, name, gsprpinfo }]
|
||||
```
|
||||
|
||||
@@ -29,10 +56,28 @@ const brands = await fn(42);
|
||||
|
||||
*Source: `src/store/brand/upsert.js`*
|
||||
|
||||
Creates or updates a brand for a company, keyed by name.
|
||||
Creates or updates a brand for the user's selected company, keyed by name.
|
||||
|
||||
**Parameters**
|
||||
|
||||
| Name | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| `googleAuthId` | `number` | The id of the Google auth user. |
|
||||
| `input` | `object` | The brand input. |
|
||||
| `input.name` | `string` | The brand name. |
|
||||
| `[input.gsprpinfo]` | `string` | Optional GSPRP info. |
|
||||
|
||||
**Returns**
|
||||
|
||||
`Promise<{id: number, name: string, gsprpinfo: string|null}>` — The upserted brand.
|
||||
|
||||
**Throws**
|
||||
|
||||
`Error` — If the brand is invalid.
|
||||
|
||||
**Example**
|
||||
|
||||
```js
|
||||
const fn = upsert(pool);
|
||||
const brand = await fn(42, { name: 'Coca-Cola', gsprpinfo: 'x' });
|
||||
const brand = await store.brand.upsert(42, { name: 'Coca-Cola', gsprpinfo: 'x' });
|
||||
// => { id, name, gsprpinfo }
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user