Commit d71b7466 authored by Guillaume Vagner's avatar Guillaume Vagner
Browse files

Merge branch 'mongoose-to-mysql'

parents 1db1cf63 38b37d47
config.js
node_modules
\ No newline at end of file
../semver/bin/semver
\ No newline at end of file
MIT License
Copyright (c) Microsoft Corporation. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE
# Installation
> `npm install --save @types/bluebird`
# Summary
This package contains type definitions for bluebird (https://github.com/petkaantonov/bluebird).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/bluebird
Additional Details
* Last updated: Thu, 13 Dec 2018 21:05:14 GMT
* Dependencies: none
* Global values: none
# Credits
These definitions were written by Leonard Hecker <https://github.com/lhecker>.
This diff is collapsed.
{
"_from": "@types/bluebird@^3.5.19",
"_id": "@types/bluebird@3.5.25",
"_inBundle": false,
"_integrity": "sha512-yfhIBix+AIFTmYGtkC0Bi+XGjSkOINykqKvO/Wqdz/DuXlAKK7HmhLAXdPIGsV4xzKcL3ev/zYc4yLNo+OvGaw==",
"_location": "/@types/bluebird",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "@types/bluebird@^3.5.19",
"name": "@types/bluebird",
"escapedName": "@types%2fbluebird",
"scope": "@types",
"rawSpec": "^3.5.19",
"saveSpec": null,
"fetchSpec": "^3.5.19"
},
"_requiredBy": [
"/promise-mysql"
],
"_resolved": "https://registry.npmjs.org/@types/bluebird/-/bluebird-3.5.25.tgz",
"_shasum": "59188b871208092e37767e4b3d80c3b3eaae43bd",
"_spec": "@types/bluebird@^3.5.19",
"_where": "/home/capsule_man/developpement/happy-botday/node_modules/promise-mysql",
"bugs": {
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
},
"bundleDependencies": false,
"contributors": [
{
"name": "Leonard Hecker",
"url": "https://github.com/lhecker"
}
],
"dependencies": {},
"deprecated": false,
"description": "TypeScript definitions for bluebird",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
"license": "MIT",
"main": "",
"name": "@types/bluebird",
"repository": {
"type": "git",
"url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git"
},
"scripts": {},
"typeScriptVersion": "2.8",
"types": "index",
"typesPublisherContentHash": "84f287bba570664e8a87b6b30953506fa39d74685adb9b86fb0389dad064398f",
"version": "3.5.25"
}
MIT License
Copyright (c) Microsoft Corporation. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE
# Installation
> `npm install --save @types/mysql`
# Summary
This package contains type definitions for mysql (https://github.com/mysqljs/mysql).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mysql
Additional Details
* Last updated: Thu, 31 May 2018 20:09:03 GMT
* Dependencies: stream, tls, node
* Global values: none
# Credits
These definitions were written by William Johnston <https://github.com/wjohnsto>, Kacper Polak <https://github.com/kacepe>, Krittanan Pingclasai <https://github.com/kpping>, James Munro <https://github.com/jdmunro>.
// Type definitions for mysql 2.15
// Project: https://github.com/mysqljs/mysql
// Definitions by: William Johnston <https://github.com/wjohnsto>
// Kacper Polak <https://github.com/kacepe>
// Krittanan Pingclasai <https://github.com/kpping>
// James Munro <https://github.com/jdmunro>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
/// <reference types="node" />
import stream = require("stream");
import tls = require("tls");
export interface EscapeFunctions {
escape(value: any, stringifyObjects?: boolean, timeZone?: string): string;
escapeId(value: string, forbidQualified?: boolean): string;
format(sql: string, values: any[], stringifyObjects?: boolean, timeZone?: string): string;
}
// implements EscapeFunctions
export function escape(value: any, stringifyObjects?: boolean, timeZone?: string): string;
export function escapeId(value: string, forbidQualified?: boolean): string;
export function format(sql: string, values: any[], stringifyObjects?: boolean, timeZone?: string): string;
export function createConnection(connectionUri: string | ConnectionConfig): Connection;
export function createPool(config: PoolConfig | string): Pool;
export function createPoolCluster(config?: PoolClusterConfig): PoolCluster;
export function raw(sql: string): () => string;
export interface Connection extends EscapeFunctions {
config: ConnectionConfig;
state: 'connected' | 'authenticated' | 'disconnected' | 'protocol_error' | string;
threadId: number | null;
createQuery: QueryFunction;
connect(callback?: (err: MysqlError, ...args: any[]) => void): void;
connect(options: any, callback?: (err: MysqlError, ...args: any[]) => void): void;
changeUser(options: ConnectionOptions, callback?: (err: MysqlError) => void): void;
changeUser(callback: (err: MysqlError) => void): void;
beginTransaction(options?: QueryOptions, callback?: (err: MysqlError) => void): void;
beginTransaction(callback: (err: MysqlError) => void): void;
commit(options?: QueryOptions, callback?: (err: MysqlError) => void): void;
commit(callback: (err: MysqlError) => void): void;
rollback(options?: QueryOptions, callback?: (err: MysqlError) => void): void;
rollback(callback: (err: MysqlError) => void): void;
query: QueryFunction;
ping(options?: QueryOptions, callback?: (err: MysqlError) => void): void;
ping(callback: (err: MysqlError) => void): void;
statistics(options?: QueryOptions, callback?: (err: MysqlError) => void): void;
statistics(callback: (err: MysqlError) => void): void;
end(callback?: (err: MysqlError, ...args: any[]) => void): void;
end(options: any, callback: (err: MysqlError, ...args: any[]) => void): void;
destroy(): void;
pause(): void;
resume(): void;
on(ev: 'drain' | 'connect', callback: () => void): Connection;
on(ev: 'end', callback: (err?: MysqlError) => void): Connection;
on(ev: 'fields', callback: (fields: any[]) => void): Connection;
on(ev: 'error', callback: (err: MysqlError) => void): Connection;
on(ev: 'enqueue', callback: (...args: any[]) => void): Connection;
on(ev: string, callback: (...args: any[]) => void): this;
}
export interface PoolConnection extends Connection {
release(): void;
end(): void;
destroy(): void;
}
export interface Pool extends EscapeFunctions {
config: PoolConfig;
getConnection(callback: (err: MysqlError, connection: PoolConnection) => void): void;
acquireConnection(connection: PoolConnection, callback: (err: MysqlError, connection: PoolConnection) => void): void;
releaseConnection(connection: PoolConnection): void;
end(callback?: (err: MysqlError) => void): void;
query: QueryFunction;
on(ev: 'connection' | 'acquire' | 'release', callback: (connection: PoolConnection) => void): Pool;
on(ev: 'error', callback: (err: MysqlError) => void): Pool;
on(ev: 'enqueue', callback: (err?: MysqlError) => void): Pool;
on(ev: string, callback: (...args: any[]) => void): Pool;
}
export interface PoolCluster {
config: PoolClusterConfig;
add(config: PoolConfig): void;
add(id: string, config: PoolConfig): void;
end(callback?: (err: MysqlError) => void): void;
of(pattern: string, selector?: string): Pool;
of(pattern: undefined | null | false, selector: string): Pool;
/**
* remove all pools which match pattern
*/
remove(pattern: string): void;
getConnection(callback: (err: MysqlError, connection: PoolConnection) => void): void;
getConnection(pattern: string, callback: (err: MysqlError, connection: PoolConnection) => void): void;
getConnection(pattern: string, selector: string, callback: (err: MysqlError, connection: PoolConnection) => void): void;
on(ev: string, callback: (...args: any[]) => void): PoolCluster;
on(ev: 'remove' | 'offline' | 'remove', callback: (nodeId: string) => void): PoolCluster;
}
// related to Query
export type packetCallback = (packet: any) => void;
export interface Query {
/**
* Template query
*/
sql: string;
/**
* Values for template query
*/
values?: string[];
/**
* Default true
*/
typeCast?: TypeCast;
/**
* Default false
*/
nestedTables: boolean;
/**
* Emits a query packet to start the query
*/
start(): void;
/**
* Determines the packet class to use given the first byte of the packet.
*
* @param byte The first byte of the packet
* @param parser The packet parser
*/
determinePacket(byte: number, parser: any): any;
OkPacket: packetCallback;
ErrorPacket: packetCallback;
ResultSetHeaderPacket: packetCallback;
FieldPacket: packetCallback;
EofPacket: packetCallback;
RowDataPacket(packet: any, parser: any, connection: Connection): void;
/**
* Creates a Readable stream with the given options
*
* @param options The options for the stream. (see readable-stream package)
*/
stream(options?: stream.ReadableOptions): stream.Readable;
on(ev: string, callback: (...args: any[]) => void): Query;
on(ev: 'result', callback: (row: any, index: number) => void): Query;
on(ev: 'error', callback: (err: MysqlError) => void): Query;
on(ev: 'fields', callback: (fields: FieldInfo[], index: number) => void): Query;
on(ev: 'packet', callback: (packet: any) => void): Query;
on(ev: 'end', callback: () => void): Query;
}
export interface GeometryType extends Array<{x: number, y: number} | GeometryType> {
x: number;
y: number;
}
export type TypeCast = boolean | (
(field: FieldInfo
& { type: string, length: number, string(): string, buffer(): Buffer, geometry(): null | GeometryType},
next: () => void) => any);
export type queryCallback = (err: MysqlError | null, results?: any, fields?: FieldInfo[]) => void;
// values can be non [], see custom format (https://github.com/mysqljs/mysql#custom-format)
export interface QueryFunction {
(query: Query): Query;
(options: string | QueryOptions, callback?: queryCallback): Query;
(options: string, values: any, callback?: queryCallback): Query;
}
export interface QueryOptions {
/**
* The SQL for the query
*/
sql: string;
/**
* Values for template query
*/
values?: any;
/**
* Every operation takes an optional inactivity timeout option. This allows you to specify appropriate timeouts for
* operations. It is important to note that these timeouts are not part of the MySQL protocol, and rather timeout
* operations through the client. This means that when a timeout is reached, the connection it occurred on will be
* destroyed and no further operations can be performed.
*/
timeout?: number;
/**
* Either a boolean or string. If true, tables will be nested objects. If string (e.g. '_'), tables will be
* nested as tableName_fieldName
*/
nestTables?: any;
/**
* Determines if column values should be converted to native JavaScript types. It is not recommended (and may go away / change in the future)
* to disable type casting, but you can currently do so on either the connection or query level. (Default: true)
*
* You can also specify a function (field: any, next: () => void) => {} to do the type casting yourself.
*
* WARNING: YOU MUST INVOKE the parser using one of these three field functions in your custom typeCast callback. They can only be called once.
*
* field.string()
* field.buffer()
* field.geometry()
*
* are aliases for
*
* parser.parseLengthCodedString()
* parser.parseLengthCodedBuffer()
* parser.parseGeometryValue()
*
* You can find which field function you need to use by looking at: RowDataPacket.prototype._typeCast
*/
typeCast?: TypeCast;
}
export interface ConnectionOptions {
/**
* The MySQL user to authenticate as
*/
user?: string;
/**
* The password of that MySQL user
*/
password?: string;
/**
* Name of the database to use for this connection
*/
database?: string;
/**
* The charset for the connection. This is called "collation" in the SQL-level of MySQL (like utf8_general_ci).
* If a SQL-level charset is specified (like utf8mb4) then the default collation for that charset is used.
* (Default: 'UTF8_GENERAL_CI')
*/
charset?: string;
/**
* Number of milliseconds
*/
timeout?: number;
}
export interface ConnectionConfig extends ConnectionOptions {
/**
* The hostname of the database you are connecting to. (Default: localhost)
*/
host?: string;
/**
* The port number to connect to. (Default: 3306)
*/
port?: number;
/**
* The source IP address to use for TCP connection
*/
localAddress?: string;
/**
* The path to a unix domain socket to connect to. When used host and port are ignored
*/
socketPath?: string;
/**
* The timezone used to store local dates. (Default: 'local')
*/
timezone?: string;
/**
* The milliseconds before a timeout occurs during the initial connection to the MySQL server. (Default: 10 seconds)
*/
connectTimeout?: number;
/**
* Stringify objects instead of converting to values. (Default: 'false')
*/
stringifyObjects?: boolean;
/**
* Allow connecting to MySQL instances that ask for the old (insecure) authentication method. (Default: false)
*/
insecureAuth?: boolean;
/**
* Determines if column values should be converted to native JavaScript types. It is not recommended (and may go away / change in the future)
* to disable type casting, but you can currently do so on either the connection or query level. (Default: true)
*
* You can also specify a function (field: any, next: () => void) => {} to do the type casting yourself.
*
* WARNING: YOU MUST INVOKE the parser using one of these three field functions in your custom typeCast callback. They can only be called once.
*
* field.string()
* field.buffer()
* field.geometry()
*
* are aliases for
*
* parser.parseLengthCodedString()
* parser.parseLengthCodedBuffer()
* parser.parseGeometryValue()
*
* You can find which field function you need to use by looking at: RowDataPacket.prototype._typeCast
*/
typeCast?: TypeCast;
/**
* A custom query format function
*/
queryFormat?(query: string, values: any): void;
/**
* When dealing with big numbers (BIGINT and DECIMAL columns) in the database, you should enable this option
* (Default: false)
*/
supportBigNumbers?: boolean;
/**
* Enabling both supportBigNumbers and bigNumberStrings forces big numbers (BIGINT and DECIMAL columns) to be
* always returned as JavaScript String objects (Default: false). Enabling supportBigNumbers but leaving
* bigNumberStrings disabled will return big numbers as String objects only when they cannot be accurately
* represented with [JavaScript Number objects] (http://ecma262-5.com/ELS5_HTML.htm#Section_8.5)
* (which happens when they exceed the [-2^53, +2^53] range), otherwise they will be returned as Number objects.
* This option is ignored if supportBigNumbers is disabled.
*/
bigNumberStrings?: boolean;
/**
* Force date types (TIMESTAMP, DATETIME, DATE) to be returned as strings rather then inflated into JavaScript
* Date objects. Can be true/false or an array of type names to keep as strings. (Default: false)
*/
dateStrings?: boolean | Array<'TIMESTAMP' | 'DATETIME' | 'DATE'>;
/**
* This will print all incoming and outgoing packets on stdout.
* You can also restrict debugging to packet types by passing an array of types (strings) to debug;
*
* (Default: false)
*/
debug?: boolean | string[] | Types[];
/**
* Generates stack traces on errors to include call site of library entrance ("long stack traces"). Slight
* performance penalty for most calls. (Default: true)
*/
trace?: boolean;
/**
* Allow multiple mysql statements per query. Be careful with this, it exposes you to SQL injection attacks. (Default: false)
*/
multipleStatements?: boolean;
/**
* List of connection flags to use other than the default ones. It is also possible to blacklist default ones
*/
flags?: string[];
/**
* object with ssl parameters or a string containing name of ssl profile
*/
ssl?: string | (tls.SecureContextOptions & { rejectUnauthorized?: boolean });
}
export interface PoolConfig extends ConnectionConfig {
/**
* The milliseconds before a timeout occurs during the connection acquisition. This is slightly different from connectTimeout,
* because acquiring a pool connection does not always involve making a connection. (Default: 10 seconds)
*/
acquireTimeout?: number;
/**
* Determines the pool's action when no connections are available and the limit has been reached. If true, the pool will queue
* the connection request and call it when one becomes available. If false, the pool will immediately call back with an error.
* (Default: true)
*/
waitForConnections?: boolean;
/**
* The maximum number of connections to create at once. (Default: 10)
*/
connectionLimit?: number;
/**
* The maximum number of connection requests the pool will queue before returning an error from getConnection. If set to 0, there
* is no limit to the number of queued connection requests. (Default: 0)
*/
queueLimit?: number;
}
export interface PoolClusterConfig {
/**
* If true, PoolCluster will attempt to reconnect when connection fails. (Default: true)
*/
canRetry?: boolean;