@crvouga/mockingbird-service-firstpromoter 2.3.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 +25 -5
- package/DISCOVERY.md +2 -2
- package/README.md +10 -10
- package/SUPPORT.md +2 -2
- package/dist/{chunk-2QGQ2BZZ.js → chunk-PNMV6J5F.js} +34 -4
- package/dist/chunk-PNMV6J5F.js.map +7 -0
- package/dist/{chunk-GYQ7E2BK.js → chunk-QU4LWLGV.js} +5 -5
- package/dist/chunk-QU4LWLGV.js.map +7 -0
- package/dist/cli.js +2 -2
- package/dist/index.js +1 -1
- package/dist/server.js +2 -2
- package/openapi.yaml +1 -1
- package/package.json +3 -3
- package/dist/chunk-2QGQ2BZZ.js.map +0 -7
- package/dist/chunk-GYQ7E2BK.js.map +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
# Changelog — @crvouga/mockingbird-service-firstpromoter
|
|
2
2
|
|
|
3
|
-
##
|
|
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
|
+
|
|
13
|
+
## 3.0.0 (2026-10-07)
|
|
14
|
+
|
|
15
|
+
### ⚠️ Breaking changes
|
|
16
|
+
|
|
17
|
+
- point the repo at crvouga/mockingbird ([1bf35a4](https://github.com/crvouga/mockingbird/commit/1bf35a422b84a85b50b09b72bd7cc7093082a86e))
|
|
18
|
+
- point the repo at crvouga/emulates ([cdb5e53](https://github.com/crvouga/mockingbird/commit/cdb5e536ed8c1f52345e3984f089001c25fdb08a))
|
|
19
|
+
- rename Emulators to Emulates ([2e10d9c](https://github.com/crvouga/mockingbird/commit/2e10d9cff84c54ac37768fc9a19d1aefd3943744))
|
|
20
|
+
- rebrand Mockingbird to Emulators ([1adca65](https://github.com/crvouga/mockingbird/commit/1adca65ce28242f11cff98eac05d2be88f680cbe))
|
|
21
|
+
|
|
22
|
+
### Fixes and improvements
|
|
23
|
+
|
|
24
|
+
- typecheck the brand gate before builds ([fc36095](https://github.com/crvouga/mockingbird/commit/fc3609514de70ffe3170a5d216fb8a49f9ce7cbb))
|
|
25
|
+
- format the emulates records query ([8698872](https://github.com/crvouga/mockingbird/commit/8698872509d06002be5a8fcdc85d79f8462320c3))
|
|
26
|
+
|
|
27
|
+
## 2.3.0 (2026-10-04)
|
|
4
28
|
|
|
5
29
|
### Features
|
|
6
30
|
|
|
@@ -18,10 +42,6 @@
|
|
|
18
42
|
- reconcile combined PR integration ([124d5be](https://github.com/crvouga/mockingbird/commit/124d5bed7576535ff481ce6da7d2369957799665))
|
|
19
43
|
- preserve inferred form headers ([02bdd28](https://github.com/crvouga/mockingbird/commit/02bdd2806a9a934607ecd7ffd0cfbe4f6ba80c91))
|
|
20
44
|
|
|
21
|
-
### Dependencies
|
|
22
|
-
|
|
23
|
-
- `@crvouga/mockingbird-service-sqlite`
|
|
24
|
-
|
|
25
45
|
## 2.2.0 (2026-10-04)
|
|
26
46
|
|
|
27
47
|
### 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
|
|
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
|
|
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
|
-
>
|
|
3
|
+
> Local emulators. Real API contracts. Part of [Mockingbird](https://github.com/crvouga/mockingbird).
|
|
4
4
|
|
|
5
|
-
Stateful
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
166
|
-
| `createRuntime` | function | The
|
|
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
|
|
6
|
+
- supported by the emulator: **16**
|
|
7
7
|
- parity enabled: **16**
|
|
8
8
|
|
|
9
|
-
| operationId | route |
|
|
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 | ✅ | |
|