@vercel/functions 1.1.0 → 1.3.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.
@@ -0,0 +1,133 @@
1
+ export declare const getEnv: (env?: {
2
+ [key: string]: string | undefined;
3
+ }) => {
4
+ /**
5
+ * An indicator to show that System Environment Variables have been exposed to your project's Deployments.
6
+ * @example "1"
7
+ */
8
+ VERCEL: string | undefined;
9
+ /**
10
+ * An indicator that the code is running in a Continuous Integration environment.
11
+ * @example "1"
12
+ */
13
+ CI: string | undefined;
14
+ /**
15
+ * The Environment that the app is deployed and running on.
16
+ * @example "production"
17
+ */
18
+ VERCEL_ENV: string | undefined;
19
+ /**
20
+ * The domain name of the generated deployment URL. The value does not include the protocol scheme https://.
21
+ * NOTE: This Variable cannot be used in conjunction with Standard Deployment Protection.
22
+ * @example "*.vercel.app"
23
+ */
24
+ VERCEL_URL: string | undefined;
25
+ /**
26
+ * The domain name of the generated Git branch URL. The value does not include the protocol scheme https://.
27
+ * @example "*-git-*.vercel.app"
28
+ */
29
+ VERCEL_BRANCH_URL: string | undefined;
30
+ /**
31
+ * A production domain name of the project. This is useful to reliably generate links that point to production such as OG-image URLs.
32
+ * The value does not include the protocol scheme https://.
33
+ * @example "myproject.vercel.app"
34
+ */
35
+ VERCEL_PROJECT_PRODUCTION_URL: string | undefined;
36
+ /**
37
+ * The ID of the Region where the app is running.
38
+ *
39
+ * Possible values:
40
+ * - arn1 (Stockholm, Sweden)
41
+ * - bom1 (Mumbai, India)
42
+ * - cdg1 (Paris, France)
43
+ * - cle1 (Cleveland, USA)
44
+ * - cpt1 (Cape Town, South Africa)
45
+ * - dub1 (Dublin, Ireland)
46
+ * - fra1 (Frankfurt, Germany)
47
+ * - gru1 (São Paulo, Brazil)
48
+ * - hkg1 (Hong Kong)
49
+ * - hnd1 (Tokyo, Japan)
50
+ * - iad1 (Washington, D.C., USA)
51
+ * - icn1 (Seoul, South Korea)
52
+ * - kix1 (Osaka, Japan)
53
+ * - lhr1 (London, United Kingdom)
54
+ * - pdx1 (Portland, USA)
55
+ * - sfo1 (San Francisco, USA)
56
+ * - sin1 (Singapore)
57
+ * - syd1 (Sydney, Australia)
58
+ * - dev1 (Development Region)
59
+ *
60
+ * @example "iad1"
61
+ */
62
+ VERCEL_REGION: string | undefined;
63
+ /**
64
+ * The unique identifier for the deployment, which can be used to implement Skew Protection.
65
+ * @example "dpl_7Gw5ZMBpQA8h9GF832KGp7nwbuh3"
66
+ */
67
+ VERCEL_DEPLOYMENT_ID: string | undefined;
68
+ /**
69
+ * When Skew Protection is enabled in Project Settings, this value is set to 1.
70
+ * @example "1"
71
+ */
72
+ VERCEL_SKEW_PROTECTION_ENABLED: string | undefined;
73
+ /**
74
+ * The Protection Bypass for Automation value, if the secret has been generated in the project's Deployment Protection settings.
75
+ */
76
+ VERCEL_AUTOMATION_BYPASS_SECRET: string | undefined;
77
+ /**
78
+ * The Git Provider the deployment is triggered from.
79
+ * @example "github"
80
+ */
81
+ VERCEL_GIT_PROVIDER: string | undefined;
82
+ /**
83
+ * The origin repository the deployment is triggered from.
84
+ * @example "my-site"
85
+ */
86
+ VERCEL_GIT_REPO_SLUG: string | undefined;
87
+ /**
88
+ * The account that owns the repository the deployment is triggered from.
89
+ * @example "acme"
90
+ */
91
+ VERCEL_GIT_REPO_OWNER: string | undefined;
92
+ /**
93
+ * The ID of the repository the deployment is triggered from.
94
+ * @example "117716146"
95
+ */
96
+ VERCEL_GIT_REPO_ID: string | undefined;
97
+ /**
98
+ * The git branch of the commit the deployment was triggered by.
99
+ * @example "improve-about-page"
100
+ */
101
+ VERCEL_GIT_COMMIT_REF: string | undefined;
102
+ /**
103
+ * The git SHA of the commit the deployment was triggered by.
104
+ * @example "fa1eade47b73733d6312d5abfad33ce9e4068081"
105
+ */
106
+ VERCEL_GIT_COMMIT_SHA: string | undefined;
107
+ /**
108
+ * The message attached to the commit the deployment was triggered by.
109
+ * @example "Update about page"
110
+ */
111
+ VERCEL_GIT_COMMIT_MESSAGE: string | undefined;
112
+ /**
113
+ * The username attached to the author of the commit that the project was deployed by.
114
+ * @example "johndoe"
115
+ */
116
+ VERCEL_GIT_COMMIT_AUTHOR_LOGIN: string | undefined;
117
+ /**
118
+ * The name attached to the author of the commit that the project was deployed by.
119
+ * @example "John Doe"
120
+ */
121
+ VERCEL_GIT_COMMIT_AUTHOR_NAME: string | undefined;
122
+ /**
123
+ * The git SHA of the last successful deployment for the project and branch.
124
+ * NOTE: This Variable is only exposed when an Ignored Build Step is provided.
125
+ * @example "fa1eade47b73733d6312d5abfad33ce9e4068080"
126
+ */
127
+ VERCEL_GIT_PREVIOUS_SHA: string | undefined;
128
+ /**
129
+ * The pull request id the deployment was triggered by. If a deployment is created on a branch before a pull request is made, this value will be an empty string.
130
+ * @example "23"
131
+ */
132
+ VERCEL_GIT_PULL_REQUEST_ID: string | undefined;
133
+ };
@@ -0,0 +1,162 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var get_env_exports = {};
20
+ __export(get_env_exports, {
21
+ getEnv: () => getEnv
22
+ });
23
+ module.exports = __toCommonJS(get_env_exports);
24
+ const getEnv = (env = process.env) => ({
25
+ /**
26
+ * An indicator to show that System Environment Variables have been exposed to your project's Deployments.
27
+ * @example "1"
28
+ */
29
+ VERCEL: get(env, "VERCEL"),
30
+ /**
31
+ * An indicator that the code is running in a Continuous Integration environment.
32
+ * @example "1"
33
+ */
34
+ CI: get(env, "CI"),
35
+ /**
36
+ * The Environment that the app is deployed and running on.
37
+ * @example "production"
38
+ */
39
+ VERCEL_ENV: get(env, "VERCEL_ENV"),
40
+ /**
41
+ * The domain name of the generated deployment URL. The value does not include the protocol scheme https://.
42
+ * NOTE: This Variable cannot be used in conjunction with Standard Deployment Protection.
43
+ * @example "*.vercel.app"
44
+ */
45
+ VERCEL_URL: get(env, "VERCEL_URL"),
46
+ /**
47
+ * The domain name of the generated Git branch URL. The value does not include the protocol scheme https://.
48
+ * @example "*-git-*.vercel.app"
49
+ */
50
+ VERCEL_BRANCH_URL: get(env, "VERCEL_BRANCH_URL"),
51
+ /**
52
+ * A production domain name of the project. This is useful to reliably generate links that point to production such as OG-image URLs.
53
+ * The value does not include the protocol scheme https://.
54
+ * @example "myproject.vercel.app"
55
+ */
56
+ VERCEL_PROJECT_PRODUCTION_URL: get(env, "VERCEL_PROJECT_PRODUCTION_URL"),
57
+ /**
58
+ * The ID of the Region where the app is running.
59
+ *
60
+ * Possible values:
61
+ * - arn1 (Stockholm, Sweden)
62
+ * - bom1 (Mumbai, India)
63
+ * - cdg1 (Paris, France)
64
+ * - cle1 (Cleveland, USA)
65
+ * - cpt1 (Cape Town, South Africa)
66
+ * - dub1 (Dublin, Ireland)
67
+ * - fra1 (Frankfurt, Germany)
68
+ * - gru1 (São Paulo, Brazil)
69
+ * - hkg1 (Hong Kong)
70
+ * - hnd1 (Tokyo, Japan)
71
+ * - iad1 (Washington, D.C., USA)
72
+ * - icn1 (Seoul, South Korea)
73
+ * - kix1 (Osaka, Japan)
74
+ * - lhr1 (London, United Kingdom)
75
+ * - pdx1 (Portland, USA)
76
+ * - sfo1 (San Francisco, USA)
77
+ * - sin1 (Singapore)
78
+ * - syd1 (Sydney, Australia)
79
+ * - dev1 (Development Region)
80
+ *
81
+ * @example "iad1"
82
+ */
83
+ VERCEL_REGION: get(env, "VERCEL_REGION"),
84
+ /**
85
+ * The unique identifier for the deployment, which can be used to implement Skew Protection.
86
+ * @example "dpl_7Gw5ZMBpQA8h9GF832KGp7nwbuh3"
87
+ */
88
+ VERCEL_DEPLOYMENT_ID: get(env, "VERCEL_DEPLOYMENT_ID"),
89
+ /**
90
+ * When Skew Protection is enabled in Project Settings, this value is set to 1.
91
+ * @example "1"
92
+ */
93
+ VERCEL_SKEW_PROTECTION_ENABLED: get(env, "VERCEL_SKEW_PROTECTION_ENABLED"),
94
+ /**
95
+ * The Protection Bypass for Automation value, if the secret has been generated in the project's Deployment Protection settings.
96
+ */
97
+ VERCEL_AUTOMATION_BYPASS_SECRET: get(env, "VERCEL_AUTOMATION_BYPASS_SECRET"),
98
+ /**
99
+ * The Git Provider the deployment is triggered from.
100
+ * @example "github"
101
+ */
102
+ VERCEL_GIT_PROVIDER: get(env, "VERCEL_GIT_PROVIDER"),
103
+ /**
104
+ * The origin repository the deployment is triggered from.
105
+ * @example "my-site"
106
+ */
107
+ VERCEL_GIT_REPO_SLUG: get(env, "VERCEL_GIT_REPO_SLUG"),
108
+ /**
109
+ * The account that owns the repository the deployment is triggered from.
110
+ * @example "acme"
111
+ */
112
+ VERCEL_GIT_REPO_OWNER: get(env, "VERCEL_GIT_REPO_OWNER"),
113
+ /**
114
+ * The ID of the repository the deployment is triggered from.
115
+ * @example "117716146"
116
+ */
117
+ VERCEL_GIT_REPO_ID: get(env, "VERCEL_GIT_REPO_ID"),
118
+ /**
119
+ * The git branch of the commit the deployment was triggered by.
120
+ * @example "improve-about-page"
121
+ */
122
+ VERCEL_GIT_COMMIT_REF: get(env, "VERCEL_GIT_COMMIT_REF"),
123
+ /**
124
+ * The git SHA of the commit the deployment was triggered by.
125
+ * @example "fa1eade47b73733d6312d5abfad33ce9e4068081"
126
+ */
127
+ VERCEL_GIT_COMMIT_SHA: get(env, "VERCEL_GIT_COMMIT_SHA"),
128
+ /**
129
+ * The message attached to the commit the deployment was triggered by.
130
+ * @example "Update about page"
131
+ */
132
+ VERCEL_GIT_COMMIT_MESSAGE: get(env, "VERCEL_GIT_COMMIT_MESSAGE"),
133
+ /**
134
+ * The username attached to the author of the commit that the project was deployed by.
135
+ * @example "johndoe"
136
+ */
137
+ VERCEL_GIT_COMMIT_AUTHOR_LOGIN: get(env, "VERCEL_GIT_COMMIT_AUTHOR_LOGIN"),
138
+ /**
139
+ * The name attached to the author of the commit that the project was deployed by.
140
+ * @example "John Doe"
141
+ */
142
+ VERCEL_GIT_COMMIT_AUTHOR_NAME: get(env, "VERCEL_GIT_COMMIT_AUTHOR_NAME"),
143
+ /**
144
+ * The git SHA of the last successful deployment for the project and branch.
145
+ * NOTE: This Variable is only exposed when an Ignored Build Step is provided.
146
+ * @example "fa1eade47b73733d6312d5abfad33ce9e4068080"
147
+ */
148
+ VERCEL_GIT_PREVIOUS_SHA: get(env, "VERCEL_GIT_PREVIOUS_SHA"),
149
+ /**
150
+ * The pull request id the deployment was triggered by. If a deployment is created on a branch before a pull request is made, this value will be an empty string.
151
+ * @example "23"
152
+ */
153
+ VERCEL_GIT_PULL_REQUEST_ID: get(env, "VERCEL_GIT_PULL_REQUEST_ID")
154
+ });
155
+ const get = (env, key) => {
156
+ const value = env[key];
157
+ return value === "" ? void 0 : value;
158
+ };
159
+ // Annotate the CommonJS export names for ESM import in node:
160
+ 0 && (module.exports = {
161
+ getEnv
162
+ });
@@ -0,0 +1,83 @@
1
+ /**
2
+ * City of the original client IP as calculated by Vercel Proxy.
3
+ */
4
+ export declare const CITY_HEADER_NAME = "x-vercel-ip-city";
5
+ /**
6
+ * Country of the original client IP as calculated by Vercel Proxy.
7
+ */
8
+ export declare const COUNTRY_HEADER_NAME = "x-vercel-ip-country";
9
+ /**
10
+ * Client IP as calculated by Vercel Proxy.
11
+ */
12
+ export declare const IP_HEADER_NAME = "x-real-ip";
13
+ /**
14
+ * Latitude of the original client IP as calculated by Vercel Proxy.
15
+ */
16
+ export declare const LATITUDE_HEADER_NAME = "x-vercel-ip-latitude";
17
+ /**
18
+ * Longitude of the original client IP as calculated by Vercel Proxy.
19
+ */
20
+ export declare const LONGITUDE_HEADER_NAME = "x-vercel-ip-longitude";
21
+ /**
22
+ * Country region of the original client IP calculated by Vercel Proxy.
23
+ *
24
+ * See [docs](https://vercel.com/docs/concepts/edge-network/headers#x-vercel-ip-country-region).
25
+ */
26
+ export declare const REGION_HEADER_NAME = "x-vercel-ip-country-region";
27
+ /**
28
+ * The request ID for each request generated by Vercel Proxy.
29
+ */
30
+ export declare const REQUEST_ID_HEADER_NAME = "x-vercel-id";
31
+ /**
32
+ * Unicode characters for emoji flags start at this number, and run up to 127469.
33
+ */
34
+ export declare const EMOJI_FLAG_UNICODE_STARTING_POSITION = 127397;
35
+ /**
36
+ * We define a new type so this function can be reused with
37
+ * the global `Request`, `node-fetch` and other types.
38
+ */
39
+ interface Request {
40
+ headers: {
41
+ get(name: string): string | null;
42
+ };
43
+ }
44
+ /**
45
+ * The location information of a given request.
46
+ */
47
+ export interface Geo {
48
+ /** The city that the request originated from. */
49
+ city?: string;
50
+ /** The country that the request originated from. */
51
+ country?: string;
52
+ /** The flag emoji for the country the request originated from. */
53
+ flag?: string;
54
+ /** The [Vercel Edge Network region](https://vercel.com/docs/concepts/edge-network/regions) that received the request. */
55
+ region?: string;
56
+ /** The region part of the ISO 3166-2 code of the client IP.
57
+ * See [docs](https://vercel.com/docs/concepts/edge-network/headers#x-vercel-ip-country-region).
58
+ */
59
+ countryRegion?: string;
60
+ /** The latitude of the client. */
61
+ latitude?: string;
62
+ /** The longitude of the client. */
63
+ longitude?: string;
64
+ }
65
+ /**
66
+ * Returns the IP address of the request from the headers.
67
+ *
68
+ * @see {@link IP_HEADER_NAME}
69
+ * @param request The incoming request object which provides the IP
70
+ */
71
+ export declare function ipAddress(request: Request): string | undefined;
72
+ /**
73
+ * Returns the location information for the incoming request.
74
+ *
75
+ * @see {@link CITY_HEADER_NAME}
76
+ * @see {@link COUNTRY_HEADER_NAME}
77
+ * @see {@link REGION_HEADER_NAME}
78
+ * @see {@link LATITUDE_HEADER_NAME}
79
+ * @see {@link LONGITUDE_HEADER_NAME}
80
+ * @param request The incoming request object which provides the geolocation data
81
+ */
82
+ export declare function geolocation(request: Request): Geo;
83
+ export {};
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var headers_exports = {};
20
+ __export(headers_exports, {
21
+ CITY_HEADER_NAME: () => CITY_HEADER_NAME,
22
+ COUNTRY_HEADER_NAME: () => COUNTRY_HEADER_NAME,
23
+ EMOJI_FLAG_UNICODE_STARTING_POSITION: () => EMOJI_FLAG_UNICODE_STARTING_POSITION,
24
+ IP_HEADER_NAME: () => IP_HEADER_NAME,
25
+ LATITUDE_HEADER_NAME: () => LATITUDE_HEADER_NAME,
26
+ LONGITUDE_HEADER_NAME: () => LONGITUDE_HEADER_NAME,
27
+ REGION_HEADER_NAME: () => REGION_HEADER_NAME,
28
+ REQUEST_ID_HEADER_NAME: () => REQUEST_ID_HEADER_NAME,
29
+ geolocation: () => geolocation,
30
+ ipAddress: () => ipAddress
31
+ });
32
+ module.exports = __toCommonJS(headers_exports);
33
+ const CITY_HEADER_NAME = "x-vercel-ip-city";
34
+ const COUNTRY_HEADER_NAME = "x-vercel-ip-country";
35
+ const IP_HEADER_NAME = "x-real-ip";
36
+ const LATITUDE_HEADER_NAME = "x-vercel-ip-latitude";
37
+ const LONGITUDE_HEADER_NAME = "x-vercel-ip-longitude";
38
+ const REGION_HEADER_NAME = "x-vercel-ip-country-region";
39
+ const REQUEST_ID_HEADER_NAME = "x-vercel-id";
40
+ const EMOJI_FLAG_UNICODE_STARTING_POSITION = 127397;
41
+ function getHeader(request, key) {
42
+ return request.headers.get(key) ?? void 0;
43
+ }
44
+ function getFlag(countryCode) {
45
+ const regex = new RegExp("^[A-Z]{2}$").test(countryCode);
46
+ if (!countryCode || !regex)
47
+ return void 0;
48
+ return String.fromCodePoint(
49
+ ...countryCode.split("").map((char) => EMOJI_FLAG_UNICODE_STARTING_POSITION + char.charCodeAt(0))
50
+ );
51
+ }
52
+ function ipAddress(request) {
53
+ return getHeader(request, IP_HEADER_NAME);
54
+ }
55
+ function getRegionFromRequestId(requestId) {
56
+ if (!requestId) {
57
+ return "dev1";
58
+ }
59
+ return requestId.split(":")[0];
60
+ }
61
+ function geolocation(request) {
62
+ return {
63
+ city: getHeader(request, CITY_HEADER_NAME),
64
+ country: getHeader(request, COUNTRY_HEADER_NAME),
65
+ flag: getFlag(getHeader(request, COUNTRY_HEADER_NAME)),
66
+ countryRegion: getHeader(request, REGION_HEADER_NAME),
67
+ region: getRegionFromRequestId(getHeader(request, REQUEST_ID_HEADER_NAME)),
68
+ latitude: getHeader(request, LATITUDE_HEADER_NAME),
69
+ longitude: getHeader(request, LONGITUDE_HEADER_NAME)
70
+ };
71
+ }
72
+ // Annotate the CommonJS export names for ESM import in node:
73
+ 0 && (module.exports = {
74
+ CITY_HEADER_NAME,
75
+ COUNTRY_HEADER_NAME,
76
+ EMOJI_FLAG_UNICODE_STARTING_POSITION,
77
+ IP_HEADER_NAME,
78
+ LATITUDE_HEADER_NAME,
79
+ LONGITUDE_HEADER_NAME,
80
+ REGION_HEADER_NAME,
81
+ REQUEST_ID_HEADER_NAME,
82
+ geolocation,
83
+ ipAddress
84
+ });
package/dist/index.d.ts CHANGED
@@ -1 +1,3 @@
1
- export * from './wait-until';
1
+ export { geolocation, ipAddress } from './headers';
2
+ export { getEnv } from './get-env';
3
+ export { waitUntil } from './wait-until';
package/dist/index.js CHANGED
@@ -3,6 +3,10 @@ var __defProp = Object.defineProperty;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
6
10
  var __copyProps = (to, from, except, desc) => {
7
11
  if (from && typeof from === "object" || typeof from === "function") {
8
12
  for (let key of __getOwnPropNames(from))
@@ -11,12 +15,22 @@ var __copyProps = (to, from, except, desc) => {
11
15
  }
12
16
  return to;
13
17
  };
14
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
15
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
16
19
  var src_exports = {};
20
+ __export(src_exports, {
21
+ geolocation: () => import_headers.geolocation,
22
+ getEnv: () => import_get_env.getEnv,
23
+ ipAddress: () => import_headers.ipAddress,
24
+ waitUntil: () => import_wait_until.waitUntil
25
+ });
17
26
  module.exports = __toCommonJS(src_exports);
18
- __reExport(src_exports, require("./wait-until"), module.exports);
27
+ var import_headers = require("./headers");
28
+ var import_get_env = require("./get-env");
29
+ var import_wait_until = require("./wait-until");
19
30
  // Annotate the CommonJS export names for ESM import in node:
20
31
  0 && (module.exports = {
21
- ...require("./wait-until")
32
+ geolocation,
33
+ getEnv,
34
+ ipAddress,
35
+ waitUntil
22
36
  });
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "dist"
10
10
  ],
11
11
  "types": "./dist/index.d.ts",
12
- "version": "1.1.0",
12
+ "version": "1.3.0",
13
13
  "repository": {
14
14
  "directory": "packages/functions",
15
15
  "type": "git",
@@ -19,8 +19,11 @@
19
19
  "url": "https://github.com/vercel/vercel/issues"
20
20
  },
21
21
  "devDependencies": {
22
- "typescript": "4.9.5",
23
22
  "tinyspawn": "1.3.1",
23
+ "typedoc": "0.24.6",
24
+ "typedoc-plugin-markdown": "3.15.2",
25
+ "typedoc-plugin-mdn-links": "3.0.3",
26
+ "typescript": "4.9.5",
24
27
  "vitest": "1.3.1"
25
28
  },
26
29
  "engines": {
@@ -31,7 +34,9 @@
31
34
  "access": "public"
32
35
  },
33
36
  "scripts": {
37
+ "pretest": "pnpm run build",
34
38
  "test": "vitest",
35
- "build": "node ../../utils/build.mjs"
39
+ "build": "node ../../utils/build.mjs",
40
+ "build:docs": "typedoc && prettier --write docs/**/*.md docs/*.md"
36
41
  }
37
42
  }