@vercel/node 1.12.2-canary.6 → 1.12.2-canary.7
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/babel.d.ts +4 -0
- package/dist/dev-server.d.ts +5 -0
- package/dist/example-import.d.ts +1 -0
- package/dist/helpers.d.ts +10 -0
- package/dist/index.d.ts +11 -33
- package/dist/index.js +22 -0
- package/dist/types.d.ts +33 -0
- package/dist/typescript.d.ts +34 -0
- package/package.json +2 -2
package/dist/babel.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { IncomingMessage, ServerResponse } from 'http';
|
|
3
|
+
import { Readable } from 'stream';
|
|
4
|
+
export declare function rawBody(readable: Readable): Promise<Buffer>;
|
|
5
|
+
export declare function onDevRequest(req: IncomingMessage, res: ServerResponse): Promise<void>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { VercelRequest, VercelResponse } from './types';
|
|
3
|
+
import { Server } from 'http';
|
|
4
|
+
import type { Bridge } from '@vercel/node-bridge/bridge';
|
|
5
|
+
export declare class ApiError extends Error {
|
|
6
|
+
readonly statusCode: number;
|
|
7
|
+
constructor(statusCode: number, message: string);
|
|
8
|
+
}
|
|
9
|
+
export declare function sendError(res: VercelResponse, statusCode: number, message: string): void;
|
|
10
|
+
export declare function createServerWithHelpers(handler: (req: VercelRequest, res: VercelResponse) => void | Promise<void>, bridge: Bridge): Server;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,33 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export declare
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export declare
|
|
11
|
-
|
|
12
|
-
cookies: VercelRequestCookies;
|
|
13
|
-
body: VercelRequestBody;
|
|
14
|
-
};
|
|
15
|
-
export declare type VercelResponse = ServerResponse & {
|
|
16
|
-
send: (body: any) => VercelResponse;
|
|
17
|
-
json: (jsonBody: any) => VercelResponse;
|
|
18
|
-
status: (statusCode: number) => VercelResponse;
|
|
19
|
-
redirect: (statusOrUrl: string | number, url?: string) => VercelResponse;
|
|
20
|
-
};
|
|
21
|
-
export declare type VercelApiHandler = (req: VercelRequest, res: VercelResponse) => void;
|
|
22
|
-
/** @deprecated Use VercelRequestCookies instead. */
|
|
23
|
-
export declare type NowRequestCookies = VercelRequestCookies;
|
|
24
|
-
/** @deprecated Use VercelRequestQuery instead. */
|
|
25
|
-
export declare type NowRequestQuery = VercelRequestQuery;
|
|
26
|
-
/** @deprecated Use VercelRequestBody instead. */
|
|
27
|
-
export declare type NowRequestBody = any;
|
|
28
|
-
/** @deprecated Use VercelRequest instead. */
|
|
29
|
-
export declare type NowRequest = VercelRequest;
|
|
30
|
-
/** @deprecated Use VercelResponse instead. */
|
|
31
|
-
export declare type NowResponse = VercelResponse;
|
|
32
|
-
/** @deprecated Use VercelApiHandler instead. */
|
|
33
|
-
export declare type NowApiHandler = VercelApiHandler;
|
|
1
|
+
import { Files, PrepareCacheOptions, BuildOptions, StartDevServerOptions, StartDevServerResult, shouldServe } from '@vercel/build-utils';
|
|
2
|
+
export { shouldServe };
|
|
3
|
+
export { NowRequest, NowResponse, VercelRequest, VercelResponse, } from './types';
|
|
4
|
+
export * from './types';
|
|
5
|
+
export declare const version = 3;
|
|
6
|
+
export declare function build({ files, entrypoint, workPath, repoRootPath, config, meta, }: BuildOptions): Promise<{
|
|
7
|
+
output: import("@vercel/build-utils").Lambda;
|
|
8
|
+
watch: string[];
|
|
9
|
+
}>;
|
|
10
|
+
export declare function prepareCache({ workPath, }: PrepareCacheOptions): Promise<Files>;
|
|
11
|
+
export declare function startDevServer(opts: StartDevServerOptions): Promise<StartDevServerResult>;
|
package/dist/index.js
CHANGED
|
@@ -344138,6 +344138,16 @@ exports.M = compile;
|
|
|
344138
344138
|
|
|
344139
344139
|
"use strict";
|
|
344140
344140
|
|
|
344141
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
344142
|
+
if (k2 === undefined) k2 = k;
|
|
344143
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
344144
|
+
}) : (function(o, m, k, k2) {
|
|
344145
|
+
if (k2 === undefined) k2 = k;
|
|
344146
|
+
o[k2] = m[k];
|
|
344147
|
+
}));
|
|
344148
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
344149
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
344150
|
+
};
|
|
344141
344151
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
344142
344152
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
344143
344153
|
};
|
|
@@ -344367,6 +344377,8 @@ function getAWSLambdaHandler(entrypoint, config) {
|
|
|
344367
344377
|
}
|
|
344368
344378
|
return '';
|
|
344369
344379
|
}
|
|
344380
|
+
// Ensures that everything from `types.ts` is exported in the final `index.d.ts` file.
|
|
344381
|
+
__exportStar(__webpack_require__(25748), exports);
|
|
344370
344382
|
exports.version = 3;
|
|
344371
344383
|
async function build({ files, entrypoint, workPath, repoRootPath, config = {}, meta = {}, }) {
|
|
344372
344384
|
const shouldAddHelpers = !(config.helpers === false || process.env.NODEJS_HELPERS === '0');
|
|
@@ -344536,6 +344548,16 @@ async function doTypeCheck({ entrypoint, workPath, meta = {} }, projectTsConfig)
|
|
|
344536
344548
|
}
|
|
344537
344549
|
|
|
344538
344550
|
|
|
344551
|
+
/***/ }),
|
|
344552
|
+
|
|
344553
|
+
/***/ 25748:
|
|
344554
|
+
/***/ ((__unused_webpack_module, exports) => {
|
|
344555
|
+
|
|
344556
|
+
"use strict";
|
|
344557
|
+
|
|
344558
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
344559
|
+
|
|
344560
|
+
|
|
344539
344561
|
/***/ }),
|
|
344540
344562
|
|
|
344541
344563
|
/***/ 80774:
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { ServerResponse, IncomingMessage } from 'http';
|
|
3
|
+
export declare type VercelRequestCookies = {
|
|
4
|
+
[key: string]: string;
|
|
5
|
+
};
|
|
6
|
+
export declare type VercelRequestQuery = {
|
|
7
|
+
[key: string]: string | string[];
|
|
8
|
+
};
|
|
9
|
+
export declare type VercelRequestBody = any;
|
|
10
|
+
export declare type VercelRequest = IncomingMessage & {
|
|
11
|
+
query: VercelRequestQuery;
|
|
12
|
+
cookies: VercelRequestCookies;
|
|
13
|
+
body: VercelRequestBody;
|
|
14
|
+
};
|
|
15
|
+
export declare type VercelResponse = ServerResponse & {
|
|
16
|
+
send: (body: any) => VercelResponse;
|
|
17
|
+
json: (jsonBody: any) => VercelResponse;
|
|
18
|
+
status: (statusCode: number) => VercelResponse;
|
|
19
|
+
redirect: (statusOrUrl: string | number, url?: string) => VercelResponse;
|
|
20
|
+
};
|
|
21
|
+
export declare type VercelApiHandler = (req: VercelRequest, res: VercelResponse) => void;
|
|
22
|
+
/** @deprecated Use VercelRequestCookies instead. */
|
|
23
|
+
export declare type NowRequestCookies = VercelRequestCookies;
|
|
24
|
+
/** @deprecated Use VercelRequestQuery instead. */
|
|
25
|
+
export declare type NowRequestQuery = VercelRequestQuery;
|
|
26
|
+
/** @deprecated Use VercelRequestBody instead. */
|
|
27
|
+
export declare type NowRequestBody = any;
|
|
28
|
+
/** @deprecated Use VercelRequest instead. */
|
|
29
|
+
export declare type NowRequest = VercelRequest;
|
|
30
|
+
/** @deprecated Use VercelResponse instead. */
|
|
31
|
+
export declare type NowResponse = VercelResponse;
|
|
32
|
+
/** @deprecated Use VercelApiHandler instead. */
|
|
33
|
+
export declare type NowApiHandler = VercelApiHandler;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import _ts from 'typescript';
|
|
2
|
+
/**
|
|
3
|
+
* Registration options.
|
|
4
|
+
*/
|
|
5
|
+
interface Options {
|
|
6
|
+
basePath?: string;
|
|
7
|
+
pretty?: boolean | null;
|
|
8
|
+
logError?: boolean | null;
|
|
9
|
+
files?: boolean | null;
|
|
10
|
+
compiler?: string;
|
|
11
|
+
ignore?: string[];
|
|
12
|
+
project?: string;
|
|
13
|
+
compilerOptions?: any;
|
|
14
|
+
ignoreDiagnostics?: Array<number | string>;
|
|
15
|
+
readFile?: (path: string) => string | undefined;
|
|
16
|
+
fileExists?: (path: string) => boolean;
|
|
17
|
+
transformers?: _ts.CustomTransformers;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Return type for registering `ts-node`.
|
|
21
|
+
*/
|
|
22
|
+
export declare type Register = (code: string, fileName: string, skipTypeCheck?: boolean) => SourceOutput;
|
|
23
|
+
/**
|
|
24
|
+
* Register TypeScript compiler.
|
|
25
|
+
*/
|
|
26
|
+
export declare function register(opts?: Options): Register;
|
|
27
|
+
/**
|
|
28
|
+
* Internal source output.
|
|
29
|
+
*/
|
|
30
|
+
declare type SourceOutput = {
|
|
31
|
+
code: string;
|
|
32
|
+
map: string;
|
|
33
|
+
};
|
|
34
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/node",
|
|
3
|
-
"version": "1.12.2-canary.
|
|
3
|
+
"version": "1.12.2-canary.7",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "./dist/index",
|
|
6
6
|
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/node-js",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"source-map-support": "0.5.12",
|
|
44
44
|
"test-listen": "1.1.0"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "2721b3449dd3ccd213f9bdd558e61eeba3ba710c"
|
|
47
47
|
}
|