@crvouga/mockingbird-service-firstpromoter 3.7.0 → 3.8.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,6 +1,13 @@
1
1
  # Changelog — @crvouga/mockingbird-service-firstpromoter
2
2
 
3
- ## 3.7.0 (2026-10-19)
3
+ ## 3.8.0 (2026-10-21)
4
+
5
+ ### Features
6
+
7
+ - raise the serve and fleet body limit to the S3 maximum ([86b9e2b](https://github.com/crvouga/mockingbird/commit/86b9e2b80bcaaaef57f52edbac50b27da0b42f33))
8
+ - validate block limits, filter nutrients, list block children ([2acb823](https://github.com/crvouga/mockingbird/commit/2acb823ba66b30f3d03221996e015c127b0f72c6))
9
+
10
+ ## 3.7.0 (2026-10-18)
4
11
 
5
12
  ### Features
6
13
 
package/README.md CHANGED
@@ -110,7 +110,7 @@ is `user:pass`. Non-2xx answers are retried; `GET /__admin/webhooks`, `…/event
110
110
  | `POST /__admin/referrals/:id/convert` | `{saleAmount?}`: the lead paid; credits the promoter (percent reward × amount) and posts the webhook. |
111
111
  | `POST /__admin/commissions` | Seed a commission against an existing `{promoter_campaign_id, amount, unit?, status?, fulfilled?, is_paid?, referral_id?, sale_amount?, event_id?}`. Defaults: approved, points, unfulfilled/unpaid. A referral must belong to that promoter and campaign. |
112
112
  | `POST /__admin/promo-codes` | Seed `{promo_code, promoter_campaign_id}` against an existing promoter campaign for sale attribution tests. |
113
- | `GET\|PUT /__admin/settings` | `{website?, defaultCampaignId?, autoConvert?, campaigns?}` (campaigns carry `referralRewards` / `promoterRewards` with `coupon`, `amount`, `unit`, `per_of_sale`). The default campaign's referral coupon is `ACME50`. |
113
+ | `GET\|PUT /__admin/settings` | `{website?, defaultCampaignId?, autoConvert?, promoCodeCreatesReferral?, campaigns?}` (campaigns carry `referralRewards` / `promoterRewards` with `coupon`, `amount`, `unit`, `per_of_sale`). The default campaign's referral coupon is `ACME50`. |
114
114
 
115
115
  Fault presets (`POST /__admin/faults {"preset": "<name>", "count"?: n}`; `GET /__admin/faults/presets`):
116
116
  `created_but_500` (stored, then 500: the retry must adopt by `cust_id`), `lookup_unavailable`
@@ -151,11 +151,19 @@ When no lead matches `email` / `uid`, the vendor's [tracking contract](https://g
151
151
  lets `tid` or `ref_id` "bypass the signup tracking": the lead is created and the sale assigned in
152
152
  one request. The emulator does the same when the `tid` (a click from `POST /__admin/clicks`) or
153
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).
154
+ toward the promoter's referrals, becomes a customer and posts `lead_becomes_referral`. This is
155
+ docs-verified (the tracking OpenAPI above), not oracle-verified. `uid` alone cannot name a new lead,
156
+ and an `email` that is already a lead under another `uid` is 422 (as in signup tracking).
157
+
158
+ **`promo_code` alone: best guess, not oracle-verified.** The vendor documents nothing further for
159
+ `promo_code` ("For promo code tracking"), so whether a sale carrying only a promo code creates the
160
+ lead is unobserved. Default (`promoCodeCreatesReferral: false`): a sale for an unknown buyer with
161
+ only `promo_code` is the same 404 as any unattributed sale, and nothing is stored. Opt in with
162
+ `PUT /__admin/settings {"promoCodeCreatesReferral": true}` to have a code seeded through
163
+ `POST /__admin/promo-codes` create the lead (needs `email`), assign the sale to the promoter owning
164
+ that campaign enrolment, and post `lead_becomes_referral`, exactly like `tid` / `ref_id`. An
165
+ unseeded code is 404 in both modes. Treat a test that depends on this setting as depending on an
166
+ emulator assumption until a live response is captured.
159
167
 
160
168
  ### Namespaces
161
169
 
@@ -172,8 +180,8 @@ already a lead under another `uid` is 422 (as in signup tracking).
172
180
  - Refunds, standalone commission creation/editing/approval, cash payouts and commission filters
173
181
  beyond those listed above; fraud checks;
174
182
  public promo-code provisioning; the hosted affiliate portal behind the iframe token.
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.
176
- Currency is recorded without foreign-exchange conversion; plan-specific rewards, quantity/MRR
183
+ - 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`, so the opt-in behavior is a best guess, not oracle-verified.
184
+ - Currency is recorded without foreign-exchange conversion; plan-specific rewards, quantity/MRR
177
185
  calculations, multiple reward tiers, split commissions and notification emails are unmodelled.
178
186
  Commission rounding and immediate approval are deterministic emulator policies, not live-verified
179
187
  campaign policy. The default campaign reward remains 10 percent, as before.
@@ -3057,7 +3057,7 @@ async function preflightFleet(config, options) {
3057
3057
  break;
3058
3058
  }
3059
3059
  }
3060
- targets.set(name, { ...target, packageVersion: packageVersion ?? "3.7.0" });
3060
+ targets.set(name, { ...target, packageVersion: packageVersion ?? "3.8.0" });
3061
3061
  } catch (error) {
3062
3062
  throw new Error(`service ${name}: ${error instanceof Error ? error.message : String(error)}`, { cause: error });
3063
3063
  }
@@ -3283,7 +3283,11 @@ var serve = async (api, options = {}) => {
3283
3283
  // ../../adapters/node/dist/listen.js
3284
3284
  var listen = async (api, options = {}) => {
3285
3285
  const host = options.host ?? "127.0.0.1";
3286
- const server = await serve(api, { port: options.port ?? 0, host });
3286
+ const server = await serve(api, {
3287
+ port: options.port ?? 0,
3288
+ host,
3289
+ ...options.maxBodyBytes !== void 0 ? { maxBodyBytes: options.maxBodyBytes } : {}
3290
+ });
3287
3291
  const address = server.address();
3288
3292
  const port = typeof address === "object" && address !== null ? address.port : options.port ?? 0;
3289
3293
  const shown = host.includes(":") ? `[${host}]` : host;
@@ -3482,7 +3486,8 @@ var httpChild = async (target, entry, options, admission, generation, privateAcc
3482
3486
  try {
3483
3487
  server = await listen(api, {
3484
3488
  port: entry.port ?? target.defaultPort,
3485
- host: entry.host ?? "127.0.0.1"
3489
+ host: entry.host ?? "127.0.0.1",
3490
+ ...target.maxBodyBytes !== void 0 ? { maxBodyBytes: target.maxBodyBytes } : {}
3486
3491
  });
3487
3492
  target.listening?.(server);
3488
3493
  } catch (error) {
@@ -4873,7 +4878,11 @@ var start = async (target, values, config) => {
4873
4878
  });
4874
4879
  if (config.idBase !== void 0)
4875
4880
  runtime.setIdBase?.(config.idBase);
4876
- const listening = await listen(runtime, { port: config.port, host: config.host });
4881
+ const listening = await listen(runtime, {
4882
+ port: config.port,
4883
+ host: config.host,
4884
+ ...target.maxBodyBytes !== void 0 ? { maxBodyBytes: target.maxBodyBytes } : {}
4885
+ });
4877
4886
  target.listening?.(listening);
4878
4887
  console.log(`${target.name} emulator listening on ${listening.url}`);
4879
4888
  console.log(`${target.name} health: GET ${listening.url}${adminPrefix}/health`);
@@ -5025,4 +5034,4 @@ export {
5025
5034
  createServer2 as createServer,
5026
5035
  serveTarget
5027
5036
  };
5028
- //# sourceMappingURL=chunk-HXG7KBUR.js.map
5037
+ //# sourceMappingURL=chunk-C6B3TYF4.js.map