biz-slide-core 1.2.4 → 1.2.6

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.
Files changed (62) hide show
  1. package/{entity → dist/entity}/template-type.entity.js +1 -0
  2. package/dist/package-lock.json +1770 -0
  3. package/dist/package.json +23 -0
  4. package/{utilities → dist/utilities}/callWithRetries.js +1 -1
  5. package/package.json +1 -1
  6. package/src/entity/image.entity.ts +34 -0
  7. package/src/entity/index.ts +13 -0
  8. package/src/entity/png-svg.entity.ts +36 -0
  9. package/src/entity/ppt-event.entity.ts +23 -0
  10. package/src/entity/ppt-slide.entity.ts +31 -0
  11. package/src/entity/ppt.entity.ts +42 -0
  12. package/src/entity/slide-layout.entity.ts +24 -0
  13. package/src/entity/slide.entity.ts +47 -0
  14. package/src/entity/socket.entity.ts +22 -0
  15. package/src/entity/template-type.entity.ts +55 -0
  16. package/src/entity/template.entity.ts +37 -0
  17. package/src/entity/training-queue.entity.ts +24 -0
  18. package/src/entity/user.entity.ts +26 -0
  19. package/src/index.ts +5 -0
  20. package/src/middleware/authentication.ts +68 -0
  21. package/src/middleware/index.ts +3 -0
  22. package/src/middleware/role.ts +5 -0
  23. package/src/middleware/schemaValidate.ts +20 -0
  24. package/src/resHandler/errorHandler.ts +44 -0
  25. package/src/resHandler/index.ts +2 -0
  26. package/src/resHandler/successHandler.ts +11 -0
  27. package/src/types/IController.ts +6 -0
  28. package/src/types/IRequest.ts +8 -0
  29. package/src/types/index.ts +11 -0
  30. package/src/utilities/callWithRetries.ts +9 -0
  31. package/src/utilities/createFolder.ts +12 -0
  32. package/src/utilities/encryptionUtils.ts +26 -0
  33. package/src/utilities/index.ts +5 -0
  34. package/src/utilities/pngSvgCategories.ts +167 -0
  35. package/tsconfig.json +11 -0
  36. /package/{entity → dist/entity}/image.entity.js +0 -0
  37. /package/{entity → dist/entity}/index.js +0 -0
  38. /package/{entity → dist/entity}/png-svg.entity.js +0 -0
  39. /package/{entity → dist/entity}/ppt-event.entity.js +0 -0
  40. /package/{entity → dist/entity}/ppt-slide.entity.js +0 -0
  41. /package/{entity → dist/entity}/ppt.entity.js +0 -0
  42. /package/{entity → dist/entity}/slide-layout.entity.js +0 -0
  43. /package/{entity → dist/entity}/slide.entity.js +0 -0
  44. /package/{entity → dist/entity}/socket.entity.js +0 -0
  45. /package/{entity → dist/entity}/template.entity.js +0 -0
  46. /package/{entity → dist/entity}/training-queue.entity.js +0 -0
  47. /package/{entity → dist/entity}/user.entity.js +0 -0
  48. /package/{index.js → dist/index.js} +0 -0
  49. /package/{middleware → dist/middleware}/authentication.js +0 -0
  50. /package/{middleware → dist/middleware}/index.js +0 -0
  51. /package/{middleware → dist/middleware}/role.js +0 -0
  52. /package/{middleware → dist/middleware}/schemaValidate.js +0 -0
  53. /package/{resHandler → dist/resHandler}/errorHandler.js +0 -0
  54. /package/{resHandler → dist/resHandler}/index.js +0 -0
  55. /package/{resHandler → dist/resHandler}/successHandler.js +0 -0
  56. /package/{types → dist/types}/IController.js +0 -0
  57. /package/{types → dist/types}/IRequest.js +0 -0
  58. /package/{types → dist/types}/index.js +0 -0
  59. /package/{utilities → dist/utilities}/createFolder.js +0 -0
  60. /package/{utilities → dist/utilities}/encryptionUtils.js +0 -0
  61. /package/{utilities → dist/utilities}/index.js +0 -0
  62. /package/{utilities → dist/utilities}/pngSvgCategories.js +0 -0
@@ -0,0 +1,9 @@
1
+ export async function callWithRetries(retryCount: number, failedMessage: string, functionRef: Function, ...args: any): Promise<any> {
2
+ try {
3
+ return await functionRef(...args)
4
+ } catch (error) {
5
+ if (retryCount <= 0) throw error;
6
+ console.log(error, failedMessage)
7
+ return callWithRetries(retryCount - 1, failedMessage, functionRef, ...args);
8
+ }
9
+ }
@@ -0,0 +1,12 @@
1
+ import fs from "fs";
2
+
3
+ export async function createFolder(folderPath: string) {
4
+ try {
5
+ if (!fs.existsSync(folderPath)) {
6
+ fs.mkdirSync(folderPath);
7
+ }
8
+ console.log(`Folder "${folderPath}" is ready.`);
9
+ } catch (error: any) {
10
+ console.error(`Error: ${error.message}`);
11
+ }
12
+ }
@@ -0,0 +1,26 @@
1
+ import jwt from 'jsonwebtoken';
2
+
3
+ const signUid = (value: object) => {
4
+ return jwt.sign({ value }, process.env.JWTSECRET || 'secret', {
5
+ expiresIn: '8h' // expires in 8 hours
6
+ });
7
+ };
8
+
9
+ const verifyUid = async (token: string): Promise<any> =>
10
+ new Promise(resolve => {
11
+ const jwtToken = token.split(" ")[1] || token;
12
+ jwt.verify(
13
+ jwtToken,
14
+ process.env.JWTSECRET || 'secret',
15
+ (err, decoded) => {
16
+ if (err) {
17
+ console.log(err)
18
+ resolve(null);
19
+ } else {
20
+ resolve(decoded);
21
+ }
22
+ },
23
+ );
24
+ });
25
+
26
+ export { signUid, verifyUid }
@@ -0,0 +1,5 @@
1
+ export * from "./callWithRetries";
2
+ export * from "./createFolder";
3
+ export * from "./encryptionUtils";
4
+ export * from "./pngSvgCategories";
5
+
@@ -0,0 +1,167 @@
1
+ export const pngSvgCategories = {
2
+ "Logo": {
3
+ "Outline": {
4
+ "alias": ""
5
+ },
6
+ "Monogram": {
7
+ "alias": ""
8
+ },
9
+ "Wordmark": {
10
+ "alias": ""
11
+ },
12
+ "Emblem": {
13
+ "alias": ""
14
+ },
15
+ "Abstract Logo": {
16
+ "alias": ""
17
+ },
18
+ "Mascot": {
19
+ "alias": ""
20
+ }
21
+ },
22
+ "Icons": {
23
+ "Outline": {
24
+ "alias": ""
25
+ },
26
+ "Pictogram": {
27
+ "alias": ""
28
+ },
29
+ "Broken Line": {
30
+ "alias": ""
31
+ },
32
+ "Gradient Line": {
33
+ "alias": ""
34
+ },
35
+ "Gradient Shape": {
36
+ "alias": "The icon should have strong and dramatic lighting and have a clean look on white background and should have only the suggested colour scheme."
37
+ },
38
+ "Doodle": {
39
+ "alias": ""
40
+ },
41
+ "Flat": {
42
+ "alias": ""
43
+ },
44
+ "Minimalistic": {
45
+ "alias": ""
46
+ },
47
+ "Isometric": {
48
+ "alias": "The icon should have strong and dramatic lighting and have a clean look on white background and should have only the suggested colour scheme. "
49
+ },
50
+ "3D Icons": {
51
+ "alias": "The icon should have strong and dramatic lighting and have a clean look on white background and should have only the suggested colour scheme."
52
+ }
53
+ },
54
+ "Illustrations": {
55
+ "Hand Drawn": {
56
+ "alias": ""
57
+ },
58
+ "Glow": {
59
+ "alias": "The icon should have strong and dramatic lighting and have a clean look on white background and should have only the suggested colour scheme. "
60
+ },
61
+ "Pixel Art": {
62
+ "alias": ""
63
+ },
64
+ "Watercolour": {
65
+ "alias": ""
66
+ },
67
+ "Psychedelic": {
68
+ "alias": "The icon should have strong and dramatic lighting and have a clean look on white background and should have only the suggested colour scheme. "
69
+ },
70
+ "80's": {
71
+ "alias": "The icon should have strong and dramatic lighting and have a clean look on white background and should have only the suggested colour scheme. "
72
+ },
73
+ "Digital Art": {
74
+ "alias": "The icon should have strong and dramatic lighting and have a clean look on white background and should have only the suggested colour scheme. "
75
+ },
76
+ "Abstract": {
77
+ "alias": "The icon should have strong and dramatic lighting and have a clean look on white background and should have only the suggested colour scheme. "
78
+ },
79
+ "Realistic": {
80
+ "alias": "The icon should have strong and dramatic lighting and have a clean look on white background and should have only the suggested colour scheme. "
81
+ },
82
+ "Comic Style": {
83
+ "alias": "The icon should have strong and dramatic lighting and have a clean look on white background and should have only the suggested colour scheme. "
84
+ },
85
+ "Fantasy": {
86
+ "alias": "The icon should have strong and dramatic lighting and have a clean look on white background and should have only the suggested colour scheme. "
87
+ },
88
+ "Anime": {
89
+ "alias": ""
90
+ },
91
+ "Minimalist": {
92
+ "alias": ""
93
+ },
94
+ "Pencil Sketch": {
95
+ "alias": ""
96
+ },
97
+ },
98
+ "3D illustration": {
99
+ "Wireframe": {
100
+ "alias": ""
101
+ },
102
+ "Low Poly": {
103
+ "alias": ""
104
+ },
105
+ "Cartoon 3D": {
106
+ "alias": ""
107
+ },
108
+ "Plastic 3D": {
109
+ "alias": ""
110
+ },
111
+ "3D render": {
112
+ "alias": ""
113
+ },
114
+ },
115
+ "Photorealism": {
116
+ "Photorealistic Painting": {
117
+ "alias": ""
118
+ },
119
+ "Photorealistic Drawing": {
120
+ "alias": ""
121
+ },
122
+ "Hyperealism": {
123
+ "alias": ""
124
+ },
125
+ "Photorealism": {
126
+ "alias": ""
127
+ },
128
+ },
129
+ "Vector Art": {
130
+ "Line Art": {
131
+ "alias": ""
132
+ },
133
+ "Cartoon": {
134
+ "alias": ""
135
+ },
136
+ "Vector Kawai": {
137
+ "alias": ""
138
+ },
139
+ "Linocut": {
140
+ "alias": ""
141
+ },
142
+ "Engraving": {
143
+ "alias": ""
144
+ },
145
+ "Doodle Line Art": {
146
+ "alias": ""
147
+ },
148
+ "Geometric": {
149
+ "alias": ""
150
+ },
151
+ "Abstract": {
152
+ "alias": ""
153
+ },
154
+ "Vintage": {
155
+ "alias": ""
156
+ },
157
+ "Minimalist": {
158
+ "alias": ""
159
+ },
160
+ "Stylized": {
161
+ "alias": ""
162
+ },
163
+ "Flat Design": {
164
+ "alias": ""
165
+ },
166
+ }
167
+ }
package/tsconfig.json ADDED
@@ -0,0 +1,11 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es5",
4
+ "module": "commonjs",
5
+ "outDir": "./dist", // Specify your desired output directory
6
+ "strict": true,
7
+ "esModuleInterop": true
8
+ },
9
+ "include": ["src/**/*.ts"],
10
+ "exclude": ["node_modules"]
11
+ }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes