@e-mc/compat-v4 0.3.2 → 0.4.0
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/index.js +283 -283
- package/package.json +4 -4
package/index.js
CHANGED
|
@@ -1,283 +1,283 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const path = require("path");
|
|
4
|
-
const V4 = require("../module/lib-v4");
|
|
5
|
-
const types_1 = require("../types");
|
|
6
|
-
function setModule(name, target, self) {
|
|
7
|
-
try {
|
|
8
|
-
require(name);
|
|
9
|
-
if (typeof target === 'string') {
|
|
10
|
-
target = require(target);
|
|
11
|
-
}
|
|
12
|
-
const cache = require.cache;
|
|
13
|
-
name = self === '1' ? path.normalize(name) + '.js' : path.join(name, 'index.js');
|
|
14
|
-
for (const pathname in cache) {
|
|
15
|
-
if (pathname.endsWith(name)) {
|
|
16
|
-
if (target) {
|
|
17
|
-
switch (name) {
|
|
18
|
-
case "@squared-functions/compress" /* FUNCTIONS.COMPRESS */:
|
|
19
|
-
case "@squared-functions/compress-v1" /* FUNCTIONS.COMPRESS_V1 */:
|
|
20
|
-
target = target.singleton();
|
|
21
|
-
break;
|
|
22
|
-
}
|
|
23
|
-
cache[pathname].exports = target;
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
delete cache[pathname];
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
catch {
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
try {
|
|
35
|
-
const Module = require("@e-mc/module" /* PACKAGE_NAME.MODULE */);
|
|
36
|
-
const kStartCPU = Symbol('startCPU');
|
|
37
|
-
for (const name in V4) {
|
|
38
|
-
// @ts-ignore
|
|
39
|
-
Module[name] = V4[name].bind(Module);
|
|
40
|
-
}
|
|
41
|
-
Object.defineProperties(Module.prototype, {
|
|
42
|
-
[kStartCPU]: { value: null, writable: true },
|
|
43
|
-
startCPU: {
|
|
44
|
-
set(value) {
|
|
45
|
-
// @ts-ignore
|
|
46
|
-
this[kStartCPU] = value;
|
|
47
|
-
},
|
|
48
|
-
get() {
|
|
49
|
-
let host;
|
|
50
|
-
// @ts-ignore
|
|
51
|
-
return this[kStartCPU] || (host = this.host) && host.startCPU;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
setModule("@squared-functions/module" /* FUNCTIONS.MODULE */, Module);
|
|
56
|
-
}
|
|
57
|
-
catch {
|
|
58
|
-
}
|
|
59
|
-
try {
|
|
60
|
-
const FileManager = require("@e-mc/file-manager" /* PACKAGE_NAME.FILE_MANAGER */);
|
|
61
|
-
const Request = require("@e-mc/request" /* PACKAGE_NAME.REQUEST */);
|
|
62
|
-
FileManager.fromHttpStatusCode = Request.fromStatusCode.bind(FileManager);
|
|
63
|
-
FileManager.defineHttpAgent = Request.defineHttpAgent.bind(FileManager);
|
|
64
|
-
FileManager.defineDnsLookup = Request.defineDnsLookup.bind(FileManager);
|
|
65
|
-
FileManager.getAria2Path = Request.getAria2Path.bind(FileManager);
|
|
66
|
-
FileManager.clearHttpBuffer = function () {
|
|
67
|
-
this.purgeMemory();
|
|
68
|
-
};
|
|
69
|
-
FileManager.resetHttpHost = function (version) {
|
|
70
|
-
Request.purgeMemory(version === 2 ? 1 : 0.5);
|
|
71
|
-
};
|
|
72
|
-
FileManager.clearDnsLookup = function () {
|
|
73
|
-
Request.purgeMemory(0);
|
|
74
|
-
};
|
|
75
|
-
FileManager.defineHttpSettings = function ({ version, timeout, headers, certs }) {
|
|
76
|
-
Request.loadSettings({ request: { timeout, use: { http_version: version }, headers, certs } });
|
|
77
|
-
};
|
|
78
|
-
FileManager.defineHttpBuffer = function (options) {
|
|
79
|
-
this.defineHttpCache(options);
|
|
80
|
-
};
|
|
81
|
-
const proto = FileManager.prototype;
|
|
82
|
-
proto.addDns = function (hostname, address, family) {
|
|
83
|
-
this.Request.addDns(hostname, address, family);
|
|
84
|
-
};
|
|
85
|
-
proto.lookupDns = function (hostname) {
|
|
86
|
-
return this.Request.lookupDns(hostname);
|
|
87
|
-
};
|
|
88
|
-
proto.getHttpProxy = function (uri, localhost) {
|
|
89
|
-
return this.Request.proxyOf(uri, localhost) || null;
|
|
90
|
-
};
|
|
91
|
-
proto.getHttpHeaders = function (uri) {
|
|
92
|
-
return this.Request.headersOf(uri);
|
|
93
|
-
};
|
|
94
|
-
proto.createHttpRequest = function (uri, options) {
|
|
95
|
-
return this.Request.opts(uri, options);
|
|
96
|
-
};
|
|
97
|
-
proto.getHttpClient = function (uri, options) {
|
|
98
|
-
return this.Request.open(uri, options);
|
|
99
|
-
};
|
|
100
|
-
Object.defineProperties(proto, {
|
|
101
|
-
cacheHttpRequest: {
|
|
102
|
-
set(value) {
|
|
103
|
-
const cacheToDisk = this.cacheToDisk;
|
|
104
|
-
if (Array.isArray(value)) {
|
|
105
|
-
if (value[0] === true) {
|
|
106
|
-
cacheToDisk.include = value.slice(1);
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
cacheToDisk.exclude = value.slice(0);
|
|
110
|
-
}
|
|
111
|
-
cacheToDisk.enabled = true;
|
|
112
|
-
}
|
|
113
|
-
else if (typeof value === 'boolean') {
|
|
114
|
-
cacheToDisk.enabled = value;
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
get() {
|
|
118
|
-
const cacheToDisk = this.cacheToDisk;
|
|
119
|
-
return (0, types_1.isArray)(cacheToDisk.include) ? cacheToDisk.include : (0, types_1.isArray)(cacheToDisk.exclude) ? cacheToDisk.exclude : cacheToDisk.enabled;
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
cacheHttpRequestBuffer: {
|
|
123
|
-
set(value) {
|
|
124
|
-
this.cacheToMemory = value;
|
|
125
|
-
},
|
|
126
|
-
get() {
|
|
127
|
-
return this.cacheToMemory;
|
|
128
|
-
}
|
|
129
|
-
},
|
|
130
|
-
fetchTimeout: {
|
|
131
|
-
set(value) {
|
|
132
|
-
this.Request.readTimeout = value;
|
|
133
|
-
},
|
|
134
|
-
get() {
|
|
135
|
-
return this.Request.readTimeout;
|
|
136
|
-
}
|
|
137
|
-
},
|
|
138
|
-
httpProxy: {
|
|
139
|
-
set(value) {
|
|
140
|
-
this.Request.proxy = value;
|
|
141
|
-
},
|
|
142
|
-
get() {
|
|
143
|
-
return this.Request.proxy;
|
|
144
|
-
}
|
|
145
|
-
},
|
|
146
|
-
acceptEncoding: {
|
|
147
|
-
set(value) {
|
|
148
|
-
this.Request.acceptEncoding = value;
|
|
149
|
-
},
|
|
150
|
-
get() {
|
|
151
|
-
return this.Request.acceptEncoding;
|
|
152
|
-
}
|
|
153
|
-
},
|
|
154
|
-
keepAliveTimeout: {
|
|
155
|
-
set(value) {
|
|
156
|
-
this.Request.agentTimeout = value;
|
|
157
|
-
this.Request.keepAlive = value > 0;
|
|
158
|
-
},
|
|
159
|
-
get() {
|
|
160
|
-
return this.Request.agentTimeout;
|
|
161
|
-
}
|
|
162
|
-
},
|
|
163
|
-
httpVersion: {
|
|
164
|
-
set(value) {
|
|
165
|
-
this.Request.httpVersion = value;
|
|
166
|
-
},
|
|
167
|
-
get() {
|
|
168
|
-
return this.Request.httpVersion;
|
|
169
|
-
}
|
|
170
|
-
},
|
|
171
|
-
ipVersion: {
|
|
172
|
-
set(value) {
|
|
173
|
-
this.Request.ipVersion = value;
|
|
174
|
-
},
|
|
175
|
-
get() {
|
|
176
|
-
return this.Request.ipVersion;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
});
|
|
180
|
-
setModule("@squared-functions/file-manager" /* FUNCTIONS.FILE_MANAGER */, FileManager);
|
|
181
|
-
}
|
|
182
|
-
catch {
|
|
183
|
-
}
|
|
184
|
-
try {
|
|
185
|
-
const Image = require("@e-mc/image" /* PACKAGE_NAME.IMAGE */);
|
|
186
|
-
Image.using = async function (instance, data, command) {
|
|
187
|
-
return instance.using?.(data, command);
|
|
188
|
-
};
|
|
189
|
-
setModule("@squared-functions/image-v3" /* FUNCTIONS.IMAGE_V3 */, Image);
|
|
190
|
-
}
|
|
191
|
-
catch {
|
|
192
|
-
}
|
|
193
|
-
try {
|
|
194
|
-
const Cloud = require("@e-mc/cloud" /* PACKAGE_NAME.CLOUD */);
|
|
195
|
-
Cloud.prototype.hasDatabaseCache = function (service, sessionKey) {
|
|
196
|
-
return this.hasCache(service, sessionKey);
|
|
197
|
-
};
|
|
198
|
-
Cloud.prototype.hasDatabaseCoerce = function (service, component, credential) {
|
|
199
|
-
return this.hasCoerce(service, component, null, credential);
|
|
200
|
-
};
|
|
201
|
-
Cloud.prototype.getDatabaseResult = function (service, credential, queryString, options, renewCache) {
|
|
202
|
-
return this.getQueryResult(service, credential, queryString, options, renewCache);
|
|
203
|
-
};
|
|
204
|
-
Cloud.prototype.setDatabaseResult = function (service, credential, queryString, result, options) {
|
|
205
|
-
return this.setQueryResult(service, credential, queryString, result, options);
|
|
206
|
-
};
|
|
207
|
-
setModule("@squared-functions/cloud" /* FUNCTIONS.CLOUD */, Cloud);
|
|
208
|
-
}
|
|
209
|
-
catch {
|
|
210
|
-
}
|
|
211
|
-
try {
|
|
212
|
-
const Watch = require("@e-mc/watch" /* PACKAGE_NAME.WATCH */);
|
|
213
|
-
const Request = require("@e-mc/request" /* PACKAGE_NAME.REQUEST */);
|
|
214
|
-
Watch.readCACert = Request.readCACert.bind(Watch);
|
|
215
|
-
Watch.readTLSKey = Request.readTLSKey.bind(Watch);
|
|
216
|
-
Watch.readTLSCert = Request.readTLSCert.bind(Watch);
|
|
217
|
-
Watch.isCert = Request.isCert.bind(Watch);
|
|
218
|
-
Watch.parseExpires = types_1.parseExpires.bind(Watch);
|
|
219
|
-
setModule("@squared-functions/watch" /* FUNCTIONS.WATCH */, Watch);
|
|
220
|
-
}
|
|
221
|
-
catch {
|
|
222
|
-
}
|
|
223
|
-
try {
|
|
224
|
-
const { TransformSeries } = require("@e-mc/document/transform" /* PACKAGE_NAME.DOCUMENT_TRANSFORM */);
|
|
225
|
-
Object.defineProperties(TransformSeries.prototype, {
|
|
226
|
-
outSourceFiles: {
|
|
227
|
-
set(value) {
|
|
228
|
-
this.out.sourceFiles = value;
|
|
229
|
-
},
|
|
230
|
-
get() {
|
|
231
|
-
return this.out.sourceFiles;
|
|
232
|
-
}
|
|
233
|
-
},
|
|
234
|
-
outIgnoreCache: {
|
|
235
|
-
set(value) {
|
|
236
|
-
this.out.ignoreCache = value;
|
|
237
|
-
},
|
|
238
|
-
get() {
|
|
239
|
-
return this.out.ignoreCache;
|
|
240
|
-
}
|
|
241
|
-
},
|
|
242
|
-
outLogAppend: {
|
|
243
|
-
set(value) {
|
|
244
|
-
this.out.logAppend = value;
|
|
245
|
-
},
|
|
246
|
-
get() {
|
|
247
|
-
return this.out.logAppend;
|
|
248
|
-
}
|
|
249
|
-
},
|
|
250
|
-
outMessageAppend: {
|
|
251
|
-
set(value) {
|
|
252
|
-
this.out.messageAppend = value;
|
|
253
|
-
},
|
|
254
|
-
get() {
|
|
255
|
-
return this.out.messageAppend;
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
});
|
|
259
|
-
const Util = require("@squared-functions/document/util" /* FUNCTIONS.DOCUMENT_UTIL */);
|
|
260
|
-
Util.parseExpires = types_1.parseExpires;
|
|
261
|
-
}
|
|
262
|
-
catch {
|
|
263
|
-
}
|
|
264
|
-
[
|
|
265
|
-
["@squared-functions/types" /* FUNCTIONS.TYPES */, "@e-mc/types" /* PACKAGE_NAME.TYPES */],
|
|
266
|
-
["@squared-functions/compress" /* FUNCTIONS.COMPRESS */, "@e-mc/compress" /* PACKAGE_NAME.COMPRESS */],
|
|
267
|
-
["@squared-functions/compress-v1" /* FUNCTIONS.COMPRESS_V1 */, "@e-mc/compress" /* PACKAGE_NAME.COMPRESS */],
|
|
268
|
-
["@squared-functions/compress-v3" /* FUNCTIONS.COMPRESS_V3 */, "@e-mc/compress" /* PACKAGE_NAME.COMPRESS */],
|
|
269
|
-
["@squared-functions/core" /* FUNCTIONS.CORE */, "@e-mc/core" /* PACKAGE_NAME.CORE */],
|
|
270
|
-
["@squared-functions/db" /* FUNCTIONS.DB */, "@e-mc/db" /* PACKAGE_NAME.DB */],
|
|
271
|
-
["@squared-functions/db/pool" /* FUNCTIONS.DB_POOL */, "@e-mc/db/pool" /* PACKAGE_NAME.DB_POOL */, '1'],
|
|
272
|
-
["@squared-functions/document" /* FUNCTIONS.DOCUMENT */, "@e-mc/document" /* PACKAGE_NAME.DOCUMENT */],
|
|
273
|
-
["@squared-functions/document/android" /* FUNCTIONS.DOCUMENT_ANDROID */, "@
|
|
274
|
-
["@squared-functions/document/chrome" /* FUNCTIONS.DOCUMENT_CHROME */, "@
|
|
275
|
-
["@squared-functions/document/transform" /* FUNCTIONS.DOCUMENT_TRANSFORM */, "@e-mc/document/transform" /* PACKAGE_NAME.DOCUMENT_TRANSFORM */],
|
|
276
|
-
["@squared-functions/file-manager/http/host" /* FUNCTIONS.FILE_MANAGER_HTTP_HOST */, "@e-mc/request/http/host" /* PACKAGE_NAME.REQUEST_HTTP_HOST */],
|
|
277
|
-
["@squared-functions/image-v3/jimp" /* FUNCTIONS.IMAGE_V3_JIMP */, "@
|
|
278
|
-
["@squared-functions/task" /* FUNCTIONS.TASK */, "@e-mc/task" /* PACKAGE_NAME.TASK */],
|
|
279
|
-
["@squared-functions/task/gulp" /* FUNCTIONS.TASK_GULP */, "@
|
|
280
|
-
["@squared-functions/watch/filegroup" /* FUNCTIONS.WATCH_FILEGROUP */, "@e-mc/watch/filegroup" /* PACKAGE_NAME.WATCH_FILEGROUP */],
|
|
281
|
-
["@e-mc/compat-v4" /* PACKAGE_NAME.COMPAT_V4 */]
|
|
282
|
-
]
|
|
283
|
-
.forEach(item => setModule(item[0], item[1], item[2]));
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const path = require("path");
|
|
4
|
+
const V4 = require("../module/lib-v4");
|
|
5
|
+
const types_1 = require("../types");
|
|
6
|
+
function setModule(name, target, self) {
|
|
7
|
+
try {
|
|
8
|
+
require(name);
|
|
9
|
+
if (typeof target === 'string') {
|
|
10
|
+
target = require(target);
|
|
11
|
+
}
|
|
12
|
+
const cache = require.cache;
|
|
13
|
+
name = self === '1' ? path.normalize(name) + '.js' : path.join(name, 'index.js');
|
|
14
|
+
for (const pathname in cache) {
|
|
15
|
+
if (pathname.endsWith(name)) {
|
|
16
|
+
if (target) {
|
|
17
|
+
switch (name) {
|
|
18
|
+
case "@squared-functions/compress" /* FUNCTIONS.COMPRESS */:
|
|
19
|
+
case "@squared-functions/compress-v1" /* FUNCTIONS.COMPRESS_V1 */:
|
|
20
|
+
target = target.singleton();
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
cache[pathname].exports = target;
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
delete cache[pathname];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
try {
|
|
35
|
+
const Module = require("@e-mc/module" /* PACKAGE_NAME.MODULE */);
|
|
36
|
+
const kStartCPU = Symbol('startCPU');
|
|
37
|
+
for (const name in V4) {
|
|
38
|
+
// @ts-ignore
|
|
39
|
+
Module[name] = V4[name].bind(Module);
|
|
40
|
+
}
|
|
41
|
+
Object.defineProperties(Module.prototype, {
|
|
42
|
+
[kStartCPU]: { value: null, writable: true },
|
|
43
|
+
startCPU: {
|
|
44
|
+
set(value) {
|
|
45
|
+
// @ts-ignore
|
|
46
|
+
this[kStartCPU] = value;
|
|
47
|
+
},
|
|
48
|
+
get() {
|
|
49
|
+
let host;
|
|
50
|
+
// @ts-ignore
|
|
51
|
+
return this[kStartCPU] || (host = this.host) && host.startCPU;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
setModule("@squared-functions/module" /* FUNCTIONS.MODULE */, Module);
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
}
|
|
59
|
+
try {
|
|
60
|
+
const FileManager = require("@e-mc/file-manager" /* PACKAGE_NAME.FILE_MANAGER */);
|
|
61
|
+
const Request = require("@e-mc/request" /* PACKAGE_NAME.REQUEST */);
|
|
62
|
+
FileManager.fromHttpStatusCode = Request.fromStatusCode.bind(FileManager);
|
|
63
|
+
FileManager.defineHttpAgent = Request.defineHttpAgent.bind(FileManager);
|
|
64
|
+
FileManager.defineDnsLookup = Request.defineDnsLookup.bind(FileManager);
|
|
65
|
+
FileManager.getAria2Path = Request.getAria2Path.bind(FileManager);
|
|
66
|
+
FileManager.clearHttpBuffer = function () {
|
|
67
|
+
this.purgeMemory();
|
|
68
|
+
};
|
|
69
|
+
FileManager.resetHttpHost = function (version) {
|
|
70
|
+
Request.purgeMemory(version === 2 ? 1 : 0.5);
|
|
71
|
+
};
|
|
72
|
+
FileManager.clearDnsLookup = function () {
|
|
73
|
+
Request.purgeMemory(0);
|
|
74
|
+
};
|
|
75
|
+
FileManager.defineHttpSettings = function ({ version, timeout, headers, certs }) {
|
|
76
|
+
Request.loadSettings({ request: { timeout, use: { http_version: version }, headers, certs } });
|
|
77
|
+
};
|
|
78
|
+
FileManager.defineHttpBuffer = function (options) {
|
|
79
|
+
this.defineHttpCache(options);
|
|
80
|
+
};
|
|
81
|
+
const proto = FileManager.prototype;
|
|
82
|
+
proto.addDns = function (hostname, address, family) {
|
|
83
|
+
this.Request.addDns(hostname, address, family);
|
|
84
|
+
};
|
|
85
|
+
proto.lookupDns = function (hostname) {
|
|
86
|
+
return this.Request.lookupDns(hostname);
|
|
87
|
+
};
|
|
88
|
+
proto.getHttpProxy = function (uri, localhost) {
|
|
89
|
+
return this.Request.proxyOf(uri, localhost) || null;
|
|
90
|
+
};
|
|
91
|
+
proto.getHttpHeaders = function (uri) {
|
|
92
|
+
return this.Request.headersOf(uri);
|
|
93
|
+
};
|
|
94
|
+
proto.createHttpRequest = function (uri, options) {
|
|
95
|
+
return this.Request.opts(uri, options);
|
|
96
|
+
};
|
|
97
|
+
proto.getHttpClient = function (uri, options) {
|
|
98
|
+
return this.Request.open(uri, options);
|
|
99
|
+
};
|
|
100
|
+
Object.defineProperties(proto, {
|
|
101
|
+
cacheHttpRequest: {
|
|
102
|
+
set(value) {
|
|
103
|
+
const cacheToDisk = this.cacheToDisk;
|
|
104
|
+
if (Array.isArray(value)) {
|
|
105
|
+
if (value[0] === true) {
|
|
106
|
+
cacheToDisk.include = value.slice(1);
|
|
107
|
+
}
|
|
108
|
+
else {
|
|
109
|
+
cacheToDisk.exclude = value.slice(0);
|
|
110
|
+
}
|
|
111
|
+
cacheToDisk.enabled = true;
|
|
112
|
+
}
|
|
113
|
+
else if (typeof value === 'boolean') {
|
|
114
|
+
cacheToDisk.enabled = value;
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
get() {
|
|
118
|
+
const cacheToDisk = this.cacheToDisk;
|
|
119
|
+
return (0, types_1.isArray)(cacheToDisk.include) ? cacheToDisk.include : (0, types_1.isArray)(cacheToDisk.exclude) ? cacheToDisk.exclude : cacheToDisk.enabled;
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
cacheHttpRequestBuffer: {
|
|
123
|
+
set(value) {
|
|
124
|
+
this.cacheToMemory = value;
|
|
125
|
+
},
|
|
126
|
+
get() {
|
|
127
|
+
return this.cacheToMemory;
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
fetchTimeout: {
|
|
131
|
+
set(value) {
|
|
132
|
+
this.Request.readTimeout = value;
|
|
133
|
+
},
|
|
134
|
+
get() {
|
|
135
|
+
return this.Request.readTimeout;
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
httpProxy: {
|
|
139
|
+
set(value) {
|
|
140
|
+
this.Request.proxy = value;
|
|
141
|
+
},
|
|
142
|
+
get() {
|
|
143
|
+
return this.Request.proxy;
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
acceptEncoding: {
|
|
147
|
+
set(value) {
|
|
148
|
+
this.Request.acceptEncoding = value;
|
|
149
|
+
},
|
|
150
|
+
get() {
|
|
151
|
+
return this.Request.acceptEncoding;
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
keepAliveTimeout: {
|
|
155
|
+
set(value) {
|
|
156
|
+
this.Request.agentTimeout = value;
|
|
157
|
+
this.Request.keepAlive = value > 0;
|
|
158
|
+
},
|
|
159
|
+
get() {
|
|
160
|
+
return this.Request.agentTimeout;
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
httpVersion: {
|
|
164
|
+
set(value) {
|
|
165
|
+
this.Request.httpVersion = value;
|
|
166
|
+
},
|
|
167
|
+
get() {
|
|
168
|
+
return this.Request.httpVersion;
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
ipVersion: {
|
|
172
|
+
set(value) {
|
|
173
|
+
this.Request.ipVersion = value;
|
|
174
|
+
},
|
|
175
|
+
get() {
|
|
176
|
+
return this.Request.ipVersion;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
setModule("@squared-functions/file-manager" /* FUNCTIONS.FILE_MANAGER */, FileManager);
|
|
181
|
+
}
|
|
182
|
+
catch {
|
|
183
|
+
}
|
|
184
|
+
try {
|
|
185
|
+
const Image = require("@e-mc/image" /* PACKAGE_NAME.IMAGE */);
|
|
186
|
+
Image.using = async function (instance, data, command) {
|
|
187
|
+
return instance.using?.(data, command);
|
|
188
|
+
};
|
|
189
|
+
setModule("@squared-functions/image-v3" /* FUNCTIONS.IMAGE_V3 */, Image);
|
|
190
|
+
}
|
|
191
|
+
catch {
|
|
192
|
+
}
|
|
193
|
+
try {
|
|
194
|
+
const Cloud = require("@e-mc/cloud" /* PACKAGE_NAME.CLOUD */);
|
|
195
|
+
Cloud.prototype.hasDatabaseCache = function (service, sessionKey) {
|
|
196
|
+
return this.hasCache(service, sessionKey);
|
|
197
|
+
};
|
|
198
|
+
Cloud.prototype.hasDatabaseCoerce = function (service, component, credential) {
|
|
199
|
+
return this.hasCoerce(service, component, null, credential);
|
|
200
|
+
};
|
|
201
|
+
Cloud.prototype.getDatabaseResult = function (service, credential, queryString, options, renewCache) {
|
|
202
|
+
return this.getQueryResult(service, credential, queryString, options, renewCache);
|
|
203
|
+
};
|
|
204
|
+
Cloud.prototype.setDatabaseResult = function (service, credential, queryString, result, options) {
|
|
205
|
+
return this.setQueryResult(service, credential, queryString, result, options);
|
|
206
|
+
};
|
|
207
|
+
setModule("@squared-functions/cloud" /* FUNCTIONS.CLOUD */, Cloud);
|
|
208
|
+
}
|
|
209
|
+
catch {
|
|
210
|
+
}
|
|
211
|
+
try {
|
|
212
|
+
const Watch = require("@e-mc/watch" /* PACKAGE_NAME.WATCH */);
|
|
213
|
+
const Request = require("@e-mc/request" /* PACKAGE_NAME.REQUEST */);
|
|
214
|
+
Watch.readCACert = Request.readCACert.bind(Watch);
|
|
215
|
+
Watch.readTLSKey = Request.readTLSKey.bind(Watch);
|
|
216
|
+
Watch.readTLSCert = Request.readTLSCert.bind(Watch);
|
|
217
|
+
Watch.isCert = Request.isCert.bind(Watch);
|
|
218
|
+
Watch.parseExpires = types_1.parseExpires.bind(Watch);
|
|
219
|
+
setModule("@squared-functions/watch" /* FUNCTIONS.WATCH */, Watch);
|
|
220
|
+
}
|
|
221
|
+
catch {
|
|
222
|
+
}
|
|
223
|
+
try {
|
|
224
|
+
const { TransformSeries } = require("@e-mc/document/transform" /* PACKAGE_NAME.DOCUMENT_TRANSFORM */);
|
|
225
|
+
Object.defineProperties(TransformSeries.prototype, {
|
|
226
|
+
outSourceFiles: {
|
|
227
|
+
set(value) {
|
|
228
|
+
this.out.sourceFiles = value;
|
|
229
|
+
},
|
|
230
|
+
get() {
|
|
231
|
+
return this.out.sourceFiles;
|
|
232
|
+
}
|
|
233
|
+
},
|
|
234
|
+
outIgnoreCache: {
|
|
235
|
+
set(value) {
|
|
236
|
+
this.out.ignoreCache = value;
|
|
237
|
+
},
|
|
238
|
+
get() {
|
|
239
|
+
return this.out.ignoreCache;
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
outLogAppend: {
|
|
243
|
+
set(value) {
|
|
244
|
+
this.out.logAppend = value;
|
|
245
|
+
},
|
|
246
|
+
get() {
|
|
247
|
+
return this.out.logAppend;
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
outMessageAppend: {
|
|
251
|
+
set(value) {
|
|
252
|
+
this.out.messageAppend = value;
|
|
253
|
+
},
|
|
254
|
+
get() {
|
|
255
|
+
return this.out.messageAppend;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
const Util = require("@squared-functions/document/util" /* FUNCTIONS.DOCUMENT_UTIL */);
|
|
260
|
+
Util.parseExpires = types_1.parseExpires;
|
|
261
|
+
}
|
|
262
|
+
catch {
|
|
263
|
+
}
|
|
264
|
+
[
|
|
265
|
+
["@squared-functions/types" /* FUNCTIONS.TYPES */, "@e-mc/types" /* PACKAGE_NAME.TYPES */],
|
|
266
|
+
["@squared-functions/compress" /* FUNCTIONS.COMPRESS */, "@e-mc/compress" /* PACKAGE_NAME.COMPRESS */],
|
|
267
|
+
["@squared-functions/compress-v1" /* FUNCTIONS.COMPRESS_V1 */, "@e-mc/compress" /* PACKAGE_NAME.COMPRESS */],
|
|
268
|
+
["@squared-functions/compress-v3" /* FUNCTIONS.COMPRESS_V3 */, "@e-mc/compress" /* PACKAGE_NAME.COMPRESS */],
|
|
269
|
+
["@squared-functions/core" /* FUNCTIONS.CORE */, "@e-mc/core" /* PACKAGE_NAME.CORE */],
|
|
270
|
+
["@squared-functions/db" /* FUNCTIONS.DB */, "@e-mc/db" /* PACKAGE_NAME.DB */],
|
|
271
|
+
["@squared-functions/db/pool" /* FUNCTIONS.DB_POOL */, "@e-mc/db/pool" /* PACKAGE_NAME.DB_POOL */, '1'],
|
|
272
|
+
["@squared-functions/document" /* FUNCTIONS.DOCUMENT */, "@e-mc/document" /* PACKAGE_NAME.DOCUMENT */],
|
|
273
|
+
["@squared-functions/document/android" /* FUNCTIONS.DOCUMENT_ANDROID */, "@pi-r/android" /* PACKAGE_NAME.DOCUMENT_ANDROID */],
|
|
274
|
+
["@squared-functions/document/chrome" /* FUNCTIONS.DOCUMENT_CHROME */, "@pi-r/chrome" /* PACKAGE_NAME.DOCUMENT_CHROME */],
|
|
275
|
+
["@squared-functions/document/transform" /* FUNCTIONS.DOCUMENT_TRANSFORM */, "@e-mc/document/transform" /* PACKAGE_NAME.DOCUMENT_TRANSFORM */],
|
|
276
|
+
["@squared-functions/file-manager/http/host" /* FUNCTIONS.FILE_MANAGER_HTTP_HOST */, "@e-mc/request/http/host" /* PACKAGE_NAME.REQUEST_HTTP_HOST */],
|
|
277
|
+
["@squared-functions/image-v3/jimp" /* FUNCTIONS.IMAGE_V3_JIMP */, "@pi-r/jimp" /* PACKAGE_NAME.IMAGE_JIMP */],
|
|
278
|
+
["@squared-functions/task" /* FUNCTIONS.TASK */, "@e-mc/task" /* PACKAGE_NAME.TASK */],
|
|
279
|
+
["@squared-functions/task/gulp" /* FUNCTIONS.TASK_GULP */, "@pi-r/gulp" /* PACKAGE_NAME.TASK_GULP */],
|
|
280
|
+
["@squared-functions/watch/filegroup" /* FUNCTIONS.WATCH_FILEGROUP */, "@e-mc/watch/filegroup" /* PACKAGE_NAME.WATCH_FILEGROUP */],
|
|
281
|
+
["@e-mc/compat-v4" /* PACKAGE_NAME.COMPAT_V4 */]
|
|
282
|
+
]
|
|
283
|
+
.forEach(item => setModule(item[0], item[1], item[2]));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@e-mc/compat-v4",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Base class compatibility with squared-functions.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"publishConfig": {
|
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
"license": "BSD 3-Clause",
|
|
23
23
|
"homepage": "https://github.com/anpham6/e-mc#readme",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@e-mc/module": "0.
|
|
26
|
-
"@e-mc/request": "0.
|
|
27
|
-
"@e-mc/types": "0.
|
|
25
|
+
"@e-mc/module": "0.4.0",
|
|
26
|
+
"@e-mc/request": "0.4.0",
|
|
27
|
+
"@e-mc/types": "0.4.0"
|
|
28
28
|
}
|
|
29
29
|
}
|