yt-transcript-strapi-plugin 0.0.21 → 0.0.22
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/server/index.js +44 -124
- package/dist/server/index.mjs +44 -124
- package/dist/server/src/content-types/index.d.ts +0 -3
- package/dist/server/src/content-types/transcript/index.d.ts +0 -3
- package/dist/server/src/index.d.ts +0 -4
- package/dist/server/src/mcp/schemas/index.d.ts +0 -6
- package/dist/server/src/mcp/tools/fetch-transcript.d.ts +0 -5
- package/dist/server/src/mcp/tools/index.d.ts +13 -13
- package/dist/server/src/services/index.d.ts +0 -1
- package/dist/server/src/services/service.d.ts +0 -2
- package/node_modules/express/node_modules/media-typer/HISTORY.md +50 -0
- package/node_modules/express/node_modules/media-typer/LICENSE +22 -0
- package/node_modules/express/node_modules/media-typer/README.md +93 -0
- package/node_modules/express/node_modules/media-typer/index.js +143 -0
- package/node_modules/express/node_modules/media-typer/package.json +33 -0
- package/node_modules/express/node_modules/type-is/HISTORY.md +292 -0
- package/node_modules/express/node_modules/type-is/LICENSE +23 -0
- package/node_modules/express/node_modules/type-is/README.md +198 -0
- package/node_modules/express/node_modules/type-is/index.js +250 -0
- package/node_modules/express/node_modules/type-is/package.json +47 -0
- package/package.json +1 -5
- package/dist/server/src/utils/openai.d.ts +0 -9
- package/node_modules/which/CHANGELOG.md +0 -166
- /package/node_modules/{media-typer → body-parser/node_modules/media-typer}/HISTORY.md +0 -0
- /package/node_modules/{media-typer → body-parser/node_modules/media-typer}/LICENSE +0 -0
- /package/node_modules/{media-typer → body-parser/node_modules/media-typer}/README.md +0 -0
- /package/node_modules/{media-typer → body-parser/node_modules/media-typer}/index.js +0 -0
- /package/node_modules/{media-typer → body-parser/node_modules/media-typer}/package.json +0 -0
- /package/node_modules/{type-is → body-parser}/node_modules/mime-types/HISTORY.md +0 -0
- /package/node_modules/{type-is → body-parser}/node_modules/mime-types/LICENSE +0 -0
- /package/node_modules/{type-is → body-parser}/node_modules/mime-types/README.md +0 -0
- /package/node_modules/{type-is → body-parser}/node_modules/mime-types/index.js +0 -0
- /package/node_modules/{type-is → body-parser}/node_modules/mime-types/mimeScore.js +0 -0
- /package/node_modules/{type-is → body-parser}/node_modules/mime-types/package.json +0 -0
- /package/node_modules/{type-is → body-parser/node_modules/type-is}/HISTORY.md +0 -0
- /package/node_modules/{type-is → body-parser/node_modules/type-is}/LICENSE +0 -0
- /package/node_modules/{type-is → body-parser/node_modules/type-is}/README.md +0 -0
- /package/node_modules/{type-is → body-parser/node_modules/type-is}/index.js +0 -0
- /package/node_modules/{type-is → body-parser/node_modules/type-is}/package.json +0 -0
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
# type-is
|
|
2
|
+
|
|
3
|
+
[![NPM Version][npm-version-image]][npm-url]
|
|
4
|
+
[![NPM Downloads][npm-downloads-image]][npm-url]
|
|
5
|
+
[![Node.js Version][node-version-image]][node-version-url]
|
|
6
|
+
[![Build Status][ci-image]][ci-url]
|
|
7
|
+
[![Test Coverage][coveralls-image]][coveralls-url]
|
|
8
|
+
|
|
9
|
+
Infer the content-type of a request.
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
This is a [Node.js](https://nodejs.org/en/) module available through the
|
|
14
|
+
[npm registry](https://www.npmjs.com/). Installation is done using the
|
|
15
|
+
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
$ npm install type-is
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## API
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
var http = require('http')
|
|
25
|
+
var typeis = require('type-is')
|
|
26
|
+
|
|
27
|
+
http.createServer(function (req, res) {
|
|
28
|
+
var istext = typeis(req, ['text/*'])
|
|
29
|
+
res.end('you ' + (istext ? 'sent' : 'did not send') + ' me text')
|
|
30
|
+
})
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### typeis(request, types)
|
|
34
|
+
|
|
35
|
+
Checks if the `request` is one of the `types`. If the request has no body,
|
|
36
|
+
even if there is a `Content-Type` header, then `null` is returned. If the
|
|
37
|
+
`Content-Type` header is invalid or does not matches any of the `types`, then
|
|
38
|
+
`false` is returned. Otherwise, a string of the type that matched is returned.
|
|
39
|
+
|
|
40
|
+
The `request` argument is expected to be a Node.js HTTP request. The `types`
|
|
41
|
+
argument is an array of type strings.
|
|
42
|
+
|
|
43
|
+
Each type in the `types` array can be one of the following:
|
|
44
|
+
|
|
45
|
+
- A file extension name such as `json`. This name will be returned if matched.
|
|
46
|
+
- A mime type such as `application/json`.
|
|
47
|
+
- A mime type with a wildcard such as `*/*` or `*/json` or `application/*`.
|
|
48
|
+
The full mime type will be returned if matched.
|
|
49
|
+
- A suffix such as `+json`. This can be combined with a wildcard such as
|
|
50
|
+
`*/vnd+json` or `application/*+json`. The full mime type will be returned
|
|
51
|
+
if matched.
|
|
52
|
+
|
|
53
|
+
Some examples to illustrate the inputs and returned value:
|
|
54
|
+
|
|
55
|
+
```js
|
|
56
|
+
// req.headers.content-type = 'application/json'
|
|
57
|
+
|
|
58
|
+
typeis(req, ['json']) // => 'json'
|
|
59
|
+
typeis(req, ['html', 'json']) // => 'json'
|
|
60
|
+
typeis(req, ['application/*']) // => 'application/json'
|
|
61
|
+
typeis(req, ['application/json']) // => 'application/json'
|
|
62
|
+
|
|
63
|
+
typeis(req, ['html']) // => false
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### typeis.hasBody(request)
|
|
67
|
+
|
|
68
|
+
Returns a Boolean if the given `request` has a body, regardless of the
|
|
69
|
+
`Content-Type` header.
|
|
70
|
+
|
|
71
|
+
Having a body has no relation to how large the body is (it may be 0 bytes).
|
|
72
|
+
This is similar to how file existence works. If a body does exist, then this
|
|
73
|
+
indicates that there is data to read from the Node.js request stream.
|
|
74
|
+
|
|
75
|
+
```js
|
|
76
|
+
if (typeis.hasBody(req)) {
|
|
77
|
+
// read the body, since there is one
|
|
78
|
+
|
|
79
|
+
req.on('data', function (chunk) {
|
|
80
|
+
// ...
|
|
81
|
+
})
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### typeis.is(mediaType, types)
|
|
86
|
+
|
|
87
|
+
Checks if the `mediaType` is one of the `types`. If the `mediaType` is invalid
|
|
88
|
+
or does not matches any of the `types`, then `false` is returned. Otherwise, a
|
|
89
|
+
string of the type that matched is returned.
|
|
90
|
+
|
|
91
|
+
The `mediaType` argument is expected to be a
|
|
92
|
+
[media type](https://tools.ietf.org/html/rfc6838) string. The `types` argument
|
|
93
|
+
is an array of type strings.
|
|
94
|
+
|
|
95
|
+
Each type in the `types` array can be one of the following:
|
|
96
|
+
|
|
97
|
+
- A file extension name such as `json`. This name will be returned if matched.
|
|
98
|
+
- A mime type such as `application/json`.
|
|
99
|
+
- A mime type with a wildcard such as `*/*` or `*/json` or `application/*`.
|
|
100
|
+
The full mime type will be returned if matched.
|
|
101
|
+
- A suffix such as `+json`. This can be combined with a wildcard such as
|
|
102
|
+
`*/vnd+json` or `application/*+json`. The full mime type will be returned
|
|
103
|
+
if matched.
|
|
104
|
+
|
|
105
|
+
Some examples to illustrate the inputs and returned value:
|
|
106
|
+
|
|
107
|
+
```js
|
|
108
|
+
var mediaType = 'application/json'
|
|
109
|
+
|
|
110
|
+
typeis.is(mediaType, ['json']) // => 'json'
|
|
111
|
+
typeis.is(mediaType, ['html', 'json']) // => 'json'
|
|
112
|
+
typeis.is(mediaType, ['application/*']) // => 'application/json'
|
|
113
|
+
typeis.is(mediaType, ['application/json']) // => 'application/json'
|
|
114
|
+
|
|
115
|
+
typeis.is(mediaType, ['html']) // => false
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### typeis.match(expected, actual)
|
|
119
|
+
|
|
120
|
+
Match the type string `expected` with `actual`, taking in to account wildcards.
|
|
121
|
+
A wildcard can only be in the type of the subtype part of a media type and only
|
|
122
|
+
in the `expected` value (as `actual` should be the real media type to match). A
|
|
123
|
+
suffix can still be included even with a wildcard subtype. If an input is
|
|
124
|
+
malformed, `false` will be returned.
|
|
125
|
+
|
|
126
|
+
```js
|
|
127
|
+
typeis.match('text/html', 'text/html') // => true
|
|
128
|
+
typeis.match('*/html', 'text/html') // => true
|
|
129
|
+
typeis.match('text/*', 'text/html') // => true
|
|
130
|
+
typeis.match('*/*', 'text/html') // => true
|
|
131
|
+
typeis.match('*/*+json', 'application/x-custom+json') // => true
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### typeis.normalize(type)
|
|
135
|
+
|
|
136
|
+
Normalize a `type` string. This works by performing the following:
|
|
137
|
+
|
|
138
|
+
- If the `type` is not a string, `false` is returned.
|
|
139
|
+
- If the string starts with `+` (so it is a `+suffix` shorthand like `+json`),
|
|
140
|
+
then it is expanded to contain the complete wildcard notation of `*/*+suffix`.
|
|
141
|
+
- If the string contains a `/`, then it is returned as the type.
|
|
142
|
+
- Else the string is assumed to be a file extension and the mapped media type is
|
|
143
|
+
returned, or `false` is there is no mapping.
|
|
144
|
+
|
|
145
|
+
This includes two special mappings:
|
|
146
|
+
|
|
147
|
+
- `'multipart'` -> `'multipart/*'`
|
|
148
|
+
- `'urlencoded'` -> `'application/x-www-form-urlencoded'`
|
|
149
|
+
|
|
150
|
+
## Examples
|
|
151
|
+
|
|
152
|
+
### Example body parser
|
|
153
|
+
|
|
154
|
+
```js
|
|
155
|
+
var express = require('express')
|
|
156
|
+
var typeis = require('type-is')
|
|
157
|
+
|
|
158
|
+
var app = express()
|
|
159
|
+
|
|
160
|
+
app.use(function bodyParser (req, res, next) {
|
|
161
|
+
if (!typeis.hasBody(req)) {
|
|
162
|
+
return next()
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
switch (typeis(req, ['urlencoded', 'json', 'multipart'])) {
|
|
166
|
+
case 'urlencoded':
|
|
167
|
+
// parse urlencoded body
|
|
168
|
+
throw new Error('implement urlencoded body parsing')
|
|
169
|
+
case 'json':
|
|
170
|
+
// parse json body
|
|
171
|
+
throw new Error('implement json body parsing')
|
|
172
|
+
case 'multipart':
|
|
173
|
+
// parse multipart body
|
|
174
|
+
throw new Error('implement multipart body parsing')
|
|
175
|
+
default:
|
|
176
|
+
// 415 error code
|
|
177
|
+
res.statusCode = 415
|
|
178
|
+
res.end()
|
|
179
|
+
break
|
|
180
|
+
}
|
|
181
|
+
})
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
## License
|
|
185
|
+
|
|
186
|
+
[MIT](LICENSE)
|
|
187
|
+
|
|
188
|
+
[ci-image]: https://badgen.net/github/checks/jshttp/type-is/master?label=ci
|
|
189
|
+
[ci-url]: https://github.com/jshttp/type-is/actions/workflows/ci.yml
|
|
190
|
+
[coveralls-image]: https://badgen.net/coveralls/c/github/jshttp/type-is/master
|
|
191
|
+
[coveralls-url]: https://coveralls.io/r/jshttp/type-is?branch=master
|
|
192
|
+
[node-version-image]: https://badgen.net/npm/node/type-is
|
|
193
|
+
[node-version-url]: https://nodejs.org/en/download
|
|
194
|
+
[npm-downloads-image]: https://badgen.net/npm/dm/type-is
|
|
195
|
+
[npm-url]: https://npmjs.org/package/type-is
|
|
196
|
+
[npm-version-image]: https://badgen.net/npm/v/type-is
|
|
197
|
+
[travis-image]: https://badgen.net/travis/jshttp/type-is/master
|
|
198
|
+
[travis-url]: https://travis-ci.org/jshttp/type-is
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* type-is
|
|
3
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
4
|
+
* Copyright(c) 2014-2015 Douglas Christopher Wilson
|
|
5
|
+
* MIT Licensed
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
'use strict'
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Module dependencies.
|
|
12
|
+
* @private
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
var contentType = require('content-type')
|
|
16
|
+
var mime = require('mime-types')
|
|
17
|
+
var typer = require('media-typer')
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Module exports.
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
module.exports = typeofrequest
|
|
25
|
+
module.exports.is = typeis
|
|
26
|
+
module.exports.hasBody = hasbody
|
|
27
|
+
module.exports.normalize = normalize
|
|
28
|
+
module.exports.match = mimeMatch
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Compare a `value` content-type with `types`.
|
|
32
|
+
* Each `type` can be an extension like `html`,
|
|
33
|
+
* a special shortcut like `multipart` or `urlencoded`,
|
|
34
|
+
* or a mime type.
|
|
35
|
+
*
|
|
36
|
+
* If no types match, `false` is returned.
|
|
37
|
+
* Otherwise, the first `type` that matches is returned.
|
|
38
|
+
*
|
|
39
|
+
* @param {String} value
|
|
40
|
+
* @param {Array} types
|
|
41
|
+
* @public
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
function typeis (value, types_) {
|
|
45
|
+
var i
|
|
46
|
+
var types = types_
|
|
47
|
+
|
|
48
|
+
// remove parameters and normalize
|
|
49
|
+
var val = tryNormalizeType(value)
|
|
50
|
+
|
|
51
|
+
// no type or invalid
|
|
52
|
+
if (!val) {
|
|
53
|
+
return false
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// support flattened arguments
|
|
57
|
+
if (types && !Array.isArray(types)) {
|
|
58
|
+
types = new Array(arguments.length - 1)
|
|
59
|
+
for (i = 0; i < types.length; i++) {
|
|
60
|
+
types[i] = arguments[i + 1]
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// no types, return the content type
|
|
65
|
+
if (!types || !types.length) {
|
|
66
|
+
return val
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
var type
|
|
70
|
+
for (i = 0; i < types.length; i++) {
|
|
71
|
+
if (mimeMatch(normalize(type = types[i]), val)) {
|
|
72
|
+
return type[0] === '+' || type.indexOf('*') !== -1
|
|
73
|
+
? val
|
|
74
|
+
: type
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// no matches
|
|
79
|
+
return false
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Check if a request has a request body.
|
|
84
|
+
* A request with a body __must__ either have `transfer-encoding`
|
|
85
|
+
* or `content-length` headers set.
|
|
86
|
+
* http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html#sec4.3
|
|
87
|
+
*
|
|
88
|
+
* @param {Object} request
|
|
89
|
+
* @return {Boolean}
|
|
90
|
+
* @public
|
|
91
|
+
*/
|
|
92
|
+
|
|
93
|
+
function hasbody (req) {
|
|
94
|
+
return req.headers['transfer-encoding'] !== undefined ||
|
|
95
|
+
!isNaN(req.headers['content-length'])
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Check if the incoming request contains the "Content-Type"
|
|
100
|
+
* header field, and it contains any of the give mime `type`s.
|
|
101
|
+
* If there is no request body, `null` is returned.
|
|
102
|
+
* If there is no content type, `false` is returned.
|
|
103
|
+
* Otherwise, it returns the first `type` that matches.
|
|
104
|
+
*
|
|
105
|
+
* Examples:
|
|
106
|
+
*
|
|
107
|
+
* // With Content-Type: text/html; charset=utf-8
|
|
108
|
+
* this.is('html'); // => 'html'
|
|
109
|
+
* this.is('text/html'); // => 'text/html'
|
|
110
|
+
* this.is('text/*', 'application/json'); // => 'text/html'
|
|
111
|
+
*
|
|
112
|
+
* // When Content-Type is application/json
|
|
113
|
+
* this.is('json', 'urlencoded'); // => 'json'
|
|
114
|
+
* this.is('application/json'); // => 'application/json'
|
|
115
|
+
* this.is('html', 'application/*'); // => 'application/json'
|
|
116
|
+
*
|
|
117
|
+
* this.is('html'); // => false
|
|
118
|
+
*
|
|
119
|
+
* @param {Object} req
|
|
120
|
+
* @param {(String|Array)} types...
|
|
121
|
+
* @return {(String|false|null)}
|
|
122
|
+
* @public
|
|
123
|
+
*/
|
|
124
|
+
|
|
125
|
+
function typeofrequest (req, types_) {
|
|
126
|
+
// no body
|
|
127
|
+
if (!hasbody(req)) return null
|
|
128
|
+
// support flattened arguments
|
|
129
|
+
var types = arguments.length > 2
|
|
130
|
+
? Array.prototype.slice.call(arguments, 1)
|
|
131
|
+
: types_
|
|
132
|
+
// request content type
|
|
133
|
+
var value = req.headers['content-type']
|
|
134
|
+
|
|
135
|
+
return typeis(value, types)
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Normalize a mime type.
|
|
140
|
+
* If it's a shorthand, expand it to a valid mime type.
|
|
141
|
+
*
|
|
142
|
+
* In general, you probably want:
|
|
143
|
+
*
|
|
144
|
+
* var type = is(req, ['urlencoded', 'json', 'multipart']);
|
|
145
|
+
*
|
|
146
|
+
* Then use the appropriate body parsers.
|
|
147
|
+
* These three are the most common request body types
|
|
148
|
+
* and are thus ensured to work.
|
|
149
|
+
*
|
|
150
|
+
* @param {String} type
|
|
151
|
+
* @return {String|false|null}
|
|
152
|
+
* @public
|
|
153
|
+
*/
|
|
154
|
+
|
|
155
|
+
function normalize (type) {
|
|
156
|
+
if (typeof type !== 'string') {
|
|
157
|
+
// invalid type
|
|
158
|
+
return false
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
switch (type) {
|
|
162
|
+
case 'urlencoded':
|
|
163
|
+
return 'application/x-www-form-urlencoded'
|
|
164
|
+
case 'multipart':
|
|
165
|
+
return 'multipart/*'
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
if (type[0] === '+') {
|
|
169
|
+
// "+json" -> "*/*+json" expando
|
|
170
|
+
return '*/*' + type
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return type.indexOf('/') === -1
|
|
174
|
+
? mime.lookup(type)
|
|
175
|
+
: type
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Check if `expected` mime type
|
|
180
|
+
* matches `actual` mime type with
|
|
181
|
+
* wildcard and +suffix support.
|
|
182
|
+
*
|
|
183
|
+
* @param {String} expected
|
|
184
|
+
* @param {String} actual
|
|
185
|
+
* @return {Boolean}
|
|
186
|
+
* @public
|
|
187
|
+
*/
|
|
188
|
+
|
|
189
|
+
function mimeMatch (expected, actual) {
|
|
190
|
+
// invalid type
|
|
191
|
+
if (expected === false) {
|
|
192
|
+
return false
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// split types
|
|
196
|
+
var actualParts = actual.split('/')
|
|
197
|
+
var expectedParts = expected.split('/')
|
|
198
|
+
|
|
199
|
+
// invalid format
|
|
200
|
+
if (actualParts.length !== 2 || expectedParts.length !== 2) {
|
|
201
|
+
return false
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
// validate type
|
|
205
|
+
if (expectedParts[0] !== '*' && expectedParts[0] !== actualParts[0]) {
|
|
206
|
+
return false
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// validate suffix wildcard
|
|
210
|
+
if (expectedParts[1].slice(0, 2) === '*+') {
|
|
211
|
+
return expectedParts[1].length <= actualParts[1].length + 1 &&
|
|
212
|
+
expectedParts[1].slice(1) === actualParts[1].slice(1 - expectedParts[1].length)
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
// validate subtype
|
|
216
|
+
if (expectedParts[1] !== '*' && expectedParts[1] !== actualParts[1]) {
|
|
217
|
+
return false
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
return true
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Normalize a type and remove parameters.
|
|
225
|
+
*
|
|
226
|
+
* @param {string} value
|
|
227
|
+
* @return {(string|null)}
|
|
228
|
+
* @private
|
|
229
|
+
*/
|
|
230
|
+
function normalizeType (value) {
|
|
231
|
+
// Parse the type
|
|
232
|
+
var type = contentType.parse(value).type
|
|
233
|
+
|
|
234
|
+
return typer.test(type) ? type : null
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Try to normalize a type and remove parameters.
|
|
239
|
+
*
|
|
240
|
+
* @param {string} value
|
|
241
|
+
* @return {(string|null)}
|
|
242
|
+
* @private
|
|
243
|
+
*/
|
|
244
|
+
function tryNormalizeType (value) {
|
|
245
|
+
try {
|
|
246
|
+
return value ? normalizeType(value) : null
|
|
247
|
+
} catch (err) {
|
|
248
|
+
return null
|
|
249
|
+
}
|
|
250
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "type-is",
|
|
3
|
+
"description": "Infer the content-type of a request.",
|
|
4
|
+
"version": "2.0.1",
|
|
5
|
+
"contributors": [
|
|
6
|
+
"Douglas Christopher Wilson <doug@somethingdoug.com>",
|
|
7
|
+
"Jonathan Ong <me@jongleberry.com> (http://jongleberry.com)"
|
|
8
|
+
],
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"repository": "jshttp/type-is",
|
|
11
|
+
"dependencies": {
|
|
12
|
+
"content-type": "^1.0.5",
|
|
13
|
+
"media-typer": "^1.1.0",
|
|
14
|
+
"mime-types": "^3.0.0"
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"eslint": "7.32.0",
|
|
18
|
+
"eslint-config-standard": "14.1.1",
|
|
19
|
+
"eslint-plugin-import": "2.25.4",
|
|
20
|
+
"eslint-plugin-markdown": "2.2.1",
|
|
21
|
+
"eslint-plugin-node": "11.1.0",
|
|
22
|
+
"eslint-plugin-promise": "5.2.0",
|
|
23
|
+
"eslint-plugin-standard": "4.1.0",
|
|
24
|
+
"mocha": "9.2.1",
|
|
25
|
+
"nyc": "15.1.0"
|
|
26
|
+
},
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">= 0.6"
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"LICENSE",
|
|
32
|
+
"HISTORY.md",
|
|
33
|
+
"index.js"
|
|
34
|
+
],
|
|
35
|
+
"scripts": {
|
|
36
|
+
"lint": "eslint .",
|
|
37
|
+
"test": "mocha --reporter spec --check-leaks --bail test/",
|
|
38
|
+
"test:debug": "mocha --reporter spec --check-leaks --inspect --inspect-brk test/",
|
|
39
|
+
"test-ci": "nyc --reporter=lcovonly --reporter=text npm test",
|
|
40
|
+
"test-cov": "nyc --reporter=html --reporter=text npm test"
|
|
41
|
+
},
|
|
42
|
+
"keywords": [
|
|
43
|
+
"content",
|
|
44
|
+
"type",
|
|
45
|
+
"checking"
|
|
46
|
+
]
|
|
47
|
+
}
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.0.
|
|
2
|
+
"version": "0.0.22",
|
|
3
3
|
"keywords": [
|
|
4
4
|
"yt-transcript-strapi-plugin",
|
|
5
5
|
"youtube",
|
|
@@ -42,13 +42,9 @@
|
|
|
42
42
|
"test:ts:back": "run -T tsc -p server/tsconfig.json"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@langchain/core": "^0.3.18",
|
|
46
|
-
"@langchain/openai": "^0.3.14",
|
|
47
|
-
"@langchain/textsplitters": "^0.1.0",
|
|
48
45
|
"@modelcontextprotocol/sdk": "^1.12.0",
|
|
49
46
|
"@strapi/design-system": "^2.0.0-rc.12",
|
|
50
47
|
"@strapi/icons": "^2.0.0-rc.12",
|
|
51
|
-
"langchain": "^0.3.5",
|
|
52
48
|
"react-intl": "^6.8.7",
|
|
53
49
|
"undici": "^6.21.0",
|
|
54
50
|
"youtubei.js": "^16.0.1",
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ChatOpenAI } from "@langchain/openai";
|
|
2
|
-
interface InitializeModelProps {
|
|
3
|
-
openAIApiKey: string;
|
|
4
|
-
model: string;
|
|
5
|
-
temp: number;
|
|
6
|
-
maxTokens?: number;
|
|
7
|
-
}
|
|
8
|
-
export declare function initializeModel({ openAIApiKey, model, temp, }: InitializeModelProps): Promise<ChatOpenAI<import("@langchain/openai").ChatOpenAICallOptions>>;
|
|
9
|
-
export {};
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
# Changes
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
## 2.0.2
|
|
5
|
-
|
|
6
|
-
* Rename bin to `node-which`
|
|
7
|
-
|
|
8
|
-
## 2.0.1
|
|
9
|
-
|
|
10
|
-
* generate changelog and publish on version bump
|
|
11
|
-
* enforce 100% test coverage
|
|
12
|
-
* Promise interface
|
|
13
|
-
|
|
14
|
-
## 2.0.0
|
|
15
|
-
|
|
16
|
-
* Parallel tests, modern JavaScript, and drop support for node < 8
|
|
17
|
-
|
|
18
|
-
## 1.3.1
|
|
19
|
-
|
|
20
|
-
* update deps
|
|
21
|
-
* update travis
|
|
22
|
-
|
|
23
|
-
## v1.3.0
|
|
24
|
-
|
|
25
|
-
* Add nothrow option to which.sync
|
|
26
|
-
* update tap
|
|
27
|
-
|
|
28
|
-
## v1.2.14
|
|
29
|
-
|
|
30
|
-
* appveyor: drop node 5 and 0.x
|
|
31
|
-
* travis-ci: add node 6, drop 0.x
|
|
32
|
-
|
|
33
|
-
## v1.2.13
|
|
34
|
-
|
|
35
|
-
* test: Pass missing option to pass on windows
|
|
36
|
-
* update tap
|
|
37
|
-
* update isexe to 2.0.0
|
|
38
|
-
* neveragain.tech pledge request
|
|
39
|
-
|
|
40
|
-
## v1.2.12
|
|
41
|
-
|
|
42
|
-
* Removed unused require
|
|
43
|
-
|
|
44
|
-
## v1.2.11
|
|
45
|
-
|
|
46
|
-
* Prevent changelog script from being included in package
|
|
47
|
-
|
|
48
|
-
## v1.2.10
|
|
49
|
-
|
|
50
|
-
* Use env.PATH only, not env.Path
|
|
51
|
-
|
|
52
|
-
## v1.2.9
|
|
53
|
-
|
|
54
|
-
* fix for paths starting with ../
|
|
55
|
-
* Remove unused `is-absolute` module
|
|
56
|
-
|
|
57
|
-
## v1.2.8
|
|
58
|
-
|
|
59
|
-
* bullet items in changelog that contain (but don't start with) #
|
|
60
|
-
|
|
61
|
-
## v1.2.7
|
|
62
|
-
|
|
63
|
-
* strip 'update changelog' changelog entries out of changelog
|
|
64
|
-
|
|
65
|
-
## v1.2.6
|
|
66
|
-
|
|
67
|
-
* make the changelog bulleted
|
|
68
|
-
|
|
69
|
-
## v1.2.5
|
|
70
|
-
|
|
71
|
-
* make a changelog, and keep it up to date
|
|
72
|
-
* don't include tests in package
|
|
73
|
-
* Properly handle relative-path executables
|
|
74
|
-
* appveyor
|
|
75
|
-
* Attach error code to Not Found error
|
|
76
|
-
* Make tests pass on Windows
|
|
77
|
-
|
|
78
|
-
## v1.2.4
|
|
79
|
-
|
|
80
|
-
* Fix typo
|
|
81
|
-
|
|
82
|
-
## v1.2.3
|
|
83
|
-
|
|
84
|
-
* update isexe, fix regression in pathExt handling
|
|
85
|
-
|
|
86
|
-
## v1.2.2
|
|
87
|
-
|
|
88
|
-
* update deps, use isexe module, test windows
|
|
89
|
-
|
|
90
|
-
## v1.2.1
|
|
91
|
-
|
|
92
|
-
* Sometimes windows PATH entries are quoted
|
|
93
|
-
* Fixed a bug in the check for group and user mode bits. This bug was introduced during refactoring for supporting strict mode.
|
|
94
|
-
* doc cli
|
|
95
|
-
|
|
96
|
-
## v1.2.0
|
|
97
|
-
|
|
98
|
-
* Add support for opt.all and -as cli flags
|
|
99
|
-
* test the bin
|
|
100
|
-
* update travis
|
|
101
|
-
* Allow checking for multiple programs in bin/which
|
|
102
|
-
* tap 2
|
|
103
|
-
|
|
104
|
-
## v1.1.2
|
|
105
|
-
|
|
106
|
-
* travis
|
|
107
|
-
* Refactored and fixed undefined error on Windows
|
|
108
|
-
* Support strict mode
|
|
109
|
-
|
|
110
|
-
## v1.1.1
|
|
111
|
-
|
|
112
|
-
* test +g exes against secondary groups, if available
|
|
113
|
-
* Use windows exe semantics on cygwin & msys
|
|
114
|
-
* cwd should be first in path on win32, not last
|
|
115
|
-
* Handle lower-case 'env.Path' on Windows
|
|
116
|
-
* Update docs
|
|
117
|
-
* use single-quotes
|
|
118
|
-
|
|
119
|
-
## v1.1.0
|
|
120
|
-
|
|
121
|
-
* Add tests, depend on is-absolute
|
|
122
|
-
|
|
123
|
-
## v1.0.9
|
|
124
|
-
|
|
125
|
-
* which.js: root is allowed to execute files owned by anyone
|
|
126
|
-
|
|
127
|
-
## v1.0.8
|
|
128
|
-
|
|
129
|
-
* don't use graceful-fs
|
|
130
|
-
|
|
131
|
-
## v1.0.7
|
|
132
|
-
|
|
133
|
-
* add license to package.json
|
|
134
|
-
|
|
135
|
-
## v1.0.6
|
|
136
|
-
|
|
137
|
-
* isc license
|
|
138
|
-
|
|
139
|
-
## 1.0.5
|
|
140
|
-
|
|
141
|
-
* Awful typo
|
|
142
|
-
|
|
143
|
-
## 1.0.4
|
|
144
|
-
|
|
145
|
-
* Test for path absoluteness properly
|
|
146
|
-
* win: Allow '' as a pathext if cmd has a . in it
|
|
147
|
-
|
|
148
|
-
## 1.0.3
|
|
149
|
-
|
|
150
|
-
* Remove references to execPath
|
|
151
|
-
* Make `which.sync()` work on Windows by honoring the PATHEXT variable.
|
|
152
|
-
* Make `isExe()` always return true on Windows.
|
|
153
|
-
* MIT
|
|
154
|
-
|
|
155
|
-
## 1.0.2
|
|
156
|
-
|
|
157
|
-
* Only files can be exes
|
|
158
|
-
|
|
159
|
-
## 1.0.1
|
|
160
|
-
|
|
161
|
-
* Respect the PATHEXT env for win32 support
|
|
162
|
-
* should 0755 the bin
|
|
163
|
-
* binary
|
|
164
|
-
* guts
|
|
165
|
-
* package
|
|
166
|
-
* 1st
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|