resend 1.0.1-canary.2 → 1.1.0

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.
@@ -1,27 +1,16 @@
1
1
  {
2
2
  "name": "resend",
3
- "version": "1.0.1-canary.2",
3
+ "version": "1.1.0",
4
4
  "description": "Node.js library for the Resend API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",
7
7
  "files": [
8
8
  "build/"
9
9
  ],
10
- "exports": {
11
- ".": {
12
- "import": {
13
- "types": "./build/src/index.d.ts",
14
- "default": "./build/src/index.js"
15
- },
16
- "require": {
17
- "types": "./build/src/index.d.ts",
18
- "default": "./build/src/index.js"
19
- }
20
- }
21
- },
22
10
  "engines": {
23
- "node": ">=16"
11
+ "node": ">=18"
24
12
  },
13
+ "packageManager": "yarn@3.6.3",
25
14
  "scripts": {
26
15
  "build": "tsc -p .",
27
16
  "test": "jest",
@@ -43,13 +32,11 @@
43
32
  "homepage": "https://github.com/resendlabs/resend-node#readme",
44
33
  "dependencies": {
45
34
  "@react-email/render": "0.0.7",
46
- "node-fetch": "2.6.12",
47
35
  "type-fest": "3.13.0"
48
36
  },
49
37
  "devDependencies": {
50
38
  "@types/jest": "29.5.3",
51
39
  "@types/node": "18.17.5",
52
- "@types/node-fetch": "2.6.4",
53
40
  "@types/react": "18.2.20",
54
41
  "@typescript-eslint/eslint-plugin": "6.4.0",
55
42
  "@typescript-eslint/parser": "6.4.0",
@@ -1,27 +1,4 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
3
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
4
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -33,7 +10,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
33
10
  };
34
11
  Object.defineProperty(exports, "__esModule", { value: true });
35
12
  exports.Resend = void 0;
36
- const node_fetch_1 = __importStar(require("node-fetch"));
37
13
  const render_1 = require("@react-email/render");
38
14
  const package_json_1 = require("../package.json");
39
15
  const api_keys_1 = require("./api-keys/api-keys");
@@ -53,7 +29,7 @@ class Resend {
53
29
  throw new Error('Missing API key. Pass it to the constructor `new Resend("re_123")`');
54
30
  }
55
31
  }
56
- this.headers = new node_fetch_1.Headers({
32
+ this.headers = new Headers({
57
33
  Authorization: `Bearer ${this.key}`,
58
34
  'User-Agent': userAgent,
59
35
  'Content-Type': 'application/json',
@@ -61,7 +37,7 @@ class Resend {
61
37
  }
62
38
  fetchRequest(path, options = {}) {
63
39
  return __awaiter(this, void 0, void 0, function* () {
64
- const response = yield (0, node_fetch_1.default)(`${baseUrl}${path}`, options);
40
+ const response = yield fetch(`${baseUrl}${path}`, options);
65
41
  if (!response.ok) {
66
42
  const error = yield response.json();
67
43
  return error;
package/package.json CHANGED
@@ -1,27 +1,16 @@
1
1
  {
2
2
  "name": "resend",
3
- "version": "1.0.1-canary.2",
3
+ "version": "1.1.0",
4
4
  "description": "Node.js library for the Resend API",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",
7
7
  "files": [
8
8
  "build/"
9
9
  ],
10
- "exports": {
11
- ".": {
12
- "import": {
13
- "types": "./build/src/index.d.ts",
14
- "default": "./build/src/index.js"
15
- },
16
- "require": {
17
- "types": "./build/src/index.d.ts",
18
- "default": "./build/src/index.js"
19
- }
20
- }
21
- },
22
10
  "engines": {
23
- "node": ">=16"
11
+ "node": ">=18"
24
12
  },
13
+ "packageManager": "yarn@3.6.3",
25
14
  "scripts": {
26
15
  "build": "tsc -p .",
27
16
  "test": "jest",
@@ -43,13 +32,11 @@
43
32
  "homepage": "https://github.com/resendlabs/resend-node#readme",
44
33
  "dependencies": {
45
34
  "@react-email/render": "0.0.7",
46
- "node-fetch": "2.6.12",
47
35
  "type-fest": "3.13.0"
48
36
  },
49
37
  "devDependencies": {
50
38
  "@types/jest": "29.5.3",
51
39
  "@types/node": "18.17.5",
52
- "@types/node-fetch": "2.6.4",
53
40
  "@types/react": "18.2.20",
54
41
  "@typescript-eslint/eslint-plugin": "6.4.0",
55
42
  "@typescript-eslint/parser": "6.4.0",
package/build/src/tt.d.ts DELETED
@@ -1 +0,0 @@
1
- export {};
package/build/src/tt.js DELETED
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const _1 = require(".");
4
- const resend = new _1.Resend('re_RL6QTnHU_Jhn8WoXG3a6qXz9ZpQ9s56fq');
5
- // const p: any = {
6
- // from: 'bu@resend.com',
7
- // to: 'develired@resend.dev',
8
- // text: 'Nice',
9
- // }
10
- resend.domains.list().then(console.log).catch(console.error);