@crvouga/mockingbird-service-firstpromoter 3.5.0 → 3.7.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 +13 -1
- package/README.md +13 -2
- package/SUPPORT.md +4 -3
- package/dist/{chunk-OHWRVHV3.js → chunk-G6BNGSL2.js} +254 -72
- package/dist/chunk-G6BNGSL2.js.map +7 -0
- package/dist/{chunk-7CHQ5LSK.js → chunk-HXG7KBUR.js} +315 -51
- package/dist/chunk-HXG7KBUR.js.map +7 -0
- package/dist/cli.js +2 -2
- package/dist/index.d.ts +62 -7
- package/dist/index.js +1 -1
- package/dist/server.d.ts +99 -3
- package/dist/server.js +2 -2
- package/openapi.yaml +55 -1
- package/package.json +1 -1
- package/dist/chunk-7CHQ5LSK.js.map +0 -7
- package/dist/chunk-OHWRVHV3.js.map +0 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
# Changelog — @crvouga/mockingbird-service-firstpromoter
|
|
2
2
|
|
|
3
|
-
## 3.
|
|
3
|
+
## 3.7.0 (2026-10-19)
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- resolve the agent-reported issue queue in one batch ([25c52b6](https://github.com/crvouga/mockingbird/commit/25c52b668a53ddb80b968419601a20abf33f956b))
|
|
8
|
+
|
|
9
|
+
## 3.6.0 (2026-10-16)
|
|
10
|
+
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
- resolve fleet and emulator issue batch ([26d2f8c](https://github.com/crvouga/mockingbird/commit/26d2f8cee99fefed93192204bac44fb1be35c1da))
|
|
14
|
+
|
|
15
|
+
## 3.5.0 (2026-10-15)
|
|
4
16
|
|
|
5
17
|
### Features
|
|
6
18
|
|
package/README.md
CHANGED
|
@@ -74,11 +74,12 @@ await server.close()
|
|
|
74
74
|
| --- | --- |
|
|
75
75
|
| `POST /v2/company/promoters` | `{email, cust_id?, profile?: {first_name, last_name}, drip_emails?, initial_campaign_id?}` → the promoter (`FirstPromoterV2ResponseSchema`), enrolled in the default campaign with a `ref_token` (first name + digits) and `ref_link` `https://acme.example/referrals?fpr=<token>`. A live promoter with the same email or `cust_id` is 422 `{message, errors: {email: ["has already been taken"]}}`. |
|
|
76
76
|
| `GET /v2/company/promoters?page=&per_page=` | `{data: [promoter], meta: {pending_count}}`; archived promoters are left out. |
|
|
77
|
-
| `GET /v2/company/promoters/{value}?find_by=id\|cust_id\|ref_token\|email` | One promoter (archived ones too, with `archived_at`), or 404 `{message: "Promoter not found"}`. |
|
|
77
|
+
| `GET /v2/company/promoters/{value}?find_by=id\|cust_id\|auth_token\|ref_token\|promo_code\|email` | One promoter (archived ones too, with `archived_at`), or 404 `{message: "Promoter not found"}`. `promo_code` resolves codes seeded through `POST /__admin/promo-codes` to the promoter owning that campaign enrolment. `auth_token` is a deterministic per-promoter token that `POST` / `GET /__admin/promoters` report as `auth_token` (the vendor's promoter schema has no such field, so the promoter body does not carry it). Any other `find_by` is 400. |
|
|
78
78
|
| `PUT /v2/company/promoters/{id}` | `{cust_id?, email?, note?, profile?}` → the promoter; 404 / 422 as above. |
|
|
79
79
|
| `POST /v2/company/promoters/archive` | `{ids: [..]}` → a completed batch `{id, status, total, selected_total, processed_count, failed_count, action_label, progress, processing_errors, …}`. |
|
|
80
80
|
| `POST /v2/promoters/iframe_login?promoter_id=` | `{access_token, expires_in}`, or 404. |
|
|
81
81
|
| `POST /v2/track/signup` | `{email, tid? \| promoter_id? \| ref_id?, uid?, skip_email_notification?}` → the referral. An unknown `tid`, promoter or ref token is 404; none of them is 400; an email already tracked is 422. With `autoConvert` (default on) the referral becomes a customer at once and `lead_becomes_referral` is posted. |
|
|
82
|
+
| `PUT /v2/company/commissions/{id}` | `{internal_note?, external_note?}` (the vendor's `CommissionUpdate`) → the updated commission, reflected in `GET /v2/company/commissions`; other fields are not writable. An unknown id is 404 `{message: "Commission not found", code: "not_found"}`. |
|
|
82
83
|
| `GET /v2/company/referrals` | A bare array of stored referrals and live promoter/campaign metadata. `q` searches email/uid; `ids[]`, `filters[type]=lead\|customer`, `filters[state]`, `filters[promoter_id]`, and inclusive `filters[created_at\|customer_since][from\|to]` filter before paging. `page` starts at 1; `per_page` defaults to 20 (max 100). Exhausted pages and unmatched searches return `[]`. |
|
|
83
84
|
| `GET /v2/company/referrals/{id}` | The same referral projection as listing. A numeric ID or `find_by=email\|uid` selects it; missing records are 404. |
|
|
84
85
|
|
|
@@ -146,6 +147,16 @@ Codes must be seeded through the admin control; tokens must belong to the referr
|
|
|
146
147
|
campaign. All validation precedes sale/commission/balance writes; snapshots/reset include event
|
|
147
148
|
deduplication. A successful sale preserves the existing conversion webhook behavior.
|
|
148
149
|
|
|
150
|
+
When no lead matches `email` / `uid`, the vendor's [tracking contract](https://github.com/firstpromoter/docs/blob/d4e9e6f16bf4801c524508d2809a425ea6419d7d/api-reference-v2/api-admin/tracking-api/openapi-v2-tracking.json)
|
|
151
|
+
lets `tid` or `ref_id` "bypass the signup tracking": the lead is created and the sale assigned in
|
|
152
|
+
one request. The emulator does the same when the `tid` (a click from `POST /__admin/clicks`) or
|
|
153
|
+
`ref_id` resolves to a live promoter and the request names the lead by `email`; the new lead counts
|
|
154
|
+
toward the promoter's referrals, becomes a customer and posts `lead_becomes_referral`. The
|
|
155
|
+
vendor documents nothing further for `promo_code` ("For promo code tracking"), so creating a lead
|
|
156
|
+
from a seeded `promo_code` alone is opt-in: `PUT /__admin/settings {"promoCodeCreatesReferral": true}`
|
|
157
|
+
(default `false`, where it stays a 404). `uid` alone cannot name a new lead, and an `email` that is
|
|
158
|
+
already a lead under another `uid` is 422 (as in signup tracking).
|
|
159
|
+
|
|
149
160
|
### Namespaces
|
|
150
161
|
|
|
151
162
|
`x-mockingbird-namespace`, a `/__admin/ns/<name>` prefix in `FIRST_PROMOTER_API_URL`, or by API key:
|
|
@@ -161,7 +172,7 @@ deduplication. A successful sale preserves the existing conversion webhook behav
|
|
|
161
172
|
- Refunds, standalone commission creation/editing/approval, cash payouts and commission filters
|
|
162
173
|
beyond those listed above; fraud checks;
|
|
163
174
|
public promo-code provisioning; the hosted affiliate portal behind the iframe token.
|
|
164
|
-
-
|
|
175
|
+
- Creating a lead from `promo_code` alone is off by default (`promoCodeCreatesReferral`): the vendor documents the one-step bypass only for `tid` and `ref_id` and the promo-code behavior is unverified against the live API.
|
|
165
176
|
Currency is recorded without foreign-exchange conversion; plan-specific rewards, quantity/MRR
|
|
166
177
|
calculations, multiple reward tiers, split commissions and notification emails are unmodelled.
|
|
167
178
|
Commission rounding and immediate approval are deterministic emulator policies, not live-verified
|
package/SUPPORT.md
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Generated from `openapi.yaml`; do not edit by hand.
|
|
4
4
|
|
|
5
|
-
- operations in spec: **
|
|
6
|
-
- supported by the emulator: **
|
|
7
|
-
- parity enabled: **
|
|
5
|
+
- operations in spec: **17**
|
|
6
|
+
- supported by the emulator: **17**
|
|
7
|
+
- parity enabled: **17**
|
|
8
8
|
|
|
9
9
|
| operationId | route | emulator | parity | notes |
|
|
10
10
|
| --- | --- | --- | --- | --- |
|
|
@@ -20,6 +20,7 @@ Generated from `openapi.yaml`; do not edit by hand.
|
|
|
20
20
|
| `ListCommissions` | `GET /v2/company/commissions` | ✅ supported | ✅ | |
|
|
21
21
|
| `FulfillCommissions` | `POST /v2/company/commissions/mark_fulfilled` | ✅ supported | ⚠️ unsafe (opt-in) | |
|
|
22
22
|
| `DestroyCommissions` | `DELETE /v2/company/commissions/destroy` | ✅ supported | ⚠️ unsafe (opt-in) | |
|
|
23
|
+
| `UpdateCommission` | `PUT /v2/company/commissions/{id}` | ✅ supported | ⚠️ unsafe (opt-in) | |
|
|
23
24
|
| `ListBatchProcesses` | `GET /v2/company/batch_processes` | ✅ supported | ✅ | |
|
|
24
25
|
| `BatchProcessProgress` | `GET /v2/company/batch_processes/progress` | ✅ supported | ✅ | |
|
|
25
26
|
| `GetBatchProcess` | `GET /v2/company/batch_processes/{id}` | ✅ supported | ✅ | |
|