node-server-engine 1.8.0 → 1.10.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 (40) hide show
  1. package/.nycrc +8 -4
  2. package/README.md +712 -67
  3. package/dist/entities/AWSS3/AWSS3.d.ts +157 -0
  4. package/dist/entities/AWSS3/AWSS3.js +426 -0
  5. package/dist/entities/AWSS3/AWSS3.js.map +1 -0
  6. package/dist/entities/AWSS3/AWSS3.types.d.ts +78 -0
  7. package/dist/entities/AWSS3/AWSS3.types.js +2 -0
  8. package/dist/entities/AWSS3/AWSS3.types.js.map +1 -0
  9. package/dist/entities/AWSS3/index.d.ts +2 -0
  10. package/dist/entities/{Storage → AWSS3}/index.js +8 -8
  11. package/dist/entities/AWSS3/index.js.map +1 -0
  12. package/dist/entities/ElasticSearch/ElasticSearch.d.ts +5 -0
  13. package/dist/entities/ElasticSearch/ElasticSearch.js +137 -38
  14. package/dist/entities/ElasticSearch/ElasticSearch.js.map +1 -1
  15. package/dist/entities/GoogleCloudStorage/GoogleCloudStorage.d.ts +141 -0
  16. package/dist/entities/GoogleCloudStorage/GoogleCloudStorage.js +351 -0
  17. package/dist/entities/GoogleCloudStorage/GoogleCloudStorage.js.map +1 -0
  18. package/dist/entities/{Storage/Storage.types.d.ts → GoogleCloudStorage/GoogleCloudStorage.types.d.ts} +14 -0
  19. package/dist/entities/GoogleCloudStorage/GoogleCloudStorage.types.js +2 -0
  20. package/dist/entities/GoogleCloudStorage/GoogleCloudStorage.types.js.map +1 -0
  21. package/dist/entities/GoogleCloudStorage/index.d.ts +2 -0
  22. package/dist/entities/GoogleCloudStorage/index.js +28 -0
  23. package/dist/entities/GoogleCloudStorage/index.js.map +1 -0
  24. package/dist/entities/Localizator/Localizator.js +2 -2
  25. package/dist/entities/Localizator/Localizator.js.map +1 -1
  26. package/dist/entities/Sequelize/Sequelize.config.js +7 -5
  27. package/dist/entities/Sequelize/Sequelize.config.js.map +1 -1
  28. package/dist/entities/Sequelize/Sequelize.js +29 -4
  29. package/dist/entities/Sequelize/Sequelize.js.map +1 -1
  30. package/dist/entities/index.d.ts +2 -1
  31. package/dist/entities/index.js +15 -4
  32. package/dist/entities/index.js.map +1 -1
  33. package/package.json +14 -12
  34. package/dist/entities/Storage/Storage.d.ts +0 -38
  35. package/dist/entities/Storage/Storage.js +0 -214
  36. package/dist/entities/Storage/Storage.js.map +0 -1
  37. package/dist/entities/Storage/Storage.types.js +0 -2
  38. package/dist/entities/Storage/Storage.types.js.map +0 -1
  39. package/dist/entities/Storage/index.d.ts +0 -2
  40. package/dist/entities/Storage/index.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Sequelize.js","names":["_sequelizeTypescript","require","_Sequelize","_interopRequireDefault","_Sequelize2","_EngineError","_LifecycleController","_report","sequelizeClient","exports","sequelize","Proxy","get","target","property","init","shutdown","addModels","EngineError","message","createSequelizeClient","authenticate","then","reportInfo","catch","err","reportError","LifecycleController","register","close","undefined","models","sync","validateSequelizeEnvironment","Sequelize","process","env","SQL_DB","SQL_USER","SQL_PASSWORD","dbConfig"],"sources":["../../../src/entities/Sequelize/Sequelize.ts"],"sourcesContent":["import { Sequelize, ModelCtor } from 'sequelize-typescript';\nimport dbConfig from './Sequelize.config';\nimport { Sequelize as SequelizeInterface } from './Sequelize.types';\nimport { validateSequelizeEnvironment } from './Sequelize.validate';\nimport { EngineError } from 'entities/EngineError';\nimport { LifecycleController } from 'entities/LifecycleController';\nimport { reportInfo, reportError } from 'utils/report';\n\nexport let sequelizeClient: undefined | Sequelize;\n\n/**\n * We use a proxy to extend the Sequelize behavior and allow initialization of the client only when needed while keeping the same interface\n */\nexport const sequelize = new Proxy<SequelizeInterface>(\n // Due to how we do the proxying, we are forced to ignore ts-errors, we could never create an object that respects the interface properly\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n {},\n {\n get: function (target, property): unknown {\n if (property === 'init') return init;\n if (property === 'shutdown') return shutdown;\n if (property === 'addModels') return addModels;\n // Create the sequelize client if it does not exist\n if (!sequelizeClient)\n throw new EngineError({\n message: 'Sequelize client was not initialized'\n });\n // Call the function on the sequelize client\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return sequelizeClient[property] as unknown;\n }\n }\n);\n\n/** On init create client and connect */\nexport function init(): void {\n // Ignore if already initialized\n if (sequelizeClient) return;\n sequelizeClient = createSequelizeClient();\n sequelizeClient\n .authenticate()\n .then(() => reportInfo({ message: 'Connected to database successfully' }))\n .catch((err: Error) => reportError(err));\n LifecycleController.register(sequelize);\n}\n\n/** On shutdown close connection and clear client */\nexport async function shutdown(): Promise<void> {\n if (sequelizeClient) await sequelizeClient.close();\n sequelizeClient = undefined;\n}\n\nexport function addModels(models: Array<ModelCtor>): void {\n if (!sequelizeClient)\n throw new EngineError({\n message: 'Sequelize client was not initialized'\n });\n sequelizeClient.addModels(models);\n sequelizeClient.sync();\n}\n\n/** Create Sequelize client */\nexport function createSequelizeClient(): Sequelize {\n // Throw an error if there is no host initial\n validateSequelizeEnvironment();\n return new Sequelize(\n process.env.SQL_DB as string,\n process.env.SQL_USER as string,\n process.env.SQL_PASSWORD as string,\n dbConfig\n );\n}\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,oBAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,oBAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAEO,IAAIO,eAAsC,GAAAC,OAAA,CAAAD,eAAA;;AAEjD;AACA;AACA;AACO,MAAME,SAAS,GAAAD,OAAA,CAAAC,SAAA,GAAG,IAAIC,KAAK;AAChC;AACA;AACA;AACA,CAAC,CAAC,EACF;EACEC,GAAG,EAAE,SAAAA,CAAUC,MAAM,EAAEC,QAAQ,EAAW;IACxC,IAAIA,QAAQ,KAA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F,OAAO,CAACC,GAAG,CAACE,QAAQ,EACpBH,OAAO,CAACC,GAAG,CAACG,YAAY,EACxBC,kBACF,CAAC;AACH","ignoreList":[]}
1
+ {"version":3,"file":"Sequelize.js","names":["_sequelizeTypescript","require","_Sequelize","_interopRequireDefault","_Sequelize2","_EngineError","_LifecycleController","_report","sequelizeClient","exports","sequelize","Proxy","get","target","property","init","shutdown","addModels","EngineError","message","createSequelizeClient","process","env","NODE_ENV","authenticate","then","reportInfo","catch","err","reportError","LifecycleController","register","close","error","console","undefined","models","sync","Sequelize","dialect","storage","logging","validateSequelizeEnvironment","SQL_DB","SQL_USER","SQL_PASSWORD","dbConfig"],"sources":["../../../src/entities/Sequelize/Sequelize.ts"],"sourcesContent":["import { Sequelize, ModelCtor } from 'sequelize-typescript';\nimport dbConfig from './Sequelize.config';\nimport { Sequelize as SequelizeInterface } from './Sequelize.types';\nimport { validateSequelizeEnvironment } from './Sequelize.validate';\nimport { EngineError } from 'entities/EngineError';\nimport { LifecycleController } from 'entities/LifecycleController';\nimport { reportInfo, reportError } from 'utils/report';\n\nexport let sequelizeClient: undefined | Sequelize;\n\n/**\n * We use a proxy to extend the Sequelize behavior and allow initialization of the client only when needed while keeping the same interface\n */\nexport const sequelize = new Proxy<SequelizeInterface>(\n // Due to how we do the proxying, we are forced to ignore ts-errors, we could never create an object that respects the interface properly\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n {},\n {\n get: function (target, property): unknown {\n if (property === 'init') return init;\n if (property === 'shutdown') return shutdown;\n if (property === 'addModels') return addModels;\n // Create the sequelize client if it does not exist\n if (!sequelizeClient)\n throw new EngineError({\n message: 'Sequelize client was not initialized'\n });\n // Call the function on the sequelize client\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return sequelizeClient[property] as unknown;\n }\n }\n);\n\n/** On init create client and connect */\nexport function init(): void {\n // Ignore if already initialized\n if (sequelizeClient) return;\n sequelizeClient = createSequelizeClient();\n \n // In test environment, authentication happens automatically with SQLite\n // For other environments, authenticate and log the result\n if (process.env.NODE_ENV !== 'test') {\n void sequelizeClient\n .authenticate()\n .then(() => reportInfo({ message: 'Connected to database successfully' }))\n .catch((err: Error) => reportError(err));\n }\n \n LifecycleController.register(sequelize);\n}\n\n/** On shutdown close connection and clear client */\nexport async function shutdown(): Promise<void> {\n if (sequelizeClient) {\n try {\n // For SQLite, just close the client (closing connection manager first causes SQLITE_MISUSE)\n // For other dialects, sequelize.close() handles everything properly\n await sequelizeClient.close();\n } catch (error) {\n // Ignore errors during shutdown\n if (process.env.NODE_ENV !== 'test') {\n console.error('Error closing sequelize client:', error);\n }\n }\n }\n sequelizeClient = undefined;\n}\n\nexport function addModels(models: Array<ModelCtor>): void {\n if (!sequelizeClient)\n throw new EngineError({\n message: 'Sequelize client was not initialized'\n });\n sequelizeClient.addModels(models);\n sequelizeClient.sync();\n}\n\n/** Create Sequelize client */\nexport function createSequelizeClient(): Sequelize {\n // Use in-memory SQLite for test environment to avoid real database connections\n if (process.env.NODE_ENV === 'test') {\n return new Sequelize({\n dialect: 'sqlite',\n storage: ':memory:',\n logging: false\n });\n }\n \n // Throw an error if there is no host initial\n validateSequelizeEnvironment();\n return new Sequelize(\n process.env.SQL_DB as string,\n process.env.SQL_USER as string,\n process.env.SQL_PASSWORD as string,\n dbConfig\n );\n}\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,oBAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,oBAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAEO,IAAIO,eAAsC,GAAAC,OAAA,CAAAD,eAAA;;AAEjD;AACA;AACA;AACO,MAAME,SAAS,GAAAD,OAAA,CAAAC,SAAA,GAAG,IAAIC,KAAK;AAChC;AACA;AACA;AACA,CAAC,CAAC,EACF;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AAC7B;AAEO,SAASlB,SAASA,CAACmB,MAAwB,EAAQ;EACxD,IAAI,CAAC5B,eAAe,EAClB,MAAM,IAAIU,wBAAW,CAAC;IACpBC,OAAO,EAAE;EACX,CAAC,CAAC;EACJX,eAAe,CAACS,SAAS,CAACmB,MAAM,CAAC;EACjC5B,eAAe,CAAC6B,IAAI,CAAC,CAAC;AACxB;;AAEA;AACO,SAASjB,qBAAqBA,CAAA,EAAc;EACjD;EACA,IAAIC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,MAAM,EAAE;IACnC,OAAO,IAAIe,8BAAS,CAAC;MACnBC,OAAO,EAAE,QAAQ;MACjBC,OAAO,EAAE,UAAU;MACnBC,OAAO,EAAE;IACX,CAAC,CAAC;EACJ;;EAEA;EACA,IAAAC,wCAA4B,EAAC,CAAC;EAC9B,OAAO,IAAIJ,8BAAS,CAClBjB,OAAO,CAACC,GAAG,CAACqB,MAAM,EAClBtB,OAAO,CAACC,GAAG,CAACsB,QAAQ,EACpBvB,OAAO,CAACC,GAAG,CAACuB,YAAY,EACxBC,kBACF,CAAC;AACH","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,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;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AA,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;IAAA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kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAkB,oBAAA,CAAAlB,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAc,oBAAA,CAAAlB,GAAA;IAAA;EAAA;AAAA;AACA,IAAAmB,OAAA,GAAAvB,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAqB,OAAA,EAAApB,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAmB,OAAA,CAAAnB,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAe,OAAA,CAAAnB,GAAA;IAAA;EAAA;AAAA;AACA,IAAAoB,iBAAA,GAAAxB,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAsB,iBAAA,EAAArB,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAoB,iBAAA,CAAApB,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAgB,iBAAA,CAAApB,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-server-engine",
3
- "version": "1.8.0",
3
+ "version": "1.10.0",
4
4
  "description": "Framework used to develop backend services. This package ships with a lot of features to standardize the creation of services, letting you focus on the business logic.",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -11,8 +11,8 @@
11
11
  "lint:fix": "eslint ./src --fix",
12
12
  "prepublish": "npm run build",
13
13
  "prepublishOnly": "npm run build",
14
- "test": "cross-env NODE_ENV=test TS_NODE_PROJECT=tsconfig.test.json mocha --require ts-node/register --require tsconfig-paths/register --reporter spec --timeout 10000 --exit test/hooks.ts 'src/**/*.test.ts'",
15
- "test:coverage": "cross-env NODE_ENV=test TS_NODE_PROJECT=tsconfig.test.json nyc --reporter=text --no-clean mocha --require ts-node/register --require tsconfig-paths/register --reporter spec test/hooks.ts 'src/**/*.test.ts'",
14
+ "test": "cross-env NODE_ENV=test TS_NODE_PROJECT=tsconfig.test.json mocha --require ts-node/register --require tsconfig-paths/register --reporter spec --timeout 10000 --exit --full-trace test/hooks.ts 'src/**/*.test.ts'",
15
+ "test:coverage": "cross-env NODE_ENV=test TS_NODE_PROJECT=tsconfig.test.json nyc --reporter=text --no-clean mocha --require ts-node/register --require tsconfig-paths/register --reporter spec --full-trace test/hooks.ts 'src/**/*.test.ts'",
16
16
  "test:file": "cross-env NODE_ENV=test TS_NODE_PROJECT=tsconfig.test.json mocha --require ts-node/register --require tsconfig-paths/register --reporter spec --exit test/hooks.ts",
17
17
  "coverage": "nyc report --report-dir=./.test-coverage --reporter=html --reporter=text",
18
18
  "coverage:ci": "nyc report --reporter=text-summary",
@@ -44,15 +44,16 @@
44
44
  },
45
45
  "homepage": "https://github.com/prakashmahendran/node-server-engine#readme",
46
46
  "dependencies": {
47
+ "@aws-sdk/client-s3": "^3.948.0",
47
48
  "@babel/runtime": "^7.26.0",
48
- "@elastic/elasticsearch": "^8.17.0",
49
- "@google-cloud/pubsub": "^4.9.0",
49
+ "@elastic/elasticsearch": "^9.2.0",
50
+ "@google-cloud/pubsub": "^4.11.0",
50
51
  "@google-cloud/secret-manager": "^6.1.0",
51
52
  "@google-cloud/storage": "^7.14.0",
52
- "@google/generative-ai": "^0.21.0",
53
+ "@google/generative-ai": "^0.24.1",
53
54
  "ajv": "^8.17.1",
54
55
  "axios": "^1.7.9",
55
- "backend-test-tools": "^1.1.2",
56
+ "backend-test-tools": "^1.2.0",
56
57
  "bytes": "^3.1.2",
57
58
  "callsite": "^1.0.0",
58
59
  "cors": "^2.8.5",
@@ -76,7 +77,7 @@
76
77
  "sequelize-typescript": "^2.1.6",
77
78
  "swagger-ui-express": "^5.0.1",
78
79
  "validator": "^13.12.0",
79
- "ws": "^8.18.0",
80
+ "ws": "^8.18.3",
80
81
  "yamljs": "^0.3.0"
81
82
  },
82
83
  "devDependencies": {
@@ -88,10 +89,10 @@
88
89
  "@babel/preset-env": "^7.26.0",
89
90
  "@babel/preset-typescript": "^7.26.0",
90
91
  "@babel/register": "^7.25.9",
91
- "@commitlint/cli": "^19.8.1",
92
- "@commitlint/config-conventional": "^19.8.1",
93
- "@faker-js/faker": "^9.3.0",
94
- "@google-cloud/precise-date": "^4.0.0",
92
+ "@commitlint/cli": "^20.2.0",
93
+ "@commitlint/config-conventional": "^20.2.0",
94
+ "@faker-js/faker": "^10.1.0",
95
+ "@google-cloud/precise-date": "^5.0.0",
95
96
  "@semantic-release/changelog": "^6.0.3",
96
97
  "@semantic-release/git": "^10.0.1",
97
98
  "@types/busboy": "^1.5.4",
@@ -148,6 +149,7 @@
148
149
  "shx": "^0.3.4",
149
150
  "sinon": "^19.0.2",
150
151
  "sinon-chai": "^3.5.0",
152
+ "sqlite3": "^5.1.7",
151
153
  "supertest": "^7.0.0",
152
154
  "tmp": "^0.2.4",
153
155
  "ts-node": "^10.9.2",
@@ -1,38 +0,0 @@
1
- import { Readable } from 'stream';
2
- import { Storage as CloudStorage, CreateWriteStreamOptions } from '@google-cloud/storage';
3
- import { UploadDestinationOptions, StorageUploadedFile, UploaderOptions, StorageGetResponse, StorageDownloadResponse } from './Storage.types';
4
- export declare const Storage: {
5
- cloudStorage: CloudStorage;
6
- /**
7
- * Upload a file to the cloud storage
8
- * @param readStream - Stream of the file content
9
- * @param bucket - Bucket in which the file should be stored
10
- * @param destinationOptions - Options for the destination generator [see: generateFileDestination(options)]
11
- * @param storageOptions - Storage library options
12
- * @param uploaderOptions - Options for this service's specific behavior
13
- * @return {Promise<Object>} - Details regarding the uploaded file's metadata
14
- */
15
- upload(readStream: Readable, bucket: string, destinationOptions?: UploadDestinationOptions, storageOptions?: CreateWriteStreamOptions, uploaderOptions?: UploaderOptions): Promise<StorageUploadedFile>;
16
- /**
17
- * Return the read stream for a given file and bucket
18
- */
19
- get(bucket: string, path: string): Promise<StorageGetResponse>;
20
- /**
21
- * Return the read stream for a given file and bucket
22
- */
23
- download(bucket: string, path: string): Promise<StorageDownloadResponse>;
24
- /**
25
- * Return the read stream for a given file path and bucket
26
- * @param {String} bucket
27
- * @param {String} path
28
- */
29
- getFileStream(bucket: string, path: string): Readable;
30
- /**
31
- * Delete a file from the cloud storage
32
- */
33
- delete(bucket: string, path: string): Promise<void>;
34
- /**
35
- * Builds the full file path on the cloud and generates it a random name
36
- */
37
- generateFileDestination(options?: UploadDestinationOptions): string;
38
- };
@@ -1,214 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.Storage = 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:storage';
16
- const Storage = exports.Storage = {
17
- cloudStorage: new _storage.Storage({
18
- projectId: process.env.GC_PROJECT,
19
- keyFilename: process.env.GOOGLE_APPLICATION_CREDENTIALS
20
- }),
21
- /**
22
- * Upload a file to the cloud storage
23
- * @param readStream - Stream of the file content
24
- * @param bucket - Bucket in which the file should be stored
25
- * @param destinationOptions - Options for the destination generator [see: generateFileDestination(options)]
26
- * @param storageOptions - Storage library options
27
- * @param uploaderOptions - Options for this service's specific behavior
28
- * @return {Promise<Object>} - Details regarding the uploaded file's metadata
29
- */
30
- async upload(readStream, bucket, destinationOptions = {}, storageOptions = {}, uploaderOptions = {}) {
31
- const {
32
- maxSize
33
- } = uploaderOptions;
34
- let file;
35
- (0, _report.reportDebug)({
36
- namespace,
37
- message: 'Uploading file to storage',
38
- data: {
39
- bucket,
40
- destinationOptions,
41
- storageOptions,
42
- uploaderOptions
43
- }
44
- });
45
-
46
- // Generate the file path
47
- // We either use a given file name, or we generate a random file name
48
- const {
49
- fileName,
50
- directory
51
- } = destinationOptions;
52
-
53
- // Upload file with given file name
54
- if (fileName) {
55
- // Only keep required slashes in full path
56
- const trimmedDirectory = (0, _trimPathSlash.trimPathSlash)(directory ?? '/');
57
- const path = `${trimmedDirectory}/${fileName}`;
58
- file = this.cloudStorage.bucket(bucket).file(path);
59
- }
60
- // Generate random destination for file and check that it is not already occupied
61
- else {
62
- do {
63
- const path = this.generateFileDestination(destinationOptions);
64
- file = this.cloudStorage.bucket(bucket).file(path);
65
- } while ((await file.exists())[0]);
66
- }
67
-
68
- // Pipe user's file stream to the storage
69
- return new Promise((resolve, reject) => {
70
- let receivedSize = 0;
71
- const writeStream = file.createWriteStream(storageOptions);
72
- const intMaxSize = maxSize && (0, _filesizeParser.default)(maxSize);
73
- // Calculate transferred size and write to storage stream
74
- readStream.on('data', function (data) {
75
- receivedSize += data.length;
76
- // Fail if transferred data over max size
77
- if (intMaxSize && receivedSize > intMaxSize) {
78
- reject(new _WebError.WebError({
79
- statusCode: 413,
80
- errorCode: 'file-too-large',
81
- message: 'Request contains a file that is over the maximum size',
82
- hint: {
83
- maxSize
84
- },
85
- data: {
86
- bucket,
87
- destinationOptions,
88
- storageOptions,
89
- receivedSize,
90
- maxSize
91
- }
92
- }));
93
- return;
94
- }
95
- writeStream.write(data);
96
- });
97
- // Error handling
98
- readStream.on('error', err => {
99
- reject(err);
100
- });
101
- writeStream.on('error', err => {
102
- reject(err);
103
- });
104
- // Graceful termination of the read
105
- readStream.on('end', () => {
106
- writeStream.end();
107
- });
108
- // Graceful termination of the write
109
- writeStream.on('finish', () => {
110
- (async () => {
111
- const [metadata] = await file.getMetadata();
112
- (0, _report.reportDebug)({
113
- namespace,
114
- message: 'File uploaded to storage',
115
- data: metadata
116
- });
117
- resolve(metadata);
118
- })().catch(error => {
119
- reject(error);
120
- });
121
- });
122
- });
123
- },
124
- /**
125
- * Return the read stream for a given file and bucket
126
- */
127
- async get(bucket, path) {
128
- const file = this.cloudStorage.bucket(bucket).file(path);
129
- const [[metadata], [data]] = await Promise.all([file.getMetadata(), file.download()]);
130
- (0, _report.reportDebug)({
131
- namespace,
132
- message: 'Downloaded file from storage',
133
- data: {
134
- bucket,
135
- path,
136
- metadata
137
- }
138
- });
139
- return {
140
- data,
141
- metadata
142
- };
143
- },
144
- /**
145
- * Return the read stream for a given file and bucket
146
- */
147
- async download(bucket, path) {
148
- const file = this.cloudStorage.bucket(bucket).file(path);
149
- const [metadata] = await file.getMetadata();
150
- (0, _report.reportDebug)({
151
- namespace,
152
- message: 'Fetched file stream from storage',
153
- data: {
154
- bucket,
155
- path,
156
- metadata
157
- }
158
- });
159
- return {
160
- stream: file.createReadStream(),
161
- metadata
162
- };
163
- },
164
- /**
165
- * Return the read stream for a given file path and bucket
166
- * @param {String} bucket
167
- * @param {String} path
168
- */
169
- getFileStream(bucket, path) {
170
- const file = this.cloudStorage.bucket(bucket).file(path);
171
- (0, _report.reportDebug)({
172
- namespace,
173
- message: "Fetched file stream from storage's bucket",
174
- data: {
175
- bucket,
176
- path
177
- }
178
- });
179
- return file.createReadStream();
180
- },
181
- /**
182
- * Delete a file from the cloud storage
183
- */
184
- async delete(bucket, path) {
185
- (0, _report.reportDebug)({
186
- namespace,
187
- message: 'Deleting file from storage',
188
- data: {
189
- bucket,
190
- path
191
- }
192
- });
193
- await this.cloudStorage.bucket(bucket).file(path).delete();
194
- },
195
- /**
196
- * Builds the full file path on the cloud and generates it a random name
197
- */
198
- generateFileDestination(options = {}) {
199
- const {
200
- directory = '/',
201
- mime,
202
- noExtension = false
203
- } = options;
204
-
205
- // use provided mime type default otherwise
206
- const extension = mime && _mimeTypes.default.extension(mime) ? _mimeTypes.default.extension(mime) : undefined;
207
- // Build the full name
208
- const fullName = extension && !noExtension ? `${(0, _crypto.randomUUID)()}.${extension}` : (0, _crypto.randomUUID)();
209
- // Only keep required slashes in full path
210
- const trimmedDirectory = (0, _trimPathSlash.trimPathSlash)(directory);
211
- return `${trimmedDirectory ? `${trimmedDirectory}/` : ''}${fullName}`;
212
- }
213
- };
214
- //# sourceMappingURL=Storage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Storage.js","names":["_crypto","require","_storage","_filesizeParser","_interopRequireDefault","_mimeTypes","_WebError","_report","_trimPathSlash","namespace","Storage","exports","cloudStorage","CloudStorage","projectId","process","env","GC_PROJECT","keyFilename","GOOGLE_APPLICATION_CREDENTIALS","upload","readStream","bucket","destinationOptions","storageOptions","uploaderOptions","maxSize","file","reportDebug","message","data","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/Storage/Storage.ts"],"sourcesContent":["import { randomUUID } from 'crypto';\nimport { Readable } from 'stream';\nimport {\n Storage as CloudStorage,\n CreateWriteStreamOptions,\n File\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} from './Storage.types';\nimport { WebError } from 'entities/WebError';\nimport { reportDebug } from 'utils/report';\nimport { trimPathSlash } from 'utils/trimPathSlash';\n\nconst namespace = 'engine:storage';\n\nexport const Storage = {\n cloudStorage: new CloudStorage({\n projectId: process.env.GC_PROJECT,\n keyFilename: process.env.GOOGLE_APPLICATION_CREDENTIALS\n }),\n\n /**\n * Upload a file to the cloud storage\n * @param readStream - Stream of the file content\n * @param bucket - Bucket in which the file should be stored\n * @param destinationOptions - Options for the destination generator [see: generateFileDestination(options)]\n * @param storageOptions - Storage library options\n * @param uploaderOptions - Options for this service's specific behavior\n * @return {Promise<Object>} - Details regarding the uploaded file's metadata\n */\n async upload(\n readStream: Readable,\n bucket: string,\n destinationOptions: UploadDestinationOptions = {},\n storageOptions: CreateWriteStreamOptions = {},\n uploaderOptions: UploaderOptions = {}\n ): Promise<StorageUploadedFile> {\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 // We either use a given file name, or we generate a random file name\n const { fileName, directory } = destinationOptions;\n\n // Upload file with given file name\n if (fileName) {\n // Only keep required slashes in full path\n const trimmedDirectory = trimPathSlash(directory ?? '/');\n const path = `${trimmedDirectory}/${fileName}`;\n file = this.cloudStorage.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 = this.cloudStorage.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 // 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: 'Request contains a file that is over the maximum size',\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 // Error handling\n readStream.on('error', (err) => {\n reject(err);\n });\n writeStream.on('error', (err) => {\n reject(err);\n });\n // Graceful termination of the read\n readStream.on('end', () => {\n writeStream.end();\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 * Return the read stream for a given file and bucket\n */\n async get(bucket: string, path: string): Promise<StorageGetResponse> {\n const file = this.cloudStorage.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 * Return the read stream for a given file and bucket\n */\n async download(\n bucket: string,\n path: string\n ): Promise<StorageDownloadResponse> {\n const file = this.cloudStorage.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 * Return the read stream for a given file path and bucket\n * @param {String} bucket\n * @param {String} path\n */\n getFileStream(bucket: string, path: string): Readable {\n const file = this.cloudStorage.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 the cloud storage\n */\n async delete(bucket: string, path: string): Promise<void> {\n reportDebug({\n namespace,\n message: 'Deleting file from storage',\n data: { bucket, path }\n });\n await this.cloudStorage.bucket(bucket).file(path).delete();\n },\n\n /**\n * Builds the full file path on the cloud and generates it a random name\n */\n generateFileDestination(options: UploadDestinationOptions = {}): string {\n const { directory = '/', mime, noExtension = false } = options;\n\n // use provided mime type default otherwise\n const extension =\n mime && mimeTypes.extension(mime) ? mimeTypes.extension(mime) : undefined;\n // Build the full name\n const fullName =\n extension && !noExtension ? `${randomUUID()}.${extension}` : randomUUID();\n // Only keep required slashes in full 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;AAKA,IAAAE,eAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,UAAA,GAAAD,sBAAA,CAAAH,OAAA;AAQA,IAAAK,SAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,cAAA,GAAAP,OAAA;AAEA,MAAMQ,SAAS,GAAG,gBAAgB;AAE3B,MAAMC,OAAO,GAAAC,OAAA,CAAAD,OAAA,GAAG;EACrBE,YAAY,EAAE,IAAIC,gBAAY,CAAC;IAC7BC,SAAS,EAAEC,OAAO,CAACC,GAAG,CAACC,UAAU;IACjCC,WAAW,EAAEH,OAAO,CAACC,GAAG,CAACG;EAC3B,CAAC,CAAC;EAEF;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,MAAMC,MAAMA,CACVC,UAAoB,EACpBC,MAAc,EACdC,kBAA4C,GAAG,CAAC,CAAC,EACjDC,cAAwC,GAAG,CAAC,CAAC,EAC7CC,eAAgC,GAAG,CAAC,CAAC,EACP;IAC9B,MAAM;MAAEC;IAAQ,CAAC,GAAGD,eAAe;IAEnC,IAAIE,IAAU;IACd,IAAAC,mBAAW,EAAC;MACVnB,SAAS;MACToB,OAAO,EAAE,2BAA2B;MACpCC,IAAI,EAAE;QAAER,MAAM;QAAEC,kBAAkB;QAAEC,cAAc;QAAEC;MAAgB;IACtE,CAAC,CAAC;;IAEF;IACA;IACA,MAAM;MAAEM,QAAQ;MAAEC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;QAAER,MAAM;QAAEa;MAAK;IACvB,CAAC,CAAC;IACF,MAAM,IAAI,CAACvB,YAAY,CAACU,MAAM,CAACA,MAAM,CAAC,CAACK,IAAI,CAACQ,IAAI,CAAC,CAAC8B,MAAM,CAAC,CAAC;EAC5D,CAAC;EAED;AACF;AACA;EACE7B,uBAAuBA,CAAC8B,OAAiC,GAAG,CAAC,CAAC,EAAU;IACtE,MAAM;MAAElC,SAAS,GAAG,GAAG;MAAEmC,IAAI;MAAEC,WAAW,GAAG;IAAM,CAAC,GAAGF,OAAO;;IAE9D;IACA,MAAMG,SAAS,GACbF,IAAI,IAAIG,kBAAS,CAACD,SAAS,CAACF,IAAI,CAAC,GAAGG,kBAAS,CAACD,SAAS,CAACF,IAAI,CAAC,GAAGI,SAAS;IAC3E;IACA,MAAMC,QAAQ,GACZH,SAAS,IAAI,CAACD,WAAW,GAAG,GAAG,IAAAK,kBAAU,EAAC,CAAC,IAAIJ,SAAS,EAAE,GAAG,IAAAI,kBAAU,EAAC,CAAC;IAC3E;IACA,MAAMxC,gBAAgB,GAAG,IAAAC,4BAAa,EAACF,SAAS,CAAC;IACjD,OAAO,GAAGC,gBAAgB,GAAG,GAAGA,gBAAgB,GAAG,GAAG,EAAE,GAAGuC,QAAQ,EAAE;EACvE;AACF,CAAC","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=Storage.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Storage.types.js","names":[],"sources":["../../../src/entities/Storage/Storage.types.ts"],"sourcesContent":["import { Readable } from 'stream';\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":[]}
@@ -1,2 +0,0 @@
1
- export * from './Storage';
2
- export * from './Storage.types';
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["_Storage","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_Storage2"],"sources":["../../../src/entities/Storage/index.ts"],"sourcesContent":["export * from './Storage';\nexport * from './Storage.types';\n"],"mappings":";;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,QAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,QAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,QAAA,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","ignoreList":[]}