node_modules ignore

This commit is contained in:
2025-05-08 23:43:47 +02:00
parent e19d52f172
commit 4574544c9f
65041 changed files with 10593536 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
import type { KoaBodyMiddlewareOptions } from '../types';
import type { Context } from 'koa';
export declare function isJsonBody(ctx: Context, options: KoaBodyMiddlewareOptions): string | false | null;
export declare function isUrlencodedBody(ctx: Context, options: KoaBodyMiddlewareOptions): string | false | null;
export declare function isTextBody(ctx: Context, options: KoaBodyMiddlewareOptions): string | false | null;
export declare function isMultipartBody(ctx: Context, options: KoaBodyMiddlewareOptions): string | false | null;

View File

@@ -0,0 +1,27 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isMultipartBody = exports.isTextBody = exports.isUrlencodedBody = exports.isJsonBody = void 0;
const jsonTypes = [
'application/json',
'application/json-patch+json',
'application/vnd.api+json',
'application/csp-report',
'application/reports+json',
];
function isJsonBody(ctx, options) {
return options.json && ctx.is(jsonTypes);
}
exports.isJsonBody = isJsonBody;
function isUrlencodedBody(ctx, options) {
return options.urlencoded && ctx.is('urlencoded');
}
exports.isUrlencodedBody = isUrlencodedBody;
function isTextBody(ctx, options) {
return options.text && ctx.is('text/*');
}
exports.isTextBody = isTextBody;
function isMultipartBody(ctx, options) {
return options.multipart && ctx.is('multipart');
}
exports.isMultipartBody = isMultipartBody;
//# sourceMappingURL=body-type-util.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"body-type-util.js","sourceRoot":"","sources":["../../src/utils/body-type-util.ts"],"names":[],"mappings":";;;AAGA,MAAM,SAAS,GAAG;IAChB,kBAAkB;IAClB,6BAA6B;IAC7B,0BAA0B;IAC1B,wBAAwB;IACxB,0BAA0B;CAC3B,CAAC;AAEF,SAAgB,UAAU,CAAC,GAAY,EAAE,OAAiC;IACxE,OAAO,OAAO,CAAC,IAAI,IAAI,GAAG,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC;AAC3C,CAAC;AAFD,gCAEC;AAED,SAAgB,gBAAgB,CAAC,GAAY,EAAE,OAAiC;IAC9E,OAAO,OAAO,CAAC,UAAU,IAAI,GAAG,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC;AACpD,CAAC;AAFD,4CAEC;AAED,SAAgB,UAAU,CAAC,GAAY,EAAE,OAAiC;IACxE,OAAO,OAAO,CAAC,IAAI,IAAI,GAAG,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;AAC1C,CAAC;AAFD,gCAEC;AAED,SAAgB,eAAe,CAAC,GAAY,EAAE,OAAiC;IAC7E,OAAO,OAAO,CAAC,SAAS,IAAI,GAAG,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC;AAClD,CAAC;AAFD,0CAEC"}

View File

@@ -0,0 +1,8 @@
import type { Fields, Files } from 'formidable';
import type { Context } from 'koa';
import type { ExtendedFormidableOptions } from '../types';
export declare type ParseWithFormidableResult = {
fields: Fields;
files: Files;
};
export default function parseWithFormidable(ctx: Context, options: ExtendedFormidableOptions): Promise<ParseWithFormidableResult>;

View File

@@ -0,0 +1,24 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const formidable_1 = __importDefault(require("formidable"));
function parseWithFormidable(ctx, options) {
const { onFileBegin, ...directOptions } = options;
const form = (0, formidable_1.default)({ multiples: true, ...directOptions });
if (onFileBegin) {
form.on('fileBegin', onFileBegin);
}
return new Promise((resolve, reject) => {
form.parse(ctx.req, (error, fields, files) => {
if (error) {
reject(error);
return;
}
resolve({ fields, files });
});
});
}
exports.default = parseWithFormidable;
//# sourceMappingURL=parse-with-formidable.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"parse-with-formidable.js","sourceRoot":"","sources":["../../src/utils/parse-with-formidable.ts"],"names":[],"mappings":";;;;;AACA,4DAAoC;AASpC,SAAwB,mBAAmB,CACzC,GAAY,EACZ,OAAkC;IAElC,MAAM,EAAE,WAAW,EAAE,GAAG,aAAa,EAAE,GAAG,OAAO,CAAC;IAClD,MAAM,IAAI,GAAG,IAAA,oBAAU,EAAC,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,aAAa,EAAE,CAAC,CAAC;IAC/D,IAAI,WAAW,EAAE;QACf,IAAI,CAAC,EAAE,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;KACnC;IACD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE;YAC3C,IAAI,KAAK,EAAE;gBACT,MAAM,CAAC,KAAK,CAAC,CAAC;gBACd,OAAO;aACR;YACD,OAAO,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,CAAC;QAC7B,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC;AAlBD,sCAkBC"}

21
server/node_modules/koa-body/lib/utils/patch-util.d.ts generated vendored Normal file
View File

@@ -0,0 +1,21 @@
import type { Context } from 'koa';
import type { Files } from 'formidable';
declare type PatchOptions = {
isMultipart: string | boolean | null;
isText: string | boolean | null;
includeUnparsed: boolean;
patchNode: boolean;
patchKoa: boolean;
};
export declare type ContextWithBodyAndFiles = Context & {
req: {
body?: any;
files?: Files;
};
request: {
body?: any;
files?: Files;
};
};
export declare function patchNodeAndKoa(ctx: ContextWithBodyAndFiles, body: any, options: PatchOptions): void;
export {};

42
server/node_modules/koa-body/lib/utils/patch-util.js generated vendored Normal file
View File

@@ -0,0 +1,42 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.patchNodeAndKoa = void 0;
const unparsed_1 = __importDefault(require("../unparsed"));
function patchNodeAndKoa(ctx, body, options) {
const { patchKoa, patchNode, isMultipart, includeUnparsed, isText } = options;
if (patchNode) {
if (isMultipart) {
ctx.req.body = body.fields;
ctx.req.files = body.files;
}
else if (includeUnparsed) {
ctx.req.body = body.parsed || {};
if (!isText) {
ctx.req.body[unparsed_1.default] = body.raw;
}
}
else {
ctx.req.body = body;
}
}
if (patchKoa) {
if (isMultipart) {
ctx.request.body = body.fields;
ctx.request.files = body.files;
}
else if (includeUnparsed) {
ctx.request.body = body.parsed || {};
if (!isText) {
ctx.request.body[unparsed_1.default] = body.raw;
}
}
else {
ctx.request.body = body;
}
}
}
exports.patchNodeAndKoa = patchNodeAndKoa;
//# sourceMappingURL=patch-util.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"patch-util.js","sourceRoot":"","sources":["../../src/utils/patch-util.ts"],"names":[],"mappings":";;;;;;AACA,2DAAyC;AAsBzC,SAAgB,eAAe,CAAC,GAA4B,EAAE,IAAS,EAAE,OAAqB;IAC5F,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAE9E,IAAI,SAAS,EAAE;QACb,IAAI,WAAW,EAAE;YACf,GAAG,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC;YAC3B,GAAG,CAAC,GAAG,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;SAC5B;aAAM,IAAI,eAAe,EAAE;YAC1B,GAAG,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC;YACjC,IAAI,CAAC,MAAM,EAAE;gBACX,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,kBAAc,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC;aACzC;SACF;aAAM;YACL,GAAG,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC;SACrB;KACF;IACD,IAAI,QAAQ,EAAE;QACZ,IAAI,WAAW,EAAE;YACf,GAAG,CAAC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC;YAC/B,GAAG,CAAC,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;SAChC;aAAM,IAAI,eAAe,EAAE;YAC1B,GAAG,CAAC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC,MAAM,IAAI,EAAE,CAAC;YACrC,IAAI,CAAC,MAAM,EAAE;gBACX,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAc,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC;aAC7C;SACF;aAAM;YACL,GAAG,CAAC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAC;SACzB;KACF;AACH,CAAC;AA7BD,0CA6BC"}

View File

@@ -0,0 +1,2 @@
import { HttpMethodEnum } from '../types';
export default function toHttpMethod(method: string): HttpMethodEnum;

View File

@@ -0,0 +1,8 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const types_1 = require("../types");
function toHttpMethod(method) {
return types_1.HttpMethodEnum[method];
}
exports.default = toHttpMethod;
//# sourceMappingURL=string-method-to-enum-method.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"string-method-to-enum-method.js","sourceRoot":"","sources":["../../src/utils/string-method-to-enum-method.ts"],"names":[],"mappings":";;AAAA,oCAA0C;AAE1C,SAAwB,YAAY,CAAC,MAAc;IACjD,OAAO,sBAAc,CAAC,MAAqC,CAAC,CAAC;AAC/D,CAAC;AAFD,+BAEC"}

View File

@@ -0,0 +1 @@
export default function throwableToError(e: unknown): Error;

View File

@@ -0,0 +1,13 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function throwableToError(e) {
if (e instanceof Error) {
return e;
}
const error = new Error(typeof e === 'object' ? JSON.stringify(e) : '' + e);
error.name = typeof e;
error.stack = undefined;
return error;
}
exports.default = throwableToError;
//# sourceMappingURL=throwable-to-error.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"throwable-to-error.js","sourceRoot":"","sources":["../../src/utils/throwable-to-error.ts"],"names":[],"mappings":";;AAAA,SAAwB,gBAAgB,CAAC,CAAU;IACjD,IAAI,CAAC,YAAY,KAAK,EAAE;QACtB,OAAO,CAAC,CAAC;KACV;IAED,MAAM,KAAK,GAAG,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;IAC5E,KAAK,CAAC,IAAI,GAAG,OAAO,CAAC,CAAC;IACtB,KAAK,CAAC,KAAK,GAAG,SAAS,CAAC;IAExB,OAAO,KAAK,CAAC;AACf,CAAC;AAVD,mCAUC"}