Initial commit - Event Planner application

This commit is contained in:
mberlin
2026-03-18 14:55:56 -03:00
commit 86d779eb4d
7548 changed files with 1006324 additions and 0 deletions

1
node_modules/@nestjs/common/file-stream/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
export * from './streamable-file';

4
node_modules/@nestjs/common/file-stream/index.js generated vendored Normal file
View File

@@ -0,0 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./streamable-file"), exports);

View File

@@ -0,0 +1,2 @@
export * from './streamable-options.interface';
export * from './streamable-handler-response.interface';

View File

@@ -0,0 +1,5 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./streamable-options.interface"), exports);
tslib_1.__exportStar(require("./streamable-handler-response.interface"), exports);

View File

@@ -0,0 +1,12 @@
export interface StreamableHandlerResponse {
/** `true` if the connection is destroyed, `false` otherwise. */
destroyed: boolean;
/** `true` if headers were sent, `false` otherwise. */
headersSent: boolean;
/** The status code that will be sent to the client when the headers get flushed. */
statusCode: number;
/** Sends the HTTP response. */
send: (body: string) => void;
/** Signals to the server that all of the response headers and body have been sent. */
end: () => void;
}

View File

@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@@ -0,0 +1,22 @@
/**
* Options for `StreamableFile`
*
* @see [Streaming files](https://docs.nestjs.com/techniques/streaming-files)
*
* @publicApi
*/
export interface StreamableFileOptions {
/**
* The value that will be used for the `Content-Type` response header.
* @default `"application/octet-stream"`
*/
type?: string;
/**
* The value that will be used for the `Content-Disposition` response header.
*/
disposition?: string | string[];
/**
* The value that will be used for the `Content-Length` response header.
*/
length?: number;
}

View File

@@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

View File

@@ -0,0 +1,27 @@
import { Readable } from 'stream';
import { Logger } from '../services';
import { StreamableFileOptions, StreamableHandlerResponse } from './interfaces';
/**
* @see [Streaming files](https://docs.nestjs.com/techniques/streaming-files)
*
* @publicApi
*/
export declare class StreamableFile {
readonly options: StreamableFileOptions;
private readonly stream;
protected logger: Logger;
protected handleError: (err: Error, response: StreamableHandlerResponse) => void;
protected logError: (err: Error) => void;
constructor(buffer: Uint8Array, options?: StreamableFileOptions);
constructor(readable: Readable, options?: StreamableFileOptions);
getStream(): Readable;
getHeaders(): {
type: string;
disposition: string | string[] | undefined;
length: number | undefined;
};
get errorHandler(): (err: Error, response: StreamableHandlerResponse) => void;
setErrorHandler(handler: (err: Error, response: StreamableHandlerResponse) => void): this;
get errorLogger(): (err: Error) => void;
setErrorLogger(handler: (err: Error) => void): this;
}

View File

@@ -0,0 +1,68 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.StreamableFile = void 0;
const stream_1 = require("stream");
const util_1 = require("util");
const enums_1 = require("../enums");
const services_1 = require("../services");
const shared_utils_1 = require("../utils/shared.utils");
/**
* @see [Streaming files](https://docs.nestjs.com/techniques/streaming-files)
*
* @publicApi
*/
class StreamableFile {
constructor(bufferOrReadStream, options = {}) {
this.options = options;
this.logger = new services_1.Logger('StreamableFile');
this.handleError = (err, res) => {
if (res.destroyed) {
return;
}
if (res.headersSent) {
res.end();
return;
}
res.statusCode = enums_1.HttpStatus.BAD_REQUEST;
res.send(err.message);
};
this.logError = (err) => {
this.logger.error(err);
};
if (util_1.types.isUint8Array(bufferOrReadStream)) {
this.stream = new stream_1.Readable();
this.stream.push(bufferOrReadStream);
this.stream.push(null);
this.options.length ??= bufferOrReadStream.length;
}
else if (bufferOrReadStream.pipe && (0, shared_utils_1.isFunction)(bufferOrReadStream.pipe)) {
this.stream = bufferOrReadStream;
}
}
getStream() {
return this.stream;
}
getHeaders() {
const { type = 'application/octet-stream', disposition = undefined, length = undefined, } = this.options;
return {
type,
disposition,
length,
};
}
get errorHandler() {
return this.handleError;
}
setErrorHandler(handler) {
this.handleError = handler;
return this;
}
get errorLogger() {
return this.logError;
}
setErrorLogger(handler) {
this.logError = handler;
return this;
}
}
exports.StreamableFile = StreamableFile;