resend 3.5.0 → 3.6.0-canary.1

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/index.d.mts CHANGED
@@ -212,6 +212,13 @@ interface CreateEmailBaseOptions {
212
212
  * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
213
213
  */
214
214
  to: string | string[];
215
+ /**
216
+ * Schedule email to be sent later.
217
+ * The date should be in ISO 8601 format (e.g: 2024-08-05T11:52:01.858Z).
218
+ *
219
+ * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
220
+ */
221
+ scheduled_at: string;
215
222
  }
216
223
  type CreateEmailOptions = RequireAtLeastOne<EmailRenderOptions> & CreateEmailBaseOptions;
217
224
  interface CreateEmailRequestOptions extends PostOptions {
@@ -480,6 +487,15 @@ declare class Domains {
480
487
  verify(id: string): Promise<VerifyDomainsResponse>;
481
488
  }
482
489
 
490
+ interface CancelEmailResponse {
491
+ data: CancelEmailResponseSuccess | null;
492
+ error: ErrorResponse | null;
493
+ }
494
+ interface CancelEmailResponseSuccess {
495
+ object: 'email';
496
+ id: string;
497
+ }
498
+
483
499
  interface GetEmailResponseSuccess {
484
500
  bcc: string[] | null;
485
501
  cc: string[] | null;
@@ -505,6 +521,7 @@ declare class Emails {
505
521
  send(payload: CreateEmailOptions, options?: CreateEmailRequestOptions): Promise<CreateEmailResponse>;
506
522
  create(payload: CreateEmailOptions, options?: CreateEmailRequestOptions): Promise<CreateEmailResponse>;
507
523
  get(id: string): Promise<GetEmailResponse>;
524
+ cancel(id: string): Promise<CancelEmailResponse>;
508
525
  }
509
526
 
510
527
  declare class Resend {
package/dist/index.d.ts CHANGED
@@ -212,6 +212,13 @@ interface CreateEmailBaseOptions {
212
212
  * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
213
213
  */
214
214
  to: string | string[];
215
+ /**
216
+ * Schedule email to be sent later.
217
+ * The date should be in ISO 8601 format (e.g: 2024-08-05T11:52:01.858Z).
218
+ *
219
+ * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
220
+ */
221
+ scheduled_at: string;
215
222
  }
216
223
  type CreateEmailOptions = RequireAtLeastOne<EmailRenderOptions> & CreateEmailBaseOptions;
217
224
  interface CreateEmailRequestOptions extends PostOptions {
@@ -480,6 +487,15 @@ declare class Domains {
480
487
  verify(id: string): Promise<VerifyDomainsResponse>;
481
488
  }
482
489
 
490
+ interface CancelEmailResponse {
491
+ data: CancelEmailResponseSuccess | null;
492
+ error: ErrorResponse | null;
493
+ }
494
+ interface CancelEmailResponseSuccess {
495
+ object: 'email';
496
+ id: string;
497
+ }
498
+
483
499
  interface GetEmailResponseSuccess {
484
500
  bcc: string[] | null;
485
501
  cc: string[] | null;
@@ -505,6 +521,7 @@ declare class Emails {
505
521
  send(payload: CreateEmailOptions, options?: CreateEmailRequestOptions): Promise<CreateEmailResponse>;
506
522
  create(payload: CreateEmailOptions, options?: CreateEmailRequestOptions): Promise<CreateEmailResponse>;
507
523
  get(id: string): Promise<GetEmailResponse>;
524
+ cancel(id: string): Promise<CancelEmailResponse>;
508
525
  }
509
526
 
510
527
  declare class Resend {
package/dist/index.js CHANGED
@@ -62,7 +62,7 @@ __export(src_exports, {
62
62
  module.exports = __toCommonJS(src_exports);
63
63
 
64
64
  // package.json
65
- var version = "3.5.0";
65
+ var version = "3.6.0-canary.1";
66
66
 
67
67
  // src/api-keys/api-keys.ts
68
68
  var ApiKeys = class {
@@ -315,6 +315,14 @@ var Emails = class {
315
315
  return data;
316
316
  });
317
317
  }
318
+ cancel(id) {
319
+ return __async(this, null, function* () {
320
+ const data = yield this.resend.post(
321
+ `/emails/${id}/cancel`
322
+ );
323
+ return data;
324
+ });
325
+ }
318
326
  };
319
327
 
320
328
  // src/resend.ts
package/dist/index.mjs CHANGED
@@ -39,7 +39,7 @@ var __async = (__this, __arguments, generator) => {
39
39
  };
40
40
 
41
41
  // package.json
42
- var version = "3.5.0";
42
+ var version = "3.6.0-canary.1";
43
43
 
44
44
  // src/api-keys/api-keys.ts
45
45
  var ApiKeys = class {
@@ -292,6 +292,14 @@ var Emails = class {
292
292
  return data;
293
293
  });
294
294
  }
295
+ cancel(id) {
296
+ return __async(this, null, function* () {
297
+ const data = yield this.resend.post(
298
+ `/emails/${id}/cancel`
299
+ );
300
+ return data;
301
+ });
302
+ }
295
303
  };
296
304
 
297
305
  // src/resend.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "resend",
3
- "version": "3.5.0",
3
+ "version": "3.6.0-canary.1",
4
4
  "description": "Node.js library for the Resend API",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",