@myapihq/sdk 2.23.2 → 2.23.3
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/dist/email.d.ts +12 -1
- package/dist/email.js +10 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/email.d.ts
CHANGED
|
@@ -184,7 +184,8 @@ export interface CampaignListSource {
|
|
|
184
184
|
}
|
|
185
185
|
export interface CreateCampaignInput {
|
|
186
186
|
name: string;
|
|
187
|
-
|
|
187
|
+
/** Null once the template it was built from has been deleted — the campaign and its send log survive that. */
|
|
188
|
+
template_id: string | null;
|
|
188
189
|
from_address: string;
|
|
189
190
|
source_kind: CampaignSourceKind;
|
|
190
191
|
source_ref?: CampaignCRMQuery | CampaignListSource;
|
|
@@ -240,5 +241,15 @@ export declare function startCampaign(apiKey: string, orgId: string, id: string)
|
|
|
240
241
|
export declare function pauseCampaign(apiKey: string, orgId: string, id: string): Promise<Campaign>;
|
|
241
242
|
export declare function resumeCampaign(apiKey: string, orgId: string, id: string): Promise<Campaign>;
|
|
242
243
|
export declare function cancelCampaign(apiKey: string, orgId: string, id: string): Promise<Campaign>;
|
|
244
|
+
/**
|
|
245
|
+
* Removes the campaign and its recipient rows. Messages already sent stay in
|
|
246
|
+
* the send log — deleting a campaign must not erase the record that mail went
|
|
247
|
+
* out. Refuses (409 CAMPAIGN_ACTIVE) while it is still sending.
|
|
248
|
+
*/
|
|
249
|
+
export declare function deleteCampaign(apiKey: string, orgId: string, id: string): Promise<{
|
|
250
|
+
deleted: boolean;
|
|
251
|
+
id: string;
|
|
252
|
+
note?: string;
|
|
253
|
+
}>;
|
|
243
254
|
export declare function listCampaignRecipients(apiKey: string, orgId: string, id: string, state?: string): Promise<CampaignRecipient[]>;
|
|
244
255
|
export declare function getCampaignStats(apiKey: string, orgId: string, id: string): Promise<CampaignStats>;
|
package/dist/email.js
CHANGED
|
@@ -39,6 +39,7 @@ exports.startCampaign = startCampaign;
|
|
|
39
39
|
exports.pauseCampaign = pauseCampaign;
|
|
40
40
|
exports.resumeCampaign = resumeCampaign;
|
|
41
41
|
exports.cancelCampaign = cancelCampaign;
|
|
42
|
+
exports.deleteCampaign = deleteCampaign;
|
|
42
43
|
exports.listCampaignRecipients = listCampaignRecipients;
|
|
43
44
|
exports.getCampaignStats = getCampaignStats;
|
|
44
45
|
const client_1 = require("./client");
|
|
@@ -82,6 +83,7 @@ exports.EXPOSES = [
|
|
|
82
83
|
'POST /email/orgs/{org_id}/campaigns',
|
|
83
84
|
'GET /email/orgs/{org_id}/campaigns',
|
|
84
85
|
'GET /email/orgs/{org_id}/campaigns/{campaign_id}',
|
|
86
|
+
'DELETE /email/orgs/{org_id}/campaigns/{campaign_id}',
|
|
85
87
|
'PATCH /email/orgs/{org_id}/campaigns/{campaign_id}',
|
|
86
88
|
'POST /email/orgs/{org_id}/campaigns/{campaign_id}/resolve',
|
|
87
89
|
'POST /email/orgs/{org_id}/campaigns/{campaign_id}/start',
|
|
@@ -254,6 +256,14 @@ async function resumeCampaign(apiKey, orgId, id) {
|
|
|
254
256
|
async function cancelCampaign(apiKey, orgId, id) {
|
|
255
257
|
return (0, client_1.request)('POST', `${campaignUrl(orgId, id)}/cancel`, apiKey);
|
|
256
258
|
}
|
|
259
|
+
/**
|
|
260
|
+
* Removes the campaign and its recipient rows. Messages already sent stay in
|
|
261
|
+
* the send log — deleting a campaign must not erase the record that mail went
|
|
262
|
+
* out. Refuses (409 CAMPAIGN_ACTIVE) while it is still sending.
|
|
263
|
+
*/
|
|
264
|
+
async function deleteCampaign(apiKey, orgId, id) {
|
|
265
|
+
return (0, client_1.request)('DELETE', campaignUrl(orgId, id), apiKey);
|
|
266
|
+
}
|
|
257
267
|
async function listCampaignRecipients(apiKey, orgId, id, state) {
|
|
258
268
|
const url = state
|
|
259
269
|
? `${campaignUrl(orgId, id)}/recipients?state=${encodeURIComponent(state)}`
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "2.23.
|
|
1
|
+
export declare const SDK_VERSION = "2.23.3";
|
package/dist/version.js
CHANGED
|
@@ -8,4 +8,4 @@ exports.SDK_VERSION = void 0;
|
|
|
8
8
|
// Why a constant and not a package.json read: the SDK runs inside edge
|
|
9
9
|
// functions (Cloudflare Workers), so it must not import node:fs. A literal
|
|
10
10
|
// is the only version source that works in every runtime we ship to.
|
|
11
|
-
exports.SDK_VERSION = '2.23.
|
|
11
|
+
exports.SDK_VERSION = '2.23.3';
|