Milestone 2: module/model docs (MD, Sphinx RST, PDF) and work log
74 source modules documented with extracted signatures, JSDoc params, imports, and call graphs. 10 first-class models (PriceRule through StatusResponse) have their own MD/RST/PDF. Sphinx HTML builds from docs/sphinx. Per-module PDFs in docs/modules-pdf and docs/models-pdf. Middleware gates 2–6 and 10 pass on MOCK_VERAE without NATS. Learned: RST includes are relative to the RST file; keep one PDF per module; Add Numbers remains the only push required tomorrow.
This commit is contained in:
parent
b814501441
commit
10c663cc0c
347 changed files with 17200 additions and 14 deletions
71
docs/modules/zappier/accounts.md
Normal file
71
docs/modules/zappier/accounts.md
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
# `zappier/accounts`
|
||||
|
||||
**Package:** `zappier`
|
||||
**Source:** `packages/zappier/src/accounts.ts`
|
||||
**Lines:** 166
|
||||
|
||||
## What this module is
|
||||
|
||||
Implementation module in `zappier`. The tables below are extracted from the source (signatures + JSDoc).
|
||||
|
||||
## Exports
|
||||
|
||||
`hashPassword`, `verifyPassword`, `base32Encode`, `base32Decode`, `hotp`, `totp`, `verifyTotp`, `generateTotpSecret`, `totpUri`, `PortalSession`, `SessionRepo`, `newSessionToken`, `InMemorySessionRepo`
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
| Kind | Name |
|
||||
|------|------|
|
||||
| interface | `PortalSession` |
|
||||
| interface | `SessionRepo` |
|
||||
| class | `InMemorySessionRepo` |
|
||||
|
||||
## Functions
|
||||
|
||||
| Name | Parameters | Param types (JSDoc) | Returns | Calls (same file / helpers) |
|
||||
|------|------------|---------------------|---------|-----------------------------|
|
||||
| `hashPassword` | `password: string` | — | `unknown` | see Call graph |
|
||||
| | _Format: scrypt:N:r:p:<salt b64>:<hash b64>_ | | | |
|
||||
| `verifyPassword` | `password: string, stored: string` | — | `unknown` | see Call graph |
|
||||
| `base32Encode` | `buf: Buffer` | — | `unknown` | see Call graph |
|
||||
| `base32Decode` | `s: string` | — | `unknown` | see Call graph |
|
||||
| `hotp` | `secret: string, counter: number, digits = 6` | — | `unknown` | see Call graph |
|
||||
| `totp` | `secret: string, atMs: number, stepSec = 30, digits = 6` | — | `unknown` | see Call graph |
|
||||
| `verifyTotp` | `secret: string,
|
||||
code: string,
|
||||
atMs: number,
|
||||
window = 1,` | — | `unknown` | see Call graph |
|
||||
| `generateTotpSecret` | `(none)` | — | `unknown` | see Call graph |
|
||||
| | _160-bit secret, base32 without padding (authenticator-app standard)._ | | | |
|
||||
| `totpUri` | `secret: string, email: string, issuer = 'Zappier'` | — | `unknown` | see Call graph |
|
||||
| | _160-bit secret, base32 without padding (authenticator-app standard)._ | | | |
|
||||
| `newSessionToken` | `(none)` | — | `unknown` | see Call graph |
|
||||
| | _Returns the session, or undefined when unknown or expired at nowMs._ | | | |
|
||||
|
||||
## Methods (class / object)
|
||||
|
||||
| Name | Parameters |
|
||||
|------|------------|
|
||||
| `create` | `customerId: string, ttlMs: number` |
|
||||
| `get` | `token: string, nowMs?: number` |
|
||||
| `delete` | `token: string` |
|
||||
| `create` | `customerId: string, ttlMs: number` |
|
||||
| `get` | `token: string, nowMs = Date.now(` |
|
||||
| `delete` | `token: string` |
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
- `crypto`
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`hashing`, `secrets`, `hashPassword`, `randomBytes`, `scryptSync`, `toString`, `verifyPassword`, `split`, `from`, `timingSafeEqual`, `base32`, `base32Encode`, `base32Decode`, `toUpperCase`, `replace`, `indexOf`, `push`, `hotp`, `alloc`, `writeBigUInt64BE`, `createHmac`, `update`, `digest`, `padStart`, `totp`, `floor`, `verifyTotp`, `test`, `padding`, `generateTotpSecret`, `totpUri`, `encodeURIComponent`, `create`, `get`, `delete`, `newSessionToken`, `now`, `set`
|
||||
|
||||
Each identifier is a call site in this file. Follow the import list to see the defining module; open that module’s MD for parameter and return types.
|
||||
|
||||
## Return values (how to read this)
|
||||
|
||||
- HTTP route handlers return Express `res.json(...)` bodies (see route docs).
|
||||
- Zapier `perform` functions return a **single object** (creates) or an **array** (triggers/searches).
|
||||
- Pricing functions return integer **cents** on `Quote.totalCents`.
|
||||
|
||||
59
docs/modules/zappier/admin-users.md
Normal file
59
docs/modules/zappier/admin-users.md
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
# `zappier/admin-users`
|
||||
|
||||
**Package:** `zappier`
|
||||
**Source:** `packages/zappier/src/admin-users.ts`
|
||||
**Lines:** 76
|
||||
|
||||
## What this module is
|
||||
|
||||
Implementation module in `zappier`. The tables below are extracted from the source (signatures + JSDoc).
|
||||
|
||||
## Exports
|
||||
|
||||
`AdminUser`, `AdminUserRepo`, `newAdminUserId`, `seedAdminUsersFromEnv`, `makeAdminUser`, `InMemoryAdminUserRepo`
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
| Kind | Name |
|
||||
|------|------|
|
||||
| interface | `AdminUser` |
|
||||
| interface | `AdminUserRepo` |
|
||||
| class | `InMemoryAdminUserRepo` |
|
||||
|
||||
## Functions
|
||||
|
||||
| Name | Parameters | Param types (JSDoc) | Returns | Calls (same file / helpers) |
|
||||
|------|------------|---------------------|---------|-----------------------------|
|
||||
| `newAdminUserId` | `(none)` | — | `unknown` | see Call graph |
|
||||
| `seedAdminUsersFromEnv` | `(none)` | — | `unknown` | see Call graph |
|
||||
| | _The env-backed seed accounts (preserved from the pre-table behavior)._ | | | |
|
||||
| `makeAdminUser` | `username: string, password: string` | — | `unknown` | see Call graph |
|
||||
|
||||
## Methods (class / object)
|
||||
|
||||
| Name | Parameters |
|
||||
|------|------------|
|
||||
| `list` | `(none)` |
|
||||
| `findByUsername` | `username: string` |
|
||||
| `save` | `user: AdminUser` |
|
||||
| `list` | `(none)` |
|
||||
| `findByUsername` | `username: string` |
|
||||
| `save` | `user: AdminUser` |
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
- `crypto`
|
||||
- `./accounts`
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`list`, `findByUsername`, `save`, `newAdminUserId`, `randomBytes`, `toString`, `accounts`, `seedAdminUsersFromEnv`, `makeAdminUser`, `hashPassword`, `now`, `constructor`, `map`, `seeded`, `find`, `findIndex`, `push`
|
||||
|
||||
Each identifier is a call site in this file. Follow the import list to see the defining module; open that module’s MD for parameter and return types.
|
||||
|
||||
## Return values (how to read this)
|
||||
|
||||
- HTTP route handlers return Express `res.json(...)` bodies (see route docs).
|
||||
- Zapier `perform` functions return a **single object** (creates) or an **array** (triggers/searches).
|
||||
- Pricing functions return integer **cents** on `Quote.totalCents`.
|
||||
|
||||
73
docs/modules/zappier/admin.md
Normal file
73
docs/modules/zappier/admin.md
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
# `zappier/admin`
|
||||
|
||||
**Package:** `zappier`
|
||||
**Source:** `packages/zappier/src/admin.ts`
|
||||
**Lines:** 486
|
||||
|
||||
## What this module is
|
||||
|
||||
Implementation module in `zappier`. The tables below are extracted from the source (signatures + JSDoc).
|
||||
|
||||
## Exports
|
||||
|
||||
`adminLoginRouter`, `adminAuth`, `AccountingDeps`, `renderInvoiceHtml`, `adminRouter`
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
| Kind | Name |
|
||||
|------|------|
|
||||
| interface | `AccountingDeps` |
|
||||
|
||||
## Functions
|
||||
|
||||
| Name | Parameters | Param types (JSDoc) | Returns | Calls (same file / helpers) |
|
||||
|------|------------|---------------------|---------|-----------------------------|
|
||||
| `adminLoginRouter` | `users: AdminUserRepo` | — | `unknown` | see Call graph |
|
||||
| `adminAuth` | `(none)` | — | `unknown` | see Call graph |
|
||||
| `isValidRule` | `rule: unknown` | — | `unknown` | see Call graph |
|
||||
| `isValidTier` | `tier: unknown` | — | `unknown` | see Call graph |
|
||||
| `periodWindow` | `period: string` | — | `unknown` | see Call graph |
|
||||
| `parseDate` | `value: unknown` | — | `unknown` | see Call graph |
|
||||
| `escapeHtml` | `s: string` | — | `unknown` | see Call graph |
|
||||
| `renderInvoiceHtml` | `invoice: Invoice, customerName: string` | — | `unknown` | see Call graph |
|
||||
| `adminRouter` | `store: PricingStore,
|
||||
customers: CustomerRepo,
|
||||
accounting: AccountingDeps,` | — | `unknown` | see Call graph |
|
||||
|
||||
## Methods (class / object)
|
||||
|
||||
| Name | Parameters |
|
||||
|------|------------|
|
||||
| `return` | `req, res, next` |
|
||||
| `return` | `typeof t.name === 'string' &&
|
||||
typeof t.multiplier === 'number' &&
|
||||
typeof t.monthlyCreditCents === 'number' &&
|
||||
(t.defaultRule === undefined || isValidRule(t.defaultRule` |
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
- `crypto`
|
||||
- `fs`
|
||||
- `path`
|
||||
- `express`
|
||||
- `./accounts`
|
||||
- `./admin-users`
|
||||
- `./auth`
|
||||
- `./invoicing`
|
||||
- `./pricing`
|
||||
- `./paths`
|
||||
- `./reports`
|
||||
- `./usage`
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`tokens`, `adminLoginRouter`, `post`, `status`, `json`, `findByUsername`, `verifyPassword`, `randomBytes`, `toString`, `set`, `now`, `adminAuth`, `header`, `next`, `startsWith`, `slice`, `has`, `isValidRule`, `every`, `isValidTier`, `periodWindow`, `split`, `map`, `parseDate`, `trim`, `isNaN`, `getTime`, `escapeHtml`, `replace`, `toFixed`, `renderInvoiceHtml`, `dollars`, `join`, `toISOString`, `toUpperCase`, `adminRouter`, `get`, `getRateCard`, `getTiers`, `put`, `upsertEndpoint`, `delete`, `deleteEndpoint`, `upsertTier`, `deleteTier`, `list`, `randomUUID`, `save`, `find`, `test`, `push`, `listFor`, `filter`, `buildInvoice`, `nextSequence`, `type`, `send`, `untouched`, `flatMap`, `billingRows`
|
||||
|
||||
Each identifier is a call site in this file. Follow the import list to see the defining module; open that module’s MD for parameter and return types.
|
||||
|
||||
## Return values (how to read this)
|
||||
|
||||
- HTTP route handlers return Express `res.json(...)` bodies (see route docs).
|
||||
- Zapier `perform` functions return a **single object** (creates) or an **array** (triggers/searches).
|
||||
- Pricing functions return integer **cents** on `Quote.totalCents`.
|
||||
|
||||
59
docs/modules/zappier/app.md
Normal file
59
docs/modules/zappier/app.md
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
# `zappier/app`
|
||||
|
||||
**Package:** `zappier`
|
||||
**Source:** `packages/zappier/src/app.ts`
|
||||
**Lines:** 203
|
||||
|
||||
## What this module is
|
||||
|
||||
Implementation module in `zappier`. The tables below are extracted from the source (signatures + JSDoc).
|
||||
|
||||
## Exports
|
||||
|
||||
`StoredItem`, `DEFAULT_CUSTOMERS`, `AppDeps`, `buildApp`
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
| Kind | Name |
|
||||
|------|------|
|
||||
| interface | `StoredItem` |
|
||||
| interface | `AppDeps` |
|
||||
|
||||
## Functions
|
||||
|
||||
| Name | Parameters | Param types (JSDoc) | Returns | Calls (same file / helpers) |
|
||||
|------|------------|---------------------|---------|-----------------------------|
|
||||
| `buildApp` | `deps: AppDeps = {}` | — | `unknown` | see Call graph |
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
- `path`
|
||||
- `crypto`
|
||||
- `express`
|
||||
- `express-openapi-validator`
|
||||
- `swagger-ui-express`
|
||||
- `yamljs`
|
||||
- `./auth`
|
||||
- `./meter`
|
||||
- `./billing/credit`
|
||||
- `./pricing`
|
||||
- `./usage`
|
||||
- `./admin`
|
||||
- `./admin-users`
|
||||
- `./accounts`
|
||||
- `./invoicing`
|
||||
- `./paths`
|
||||
- `./portal`
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`join`, `next`, `parse`, `status`, `json`, `buildApp`, `seeded`, `seedAdminUsersFromEnv`, `rateCard`, `getRateCard`, `tiers`, `getTiers`, `express`, `use`, `load`, `setup`, `adminLoginRouter`, `adminAuth`, `adminRouter`, `static`, `async`, `import`, `toDataURL`, `portalRouter`, `apiKeyAuth`, `middleware`, `get`, `meter`, `post`, `toUpperCase`, `isFinite`, `randomUUID`, `map`, `toISOString`, `unshift`, `filter`, `setUTCDate`, `setUTCHours`, `summaryFor`, `find`, `applyMonthlyCredit`
|
||||
|
||||
Each identifier is a call site in this file. Follow the import list to see the defining module; open that module’s MD for parameter and return types.
|
||||
|
||||
## Return values (how to read this)
|
||||
|
||||
- HTTP route handlers return Express `res.json(...)` bodies (see route docs).
|
||||
- Zapier `perform` functions return a **single object** (creates) or an **array** (triggers/searches).
|
||||
- Pricing functions return integer **cents** on `Quote.totalCents`.
|
||||
|
||||
60
docs/modules/zappier/auth.md
Normal file
60
docs/modules/zappier/auth.md
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
# `zappier/auth`
|
||||
|
||||
**Package:** `zappier`
|
||||
**Source:** `packages/zappier/src/auth.ts`
|
||||
**Lines:** 84
|
||||
|
||||
## What this module is
|
||||
|
||||
Implementation module in `zappier`. The tables below are extracted from the source (signatures + JSDoc).
|
||||
|
||||
## Exports
|
||||
|
||||
`BillingType`, `Customer`, `CustomerRepo`, `InMemoryCustomerRepo`, `apiKeyAuth`
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
| Kind | Name |
|
||||
|------|------|
|
||||
| interface | `Customer` |
|
||||
| interface | `CustomerRepo` |
|
||||
| type | `BillingType` |
|
||||
| class | `InMemoryCustomerRepo` |
|
||||
|
||||
## Functions
|
||||
|
||||
| Name | Parameters | Param types (JSDoc) | Returns | Calls (same file / helpers) |
|
||||
|------|------------|---------------------|---------|-----------------------------|
|
||||
| `apiKeyAuth` | `repo: CustomerRepo` | — | `unknown` | see Call graph |
|
||||
|
||||
## Methods (class / object)
|
||||
|
||||
| Name | Parameters |
|
||||
|------|------------|
|
||||
| `findByApiKey` | `apiKey: string` |
|
||||
| `findByEmail` | `email: string` |
|
||||
| `list` | `(none)` |
|
||||
| `save` | `customer: Customer` |
|
||||
| `constructor` | `customers: Customer[] = []` |
|
||||
| `findByApiKey` | `apiKey: string` |
|
||||
| `findByEmail` | `email: string` |
|
||||
| `list` | `(none)` |
|
||||
| `save` | `customer: Customer` |
|
||||
| `return` | `req, res, next` |
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
- `express`
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`findByApiKey`, `findByEmail`, `list`, `save`, `constructor`, `arrays`, `map`, `find`, `toLowerCase`, `findIndex`, `push`, `apiKeyAuth`, `header`, `status`, `json`, `next`
|
||||
|
||||
Each identifier is a call site in this file. Follow the import list to see the defining module; open that module’s MD for parameter and return types.
|
||||
|
||||
## Return values (how to read this)
|
||||
|
||||
- HTTP route handlers return Express `res.json(...)` bodies (see route docs).
|
||||
- Zapier `perform` functions return a **single object** (creates) or an **array** (triggers/searches).
|
||||
- Pricing functions return integer **cents** on `Quote.totalCents`.
|
||||
|
||||
44
docs/modules/zappier/billing/credit.md
Normal file
44
docs/modules/zappier/billing/credit.md
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
# `zappier/billing/credit`
|
||||
|
||||
**Package:** `zappier`
|
||||
**Source:** `packages/zappier/src/billing/credit.ts`
|
||||
**Lines:** 20
|
||||
|
||||
## What this module is
|
||||
|
||||
Implementation module in `zappier`. The tables below are extracted from the source (signatures + JSDoc).
|
||||
|
||||
## Exports
|
||||
|
||||
`BilledSummary`, `applyMonthlyCredit`
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
| Kind | Name |
|
||||
|------|------|
|
||||
| interface | `BilledSummary` |
|
||||
|
||||
## Functions
|
||||
|
||||
| Name | Parameters | Param types (JSDoc) | Returns | Calls (same file / helpers) |
|
||||
|------|------------|---------------------|---------|-----------------------------|
|
||||
| `applyMonthlyCredit` | `summary: UsageSummary,
|
||||
tier: TierConfig,` | — | `unknown` | see Call graph |
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
- `../pricing`
|
||||
- `../usage`
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`applyMonthlyCredit`, `min`
|
||||
|
||||
Each identifier is a call site in this file. Follow the import list to see the defining module; open that module’s MD for parameter and return types.
|
||||
|
||||
## Return values (how to read this)
|
||||
|
||||
- HTTP route handlers return Express `res.json(...)` bodies (see route docs).
|
||||
- Zapier `perform` functions return a **single object** (creates) or an **array** (triggers/searches).
|
||||
- Pricing functions return integer **cents** on `Quote.totalCents`.
|
||||
|
||||
43
docs/modules/zappier/billing/reload.md
Normal file
43
docs/modules/zappier/billing/reload.md
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
# `zappier/billing/reload`
|
||||
|
||||
**Package:** `zappier`
|
||||
**Source:** `packages/zappier/src/billing/reload.ts`
|
||||
**Lines:** 32
|
||||
|
||||
## What this module is
|
||||
|
||||
Implementation module in `zappier`. The tables below are extracted from the source (signatures + JSDoc).
|
||||
|
||||
## Exports
|
||||
|
||||
`stripePaymentClient`, `hasRealStripeKey`
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
_None extracted._
|
||||
|
||||
## Functions
|
||||
|
||||
| Name | Parameters | Param types (JSDoc) | Returns | Calls (same file / helpers) |
|
||||
|------|------------|---------------------|---------|-----------------------------|
|
||||
| `stripePaymentClient` | `secretKey: string` | — | `unknown` | see Call graph |
|
||||
| `hasRealStripeKey` | `key: string \| undefined` | — | `unknown` | see Call graph |
|
||||
| | _True when the key looks usable (not empty / not the setup placeholder)._ | | | |
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
- `stripe`
|
||||
- `../portal`
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`confirms`, `stripePaymentClient`, `async`, `create`, `usable`, `hasRealStripeKey`, `startsWith`
|
||||
|
||||
Each identifier is a call site in this file. Follow the import list to see the defining module; open that module’s MD for parameter and return types.
|
||||
|
||||
## Return values (how to read this)
|
||||
|
||||
- HTTP route handlers return Express `res.json(...)` bodies (see route docs).
|
||||
- Zapier `perform` functions return a **single object** (creates) or an **array** (triggers/searches).
|
||||
- Pricing functions return integer **cents** on `Quote.totalCents`.
|
||||
|
||||
60
docs/modules/zappier/billing/stripe.md
Normal file
60
docs/modules/zappier/billing/stripe.md
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
# `zappier/billing/stripe`
|
||||
|
||||
**Package:** `zappier`
|
||||
**Source:** `packages/zappier/src/billing/stripe.ts`
|
||||
**Lines:** 42
|
||||
|
||||
## What this module is
|
||||
|
||||
Implementation module in `zappier`. The tables below are extracted from the source (signatures + JSDoc).
|
||||
|
||||
## Exports
|
||||
|
||||
`METER_EVENT_NAME`, `MeterEventClient`, `computeBillableCents`, `computeDelta`, `reportUsage`
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
| Kind | Name |
|
||||
|------|------|
|
||||
| interface | `MeterEventClient` |
|
||||
|
||||
## Functions
|
||||
|
||||
| Name | Parameters | Param types (JSDoc) | Returns | Calls (same file / helpers) |
|
||||
|------|------------|---------------------|---------|-----------------------------|
|
||||
| `computeBillableCents` | `entries: UsageEntry[], monthlyCreditCents: number` | — | `unknown` | see Call graph |
|
||||
| | _Stripe-side dedup key; events with the same identifier are dropped._ | | | |
|
||||
| `computeDelta` | `billableCents: number, previouslyReportedCents: number` | — | `unknown` | see Call graph |
|
||||
| `reportUsage` | `client: MeterEventClient,
|
||||
stripeCustomerId: string,
|
||||
entries: UsageEntry[],
|
||||
monthlyCreditCents: number,` | — | `unknown` | see Call graph |
|
||||
|
||||
## Methods (class / object)
|
||||
|
||||
| Name | Parameters |
|
||||
|------|------------|
|
||||
| `createMeterEvent` | `params: {
|
||||
eventName: string;
|
||||
customerId: string;
|
||||
value: string;
|
||||
/** Stripe-side dedup key; events with the same identifier are dropped. */
|
||||
identifier?: string;
|
||||
}` |
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
- `../usage`
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`createMeterEvent`, `computeBillableCents`, `reduce`, `max`, `computeDelta`, `ts`, `reportUsage`
|
||||
|
||||
Each identifier is a call site in this file. Follow the import list to see the defining module; open that module’s MD for parameter and return types.
|
||||
|
||||
## Return values (how to read this)
|
||||
|
||||
- HTTP route handlers return Express `res.json(...)` bodies (see route docs).
|
||||
- Zapier `perform` functions return a **single object** (creates) or an **array** (triggers/searches).
|
||||
- Pricing functions return integer **cents** on `Quote.totalCents`.
|
||||
|
||||
51
docs/modules/zappier/db/admin-user-repo.md
Normal file
51
docs/modules/zappier/db/admin-user-repo.md
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
# `zappier/db/admin-user-repo`
|
||||
|
||||
**Package:** `zappier`
|
||||
**Source:** `packages/zappier/src/db/admin-user-repo.ts`
|
||||
**Lines:** 72
|
||||
|
||||
## What this module is
|
||||
|
||||
Implementation module in `zappier`. The tables below are extracted from the source (signatures + JSDoc).
|
||||
|
||||
## Exports
|
||||
|
||||
`SqliteAdminUserRepo`
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
| Kind | Name |
|
||||
|------|------|
|
||||
| class | `SqliteAdminUserRepo` |
|
||||
|
||||
## Functions
|
||||
|
||||
| Name | Parameters | Param types (JSDoc) | Returns | Calls (same file / helpers) |
|
||||
|------|------------|---------------------|---------|-----------------------------|
|
||||
| `toAdminUser` | `r: Record<string, unknown>` | — | `unknown` | see Call graph |
|
||||
|
||||
## Methods (class / object)
|
||||
|
||||
| Name | Parameters |
|
||||
|------|------------|
|
||||
| `list` | `(none)` |
|
||||
| `findByUsername` | `username: string` |
|
||||
| `save` | `user: AdminUser` |
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
- `better-sqlite3`
|
||||
- `../admin-users`
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`constructor`, `exec`, `admin_users`, `seeded`, `prepare`, `get`, `save`, `makeAdminUser`, `list`, `all`, `map`, `findByUsername`, `toAdminUser`, `run`
|
||||
|
||||
Each identifier is a call site in this file. Follow the import list to see the defining module; open that module’s MD for parameter and return types.
|
||||
|
||||
## Return values (how to read this)
|
||||
|
||||
- HTTP route handlers return Express `res.json(...)` bodies (see route docs).
|
||||
- Zapier `perform` functions return a **single object** (creates) or an **array** (triggers/searches).
|
||||
- Pricing functions return integer **cents** on `Quote.totalCents`.
|
||||
|
||||
57
docs/modules/zappier/db/billing-repo.md
Normal file
57
docs/modules/zappier/db/billing-repo.md
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
# `zappier/db/billing-repo`
|
||||
|
||||
**Package:** `zappier`
|
||||
**Source:** `packages/zappier/src/db/billing-repo.ts`
|
||||
**Lines:** 69
|
||||
|
||||
## What this module is
|
||||
|
||||
Implementation module in `zappier`. The tables below are extracted from the source (signatures + JSDoc).
|
||||
|
||||
## Exports
|
||||
|
||||
`BillingReportRepo`, `JobLockRepo`, `SqliteBillingReportRepo`
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
| Kind | Name |
|
||||
|------|------|
|
||||
| interface | `BillingReportRepo` |
|
||||
| interface | `JobLockRepo` |
|
||||
| class | `SqliteBillingReportRepo` |
|
||||
|
||||
## Functions
|
||||
|
||||
_No top-level functions extracted._
|
||||
|
||||
## Methods (class / object)
|
||||
|
||||
| Name | Parameters |
|
||||
|------|------------|
|
||||
| `getReportedCents` | `customerId: string, period: string` |
|
||||
| `upsertReportedCents` | `customerId: string, period: string, cumulativeCents: number` |
|
||||
| `tryAcquireLock` | `name: string, ttlMs: number` |
|
||||
| `releaseLock` | `name: string` |
|
||||
| `constructor` | `private db: Database.Database,
|
||||
private now: (` |
|
||||
| `getReportedCents` | `customerId: string, period: string` |
|
||||
| `upsertReportedCents` | `customerId: string, period: string, cumulativeCents: number` |
|
||||
| `tryAcquireLock` | `name: string, ttlMs: number` |
|
||||
| `releaseLock` | `name: string` |
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
- `better-sqlite3`
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`getReportedCents`, `upsertReportedCents`, `tryAcquireLock`, `releaseLock`, `constructor`, `exec`, `billing_reports`, `job_locks`, `prepare`, `get`, `run`, `now`
|
||||
|
||||
Each identifier is a call site in this file. Follow the import list to see the defining module; open that module’s MD for parameter and return types.
|
||||
|
||||
## Return values (how to read this)
|
||||
|
||||
- HTTP route handlers return Express `res.json(...)` bodies (see route docs).
|
||||
- Zapier `perform` functions return a **single object** (creates) or an **array** (triggers/searches).
|
||||
- Pricing functions return integer **cents** on `Quote.totalCents`.
|
||||
|
||||
53
docs/modules/zappier/db/customer-repo.md
Normal file
53
docs/modules/zappier/db/customer-repo.md
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
# `zappier/db/customer-repo`
|
||||
|
||||
**Package:** `zappier`
|
||||
**Source:** `packages/zappier/src/db/customer-repo.ts`
|
||||
**Lines:** 113
|
||||
|
||||
## What this module is
|
||||
|
||||
Implementation module in `zappier`. The tables below are extracted from the source (signatures + JSDoc).
|
||||
|
||||
## Exports
|
||||
|
||||
`SqliteCustomerRepo`
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
| Kind | Name |
|
||||
|------|------|
|
||||
| class | `SqliteCustomerRepo` |
|
||||
|
||||
## Functions
|
||||
|
||||
| Name | Parameters | Param types (JSDoc) | Returns | Calls (same file / helpers) |
|
||||
|------|------------|---------------------|---------|-----------------------------|
|
||||
| `toCustomer` | `r: Record<string, unknown>` | — | `unknown` | see Call graph |
|
||||
|
||||
## Methods (class / object)
|
||||
|
||||
| Name | Parameters |
|
||||
|------|------------|
|
||||
| `constructor` | `private db: Database.Database, seed: Customer[] = []` |
|
||||
| `findByApiKey` | `apiKey: string` |
|
||||
| `findByEmail` | `email: string` |
|
||||
| `list` | `(none)` |
|
||||
| `save` | `customer: Customer` |
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
- `better-sqlite3`
|
||||
- `../auth`
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`constructor`, `exec`, `customers`, `ensureColumn`, `prepare`, `get`, `save`, `table_info`, `all`, `some`, `findByApiKey`, `toCustomer`, `findByEmail`, `lower`, `list`, `map`, `run`
|
||||
|
||||
Each identifier is a call site in this file. Follow the import list to see the defining module; open that module’s MD for parameter and return types.
|
||||
|
||||
## Return values (how to read this)
|
||||
|
||||
- HTTP route handlers return Express `res.json(...)` bodies (see route docs).
|
||||
- Zapier `perform` functions return a **single object** (creates) or an **array** (triggers/searches).
|
||||
- Pricing functions return integer **cents** on `Quote.totalCents`.
|
||||
|
||||
51
docs/modules/zappier/db/invoice-repo.md
Normal file
51
docs/modules/zappier/db/invoice-repo.md
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
# `zappier/db/invoice-repo`
|
||||
|
||||
**Package:** `zappier`
|
||||
**Source:** `packages/zappier/src/db/invoice-repo.ts`
|
||||
**Lines:** 120
|
||||
|
||||
## What this module is
|
||||
|
||||
Implementation module in `zappier`. The tables below are extracted from the source (signatures + JSDoc).
|
||||
|
||||
## Exports
|
||||
|
||||
`SqliteInvoiceRepo`
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
| Kind | Name |
|
||||
|------|------|
|
||||
| class | `SqliteInvoiceRepo` |
|
||||
|
||||
## Functions
|
||||
|
||||
_No top-level functions extracted._
|
||||
|
||||
## Methods (class / object)
|
||||
|
||||
| Name | Parameters |
|
||||
|------|------------|
|
||||
| `constructor` | `private db: Database.Database` |
|
||||
| `save` | `invoice: Invoice` |
|
||||
| `get` | `id: string` |
|
||||
| `list` | `filter: { customerId?: string; period?: string; status?: Invoice['status'] }` |
|
||||
| `nextSequence` | `period: string` |
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
- `better-sqlite3`
|
||||
- `../invoicing`
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`constructor`, `exec`, `invoices`, `invoice_lines`, `save`, `prepare`, `run`, `get`, `toInvoice`, `list`, `push`, `join`, `all`, `map`, `nextSequence`
|
||||
|
||||
Each identifier is a call site in this file. Follow the import list to see the defining module; open that module’s MD for parameter and return types.
|
||||
|
||||
## Return values (how to read this)
|
||||
|
||||
- HTTP route handlers return Express `res.json(...)` bodies (see route docs).
|
||||
- Zapier `perform` functions return a **single object** (creates) or an **array** (triggers/searches).
|
||||
- Pricing functions return integer **cents** on `Quote.totalCents`.
|
||||
|
||||
55
docs/modules/zappier/db/pricing-store.md
Normal file
55
docs/modules/zappier/db/pricing-store.md
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
# `zappier/db/pricing-store`
|
||||
|
||||
**Package:** `zappier`
|
||||
**Source:** `packages/zappier/src/db/pricing-store.ts`
|
||||
**Lines:** 107
|
||||
|
||||
## What this module is
|
||||
|
||||
Implementation module in `zappier`. The tables below are extracted from the source (signatures + JSDoc).
|
||||
|
||||
## Exports
|
||||
|
||||
`SqlitePricingStore`
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
| Kind | Name |
|
||||
|------|------|
|
||||
| class | `SqlitePricingStore` |
|
||||
|
||||
## Functions
|
||||
|
||||
_No top-level functions extracted._
|
||||
|
||||
## Methods (class / object)
|
||||
|
||||
| Name | Parameters |
|
||||
|------|------------|
|
||||
| `constructor` | `private db: Database.Database,
|
||||
seedCard: RateCard = DEFAULT_RATE_CARD,
|
||||
seedTiers: TierConfig[] = DEFAULT_TIERS,` |
|
||||
| `getRateCard` | `(none)` |
|
||||
| `getTiers` | `(none)` |
|
||||
| `upsertEndpoint` | `endpointId: string, rule: PriceRule` |
|
||||
| `deleteEndpoint` | `endpointId: string` |
|
||||
| `upsertTier` | `tier: TierConfig` |
|
||||
| `deleteTier` | `tierId: string` |
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
- `better-sqlite3`
|
||||
- `../pricing`
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`constructor`, `exec`, `price_endpoints`, `tiers`, `prepare`, `get`, `entries`, `upsertEndpoint`, `upsertTier`, `getRateCard`, `all`, `parse`, `getTiers`, `map`, `run`, `stringify`, `deleteEndpoint`, `deleteTier`
|
||||
|
||||
Each identifier is a call site in this file. Follow the import list to see the defining module; open that module’s MD for parameter and return types.
|
||||
|
||||
## Return values (how to read this)
|
||||
|
||||
- HTTP route handlers return Express `res.json(...)` bodies (see route docs).
|
||||
- Zapier `perform` functions return a **single object** (creates) or an **array** (triggers/searches).
|
||||
- Pricing functions return integer **cents** on `Quote.totalCents`.
|
||||
|
||||
50
docs/modules/zappier/db/session-repo.md
Normal file
50
docs/modules/zappier/db/session-repo.md
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
# `zappier/db/session-repo`
|
||||
|
||||
**Package:** `zappier`
|
||||
**Source:** `packages/zappier/src/db/session-repo.ts`
|
||||
**Lines:** 52
|
||||
|
||||
## What this module is
|
||||
|
||||
Implementation module in `zappier`. The tables below are extracted from the source (signatures + JSDoc).
|
||||
|
||||
## Exports
|
||||
|
||||
`SqliteSessionRepo`
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
| Kind | Name |
|
||||
|------|------|
|
||||
| class | `SqliteSessionRepo` |
|
||||
|
||||
## Functions
|
||||
|
||||
_No top-level functions extracted._
|
||||
|
||||
## Methods (class / object)
|
||||
|
||||
| Name | Parameters |
|
||||
|------|------------|
|
||||
| `constructor` | `private db: Database.Database` |
|
||||
| `create` | `customerId: string, ttlMs: number` |
|
||||
| `get` | `token: string, nowMs = Date.now(` |
|
||||
| `delete` | `token: string` |
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
- `better-sqlite3`
|
||||
- `../accounts`
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`constructor`, `exec`, `portal_sessions`, `create`, `now`, `newSessionToken`, `prepare`, `run`, `get`, `delete`
|
||||
|
||||
Each identifier is a call site in this file. Follow the import list to see the defining module; open that module’s MD for parameter and return types.
|
||||
|
||||
## Return values (how to read this)
|
||||
|
||||
- HTTP route handlers return Express `res.json(...)` bodies (see route docs).
|
||||
- Zapier `perform` functions return a **single object** (creates) or an **array** (triggers/searches).
|
||||
- Pricing functions return integer **cents** on `Quote.totalCents`.
|
||||
|
||||
50
docs/modules/zappier/db/usage-repo.md
Normal file
50
docs/modules/zappier/db/usage-repo.md
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
# `zappier/db/usage-repo`
|
||||
|
||||
**Package:** `zappier`
|
||||
**Source:** `packages/zappier/src/db/usage-repo.ts`
|
||||
**Lines:** 62
|
||||
|
||||
## What this module is
|
||||
|
||||
Implementation module in `zappier`. The tables below are extracted from the source (signatures + JSDoc).
|
||||
|
||||
## Exports
|
||||
|
||||
`SqliteUsageRepo`
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
| Kind | Name |
|
||||
|------|------|
|
||||
| class | `SqliteUsageRepo` |
|
||||
|
||||
## Functions
|
||||
|
||||
_No top-level functions extracted._
|
||||
|
||||
## Methods (class / object)
|
||||
|
||||
| Name | Parameters |
|
||||
|------|------------|
|
||||
| `constructor` | `private db: Database.Database` |
|
||||
| `record` | `entry: UsageEntry` |
|
||||
| `listFor` | `customerId: string, since?: Date` |
|
||||
| `summaryFor` | `customerId: string, since?: Date` |
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
- `better-sqlite3`
|
||||
- `../usage`
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`constructor`, `exec`, `usage_entries`, `record`, `prepare`, `run`, `getTime`, `listFor`, `all`, `map`, `summaryFor`, `summarize`
|
||||
|
||||
Each identifier is a call site in this file. Follow the import list to see the defining module; open that module’s MD for parameter and return types.
|
||||
|
||||
## Return values (how to read this)
|
||||
|
||||
- HTTP route handlers return Express `res.json(...)` bodies (see route docs).
|
||||
- Zapier `perform` functions return a **single object** (creates) or an **array** (triggers/searches).
|
||||
- Pricing functions return integer **cents** on `Quote.totalCents`.
|
||||
|
||||
51
docs/modules/zappier/index.md
Normal file
51
docs/modules/zappier/index.md
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
# `zappier/index`
|
||||
|
||||
**Package:** `zappier`
|
||||
**Source:** `packages/zappier/src/index.ts`
|
||||
**Lines:** 42
|
||||
|
||||
## What this module is
|
||||
|
||||
Implementation module in `zappier`. The tables below are extracted from the source (signatures + JSDoc).
|
||||
|
||||
## Exports
|
||||
|
||||
_No named `export` / `module.exports` keys detected._
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
_None extracted._
|
||||
|
||||
## Functions
|
||||
|
||||
_No top-level functions extracted._
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
- `path`
|
||||
- `better-sqlite3`
|
||||
- `dotenv`
|
||||
- `./app`
|
||||
- `./admin-users`
|
||||
- `./billing/reload`
|
||||
- `./db/admin-user-repo`
|
||||
- `./db/customer-repo`
|
||||
- `./db/invoice-repo`
|
||||
- `./db/pricing-store`
|
||||
- `./db/session-repo`
|
||||
- `./db/usage-repo`
|
||||
- `./paths`
|
||||
- `./portal`
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`loadEnv`, `join`, `seeded`, `seedAdminUsersFromEnv`, `immediately`, `hasRealStripeKey`, `stripePaymentClient`, `async`, `buildApp`, `listen`, `log`
|
||||
|
||||
Each identifier is a call site in this file. Follow the import list to see the defining module; open that module’s MD for parameter and return types.
|
||||
|
||||
## Return values (how to read this)
|
||||
|
||||
- HTTP route handlers return Express `res.json(...)` bodies (see route docs).
|
||||
- Zapier `perform` functions return a **single object** (creates) or an **array** (triggers/searches).
|
||||
- Pricing functions return integer **cents** on `Quote.totalCents`.
|
||||
|
||||
75
docs/modules/zappier/invoicing.md
Normal file
75
docs/modules/zappier/invoicing.md
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
# `zappier/invoicing`
|
||||
|
||||
**Package:** `zappier`
|
||||
**Source:** `packages/zappier/src/invoicing.ts`
|
||||
**Lines:** 107
|
||||
|
||||
## What this module is
|
||||
|
||||
Implementation module in `zappier`. The tables below are extracted from the source (signatures + JSDoc).
|
||||
|
||||
## Exports
|
||||
|
||||
`InvoiceLine`, `Invoice`, `InvoiceRepo`, `InMemoryInvoiceRepo`, `buildInvoice`
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
| Kind | Name |
|
||||
|------|------|
|
||||
| interface | `InvoiceLine` |
|
||||
| interface | `Invoice` |
|
||||
| interface | `InvoiceRepo` |
|
||||
| class | `InMemoryInvoiceRepo` |
|
||||
|
||||
## Functions
|
||||
|
||||
| Name | Parameters | Param types (JSDoc) | Returns | Calls (same file / helpers) |
|
||||
|------|------------|---------------------|---------|-----------------------------|
|
||||
| `buildInvoice` | `args: {
|
||||
customer: Customer;
|
||||
period: string;
|
||||
sequence: number;
|
||||
entries: UsageEntry[];
|
||||
tier: TierConfig;
|
||||
poNumber?: string;
|
||||
}` | — | `unknown` | see Call graph |
|
||||
|
||||
## Methods (class / object)
|
||||
|
||||
| Name | Parameters |
|
||||
|------|------------|
|
||||
| `save` | `invoice: Invoice` |
|
||||
| `get` | `id: string` |
|
||||
| `list` | `filter: {
|
||||
customerId?: string;
|
||||
period?: string;
|
||||
status?: Invoice['status'];
|
||||
}` |
|
||||
| `nextSequence` | `period: string` |
|
||||
| `save` | `invoice: Invoice` |
|
||||
| `get` | `id: string` |
|
||||
| `list` | `filter: {
|
||||
customerId?: string;
|
||||
period?: string;
|
||||
status?: Invoice['status'];
|
||||
}` |
|
||||
| `nextSequence` | `period: string` |
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
- `./auth`
|
||||
- `./pricing`
|
||||
- `./usage`
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`cents`, `save`, `get`, `list`, `nextSequence`, `set`, `map`, `values`, `filter`, `sort`, `localeCompare`, `buildInvoice`, `reduce`, `min`, `padStart`
|
||||
|
||||
Each identifier is a call site in this file. Follow the import list to see the defining module; open that module’s MD for parameter and return types.
|
||||
|
||||
## Return values (how to read this)
|
||||
|
||||
- HTTP route handlers return Express `res.json(...)` bodies (see route docs).
|
||||
- Zapier `perform` functions return a **single object** (creates) or an **array** (triggers/searches).
|
||||
- Pricing functions return integer **cents** on `Quote.totalCents`.
|
||||
|
||||
63
docs/modules/zappier/jobs/report-usage.md
Normal file
63
docs/modules/zappier/jobs/report-usage.md
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
# `zappier/jobs/report-usage`
|
||||
|
||||
**Package:** `zappier`
|
||||
**Source:** `packages/zappier/src/jobs/report-usage.ts`
|
||||
**Lines:** 130
|
||||
|
||||
## What this module is
|
||||
|
||||
Implementation module in `zappier`. The tables below are extracted from the source (signatures + JSDoc).
|
||||
|
||||
## Exports
|
||||
|
||||
`ReportUsageDeps`, `REPORT_USAGE_LOCK`, `firstOfMonthUtc`, `reportMonthlyUsage`
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
| Kind | Name |
|
||||
|------|------|
|
||||
| interface | `ReportUsageDeps` |
|
||||
|
||||
## Functions
|
||||
|
||||
| Name | Parameters | Param types (JSDoc) | Returns | Calls (same file / helpers) |
|
||||
|------|------------|---------------------|---------|-----------------------------|
|
||||
| `firstOfMonthUtc` | `now: Date` | — | `unknown` | see Call graph |
|
||||
| `reportMonthlyUsage` | `deps: ReportUsageDeps` | — | `unknown` | see Call graph |
|
||||
| `main` | `(none)` | — | `unknown` | see Call graph |
|
||||
|
||||
## Methods (class / object)
|
||||
|
||||
| Name | Parameters |
|
||||
|------|------------|
|
||||
| `loadEnv` | `{ path: path.join(PROJECT_ROOT, '.env'` |
|
||||
| `main` | `(none)` |
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
- `better-sqlite3`
|
||||
- `path`
|
||||
- `stripe`
|
||||
- `../app`
|
||||
- `../auth`
|
||||
- `../billing/stripe`
|
||||
- `../db/billing-repo`
|
||||
- `../db/customer-repo`
|
||||
- `../db/pricing-store`
|
||||
- `../db/usage-repo`
|
||||
- `../paths`
|
||||
- `../pricing`
|
||||
- `../usage`
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`firstOfMonthUtc`, `setUTCDate`, `setUTCHours`, `reportMonthlyUsage`, `tryAcquireLock`, `log`, `toISOString`, `slice`, `list`, `find`, `warn`, `listFor`, `computeBillableCents`, `getReportedCents`, `computeDelta`, `createMeterEvent`, `upsertReportedCents`, `releaseLock`, `main`, `import`, `loadEnv`, `join`, `async`, `create`, `getTiers`, `error`, `exit`
|
||||
|
||||
Each identifier is a call site in this file. Follow the import list to see the defining module; open that module’s MD for parameter and return types.
|
||||
|
||||
## Return values (how to read this)
|
||||
|
||||
- HTTP route handlers return Express `res.json(...)` bodies (see route docs).
|
||||
- Zapier `perform` functions return a **single object** (creates) or an **array** (triggers/searches).
|
||||
- Pricing functions return integer **cents** on `Quote.totalCents`.
|
||||
|
||||
50
docs/modules/zappier/meter.md
Normal file
50
docs/modules/zappier/meter.md
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
# `zappier/meter`
|
||||
|
||||
**Package:** `zappier`
|
||||
**Source:** `packages/zappier/src/meter.ts`
|
||||
**Lines:** 49
|
||||
|
||||
## What this module is
|
||||
|
||||
Implementation module in `zappier`. The tables below are extracted from the source (signatures + JSDoc).
|
||||
|
||||
## Exports
|
||||
|
||||
`meter`
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
_None extracted._
|
||||
|
||||
## Functions
|
||||
|
||||
| Name | Parameters | Param types (JSDoc) | Returns | Calls (same file / helpers) |
|
||||
|------|------------|---------------------|---------|-----------------------------|
|
||||
| `meter` | `endpointId: string,
|
||||
repo: UsageRepo,
|
||||
pricing: PricingContext,` | — | `unknown` | see Call graph |
|
||||
|
||||
## Methods (class / object)
|
||||
|
||||
| Name | Parameters |
|
||||
|------|------------|
|
||||
| `return` | `req, res, next` |
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
- `express`
|
||||
- `./pricing`
|
||||
- `./usage`
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`meter`, `status`, `json`, `byteLength`, `stringify`, `reduce`, `quoteCall`, `record`, `next`
|
||||
|
||||
Each identifier is a call site in this file. Follow the import list to see the defining module; open that module’s MD for parameter and return types.
|
||||
|
||||
## Return values (how to read this)
|
||||
|
||||
- HTTP route handlers return Express `res.json(...)` bodies (see route docs).
|
||||
- Zapier `perform` functions return a **single object** (creates) or an **array** (triggers/searches).
|
||||
- Pricing functions return integer **cents** on `Quote.totalCents`.
|
||||
|
||||
38
docs/modules/zappier/paths.md
Normal file
38
docs/modules/zappier/paths.md
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
# `zappier/paths`
|
||||
|
||||
**Package:** `zappier`
|
||||
**Source:** `packages/zappier/src/paths.ts`
|
||||
**Lines:** 10
|
||||
|
||||
## What this module is
|
||||
|
||||
Implementation module in `zappier`. The tables below are extracted from the source (signatures + JSDoc).
|
||||
|
||||
## Exports
|
||||
|
||||
`PROJECT_ROOT`
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
_None extracted._
|
||||
|
||||
## Functions
|
||||
|
||||
_No top-level functions extracted._
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
- `path`
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`directory`, `join`
|
||||
|
||||
Each identifier is a call site in this file. Follow the import list to see the defining module; open that module’s MD for parameter and return types.
|
||||
|
||||
## Return values (how to read this)
|
||||
|
||||
- HTTP route handlers return Express `res.json(...)` bodies (see route docs).
|
||||
- Zapier `perform` functions return a **single object** (creates) or an **array** (triggers/searches).
|
||||
- Pricing functions return integer **cents** on `Quote.totalCents`.
|
||||
|
||||
63
docs/modules/zappier/portal.md
Normal file
63
docs/modules/zappier/portal.md
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
# `zappier/portal`
|
||||
|
||||
**Package:** `zappier`
|
||||
**Source:** `packages/zappier/src/portal.ts`
|
||||
**Lines:** 285
|
||||
|
||||
## What this module is
|
||||
|
||||
Implementation module in `zappier`. The tables below are extracted from the source (signatures + JSDoc).
|
||||
|
||||
## Exports
|
||||
|
||||
`PaymentResult`, `PaymentClient`, `PortalDeps`, `portalRouter`
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
| Kind | Name |
|
||||
|------|------|
|
||||
| interface | `PaymentResult` |
|
||||
| interface | `PaymentClient` |
|
||||
| interface | `PortalDeps` |
|
||||
|
||||
## Functions
|
||||
|
||||
| Name | Parameters | Param types (JSDoc) | Returns | Calls (same file / helpers) |
|
||||
|------|------------|---------------------|---------|-----------------------------|
|
||||
| `publicProfile` | `c: Customer` | — | `unknown` | see Call graph |
|
||||
| | _Profile payload safe to return to the customer (no hashes/secrets)._ | | | |
|
||||
| `sessionAuth` | `deps: PortalDeps` | — | `unknown` | see Call graph |
|
||||
| `save` | `deps: PortalDeps, customer: Customer` | — | `unknown` | see Call graph |
|
||||
| `portalRouter` | `deps: PortalDeps` | — | `unknown` | see Call graph |
|
||||
|
||||
## Methods (class / object)
|
||||
|
||||
| Name | Parameters |
|
||||
|------|------------|
|
||||
| `reload` | `customer: Customer, amountCents: number` |
|
||||
| `return` | `req, res, next` |
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
- `crypto`
|
||||
- `express`
|
||||
- `./accounts`
|
||||
- `./admin`
|
||||
- `./auth`
|
||||
- `./billing/credit`
|
||||
- `./invoicing`
|
||||
- `./pricing`
|
||||
- `./usage`
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`now`, `reload`, `customer`, `publicProfile`, `sessionAuth`, `header`, `startsWith`, `slice`, `get`, `list`, `find`, `status`, `json`, `next`, `save`, `portalRouter`, `post`, `trim`, `test`, `hashPassword`, `findByEmail`, `randomBytes`, `toString`, `create`, `verifyPassword`, `verifyTotp`, `use`, `delete`, `setUTCDate`, `setUTCHours`, `summaryFor`, `tiers`, `applyMonthlyCredit`, `rateCard`, `type`, `send`, `renderInvoiceHtml`, `async`, `generateTotpSecret`, `totpUri`, `qr`, `isInteger`, `put`
|
||||
|
||||
Each identifier is a call site in this file. Follow the import list to see the defining module; open that module’s MD for parameter and return types.
|
||||
|
||||
## Return values (how to read this)
|
||||
|
||||
- HTTP route handlers return Express `res.json(...)` bodies (see route docs).
|
||||
- Zapier `perform` functions return a **single object** (creates) or an **array** (triggers/searches).
|
||||
- Pricing functions return integer **cents** on `Quote.totalCents`.
|
||||
|
||||
78
docs/modules/zappier/pricing.md
Normal file
78
docs/modules/zappier/pricing.md
Normal file
|
|
@ -0,0 +1,78 @@
|
|||
# `zappier/pricing`
|
||||
|
||||
**Package:** `zappier`
|
||||
**Source:** `packages/zappier/src/pricing.ts`
|
||||
**Lines:** 171
|
||||
|
||||
## What this module is
|
||||
|
||||
Implementation module in `zappier`. The tables below are extracted from the source (signatures + JSDoc).
|
||||
|
||||
## Exports
|
||||
|
||||
`PriceRule`, `TierConfig`, `RateCard`, `TierCatalog`, `ConfigTierCatalog`, `CallUsage`, `Quote`, `PricingContext`, `PricingStore`, `DEFAULT_RATE_CARD`, `DEFAULT_TIERS`, `DEFAULT_PRICING`, `InMemoryPricingStore`, `quoteCall`
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
| Kind | Name |
|
||||
|------|------|
|
||||
| interface | `TierConfig` |
|
||||
| interface | `RateCard` |
|
||||
| interface | `TierCatalog` |
|
||||
| interface | `CallUsage` |
|
||||
| interface | `Quote` |
|
||||
| interface | `PricingContext` |
|
||||
| interface | `PricingStore` |
|
||||
| type | `PriceRule` |
|
||||
| class | `ConfigTierCatalog` |
|
||||
| class | `InMemoryPricingStore` |
|
||||
|
||||
## Functions
|
||||
|
||||
| Name | Parameters | Param types (JSDoc) | Returns | Calls (same file / helpers) |
|
||||
|------|------------|---------------------|---------|-----------------------------|
|
||||
| `quoteCall` | `pricing: PricingContext,
|
||||
tierId: string,
|
||||
endpointId: string,
|
||||
usage: CallUsage,
|
||||
multiplierOverride?: number,` | — | `unknown` | see Call graph |
|
||||
|
||||
## Methods (class / object)
|
||||
|
||||
| Name | Parameters |
|
||||
|------|------------|
|
||||
| `find` | `id: string` |
|
||||
| `list` | `(none)` |
|
||||
| `constructor` | `private tiers: TierConfig[]` |
|
||||
| `find` | `id: string` |
|
||||
| `list` | `(none)` |
|
||||
| `getRateCard` | `(none)` |
|
||||
| `getTiers` | `(none)` |
|
||||
| `upsertEndpoint` | `endpointId: string, rule: PriceRule` |
|
||||
| `deleteEndpoint` | `endpointId: string` |
|
||||
| `upsertTier` | `tier: TierConfig` |
|
||||
| `deleteTier` | `tierId: string` |
|
||||
| `constructor` | `rateCard: RateCard = DEFAULT_RATE_CARD, tiers: TierConfig[] = DEFAULT_TIERS` |
|
||||
| `getRateCard` | `(none)` |
|
||||
| `getTiers` | `(none)` |
|
||||
| `upsertEndpoint` | `endpointId: string, rule: PriceRule` |
|
||||
| `deleteEndpoint` | `endpointId: string` |
|
||||
| `upsertTier` | `tier: TierConfig` |
|
||||
| `deleteTier` | `tierId: string` |
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
_No imports detected._
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`find`, `list`, `constructor`, `getRateCard`, `getTiers`, `upsertEndpoint`, `deleteEndpoint`, `upsertTier`, `deleteTier`, `findIndex`, `push`, `filter`, `quoteCall`, `ceil`, `round`
|
||||
|
||||
Each identifier is a call site in this file. Follow the import list to see the defining module; open that module’s MD for parameter and return types.
|
||||
|
||||
## Return values (how to read this)
|
||||
|
||||
- HTTP route handlers return Express `res.json(...)` bodies (see route docs).
|
||||
- Zapier `perform` functions return a **single object** (creates) or an **array** (triggers/searches).
|
||||
- Pricing functions return integer **cents** on `Quote.totalCents`.
|
||||
|
||||
56
docs/modules/zappier/reports.md
Normal file
56
docs/modules/zappier/reports.md
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
# `zappier/reports`
|
||||
|
||||
**Package:** `zappier`
|
||||
**Source:** `packages/zappier/src/reports.ts`
|
||||
**Lines:** 99
|
||||
|
||||
## What this module is
|
||||
|
||||
Implementation module in `zappier`. The tables below are extracted from the source (signatures + JSDoc).
|
||||
|
||||
## Exports
|
||||
|
||||
`BillingRow`, `billingRows`, `TrendPoint`, `usageTrend`, `CsvColumn`, `toCsv`
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
| Kind | Name |
|
||||
|------|------|
|
||||
| interface | `BillingRow` |
|
||||
| interface | `TrendPoint` |
|
||||
| interface | `CsvColumn` |
|
||||
|
||||
## Functions
|
||||
|
||||
| Name | Parameters | Param types (JSDoc) | Returns | Calls (same file / helpers) |
|
||||
|------|------------|---------------------|---------|-----------------------------|
|
||||
| `billingRows` | `args: {
|
||||
entries: UsageEntry[];
|
||||
customers: Customer[];
|
||||
tiers: TierConfig[];
|
||||
from?: Date;
|
||||
to?: Date;
|
||||
customerId?: string;
|
||||
billingType?: BillingType;
|
||||
}` | — | `unknown` | see Call graph |
|
||||
| `usageTrend` | `entries: UsageEntry[], bucket: 'day' \| 'week'` | — | `unknown` | see Call graph |
|
||||
| | _Day bucket: YYYY-MM-DD. Week bucket: the Monday (UTC) of that week, YYYY-MM-DD._ | | | |
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
- `./auth`
|
||||
- `./pricing`
|
||||
- `./usage`
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`billingRows`, `filter`, `map`, `reduce`, `find`, `min`, `usageTrend`, `setUTCHours`, `getUTCDay`, `setUTCDate`, `getUTCDate`, `toISOString`, `slice`, `key`, `get`, `set`, `values`, `sort`, `localeCompare`, `test`, `replace`, `cell`, `join`, `push`
|
||||
|
||||
Each identifier is a call site in this file. Follow the import list to see the defining module; open that module’s MD for parameter and return types.
|
||||
|
||||
## Return values (how to read this)
|
||||
|
||||
- HTTP route handlers return Express `res.json(...)` bodies (see route docs).
|
||||
- Zapier `perform` functions return a **single object** (creates) or an **array** (triggers/searches).
|
||||
- Pricing functions return integer **cents** on `Quote.totalCents`.
|
||||
|
||||
56
docs/modules/zappier/usage.md
Normal file
56
docs/modules/zappier/usage.md
Normal file
|
|
@ -0,0 +1,56 @@
|
|||
# `zappier/usage`
|
||||
|
||||
**Package:** `zappier`
|
||||
**Source:** `packages/zappier/src/usage.ts`
|
||||
**Lines:** 55
|
||||
|
||||
## What this module is
|
||||
|
||||
Implementation module in `zappier`. The tables below are extracted from the source (signatures + JSDoc).
|
||||
|
||||
## Exports
|
||||
|
||||
`UsageEntry`, `UsageSummary`, `summarize`, `UsageRepo`, `InMemoryUsageRepo`
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
| Kind | Name |
|
||||
|------|------|
|
||||
| interface | `UsageEntry` |
|
||||
| interface | `UsageSummary` |
|
||||
| interface | `UsageRepo` |
|
||||
| class | `InMemoryUsageRepo` |
|
||||
|
||||
## Functions
|
||||
|
||||
| Name | Parameters | Param types (JSDoc) | Returns | Calls (same file / helpers) |
|
||||
|------|------------|---------------------|---------|-----------------------------|
|
||||
| `summarize` | `customerId: string, list: UsageEntry[]` | — | `unknown` | see Call graph |
|
||||
|
||||
## Methods (class / object)
|
||||
|
||||
| Name | Parameters |
|
||||
|------|------------|
|
||||
| `record` | `entry: UsageEntry` |
|
||||
| `listFor` | `customerId: string, since?: Date` |
|
||||
| `summaryFor` | `customerId: string, since?: Date` |
|
||||
| `record` | `entry: UsageEntry` |
|
||||
| `listFor` | `customerId: string, since?: Date` |
|
||||
| `summaryFor` | `customerId: string, since?: Date` |
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
_No imports detected._
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`summarize`, `reduce`, `record`, `listFor`, `summaryFor`, `push`, `filter`
|
||||
|
||||
Each identifier is a call site in this file. Follow the import list to see the defining module; open that module’s MD for parameter and return types.
|
||||
|
||||
## Return values (how to read this)
|
||||
|
||||
- HTTP route handlers return Express `res.json(...)` bodies (see route docs).
|
||||
- Zapier `perform` functions return a **single object** (creates) or an **array** (triggers/searches).
|
||||
- Pricing functions return integer **cents** on `Quote.totalCents`.
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue