ensend 0.0.5 → 0.0.7

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.
@@ -65,19 +65,22 @@ export declare namespace TSendApi {
65
65
  type RequiresAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
66
66
  [K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;
67
67
  }[Keys];
68
+ type RecipientType = string | string[] | {
69
+ address: string;
70
+ name?: string;
71
+ variables?: Record<string, string | number>;
72
+ } | Array<{
73
+ address: string;
74
+ name?: string;
75
+ variables?: Record<string, string | number>;
76
+ }>;
68
77
  export type SendMailMessageDto<I extends readonly string[] = [], T extends readonly string[] = []> = {
69
78
  subject: string;
70
79
  sender: I[number] | {
71
80
  name?: string;
72
81
  address: I[number];
73
82
  };
74
- recipients: string | string[] | {
75
- name?: string;
76
- address: string;
77
- } | Array<{
78
- name?: string;
79
- address: string;
80
- }>;
83
+ recipients: RecipientType;
81
84
  replyAddress?: string;
82
85
  attachments?: Array<{
83
86
  name: string;
@@ -100,7 +103,7 @@ export declare namespace TSendApi {
100
103
  } & RequiresAtLeastOne<{
101
104
  message: string;
102
105
  template: {
103
- id: T[number];
106
+ ref: T[number];
104
107
  variables?: Record<string, string>;
105
108
  };
106
109
  }, "message" | "template">;
@@ -136,28 +139,16 @@ export declare namespace TSendApi {
136
139
  } & RequiresAtLeastOne<{
137
140
  message: string;
138
141
  template: {
139
- id: T[number];
142
+ ref: T[number];
140
143
  variables?: Record<string, string>;
141
144
  };
142
145
  }, "message" | "template"> & RequiresAtLeastOne<{
143
- recipients: string | string[] | {
144
- name?: string;
145
- address: string;
146
- } | Array<{
147
- name?: string;
148
- address: string;
149
- }>;
146
+ recipients: RecipientType;
150
147
  audience: string[];
151
148
  }>;
152
149
  export type SendExistingMailBroadcastDto = {
153
150
  broadcastRef: string;
154
- recipients?: string | string[] | {
155
- name?: string;
156
- address: string;
157
- } | Array<{
158
- name?: string;
159
- address: string;
160
- }>;
151
+ recipients?: RecipientType;
161
152
  };
162
153
  export type SendMailBroadcastResponse = HttpClientResponse<{
163
154
  broadcast: {
@@ -46,7 +46,7 @@ export class SendApi {
46
46
  async SendMailBroadcast(dto) {
47
47
  return this.http({
48
48
  method: "POST",
49
- path: "/send/mail/broadast",
49
+ path: "/send/mail/broadcast",
50
50
  body: dto,
51
51
  });
52
52
  }
@@ -65,7 +65,7 @@ export class SendApi {
65
65
  async SendExistingMailBroadcast(dto) {
66
66
  return this.http({
67
67
  method: "POST",
68
- path: "/send/mail/broadast",
68
+ path: "/send/mail/broadcast",
69
69
  body: dto,
70
70
  });
71
71
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ensend",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "description": "Official Typescript/Javascript SDK for the new Ensend API. See completed documentation at https://docs.ensend.co",