@@ -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 ;
@@ -70,9 +86,9 @@ export type SendTelegramResponse = {
7086
7187export type PrepareTelegramCampaignParams = {
7288 /**
73- * Granted access to process in bulk.
89+ * List of `GrantedAccess` to contacts to send telegrams to in bulk.
90+ *
7491 * use `fetchMyContacts({ bulkOnly: true })` to get granted accesses.
75- * if not provided, the single message will be processed.
7692 */
7793 grantedAccess : GrantedAccess [ ] ;
7894 maxProtectedDataPerTask ?: number ;
@@ -86,11 +102,22 @@ export type PrepareTelegramCampaignParams = {
86102} ;
87103
88104export type PrepareTelegramCampaignResponse = {
89- campaignRequest : BulkRequest ;
105+ /**
106+ * The prepared campaign request
107+ *
108+ * Use this in `sendTelegramCampaign()` to start or continue sending the campaign
109+ */
110+ campaignRequest : CampaignRequest ;
90111} ;
91112
92113export type SendTelegramCampaignParams = {
93- campaignRequest : BulkRequest ;
114+ /**
115+ * The prepared campaign request from prepareTelegramCampaign
116+ */
117+ campaignRequest : CampaignRequest ;
118+ /**
119+ * Workerpool address or ENS to use for processing
120+ */
94121 workerpoolAddressOrEns ?: string ;
95122} ;
96123
0 commit comments