resend 3.6.0-canary.0 → 3.6.0-canary.2

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
@@ -218,7 +218,7 @@ interface CreateEmailBaseOptions {
218
218
  *
219
219
  * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
220
220
  */
221
- scheduled_at: string;
221
+ scheduledAt: string;
222
222
  }
223
223
  type CreateEmailOptions = RequireAtLeastOne<EmailRenderOptions> & CreateEmailBaseOptions;
224
224
  interface CreateEmailRequestOptions extends PostOptions {
@@ -515,12 +515,26 @@ interface GetEmailResponse {
515
515
  error: ErrorResponse | null;
516
516
  }
517
517
 
518
+ interface UpdateEmailOptions {
519
+ id: string;
520
+ scheduledAt: string;
521
+ }
522
+ interface UpdateEmailResponseSuccess {
523
+ id: string;
524
+ object: 'email';
525
+ }
526
+ interface UpdateEmailResponse {
527
+ data: UpdateEmailResponseSuccess | null;
528
+ error: ErrorResponse | null;
529
+ }
530
+
518
531
  declare class Emails {
519
532
  private readonly resend;
520
533
  constructor(resend: Resend);
521
534
  send(payload: CreateEmailOptions, options?: CreateEmailRequestOptions): Promise<CreateEmailResponse>;
522
535
  create(payload: CreateEmailOptions, options?: CreateEmailRequestOptions): Promise<CreateEmailResponse>;
523
536
  get(id: string): Promise<GetEmailResponse>;
537
+ update(payload: UpdateEmailOptions): Promise<UpdateEmailResponse>;
524
538
  cancel(id: string): Promise<CancelEmailResponse>;
525
539
  }
526
540
 
package/dist/index.d.ts CHANGED
@@ -218,7 +218,7 @@ interface CreateEmailBaseOptions {
218
218
  *
219
219
  * @link https://resend.com/docs/api-reference/emails/send-email#body-parameters
220
220
  */
221
- scheduled_at: string;
221
+ scheduledAt: string;
222
222
  }
223
223
  type CreateEmailOptions = RequireAtLeastOne<EmailRenderOptions> & CreateEmailBaseOptions;
224
224
  interface CreateEmailRequestOptions extends PostOptions {
@@ -515,12 +515,26 @@ interface GetEmailResponse {
515
515
  error: ErrorResponse | null;
516
516
  }
517
517
 
518
+ interface UpdateEmailOptions {
519
+ id: string;
520
+ scheduledAt: string;
521
+ }
522
+ interface UpdateEmailResponseSuccess {
523
+ id: string;
524
+ object: 'email';
525
+ }
526
+ interface UpdateEmailResponse {
527
+ data: UpdateEmailResponseSuccess | null;
528
+ error: ErrorResponse | null;
529
+ }
530
+
518
531
  declare class Emails {
519
532
  private readonly resend;
520
533
  constructor(resend: Resend);
521
534
  send(payload: CreateEmailOptions, options?: CreateEmailRequestOptions): Promise<CreateEmailResponse>;
522
535
  create(payload: CreateEmailOptions, options?: CreateEmailRequestOptions): Promise<CreateEmailResponse>;
523
536
  get(id: string): Promise<GetEmailResponse>;
537
+ update(payload: UpdateEmailOptions): Promise<UpdateEmailResponse>;
524
538
  cancel(id: string): Promise<CancelEmailResponse>;
525
539
  }
526
540
 
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.6.0-canary.0";
65
+ var version = "3.6.0-canary.2";
66
66
 
67
67
  // src/api-keys/api-keys.ts
68
68
  var ApiKeys = class {
@@ -315,6 +315,17 @@ var Emails = class {
315
315
  return data;
316
316
  });
317
317
  }
318
+ update(payload) {
319
+ return __async(this, null, function* () {
320
+ const data = yield this.resend.patch(
321
+ `/emails/${payload.id}`,
322
+ {
323
+ scheduled_at: payload.scheduledAt
324
+ }
325
+ );
326
+ return data;
327
+ });
328
+ }
318
329
  cancel(id) {
319
330
  return __async(this, null, function* () {
320
331
  const data = yield this.resend.post(
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.6.0-canary.0";
42
+ var version = "3.6.0-canary.2";
43
43
 
44
44
  // src/api-keys/api-keys.ts
45
45
  var ApiKeys = class {
@@ -292,6 +292,17 @@ var Emails = class {
292
292
  return data;
293
293
  });
294
294
  }
295
+ update(payload) {
296
+ return __async(this, null, function* () {
297
+ const data = yield this.resend.patch(
298
+ `/emails/${payload.id}`,
299
+ {
300
+ scheduled_at: payload.scheduledAt
301
+ }
302
+ );
303
+ return data;
304
+ });
305
+ }
295
306
  cancel(id) {
296
307
  return __async(this, null, function* () {
297
308
  const data = yield this.resend.post(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "resend",
3
- "version": "3.6.0-canary.0",
3
+ "version": "3.6.0-canary.2",
4
4
  "description": "Node.js library for the Resend API",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",