@ccci/micro-server 1.0.140 → 1.0.141
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/index.d.ts +1 -0
- package/dist/index.js +24 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export { default as Uploader } from './utils/Uploader';
|
|
|
19
19
|
export { default as Mailer } from './utils/Mailer';
|
|
20
20
|
export { default as UploaderS3 } from './utils/uploader-s3';
|
|
21
21
|
export { default as Sequelize } from 'sequelize';
|
|
22
|
+
export * from './utils/Mixins';
|
|
22
23
|
export type { NotificationType, NotificationOptions } from './types/NotificationTypes';
|
|
23
24
|
export { default as PushNotifier } from './utils/PushNotifier';
|
|
24
25
|
export { PublicAccess, PrivateAccess, endpoint } from './decorators/Endpoints';
|
package/dist/index.js
CHANGED
|
@@ -281585,6 +281585,26 @@ var getMimeType = (fileName) => {
|
|
|
281585
281585
|
const extension = fileName.split(".").pop()?.toLowerCase();
|
|
281586
281586
|
return extension ? mimeTypes[extension] || null : null;
|
|
281587
281587
|
};
|
|
281588
|
+
var extractIds = (input) => {
|
|
281589
|
+
const regex = /\[([a-zA-Z]+:(\d+))\]/g;
|
|
281590
|
+
let match;
|
|
281591
|
+
const ids = [];
|
|
281592
|
+
while ((match = regex.exec(input)) !== null) {
|
|
281593
|
+
ids.push(Number(match[2]));
|
|
281594
|
+
}
|
|
281595
|
+
return ids;
|
|
281596
|
+
};
|
|
281597
|
+
var decrypt = (salt, encoded) => {
|
|
281598
|
+
const textToChars = (text) => Array.from(text).map((c) => c.charCodeAt(0));
|
|
281599
|
+
const applySaltToChar = (code) => textToChars(salt).reduce((acc, charCode) => acc ^ charCode, code);
|
|
281600
|
+
return encoded.match(/.{1,2}/g)?.map((hex) => parseInt(hex, 16)).map(applySaltToChar).map((charCode) => String.fromCharCode(charCode)).join("") || "";
|
|
281601
|
+
};
|
|
281602
|
+
var encrypt = (salt, text) => {
|
|
281603
|
+
const textToChars = (text2) => Array.from(text2).map((c) => c.charCodeAt(0));
|
|
281604
|
+
const byteHex = (n) => ("0" + n.toString(16)).slice(-2);
|
|
281605
|
+
const applySaltToChar = (code) => textToChars(salt).reduce((acc, charCode) => acc ^ charCode, code);
|
|
281606
|
+
return Array.from(text).map((char) => char.charCodeAt(0)).map(applySaltToChar).map(byteHex).join("");
|
|
281607
|
+
};
|
|
281588
281608
|
|
|
281589
281609
|
// src/utils/uploader-s3.ts
|
|
281590
281610
|
class UploaderS3 {
|
|
@@ -282420,8 +282440,12 @@ var PrivateAccess = (constructor) => {
|
|
|
282420
282440
|
};
|
|
282421
282441
|
export {
|
|
282422
282442
|
verify,
|
|
282443
|
+
getMimeType,
|
|
282423
282444
|
generate,
|
|
282445
|
+
extractIds,
|
|
282424
282446
|
endpoint,
|
|
282447
|
+
encrypt,
|
|
282448
|
+
decrypt,
|
|
282425
282449
|
decode,
|
|
282426
282450
|
WebSocketServer,
|
|
282427
282451
|
UploaderS3,
|