@crvouga/mockingbird-service-firstpromoter 3.0.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog — @crvouga/mockingbird-service-firstpromoter
2
2
 
3
+ ## 3.1.0 (2026-10-08)
4
+
5
+ ### Features
6
+
7
+ - redesign emulator experience ([d6038c2](https://github.com/crvouga/mockingbird/commit/d6038c27eebbaa1751f02bc9305002a5b1304779))
8
+
9
+ ### Dependencies
10
+
11
+ - `@crvouga/mockingbird-service-sqlite`
12
+
3
13
  ## 3.0.0 (2026-10-07)
4
14
 
5
15
  ### ⚠️ Breaking changes
@@ -14,10 +24,6 @@
14
24
  - typecheck the brand gate before builds ([fc36095](https://github.com/crvouga/mockingbird/commit/fc3609514de70ffe3170a5d216fb8a49f9ce7cbb))
15
25
  - format the emulates records query ([8698872](https://github.com/crvouga/mockingbird/commit/8698872509d06002be5a8fcdc85d79f8462320c3))
16
26
 
17
- ### Dependencies
18
-
19
- - `@crvouga/mockingbird-service-sqlite`
20
-
21
27
  ## 2.3.0 (2026-10-04)
22
28
 
23
29
  ### Features
package/DISCOVERY.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # @crvouga/mockingbird-service-firstpromoter discovery
2
2
 
3
3
  This is the installed-package index for coding agents and tooling. All relative links resolve
4
- inside `node_modules/@crvouga/mockingbird-service-firstpromoter/`; no repository checkout is needed to discover the mock's
4
+ inside `node_modules/@crvouga/mockingbird-service-firstpromoter/`; no repository checkout is needed to discover the emulator's
5
5
  supported surface or documented behavior.
6
6
 
7
7
  ## Capability and behavior sources
@@ -48,7 +48,7 @@ designed for assertions and diagnosis by consuming test suites.
48
48
  ## Report a mismatch or missing capability
49
49
 
50
50
  Follow the [agent reporting contract](https://github.com/crvouga/mockingbird/blob/main/docs/REPORTING_ISSUES.md). Include package version,
51
- operation/command, a minimal redacted request, actual mock result, expected oracle result or vendor
51
+ operation/command, a minimal redacted request, actual emulator result, expected oracle result or vendor
52
52
  documentation, and whether the mismatch appears in the matrix. Never include keys, tokens,
53
53
  customer data, prompts, PHI, card data, or unredacted recordings.
54
54
 
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # @crvouga/mockingbird-service-firstpromoter
2
2
 
3
- > Familiar calls. Faithful echoes. Part of [Mockingbird](https://github.com/crvouga/mockingbird).
3
+ > Local emulators. Real API contracts. Part of [Mockingbird](https://github.com/crvouga/mockingbird).
4
4
 
5
- Stateful mock of the **FirstPromoter v2** affiliate API for test suites: promoter create (adopt
5
+ Stateful emulator of the **FirstPromoter v2** affiliate API for test suites: promoter create (adopt
6
6
  before create by `cust_id`), lookups by id / `cust_id` / `ref_token` / email, list, update,
7
7
  archive, the dashboard iframe login, signup tracking by click `tid`, `promoter_id` or ref token,
8
8
  and the Basic-auth `lead_becomes_referral` webhook our backend receives. Every request is
@@ -25,7 +25,7 @@ with any Fetch server.
25
25
 
26
26
  ## Usage
27
27
 
28
- Point `FIRST_PROMOTER_API_URL` at the mock (our Joi schema requires `https`, so either front it
28
+ Point `FIRST_PROMOTER_API_URL` at the emulator (our Joi schema requires `https`, so either front it
29
29
  with TLS or relax that rule in the stack), set any `FIRST_PROMOTER_API_KEY` and
30
30
  `FIRST_PROMOTER_ACCOUNT_ID`, and pass the webhook Basic-auth pair as `--webhook-secret`.
31
31
 
@@ -53,7 +53,7 @@ const admin = (path: string, body: unknown) =>
53
53
  // An existing affiliate, and a click on their link: the tid checkout stores as fp_tid.
54
54
  await admin("/promoters", { email: "nate@example.com", ref_token: "nate91" })
55
55
  const { tid } = (await (await admin("/clicks", { ref_token: "nate91" })).json()) as { tid: string }
56
- // …the app's invoice handler posts POST /v2/track/signup {email, tid}; the mock converts the
56
+ // …the app's invoice handler posts POST /v2/track/signup {email, tid}; the emulator converts the
57
57
  // referral and posts lead_becomes_referral to the backend with Authorization: Basic…
58
58
  ```
59
59
 
@@ -113,7 +113,7 @@ Commission reconciliation follows FirstPromoter's [published contract](https://g
113
113
  ranges and creation-date ranges. `POST …/commissions/mark_fulfilled` fulfills nonmonetary
114
114
  commissions; `DELETE …/commissions/destroy` deletes selected commissions. Both take `{ids}`.
115
115
  Batches of at most five IDs return 200/completed; larger batches return 202/pending. In the
116
- mock they move to in_progress after the clock advances and complete at 1,000 ms, on the next
116
+ emulator they move to in_progress after the clock advances and complete at 1,000 ms, on the next
117
117
  authenticated API call. The batch collections and pending work participate in reset and snapshots.
118
118
  `GET …/batch_processes` and `…/batch_processes/progress` list unfinished work by default
119
119
  (`filters[status]` selects another status); `GET …/batch_processes/{id}` returns counts and
@@ -144,16 +144,16 @@ deduplication. A successful sale preserves the existing conversion webhook behav
144
144
 
145
145
  - Error bodies and exact status codes of the real API are unverified (no sandbox credentials):
146
146
  errors use `{message}` and validation `{message, errors: {field: [...]}}`. Our consumer only
147
- branches on `ok` / 404, which the mock gets right.
147
+ branches on `ok` / 404, which the emulator gets right.
148
148
  - The v1 API our EMR backend still calls (`/v1/promoters/*`, `/v1/track/signup`,
149
- `/v1/reports/campaigns`); the catalog scopes this mock to v2.
149
+ `/v1/reports/campaigns`); the catalog scopes this emulator to v2.
150
150
  - Refunds, standalone commission creation/editing/approval, cash payouts and commission filters
151
151
  beyond those listed above; fraud checks;
152
152
  public promo-code provisioning; the hosted affiliate portal behind the iframe token.
153
153
  - Sale tracking requires an existing referral (the vendor's one-step signup bypass is unmodelled).
154
154
  Currency is recorded without foreign-exchange conversion; plan-specific rewards, quantity/MRR
155
155
  calculations, multiple reward tiers, split commissions and notification emails are unmodelled.
156
- Commission rounding and immediate approval are deterministic mock policies, not live-verified
156
+ Commission rounding and immediate approval are deterministic emulator policies, not live-verified
157
157
  campaign policy. The default campaign reward remains 10 percent, as before.
158
158
  - Referral editing/deletion, username/website profile provisioning, cancelled-date filters and split attribution.
159
159
  - Promoter ids are sequential from 4800001 per namespace.
@@ -162,8 +162,8 @@ deduplication. A successful sale preserves the existing conversion webhook behav
162
162
 
163
163
  | Export | Kind | Description |
164
164
  | --- | --- | --- |
165
- | `FirstPromoterAPI` | class | The in-process mock: `fetch(request)`, `reset()`, `render(promoter)`, `click(refToken)`, `convert(referralId, saleAmount?)`, `seedPromoter(input)`, `state`. Options: `sqlite`, `now`, `namespace`, `settings`, `onWebhook`. |
166
- | `createRuntime` | function | The mock with the full service contract (health, admin, namespaces, credentials, presets, webhooks). Options: `webhooks: {url, secret, retryDelaysMs?, fetch?}`, `settings`, `clock`, `seed`, `adminKey`, `onLog`, `sqlite`. |
165
+ | `FirstPromoterAPI` | class | The in-process emulator: `fetch(request)`, `reset()`, `render(promoter)`, `click(refToken)`, `convert(referralId, saleAmount?)`, `seedPromoter(input)`, `state`. Options: `sqlite`, `now`, `namespace`, `settings`, `onWebhook`. |
166
+ | `createRuntime` | function | The emulator with the full service contract (health, admin, namespaces, credentials, presets, webhooks). Options: `webhooks: {url, secret, retryDelaysMs?, fetch?}`, `settings`, `clock`, `seed`, `adminKey`, `onLog`, `sqlite`. |
167
167
  | `FIRSTPROMOTER_PRESETS` | object | Every named fault preset. |
168
168
  | `FIRSTPROMOTER_NAMESPACE` | string | The service name, `"firstpromoter"`. |
169
169
  | `WEBHOOK_PATH` | string | Our receiver's path, `/users/webhooks/first-promoter`. |
package/SUPPORT.md CHANGED
@@ -3,10 +3,10 @@
3
3
  Generated from `openapi.yaml`; do not edit by hand.
4
4
 
5
5
  - operations in spec: **16**
6
- - supported by the mock: **16**
6
+ - supported by the emulator: **16**
7
7
  - parity enabled: **16**
8
8
 
9
- | operationId | route | mock | parity | notes |
9
+ | operationId | route | emulator | parity | notes |
10
10
  | --- | --- | --- | --- | --- |
11
11
  | `TrackSignup` | `POST /v2/track/signup` | ✅ supported | ⚠️ unsafe (opt-in) | |
12
12
  | `ListPromoters` | `GET /v2/company/promoters` | ✅ supported | ✅ | |