mosquito-transport 1.5.2 → 1.5.4
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/lib/helpers/values.js +6 -1
- package/lib/index.d.ts +23 -1
- package/lib/index.js +1 -1
- package/lib/products/database/index.js +2 -2
- package/package.json +3 -3
package/lib/helpers/values.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Scoped } from "./variables";
|
|
2
2
|
import { join } from 'path';
|
|
3
|
+
import { simplifyError } from 'simplify-error';
|
|
3
4
|
|
|
4
5
|
export const DEFAULT_DB = Symbol('default_db');
|
|
5
6
|
export const ADMIN_DB_NAME = Symbol('admin_db_name');
|
|
@@ -74,4 +75,8 @@ export const EnginePath = {
|
|
|
74
75
|
userAcct: 'userAcct',
|
|
75
76
|
tokenStore: 'tokenStore',
|
|
76
77
|
refreshTokenStore: 'refreshTokenStore'
|
|
77
|
-
};
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export const ERROR = {
|
|
81
|
+
INCORRECT_PASSWORD: simplifyError('incorrect_password', 'The provided password for this account is incorrect')
|
|
82
|
+
}
|
package/lib/index.d.ts
CHANGED
|
@@ -29,8 +29,10 @@ interface StorageRulesSnapshot {
|
|
|
29
29
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
+
type WriteScope = 'setOne' | 'setMany' | 'updateOne' | 'updateMany' | 'mergeOne' | 'mergeMany' | 'deleteOne' | 'deleteMany' | 'replaceOne' | 'putOne';
|
|
33
|
+
|
|
32
34
|
interface BatchUpdateValue {
|
|
33
|
-
scope:
|
|
35
|
+
scope: WriteScope;
|
|
34
36
|
find?: DatabaseRulesIOPrescription['find'];
|
|
35
37
|
value?: DatabaseRulesIOPrescription['value'];
|
|
36
38
|
path: string;
|
|
@@ -44,10 +46,30 @@ interface DatabaseRulesIOPrescription {
|
|
|
44
46
|
random?: boolean;
|
|
45
47
|
find?: Filter<undefined> | {} | undefined;
|
|
46
48
|
value?: UpdateFilter<undefined> | undefined;
|
|
49
|
+
config?: PrescriptionConfig | undefined;
|
|
50
|
+
scope?: WriteScope;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
interface PrescribedExtraction {
|
|
54
|
+
collection: string;
|
|
55
|
+
sort?: Sort;
|
|
56
|
+
direction?: SortDirection;
|
|
57
|
+
limit?: number;
|
|
58
|
+
find?: Filter<undefined> | {} | undefined;
|
|
59
|
+
findOne?: Filter<undefined> | {} | undefined;
|
|
60
|
+
returnOnly?: string | string[] | undefined;
|
|
61
|
+
excludeFields?: string | string[] | undefined;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
interface PrescriptionConfig {
|
|
65
|
+
extraction?: PrescribedExtraction | PrescribedExtraction[] | undefined;
|
|
66
|
+
returnOnly?: string | string[] | undefined;
|
|
67
|
+
excludeFields?: string | string[] | undefined;
|
|
47
68
|
}
|
|
48
69
|
|
|
49
70
|
interface DatabaseRulesBatchWritePrescription {
|
|
50
71
|
value: BatchUpdateValue[];
|
|
72
|
+
stepping?: boolean;
|
|
51
73
|
}
|
|
52
74
|
|
|
53
75
|
interface DatabaseRulesSnapshot {
|
package/lib/index.js
CHANGED
|
@@ -185,7 +185,7 @@ const serveStorage = ({
|
|
|
185
185
|
inputFile: filePath
|
|
186
186
|
};
|
|
187
187
|
|
|
188
|
-
const ffmpegCommad = `ffmpeg -i "${filePath}"${mute ? ' -an' : ''}${com.length ? ' -vf "' + com.join(', ') + '"' : ''}${mute ? '' : ' -c:a copy'}${crf}${vbr ? ' -b:v ' + vbr : ''}${abr ? ' -b:a' + abr : ''}${fps ? ' -r' + fps : ''} -preset ${preset || 'medium'} "${outPath}"`;
|
|
188
|
+
const ffmpegCommad = `ffmpeg -i "${filePath}"${mute ? ' -an' : ''}${com.length ? ' -vf "' + com.join(', ') + '"' : ''}${mute ? '' : ' -c:a copy'}${crf}${vbr ? ' -b:v ' + vbr : ''}${abr ? ' -b:a' + abr : ''}${fps ? ' -r ' + fps : ''} -preset ${preset || 'medium'} "${outPath}"`;
|
|
189
189
|
|
|
190
190
|
exec(ffmpegCommad, async (err) => {
|
|
191
191
|
if (!Scoped.cacheTranformVideoTimer[outPath]) {
|
|
@@ -164,7 +164,7 @@ const extractDocField = async (d, commands, projectName, dbName, dbUrl) => {
|
|
|
164
164
|
|
|
165
165
|
if (extraction) {
|
|
166
166
|
const extractedResult = await Promise.all(
|
|
167
|
-
foreignDoc.map(
|
|
167
|
+
foreignDoc.map(async t => {
|
|
168
168
|
const { collection, direction, sort, limit, find, findOne } = t;
|
|
169
169
|
const exFind = assignExtractionFind(d, find || findOne);
|
|
170
170
|
|
|
@@ -263,7 +263,7 @@ const CommonWriteFootPrint = {
|
|
|
263
263
|
value: (t, p) => p.scope === 'setMany' ? (Array.isArray(t) && t.length && !t.filter(v => !InsertValueFootPrint(v)).length) :
|
|
264
264
|
['setOne', 'replaceOne', 'putOne'].includes(p.scope) ? InsertValueFootPrint(t) :
|
|
265
265
|
['updateOne', 'mergeOne', 'updateMany', 'mergeMany'].includes(p.scope) ? UpdateValueFootPrint(t) :
|
|
266
|
-
t === undefined
|
|
266
|
+
(t === undefined || t === null)
|
|
267
267
|
};
|
|
268
268
|
|
|
269
269
|
const CommonQueryFootPrint = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mosquito-transport",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.4",
|
|
4
4
|
"description": "MosquitoTransport is a powerful tool that helps persist and synchronize data between your MongoDB database and frontend applications",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"express": "^4.18.2",
|
|
44
44
|
"fast-json-stable-stringify": "^2.1.0",
|
|
45
45
|
"google-auth-library": "^8.8.0",
|
|
46
|
-
"guard-object": "^1.0.
|
|
46
|
+
"guard-object": "^1.0.8",
|
|
47
47
|
"json-buffer": "^3.0.1",
|
|
48
48
|
"jsonwebtoken": "^9.0.0",
|
|
49
49
|
"lodash.get": "^4.4.2",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"lodash.unset": "^4.5.2",
|
|
52
52
|
"node-fetch": "^3.3.1",
|
|
53
53
|
"set-large-timeout": "^1.0.1",
|
|
54
|
-
"simplify-error": "^1.0.
|
|
54
|
+
"simplify-error": "^1.0.1",
|
|
55
55
|
"socket.io": "^4.6.1",
|
|
56
56
|
"subscription-listener": "^1.1.2",
|
|
57
57
|
"tweetnacl": "^1.0.3"
|