@blurpaper/shared 2.0.3 → 2.0.7
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/helpers/object.helper.js +1 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -3
- package/package.json +1 -1
- package/dist/classes/paper-configuration.class.d.ts +0 -11
- package/dist/classes/paper-configuration.class.js +0 -45
- package/dist/classes/url-formatter.class.d.ts +0 -4
- package/dist/classes/url-formatter.class.js +0 -10
- package/dist/interfaces/env.interface.d.ts +0 -16
- package/dist/interfaces/env.interface.js +0 -2
|
@@ -20,7 +20,7 @@ const recursivelyReassignKeysAndValues = (alphabetKeyMap, originalObject = {}, m
|
|
|
20
20
|
largeRepetitableIndex = (currentLargeRepetitableIndex >= 0) ? currentLargeRepetitableIndex : largeRepetitables.push(stringifiedLarge) - 1;
|
|
21
21
|
}
|
|
22
22
|
const alphabetKey = alphabetKeyMap.addToAlphabet(key, undefined, { noLowerKeys: true, addKeyAlphabet: true });
|
|
23
|
-
minifiedObject[alphabetKey] = isLargeRepetitable ? largeRepetitableIndex : (0, exports.isPrimitive)(nestedObject) ? (((key === 'value') && ((typeof nestedObject === 'string'))) || (typeof nestedObject === 'number') || !isNaN(Number(nestedObject)) || (typeof nestedObject === 'boolean') || constants_1.GUID_REGEX.test(nestedObject) || constants_1.NUMBER_REGEX.test(nestedObject) || (nestedObject === undefined) || (nestedObject === null) ? nestedObject : alphabetKeyMap.addToAlphabet(nestedObject, undefined, { noLowerKeys: true, addKeyAlphabet: true })) : {};
|
|
23
|
+
minifiedObject[alphabetKey] = isLargeRepetitable ? largeRepetitableIndex : (0, exports.isPrimitive)(nestedObject) ? (((key === 'value') && ((typeof nestedObject === 'string'))) || (typeof nestedObject === 'number') || !isNaN(Number(nestedObject)) || (typeof nestedObject === 'boolean') || constants_1.GUID_REGEX.test(nestedObject) || constants_1.NUMBER_REGEX.test(nestedObject) || (nestedObject === undefined) || (nestedObject === null) ? nestedObject : alphabetKeyMap.addToAlphabet(nestedObject, undefined, { noLowerKeys: true, addKeyAlphabet: true })) : (Array.isArray(nestedObject) ? [] : {});
|
|
24
24
|
if (!(0, exports.isPrimitive)(nestedObject) && !isLargeRepetitable && (!nestedObject[constants_1.VISITED_SESSION_GENERATION_KEY] || (nestedObject[constants_1.VISITED_SESSION_GENERATION_KEY] !== visitingSesion))) {
|
|
25
25
|
(0, exports.recursivelyReassignKeysAndValues)(alphabetKeyMap, nestedObject, minifiedObject[alphabetKey], largeRepetitables, visitingSesion);
|
|
26
26
|
nestedObject[constants_1.VISITED_SESSION_GENERATION_KEY] = visitingSesion;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
export * from "./interfaces/alphabet-settings-input.interface";
|
|
2
2
|
export * from "./interfaces/start-end.interface";
|
|
3
3
|
export * from "./interfaces/repetitable-data.interface";
|
|
4
|
-
export * from "./interfaces/env.interface";
|
|
5
4
|
export * from "./helpers/object.helper";
|
|
6
5
|
export * from "./helpers/string.helper";
|
|
7
6
|
export * from "./classes/key-alphabet.class";
|
|
8
|
-
export * from "./classes/paper-configuration.class";
|
|
9
|
-
export * from "./classes/url-formatter.class";
|
|
10
7
|
export * from "./enums/save-upload-file.enum";
|
|
11
8
|
export * from "./constants";
|
package/dist/index.js
CHANGED
|
@@ -17,11 +17,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./interfaces/alphabet-settings-input.interface"), exports);
|
|
18
18
|
__exportStar(require("./interfaces/start-end.interface"), exports);
|
|
19
19
|
__exportStar(require("./interfaces/repetitable-data.interface"), exports);
|
|
20
|
-
__exportStar(require("./interfaces/env.interface"), exports);
|
|
21
20
|
__exportStar(require("./helpers/object.helper"), exports);
|
|
22
21
|
__exportStar(require("./helpers/string.helper"), exports);
|
|
23
22
|
__exportStar(require("./classes/key-alphabet.class"), exports);
|
|
24
|
-
__exportStar(require("./classes/paper-configuration.class"), exports);
|
|
25
|
-
__exportStar(require("./classes/url-formatter.class"), exports);
|
|
26
23
|
__exportStar(require("./enums/save-upload-file.enum"), exports);
|
|
27
24
|
__exportStar(require("./constants"), exports);
|
package/package.json
CHANGED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { IEnv } from "../interfaces/env.interface";
|
|
2
|
-
export declare class PaperConfiguration {
|
|
3
|
-
env: IEnv;
|
|
4
|
-
isProduction: boolean;
|
|
5
|
-
app: any;
|
|
6
|
-
https: any;
|
|
7
|
-
fs: any;
|
|
8
|
-
constructor(env: IEnv, app: any, https: any, fs: any);
|
|
9
|
-
startNodeServer(): void;
|
|
10
|
-
getCorsOrigin(): Record<string, string | RegExp>;
|
|
11
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PaperConfiguration = void 0;
|
|
4
|
-
class PaperConfiguration {
|
|
5
|
-
env;
|
|
6
|
-
isProduction;
|
|
7
|
-
app;
|
|
8
|
-
https;
|
|
9
|
-
fs;
|
|
10
|
-
constructor(env, app, https, fs) {
|
|
11
|
-
this.env = env;
|
|
12
|
-
this.isProduction = env.NODE_ENV === 'production';
|
|
13
|
-
this.app = app;
|
|
14
|
-
this.https = https;
|
|
15
|
-
this.fs = fs;
|
|
16
|
-
}
|
|
17
|
-
startNodeServer() {
|
|
18
|
-
let server = this.app;
|
|
19
|
-
if (this.isProduction && this.env.PRIVATE_KEY && this.env.FULL_CHAIN) {
|
|
20
|
-
try {
|
|
21
|
-
server = this.https.createServer({
|
|
22
|
-
key: this.fs.readFileSync(this.env.PRIVATE_KEY),
|
|
23
|
-
cert: this.fs.readFileSync(this.env.FULL_CHAIN),
|
|
24
|
-
rejectUnauthorized: false,
|
|
25
|
-
}, this.app);
|
|
26
|
-
}
|
|
27
|
-
catch (error) {
|
|
28
|
-
console.log('ERROR:');
|
|
29
|
-
console.log('Could not start with SSL connection');
|
|
30
|
-
console.log(error);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
server.listen(this.env.PORT, () => {
|
|
34
|
-
console.log(`${this.env.APP_NAME} is listening on port ${this.env.PORT}!!!!`);
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
getCorsOrigin() {
|
|
38
|
-
return {
|
|
39
|
-
origin: this.isProduction ?
|
|
40
|
-
/^(https:\/\/)([a-zA-Z0-9\-]+)?(?!\/)(?!\?).?(blurpaper.com):?([0-9]+)?/ :
|
|
41
|
-
'*'
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
exports.PaperConfiguration = PaperConfiguration;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.URLFormatter = void 0;
|
|
4
|
-
class URLFormatter {
|
|
5
|
-
url;
|
|
6
|
-
constructor(protocol, linkTo, port) {
|
|
7
|
-
this.url = `${protocol}://${linkTo}:${port}`;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
exports.URLFormatter = URLFormatter;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export interface IEnv {
|
|
2
|
-
LINK_TO_PAPER_CRUD?: string;
|
|
3
|
-
LINK_TO_PAPER_LOOP?: string;
|
|
4
|
-
LINK_TO_PAPER_EMAIL_BE?: string;
|
|
5
|
-
LINK_TO_PAPER_EBOOK_REPO?: string;
|
|
6
|
-
PAPER_EBOOK_REPO_PORT?: number;
|
|
7
|
-
PAPER_CRUD_PORT?: string;
|
|
8
|
-
PAPER_LOOP_PORT?: string;
|
|
9
|
-
PAPER_EMAIL_BE_PORT?: number;
|
|
10
|
-
PROTOCOL?: string;
|
|
11
|
-
NODE_ENV?: string;
|
|
12
|
-
PRIVATE_KEY?: string;
|
|
13
|
-
FULL_CHAIN?: string;
|
|
14
|
-
APP_NAME?: string;
|
|
15
|
-
PORT?: string;
|
|
16
|
-
}
|