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:
@@ -8,9 +8,35 @@ This document is auto-generated from the JSDoc comments in `src/store` by runnin
|
||||
|
||||
Creates a new address for an entity.
|
||||
|
||||
**Parameters**
|
||||
|
||||
| Name | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| `googleAuthId` | `number` | The id of the Google auth user. |
|
||||
| `entityId` | `number` | The id of the entity. |
|
||||
| `input` | `object` | The address input. |
|
||||
| `input.addressType` | `string` | The address type (e.g. `'billing'`). |
|
||||
| `[input.firstName]` | `string` | The first name. |
|
||||
| `[input.name]` | `string` | The name. |
|
||||
| `[input.street]` | `string` | The street. |
|
||||
| `[input.streetNumber]` | `string` | The street number. |
|
||||
| `[input.zip]` | `string` | The zip code. |
|
||||
| `[input.city]` | `string` | The city. |
|
||||
| `[input.county]` | `string` | The county. |
|
||||
| `[input.sort]` | `number` | Optional sort order. |
|
||||
|
||||
**Returns**
|
||||
|
||||
`Promise<object>` — The created address.
|
||||
|
||||
**Throws**
|
||||
|
||||
`Error` — If the address type is missing.
|
||||
|
||||
**Example**
|
||||
|
||||
```js
|
||||
const fn = create(pool);
|
||||
const address = await fn(42, 5, { addressType: 'billing', street: 'Main St', city: 'Berlin' });
|
||||
const address = await store.entityaddress.create(42, 5, { addressType: 'billing', street: 'Main St', city: 'Berlin' });
|
||||
// => { id, entityId, firstName, name, street, streetNumber, zip, city, county, addressType, sort }
|
||||
```
|
||||
|
||||
@@ -20,9 +46,26 @@ const address = await fn(42, 5, { addressType: 'billing', street: 'Main St', cit
|
||||
|
||||
Deletes an address of an entity.
|
||||
|
||||
**Parameters**
|
||||
|
||||
| Name | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| `googleAuthId` | `number` | The id of the Google auth user. |
|
||||
| `entityId` | `number` | The id of the entity. |
|
||||
| `id` | `number` | The id of the address to delete. |
|
||||
|
||||
**Returns**
|
||||
|
||||
`Promise<void>`
|
||||
|
||||
**Throws**
|
||||
|
||||
`Error` — If the address is not found.
|
||||
|
||||
**Example**
|
||||
|
||||
```js
|
||||
const fn = del(pool);
|
||||
await fn(42, 5, 9);
|
||||
await store.entityaddress.delete(42, 5, 9);
|
||||
```
|
||||
|
||||
## `entityaddress.list`
|
||||
@@ -31,9 +74,21 @@ await fn(42, 5, 9);
|
||||
|
||||
Lists the addresses of an entity.
|
||||
|
||||
**Parameters**
|
||||
|
||||
| Name | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| `googleAuthId` | `number` | The id of the Google auth user. |
|
||||
| `entityId` | `number` | The id of the entity. |
|
||||
|
||||
**Returns**
|
||||
|
||||
`Promise<Array<object>>` — The addresses.
|
||||
|
||||
**Example**
|
||||
|
||||
```js
|
||||
const fn = list(pool);
|
||||
const addresses = await fn(42, 5);
|
||||
const addresses = await store.entityaddress.list(42, 5);
|
||||
// => [{ id, entityId, firstName, name, street, streetNumber, zip, city, county, addressType, sort }]
|
||||
```
|
||||
|
||||
@@ -43,8 +98,26 @@ const addresses = await fn(42, 5);
|
||||
|
||||
Updates an address of an entity.
|
||||
|
||||
**Parameters**
|
||||
|
||||
| Name | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| `googleAuthId` | `number` | The id of the Google auth user. |
|
||||
| `entityId` | `number` | The id of the entity. |
|
||||
| `id` | `number` | The id of the address to update. |
|
||||
| `patch` | `object` | The update patch (any subset of address fields). |
|
||||
|
||||
**Returns**
|
||||
|
||||
`Promise<object>` — The updated address.
|
||||
|
||||
**Throws**
|
||||
|
||||
`Error` — If the address is not found.
|
||||
|
||||
**Example**
|
||||
|
||||
```js
|
||||
const fn = update(pool);
|
||||
const address = await fn(42, 5, 9, { city: 'Hamburg' });
|
||||
const address = await store.entityaddress.update(42, 5, 9, { city: 'Hamburg' });
|
||||
// => { id, entityId, firstName, name, street, streetNumber, zip, city, county, addressType, sort }
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user