isite 1.14.92 → 2021.11.3-0.1
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/README.md +488 -477
- package/apps/client-side/app.js +28 -1
- package/apps/client-side/site_files/css/btn.css +98 -0
- package/apps/client-side/site_files/css/checkbox.css +10 -7
- package/apps/client-side/site_files/css/dropdown.css +61 -0
- package/apps/client-side/site_files/css/effect.css +283 -280
- package/apps/client-side/site_files/css/font-awesome.css +4615 -3
- package/apps/client-side/site_files/css/font-awesome.min.css +5 -0
- package/apps/client-side/site_files/css/font-cairo.css +14 -0
- package/apps/client-side/site_files/css/font-droid.css +19 -0
- package/apps/client-side/site_files/css/fonts.css +6 -34
- package/apps/client-side/site_files/css/form.css +31 -131
- package/apps/client-side/site_files/css/layout.css +27 -13
- package/apps/client-side/site_files/css/modal.css +184 -164
- package/apps/client-side/site_files/css/tabs.css +3 -3
- package/apps/client-side/site_files/css/theme.css +2 -2
- package/apps/client-side/site_files/css/theme_dark.css +1 -1
- package/apps/client-side/site_files/css/theme_paper.css +175 -151
- package/apps/client-side/site_files/html/sub/i-date2.content.html +64 -0
- package/apps/client-side/site_files/html/sub/i-list.content.html +31 -0
- package/apps/client-side/site_files/html/sub/i-list2.content.html +22 -0
- package/apps/client-side/site_files/js/directive.js +1570 -1650
- package/apps/client-side/site_files/js/directive.min.js +2 -2
- package/apps/client-side/site_files/js/site.js +59 -17
- package/apps/client-side/site_files/js/site.min.js +1 -1
- package/apps/client-side/site_files/webfonts/fa-brands-400.eot +0 -0
- package/apps/client-side/site_files/webfonts/fa-brands-400.svg +3717 -0
- package/apps/client-side/site_files/webfonts/fa-brands-400.ttf +0 -0
- package/apps/client-side/site_files/webfonts/fa-brands-400.woff +0 -0
- package/apps/client-side/site_files/webfonts/fa-brands-400.woff2 +0 -0
- package/apps/client-side/site_files/webfonts/fa-regular-400.eot +0 -0
- package/apps/client-side/site_files/webfonts/fa-regular-400.svg +801 -0
- package/apps/client-side/site_files/webfonts/fa-regular-400.ttf +0 -0
- package/apps/client-side/site_files/webfonts/fa-regular-400.woff +0 -0
- package/apps/client-side/site_files/webfonts/fa-regular-400.woff2 +0 -0
- package/apps/client-side/site_files/webfonts/fa-solid-900.eot +0 -0
- package/apps/client-side/site_files/webfonts/fa-solid-900.svg +5034 -0
- package/apps/client-side/site_files/webfonts/fa-solid-900.ttf +0 -0
- package/apps/client-side/site_files/webfonts/fa-solid-900.woff +0 -0
- package/apps/client-side/site_files/webfonts/fa-solid-900.woff2 +0 -0
- package/apps/ui-print/site_files/js/index.js +194 -191
- package/index.js +2 -2
- package/isite_files/html/browser.html +1 -1
- package/isite_files/html/installing.html +1 -1
- package/lib/collection.js +14 -7
- package/lib/fsm.js +389 -346
- package/lib/logs.js +1 -1
- package/lib/mongodb.js +9 -7
- package/lib/parser.js +495 -475
- package/lib/routing.js +61 -17
- package/lib/security.js +4 -4
- package/lib/session.js +8 -22
- package/lib/sessions.js +1 -1
- package/lib/storage.js +1 -1
- package/lib/temp.js +1 -1
- package/lib/ws.js +3 -0
- package/object-options/index.js +4 -4
- package/object-options/lib/fn.js +1 -1
- package/package.json +1 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,206 +1,209 @@
|
|
|
1
1
|
site.print = site.printHTML = function (options) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
window.document.querySelectorAll('style').forEach((s) => {
|
|
27
|
-
content += s.outerHTML;
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
if (options.links) {
|
|
31
|
-
options.links.forEach((link) => {
|
|
32
|
-
content += '<link rel="stylesheet" href="' + link + '" type="text/css" >';
|
|
2
|
+
options = options || {};
|
|
3
|
+
|
|
4
|
+
if (typeof options === 'string') {
|
|
5
|
+
options = {
|
|
6
|
+
selector: options,
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
if (!options.selector) {
|
|
11
|
+
console.error('No Selector sets ...');
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
if (!options.ip) {
|
|
15
|
+
options.ip = 'localhost';
|
|
16
|
+
}
|
|
17
|
+
if (!options.port) {
|
|
18
|
+
options.port = '60080';
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
let content = '';
|
|
22
|
+
window.document.querySelectorAll('link[rel=stylesheet]').forEach((l) => {
|
|
23
|
+
content += l.outerHTML;
|
|
33
24
|
});
|
|
34
|
-
}
|
|
35
25
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
26
|
+
window.document.querySelectorAll('style').forEach((s) => {
|
|
27
|
+
content += s.outerHTML;
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
if (options.links) {
|
|
31
|
+
options.links.forEach((link) => {
|
|
32
|
+
content += '<link rel="stylesheet" href="' + link + '" type="text/css" >';
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (options.preappends) {
|
|
37
|
+
options.preappends.forEach((el) => {
|
|
38
|
+
el = window.document.querySelector(el);
|
|
39
|
+
if (el) {
|
|
40
|
+
content += el.outerHTML;
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
document.querySelectorAll(options.selector + ' input').forEach((el) => {
|
|
46
|
+
el.setAttribute('value', el.value);
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
document.querySelectorAll(options.selector + ' textarea').forEach((el) => {
|
|
50
|
+
el.innerText = el.value;
|
|
42
51
|
});
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
document.querySelectorAll(options.selector + ' textarea').forEach((el) => {
|
|
50
|
-
el.innerText = el.value;
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
document.querySelectorAll(options.selector).forEach((el) => {
|
|
54
|
-
let display = el.style.display;
|
|
55
|
-
el.style.display = 'block';
|
|
56
|
-
content += el.outerHTML;
|
|
57
|
-
el.style.display = display;
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
if (options.appends) {
|
|
61
|
-
options.appends.forEach((el) => {
|
|
62
|
-
el = window.document.querySelector(el);
|
|
63
|
-
if (el) {
|
|
52
|
+
|
|
53
|
+
document.querySelectorAll(options.selector).forEach((el) => {
|
|
54
|
+
let display = el.style.display;
|
|
55
|
+
el.style.display = 'block';
|
|
64
56
|
content += el.outerHTML;
|
|
65
|
-
|
|
57
|
+
el.style.display = display;
|
|
66
58
|
});
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
{
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
59
|
+
|
|
60
|
+
if (options.appends) {
|
|
61
|
+
options.appends.forEach((el) => {
|
|
62
|
+
el = window.document.querySelector(el);
|
|
63
|
+
if (el) {
|
|
64
|
+
content += el.outerHTML;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
site.postData(
|
|
70
|
+
{ url: '/api/print', data: { content: content } },
|
|
71
|
+
(response) => {
|
|
72
|
+
if (response.done) {
|
|
73
|
+
if (options.printer) {
|
|
74
|
+
fetch(response.url, {
|
|
75
|
+
mode: 'cors',
|
|
76
|
+
method: 'get',
|
|
77
|
+
})
|
|
78
|
+
.then((res) => res.text())
|
|
79
|
+
.then((html) => {
|
|
80
|
+
site.postData(
|
|
81
|
+
{
|
|
82
|
+
url: `http://${options.ip}:${options.port}/print`,
|
|
83
|
+
data: {
|
|
84
|
+
html: html,
|
|
85
|
+
type: 'html',
|
|
86
|
+
printer: options.printer,
|
|
87
|
+
width: options.width ?? 320,
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
(res) => {
|
|
91
|
+
console.log(res);
|
|
92
|
+
},
|
|
93
|
+
(err) => {
|
|
94
|
+
console.log(err);
|
|
95
|
+
},
|
|
96
|
+
);
|
|
97
|
+
})
|
|
98
|
+
.catch((err) => {
|
|
99
|
+
console.error(err);
|
|
100
|
+
});
|
|
101
|
+
} else {
|
|
102
|
+
window.open(response.url);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
(error) => {
|
|
107
|
+
console.log(error);
|
|
108
|
+
},
|
|
109
|
+
);
|
|
110
|
+
|
|
111
|
+
return !0;
|
|
109
112
|
};
|
|
110
113
|
|
|
111
114
|
site.printAsImageBusy = false;
|
|
112
115
|
|
|
113
116
|
site.printAsImage = function (options, callback) {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
117
|
+
if (site.printAsImageBusy) {
|
|
118
|
+
setTimeout(() => {
|
|
119
|
+
site.printAsImage(options, callback);
|
|
120
|
+
}, 1000);
|
|
121
|
+
return false;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
site.printAsImageBusy = true;
|
|
125
|
+
options = options || {};
|
|
126
|
+
|
|
127
|
+
if (typeof options === 'string') {
|
|
128
|
+
options = {
|
|
129
|
+
selector: options,
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
if (!options.selector) {
|
|
133
|
+
console.error('No Selector sets ...');
|
|
134
|
+
site.printAsImageBusy = false;
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
if (!options.ip) {
|
|
138
|
+
options.ip = 'localhost';
|
|
139
|
+
}
|
|
140
|
+
if (!options.port) {
|
|
141
|
+
options.port = '60080';
|
|
142
|
+
}
|
|
143
|
+
if (!options.type) {
|
|
144
|
+
options.type = 'image';
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
let node = typeof options.selector === 'string' ? document.querySelector(options.selector) : options.selector;
|
|
148
|
+
if (!node) {
|
|
149
|
+
console.error('No Node Selector ');
|
|
150
|
+
site.printAsImageBusy = false;
|
|
151
|
+
return false;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
domtoimage
|
|
155
|
+
.toPng(node, { quality: 1, bgcolor: '#ffffff' })
|
|
156
|
+
.then(function (dataUrl) {
|
|
157
|
+
var img = new Image();
|
|
158
|
+
img.src = dataUrl;
|
|
159
|
+
if (callback) {
|
|
160
|
+
callback(img);
|
|
161
|
+
}
|
|
162
|
+
options.dataUrl = dataUrl;
|
|
163
|
+
site.printDataUrl(options);
|
|
164
|
+
site.printAsImageBusy = false;
|
|
165
|
+
})
|
|
166
|
+
.catch(function (error) {
|
|
167
|
+
console.error(error);
|
|
168
|
+
site.printAsImageBusy = false;
|
|
169
|
+
});
|
|
167
170
|
};
|
|
168
171
|
|
|
169
172
|
site.printDataUrl = function (options) {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
173
|
+
site.postData(
|
|
174
|
+
{ url: '/api/print', data: { content: options.dataUrl, type: options.type } },
|
|
175
|
+
(response) => {
|
|
176
|
+
if (response.done) {
|
|
177
|
+
if (options.printer) {
|
|
178
|
+
fetch(response.url, {
|
|
179
|
+
mode: 'cors',
|
|
180
|
+
method: 'get',
|
|
181
|
+
})
|
|
182
|
+
.then((res) => res.text())
|
|
183
|
+
.then((html) => {
|
|
184
|
+
site.postData(
|
|
185
|
+
{
|
|
186
|
+
url: `http://${options.ip}:${options.port}/print`,
|
|
187
|
+
data: {
|
|
188
|
+
html: html,
|
|
189
|
+
type: 'html',
|
|
190
|
+
printer: options.printer,
|
|
191
|
+
width: options.width ?? 320,
|
|
192
|
+
},
|
|
193
|
+
},
|
|
194
|
+
(res) => {},
|
|
195
|
+
);
|
|
196
|
+
})
|
|
197
|
+
.catch((err) => {
|
|
198
|
+
console.error(err);
|
|
199
|
+
});
|
|
200
|
+
} else {
|
|
201
|
+
window.open(response.url);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
(error) => {
|
|
206
|
+
console.log(error);
|
|
207
|
+
},
|
|
208
|
+
);
|
|
206
209
|
};
|
package/index.js
CHANGED
|
@@ -237,12 +237,12 @@ module.exports = function init(options) {
|
|
|
237
237
|
};
|
|
238
238
|
|
|
239
239
|
____0.on('[any][saving data]', function () {
|
|
240
|
-
____0.log('Saving Data :: ' + ____0.options.
|
|
240
|
+
____0.log('Saving Data :: ' + ____0.options.savingTime + ' Minute ');
|
|
241
241
|
});
|
|
242
242
|
|
|
243
243
|
setInterval(function () {
|
|
244
244
|
____0.call('[any][saving data]');
|
|
245
|
-
}, ____0.options.
|
|
245
|
+
}, ____0.options.savingTime * 1000 * 60);
|
|
246
246
|
|
|
247
247
|
____0.dashboard = require(__dirname + '/lib/dashboard.js');
|
|
248
248
|
____0.dashboard(____0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
291417163575273638371317211852754538718715316185431932674514136541388259293423574553218715316151211412512918525741383187153161512114125121141251211572674239325221182761413923744239318621573736325375812153126929517524211412512114125121141285453837754134136147193271253837724738577829342341253737132536276945391352471857534518365321182769455932574559318621565717293837564278365321148587153161512114125121141251211572674239325221188252453836862159426242394771457923752153135445788275423882752934237943383275431576564239426241783667477857564718516521185768433932624138716746782752451836862634817121531269295175242114125121141251211412854718577545183687315923694779275746531337461832524718576842731268255381852579326247187257295175242114125121157169431837524215812714531251211412854158865648358127145312512114125121141251291851722956237345794774423921513739135641393262455846512553816829148661263581271453125121141251211412512919275446585771471581271453125121141251211412512114125121194762455832694773826945587262455837494678377347583773397937734514128621144761471932714674616925792769417857524514765346588679467837732558276945344684153161512114125121141251211412512114137943388256457946684518865441387249467837734758377339793773451412862114476147193271285385692635217925541268261481722854417126155171237465271453125121141251211412512114125121194762455832694773826945587262455837354239237842392339457923644338825921157551425817654678368415316127145312512114125121141251211412512119476245583269477382754659572645781756325857654234128621184276455827754338866821145269461932624578827425141354413872654158175443735651487175242114125121141251211412512114125121141251211827524518725341382764211575271453125121141251211412512114125121141251211412512114125141781765451823524178655149197127145312512114125121141251211412512114125121141251211412514259376841793262457881512414565148717524211412512114125121141251211412512114125121141251211412512114125141788668467886654234826545784661237827524518725341382764211882694714136245391365423876574559315125538168237356841531615121141251211412512114125121141251211412512114125121197584153161512114125121141251211412512114125121141251433841512418867147185769455926684258377541785162211965271453125121141251211412512114125121141251211412512114125142583775417851614579137543388668467382764658716521196551453886564235615123782769465926592514137342383262465837544715615123784269451872694773465149345627145312512114125121141251211412512114125121141251211412512114125121148275431837682414527342392771457882744234565129358151465837744618866846783668471837814714516224317524211412512114125121141251211412512114125121141251211412512114125125593261423881612419325748193162211575872119652714531251211412512114125121141251211412512114125121141251211412512114125121141362425312614579137543388668467382754839135721157586293412594678277343391375237356514871752421141251211412512114125121141251211412512114125121141251211412512114125121141251211413784139215141793774471886673678277343391375211575514218865447387657455931684179235741393257323872574538376847145159467827734339137523735684153161512114125121141251211412512114125121141251211412512114125121141251211412512114125121182776467932694537275446585771471482624214128621188671471857694559266843383184153161512114125121141251211412512114125121141251211412512114125121141251211412512114125121182776467932694537275446585771471482624558825746565236353671512934137542395275287175242114125121141251211412512114125121141251211412512114125121141251211412512114125121141356457827764538376847148272473837734837275745183754471886732414476142381756237356684139137142388256317852624518316141793774471886673678277343391375243565271453125121141251211412512114125121141251211412512114125121141251211412512114125121141251417817654518235241786561243565271453125121141251211412512114125121141251211412512114125121141251211412512114138615316151211412512114125121141251211412512114125121141251211412512114138624356527145312512114125121141251211412512114125121141386211837654678365148717524211412512114125121141251211412512114125121141251211413624253126145791375433886684673827548391357211575862934125946782773433913752373565148717524211412512114125121141251211412512114125121141251211412512114125147581773211827764679326945372754465857714714128621183269417937674238827525582773423817754236376542387657455931612379275446585771471446622871752421141251211412512114125121141251211412512114125121141251211412514179377447188667367827734339137525585756211575514579137543388668467382624215652714531251211412512114125121141251211412512114125121141251211412512118277646793269453727544658577147148274465826512934136946193262457882742559377345156527145312512114125121141251211412512114125121141251211412512114125121182776467932694537275446585771471482694558726941383151293413544138726541581754437465271453125121141251211412512114125121141251211412512114125121141251211832694179376742388275255917764239238236783765423827754579216123785257413831592434825246191357455832154318576542145254473927754578763541792362461931622871752421141251211412512114125121141251211412512114125121141386153161512114125121141251211412512114125121141251493175242114125121141251211412512114125149356527145175242114125121141251211412512114125143384151241727293175571335162334357647353237216221196527145312512114125121141251211412512114125121141362425312613675861534361726315723293776271736538278413921684178867342348262421482654338675724144663471837744714615924345651487175242114125121141251211412512114125121141251211412512114136542393151477857682115755136758615343617263157232937762717365382544739237342388275377857684218867928717524211412512114125121141251211412512114125121141251211413794338816846785269477557684138277543394257241842524519275724356527145312512114125121141251211412512114125121141251211412514778576825592757471727644339133641392764415817732418425245192757243565271453125121141251211412512114125121141251211412512114125147785768255927614579472345581754471857784234516228717524211412512114125121141251211412512114125121141251211413794338816845791357455632574757326945787274241456841531615121141251211412512114125121141251211412514931752421141251211412512114125121141251493413574519275721196527145312512114125121141251211412512114125121141379433882564579466847192382351886524216426245183661487175242114125121141251211412512114125121141251211412512114137646587183211447614719327146746169257923524773825943393261473823764678377341788668471837684714825445787569413823744738827447181773257927674139237525381771461926694538176245538653465886794678377325792762471837494258576542392669435926694238725741793273457881684359265925127524211412512114125121141251211412512114125121141251211413754839135728531259467827734339137523737127145312512114125121141251211412512114125121141251211412514338318321144753413927624173767441792362461931592512752421141251211412512114125121141251211412512114125121141358423932544315615147192376423471271453125121141251211412512114125121141251211413862435652714531251211412512114125121141251211975271451752421141251211412512114125121141251425937684179326245788151417852574178673542392378423923354718177547392661243413841531615121141251211412512114125121141251211412514778576842188679255932734836726941383218433872572412752421141251211412512114125121141251211412512114125121141384153161512114125121141251211412512114125121141251211412512114125121141376465871832118866845185768423786744239237842392349473923652114655123738663467386744718177547392668435926592512752421141251211412512114125121141251211412512114125121141251211412514719577142356151237927544658577147144665153161512114125121141251211412512114125121141251211412512114125121141362421561512379277541393276467685592114655132181775423482684579466124347127145312512114125121141251211412512114125121141251211412512114125121184257471827612853137546593757251275242114125121141251211412512114125121141251211412512114138625127524211412512114125121141251211412512114125121141251211412612434128629531384153161512114125121141251211412512114125121141251211412512114125121141362425312614778576842188679255886684518576842372757465942574657476946586762455846622119652714531251211412512114125121141251211412512114125121141251211412512114125121141374471817734716765243388235423923784239216124356527145312512114125121141251211412512114125121141251211412512114125121197551423872744234138415316151211412512114125121141251211412512114125121141251211412512114125121141251467932524659322743392373457923354239237842392161243565271453125121141251211412512114125121141251211412512114125121141251211975271453125121141251211412512114125121141251211412512114125149347127145312512114125121141251211412512114125121141262287175242114125121141251211412512114125149317524153161512114125121141251211412512114135847388254471857694553137447181773471676624659236946572757465942574653516221196527145312512114125121141251211412512114125121141362425312612139476245583269477382544518575745593151491971512139476245583269477382544518575745593168415817744338274947391356413932572434138415316151211412512114125121141251211412512114125121141251211947624558326947738275465957264578175632585765423452841531615121141251211412512114125121141251211412512114125121141251211413764658718321144761471932714674616925792352477382594339326147382376467837734178866847183768471482544578756941382374473882744718177325792767413923752538177146192669453817624553865346588679467837732579276247183749425857654239266943592669415817744338266843592659251275242114125121141251211412512114125121141251211412512114125121141251471957714235615123792754465857714714466515316151211412512114125121141251211412512114125121141251211412512114136242156151237823524678575425392754465857714714466515316151211412512114125121141251211412512114125121141251211412512114135842393254431561514719237642347127145312512114125121141251211412512114125121141251211412514934568415316151211412512114125121141251211412512114125149317524211412512114125121141251211412514931752415316151211412512114125121141251211413584738825447185769455313744718177347167652433882354239237842392161243413841531615121141251211412512114125121141251211412514338415124141779433882564579466841787262423882752119728521141779433882564579466841787262423882752558235246785754397937714218177542345651487175242114125121141251211412512114125121141251211412512114137943388256457946684719238235188652421642624518366148717524211412512114125121141251211412512114125121141251211412512114125147392365285313694558726245583749467837734758377339793773451412642114466943592669415817744338266843592689475837734678576945547559211465513218177542348268457946612434712714531251211412512114125121141251211412512114125121141251211412512119328246183683211447744179236246193159251275242114125121141251211412512114125121141251211412512114125121141251433831832114475341392762417376744179236246193159251275242114125121141251211412512114125121141251211412512114125121141251425837754178518321193273473836651531615121141251211412512114125121141251211412512114125121197562287175242114125121141251211412512114125121141251211975271453125121141251211412512114125121197527145312512114125121141251211412512119275747165768471837734758176524145162211575872119652714531251211412512114125121141251211412512114137943388256457946684578826543388257367837734758377337788673437857684273128621184252451927572871752421141251211412512114125121141251211412512118276142382764367837734758377336793252471937742414568415316151211412512114125121141251211413862514127226151271211461512754125124531272243565271453125121141251211412512914867441792362461931871531615121141251291486534578328229517524291486614718766529517524
|
|
1
|
+
291417163575273638371317211852754538718715316185431932674514136541388259293423574553218715316151211412512918525741383187153161512114125121141251211572674239325221182761413923744239318621573736325375812153126929517524211412512114125121141285453837754134136147193271253837724738577829342341253737132536276945391352471857534518365321182769455932574559318621565717293837564278365321148587153161512114125121141251211572674239325221188252453836862159426242394771457923752153135445788275423882752934237943383275431576564239426241783667477857564718516521185768433932624138716746782752451836862634817121531269295175242114125121141251211412854718577545183687313937754573131446588679467837732117377142181775433882592114816825547169471857754518368715316151211412512914866142381756295175242114125121157253457832822951752421141251211412512114128543151687313937754573131446588679467837732117377142181775433882592114816825547169431516871531615121141251211412512115727441792362461931871531615121141251211412512114125121141379433882564579466845788265433882573979275746594257465786764658715129341259431932754619268325738674457827624138716741592369477927574653825445787559287175242114125121141251211412512114125147785768421886792558726941781765397927574659425746578676465871512934125943193275461561692574167327738171255412682635617826151281261446841531615121141251211412512114125121141379433882564579466845788265433882573678377347583773377886734378576842731286211842524519275728717524153161512114125121141251211412512114137943388256457946684719238235188652421642624518365129341358473882544718576945531261457913754338866846737151417817654518235241786562211965271453125121141251211412512114125121141251211413544138726541581754437312861531615121141251211412512114125121141251211412512114125121182752451872534138276421197285153161512114125121141251211412512114125121141251211412512118427645582775433886682114516221196527145312512114125121141251211412512114125121141251211412512114125121182769455927694518366845188659241447544138726541581754437313684579315143387671451837674238827521148168255346622871752421141251211412512114125121141251211412512114125121141386287175242114125121141251211412512114125121141251211857582114526946193262457882742558425747182761243413841531615121141251211412512114125121141251211412512114125121184257471827612418867147185769455926684739236525141384211876694218368321144754457923742373715146583756433923574179318321144758457872654579465921197562153161512114125121141251211412512114125121141251211412512114125121141268471852574553516146583774461886684678366221157587211923574679136945592757255932574819316124345627145312512114125121141251211412512114125121141251211412512114125121148275431837682414527542395275243412862953138415316151211412512114125121141251211412512114125121141251211412512114125121141251433841512418867147185769455926684719577142341286293575512379275446585771471446622119652714531251211412512114125121141251211412512114125121141251211412512114125121141251211412514758177321182776467932694537275446585771471412862118326941793767423882752558277342381775423637654238765745593161237927544658577147144662287175242114125121141251211412512114125121141251211412512114125121141251211412512114125121141354473927754578763541792362461931684338315129341369461932624578827425585756287175242114125121141251211412512114125121141251211412512114125121141251211412512114125121141354473927754578763541792362461931684338826842392321371676262115755147183781471565271453125121141251211412512114125121141251211412512114125121141251211412512114125121141251421886544738765745593168463937574659573542387257417932694653515943183752421446622558177146183768421627614338725624182776467932694537275446585771471456841531615121141251211412512114125121141251211412512114125121141251211412512114125121141251211827524518725341382764241456841531615121141251211412512114125121141251211412512114125121141251211412512114125149317524211412512114125121141251211412512114125121141251211412512114125149345684153161512114125121141251211412512114125121141251493413574519275721196527145312512114125121141251211412512114125121141251211412514338415124188671471857694559266847195771423412862935755123792754465857714714466221196527145312512114125121141251211412512114125121141251211412512114125121194252465313544739277545787635417923624619315129341356457827764538376847148254465837524718371745183767423882752414477441792362461931592435652714531251211412512114125121141251211412512114125121141251211412512118277646793269453727544658577147148262421412862118867147185769455926684338318415316151211412512114125121141251211412512114125121141251211412512114135447392775457876354179236246193168467923542115755145791375433886684673827646587184153161512114125121141251211412512114125121141251211412512114125121141354473927754578763541792362461931684578826545781756211575514178176545182352417865841531615121141251211412512114125121141251211412512114125121141251211413564578277645383768471482724738377348372757451837544718867324144761423817562373566841391371423882563178526245183161417937744718866736782773433913752435652714531251211412512114125121141251211412512114125121141251493175242114125121141251211412512114125121141251211975271453125121141251211412512114125121197584153161271453125121141251211412512114125121184276455827754338866821182761423827643678377347583773367932524719377424145651487175242114125121141251211412512114125121141251211947624558326947738275465957264578175632585765423451271453125121141251211412512114125121141251211412512114125148717524211412512114125121141251211412512114125121141251211412512114125147392365285313694558726245583749467837734758377339793773451412642114466943592669467932524719377425586274297942574659276245788186237312642116325247183668455886792414566515316151211412512114125121141251211412512114125121141251211412512114137548391357285312594678277343391375237371271453125121141251211412512114125121141251211412512114125121141251211857562853125946793252471937743973465124731316413932572558826947735162251275242114125121141251211412512114125121141251211412512114125121141251425837754178518321193273473836651531615121141251211412512114125121141251211412512114125121197565153161512114125121141251211412512114125121141251211412512114516221157587211965271453125121141251211412512114125121141251211412512114125121141251211857582114527943388256457946684578826543388257367837734758377337788673437857684273565148717524211412512114125121141251211412512114125121141251211412512114125121141251211927754139237535381762455727574659425746535162287175242114125121141251211412512114125121141251211412512114125121141251493413574519275721196527145312512114125121141251211412512114125121141251211412512114125121141251211413744718177347167662465923694657275746594257465351622871752421141251211412512114125121141251211412512114125121141251211412514931752421141251211412512114125121141251211412512114125121141386251275242114125121141251211412512114125121141251211456841531615121141251211412512114125121141386153161271453125121141251211412512114125121184276455827754338866821192775413923753538577346588673367837734758377324145651487175242114125121141251211412512114125121141251211857582114515247785768421886792558276543383768471413854914125247785768421886792558276543383768471482534139276241768676461832524718366221196527145312512114125121141251211412512114125121141251211412514778576842188679255932734836726941383218433872572419652714531251211412512114125121141251211412512114125121141251211412512119377345156151237852754719137428538569465817792558476247185276415937744239235445788275423882752558276945348652415927764559277541392169467876524659316741391371467386674138576825782373457947744239216946785775423786584338725746738663467386534139276241738263467346651531615121141251211412512114125121141251211412512114125121141251211413754839135728531259467827734339137523737127145312512114125121141251211412512114125121141251211412512114125121185756285312594158177443382667467827734339137523737127145312512114125121141251211412512114125121141251211412512114125121184257471827612853137546593757251275242114125121141251211412512114125121141251211412512114138624356527145312512114125121141251211412512114125121141386153161512114125121141251211412512114138615316127145312512114125121141251211412512118427645582775433886682119277541392375353817624557275746594257465351622119652714531251211412512114125121141251211412512114136242531261213947624558326947738254451857574559315149197151213947624558326947738254451857574559316841581774433827494739135641393257243413841531615121141251211412512114125121141251211412512114125121194762455832694773827546595726457817563258576542345284153161512114125121141251211412512114125121141251211412512114125121141376465871832118866845185768423786744239237842392349473923652114655123738663467386534139276241738263467486784239237443388668293446512473131641393257255882694773516225127524211412512114125121141251211412512114125121141251211412512114125147195771423561512379275446585771471446651531615121141251211412512114125121141251211412512114125121141251211413624215615123782352467857542539275446585771471446651531615121141251211412512114125121141251211412512114125121141251211413584239325443156151471923764234712714531251211412512114125121141251211412512114125121141251493456841531615121141251211412512114125121141251211412514931752421141251211412512114125121141251493175241531615121141251211412512114125121141354431837544376275746594257465727754139327646735162287175242114125121141251211412512114125146783775343882754239237841387161241456512935815148717524211412512114125121141251211412512114125121194762455832694773826945587262455837354239237842392339457923644338825921157551425817654678368415316151211412512114125121141251211412512114125141785257417867354239237842392335471817754739266124356527145312512114125121141251211412512119756521151671261512512453127826141263211526712435652714517524153161512114125121141251211571694678277343391375295175242114125121157169415886564835812714547169431932674515812714519191
|
package/lib/collection.js
CHANGED
|
@@ -118,13 +118,13 @@ module.exports = function init(____0, option, db) {
|
|
|
118
118
|
let $res = options.$res;
|
|
119
119
|
let option = {};
|
|
120
120
|
if (options._id) {
|
|
121
|
-
option.set =
|
|
121
|
+
option.set = { ...options };
|
|
122
122
|
delete option.set._id;
|
|
123
123
|
option.where = {
|
|
124
124
|
_id: options._id,
|
|
125
125
|
};
|
|
126
126
|
} else if (options.id) {
|
|
127
|
-
option.set =
|
|
127
|
+
option.set = { ...options };
|
|
128
128
|
delete option.set.id;
|
|
129
129
|
option.where = {
|
|
130
130
|
id: options.id,
|
|
@@ -259,7 +259,7 @@ module.exports = function init(____0, option, db) {
|
|
|
259
259
|
} else {
|
|
260
260
|
if (options.where === undefined && options.select === undefined) {
|
|
261
261
|
options = {
|
|
262
|
-
where:
|
|
262
|
+
where: { ...options },
|
|
263
263
|
};
|
|
264
264
|
}
|
|
265
265
|
|
|
@@ -356,6 +356,13 @@ module.exports = function init(____0, option, db) {
|
|
|
356
356
|
(docs, callback, run) => {
|
|
357
357
|
callback = callback || function () {};
|
|
358
358
|
|
|
359
|
+
if (!Array.isArray(docs) || docs.length === 0) {
|
|
360
|
+
callback({
|
|
361
|
+
message: '!docs or docs.length = 0 ',
|
|
362
|
+
});
|
|
363
|
+
return;
|
|
364
|
+
}
|
|
365
|
+
|
|
359
366
|
if (run !== 2 && run !== !0) {
|
|
360
367
|
$collection.opration_list.push({
|
|
361
368
|
options: docs,
|
|
@@ -387,7 +394,7 @@ module.exports = function init(____0, option, db) {
|
|
|
387
394
|
collectionName: $collection.collection,
|
|
388
395
|
dbName: $collection.db,
|
|
389
396
|
docs: docs,
|
|
390
|
-
options
|
|
397
|
+
options: { ordered: true },
|
|
391
398
|
},
|
|
392
399
|
(err, result) => {
|
|
393
400
|
callback(err, result);
|
|
@@ -477,7 +484,7 @@ module.exports = function init(____0, option, db) {
|
|
|
477
484
|
} else {
|
|
478
485
|
let options = {};
|
|
479
486
|
if ($options.where === undefined) {
|
|
480
|
-
options.where =
|
|
487
|
+
options.where = { ...$options };
|
|
481
488
|
} else {
|
|
482
489
|
options = $options;
|
|
483
490
|
}
|
|
@@ -709,9 +716,9 @@ module.exports = function init(____0, option, db) {
|
|
|
709
716
|
|
|
710
717
|
if (____0.isFileExistsSync(file_path)) {
|
|
711
718
|
console.log('[ imported file exists ]');
|
|
712
|
-
let docs =
|
|
719
|
+
let docs = ____0.fromJson(____0.readFileSync(file_path).toString());
|
|
713
720
|
console.log('[ imported file readed ]');
|
|
714
|
-
if (
|
|
721
|
+
if (Array.isArray(docs)) {
|
|
715
722
|
docs.forEach((doc) => {
|
|
716
723
|
$collection.addOne(doc, (err, doc2) => {
|
|
717
724
|
if (!err && doc) {
|