@trycourier/courier 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
@@ -5,9 +5,13 @@ This project adheres to [Semantic Versioning](http://semver.org/).
5
5
 
6
6
  ## [Unreleased][unreleased]
7
7
 
8
+ ## [3.8.0] - 2022-03-14
9
+
10
+ - adds additional types for utm property (`message.metadata.utm`)
11
+
8
12
  ## [v3.7.0] - 2022-03-11
9
13
 
10
- - adds additional types for the tags property (`message.tags`)
14
+ - adds additional types for the tags property (`message.metadata.tags`)
11
15
  - adds support for searching message by tags
12
16
 
13
17
  ## [v3.6.0] - 2022-02-10
@@ -238,11 +238,12 @@ export interface ElementalContentSugar {
238
238
  }
239
239
  export declare type Content = ElementalContentSugar | ElementalContent;
240
240
  export interface BaseMessage {
241
- to: MessageRecipient;
242
- data?: MessageData;
243
241
  channels?: MessageChannels;
242
+ data?: MessageData;
243
+ metadata?: MessageMetadata;
244
244
  providers?: MessageProviders;
245
245
  routing?: Routing;
246
+ to: MessageRecipient;
246
247
  }
247
248
  interface TrackingOverride {
248
249
  open: boolean;
@@ -316,19 +317,21 @@ export interface RoutingStrategyProvider<T = Record<string, any>> {
316
317
  config?: T;
317
318
  if?: string;
318
319
  }
319
- export interface BaseMessageMetadata {
320
- tags?: [string?, string?, string?, string?, string?, string?, string?, string?, string?];
321
- }
322
- export interface ContentMessageMetadata extends BaseMessageMetadata {
320
+ export interface MessageMetadata {
323
321
  event?: string;
322
+ tags?: string[];
323
+ utm?: {
324
+ source?: string;
325
+ medium?: string;
326
+ campaign?: string;
327
+ term?: string;
328
+ content?: string;
329
+ };
324
330
  }
325
331
  export interface ContentMessage extends BaseMessage {
326
332
  content: Content;
327
- metadata?: ContentMessageMetadata;
328
333
  }
329
334
  export interface TemplateMessage extends BaseMessage {
330
- brand?: string;
331
- metadata?: BaseMessageMetadata;
332
335
  template: string;
333
336
  }
334
337
  export declare type Message = ContentMessage | TemplateMessage;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trycourier/courier",
3
- "version": "3.7.0",
3
+ "version": "3.8.0",
4
4
  "description": "A node.js module for communicating with the Courier REST API.",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",