@whooshbang/contract-mock 3.1.0 → 3.3.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
@@ -5,6 +5,15 @@ recorded here.
5
5
 
6
6
  ## Unreleased
7
7
 
8
+ ## 3.3.0
9
+
10
+ - Built against contracts 3.3.0 and SDK 4.3.0 for message search, list filters and category visibility settings.
11
+ - Update Hono to 4.13.11, including the upstream `serveStatic` security fix.
12
+
13
+ ## 3.2.0
14
+
15
+ - Built against contracts 3.2.0 and SDK 4.2.0 (message categories, additive).
16
+
8
17
  ## 3.1.0
9
18
 
10
19
  - Built against contracts 3.1.0 and SDK 4.1.0 (additive fields and the resume route).
package/dist/core.js CHANGED
@@ -421,6 +421,8 @@ function defaultProjectRecipientExperience(state, project) {
421
421
  display_name: "My App",
422
422
  },
423
423
  default_locale: project.default_locale,
424
+ show_service_category_switches: true,
425
+ show_marketing_category_switches: true,
424
426
  diagnostic_id: state.idGenerator("diagnostic"),
425
427
  project_id: project.id,
426
428
  row_version: 1,
@@ -1246,6 +1248,26 @@ async function createConnectionFingerprint(request) {
1246
1248
  }
1247
1249
  function problem(code, status, diagnosticId, overrides = {}) {
1248
1250
  const defaults = {
1251
+ category_conflict: {
1252
+ detail: "The message category could not be changed.",
1253
+ retryable: false,
1254
+ title: "Message category conflict",
1255
+ },
1256
+ category_not_found: {
1257
+ detail: "No category with that key in this project.",
1258
+ retryable: false,
1259
+ title: "Message category not found",
1260
+ },
1261
+ category_purpose_mismatch: {
1262
+ detail: "The message purpose must match its category. Nothing was sent or charged.",
1263
+ retryable: false,
1264
+ title: "Purpose and category do not match",
1265
+ },
1266
+ category_turned_off: {
1267
+ detail: "The subscriber turned off this message category. Nothing was sent or charged.",
1268
+ retryable: false,
1269
+ title: "Message category turned off",
1270
+ },
1249
1271
  not_consented_for_marketing: {
1250
1272
  detail: "This binding is enrolled for service email only. Nothing was sent or charged.",
1251
1273
  retryable: false,
@@ -4379,7 +4401,8 @@ function addPublicRoutes(app, getState, options) {
4379
4401
  if (parsed.value.row_version !== current.row_version) {
4380
4402
  return problemResponse(problem("recipient_configuration_invalid", 409, state.idGenerator("diagnostic")));
4381
4403
  }
4382
- const requestedAssetId = parsed.value.brand.logo_asset_id;
4404
+ const brand = parsed.value.brand ?? current.brand;
4405
+ const requestedAssetId = brand.logo_asset_id;
4383
4406
  if (requestedAssetId !== undefined) {
4384
4407
  const asset = state.recipientBrandAssets.get(requestedAssetId);
4385
4408
  if (asset === undefined ||
@@ -4389,8 +4412,15 @@ function addPublicRoutes(app, getState, options) {
4389
4412
  }
4390
4413
  }
4391
4414
  const next = {
4392
- brand: parsed.value.brand,
4393
- default_locale: parsed.value.default_locale,
4415
+ brand,
4416
+ default_locale: parsed.value.default_locale ?? current.default_locale,
4417
+ email_answer_confirmation: parsed.value.email_answer_confirmation ??
4418
+ current.email_answer_confirmation ??
4419
+ "one_click",
4420
+ show_service_category_switches: parsed.value.show_service_category_switches ??
4421
+ current.show_service_category_switches,
4422
+ show_marketing_category_switches: parsed.value.show_marketing_category_switches ??
4423
+ current.show_marketing_category_switches,
4394
4424
  diagnostic_id: state.idGenerator("diagnostic"),
4395
4425
  project_id: projectId,
4396
4426
  row_version: current.row_version + 1,