node-server-engine 1.8.0 → 1.9.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.
Files changed (35) hide show
  1. package/README.md +712 -67
  2. package/dist/entities/AWSS3/AWSS3.d.ts +157 -0
  3. package/dist/entities/AWSS3/AWSS3.js +426 -0
  4. package/dist/entities/AWSS3/AWSS3.js.map +1 -0
  5. package/dist/entities/AWSS3/AWSS3.types.d.ts +78 -0
  6. package/dist/entities/AWSS3/AWSS3.types.js +2 -0
  7. package/dist/entities/AWSS3/AWSS3.types.js.map +1 -0
  8. package/dist/entities/AWSS3/index.d.ts +2 -0
  9. package/dist/entities/{Storage → AWSS3}/index.js +8 -8
  10. package/dist/entities/AWSS3/index.js.map +1 -0
  11. package/dist/entities/ElasticSearch/ElasticSearch.d.ts +5 -0
  12. package/dist/entities/ElasticSearch/ElasticSearch.js +137 -38
  13. package/dist/entities/ElasticSearch/ElasticSearch.js.map +1 -1
  14. package/dist/entities/GoogleCloudStorage/GoogleCloudStorage.d.ts +141 -0
  15. package/dist/entities/GoogleCloudStorage/GoogleCloudStorage.js +351 -0
  16. package/dist/entities/GoogleCloudStorage/GoogleCloudStorage.js.map +1 -0
  17. package/dist/entities/{Storage/Storage.types.d.ts → GoogleCloudStorage/GoogleCloudStorage.types.d.ts} +14 -0
  18. package/dist/entities/GoogleCloudStorage/GoogleCloudStorage.types.js +2 -0
  19. package/dist/entities/GoogleCloudStorage/GoogleCloudStorage.types.js.map +1 -0
  20. package/dist/entities/GoogleCloudStorage/index.d.ts +2 -0
  21. package/dist/entities/GoogleCloudStorage/index.js +28 -0
  22. package/dist/entities/GoogleCloudStorage/index.js.map +1 -0
  23. package/dist/entities/Localizator/Localizator.js +2 -2
  24. package/dist/entities/Localizator/Localizator.js.map +1 -1
  25. package/dist/entities/index.d.ts +2 -1
  26. package/dist/entities/index.js +15 -4
  27. package/dist/entities/index.js.map +1 -1
  28. package/package.json +11 -10
  29. package/dist/entities/Storage/Storage.d.ts +0 -38
  30. package/dist/entities/Storage/Storage.js +0 -214
  31. package/dist/entities/Storage/Storage.js.map +0 -1
  32. package/dist/entities/Storage/Storage.types.js +0 -2
  33. package/dist/entities/Storage/Storage.types.js.map +0 -1
  34. package/dist/entities/Storage/index.d.ts +0 -2
  35. package/dist/entities/Storage/index.js.map +0 -1
@@ -0,0 +1,351 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.GoogleCloudStorage = void 0;
8
+ var _crypto = require("crypto");
9
+ var _storage = require("@google-cloud/storage");
10
+ var _filesizeParser = _interopRequireDefault(require("filesize-parser"));
11
+ var _mimeTypes = _interopRequireDefault(require("mime-types"));
12
+ var _WebError = require("../WebError");
13
+ var _report = require("../../utils/report");
14
+ var _trimPathSlash = require("../../utils/trimPathSlash");
15
+ const namespace = 'engine:google-cloud-storage';
16
+
17
+ /**
18
+ * Generic Google Cloud Storage wrapper for easy file operations
19
+ * Provides methods for uploading, downloading, streaming, and deleting files
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * // Initialize with custom configuration
24
+ * GoogleCloudStorage.init({
25
+ * projectId: 'my-project',
26
+ * keyFilename: '/path/to/keyfile.json'
27
+ * });
28
+ *
29
+ * // Upload a file
30
+ * const result = await GoogleCloudStorage.upload(
31
+ * fileStream,
32
+ * 'my-bucket',
33
+ * { directory: 'uploads', mime: 'image/png' }
34
+ * );
35
+ *
36
+ * // Download a file
37
+ * const { data, metadata } = await GoogleCloudStorage.get('my-bucket', 'uploads/file.png');
38
+ *
39
+ * // Delete a file
40
+ * await GoogleCloudStorage.delete('my-bucket', 'uploads/file.png');
41
+ * ```
42
+ */
43
+ const GoogleCloudStorage = exports.GoogleCloudStorage = {
44
+ cloudStorage: null,
45
+ /**
46
+ * Initialize Google Cloud Storage with configuration
47
+ * Call this method before using any other methods
48
+ * @param config - Google Cloud Storage configuration options
49
+ */
50
+ init(config) {
51
+ const storageConfig = {};
52
+ if (config) {
53
+ if (config.projectId) storageConfig.projectId = config.projectId;
54
+ if (config.keyFilename) storageConfig.keyFilename = config.keyFilename;
55
+ if (config.credentials) storageConfig.credentials = config.credentials;
56
+ if (config.apiEndpoint) storageConfig.apiEndpoint = config.apiEndpoint;
57
+ } else {
58
+ // Use environment variables as fallback
59
+ if (process.env.GC_PROJECT) storageConfig.projectId = process.env.GC_PROJECT;
60
+ if (process.env.GOOGLE_APPLICATION_CREDENTIALS) {
61
+ storageConfig.keyFilename = process.env.GOOGLE_APPLICATION_CREDENTIALS;
62
+ }
63
+ }
64
+ this.cloudStorage = new _storage.Storage(storageConfig);
65
+ (0, _report.reportDebug)({
66
+ namespace,
67
+ message: 'Google Cloud Storage initialized',
68
+ data: {
69
+ projectId: storageConfig.projectId
70
+ }
71
+ });
72
+ },
73
+ /**
74
+ * Get the Cloud Storage instance (auto-initializes if needed)
75
+ * @private
76
+ */
77
+ getStorageInstance() {
78
+ if (!this.cloudStorage) {
79
+ this.init();
80
+ }
81
+ return this.cloudStorage;
82
+ },
83
+ /**
84
+ * Upload a file to Google Cloud Storage
85
+ * @param readStream - Readable stream of the file content
86
+ * @param bucket - Bucket name where the file should be stored
87
+ * @param destinationOptions - Options for file destination (directory, fileName, etc.)
88
+ * @param storageOptions - Google Cloud Storage write stream options
89
+ * @param uploaderOptions - Additional options like maxSize
90
+ * @returns Promise with file metadata
91
+ *
92
+ * @example
93
+ * ```typescript
94
+ * const fileStream = fs.createReadStream('photo.jpg');
95
+ * const result = await GoogleCloudStorage.upload(
96
+ * fileStream,
97
+ * 'my-bucket',
98
+ * { directory: 'photos', mime: 'image/jpeg' },
99
+ * { metadata: { contentType: 'image/jpeg' } },
100
+ * { maxSize: '5MB' }
101
+ * );
102
+ * console.log(result.name); // photos/uuid.jpeg
103
+ * ```
104
+ */
105
+ async upload(readStream, bucket, destinationOptions = {}, storageOptions = {}, uploaderOptions = {}) {
106
+ const storage = this.getStorageInstance();
107
+ const {
108
+ maxSize
109
+ } = uploaderOptions;
110
+ let file;
111
+ (0, _report.reportDebug)({
112
+ namespace,
113
+ message: 'Uploading file to storage',
114
+ data: {
115
+ bucket,
116
+ destinationOptions,
117
+ storageOptions,
118
+ uploaderOptions
119
+ }
120
+ });
121
+
122
+ // Generate the file path
123
+ const {
124
+ fileName,
125
+ directory
126
+ } = destinationOptions;
127
+
128
+ // Upload file with given file name
129
+ if (fileName) {
130
+ const trimmedDirectory = (0, _trimPathSlash.trimPathSlash)(directory ?? '/');
131
+ const path = trimmedDirectory ? `${trimmedDirectory}/${fileName}` : fileName;
132
+ file = storage.bucket(bucket).file(path);
133
+ }
134
+ // Generate random destination for file and check that it is not already occupied
135
+ else {
136
+ do {
137
+ const path = this.generateFileDestination(destinationOptions);
138
+ file = storage.bucket(bucket).file(path);
139
+ } while ((await file.exists())[0]);
140
+ }
141
+
142
+ // Pipe user's file stream to the storage
143
+ return new Promise((resolve, reject) => {
144
+ let receivedSize = 0;
145
+ const writeStream = file.createWriteStream(storageOptions);
146
+ const intMaxSize = maxSize && (0, _filesizeParser.default)(maxSize);
147
+
148
+ // Calculate transferred size and write to storage stream
149
+ readStream.on('data', function (data) {
150
+ receivedSize += data.length;
151
+ // Fail if transferred data over max size
152
+ if (intMaxSize && receivedSize > intMaxSize) {
153
+ reject(new _WebError.WebError({
154
+ statusCode: 413,
155
+ errorCode: 'file-too-large',
156
+ message: 'File size exceeds the maximum allowed limit',
157
+ hint: {
158
+ maxSize
159
+ },
160
+ data: {
161
+ bucket,
162
+ destinationOptions,
163
+ storageOptions,
164
+ receivedSize,
165
+ maxSize
166
+ }
167
+ }));
168
+ return;
169
+ }
170
+ writeStream.write(data);
171
+ });
172
+
173
+ // Error handling
174
+ readStream.on('error', err => {
175
+ reject(err);
176
+ });
177
+ writeStream.on('error', err => {
178
+ reject(err);
179
+ });
180
+
181
+ // Graceful termination of the read
182
+ readStream.on('end', () => {
183
+ writeStream.end();
184
+ });
185
+
186
+ // Graceful termination of the write
187
+ writeStream.on('finish', () => {
188
+ (async () => {
189
+ const [metadata] = await file.getMetadata();
190
+ (0, _report.reportDebug)({
191
+ namespace,
192
+ message: 'File uploaded to storage',
193
+ data: metadata
194
+ });
195
+ resolve(metadata);
196
+ })().catch(error => {
197
+ reject(error);
198
+ });
199
+ });
200
+ });
201
+ },
202
+ /**
203
+ * Download a file from Google Cloud Storage and return its content as Buffer
204
+ * @param bucket - Bucket name
205
+ * @param path - File path in the bucket
206
+ * @returns Promise with file data and metadata
207
+ *
208
+ * @example
209
+ * ```typescript
210
+ * const { data, metadata } = await GoogleCloudStorage.get('my-bucket', 'photos/image.jpg');
211
+ * console.log(metadata.size); // File size in bytes
212
+ * console.log(data); // Buffer with file content
213
+ * ```
214
+ */
215
+ async get(bucket, path) {
216
+ const storage = this.getStorageInstance();
217
+ const file = storage.bucket(bucket).file(path);
218
+ const [[metadata], [data]] = await Promise.all([file.getMetadata(), file.download()]);
219
+ (0, _report.reportDebug)({
220
+ namespace,
221
+ message: 'Downloaded file from storage',
222
+ data: {
223
+ bucket,
224
+ path,
225
+ metadata
226
+ }
227
+ });
228
+ return {
229
+ data,
230
+ metadata
231
+ };
232
+ },
233
+ /**
234
+ * Get a readable stream for a file from Google Cloud Storage
235
+ * Use this for large files or when you need to stream the content
236
+ * @param bucket - Bucket name
237
+ * @param path - File path in the bucket
238
+ * @returns Promise with readable stream and metadata
239
+ *
240
+ * @example
241
+ * ```typescript
242
+ * const { stream, metadata } = await GoogleCloudStorage.download('my-bucket', 'videos/video.mp4');
243
+ * stream.pipe(res); // Stream to HTTP response
244
+ * ```
245
+ */
246
+ async download(bucket, path) {
247
+ const storage = this.getStorageInstance();
248
+ const file = storage.bucket(bucket).file(path);
249
+ const [metadata] = await file.getMetadata();
250
+ (0, _report.reportDebug)({
251
+ namespace,
252
+ message: 'Fetched file stream from storage',
253
+ data: {
254
+ bucket,
255
+ path,
256
+ metadata
257
+ }
258
+ });
259
+ return {
260
+ stream: file.createReadStream(),
261
+ metadata
262
+ };
263
+ },
264
+ /**
265
+ * Get a readable stream for a file (without fetching metadata)
266
+ * Use this when you don't need metadata and want faster streaming
267
+ * @param bucket - Bucket name
268
+ * @param path - File path in the bucket
269
+ * @returns Readable stream
270
+ *
271
+ * @example
272
+ * ```typescript
273
+ * const stream = GoogleCloudStorage.getFileStream('my-bucket', 'audio/song.mp3');
274
+ * stream.pipe(res); // Direct streaming without metadata fetch
275
+ * ```
276
+ */
277
+ getFileStream(bucket, path) {
278
+ const storage = this.getStorageInstance();
279
+ const file = storage.bucket(bucket).file(path);
280
+ (0, _report.reportDebug)({
281
+ namespace,
282
+ message: "Fetched file stream from storage's bucket",
283
+ data: {
284
+ bucket,
285
+ path
286
+ }
287
+ });
288
+ return file.createReadStream();
289
+ },
290
+ /**
291
+ * Delete a file from Google Cloud Storage
292
+ * @param bucket - Bucket name
293
+ * @param path - File path in the bucket
294
+ * @returns Promise that resolves when deletion is complete
295
+ *
296
+ * @example
297
+ * ```typescript
298
+ * await GoogleCloudStorage.delete('my-bucket', 'temp/old-file.txt');
299
+ * ```
300
+ */
301
+ async delete(bucket, path) {
302
+ const storage = this.getStorageInstance();
303
+ (0, _report.reportDebug)({
304
+ namespace,
305
+ message: 'Deleting file from storage',
306
+ data: {
307
+ bucket,
308
+ path
309
+ }
310
+ });
311
+ await storage.bucket(bucket).file(path).delete();
312
+ },
313
+ /**
314
+ * Generate a random file path with optional directory and extension
315
+ * Useful for creating unique file names
316
+ * @param options - Options for file destination generation
317
+ * @returns Generated file path
318
+ *
319
+ * @example
320
+ * ```typescript
321
+ * // Generate UUID only
322
+ * const path1 = GoogleCloudStorage.generateFileDestination();
323
+ * // 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'
324
+ *
325
+ * // With directory and MIME type
326
+ * const path2 = GoogleCloudStorage.generateFileDestination({
327
+ * directory: 'uploads/images',
328
+ * mime: 'image/jpeg'
329
+ * });
330
+ * // 'uploads/images/a1b2c3d4-e5f6-7890-abcd-ef1234567890.jpeg'
331
+ * ```
332
+ */
333
+ generateFileDestination(options = {}) {
334
+ const {
335
+ directory = '/',
336
+ mime,
337
+ noExtension = false
338
+ } = options;
339
+
340
+ // Determine file extension from MIME type
341
+ const extension = mime && _mimeTypes.default.extension(mime) ? _mimeTypes.default.extension(mime) : undefined;
342
+
343
+ // Build the full name with or without extension
344
+ const fullName = extension && !noExtension ? `${(0, _crypto.randomUUID)()}.${extension}` : (0, _crypto.randomUUID)();
345
+
346
+ // Clean up directory path
347
+ const trimmedDirectory = (0, _trimPathSlash.trimPathSlash)(directory);
348
+ return `${trimmedDirectory ? `${trimmedDirectory}/` : ''}${fullName}`;
349
+ }
350
+ };
351
+ //# sourceMappingURL=GoogleCloudStorage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GoogleCloudStorage.js","names":["_crypto","require","_storage","_filesizeParser","_interopRequireDefault","_mimeTypes","_WebError","_report","_trimPathSlash","namespace","GoogleCloudStorage","exports","cloudStorage","init","config","storageConfig","projectId","keyFilename","credentials","apiEndpoint","process","env","GC_PROJECT","GOOGLE_APPLICATION_CREDENTIALS","CloudStorage","reportDebug","message","data","getStorageInstance","upload","readStream","bucket","destinationOptions","storageOptions","uploaderOptions","storage","maxSize","file","fileName","directory","trimmedDirectory","trimPathSlash","path","generateFileDestination","exists","Promise","resolve","reject","receivedSize","writeStream","createWriteStream","intMaxSize","fileSizeParser","on","length","WebError","statusCode","errorCode","hint","write","err","end","metadata","getMetadata","catch","error","get","all","download","stream","createReadStream","getFileStream","delete","options","mime","noExtension","extension","mimeTypes","undefined","fullName","randomUUID"],"sources":["../../../src/entities/GoogleCloudStorage/GoogleCloudStorage.ts"],"sourcesContent":["import { randomUUID } from 'crypto';\nimport { Readable } from 'stream';\nimport {\n Storage as CloudStorage,\n CreateWriteStreamOptions,\n File,\n StorageOptions\n} from '@google-cloud/storage';\nimport fileSizeParser from 'filesize-parser';\nimport mimeTypes from 'mime-types';\nimport {\n UploadDestinationOptions,\n StorageUploadedFile,\n UploaderOptions,\n StorageGetResponse,\n StorageDownloadResponse,\n GoogleCloudStorageConfig\n} from './GoogleCloudStorage.types';\nimport { WebError } from 'entities/WebError';\nimport { reportDebug } from 'utils/report';\nimport { trimPathSlash } from 'utils/trimPathSlash';\n\nconst namespace = 'engine:google-cloud-storage';\n\n/**\n * Generic Google Cloud Storage wrapper for easy file operations\n * Provides methods for uploading, downloading, streaming, and deleting files\n * \n * @example\n * ```typescript\n * // Initialize with custom configuration\n * GoogleCloudStorage.init({\n * projectId: 'my-project',\n * keyFilename: '/path/to/keyfile.json'\n * });\n * \n * // Upload a file\n * const result = await GoogleCloudStorage.upload(\n * fileStream,\n * 'my-bucket',\n * { directory: 'uploads', mime: 'image/png' }\n * );\n * \n * // Download a file\n * const { data, metadata } = await GoogleCloudStorage.get('my-bucket', 'uploads/file.png');\n * \n * // Delete a file\n * await GoogleCloudStorage.delete('my-bucket', 'uploads/file.png');\n * ```\n */\nexport const GoogleCloudStorage = {\n cloudStorage: null as CloudStorage | null,\n\n /**\n * Initialize Google Cloud Storage with configuration\n * Call this method before using any other methods\n * @param config - Google Cloud Storage configuration options\n */\n init(config?: GoogleCloudStorageConfig): void {\n const storageConfig: StorageOptions = {};\n\n if (config) {\n if (config.projectId) storageConfig.projectId = config.projectId;\n if (config.keyFilename) storageConfig.keyFilename = config.keyFilename;\n if (config.credentials) storageConfig.credentials = config.credentials;\n if (config.apiEndpoint) storageConfig.apiEndpoint = config.apiEndpoint;\n } else {\n // Use environment variables as fallback\n if (process.env.GC_PROJECT) storageConfig.projectId = process.env.GC_PROJECT;\n if (process.env.GOOGLE_APPLICATION_CREDENTIALS) {\n storageConfig.keyFilename = process.env.GOOGLE_APPLICATION_CREDENTIALS;\n }\n }\n\n this.cloudStorage = new CloudStorage(storageConfig);\n reportDebug({\n namespace,\n message: 'Google Cloud Storage initialized',\n data: { projectId: storageConfig.projectId }\n });\n },\n\n /**\n * Get the Cloud Storage instance (auto-initializes if needed)\n * @private\n */\n getStorageInstance(): CloudStorage {\n if (!this.cloudStorage) {\n this.init();\n }\n return this.cloudStorage!;\n },\n\n /**\n * Upload a file to Google Cloud Storage\n * @param readStream - Readable stream of the file content\n * @param bucket - Bucket name where the file should be stored\n * @param destinationOptions - Options for file destination (directory, fileName, etc.)\n * @param storageOptions - Google Cloud Storage write stream options\n * @param uploaderOptions - Additional options like maxSize\n * @returns Promise with file metadata\n * \n * @example\n * ```typescript\n * const fileStream = fs.createReadStream('photo.jpg');\n * const result = await GoogleCloudStorage.upload(\n * fileStream,\n * 'my-bucket',\n * { directory: 'photos', mime: 'image/jpeg' },\n * { metadata: { contentType: 'image/jpeg' } },\n * { maxSize: '5MB' }\n * );\n * console.log(result.name); // photos/uuid.jpeg\n * ```\n */\n async upload(\n readStream: Readable,\n bucket: string,\n destinationOptions: UploadDestinationOptions = {},\n storageOptions: CreateWriteStreamOptions = {},\n uploaderOptions: UploaderOptions = {}\n ): Promise<StorageUploadedFile> {\n const storage = this.getStorageInstance();\n const { maxSize } = uploaderOptions;\n\n let file: File;\n reportDebug({\n namespace,\n message: 'Uploading file to storage',\n data: { bucket, destinationOptions, storageOptions, uploaderOptions }\n });\n\n // Generate the file path\n const { fileName, directory } = destinationOptions;\n\n // Upload file with given file name\n if (fileName) {\n const trimmedDirectory = trimPathSlash(directory ?? '/');\n const path = trimmedDirectory ? `${trimmedDirectory}/${fileName}` : fileName;\n file = storage.bucket(bucket).file(path);\n }\n // Generate random destination for file and check that it is not already occupied\n else {\n do {\n const path = this.generateFileDestination(destinationOptions);\n file = storage.bucket(bucket).file(path);\n } while ((await file.exists())[0]);\n }\n\n // Pipe user's file stream to the storage\n return new Promise((resolve, reject) => {\n let receivedSize = 0;\n const writeStream = file.createWriteStream(storageOptions);\n const intMaxSize = maxSize && fileSizeParser(maxSize);\n \n // Calculate transferred size and write to storage stream\n readStream.on('data', function (data: Buffer) {\n receivedSize += data.length;\n // Fail if transferred data over max size\n if (intMaxSize && receivedSize > intMaxSize) {\n reject(\n new WebError({\n statusCode: 413,\n errorCode: 'file-too-large',\n message: 'File size exceeds the maximum allowed limit',\n hint: { maxSize },\n data: {\n bucket,\n destinationOptions,\n storageOptions,\n receivedSize,\n maxSize\n }\n })\n );\n return;\n }\n writeStream.write(data);\n });\n \n // Error handling\n readStream.on('error', (err) => {\n reject(err);\n });\n writeStream.on('error', (err) => {\n reject(err);\n });\n \n // Graceful termination of the read\n readStream.on('end', () => {\n writeStream.end();\n });\n \n // Graceful termination of the write\n writeStream.on('finish', () => {\n (async (): Promise<void> => {\n const [metadata] = (await file.getMetadata()) as [\n StorageUploadedFile,\n unknown\n ];\n reportDebug({\n namespace,\n message: 'File uploaded to storage',\n data: metadata\n });\n resolve(metadata);\n })().catch((error) => {\n reject(error);\n });\n });\n });\n },\n\n /**\n * Download a file from Google Cloud Storage and return its content as Buffer\n * @param bucket - Bucket name\n * @param path - File path in the bucket\n * @returns Promise with file data and metadata\n * \n * @example\n * ```typescript\n * const { data, metadata } = await GoogleCloudStorage.get('my-bucket', 'photos/image.jpg');\n * console.log(metadata.size); // File size in bytes\n * console.log(data); // Buffer with file content\n * ```\n */\n async get(bucket: string, path: string): Promise<StorageGetResponse> {\n const storage = this.getStorageInstance();\n const file = storage.bucket(bucket).file(path);\n const [[metadata], [data]] = (await Promise.all([\n file.getMetadata(),\n file.download()\n ])) as [[StorageUploadedFile, unknown], [Buffer]];\n reportDebug({\n namespace,\n message: 'Downloaded file from storage',\n data: { bucket, path, metadata }\n });\n return {\n data,\n metadata\n };\n },\n\n /**\n * Get a readable stream for a file from Google Cloud Storage\n * Use this for large files or when you need to stream the content\n * @param bucket - Bucket name\n * @param path - File path in the bucket\n * @returns Promise with readable stream and metadata\n * \n * @example\n * ```typescript\n * const { stream, metadata } = await GoogleCloudStorage.download('my-bucket', 'videos/video.mp4');\n * stream.pipe(res); // Stream to HTTP response\n * ```\n */\n async download(\n bucket: string,\n path: string\n ): Promise<StorageDownloadResponse> {\n const storage = this.getStorageInstance();\n const file = storage.bucket(bucket).file(path);\n const [metadata] = (await file.getMetadata()) as [\n StorageUploadedFile,\n unknown\n ];\n reportDebug({\n namespace,\n message: 'Fetched file stream from storage',\n data: { bucket, path, metadata }\n });\n return {\n stream: file.createReadStream(),\n metadata\n };\n },\n\n /**\n * Get a readable stream for a file (without fetching metadata)\n * Use this when you don't need metadata and want faster streaming\n * @param bucket - Bucket name\n * @param path - File path in the bucket\n * @returns Readable stream\n * \n * @example\n * ```typescript\n * const stream = GoogleCloudStorage.getFileStream('my-bucket', 'audio/song.mp3');\n * stream.pipe(res); // Direct streaming without metadata fetch\n * ```\n */\n getFileStream(bucket: string, path: string): Readable {\n const storage = this.getStorageInstance();\n const file = storage.bucket(bucket).file(path);\n reportDebug({\n namespace,\n message: \"Fetched file stream from storage's bucket\",\n data: { bucket, path }\n });\n return file.createReadStream();\n },\n\n /**\n * Delete a file from Google Cloud Storage\n * @param bucket - Bucket name\n * @param path - File path in the bucket\n * @returns Promise that resolves when deletion is complete\n * \n * @example\n * ```typescript\n * await GoogleCloudStorage.delete('my-bucket', 'temp/old-file.txt');\n * ```\n */\n async delete(bucket: string, path: string): Promise<void> {\n const storage = this.getStorageInstance();\n reportDebug({\n namespace,\n message: 'Deleting file from storage',\n data: { bucket, path }\n });\n await storage.bucket(bucket).file(path).delete();\n },\n\n /**\n * Generate a random file path with optional directory and extension\n * Useful for creating unique file names\n * @param options - Options for file destination generation\n * @returns Generated file path\n * \n * @example\n * ```typescript\n * // Generate UUID only\n * const path1 = GoogleCloudStorage.generateFileDestination();\n * // 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'\n * \n * // With directory and MIME type\n * const path2 = GoogleCloudStorage.generateFileDestination({\n * directory: 'uploads/images',\n * mime: 'image/jpeg'\n * });\n * // 'uploads/images/a1b2c3d4-e5f6-7890-abcd-ef1234567890.jpeg'\n * ```\n */\n generateFileDestination(options: UploadDestinationOptions = {}): string {\n const { directory = '/', mime, noExtension = false } = options;\n\n // Determine file extension from MIME type\n const extension =\n mime && mimeTypes.extension(mime) ? mimeTypes.extension(mime) : undefined;\n \n // Build the full name with or without extension\n const fullName =\n extension && !noExtension ? `${randomUUID()}.${extension}` : randomUUID();\n \n // Clean up directory path\n const trimmedDirectory = trimPathSlash(directory);\n return `${trimmedDirectory ? `${trimmedDirectory}/` : ''}${fullName}`;\n }\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAD,OAAA;AAMA,IAAAE,eAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,UAAA,GAAAD,sBAAA,CAAAH,OAAA;AASA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,cAAA,GAAAP,OAAA;AAEA,MAAMQ,SAAS,GAAG,6BAA6B;;AAE/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,kBAAkB,GAAAC,OAAA,CAAAD,kBAAA,GAAG;EAChCE,YAAY,EAAE,IAA2B;EAEzC;AACF;AACA;AACA;AACA;EACEC,IAAIA,CAACC,MAAiC,EAAQ;IAC5C,MAAMC,aAA6B,GAAG,CAAC,CAAC;IAExC,IAAID,MAAM,EAAE;MACV,IAAIA,MAAM,CAACE,SAAS,EAAED,aAAa,CAACC,SAAS,GAAGF,MAAM,CAACE,SAAS;MAChE,IAAIF,MAAM,CAACG,WAAW,EAAEF,aAAa,CAACE,WAAW,GAAGH,MAAM,CAACG,WAAW;MACtE,IAAIH,MAAM,CAACI,WAAW,EAAEH,aAAa,CAACG,WAAW,GAAGJ,MAAM,CAACI,WAAW;MACtE,IAAIJ,MAAM,CAACK,WAAW,EAAEJ,aAAa,CAACI,WAAW,GAAGL,MAAM,CAACK,WAAW;IACxE,CAAC,MAAM;MACL;M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E;EACvE;AACF,CAAC","ignoreList":[]}
@@ -1,4 +1,18 @@
1
1
  import { Readable } from 'stream';
2
+ /** Google Cloud Storage initialization configuration */
3
+ export interface GoogleCloudStorageConfig {
4
+ /** Google Cloud Project ID */
5
+ projectId?: string;
6
+ /** Path to service account key file */
7
+ keyFilename?: string;
8
+ /** Service account credentials object */
9
+ credentials?: {
10
+ client_email?: string;
11
+ private_key?: string;
12
+ };
13
+ /** Custom API endpoint (useful for emulators) */
14
+ apiEndpoint?: string;
15
+ }
2
16
  /** Options to set where an uploaded file is stored in the bucket */
3
17
  export interface UploadDestinationOptions {
4
18
  /** Directory of the bucket in which the file is stored. Defaults to the root directory */
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ //# sourceMappingURL=GoogleCloudStorage.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GoogleCloudStorage.types.js","names":[],"sources":["../../../src/entities/GoogleCloudStorage/GoogleCloudStorage.types.ts"],"sourcesContent":["import { Readable } from 'stream';\n\n/** Google Cloud Storage initialization configuration */\nexport interface GoogleCloudStorageConfig {\n /** Google Cloud Project ID */\n projectId?: string;\n /** Path to service account key file */\n keyFilename?: string;\n /** Service account credentials object */\n credentials?: {\n client_email?: string;\n private_key?: string;\n };\n /** Custom API endpoint (useful for emulators) */\n apiEndpoint?: string;\n}\n\n/** Options to set where an uploaded file is stored in the bucket */\nexport interface UploadDestinationOptions {\n /** Directory of the bucket in which the file is stored. Defaults to the root directory */\n directory?: string;\n /** Name under which the file is stored. If specified, the file is stored with that name. Otherwise random name generation is done */\n fileName?: string;\n /** When using random file name generation (ie: fileName is undefined). We use the MIME type to determine which is the best extension to apply to the file */\n mime?: string;\n /** When using random file name generation (ie: fileName is undefined), use this parameter to skip adding an extension to the file */\n noExtension?: boolean;\n}\n\n/** Options of the file uploader */\nexport interface UploaderOptions {\n /** Maximum size of the file (ex: 2MB) */\n maxSize?: string;\n}\n\n/** Object representing a file that has been uploaded */\nexport interface StorageUploadedFile {\n /** Bucket in which the file has been uploaded */\n bucket: string;\n /** Name of the stored object with path */\n name: string;\n /** Content-type of the file */\n contentType: string;\n /** Byte size of the file */\n size: string;\n /** ISO string of the creation date */\n timeCreated: string;\n /** ISO string of the update date */\n updated: string;\n /** MD5 hash of the content */\n md5Hash: string;\n /** CRC32C hash of the content */\n crc32c: string;\n /** Storage class applied */\n storageClass: string;\n}\n\n/** Return type for a file download */\nexport interface StorageGetResponse {\n /** The file raw binary content */\n data: Buffer;\n /** The file's metadata */\n metadata: StorageUploadedFile;\n}\n\n/** Return time for a file streaming fetching */\nexport interface StorageDownloadResponse {\n /** A readable stream with the file's content */\n stream: Readable;\n /** The file's metadata */\n metadata: StorageUploadedFile;\n}\n"],"mappings":"","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ export * from './GoogleCloudStorage';
2
+ export * from './GoogleCloudStorage.types';
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _GoogleCloudStorage = require("./GoogleCloudStorage");
7
+ Object.keys(_GoogleCloudStorage).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _GoogleCloudStorage[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _GoogleCloudStorage[key];
14
+ }
15
+ });
16
+ });
17
+ var _GoogleCloudStorage2 = require("./GoogleCloudStorage.types");
18
+ Object.keys(_GoogleCloudStorage2).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _GoogleCloudStorage2[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _GoogleCloudStorage2[key];
25
+ }
26
+ });
27
+ });
28
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["_GoogleCloudStorage","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_GoogleCloudStorage2"],"sources":["../../../src/entities/GoogleCloudStorage/index.ts"],"sourcesContent":["export * from './GoogleCloudStorage';\nexport * from './GoogleCloudStorage.types';\n"],"mappings":";;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,mBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,mBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,mBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,oBAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,oBAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,oBAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,oBAAA,CAAAL,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
@@ -7,7 +7,7 @@ exports.Localizator = void 0;
7
7
  var _guessNamingConvention = require("./guessNamingConvention");
8
8
  var _EngineError = require("../EngineError");
9
9
  var _LifecycleController = require("../LifecycleController");
10
- var _Storage = require("../Storage");
10
+ var _GoogleCloudStorage = require("../GoogleCloudStorage");
11
11
  var _checkEnvironment = require("../../utils/checkEnvironment");
12
12
  var _envAssert = require("../../utils/envAssert");
13
13
  var _report = require("../../utils/report");
@@ -46,7 +46,7 @@ const Localizator = exports.Localizator = {
46
46
  });
47
47
  const {
48
48
  data
49
- } = await _Storage.Storage.get(process.env.LOCALES_BUCKET, file);
49
+ } = await _GoogleCloudStorage.GoogleCloudStorage.get(process.env.LOCALES_BUCKET, file);
50
50
  const stringified = data.toString('utf-8');
51
51
  const result = JSON.parse(stringified);
52
52
  (0, _report.reportDebug)({
@@ -1 +1 @@
1
- {"version":3,"file":"Localizator.js","names":["_guessNamingConvention","require","_EngineError","_LifecycleController","_Storage","_checkEnvironment","_envAssert","_report","namespace","REFRESH_FREQUENCY","localeData","scripts","interval","Localizator","exports","init","assertEnvironment","LOCALES_BUCKET","envAssert","isString","synchronize","setInterval","catch","error","reportError","LifecycleController","register","getLocaleFile","file","reportDebug","message","data","bucket","process","env","Storage","get","stringified","toString","result","JSON","parse","fetchedLocaleData","fetchedScripts","Promise","all","buildRangeRegex","script","i","Object","keys","ranges","rangeRegex","RegExp","join","guessNamingConvention","firstName","lastName","locale","EngineError","name","getDisplayNames","convention","reduce","type","safeType","replace","trim","getLocaleData","isValidLocale","undefined","shutdown","clearInterval"],"sources":["../../../src/entities/Localizator/Localizator.ts"],"sourcesContent":["import { guessNamingConvention } from './guessNamingConvention';\nimport {\n LocalizatorLocalizationData,\n LocalizatorLocalizationDataElement,\n LocalizatorScripts,\n LocalizatorNamingConventions\n} from './Localizator.types';\nimport { EngineError } from 'entities/EngineError';\nimport { LifecycleController } from 'entities/LifecycleController';\nimport { Storage } from 'entities/Storage';\nimport { assertEnvironment } from 'utils/checkEnvironment';\nimport { envAssert } from 'utils/envAssert';\nimport { reportError, reportDebug } from 'utils/report';\n\nconst namespace = 'engine:localizator';\n\nconst REFRESH_FREQUENCY = 10 * 60 * 1000;\n\nlet localeData: undefined | LocalizatorLocalizationData;\nlet scripts: undefined | LocalizatorScripts;\nlet interval: NodeJS.Timeout | string | number | undefined;\n\n/** Service handling contextual localization */\nexport const Localizator = {\n async init(): Promise<void> {\n assertEnvironment({ LOCALES_BUCKET: envAssert.isString() });\n await Localizator.synchronize();\n // Keep synchronizing\n interval = setInterval(() => {\n Localizator.synchronize().catch((error) => {\n reportError(error);\n });\n }, REFRESH_FREQUENCY);\n LifecycleController.register(Localizator);\n },\n\n /**\n * Fetch a JSON file from the locales bucket\n */\n async getLocaleFile<T>(file: string): Promise<T> {\n reportDebug({\n namespace,\n message: `Starting download of localization file [${file}]`,\n data: { bucket: process.env.LOCALES_BUCKET, file }\n });\n const { data } = await Storage.get(\n process.env.LOCALES_BUCKET as string,\n file\n );\n const stringified = data.toString('utf-8');\n const result = JSON.parse(stringified) as T;\n reportDebug({\n namespace,\n message: `Fetched localization file [${file}]`,\n data: { bucket: process.env.LOCALES_BUCKET, file, result }\n });\n return result;\n },\n\n /**\n * Synchronizes the localeData and scripts files\n * Should be called only once on startup\n */\n async synchronize(): Promise<void> {\n reportDebug({ namespace, message: `Starting synchronizing` });\n const [fetchedLocaleData, fetchedScripts] = await Promise.all([\n Localizator.getLocaleFile<LocalizatorLocalizationData>('localeData.json'),\n Localizator.getLocaleFile<LocalizatorScripts>('scripts.json')\n ]);\n localeData = fetchedLocaleData;\n scripts = Localizator.buildRangeRegex(fetchedScripts);\n reportDebug({ namespace, message: `Finished synchronizing` });\n },\n\n /** Transform unicode ranges in scripts data to regex */\n buildRangeRegex(script: LocalizatorScripts): LocalizatorScripts {\n for (const i of Object.keys(script)) {\n const ranges = script[i].ranges;\n if (ranges) {\n script[i].rangeRegex = new RegExp(`[${ranges.join('')}]`, 'u');\n }\n }\n return script;\n },\n\n /** Guess the naming convention to use for a given name and locale */\n guessNamingConvention(\n firstName: string,\n lastName: string,\n locale: string\n ): LocalizatorNamingConventions {\n if (!scripts || !localeData)\n throw new EngineError({ message: 'Localizator is not initialized' });\n const name = firstName + lastName; // merge two names if possible\n return guessNamingConvention(scripts, localeData, name, locale);\n },\n\n /**\n * Calculate the different display names for a user\n */\n getDisplayNames(\n firstName: string,\n lastName: string,\n locale: string\n ): LocalizatorNamingConventions {\n const convention = Localizator.guessNamingConvention(\n firstName,\n lastName,\n locale\n );\n return Object.keys(convention).reduce((convention, type) => {\n const safeType = type as keyof LocalizatorNamingConventions;\n convention[safeType] = convention[safeType]\n .replace('{firstName}', firstName)\n .replace('{lastName}', lastName ?? '')\n .trim();\n return convention;\n }, convention);\n },\n\n /** Get the localization data for a locale */\n getLocaleData(locale: string): LocalizatorLocalizationDataElement {\n if (!localeData)\n throw new EngineError({ message: 'Localizator is not initialized' });\n return localeData[locale];\n },\n\n /** Check if a locale exists */\n isValidLocale(locale: string): boolean {\n if (!localeData)\n throw new EngineError({ message: 'Localizator is not initialized' });\n return localeData[locale] !== undefined;\n },\n\n /** Cleanup the instance */\n shutdown(): void {\n if (interval) clearInterval(interval);\n }\n};\n"],"mappings":";;;;;;AAAA,IAAAA,sBAAA,GAAAC,OAAA;AAOA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,oBAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAEA,MAAMO,SAAS,GAAG,oBAAoB;AAEtC,MAAMC,iBAAiB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;AAExC,IAAIC,UAAmD;AACvD,IAAIC,OAAuC;AAC3C,IAAIC,QAAsD;;AAE1D;AACO,MAAMC,WAAW,GAAAC,OAAA,CAAAD,WAAA,GAAG;EACzB,MAAME,IAAIA,CAAA,EAAkB;IAC1B,IAAAC,mCAAiB,EAAC;MAAEC,cAAc,EAAEC,oBAAS,CAACC,QAAQ,CAAC;IAAE,CAAC,CAAC;IAC3D,MAAMN,WAAW,CAACO,WAAW,CAAC,CAAC;IAC/B;IACAR,QAAQ,GAAGS,WAAW,CAAC,MAAM;MAC3BR,WAAW,CAACO,WAAW,CAAC,CAAC,CAACE,KAAK,CAAEC,KAAK,IAAK;QACzC,IAAAC,mBAAW,EAACD,KAAK,CAAC;MACpB,CAAC,CAAC;IACJ,CAAC,EAAEd,iBAAiB,CAAC;IACrBgB,wCAAm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CAAC,CACrCU,IAAI,CAAC,CAAC;MACT,OAAOL,UAAU;IACnB,CAAC,EAAEA,UAAU,CAAC;EAChB,CAAC;EAED;EACAM,aAAaA,CAACV,MAAc,EAAsC;IAChE,IAAI,CAAChD,UAAU,EACb,MAAM,IAAIiD,wBAAW,CAAC;MAAE7B,OAAO,EAAE;IAAiC,CAAC,CAAC;IACtE,OAAOpB,UAAU,CAACgD,MAAM,CAAC;EAC3B,CAAC;EAED;EACAW,aAAaA,CAACX,MAAc,EAAW;IACrC,IAAI,CAAChD,UAAU,EACb,MAAM,IAAIiD,wBAAW,CAAC;MAAE7B,OAAO,EAAE;IAAiC,CAAC,CAAC;IACtE,OAAOpB,UAAU,CAACgD,MAAM,CAAC,KAAKY,SAAS;EACzC,CAAC;EAED;EACAC,QAAQA,CAAA,EAAS;IACf,IAAI3D,QAAQ,EAAE4D,aAAa,CAAC5D,QAAQ,CAAC;EACvC;AACF,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"Localizator.js","names":["_guessNamingConvention","require","_EngineError","_LifecycleController","_GoogleCloudStorage","_checkEnvironment","_envAssert","_report","namespace","REFRESH_FREQUENCY","localeData","scripts","interval","Localizator","exports","init","assertEnvironment","LOCALES_BUCKET","envAssert","isString","synchronize","setInterval","catch","error","reportError","LifecycleController","register","getLocaleFile","file","reportDebug","message","data","bucket","process","env","GoogleCloudStorage","get","stringified","toString","result","JSON","parse","fetchedLocaleData","fetchedScripts","Promise","all","buildRangeRegex","script","i","Object","keys","ranges","rangeRegex","RegExp","join","guessNamingConvention","firstName","lastName","locale","EngineError","name","getDisplayNames","convention","reduce","type","safeType","replace","trim","getLocaleData","isValidLocale","undefined","shutdown","clearInterval"],"sources":["../../../src/entities/Localizator/Localizator.ts"],"sourcesContent":["import { guessNamingConvention } from './guessNamingConvention';\nimport {\n LocalizatorLocalizationData,\n LocalizatorLocalizationDataElement,\n LocalizatorScripts,\n LocalizatorNamingConventions\n} from './Localizator.types';\nimport { EngineError } from 'entities/EngineError';\nimport { LifecycleController } from 'entities/LifecycleController';\nimport { GoogleCloudStorage } from 'entities/GoogleCloudStorage';\nimport { assertEnvironment } from 'utils/checkEnvironment';\nimport { envAssert } from 'utils/envAssert';\nimport { reportError, reportDebug } from 'utils/report';\n\nconst namespace = 'engine:localizator';\n\nconst REFRESH_FREQUENCY = 10 * 60 * 1000;\n\nlet localeData: undefined | LocalizatorLocalizationData;\nlet scripts: undefined | LocalizatorScripts;\nlet interval: NodeJS.Timeout | string | number | undefined;\n\n/** Service handling contextual localization */\nexport const Localizator = {\n async init(): Promise<void> {\n assertEnvironment({ LOCALES_BUCKET: envAssert.isString() });\n await Localizator.synchronize();\n // Keep synchronizing\n interval = setInterval(() => {\n Localizator.synchronize().catch((error) => {\n reportError(error);\n });\n }, REFRESH_FREQUENCY);\n LifecycleController.register(Localizator);\n },\n\n /**\n * Fetch a JSON file from the locales bucket\n */\n async getLocaleFile<T>(file: string): Promise<T> {\n reportDebug({\n namespace,\n message: `Starting download of localization file [${file}]`,\n data: { bucket: process.env.LOCALES_BUCKET, file }\n });\n const { data } = await GoogleCloudStorage.get(\n process.env.LOCALES_BUCKET as string,\n file\n );\n const stringified = data.toString('utf-8');\n const result = JSON.parse(stringified) as T;\n reportDebug({\n namespace,\n message: `Fetched localization file [${file}]`,\n data: { bucket: process.env.LOCALES_BUCKET, file, result }\n });\n return result;\n },\n\n /**\n * Synchronizes the localeData and scripts files\n * Should be called only once on startup\n */\n async synchronize(): Promise<void> {\n reportDebug({ namespace, message: `Starting synchronizing` });\n const [fetchedLocaleData, fetchedScripts] = await Promise.all([\n Localizator.getLocaleFile<LocalizatorLocalizationData>('localeData.json'),\n Localizator.getLocaleFile<LocalizatorScripts>('scripts.json')\n ]);\n localeData = fetchedLocaleData;\n scripts = Localizator.buildRangeRegex(fetchedScripts);\n reportDebug({ namespace, message: `Finished synchronizing` });\n },\n\n /** Transform unicode ranges in scripts data to regex */\n buildRangeRegex(script: LocalizatorScripts): LocalizatorScripts {\n for (const i of Object.keys(script)) {\n const ranges = script[i].ranges;\n if (ranges) {\n script[i].rangeRegex = new RegExp(`[${ranges.join('')}]`, 'u');\n }\n }\n return script;\n },\n\n /** Guess the naming convention to use for a given name and locale */\n guessNamingConvention(\n firstName: string,\n lastName: string,\n locale: string\n ): LocalizatorNamingConventions {\n if (!scripts || !localeData)\n throw new EngineError({ message: 'Localizator is not initialized' });\n const name = firstName + lastName; // merge two names if possible\n return guessNamingConvention(scripts, localeData, name, locale);\n },\n\n /**\n * Calculate the different display names for a user\n */\n getDisplayNames(\n firstName: string,\n lastName: string,\n locale: string\n ): LocalizatorNamingConventions {\n const convention = Localizator.guessNamingConvention(\n firstName,\n lastName,\n locale\n );\n return Object.keys(convention).reduce((convention, type) => {\n const safeType = type as keyof LocalizatorNamingConventions;\n convention[safeType] = convention[safeType]\n .replace('{firstName}', firstName)\n .replace('{lastName}', lastName ?? '')\n .trim();\n return convention;\n }, convention);\n },\n\n /** Get the localization data for a locale */\n getLocaleData(locale: string): LocalizatorLocalizationDataElement {\n if (!localeData)\n throw new EngineError({ message: 'Localizator is not initialized' });\n return localeData[locale];\n },\n\n /** Check if a locale exists */\n isValidLocale(locale: string): boolean {\n if (!localeData)\n throw new EngineError({ message: 'Localizator is not initialized' });\n return localeData[locale] !== undefined;\n },\n\n /** Cleanup the instance */\n shutdown(): void {\n if (interval) clearInterval(interval);\n }\n};\n"],"mappings":";;;;;;AAAA,IAAAA,sBAAA,GAAAC,OAAA;AAOA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,oBAAA,GAAAF,OAAA;AACA,IAAAG,mBAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAEA,MAAMO,SAAS,GAAG,oBAAoB;AAEtC,MAAMC,iBAAiB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI;AAExC,IAAIC,UAAmD;AACvD,IAAIC,O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AC;EACjE,CAAC;EAED;AACF;AACA;EACEG,eAAeA,CACbL,SAAiB,EACjBC,QAAgB,EAChBC,MAAc,EACgB;IAC9B,MAAMI,UAAU,GAAGjD,WAAW,CAAC0C,qBAAqB,CAClDC,SAAS,EACTC,QAAQ,EACRC,MACF,CAAC;IACD,OAAOT,MAAM,CAACC,IAAI,CAACY,UAAU,CAAC,CAACC,MAAM,CAAC,CAACD,UAAU,EAAEE,IAAI,KAAK;MAC1D,MAAMC,QAAQ,GAAGD,IAA0C;MAC3DF,UAAU,CAACG,QAAQ,CAAC,GAAGH,UAAU,CAACG,QAAQ,CAAC,CACxCC,OAAO,CAAC,aAAa,EAAEV,SAAS,CAAC,CACjCU,OAAO,CAAC,YAAY,EAAET,QAAQ,IAAI,EAAE,CAAC,CACrCU,IAAI,CAAC,CAAC;MACT,OAAOL,UAAU;IACnB,CAAC,EAAEA,UAAU,CAAC;EAChB,CAAC;EAED;EACAM,aAAaA,CAACV,MAAc,EAAsC;IAChE,IAAI,CAAChD,UAAU,EACb,MAAM,IAAIiD,wBAAW,CAAC;MAAE7B,OAAO,EAAE;IAAiC,CAAC,CAAC;IACtE,OAAOpB,UAAU,CAACgD,MAAM,CAAC;EAC3B,CAAC;EAED;EACAW,aAAaA,CAACX,MAAc,EAAW;IACrC,IAAI,CAAChD,UAAU,EACb,MAAM,IAAIiD,wBAAW,CAAC;MAAE7B,OAAO,EAAE;IAAiC,CAAC,CAAC;IACtE,OAAOpB,UAAU,CAACgD,MAAM,CAAC,KAAKY,SAAS;EACzC,CAAC;EAED;EACAC,QAAQA,CAAA,EAAS;IACf,IAAI3D,QAAQ,EAAE4D,aAAa,CAAC5D,QAAQ,CAAC;EACvC;AACF,CAAC","ignoreList":[]}
@@ -8,7 +8,8 @@ export * from './SocketClient';
8
8
  export * from './Server';
9
9
  export * from './Redis';
10
10
  export * from './Localizator';
11
- export * from './Storage';
11
+ export * from './GoogleCloudStorage';
12
+ export * from './AWSS3';
12
13
  export * from './Sequelize';
13
14
  export * from './ElasticSearch';
14
15
  export * from './LifecycleController';
@@ -113,14 +113,25 @@ Object.keys(_Localizator).forEach(function (key) {
113
113
  }
114
114
  });
115
115
  });
116
- var _Storage = require("./Storage");
117
- Object.keys(_Storage).forEach(function (key) {
116
+ var _GoogleCloudStorage = require("./GoogleCloudStorage");
117
+ Object.keys(_GoogleCloudStorage).forEach(function (key) {
118
118
  if (key === "default" || key === "__esModule") return;
119
- if (key in exports && exports[key] === _Storage[key]) return;
119
+ if (key in exports && exports[key] === _GoogleCloudStorage[key]) return;
120
120
  Object.defineProperty(exports, key, {
121
121
  enumerable: true,
122
122
  get: function () {
123
- return _Storage[key];
123
+ return _GoogleCloudStorage[key];
124
+ }
125
+ });
126
+ });
127
+ var _AWSS = require("./AWSS3");
128
+ Object.keys(_AWSS).forEach(function (key) {
129
+ if (key === "default" || key === "__esModule") return;
130
+ if (key in exports && exports[key] === _AWSS[key]) return;
131
+ Object.defineProperty(exports, key, {
132
+ enumerable: true,
133
+ get: function () {
134
+ return _AWSS[key];
124
135
  }
125
136
  });
126
137
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_EngineError","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_WebError","_ValidationError","_KeySet","_Endpoint","_MessageHandler","_SocketClient","_Server","_Redis","_Localizator","_Storage","_Sequelize","_ElasticSearch","_LifecycleController","_PubSub","_PushNotification"],"sources":["../../src/entities/index.ts"],"sourcesContent":["export * from './EngineError';\nexport * from './WebError';\nexport * from './ValidationError';\nexport * from './KeySet';\nexport * from './Endpoint';\nexport * from './MessageHandler';\nexport * from './SocketClient';\nexport * from './Server';\nexport * from './Redis';\nexport * from './Localizator';\nexport * from './Storage';\nexport * from './Sequelize';\nexport * from './ElasticSearch';\nexport * from './LifecycleController';\nexport * from './PubSub';\nexport * from './PushNotification';\n"],"mappings":";;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,YAAA,EAAA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C,GAAA,WAAAA,CAAA;MAAA,OAAAa,oBAAA,CAAAjB,GAAA;IAAA;EAAA;AAAA;AACA,IAAAkB,OAAA,GAAAtB,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAoB,OAAA,EAAAnB,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAkB,OAAA,CAAAlB,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAc,OAAA,CAAAlB,GAAA;IAAA;EAAA;AAAA;AACA,IAAAmB,iBAAA,GAAAvB,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAqB,iBAAA,EAAApB,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAmB,iBAAA,CAAAnB,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAe,iBAAA,CAAAnB,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_EngineError","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_WebError","_ValidationError","_KeySet","_Endpoint","_MessageHandler","_SocketClient","_Server","_Redis","_Localizator","_GoogleCloudStorage","_AWSS","_Sequelize","_ElasticSearch","_LifecycleController","_PubSub","_PushNotification"],"sources":["../../src/entities/index.ts"],"sourcesContent":["export * from './EngineError';\nexport * from './WebError';\nexport * from './ValidationError';\nexport * from './KeySet';\nexport * from './Endpoint';\nexport * from './MessageHandler';\nexport * from './SocketClient';\nexport * from './Server';\nexport * from './Redis';\nexport * from './Localizator';\nexport * from './GoogleCloudStorage';\nexport * from './AWSS3';\nexport * from './Sequelize';\nexport * from './ElasticSearch';\nexport * from './LifecycleController';\nexport * from './PubSub';\nexport * from './PushNotification';\n"],"mappings":";;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,YAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,YAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,YAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,SAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,SAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,SAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,SAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,gBAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,gBAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,gBAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,gBAAA,CAAAN,GAAA;IAAA;EAAA;AAAA;AACA,IAAAO,OAAA,GAAAX,OAAA;AAAAC,M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