@@ -12,6 +12,22 @@ export type Address = string;
1212
1313export type TimeStamp = string ;
1414
15+ /**
16+ * request to send email in bulk
17+ *
18+ * use `prepareEmailCampaign()` to create a `CampaignRequest`
19+ *
20+ * then use `sendEmailCampaign()` to send the campaign
21+ */
22+ export type CampaignRequest = BulkRequest ;
23+
24+ /**
25+ * authorization signed by the data owner granting access to this contact
26+ *
27+ * `GrantedAccess` are obtained by fetching contacts (e.g. `fetchMyContacts()` or `fetchUserContacts()`)
28+ *
29+ * `GrantedAccess` can be consumed for email campaigns (e.g. `prepareEmailCampaign()` then `sendEmailCampaign()`)
30+ */
1531export type GrantedAccess = {
1632 dataset : string ;
1733 datasetprice : string ;
@@ -139,14 +155,19 @@ export type PrepareEmailCampaignParams = {
139155} ;
140156
141157export type PrepareEmailCampaignResponse = {
142- campaignRequest : BulkRequest ;
158+ /**
159+ * The prepared campaign request
160+ *
161+ * Use this in `sendEmailCampaign()` to start or continue sending the campaign
162+ */
163+ campaignRequest : CampaignRequest ;
143164} ;
144165
145166export type SendEmailCampaignParams = {
146167 /**
147168 * The prepared campaign request from prepareEmailCampaign
148169 */
149- campaignRequest : PrepareEmailCampaignResponse [ 'campaignRequest' ] ;
170+ campaignRequest : CampaignRequest ;
150171 /**
151172 * Workerpool address or ENS to use for processing
152173 */
@@ -162,9 +183,21 @@ export type SendEmailCampaignParams = {
162183} ;
163184
164185export type SendEmailCampaignResponse = {
186+ /**
187+ * List of tasks created for the campaign
188+ */
165189 tasks : Array < {
190+ /**
191+ * ID of the task
192+ */
166193 taskId : string ;
194+ /**
195+ * ID of the deal containing the task
196+ */
167197 dealId : string ;
198+ /**
199+ * Index of the task in the bulk request
200+ */
168201 bulkIndex : number ;
169202 } > ;
170203} ;
0 commit comments