@volter/twin-postmark 0.1.1 → 0.1.2

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.
@@ -20,7 +20,7 @@
20
20
  // DELIVERY PLAN. A sent email progresses through a DETERMINISTIC, OFFLINE outcome the twin
21
21
  // drives — no SMTP, no network. `deliveryPlan()` is pure so the twin + its tests are
22
22
  // repeatable.
23
- import { projectResources } from '@volter/world-core';
23
+ import { projectResources, deliveryTraceHeaders } from '@volter/world-core';
24
24
  import { appDestination, appFetch } from '@volter/world-core/app-route';
25
25
  import { worldEgressRefusal } from '@volter/world-core/network-policy';
26
26
  const SERVICE = 'postmark';
@@ -68,7 +68,7 @@ const httpDelivery = async (url, body, headers) => {
68
68
  if (!appDestination(url) && worldEgressRefusal(url) !== null)
69
69
  return; // the World's egress rule, the application's own hostnames reaching it inside the World: refused like an unreachable endpoint
70
70
  try {
71
- await appFetch(url, { method: 'POST', headers, body });
71
+ await appFetch(url, { method: 'POST', headers: { ...headers, ...deliveryTraceHeaders() }, body });
72
72
  }
73
73
  catch {
74
74
  /* fire-and-forget, like the real vendor */
@@ -16,11 +16,11 @@
16
16
  // PURE FRONTEND (R3): the mirror imports no handler and no twin internals — it MOUNTS the pack's
17
17
  // own fetch adapter as its API backend and reads every byte of state back over the wire.
18
18
  import { readFile } from 'node:fs/promises';
19
- import { bundleClient, fileResponse } from '@volter/world-core';
19
+ import { bundleClient, fileResponse, filePathOf } from '@volter/world-core';
20
20
  import { serveHttp } from '@volter/world-core';
21
21
  import { createPostmarkTwinFetch } from "./postmark-server.js";
22
- const CLIENT_ENTRY = () => new URL('../client/postmark-mirror.tsx', import.meta.url).pathname; // lazy: workerd rejects top-level relative URL from import.meta.url (bundled via pack index)
23
- const CLIENT_CSS = () => new URL('../client/postmark-mirror.css', import.meta.url).pathname; // lazy: workerd rejects top-level relative URL from import.meta.url (bundled via pack index)
22
+ const CLIENT_ENTRY = () => filePathOf(new URL('../client/postmark-mirror.tsx', import.meta.url)); // lazy: workerd rejects top-level relative URL from import.meta.url (bundled via pack index)
23
+ const CLIENT_CSS = () => filePathOf(new URL('../client/postmark-mirror.css', import.meta.url)); // lazy: workerd rejects top-level relative URL from import.meta.url (bundled via pack index)
24
24
  /** The recipients of an outbound message, as a readable list. */
25
25
  export function recipientsOf(m) {
26
26
  if (Array.isArray(m?.Recipients))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/twin-postmark",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Local Postmark twin — a faithful, stateful local Postmark transactional-email API your real `postmark` SDK talks to unmodified. Plain/templated/batch sends, outbound + inbound message activity, bounces and delivery stats, templates, message streams, suppressions, webhooks, servers, domains and sender signatures. Deterministic offline delivery lifecycle and Postmark's real (unsigned, Basic-auth/custom-header) webhooks. Activity mirror UI. Built on @volter/world-core.",
5
5
  "keywords": [
6
6
  "twin",
@@ -58,10 +58,10 @@
58
58
  "react-dom": "^19.2.7"
59
59
  },
60
60
  "peerDependencies": {
61
- "@volter/world-core": "2.0.1"
61
+ "@volter/world-core": "2.0.2"
62
62
  },
63
63
  "devDependencies": {
64
- "@volter/world-core": "2.0.1",
64
+ "@volter/world-core": "2.0.2",
65
65
  "@volter/world-tooling": "0.1.0",
66
66
  "postmark": "^4.0.5",
67
67
  "@types/bun": "^1.2.20",
@@ -20,7 +20,7 @@
20
20
  // DELIVERY PLAN. A sent email progresses through a DETERMINISTIC, OFFLINE outcome the twin
21
21
  // drives — no SMTP, no network. `deliveryPlan()` is pure so the twin + its tests are
22
22
  // repeatable.
23
- import { projectResources } from '@volter/world-core';
23
+ import { projectResources, deliveryTraceHeaders } from '@volter/world-core';
24
24
  import { appDestination, appFetch } from '@volter/world-core/app-route';
25
25
  import { worldEgressRefusal } from '@volter/world-core/network-policy';
26
26
 
@@ -80,7 +80,7 @@ export function webhookHeaders(webhook: Record<string, unknown>): Record<string,
80
80
  const httpDelivery: PostmarkWebhookDelivery = async (url, body, headers) => {
81
81
  if (!appDestination(url) && worldEgressRefusal(url) !== null) return; // the World's egress rule, the application's own hostnames reaching it inside the World: refused like an unreachable endpoint
82
82
  try {
83
- await appFetch(url, { method: 'POST', headers, body });
83
+ await appFetch(url, { method: 'POST', headers: { ...headers, ...deliveryTraceHeaders() }, body });
84
84
  } catch {
85
85
  /* fire-and-forget, like the real vendor */
86
86
  }
@@ -16,12 +16,12 @@
16
16
  // PURE FRONTEND (R3): the mirror imports no handler and no twin internals — it MOUNTS the pack's
17
17
  // own fetch adapter as its API backend and reads every byte of state back over the wire.
18
18
  import { readFile } from 'node:fs/promises';
19
- import { bundleClient, fileResponse } from '@volter/world-core';
19
+ import { bundleClient, fileResponse, filePathOf } from '@volter/world-core';
20
20
  import { serveHttp } from '@volter/world-core';
21
21
  import { createPostmarkTwinFetch } from './postmark-server.ts';
22
22
 
23
- const CLIENT_ENTRY = () => new URL('../client/postmark-mirror.tsx', import.meta.url).pathname; // lazy: workerd rejects top-level relative URL from import.meta.url (bundled via pack index)
24
- const CLIENT_CSS = () => new URL('../client/postmark-mirror.css', import.meta.url).pathname; // lazy: workerd rejects top-level relative URL from import.meta.url (bundled via pack index)
23
+ const CLIENT_ENTRY = () => filePathOf(new URL('../client/postmark-mirror.tsx', import.meta.url)); // lazy: workerd rejects top-level relative URL from import.meta.url (bundled via pack index)
24
+ const CLIENT_CSS = () => filePathOf(new URL('../client/postmark-mirror.css', import.meta.url)); // lazy: workerd rejects top-level relative URL from import.meta.url (bundled via pack index)
25
25
 
26
26
  // ---------------------------------------------------------------------------
27
27
  // Pure, dependency-free render/format helpers (no `@volter/world-core`, no `Bun`, no handler).