Add NATS account-balance SoT and statement review for customers, CS, and sales
Some checks are pending
offline / test (push) Waiting to run
Some checks are pending
offline / test (push) Waiting to run
Internal billing now uses verae.billing.* request-reply and pubs. zappier-account-balance tracks prepaid, credits, usage, and payments. Portal, admin, CS, and sales all review the same statement. Independent Forgejo repos stay split via push-module-repos.
This commit is contained in:
parent
a1a5b957fd
commit
ac38676645
135 changed files with 3078 additions and 130 deletions
|
|
@ -24,11 +24,16 @@ Markdown indexes: https://zapier.georgelambert.org/index-md.html
|
|||
repos/zapier-user-docs
|
||||
repos/docs-master
|
||||
repos/verae-nats-process
|
||||
repos/zappier-account-balance
|
||||
repos/zappier-customer-service
|
||||
repos/zappier-sales-pricing
|
||||
repos/zappier-accounting-export
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
:caption: API modules
|
||||
|
||||
modules/zappier/accounting-export
|
||||
modules/zappier/accounts
|
||||
modules/zappier/admin-users
|
||||
modules/zappier/admin
|
||||
|
|
@ -37,6 +42,8 @@ Markdown indexes: https://zapier.georgelambert.org/index-md.html
|
|||
modules/zappier/billing/credit
|
||||
modules/zappier/billing/reload
|
||||
modules/zappier/billing/stripe
|
||||
modules/zappier/billing-nats
|
||||
modules/zappier/credits
|
||||
modules/zappier/db/admin-user-repo
|
||||
modules/zappier/db/billing-repo
|
||||
modules/zappier/db/customer-repo
|
||||
|
|
@ -48,10 +55,13 @@ Markdown indexes: https://zapier.georgelambert.org/index-md.html
|
|||
modules/zappier/invoicing
|
||||
modules/zappier/jobs/report-usage
|
||||
modules/zappier/meter
|
||||
modules/zappier/nats-shim.d
|
||||
modules/zappier/paths
|
||||
modules/zappier/portal
|
||||
modules/zappier/pricing
|
||||
modules/zappier/reports
|
||||
modules/zappier/statement
|
||||
modules/zappier/upstream
|
||||
modules/zappier/usage
|
||||
modules/verae-zapier-middleware/app
|
||||
modules/verae-zapier-middleware/clients/veraeClient
|
||||
|
|
@ -138,3 +148,12 @@ Markdown indexes: https://zapier.georgelambert.org/index-md.html
|
|||
modules/verae-zapier-simulator/pipeline
|
||||
modules/verae-zapier-simulator/server
|
||||
modules/verae-zapier-simulator/trace
|
||||
modules/zappier-account-balance/books
|
||||
modules/zappier-account-balance/server
|
||||
modules/zappier-account-balance/subjects
|
||||
modules/zappier-customer-service/nats-billing
|
||||
modules/zappier-customer-service/server
|
||||
modules/zappier-sales-pricing/nats-billing
|
||||
modules/zappier-sales-pricing/server
|
||||
modules/zappier-accounting-export/nats-billing
|
||||
modules/zappier-accounting-export/server
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
**Package:** `verae-fleet`
|
||||
**Source:** `packages/verae-fleet/src/supervisor.js`
|
||||
**Lines:** 511
|
||||
**Lines:** 528
|
||||
|
||||
## What this module is
|
||||
|
||||
|
|
@ -10,7 +10,7 @@ Implementation module in `verae-fleet`. The tables below are extracted from the
|
|||
|
||||
## Exports
|
||||
|
||||
`Supervisor`
|
||||
`spawnLocal`, `Supervisor`
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
|
|
@ -22,6 +22,7 @@ Implementation module in `verae-fleet`. The tables below are extracted from the
|
|||
|
||||
| Name | Parameters | Param types (JSDoc) | Returns | Calls (same file / helpers) |
|
||||
|------|------------|---------------------|---------|-----------------------------|
|
||||
| `spawnLocal` | `root, spec, env, healthPort` | — | `unknown` | see Call graph |
|
||||
| `waitExit` | `child, ms` | — | `unknown` | see Call graph |
|
||||
| `waitForHealth` | `rec, ms` | — | `unknown` | see Call graph |
|
||||
|
||||
|
|
@ -70,7 +71,7 @@ Implementation module in `verae-fleet`. The tables below are extracted from the
|
|||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`floor`, `join`, `dirname`, `fileURLToPath`, `constructor`, `loadFleet`, `mkdirSync`, `isArray`, `machines`, `addMachine`, `upsertMachine`, `saveOverlay`, `log`, `setMachineEnabled`, `find`, `checkMachine`, `sshCheck`, `httpProbe`, `machineOf`, `controlInstance`, `sshHttp`, `postControl`, `toISOString`, `push`, `splice`, `spec`, `nextIndex`, `values`, `filter`, `map`, `has`, `startOne`, `get`, `pickMachine`, `sshSpawnWorker`, `spawn`, `now`, `on`, `set`, `waitForHealth`, `stopInstance`, `sshKillWorker`, `kill`, `waitExit`, `delete`, `reconcile`, `pauseInstance`, `resumeInstance`, `restartInstance`, `markUnhealthy`, `probe`, `isFinite`, `summarizeRtt`, `available`, `keys`, `min`, `startService`, `stopService`, `pauseService`, `resumeService`
|
||||
`floor`, `join`, `dirname`, `fileURLToPath`, `apps`, `spawnLocal`, `resolve`, `spawn`, `constructor`, `loadFleet`, `mkdirSync`, `isArray`, `machines`, `addMachine`, `upsertMachine`, `saveOverlay`, `log`, `setMachineEnabled`, `find`, `checkMachine`, `sshCheck`, `httpProbe`, `machineOf`, `controlInstance`, `sshHttp`, `postControl`, `toISOString`, `push`, `splice`, `spec`, `nextIndex`, `values`, `filter`, `map`, `has`, `startOne`, `get`, `pickMachine`, `sshSpawnWorker`, `now`, `on`, `set`, `waitForHealth`, `stopInstance`, `sshKillWorker`, `kill`, `waitExit`, `delete`, `reconcile`, `pauseInstance`, `resumeInstance`, `restartInstance`, `markUnhealthy`, `probe`, `isFinite`, `summarizeRtt`, `available`, `keys`, `min`, `startService`
|
||||
|
||||
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.
|
||||
|
||||
|
|
|
|||
54
docs/sphinx/modules/zappier-account-balance/books.md
Normal file
54
docs/sphinx/modules/zappier-account-balance/books.md
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
# `zappier-account-balance/books`
|
||||
|
||||
**Package:** `zappier-account-balance`
|
||||
**Source:** `packages/zappier-account-balance/src/books.js`
|
||||
**Lines:** 90
|
||||
|
||||
## What this module is
|
||||
|
||||
Implementation module in `zappier-account-balance`. The tables below are extracted from the source (signatures + JSDoc).
|
||||
|
||||
## Exports
|
||||
|
||||
`AccountBooks`, `handle`
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
| Kind | Name |
|
||||
|------|------|
|
||||
| class | `AccountBooks` |
|
||||
|
||||
## Functions
|
||||
|
||||
| Name | Parameters | Param types (JSDoc) | Returns | Calls (same file / helpers) |
|
||||
|------|------------|---------------------|---------|-----------------------------|
|
||||
| `handle` | `subject, payload, books` | — | `unknown` | see Call graph |
|
||||
| `match` | `rows` | — | `unknown` | see Call graph |
|
||||
|
||||
## Methods (class / object)
|
||||
|
||||
| Name | Parameters |
|
||||
|------|------------|
|
||||
| `constructor` | `(none)` |
|
||||
| `prepaidCents` | `customerId` |
|
||||
| `adjust` | `{ customerId, cents, reason, agent, kind = 'credit' }` |
|
||||
| `recordUsage` | `entry` |
|
||||
| `recordPayment` | `entry` |
|
||||
| `statement` | `customerId` |
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
_No imports detected._
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`constructor`, `prepaidCents`, `adjust`, `trunc`, `now`, `toString`, `random`, `slice`, `toISOString`, `unshift`, `recordUsage`, `recordPayment`, `statement`, `filter`, `match`, `handle`, `endsWith`
|
||||
|
||||
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`.
|
||||
|
||||
7
docs/sphinx/modules/zappier-account-balance/books.rst
Normal file
7
docs/sphinx/modules/zappier-account-balance/books.rst
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
zappier-account-balance.books
|
||||
=============================
|
||||
|
||||
Generated API sheet for ``zappier-account-balance/books``.
|
||||
|
||||
.. include:: books.md
|
||||
:parser: myst_parser.sphinx_
|
||||
53
docs/sphinx/modules/zappier-account-balance/server.md
Normal file
53
docs/sphinx/modules/zappier-account-balance/server.md
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
# `zappier-account-balance/server`
|
||||
|
||||
**Package:** `zappier-account-balance`
|
||||
**Source:** `packages/zappier-account-balance/src/server.js`
|
||||
**Lines:** 93
|
||||
|
||||
## What this module is
|
||||
|
||||
Implementation module in `zappier-account-balance`. The tables below are extracted from the source (signatures + JSDoc).
|
||||
|
||||
## Exports
|
||||
|
||||
_No named `export` / `module.exports` keys detected._
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
_None extracted._
|
||||
|
||||
## Functions
|
||||
|
||||
| Name | Parameters | Param types (JSDoc) | Returns | Calls (same file / helpers) |
|
||||
|------|------------|---------------------|---------|-----------------------------|
|
||||
| `startNats` | `(none)` | — | `unknown` | see Call graph |
|
||||
| `readBody` | `req` | — | `unknown` | see Call graph |
|
||||
| `reply` | `sub, fn` | — | `unknown` | see Call graph |
|
||||
| `json` | `code, obj` | — | `unknown` | see Call graph |
|
||||
|
||||
## Methods (class / object)
|
||||
|
||||
| Name | Parameters |
|
||||
|------|------------|
|
||||
| `reply` | `nc.subscribe(SUBJECTS.STATEMENT_GET, { queue: SUBJECTS.QUEUE }` |
|
||||
| `reply` | `nc.subscribe(SUBJECTS.BALANCE_GET, { queue: SUBJECTS.QUEUE }` |
|
||||
| `reply` | `nc.subscribe(SUBJECTS.BALANCE_ADJUST, { queue: SUBJECTS.QUEUE }` |
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
- `node:http`
|
||||
- `./books.js`
|
||||
- `./subjects.js`
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`startNats`, `import`, `connect`, `split`, `async`, `parse`, `decode`, `fn`, `respond`, `encode`, `stringify`, `reply`, `subscribe`, `handle`, `write`, `readBody`, `on`, `push`, `resolve`, `concat`, `toString`, `createServer`, `writeHead`, `end`, `json`, `match`, `statement`, `adjust`, `listen`
|
||||
|
||||
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`.
|
||||
|
||||
7
docs/sphinx/modules/zappier-account-balance/server.rst
Normal file
7
docs/sphinx/modules/zappier-account-balance/server.rst
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
zappier-account-balance.server
|
||||
==============================
|
||||
|
||||
Generated API sheet for ``zappier-account-balance/server``.
|
||||
|
||||
.. include:: server.md
|
||||
:parser: myst_parser.sphinx_
|
||||
36
docs/sphinx/modules/zappier-account-balance/subjects.md
Normal file
36
docs/sphinx/modules/zappier-account-balance/subjects.md
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
# `zappier-account-balance/subjects`
|
||||
|
||||
**Package:** `zappier-account-balance`
|
||||
**Source:** `packages/zappier-account-balance/src/subjects.js`
|
||||
**Lines:** 11
|
||||
|
||||
## What this module is
|
||||
|
||||
Implementation module in `zappier-account-balance`. The tables below are extracted from the source (signatures + JSDoc).
|
||||
|
||||
## Exports
|
||||
|
||||
`SUBJECTS`
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
_None extracted._
|
||||
|
||||
## Functions
|
||||
|
||||
_No top-level functions extracted._
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
_No imports detected._
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
_No local call identifiers extracted._
|
||||
|
||||
## 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`.
|
||||
|
||||
7
docs/sphinx/modules/zappier-account-balance/subjects.rst
Normal file
7
docs/sphinx/modules/zappier-account-balance/subjects.rst
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
zappier-account-balance.subjects
|
||||
================================
|
||||
|
||||
Generated API sheet for ``zappier-account-balance/subjects``.
|
||||
|
||||
.. include:: subjects.md
|
||||
:parser: myst_parser.sphinx_
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
# `zappier-accounting-export/nats-billing`
|
||||
|
||||
**Package:** `zappier-accounting-export`
|
||||
**Source:** `packages/zappier-accounting-export/src/nats-billing.js`
|
||||
**Lines:** 18
|
||||
|
||||
## What this module is
|
||||
|
||||
Implementation module in `zappier-accounting-export`. The tables below are extracted from the source (signatures + JSDoc).
|
||||
|
||||
## Exports
|
||||
|
||||
`SUBJECTS`, `billingRequest`
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
_None extracted._
|
||||
|
||||
## Functions
|
||||
|
||||
| Name | Parameters | Param types (JSDoc) | Returns | Calls (same file / helpers) |
|
||||
|------|------------|---------------------|---------|-----------------------------|
|
||||
| `billingRequest` | `subject, payload` | — | `unknown` | see Call graph |
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
_No imports detected._
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`billingRequest`, `import`, `connect`, `split`, `request`, `encode`, `stringify`, `parse`, `decode`, `close`
|
||||
|
||||
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`.
|
||||
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
zappier-accounting-export.nats-billing
|
||||
======================================
|
||||
|
||||
Generated API sheet for ``zappier-accounting-export/nats-billing``.
|
||||
|
||||
.. include:: nats-billing.md
|
||||
:parser: myst_parser.sphinx_
|
||||
46
docs/sphinx/modules/zappier-accounting-export/server.md
Normal file
46
docs/sphinx/modules/zappier-accounting-export/server.md
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
# `zappier-accounting-export/server`
|
||||
|
||||
**Package:** `zappier-accounting-export`
|
||||
**Source:** `packages/zappier-accounting-export/src/server.js`
|
||||
**Lines:** 62
|
||||
|
||||
## What this module is
|
||||
|
||||
Implementation module in `zappier-accounting-export`. The tables below are extracted from the source (signatures + JSDoc).
|
||||
|
||||
## Exports
|
||||
|
||||
_No named `export` / `module.exports` keys detected._
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
_None extracted._
|
||||
|
||||
## Functions
|
||||
|
||||
| Name | Parameters | Param types (JSDoc) | Returns | Calls (same file / helpers) |
|
||||
|------|------------|---------------------|---------|-----------------------------|
|
||||
| `edge` | `pathname` | — | `unknown` | see Call graph |
|
||||
| `send` | `code, type, body` | — | `unknown` | see Call graph |
|
||||
| `json` | `code, obj` | — | `unknown` | see Call graph |
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
- `node:fs`
|
||||
- `node:http`
|
||||
- `node:path`
|
||||
- `node:url`
|
||||
- `./nats-billing.js`
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`replace`, `join`, `dirname`, `fileURLToPath`, `edge`, `fetch`, `createServer`, `async`, `writeHead`, `end`, `send`, `stringify`, `readFileSync`, `json`, `match`, `billingRequest`, `text`, `get`, `encodeURIComponent`, `listen`, `write`
|
||||
|
||||
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`.
|
||||
|
||||
7
docs/sphinx/modules/zappier-accounting-export/server.rst
Normal file
7
docs/sphinx/modules/zappier-accounting-export/server.rst
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
zappier-accounting-export.server
|
||||
================================
|
||||
|
||||
Generated API sheet for ``zappier-accounting-export/server``.
|
||||
|
||||
.. include:: server.md
|
||||
:parser: myst_parser.sphinx_
|
||||
40
docs/sphinx/modules/zappier-customer-service/nats-billing.md
Normal file
40
docs/sphinx/modules/zappier-customer-service/nats-billing.md
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
# `zappier-customer-service/nats-billing`
|
||||
|
||||
**Package:** `zappier-customer-service`
|
||||
**Source:** `packages/zappier-customer-service/src/nats-billing.js`
|
||||
**Lines:** 21
|
||||
|
||||
## What this module is
|
||||
|
||||
Implementation module in `zappier-customer-service`. The tables below are extracted from the source (signatures + JSDoc).
|
||||
|
||||
## Exports
|
||||
|
||||
`SUBJECTS`, `billingRequest`
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
_None extracted._
|
||||
|
||||
## Functions
|
||||
|
||||
| Name | Parameters | Param types (JSDoc) | Returns | Calls (same file / helpers) |
|
||||
|------|------------|---------------------|---------|-----------------------------|
|
||||
| `billingRequest` | `subject, payload` | — | `unknown` | see Call graph |
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
_No imports detected._
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`billingRequest`, `import`, `connect`, `split`, `request`, `encode`, `stringify`, `parse`, `decode`, `close`
|
||||
|
||||
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`.
|
||||
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
zappier-customer-service.nats-billing
|
||||
=====================================
|
||||
|
||||
Generated API sheet for ``zappier-customer-service/nats-billing``.
|
||||
|
||||
.. include:: nats-billing.md
|
||||
:parser: myst_parser.sphinx_
|
||||
45
docs/sphinx/modules/zappier-customer-service/server.md
Normal file
45
docs/sphinx/modules/zappier-customer-service/server.md
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
# `zappier-customer-service/server`
|
||||
|
||||
**Package:** `zappier-customer-service`
|
||||
**Source:** `packages/zappier-customer-service/src/server.js`
|
||||
**Lines:** 81
|
||||
|
||||
## What this module is
|
||||
|
||||
Implementation module in `zappier-customer-service`. The tables below are extracted from the source (signatures + JSDoc).
|
||||
|
||||
## Exports
|
||||
|
||||
_No named `export` / `module.exports` keys detected._
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
_None extracted._
|
||||
|
||||
## Functions
|
||||
|
||||
| Name | Parameters | Param types (JSDoc) | Returns | Calls (same file / helpers) |
|
||||
|------|------------|---------------------|---------|-----------------------------|
|
||||
| `statement` | `customerId` | — | `unknown` | see Call graph |
|
||||
| `json` | `code, obj` | — | `unknown` | see Call graph |
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
- `node:fs`
|
||||
- `node:http`
|
||||
- `node:path`
|
||||
- `node:url`
|
||||
- `./nats-billing.js`
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`join`, `dirname`, `fileURLToPath`, `replace`, `statement`, `billingRequest`, `fetch`, `json`, `createServer`, `async`, `writeHead`, `end`, `stringify`, `readFileSync`, `match`, `push`, `parse`, `concat`, `toString`, `get`, `listen`, `write`
|
||||
|
||||
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`.
|
||||
|
||||
7
docs/sphinx/modules/zappier-customer-service/server.rst
Normal file
7
docs/sphinx/modules/zappier-customer-service/server.rst
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
zappier-customer-service.server
|
||||
===============================
|
||||
|
||||
Generated API sheet for ``zappier-customer-service/server``.
|
||||
|
||||
.. include:: server.md
|
||||
:parser: myst_parser.sphinx_
|
||||
40
docs/sphinx/modules/zappier-sales-pricing/nats-billing.md
Normal file
40
docs/sphinx/modules/zappier-sales-pricing/nats-billing.md
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
# `zappier-sales-pricing/nats-billing`
|
||||
|
||||
**Package:** `zappier-sales-pricing`
|
||||
**Source:** `packages/zappier-sales-pricing/src/nats-billing.js`
|
||||
**Lines:** 18
|
||||
|
||||
## What this module is
|
||||
|
||||
Implementation module in `zappier-sales-pricing`. The tables below are extracted from the source (signatures + JSDoc).
|
||||
|
||||
## Exports
|
||||
|
||||
`SUBJECTS`, `billingRequest`
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
_None extracted._
|
||||
|
||||
## Functions
|
||||
|
||||
| Name | Parameters | Param types (JSDoc) | Returns | Calls (same file / helpers) |
|
||||
|------|------------|---------------------|---------|-----------------------------|
|
||||
| `billingRequest` | `subject, payload` | — | `unknown` | see Call graph |
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
_No imports detected._
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`billingRequest`, `import`, `connect`, `split`, `request`, `encode`, `stringify`, `parse`, `decode`, `close`
|
||||
|
||||
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`.
|
||||
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
zappier-sales-pricing.nats-billing
|
||||
==================================
|
||||
|
||||
Generated API sheet for ``zappier-sales-pricing/nats-billing``.
|
||||
|
||||
.. include:: nats-billing.md
|
||||
:parser: myst_parser.sphinx_
|
||||
45
docs/sphinx/modules/zappier-sales-pricing/server.md
Normal file
45
docs/sphinx/modules/zappier-sales-pricing/server.md
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
# `zappier-sales-pricing/server`
|
||||
|
||||
**Package:** `zappier-sales-pricing`
|
||||
**Source:** `packages/zappier-sales-pricing/src/server.js`
|
||||
**Lines:** 77
|
||||
|
||||
## What this module is
|
||||
|
||||
Implementation module in `zappier-sales-pricing`. The tables below are extracted from the source (signatures + JSDoc).
|
||||
|
||||
## Exports
|
||||
|
||||
_No named `export` / `module.exports` keys detected._
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
_None extracted._
|
||||
|
||||
## Functions
|
||||
|
||||
| Name | Parameters | Param types (JSDoc) | Returns | Calls (same file / helpers) |
|
||||
|------|------------|---------------------|---------|-----------------------------|
|
||||
| `edge` | `pathname, { method = 'GET', body } = {}` | — | `unknown` | see Call graph |
|
||||
| `json` | `code, obj` | — | `unknown` | see Call graph |
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
- `node:fs`
|
||||
- `node:http`
|
||||
- `node:path`
|
||||
- `node:url`
|
||||
- `./nats-billing.js`
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`join`, `dirname`, `fileURLToPath`, `replace`, `edge`, `fetch`, `stringify`, `text`, `parse`, `createServer`, `async`, `writeHead`, `end`, `readFileSync`, `json`, `match`, `billingRequest`, `push`, `concat`, `toString`, `listen`, `write`
|
||||
|
||||
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`.
|
||||
|
||||
7
docs/sphinx/modules/zappier-sales-pricing/server.rst
Normal file
7
docs/sphinx/modules/zappier-sales-pricing/server.rst
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
zappier-sales-pricing.server
|
||||
============================
|
||||
|
||||
Generated API sheet for ``zappier-sales-pricing/server``.
|
||||
|
||||
.. include:: server.md
|
||||
:parser: myst_parser.sphinx_
|
||||
43
docs/sphinx/modules/zappier/accounting-export.md
Normal file
43
docs/sphinx/modules/zappier/accounting-export.md
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
# `zappier/accounting-export`
|
||||
|
||||
**Package:** `zappier`
|
||||
**Source:** `packages/zappier/src/accounting-export.ts`
|
||||
**Lines:** 37
|
||||
|
||||
## What this module is
|
||||
|
||||
Implementation module in `zappier`. The tables below are extracted from the source (signatures + JSDoc).
|
||||
|
||||
## Exports
|
||||
|
||||
`invoicesToQuickBooksIif`, `invoicesToAccountingCsv`
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
_None extracted._
|
||||
|
||||
## Functions
|
||||
|
||||
| Name | Parameters | Param types (JSDoc) | Returns | Calls (same file / helpers) |
|
||||
|------|------------|---------------------|---------|-----------------------------|
|
||||
| `iifDate` | `ms: number` | — | `unknown` | see Call graph |
|
||||
| `invoicesToQuickBooksIif` | `invoices: Invoice[]` | — | `unknown` | see Call graph |
|
||||
| | _QuickBooks IIF journal for issued/paid invoices (Accounts Receivable + Sales)._ | | | |
|
||||
| `invoicesToAccountingCsv` | `invoices: Invoice[]` | — | `unknown` | see Call graph |
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
- `./invoicing`
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`iifDate`, `getUTCMonth`, `padStart`, `getUTCDate`, `getUTCFullYear`, `invoices`, `invoicesToQuickBooksIif`, `now`, `toFixed`, `push`, `join`, `invoicesToAccountingCsv`, `map`
|
||||
|
||||
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`.
|
||||
|
||||
7
docs/sphinx/modules/zappier/accounting-export.rst
Normal file
7
docs/sphinx/modules/zappier/accounting-export.rst
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
zappier.accounting-export
|
||||
=========================
|
||||
|
||||
Generated API sheet for ``zappier/accounting-export``.
|
||||
|
||||
.. include:: accounting-export.md
|
||||
:parser: myst_parser.sphinx_
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
**Package:** `zappier`
|
||||
**Source:** `packages/zappier/src/admin.ts`
|
||||
**Lines:** 486
|
||||
**Lines:** 588
|
||||
|
||||
## What this module is
|
||||
|
||||
|
|
@ -32,7 +32,8 @@ Implementation module in `zappier`. The tables below are extracted from the sour
|
|||
| `renderInvoiceHtml` | `invoice: Invoice, customerName: string` | — | `unknown` | see Call graph |
|
||||
| `adminRouter` | `store: PricingStore,
|
||||
customers: CustomerRepo,
|
||||
accounting: AccountingDeps,` | — | `unknown` | see Call graph |
|
||||
accounting: AccountingDeps,
|
||||
credits: CreditLedger = new CreditLedger(` | — | `unknown` | see Call graph |
|
||||
|
||||
## Methods (class / object)
|
||||
|
||||
|
|
@ -58,10 +59,14 @@ Implementation module in `zappier`. The tables below are extracted from the sour
|
|||
- `./paths`
|
||||
- `./reports`
|
||||
- `./usage`
|
||||
- `./credits`
|
||||
- `./accounting-export`
|
||||
- `./statement`
|
||||
- `./billing-nats`
|
||||
|
||||
## 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`
|
||||
`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`, `isFinite`, `trunc`, `add`, `natsPublish`, `natsAdjust`, `async`, `natsStatement`, `composeStatement`, `listFor`, `type`, `send`
|
||||
|
||||
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.
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
**Package:** `zappier`
|
||||
**Source:** `packages/zappier/src/app.ts`
|
||||
**Lines:** 257
|
||||
**Lines:** 272
|
||||
|
||||
## What this module is
|
||||
|
||||
|
|
@ -24,6 +24,7 @@ Implementation module in `zappier`. The tables below are extracted from the sour
|
|||
| Name | Parameters | Param types (JSDoc) | Returns | Calls (same file / helpers) |
|
||||
|------|------------|---------------------|---------|-----------------------------|
|
||||
| `buildApp` | `deps: AppDeps = {}` | — | `unknown` | see Call graph |
|
||||
| `onUsage` | `e: { customerId: string; endpointId: string; cents: number }` | — | `unknown` | see Call graph |
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
|
|
@ -44,10 +45,14 @@ Implementation module in `zappier`. The tables below are extracted from the sour
|
|||
- `./invoicing`
|
||||
- `./paths`
|
||||
- `./portal`
|
||||
- `./upstream`
|
||||
- `./credits`
|
||||
- `./statement`
|
||||
- `./billing-nats`
|
||||
|
||||
## 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`, `toLowerCase`, `createHash`, `update`, `digest`, `randomUUID`, `toISOString`, `set`, `isFinite`, `map`, `unshift`, `filter`, `setUTCDate`, `setUTCHours`, `summaryFor`, `find`, `applyMonthlyCredit`
|
||||
`join`, `next`, `parse`, `status`, `json`, `buildApp`, `seeded`, `seedAdminUsersFromEnv`, `rateCard`, `getRateCard`, `tiers`, `getTiers`, `natsPublish`, `toISOString`, `express`, `use`, `load`, `setup`, `adminLoginRouter`, `adminAuth`, `adminRouter`, `static`, `async`, `import`, `toDataURL`, `portalRouter`, `get`, `apiKeyAuth`, `middleware`, `meter`, `post`, `toUpperCase`, `proxyVerae`, `toLowerCase`, `createHash`, `update`, `digest`, `randomUUID`, `set`, `isFinite`, `map`, `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.
|
||||
|
||||
|
|
|
|||
54
docs/sphinx/modules/zappier/billing-nats.md
Normal file
54
docs/sphinx/modules/zappier/billing-nats.md
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
# `zappier/billing-nats`
|
||||
|
||||
**Package:** `zappier`
|
||||
**Source:** `packages/zappier/src/billing-nats.ts`
|
||||
**Lines:** 74
|
||||
|
||||
## What this module is
|
||||
|
||||
Implementation module in `zappier`. The tables below are extracted from the source (signatures + JSDoc).
|
||||
|
||||
## Exports
|
||||
|
||||
`BILLING_SUBJECTS`, `BillingStatement`, `natsStatement`, `natsAdjust`, `natsPublish`
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
| Kind | Name |
|
||||
|------|------|
|
||||
| type | `BillingStatement` |
|
||||
| type | `Nc` |
|
||||
|
||||
## Functions
|
||||
|
||||
| Name | Parameters | Param types (JSDoc) | Returns | Calls (same file / helpers) |
|
||||
|------|------------|---------------------|---------|-----------------------------|
|
||||
| `nc` | `(none)` | — | `unknown` | see Call graph |
|
||||
| `encode` | `obj: unknown` | — | `unknown` | see Call graph |
|
||||
| `decode` | `buf: Uint8Array` | — | `unknown` | see Call graph |
|
||||
| `natsStatement` | `customerId: string` | — | `unknown` | see Call graph |
|
||||
| `natsAdjust` | `payload: {
|
||||
customerId: string;
|
||||
cents: number;
|
||||
reason: string;
|
||||
agent: string;
|
||||
kind?: string;
|
||||
}` | — | `unknown` | see Call graph |
|
||||
| `natsPublish` | `subject: string, payload: unknown` | — | `unknown` | see Call graph |
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
_No imports detected._
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`unset`, `nc`, `async`, `import`, `connect`, `split`, `encode`, `stringify`, `decode`, `parse`, `natsStatement`, `request`, `natsAdjust`, `natsPublish`, `then`, `publish`
|
||||
|
||||
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`.
|
||||
|
||||
7
docs/sphinx/modules/zappier/billing-nats.rst
Normal file
7
docs/sphinx/modules/zappier/billing-nats.rst
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
zappier.billing-nats
|
||||
====================
|
||||
|
||||
Generated API sheet for ``zappier/billing-nats``.
|
||||
|
||||
.. include:: billing-nats.md
|
||||
:parser: myst_parser.sphinx_
|
||||
48
docs/sphinx/modules/zappier/credits.md
Normal file
48
docs/sphinx/modules/zappier/credits.md
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
# `zappier/credits`
|
||||
|
||||
**Package:** `zappier`
|
||||
**Source:** `packages/zappier/src/credits.ts`
|
||||
**Lines:** 30
|
||||
|
||||
## What this module is
|
||||
|
||||
Implementation module in `zappier`. The tables below are extracted from the source (signatures + JSDoc).
|
||||
|
||||
## Exports
|
||||
|
||||
`CreditAdjustment`, `CreditLedger`
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
| Kind | Name |
|
||||
|------|------|
|
||||
| interface | `CreditAdjustment` |
|
||||
| class | `CreditLedger` |
|
||||
|
||||
## Functions
|
||||
|
||||
_No top-level functions extracted._
|
||||
|
||||
## Methods (class / object)
|
||||
|
||||
| Name | Parameters |
|
||||
|------|------------|
|
||||
| `add` | `row: Omit<CreditAdjustment, 'id' | 'at'> & { id?: string; at?: string }` |
|
||||
| `list` | `customerId?: string` |
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
_No imports detected._
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`add`, `now`, `toString`, `toISOString`, `unshift`, `list`, `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`.
|
||||
|
||||
7
docs/sphinx/modules/zappier/credits.rst
Normal file
7
docs/sphinx/modules/zappier/credits.rst
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
zappier.credits
|
||||
===============
|
||||
|
||||
Generated API sheet for ``zappier/credits``.
|
||||
|
||||
.. include:: credits.md
|
||||
:parser: myst_parser.sphinx_
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
**Package:** `zappier`
|
||||
**Source:** `packages/zappier/src/meter.ts`
|
||||
**Lines:** 49
|
||||
**Lines:** 52
|
||||
|
||||
## What this module is
|
||||
|
||||
|
|
@ -22,7 +22,8 @@ _None extracted._
|
|||
|------|------------|---------------------|---------|-----------------------------|
|
||||
| `meter` | `endpointId: string,
|
||||
repo: UsageRepo,
|
||||
pricing: PricingContext,` | — | `unknown` | see Call graph |
|
||||
pricing: PricingContext,
|
||||
onRecord?: (entry: { customerId: string; endpointId: string; cents: number }` | — | `unknown` | see Call graph |
|
||||
|
||||
## Methods (class / object)
|
||||
|
||||
|
|
|
|||
41
docs/sphinx/modules/zappier/nats-shim.d.md
Normal file
41
docs/sphinx/modules/zappier/nats-shim.d.md
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
# `zappier/nats-shim.d`
|
||||
|
||||
**Package:** `zappier`
|
||||
**Source:** `packages/zappier/src/nats-shim.d.ts`
|
||||
**Lines:** 12
|
||||
|
||||
## 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
|
||||
|
||||
| Name | Parameters | Param types (JSDoc) | Returns | Calls (same file / helpers) |
|
||||
|------|------------|---------------------|---------|-----------------------------|
|
||||
| `connect` | `opts: unknown` | — | `unknown` | see Call graph |
|
||||
| `StringCodec` | `(none)` | — | `unknown` | see Call graph |
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
_No imports detected._
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`connect`, `request`, `publish`, `close`, `encode`, `decode`
|
||||
|
||||
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`.
|
||||
|
||||
7
docs/sphinx/modules/zappier/nats-shim.d.rst
Normal file
7
docs/sphinx/modules/zappier/nats-shim.d.rst
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
zappier.nats-shim.d
|
||||
===================
|
||||
|
||||
Generated API sheet for ``zappier/nats-shim.d``.
|
||||
|
||||
.. include:: nats-shim.d.md
|
||||
:parser: myst_parser.sphinx_
|
||||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
**Package:** `zappier`
|
||||
**Source:** `packages/zappier/src/portal.ts`
|
||||
**Lines:** 285
|
||||
**Lines:** 321
|
||||
|
||||
## What this module is
|
||||
|
||||
|
|
@ -48,10 +48,13 @@ Implementation module in `zappier`. The tables below are extracted from the sour
|
|||
- `./invoicing`
|
||||
- `./pricing`
|
||||
- `./usage`
|
||||
- `./credits`
|
||||
- `./statement`
|
||||
- `./billing-nats`
|
||||
|
||||
## 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`
|
||||
`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`, `async`, `natsStatement`, `composeStatement`, `listFor`, `type`, `send`, `renderInvoiceHtml`, `generateTotpSecret`, `totpUri`, `qr`, `isInteger`, `natsPublish`, `natsAdjust`, `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.
|
||||
|
||||
|
|
|
|||
48
docs/sphinx/modules/zappier/statement.md
Normal file
48
docs/sphinx/modules/zappier/statement.md
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
# `zappier/statement`
|
||||
|
||||
**Package:** `zappier`
|
||||
**Source:** `packages/zappier/src/statement.ts`
|
||||
**Lines:** 39
|
||||
|
||||
## What this module is
|
||||
|
||||
Implementation module in `zappier`. The tables below are extracted from the source (signatures + JSDoc).
|
||||
|
||||
## Exports
|
||||
|
||||
`composeStatement`
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
_None extracted._
|
||||
|
||||
## Functions
|
||||
|
||||
| Name | Parameters | Param types (JSDoc) | Returns | Calls (same file / helpers) |
|
||||
|------|------------|---------------------|---------|-----------------------------|
|
||||
| `composeStatement` | `args: {
|
||||
customerId: string;
|
||||
prepaidCents: number;
|
||||
credits: CreditAdjustment[];
|
||||
usage: UsageEntry[];
|
||||
invoices: Invoice[];
|
||||
}` | — | `unknown` | see Call graph |
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
- `./credits`
|
||||
- `./invoicing`
|
||||
- `./usage`
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`composeStatement`, `filter`, `map`, `now`, `toISOString`, `slice`, `reverse`
|
||||
|
||||
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`.
|
||||
|
||||
7
docs/sphinx/modules/zappier/statement.rst
Normal file
7
docs/sphinx/modules/zappier/statement.rst
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
zappier.statement
|
||||
=================
|
||||
|
||||
Generated API sheet for ``zappier/statement``.
|
||||
|
||||
.. include:: statement.md
|
||||
:parser: myst_parser.sphinx_
|
||||
45
docs/sphinx/modules/zappier/upstream.md
Normal file
45
docs/sphinx/modules/zappier/upstream.md
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
# `zappier/upstream`
|
||||
|
||||
**Package:** `zappier`
|
||||
**Source:** `packages/zappier/src/upstream.ts`
|
||||
**Lines:** 46
|
||||
|
||||
## What this module is
|
||||
|
||||
Implementation module in `zappier`. The tables below are extracted from the source (signatures + JSDoc).
|
||||
|
||||
## Exports
|
||||
|
||||
`UpstreamFetch`, `proxyVerae`
|
||||
|
||||
## Types / interfaces / classes
|
||||
|
||||
| Kind | Name |
|
||||
|------|------|
|
||||
| type | `UpstreamFetch` |
|
||||
|
||||
## Functions
|
||||
|
||||
| Name | Parameters | Param types (JSDoc) | Returns | Calls (same file / helpers) |
|
||||
|------|------------|---------------------|---------|-----------------------------|
|
||||
| `proxyVerae` | `req: Request,
|
||||
res: Response,
|
||||
pathname: string,
|
||||
fetchImpl: UpstreamFetch = fetch,` | — | `unknown` | see Call graph |
|
||||
|
||||
## What it imports / requires
|
||||
|
||||
- `express`
|
||||
|
||||
## Call graph (identifiers invoked)
|
||||
|
||||
`proxyVerae`, `replace`, `entries`, `set`, `header`, `toUpperCase`, `stringify`, `fetchImpl`, `toString`, `text`, `parse`, `isArray`, `status`, `json`
|
||||
|
||||
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`.
|
||||
|
||||
7
docs/sphinx/modules/zappier/upstream.rst
Normal file
7
docs/sphinx/modules/zappier/upstream.rst
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
zappier.upstream
|
||||
================
|
||||
|
||||
Generated API sheet for ``zappier/upstream``.
|
||||
|
||||
.. include:: upstream.md
|
||||
:parser: myst_parser.sphinx_
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
High-level description of the whole system: what it is, which **independent git repositories** implement it, how it stays up, how it behaves when the local network fails, and how it talks to the **central Verae NATS.IO 3-server cluster**. New work is added by **new address routing**, not by teaching Zapier about NATS.
|
||||
|
||||
**This repo:** https://git.georgelambert.org/marchon/overview
|
||||
**Bring online:** https://zapier.georgelambert.org/packages/verae-ops/GETTING-STARTED.pdf
|
||||
**Live catalog (PDF by default):** https://zapier.georgelambert.org/ · [Markdown indexes](https://zapier.georgelambert.org/index-md.html)
|
||||
**Clone:** `ssh://git@git.georgelambert.org:2223/marchon/overview.git`
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ This is the operations repo. Application code lives in the other independent git
|
|||
|
||||
## Reading order
|
||||
|
||||
0. **[GETTING-STARTED.md](GETTING-STARTED.md)** — install, first-up, monitor (read this first)
|
||||
1. [01-dependencies.md](01-dependencies.md) — what must exist, who talks to whom
|
||||
2. [02-docker.md](02-docker.md) — Compose (NATS 3-node cluster + HTTPS edges)
|
||||
3. [03-proxmox.md](03-proxmox.md) — LXC / QEMU VMs
|
||||
|
|
|
|||
31
docs/sphinx/repos/zappier-account-balance.md
Normal file
31
docs/sphinx/repos/zappier-account-balance.md
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
# zappier-account-balance
|
||||
|
||||
Source of truth for **customer prepaid balances**. Internal traffic is **NATS request-reply**; HTTP is health plus a fallback.
|
||||
|
||||
**Forgejo:** https://git.georgelambert.org/marchon/zappier-account-balance
|
||||
**Catalog:** https://zapier.georgelambert.org/packages/zappier-account-balance/README.pdf
|
||||
|
||||
Zapier cloud never connects here. zappier-edge, customer-service, sales-pricing, and accounting-export do.
|
||||
|
||||
## Subjects
|
||||
|
||||
| Subject | Kind | Who |
|
||||
|---------|------|-----|
|
||||
| `verae.billing.statement.get` | request-reply | portal, CS, sales, admin |
|
||||
| `verae.billing.balance.get` | request-reply | anyone internal |
|
||||
| `verae.billing.balance.adjust` | request-reply | CS credits, portal reload |
|
||||
| `verae.billing.usage.recorded` | pub | zappier-edge meter |
|
||||
| `verae.billing.payment.recorded` | pub | portal reload, invoice paid |
|
||||
| `verae.billing.credit.applied` | pub | CS |
|
||||
|
||||
Queue group: `account-balance`.
|
||||
|
||||
## Run
|
||||
|
||||
```bash
|
||||
NATS_URL=nats://127.0.0.1:4222 PORT=3010 npm start
|
||||
curl http://127.0.0.1:3010/health
|
||||
curl http://127.0.0.1:3010/statement/cust_1
|
||||
```
|
||||
|
||||
Statement JSON: `{ customerId, prepaidCents, credits[], usage[], payments[] }`.
|
||||
21
docs/sphinx/repos/zappier-accounting-export.md
Normal file
21
docs/sphinx/repos/zappier-accounting-export.md
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
# zappier-accounting-export
|
||||
|
||||
Accounting-department export of **invoices, billing, and payment history** to **QuickBooks IIF** and generic CSV (also usable in other ledgers).
|
||||
|
||||
**Forgejo:** https://git.georgelambert.org/marchon/zappier-accounting-export
|
||||
**Catalog:** https://zapier.georgelambert.org/packages/zappier-accounting-export/README.pdf
|
||||
|
||||
Reads issued/paid invoices from zappier-edge (`ZAPPIER_ADMIN_URL`). Customer statements (credits, balances, usage, payments) come from NATS `verae.billing.statement.get`.
|
||||
|
||||
Staff UI: http://127.0.0.1:3013/
|
||||
|
||||
```bash
|
||||
PORT=3013 NATS_URL=nats://127.0.0.1:4222 node src/server.js
|
||||
curl http://127.0.0.1:3013/review/cust_1
|
||||
curl 'http://127.0.0.1:3013/export/quickbooks.iif?period=2026-07' -o zappier.iif
|
||||
curl 'http://127.0.0.1:3013/export/accounting.csv?period=2026-07' -o zappier.csv
|
||||
```
|
||||
|
||||
Import the IIF in QuickBooks Desktop: **File → Utilities → Import → IIF**. The CSV is a flat invoice register for other systems.
|
||||
|
||||
History is the invoice list on zappier-edge (draft / issued / paid) plus CS credit ledger and portal prepaid reloads.
|
||||
23
docs/sphinx/repos/zappier-customer-service.md
Normal file
23
docs/sphinx/repos/zappier-customer-service.md
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
# zappier-customer-service
|
||||
|
||||
Department API for **customer-service credit additions** and **review** of credits, balances, usage, and payments. Internally uses **NATS** `verae.billing.*` (account-balance). HTTP fallback to account-balance then zappier-edge.
|
||||
|
||||
**Forgejo:** https://git.georgelambert.org/marchon/zappier-customer-service
|
||||
**Catalog:** https://zapier.georgelambert.org/packages/zappier-customer-service/README.pdf
|
||||
**Plugs into:** zappier-edge admin (`x-admin-key`) at `ZAPPIER_ADMIN_URL` (default `http://127.0.0.1:3000`).
|
||||
|
||||
```bash
|
||||
PORT=3011 ZAPPIER_ADMIN_URL=http://127.0.0.1:3000 node src/server.js
|
||||
curl -X POST http://127.0.0.1:3011/credits -H 'content-type: application/json' \
|
||||
-d '{"customerId":"cust_1","cents":500,"reason":"goodwill","agent":"cs-anna"}'
|
||||
```
|
||||
|
||||
| Route | Job |
|
||||
|-------|-----|
|
||||
| `GET /` | Staff review UI |
|
||||
| `GET /health` | `{ ok, role }` |
|
||||
| `POST /credits` | Add/subtract prepaid cents (NATS `balance.adjust`) |
|
||||
| `GET /credits?customerId=` | Ledger |
|
||||
| `GET /review/:customerId` | Full statement (balance, credits, usage, payments) |
|
||||
|
||||
Talks to NATS `verae.billing.*` internally. Never talks to Zapier cloud.
|
||||
19
docs/sphinx/repos/zappier-sales-pricing.md
Normal file
19
docs/sphinx/repos/zappier-sales-pricing.md
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# zappier-sales-pricing
|
||||
|
||||
Sales-department API for **per-customer pricing** (tier + `multiplierOverride`). zappier-edge remains the rate-card store.
|
||||
|
||||
**Forgejo:** https://git.georgelambert.org/marchon/zappier-sales-pricing
|
||||
**Catalog:** https://zapier.georgelambert.org/packages/zappier-sales-pricing/README.pdf
|
||||
|
||||
Internal reviews use NATS `verae.billing.statement.get` (account-balance).
|
||||
|
||||
Staff UI: http://127.0.0.1:3012/ — review credits, balances, usage, payments.
|
||||
|
||||
```bash
|
||||
PORT=3012 NATS_URL=nats://127.0.0.1:4222 node src/server.js
|
||||
curl http://127.0.0.1:3012/review/cust_2
|
||||
curl http://127.0.0.1:3012/quotes/cust_2
|
||||
curl -X PUT http://127.0.0.1:3012/customers/cust_2/pricing \
|
||||
-H 'content-type: application/json' \
|
||||
-d '{"multiplierOverride":0.4,"tierId":"business"}'
|
||||
```
|
||||
|
|
@ -5,8 +5,11 @@ monthly credits, a usage ledger, Stripe metered billing, purchase-order
|
|||
invoicing, a company admin console, a self-service customer portal, and a
|
||||
Zapier integration.
|
||||
|
||||
This is the **billing and user platform** (originally the standalone `zappier` git tree at `~/zappier`). Forgejo name: **zappier-edge**. It owns signup, TOTP, API keys, rate card, Stripe meter, PO invoices, admin users, and the customer portal. Verae middleware does not replace this.
|
||||
|
||||
**Forgejo:** https://git.georgelambert.org/marchon/zappier-edge
|
||||
**Catalog README:** https://zapier.georgelambert.org/packages/zappier/README.pdf
|
||||
**Catalog README:** https://zapier.georgelambert.org/packages/zappier/README.pdf
|
||||
**Bring the whole system online:** https://zapier.georgelambert.org/packages/verae-ops/GETTING-STARTED.pdf
|
||||
|
||||
## Documentation (public PDFs)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue