@ingram-tech/nk-marketing 0.2.0 → 0.2.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.
package/README.md CHANGED
@@ -5,8 +5,7 @@ newsletter audiences/subscriptions (broadcast), and **idempotent triggered
5
5
  campaigns** (post-signup drips). RFC 8058 one-click unsubscribe throughout.
6
6
  Sends via [`@ingram-tech/nk-email`](../nk-email).
7
7
 
8
- This is the Postgres-native successor to `@ingram-tech/newsletter` (which was
9
- Supabase-bound). It **owns its tables** and ships the migration; you inject an
8
+ It **owns its tables** and ships the migration; you inject an
10
9
  `@ingram-tech/nk-db` pool (or any `pg` client) and a base URL. It defines its own
11
10
  row types and never reaches into your schema.
12
11
 
package/dist/types.d.ts CHANGED
@@ -3,13 +3,12 @@
3
3
  * and the public option/result shapes. Following the nk-billing precedent, these
4
4
  * are plain typed interfaces read via `db.query<Row>(...)` rather than Zod
5
5
  * schemas: the rows come back from a typed `pg`/nk-db query, not from untyped
6
- * Supabase JSON, so the boundary that the "validate with Zod" rule guards isn't
6
+ * external JSON, so the boundary that the "validate with Zod" rule guards isn't
7
7
  * crossed here.
8
8
  *
9
- * Timestamps are typed as `string` a nextkit site configures `pg` to return
10
- * timestamptz as ISO strings (nk-db's `configureTimestampsAsStrings`). The
11
- * client only ever reads them for null-ness, so the exact representation does
12
- * not matter to this package.
9
+ * Timestamps are typed as `string`. The client only ever reads them for
10
+ * null-ness, so the exact representation `pg` returns does not matter to this
11
+ * package.
13
12
  */
14
13
  /** Row of `marketing_contacts`. */
15
14
  export interface Contact {
@@ -75,7 +74,7 @@ export interface BroadcastOptions {
75
74
  /**
76
75
  * If set, each recipient is claimed in `marketing_deliveries` under this key
77
76
  * before sending, making a re-run idempotent (the issue id is a good value).
78
- * Omit to send unconditionally to every active subscriber (legacy behaviour).
77
+ * Omit to send unconditionally to every active subscriber.
79
78
  */
80
79
  campaignKey?: string;
81
80
  }
@@ -1 +1 @@
1
- {"version":3,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AY,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,eAAe;IAC/B,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,wEAAwE;IACxE,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC7C;AAED,MAAM,MAAM,eAAe,GACxB;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE;AACpB,mDAAmD;GACjD;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE;AAC1B,gEAAgE;GAC9D;IAAE,MAAM,EAAE,WAAW,CAAA;CAAE,CAAC;AAE3B,MAAM,MAAM,iBAAiB,GAC1B;IAAE,MAAM,EAAE,cAAc,CAAC;IAAC,KAAK,EAAE,UAAU,GAAG,QAAQ,CAAA;CAAE;AAC1D,kDAAkD;GAChD;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE;AACvB,qDAAqD;GACnD;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE,CAAC"}
package/dist/types.js CHANGED
@@ -3,13 +3,12 @@
3
3
  * and the public option/result shapes. Following the nk-billing precedent, these
4
4
  * are plain typed interfaces read via `db.query<Row>(...)` rather than Zod
5
5
  * schemas: the rows come back from a typed `pg`/nk-db query, not from untyped
6
- * Supabase JSON, so the boundary that the "validate with Zod" rule guards isn't
6
+ * external JSON, so the boundary that the "validate with Zod" rule guards isn't
7
7
  * crossed here.
8
8
  *
9
- * Timestamps are typed as `string` a nextkit site configures `pg` to return
10
- * timestamptz as ISO strings (nk-db's `configureTimestampsAsStrings`). The
11
- * client only ever reads them for null-ness, so the exact representation does
12
- * not matter to this package.
9
+ * Timestamps are typed as `string`. The client only ever reads them for
10
+ * null-ness, so the exact representation `pg` returns does not matter to this
11
+ * package.
13
12
  */
14
13
  export {};
15
14
  //# sourceMappingURL=types.js.map
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG"}
@@ -1,11 +1,9 @@
1
1
  -- @ingram-tech/nk-marketing — contacts, audiences, subscriptions, deliveries.
2
2
  --
3
3
  -- The stateful slice powering newsletter broadcasts AND post-signup lifecycle
4
- -- email. This is the Postgres-native successor to @ingram-tech/newsletter
5
- -- (which was Supabase/RLS-bound). Like @ingram-tech/nk-billing's ledger, these
6
- -- tables carry NO row-level security: a nextkit site reaches them through its
7
- -- app role and filters in the app layer. Add your own RLS only if your stack
8
- -- needs it.
4
+ -- email. Like @ingram-tech/nk-billing's ledger, these tables carry NO row-level
5
+ -- security: a nextkit site reaches them through its app role and filters in the
6
+ -- app layer. Add your own RLS only if your stack needs it.
9
7
  --
10
8
  -- Ship this as a Drizzle schema fragment + generated SQL so it composes with the
11
9
  -- consuming site's drizzle-kit pipeline (see docs/marketing.md). Table names are
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ingram-tech/nk-marketing",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Postgres-backed marketing & lifecycle email: contacts, consent, newsletter audiences, and idempotent triggered campaigns with RFC 8058 one-click unsubscribe. Sends via @ingram-tech/nk-email.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -32,7 +32,7 @@
32
32
  "@ingram-tech/nk-email": "^0.3.0"
33
33
  },
34
34
  "devDependencies": {
35
- "@ingram-tech/nk-dev": "0.2.3",
35
+ "@ingram-tech/nk-dev": "0.2.4",
36
36
  "@types/node": "^25.0.0",
37
37
  "typescript": "^6.0.3",
38
38
  "vitest": "^4.1.6"