From cadc507fad2fee59b23d1d8e73c472c077f468fc Mon Sep 17 00:00:00 2001 From: Heiner Lohaus Date: Sat, 18 Nov 2023 04:38:31 +0100 Subject: Add AiChatOnline, ChatgptDemoAi, ChatgptNext Providers Add OnlineGpt and TalkAi Provider Add get_random_string and get_random_hex helper Remove funcaptcha package --- .../npm/node_modules/@fastify/busboy/lib/main.js | 85 ---------------------- 1 file changed, 85 deletions(-) delete mode 100644 g4f/Provider/npm/node_modules/@fastify/busboy/lib/main.js (limited to 'g4f/Provider/npm/node_modules/@fastify/busboy/lib/main.js') diff --git a/g4f/Provider/npm/node_modules/@fastify/busboy/lib/main.js b/g4f/Provider/npm/node_modules/@fastify/busboy/lib/main.js deleted file mode 100644 index 8794bebf..00000000 --- a/g4f/Provider/npm/node_modules/@fastify/busboy/lib/main.js +++ /dev/null @@ -1,85 +0,0 @@ -'use strict' - -const WritableStream = require('node:stream').Writable -const { inherits } = require('node:util') -const Dicer = require('../deps/dicer/lib/Dicer') - -const MultipartParser = require('./types/multipart') -const UrlencodedParser = require('./types/urlencoded') -const parseParams = require('./utils/parseParams') - -function Busboy (opts) { - if (!(this instanceof Busboy)) { return new Busboy(opts) } - - if (typeof opts !== 'object') { - throw new TypeError('Busboy expected an options-Object.') - } - if (typeof opts.headers !== 'object') { - throw new TypeError('Busboy expected an options-Object with headers-attribute.') - } - if (typeof opts.headers['content-type'] !== 'string') { - throw new TypeError('Missing Content-Type-header.') - } - - const { - headers, - ...streamOptions - } = opts - - this.opts = { - autoDestroy: false, - ...streamOptions - } - WritableStream.call(this, this.opts) - - this._done = false - this._parser = this.getParserByHeaders(headers) - this._finished = false -} -inherits(Busboy, WritableStream) - -Busboy.prototype.emit = function (ev) { - if (ev === 'finish') { - if (!this._done) { - this._parser?.end() - return - } else if (this._finished) { - return - } - this._finished = true - } - WritableStream.prototype.emit.apply(this, arguments) -} - -Busboy.prototype.getParserByHeaders = function (headers) { - const parsed = parseParams(headers['content-type']) - - const cfg = { - defCharset: this.opts.defCharset, - fileHwm: this.opts.fileHwm, - headers, - highWaterMark: this.opts.highWaterMark, - isPartAFile: this.opts.isPartAFile, - limits: this.opts.limits, - parsedConType: parsed, - preservePath: this.opts.preservePath - } - - if (MultipartParser.detect.test(parsed[0])) { - return new MultipartParser(this, cfg) - } - if (UrlencodedParser.detect.test(parsed[0])) { - return new UrlencodedParser(this, cfg) - } - throw new Error('Unsupported Content-Type.') -} - -Busboy.prototype._write = function (chunk, encoding, cb) { - this._parser.write(chunk, cb) -} - -module.exports = Busboy -module.exports.default = Busboy -module.exports.Busboy = Busboy - -module.exports.Dicer = Dicer -- cgit v1.2.3