@lyxa.ai/core 1.4.314 → 1.4.315

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -62,6 +62,7 @@ const cash_settlement_1 = require("./libraries/cash-settlement");
62
62
  const EnvironmentConfigurationType_1 = require("./libraries/configuration/types/EnvironmentConfigurationType");
63
63
  const osrm_1 = require("./libraries/map/providers/osrm");
64
64
  const rabbitmq_environments_1 = require("./utilities/environment/rabbitmq-environments");
65
+ const redis_environments_1 = require("./utilities/environment/redis-environments");
65
66
  const instance_disconnect_1 = require("./libraries/socket/connections/instance-disconnect");
66
67
  const logger_kit_1 = require("./libraries/logger-kit");
67
68
  const lyxa_fcm_service_1 = require("./libraries/notification/lyxa-fcm.service");
@@ -102,7 +103,10 @@ async function bootstrapCore(options) {
102
103
  async function registerLibraries(options) {
103
104
  const configurationInstance = new configuration_1.ConfigurationService(options);
104
105
  typedi_1.Container.set(configuration_1.ConfigurationService, configurationInstance);
105
- const redisInstance = new redis_1.RedisService(configurationInstance.redisURL);
106
+ const redisUrl = options?.redisURL
107
+ ? options.redisURL
108
+ : await (0, redis_environments_1.getRedisUrl)(options?.environment ?? EnvironmentConfigurationType_1.EnvironmentConfigurationType.DEV);
109
+ const redisInstance = new redis_1.RedisService(redisUrl);
106
110
  typedi_1.Container.set(redis_1.RedisService, redisInstance);
107
111
  const secretInstance = new secrets_1.SecretManagerService(configurationInstance, redisInstance);
108
112
  typedi_1.Container.set(secrets_1.SecretManagerService, secretInstance);
@@ -159,7 +163,8 @@ async function registerLibraries(options) {
159
163
  typedi_1.Container.set(firebase_fcm_service_1.FirebaseFcmService, fcmService);
160
164
  typedi_1.Container.set(lyxa_fcm_service_1.LyxaFcmService, lyxaFcmService);
161
165
  console.log('Initialized everything');
162
- await (0, event_1.initRabbitMQConnection)(rabbitmq_environments_1.RabbitMQUrlMap[options?.environment ?? EnvironmentConfigurationType_1.EnvironmentConfigurationType.DEV]);
166
+ const rabbitMQUrl = await (0, rabbitmq_environments_1.getRabbitMQUrl)(options?.environment ?? EnvironmentConfigurationType_1.EnvironmentConfigurationType.DEV, secretInstance);
167
+ await (0, event_1.initRabbitMQConnection)(rabbitMQUrl);
163
168
  const allSubscriptions = SubscriptionRegistry_1.SubscriptionRegistry.getAllSubscriptions();
164
169
  const instantiatedServices = new Map();
165
170
  for (const { eventId, targetConstructor, methodName } of allSubscriptions) {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,sCA0BC;AAED,8CA4GC;AAED,oCAEC;AAjLD,qFAAqF;AAErF,IAAA,0CAAqB,GAAE,CAAC;AAExB,2CAA6C;AAC7C,mCAAmC;AACnC,6DAAuF;AACvF,+CAAgD;AAChD,6CAAiD;AACjD,6CAAoF;AACpF,iDAA2D;AAC3D,uDAAgE;AAChE,+CAAmD;AACnD,mDAAuD;AACvD,6CAA6E;AAC7E,0FAAuF;AACvF,yCAAgE;AAChE,yDAAmE;AACnE,wFAAmF;AACnF,wEAAmE;AACnE,iEAA4F;AAC5F,+GAA4G;AAC5G,yDAAgE;AAChE,yFAA+E;AAC/E,4FAAuG;AACvG,uDAAuD;AACvD,gFAA2E;AAC3E,8EAAyE;AACzE,gGAAkG;AAElG,+EAAyF;AAGzF,6GAA4G;AAAnG,4IAAA,4BAA4B,OAAA;AACrC,2CAAyD;AAAhD,6GAAA,oBAAoB,OAAA;AAC7B,+DAA6C;AAEtC,KAAK,UAAU,aAAa,CAAC,OAA8B;IACjE,IAAI,CAAC;QACJ,MAAM,iBAAiB,CAAC,OAAO,CAAC,CAAC;QACjC,YAAY,EAAE,CAAC,SAAS,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;QAE/E,MAAM,gBAAgB,GAAG,KAAK,IAAI,EAAE;YACnC,Y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E,iBAAiB,EAAE,UAAU,EAAE,IAAI,gBAAgB,EAAE,CAAC;QAC3E,IAAI,QAAQ,GAAG,oBAAoB,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC3D,IAAI,CAAC,QAAQ,EAAE,CAAC;YACf,QAAQ,GAAG,kBAAS,CAAC,GAAG,CAAC,iBAAwB,CAAC,CAAC;YACnD,oBAAoB,CAAC,GAAG,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC;QACvD,CAAC;QAED,MAAM,IAAA,wBAAgB,EAAC,OAAO,EAAE,KAAK,EAAC,OAAO,EAAC,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IACjF,CAAC;AACF,CAAC;AAED,SAAgB,YAAY;IAC3B,OAAO,kBAAS,CAAC,GAAG,CAAC,0BAAc,CAAC,CAAC;AACtC,CAAC","sourcesContent":["// Apply the soft delete plugin globally before any connections or models\nimport { applySoftDeletePlugin } from './libraries/mongo/plugins/soft-delete-plugin';\n\napplySoftDeletePlugin();\n\nimport { LibraryManager } from './libraries';\nimport { Container } from 'typedi';\nimport { ConfigurationOptions, ConfigurationService } from './libraries/configuration';\nimport { LyxaLogger } from './libraries/logger';\nimport { RedisService } from './libraries/redis';\nimport { initGlobalConnection, initLyxaMongoDbConnection } from './libraries/mongo';\nimport { SecretManagerService } from './libraries/secrets';\nimport { MicroServiceDispatcher } from './libraries/dispatcher';\nimport { TwilioService } from './libraries/twilio';\nimport { FirebaseService } from './libraries/firebase';\nimport { initRabbitMQConnection, subscribeToEvent } from './libraries/event';\nimport { SubscriptionRegistry } from './libraries/event/registry/SubscriptionRegistry';\nimport { GoogleMapsService, MapService } from './libraries/map';\nimport { CachedSettingsService } from './libraries/cache/settings';\nimport { FirebaseFcmService } from './libraries/notification/firebase-fcm.service';\nimport { BullMQService } from './libraries/bullmq/bull-mq-service';\nimport { BOBSecrets, BOBService, CashSettlementService } from './libraries/cash-settlement';\nimport { EnvironmentConfigurationType } from './libraries/configuration/types/EnvironmentConfigurationType';\nimport { OsrmMapService } from './libraries/map/providers/osrm';\nimport { RabbitMQUrlMap } from './utilities/environment/rabbitmq-environments';\nimport { disconnectAllEntitiesFromInstance } from './libraries/socket/connections/instance-disconnect';\nimport { LyxaLoggerKit } from './libraries/logger-kit';\nimport { LyxaFcmService } from './libraries/notification/lyxa-fcm.service';\nimport { LyxaFcmSender } from './libraries/notification/lyxa-fcm-sender';\nimport { FirebaseMessageBuilderFactory } from './libraries/notification/firebase-message.builder';\nimport { GoogleTranslateService } from './libraries/google-translate';\nimport { LLMCompletionService, LLMProvider } from './libraries/llm/llm-provider-service';\n\nexport { ConfigurationOptions } from './libraries/configuration';\nexport { EnvironmentConfigurationType } from './libraries/configuration/types/EnvironmentConfigurationType';\nexport { initGlobalConnection } from './libraries/mongo';\nexport * from './libraries/google-translate';\n\nexport async function bootstrapCore(options?: ConfigurationOptions) {\n\ttry {\n\t\tawait registerLibraries(options);\n\t\tgetLibraries().getLogger().logger.info('Successfully bootstrapped lyxa-core.');\n\n\t\tconst gracefulShutdown = async () => {\n\t\t\tgetLibraries().getLogger().logger.info('Received shutdown signal, shutting down gracefully...');\n\t\t\tif (options?.instanceType == 'socket') await disconnectAllEntitiesFromInstance();\n\t\t\tprocess.exit();\n\t\t};\n\n\t\tprocess.on('SIGTERM', gracefulShutdown);\n\t\tprocess.on('SIGINT', gracefulShutdown);\n\t\tprocess.on('uncaughtException', err => {\n\t\t\tconsole.log('err', err);\n\t\t\tgetLibraries().getLogger().logger.error('Uncaught exception, shutting down...', err);\n\t\t\tgracefulShutdown();\n\t\t});\n\t\tprocess.on('exit', code => {\n\t\t\tgetLibraries().getLogger().logger.info(`Exiting with code: ${code}`);\n\t\t});\n\n\t\tconsole.log('Created hooks.');\n\t} catch (e) {\n\t\tconsole.error(e);\n\t}\n}\n\nexport async function registerLibraries(options?: ConfigurationOptions) {\n\t// Setup configuration.\n\tconst configurationInstance = new ConfigurationService(options);\n\tContainer.set(ConfigurationService, configurationInstance);\n\n\t// Setup redis.\n\tconst redisInstance = new RedisService(configurationInstance.redisURL);\n\tContainer.set(RedisService, redisInstance);\n\n\t// Setup secret\n\tconst secretInstance = new SecretManagerService(configurationInstance, redisInstance);\n\tContainer.set(SecretManagerService, secretInstance);\n\n\t// Setup BullMQ\n\tconst bullMQInstance = new BullMQService(redisInstance);\n\tContainer.set(BullMQService, bullMQInstance);\n\n\tconst mongoUrl = options?.mongoDbUrl\n\t\t? options.mongoDbUrl\n\t\t: await getLibraries().getSecretsService().getKey('MONGO_URL');\n\n\tawait initLyxaMongoDbConnection(mongoUrl!, options);\n\tawait initGlobalConnection(mongoUrl!, options!.environment);\n\n\tconst loggerInstance = new LyxaLogger(options!.instanceType!, mongoUrl!);\n\tContainer.set(LyxaLogger, loggerInstance);\n\n\tconst loggerKit = new LyxaLoggerKit({ instanceType: options!.instanceType! });\n\tContainer.set(LyxaLoggerKit, loggerKit);\n\n\t// Setup firebase\n\tconst firebaseInstance = new FirebaseService(configurationInstance!);\n\tContainer.set(FirebaseService, firebaseInstance);\n\n\t//Setup google translate\n\t// Container.set(GoogleTranslateService, Container.get(GoogleTranslateService));\n\n\t// Setup microservice dispatcher\n\tconst microserviceDispatcherInstance = new MicroServiceDispatcher(secretInstance);\n\tContainer.set(MicroServiceDispatcher, microserviceDispatcherInstance);\n\n\t// Setup twilio\n\tconst twilioServiceInstance = new TwilioService();\n\tContainer.set(TwilioService, twilioServiceInstance);\n\n\t// Setup LLM service\n\tconst llmCompletionService = new LLMCompletionService(LLMProvider.OPENAI);\n\tContainer.set(LLMCompletionService, llmCompletionService);\n\n\t// Setup map service\n\tconst googleMapsKey = await getLibraries().getSecretsService().getKey('GOOGLE_MAPS_API_KEY');\n\tconst googleMapService = new GoogleMapsService(redisInstance, googleMapsKey as string);\n\tconst osrmMapService = new OsrmMapService();\n\tconst mapServiceInstance = new MapService(googleMapService, osrmMapService);\n\tContainer.set(MapService, mapServiceInstance);\n\n\t// Setup cash settlement service\n\tconst bobUsername = await getLibraries().getSecretsService().getKey('BOB_USER_NAME');\n\tconst bobPassword = await getLibraries().getSecretsService().getKey('BOB_PASSWORD');\n\tconst bobURL = await getLibraries().getSecretsService().getKey('BOB_URL');\n\n\tconst bobService = new BOBService({\n\t\tBOB_USER_NAME: bobUsername,\n\t\tBOB_PASSWORD: bobPassword,\n\t\tBOB_URL: bobURL,\n\t} as BOBSecrets);\n\tconst cashSettlementServiceInstance = new CashSettlementService(bobService);\n\tContainer.set(CashSettlementService, cashSettlementServiceInstance);\n\tContainer.set(BOBService, bobService);\n\n\tconst settingsServiceInstance = new CachedSettingsService(redisInstance);\n\tContainer.set(CachedSettingsService, settingsServiceInstance);\n\n\ttry {\n\t\tconst settings = await settingsServiceInstance.getSettings();\n\t\tconst { _setTimezone } = await import('./utilities/dayjs/dayjs');\n\t\t_setTimezone(settings?.timezone || 'Asia/Beirut');\n\t\tconsole.log('Timezone initialized:', settings?.timezone || 'Asia/Beirut');\n\t} catch (error) {\n\t\tconsole.error('Failed to initialize timezone:', error);\n\t}\n\n\t// Setup fcm service\n\tconst fcmService = new FirebaseFcmService();\n\tconst builder = new FirebaseMessageBuilderFactory();\n\tconst lyxaFcmSender = new LyxaFcmSender(fcmService, builder);\n\tconst lyxaFcmService = new LyxaFcmService(lyxaFcmSender);\n\n\tContainer.set(FirebaseFcmService, fcmService);\n\tContainer.set(LyxaFcmService, lyxaFcmService);\n\n\tconsole.log('Initialized everything');\n\n\tawait initRabbitMQConnection(RabbitMQUrlMap[options?.environment ?? EnvironmentConfigurationType.DEV]);\n\n\tconst allSubscriptions = SubscriptionRegistry.getAllSubscriptions();\n\n\tconst instantiatedServices = new Map<Function, any>();\n\n\tfor (const { eventId, targetConstructor, methodName } of allSubscriptions) {\n\t\tlet instance = instantiatedServices.get(targetConstructor);\n\t\tif (!instance) {\n\t\t\tinstance = Container.get(targetConstructor as any);\n\t\t\tinstantiatedServices.set(targetConstructor, instance);\n\t\t}\n\n\t\tawait subscribeToEvent(eventId, async payload => instance[methodName](payload));\n\t}\n}\n\nexport function getLibraries(): LibraryManager {\n\treturn Container.get(LibraryManager);\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,sCA0BC;AAED,8CAiHC;AAED,oCAEC;AAvLD,qFAAqF;AAErF,IAAA,0CAAqB,GAAE,CAAC;AAExB,2CAA6C;AAC7C,mCAAmC;AACnC,6DAAuF;AACvF,+CAAgD;AAChD,6CAAiD;AACjD,6CAAoF;AACpF,iDAA2D;AAC3D,uDAAgE;AAChE,+CAAmD;AACnD,mDAAuD;AACvD,6CAA6E;AAC7E,0FAAuF;AACvF,yCAAgE;AAChE,yDAAmE;AACnE,wFAAmF;AACnF,wEAAmE;AACnE,iEAA4F;AAC5F,+GAA4G;AAC5G,yDAAgE;AAChE,yFAA+E;AAC/E,mFAAyE;AACzE,4FAAuG;AACvG,uDAAuD;AACvD,gFAA2E;AAC3E,8EAAyE;AACzE,gGAAkG;AAElG,+EAAyF;AAGzF,6GAA4G;AAAnG,4IAAA,4BAA4B,OAAA;AACrC,2CAAyD;AAAhD,6GAAA,oBAAoB,OAAA;AAC7B,+DAA6C;AAEtC,KAAK,UAAU,aAAa,CAAC,OAA8B;IACjE,IAAI,CAAC;QACJ,MAAM,iBAAiB,CAAC,OAAO,CAAC,CAAC;QACjC,YAAY,EAAE,CAAC,SAAS,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAAC;QAE/E,MAAM,gBAAgB,GAAG,KAAK,IAAI,EAAE;YACnC,YAAY,EAAE,CAAC,SAAS,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,uDAAuD,CAAC,CAAC;YAChG,IAAI,OAAO,EAAE,YAAY,IAAI,QAAQ;gBAAE,MAAM,IAAA,uDAAiC,GAAE,CAAC;YACjF,OAAO,CAAC,IAAI,EAAE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C;IAEtD,KAAK,MAAM,EAAE,OAAO,EAAE,iBAAiB,EAAE,UAAU,EAAE,IAAI,gBAAgB,EAAE,CAAC;QAC3E,IAAI,QAAQ,GAAG,oBAAoB,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAC3D,IAAI,CAAC,QAAQ,EAAE,CAAC;YACf,QAAQ,GAAG,kBAAS,CAAC,GAAG,CAAC,iBAAwB,CAAC,CAAC;YACnD,oBAAoB,CAAC,GAAG,CAAC,iBAAiB,EAAE,QAAQ,CAAC,CAAC;QACvD,CAAC;QAED,MAAM,IAAA,wBAAgB,EAAC,OAAO,EAAE,KAAK,EAAC,OAAO,EAAC,EAAE,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IACjF,CAAC;AACF,CAAC;AAED,SAAgB,YAAY;IAC3B,OAAO,kBAAS,CAAC,GAAG,CAAC,0BAAc,CAAC,CAAC;AACtC,CAAC","sourcesContent":["// Apply the soft delete plugin globally before any connections or models\nimport { applySoftDeletePlugin } from './libraries/mongo/plugins/soft-delete-plugin';\n\napplySoftDeletePlugin();\n\nimport { LibraryManager } from './libraries';\nimport { Container } from 'typedi';\nimport { ConfigurationOptions, ConfigurationService } from './libraries/configuration';\nimport { LyxaLogger } from './libraries/logger';\nimport { RedisService } from './libraries/redis';\nimport { initGlobalConnection, initLyxaMongoDbConnection } from './libraries/mongo';\nimport { SecretManagerService } from './libraries/secrets';\nimport { MicroServiceDispatcher } from './libraries/dispatcher';\nimport { TwilioService } from './libraries/twilio';\nimport { FirebaseService } from './libraries/firebase';\nimport { initRabbitMQConnection, subscribeToEvent } from './libraries/event';\nimport { SubscriptionRegistry } from './libraries/event/registry/SubscriptionRegistry';\nimport { GoogleMapsService, MapService } from './libraries/map';\nimport { CachedSettingsService } from './libraries/cache/settings';\nimport { FirebaseFcmService } from './libraries/notification/firebase-fcm.service';\nimport { BullMQService } from './libraries/bullmq/bull-mq-service';\nimport { BOBSecrets, BOBService, CashSettlementService } from './libraries/cash-settlement';\nimport { EnvironmentConfigurationType } from './libraries/configuration/types/EnvironmentConfigurationType';\nimport { OsrmMapService } from './libraries/map/providers/osrm';\nimport { getRabbitMQUrl } from './utilities/environment/rabbitmq-environments';\nimport { getRedisUrl } from './utilities/environment/redis-environments';\nimport { disconnectAllEntitiesFromInstance } from './libraries/socket/connections/instance-disconnect';\nimport { LyxaLoggerKit } from './libraries/logger-kit';\nimport { LyxaFcmService } from './libraries/notification/lyxa-fcm.service';\nimport { LyxaFcmSender } from './libraries/notification/lyxa-fcm-sender';\nimport { FirebaseMessageBuilderFactory } from './libraries/notification/firebase-message.builder';\nimport { GoogleTranslateService } from './libraries/google-translate';\nimport { LLMCompletionService, LLMProvider } from './libraries/llm/llm-provider-service';\n\nexport { ConfigurationOptions } from './libraries/configuration';\nexport { EnvironmentConfigurationType } from './libraries/configuration/types/EnvironmentConfigurationType';\nexport { initGlobalConnection } from './libraries/mongo';\nexport * from './libraries/google-translate';\n\nexport async function bootstrapCore(options?: ConfigurationOptions) {\n\ttry {\n\t\tawait registerLibraries(options);\n\t\tgetLibraries().getLogger().logger.info('Successfully bootstrapped lyxa-core.');\n\n\t\tconst gracefulShutdown = async () => {\n\t\t\tgetLibraries().getLogger().logger.info('Received shutdown signal, shutting down gracefully...');\n\t\t\tif (options?.instanceType == 'socket') await disconnectAllEntitiesFromInstance();\n\t\t\tprocess.exit();\n\t\t};\n\n\t\tprocess.on('SIGTERM', gracefulShutdown);\n\t\tprocess.on('SIGINT', gracefulShutdown);\n\t\tprocess.on('uncaughtException', err => {\n\t\t\tconsole.log('err', err);\n\t\t\tgetLibraries().getLogger().logger.error('Uncaught exception, shutting down...', err);\n\t\t\tgracefulShutdown();\n\t\t});\n\t\tprocess.on('exit', code => {\n\t\t\tgetLibraries().getLogger().logger.info(`Exiting with code: ${code}`);\n\t\t});\n\n\t\tconsole.log('Created hooks.');\n\t} catch (e) {\n\t\tconsole.error(e);\n\t}\n}\n\nexport async function registerLibraries(options?: ConfigurationOptions) {\n\t// Setup configuration.\n\tconst configurationInstance = new ConfigurationService(options);\n\tContainer.set(ConfigurationService, configurationInstance);\n\n\t// Setup redis.\n\tconst redisUrl = options?.redisURL\n\t\t? options.redisURL\n\t\t: await getRedisUrl(options?.environment ?? EnvironmentConfigurationType.DEV);\n\n\tconst redisInstance = new RedisService(redisUrl);\n\tContainer.set(RedisService, redisInstance);\n\n\t// Setup secret\n\tconst secretInstance = new SecretManagerService(configurationInstance, redisInstance);\n\tContainer.set(SecretManagerService, secretInstance);\n\n\t// Setup BullMQ\n\tconst bullMQInstance = new BullMQService(redisInstance);\n\tContainer.set(BullMQService, bullMQInstance);\n\n\tconst mongoUrl = options?.mongoDbUrl\n\t\t? options.mongoDbUrl\n\t\t: await getLibraries().getSecretsService().getKey('MONGO_URL');\n\n\tawait initLyxaMongoDbConnection(mongoUrl!, options);\n\tawait initGlobalConnection(mongoUrl!, options!.environment);\n\n\tconst loggerInstance = new LyxaLogger(options!.instanceType!, mongoUrl!);\n\tContainer.set(LyxaLogger, loggerInstance);\n\n\tconst loggerKit = new LyxaLoggerKit({ instanceType: options!.instanceType! });\n\tContainer.set(LyxaLoggerKit, loggerKit);\n\n\t// Setup firebase\n\tconst firebaseInstance = new FirebaseService(configurationInstance!);\n\tContainer.set(FirebaseService, firebaseInstance);\n\n\t//Setup google translate\n\t// Container.set(GoogleTranslateService, Container.get(GoogleTranslateService));\n\n\t// Setup microservice dispatcher\n\tconst microserviceDispatcherInstance = new MicroServiceDispatcher(secretInstance);\n\tContainer.set(MicroServiceDispatcher, microserviceDispatcherInstance);\n\n\t// Setup twilio\n\tconst twilioServiceInstance = new TwilioService();\n\tContainer.set(TwilioService, twilioServiceInstance);\n\n\t// Setup LLM service\n\tconst llmCompletionService = new LLMCompletionService(LLMProvider.OPENAI);\n\tContainer.set(LLMCompletionService, llmCompletionService);\n\n\t// Setup map service\n\tconst googleMapsKey = await getLibraries().getSecretsService().getKey('GOOGLE_MAPS_API_KEY');\n\tconst googleMapService = new GoogleMapsService(redisInstance, googleMapsKey as string);\n\tconst osrmMapService = new OsrmMapService();\n\tconst mapServiceInstance = new MapService(googleMapService, osrmMapService);\n\tContainer.set(MapService, mapServiceInstance);\n\n\t// Setup cash settlement service\n\tconst bobUsername = await getLibraries().getSecretsService().getKey('BOB_USER_NAME');\n\tconst bobPassword = await getLibraries().getSecretsService().getKey('BOB_PASSWORD');\n\tconst bobURL = await getLibraries().getSecretsService().getKey('BOB_URL');\n\n\tconst bobService = new BOBService({\n\t\tBOB_USER_NAME: bobUsername,\n\t\tBOB_PASSWORD: bobPassword,\n\t\tBOB_URL: bobURL,\n\t} as BOBSecrets);\n\tconst cashSettlementServiceInstance = new CashSettlementService(bobService);\n\tContainer.set(CashSettlementService, cashSettlementServiceInstance);\n\tContainer.set(BOBService, bobService);\n\n\tconst settingsServiceInstance = new CachedSettingsService(redisInstance);\n\tContainer.set(CachedSettingsService, settingsServiceInstance);\n\n\ttry {\n\t\tconst settings = await settingsServiceInstance.getSettings();\n\t\tconst { _setTimezone } = await import('./utilities/dayjs/dayjs');\n\t\t_setTimezone(settings?.timezone || 'Asia/Beirut');\n\t\tconsole.log('Timezone initialized:', settings?.timezone || 'Asia/Beirut');\n\t} catch (error) {\n\t\tconsole.error('Failed to initialize timezone:', error);\n\t}\n\n\t// Setup fcm service\n\tconst fcmService = new FirebaseFcmService();\n\tconst builder = new FirebaseMessageBuilderFactory();\n\tconst lyxaFcmSender = new LyxaFcmSender(fcmService, builder);\n\tconst lyxaFcmService = new LyxaFcmService(lyxaFcmSender);\n\n\tContainer.set(FirebaseFcmService, fcmService);\n\tContainer.set(LyxaFcmService, lyxaFcmService);\n\n\tconsole.log('Initialized everything');\n\n\tconst rabbitMQUrl = await getRabbitMQUrl(options?.environment ?? EnvironmentConfigurationType.DEV, secretInstance);\n\tawait initRabbitMQConnection(rabbitMQUrl);\n\n\tconst allSubscriptions = SubscriptionRegistry.getAllSubscriptions();\n\n\tconst instantiatedServices = new Map<Function, any>();\n\n\tfor (const { eventId, targetConstructor, methodName } of allSubscriptions) {\n\t\tlet instance = instantiatedServices.get(targetConstructor);\n\t\tif (!instance) {\n\t\t\tinstance = Container.get(targetConstructor as any);\n\t\t\tinstantiatedServices.set(targetConstructor, instance);\n\t\t}\n\n\t\tawait subscribeToEvent(eventId, async payload => instance[methodName](payload));\n\t}\n}\n\nexport function getLibraries(): LibraryManager {\n\treturn Container.get(LibraryManager);\n}\n"]}
@@ -34,6 +34,5 @@ export declare class ConfigurationService {
34
34
  private readonly _defaultOptions;
35
35
  private readonly _options;
36
36
  constructor(options?: ConfigurationOptions);
37
- get redisURL(): string;
38
37
  get options(): ConfigurationOptions;
39
38
  }
@@ -12,10 +12,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.ConfigurationService = void 0;
13
13
  const typedi_1 = require("typedi");
14
14
  const EnvironmentConfigurationType_1 = require("./types/EnvironmentConfigurationType");
15
- const redis_environments_1 = require("../../utilities/environment/redis-environments");
16
15
  let ConfigurationService = class ConfigurationService {
17
16
  _defaultOptions = {
18
- redisURL: redis_environments_1.RedisUrlMap[EnvironmentConfigurationType_1.EnvironmentConfigurationType.DEV],
19
17
  tenet: 'default',
20
18
  instanceType: 'unknown',
21
19
  firebaseAdmin: {
@@ -66,12 +64,8 @@ let ConfigurationService = class ConfigurationService {
66
64
  this._options = {
67
65
  ...this._defaultOptions,
68
66
  ...options,
69
- redisURL: options?.redisURL ? options?.redisURL : redis_environments_1.RedisUrlMap[options?.environment]
70
67
  };
71
68
  }
72
- get redisURL() {
73
- return redis_environments_1.RedisUrlMap[this._options.environment];
74
- }
75
69
  get options() {
76
70
  return this._options;
77
71
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/configuration/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,mCAAiC;AACjC,uFAAoF;AACpF,uFAA6E;AAkCtE,IAAM,oBAAoB,GAA1B,MAAM,oBAAo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,CAAC;SACpH,CAAC;IACH,CAAC;IAED,IAAI,QAAQ;QACX,OAAO,gCAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;IAC/C,CAAC;IAED,IAAI,OAAO;QACV,OAAO,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;CACD,CAAA;AAvEY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,gBAAO,GAAE;;GACG,oBAAoB,CAuEhC","sourcesContent":["import { FirebaseOptions } from 'firebase/app';\nimport { ServiceAccount } from 'firebase-admin';\nimport { Service } from 'typedi';\nimport { EnvironmentConfigurationType } from './types/EnvironmentConfigurationType';\nimport { RedisUrlMap } from '../../utilities/environment/redis-environments';\n\nexport interface ConfigurationOptions {\n\ttenet?: string;\n\tredisURL?: string;\n\tinstanceType?: string;\n\tmongoDbUrl?: string;\n\tmongooseDebug?: boolean;\n\tfirebaseAdmin?: {\n\t\tsuper: {\n\t\t\tfirebaseAdminServiceAccount: ServiceAccount;\n\t\t\tfirebaseAdminAppName?: string;\n\t\t};\n\t\tuser: {\n\t\t\tfirebaseAdminServiceAccount: ServiceAccount;\n\t\t\tfirebaseAdminAppName?: string;\n\t\t};\n\t\tshop: {\n\t\t\tfirebaseAdminServiceAccount: ServiceAccount;\n\t\t\tfirebaseAdminAppName?: string;\n\t\t};\n\t\trider: {\n\t\t\tfirebaseAdminServiceAccount: ServiceAccount;\n\t\t\tfirebaseAdminAppName?: string;\n\t\t};\n\t\tcpanel: {\n\t\t\tfirebaseAdminServiceAccount: ServiceAccount;\n\t\t\tfirebaseAdminAppName?: string;\n\t\t};\n\t};\n\tenvironment: EnvironmentConfigurationType;\n}\n\n@Service()\nexport class ConfigurationService {\n\tprivate readonly _defaultOptions: ConfigurationOptions = {\n\t\tredisURL: RedisUrlMap[EnvironmentConfigurationType.DEV],\n\t\ttenet: 'default',\n\t\tinstanceType: 'unknown',\n\t\tfirebaseAdmin: {\n\t\t\tsuper: {\n\t\t\t\tfirebaseAd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lPKRDmw3bKD4tseK36JsJw\\n5u7im6CpiTEgSSbOCr1ggITv6VbHUK/Nv3mExJH6uuzd9szb94JUAxGbZ16Liwn4\\nse+K2XlnLEnqxzFSkprOJAJkfbffrH+IxW8gNrK/UbjKT/xgEVH1ZeKUMPLCQG+y\\nLAW6NY50hwKBgCYQTPfAQa87u4mrvdsheJv67cCslfOlWPigDsXAK6aoYPU+E/2N\\nVwtL+F2KH7o/IVvfOdyTjryula9Pw+/PoYtWb5neHGFVxZiM+byuwzdeMHW2lHRU\\nOOroF8gdeRT6HIxVR0lwg2EC8cWRtD6KBmgwfqJfPe+1fJ8kSgCDlsiBAoGBAI1D\\nOyNeYW4bBhMHMeeOYY9nPsL2sUE92Zslolbgg/4fVds5dpAvpsWECGJy0Dn/6Ap8\\njtMbgnRUSsDGnWP8IjgvTCLvNCSxn0YRG1+L+tnIbfkmdePq1ZJ1oupDpWkVTzsC\\nU0Ydor2IzrW3bqiIXU6jculntYmu3a67biqYo7F3AoGBALoinJdtNLLqOqf/MumD\\n+YmbzHqsuID2dGyct7GESIBx3a67hwyJQfCK8nyHNyWN7lFg+H1rZlu1Cjmo0hlu\\nOxzdbWON5Rg2n3TbGw3AM1M55khsedbmm8MOSRdhIkz5RuYESSNAvVC6CBcfg5gb\\nCPq8jrR+oljMjBwAaQmFlPF7\\n-----END PRIVATE KEY-----\\n',\n\t\t\t\t\tclientEmail: 'lyxa-core@for-poc-325210.iam.gserviceaccount.com',\n\t\t\t\t},\n\t\t\t},\n\t\t\tuser: {\n\t\t\t\tfirebaseAdminServiceAccount: {\n\t\t\t\t\tprojectId: 'for-poc-325210',\n\t\t\t\t\tprivateKey:\n\t\t\t\t\t\t'-----BEGIN PRIVATE KEY-----\\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC9yUnAC2pQ+dhe\\ndJVMS7RQeQdQO7JhT0BXz0MbpCXlEdc3j/GQAY9UfKxQLg1VZh+4An8aUZevOy/v\\nUaHsv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vzbczT5/UKN0KlPvw/WoShT3HuRBk97tRcxZUS19i2sS\\nT/Jf3JJvfSngSX439+mZXZ5OuUEgoRGgMzeuQhLXBmcUI3rF1DlyFvdpAoGAfmq5\\nbn8fSzUNn+/6MGFt8Tb/JAscS87vCTZpkb+xXUlfCJaoQqxTuLEBzAC2Nsr0XDAg\\n2UqsUxBSs3VDjIRPVJc9adx9wH+sLAHhzn5fquR6OBesZ8gSjs8BjzqmPeAi6P09\\nZ60z8lh6S1RH0N1WqhBh7q2dEnbirqoV41CnNuECgYEAr26tTBIvEeZY3gmAmOVl\\nCw6gkxaHdzZplFl8Qnv272VllQpwbR1zaF6RfWsTEsrhrT+VtrZO6DDh9O6iJkbB\\n7Re3BnMOhGfUS3HlPCFnkdodeaoeVpg4llYwuunmyj+SmNxnC56TiznML1owmUYd\\ndLFeY+JZ0GpSBO0qYlY5QGk=\\n-----END PRIVATE KEY-----\\n',\n\t\t\t\t\tclientEmail: 'firebase-adminsdk-onusy@for-poc-325210.iam.gserviceaccount.com',\n\t\t\t\t},\n\t\t\t\tfirebaseAdminAppName: 'lyxa-user',\n\t\t\t},\n\t\t\trider: {\n\t\t\t\tfirebaseAdminServiceAccount: {\n\t\t\t\t\tprojectId: 'lyxa-rider-88939',\n\t\t\t\t\tprivateKey:\n\t\t\t\t\t\t'-----BEGIN PRIVATE KEY-----\\nMIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC08zRqUjHFO7Ir\\n4UNHIjxVp7oJkK3rrV1UGfHeHsijm6CSWjViVqsFKUZliYXTjg9S8rIMmC3OAMrh\\n5FTdNfDell8YHPbVRWZ0OFBNWglvKMgMKMoyQuBKtvEAdZwgVMreOf+51QlZnPxy\\nTBNh4Du2ahb8TtAjwxXt7CgMjNIfoMjQFJTrBTAmsxhtOEpYvPU2iX+OtAkHgrs1\\nNeWpBGpN4GSwOfA8MdgvorLYbeRDnkY4cH/ReNymTW9nbX1vgsx2AE1NR5PTNxv0\\nIu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dwDRcp7rA05KcgbbeAJ28L6zN6nMTMHKfJWGtmZyNfQioOyNdKhAaEI\\nSKiawhhOMjbEz5GQjtSFG8gz/l9t+IOBOlfj2fECgYBC8gGC7YHm+PvV5F1CVRZD\\nUYVlAnqOMJ1VvfTemW/kPzuCMd/JEKSE+b21h3rObMvUZU5AnkM3VT1+hDv6tyEt\\nblgh89YsHUor7wXSrYnVmYsrm91JABTWsLhLy92iqylg0xBs3Q5RGCt/s9f3YFFw\\nKghNmTDraGggnf5U/Z4LJw==\\n-----END PRIVATE KEY-----\\n',\n\t\t\t\t\tclientEmail: 'firebase-adminsdk-qwhrd@lyxa-rider-88939.iam.gserviceaccount.com',\n\t\t\t\t},\n\t\t\t\tfirebaseAdminAppName: 'lyxa-rider',\n\t\t\t},\n\t\t\tshop: {\n\t\t\t\tfirebaseAdminServiceAccount: {\n\t\t\t\t\tprojectId: 'lyxa-shop',\n\t\t\t\t\tprivateKey:\n\t\t\t\t\t\t'-----BEGIN PRIVATE KEY-----\\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDTWaf/QGSjk7po\\nri+6Nzo/tep1UtgMSY4KscT3iCbepiAsw7C8NCQqz3wYEAFRwywbaCwUcUs5KUC7\\n/e9TvpSQQksu10P9uP+c7wnAy+l0ay/15vWUV0usmDhMMvfjtDwS2RYTMEAdNUiZ\\nOuMC3/DDCBHt0SC5WCNzz11jj/n5bdVOS02qHd8V/lbd46iVEYfFswkI5NBgV7CY\\nnR2CoVcakPIeu9kEKdjXsJvf8+zCYtXPaFvcubQcnybOcg6usU+AHD1iwCRd6BrK\\n2PpM3gy/eASLJtzg/JoU0CgqJICmfR8LvGk6iHTp7VMfPuCfggwYtO3W1kSHuW4I\\nswbXYOJbAgMBAAECggEAMHKZ5xIsv66KiZp8SFSGnrolv7U430AxNlRf0Vo9hsZQ\\nE9Lb/Zh6PfIIAUAR/VsfDj1H9XuvAbBqLW3dYbYLOjJoJ5mi9VNmDORiuPZF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wpP9C06Y\\nZmnuEfgYIewBHZbpRO+nsGX+AK15gbJUNk1RbWmUU7AvkHyo4eE6NnNVbygxaFSk\\n0+8aYRpYzZRnyAn8Oo6o2No=\\n-----END PRIVATE KEY-----\\n',\n\t\t\t\t\tclientEmail: 'firebase-adminsdk-w4v98@lyxa-shop.iam.gserviceaccount.com',\n\t\t\t\t},\n\t\t\t\tfirebaseAdminAppName: 'lyxa-shop',\n\t\t\t},\n\t\t\tcpanel: {\n\t\t\t\tfirebaseAdminServiceAccount: {\n\t\t\t\t\tprojectId: 'lyxa-cpanel',\n\t\t\t\t\tprivateKey:\n\t\t\t\t\t\t'-----BEGIN PRIVATE KEY-----\\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDJpYsdNZcdGY/L\\nN+E3nzxsEWL157vzb7RL/yIzn1shGeyzwNtv3Ew26c8yLxGBJx/1IFe/qwomWNOt\\nK8oLgExlwYYzHA9sP+pKBYmxoL2Jqy8A0Ug0T0Cm8Bc78xy7810WCr07rbzFsDup\\nmtaVNMQh0A3CFEW/2+ZjiTN8628T7ziZDvjj+rTR01Kchqv1Lh5uCFiyKryc0lpF\\nL2LI8TKTZ0gikrqxqmKukv/o0aiiBVZxpghZbZ6oevc3XFGCWs6taVsnATecel57\\nvqcV6uZKGbDRU4OKrqTMlCJH6aAt6G1xN2DaCFSzqf5On+O7LkmlNiK/unjgewAt\\nINldmEAdAgMBAAECggEAG92JDmXH9qkAInyb3mReZK64ZrP52KewmintL4YPgVEE\\nUUjO6jPewl3oGI7Bk//0nhq0lZOMyQTQZ6db+d/mbs9h/LEdfn+MoGMIhqfoWVxz\\nF+FT4YqsLAWUqF+tsllsnS2pvdQB+K2kaQkxKxhKHEQUiqPjiaJZQZsFpvcf9/iB\\nhkCVBwd0mrExf841CGXxDBUgTHqwtQhwstkmgBDhFHVYzaIC3bR1hcksorWiND36\\nj43q0JiLpD0tOxKUGKloA8f+XYSE6nF1MSmfCG7rQ8iG4e6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t\t},\n\t\t\t\tfirebaseAdminAppName: 'lyxa-cpanel',\n\t\t\t},\n\t\t},\n\t\tenvironment: EnvironmentConfigurationType.DEV,\n\t};\n\n\tprivate readonly _options: ConfigurationOptions;\n\n\tconstructor(options?: ConfigurationOptions) {\n\t\tthis._options = {\n\t\t\t...this._defaultOptions,\n\t\t\t...options,\n\t\t\tredisURL: options?.redisURL ? options?.redisURL : RedisUrlMap[options?.environment as EnvironmentConfigurationType]\t\t\t\n\t\t};\t\t\n\t}\n\n\tget redisURL(): string {\n\t\treturn RedisUrlMap[this._options.environment];\n\t}\n\n\tget options(): ConfigurationOptions {\n\t\treturn this._options;\n\t}\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/configuration/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,mCAAiC;AACjC,uFAAoF;AAkC7E,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IACf,eAAe,GAAyB;QACxD,KAAK,EAAE,SAAS;QAChB,YAAY,EAAE,SAAS;QACvB,aAAa,EAAE;YACd,KAAK,EAAE;gBACN,2BAA2B,EAAE;oBAC5B,SAAS,EAAE,gBAAgB;oBAC3B,UAAU,EACT,ssDAAssD;oBACvsD,WAAW,EAAE,kDAAkD;iBAC/D;aACD;YACD,IAAI,EAAE;gBACL,2BAA2B,EAAE;oBAC5B,SAAS,EAAE,gBAAgB;oBAC3B,UAAU,EACT,ssDAAssD;oBACvsD,WAAW,EAAE,gEAAgE;iBAC7E;gBACD,oBAAoB,EAAE,WAAW;aACjC;YACD,KAAK,EAAE;gBACN,2BAA2B,EAAE;oBAC5B,SAAS,EAAE,kBAAkB;oBAC7B,UAAU,EACT,ssDAAssD;oBACvsD,WAAW,EAAE,kEAAkE;iBAC/E;gBACD,oBAAoB,EAAE,YAAY;aAClC;YACD,IAAI,EAAE;gBACL,2BAA2B,EAAE;oBAC5B,SAAS,EAAE,WAAW;oBACtB,UAAU,EACT,ssDAAssD;oBACvsD,WAAW,EAAE,2DAA2D;iBACxE;gBACD,oBAAoB,EAAE,WAAW;aACjC;YACD,MAAM,EAAE;gBACP,2BAA2B,EAAE;oBAC5B,SAAS,EAAE,aAAa;oBACxB,UAAU,EACT,ssDAAssD;oBACvsD,WAAW,EAAE,6DAA6D;iBAC1E;gBACD,oBAAoB,EAAE,aAAa;aACnC;SACD;QACD,WAAW,EAAE,2DAA4B,CAAC,GAAG;KAC7C,CAAC;IAEe,QAAQ,CAAuB;IAEhD,YAAY,OAA8B;QACzC,IAAI,CAAC,QAAQ,GAAG;YACf,GAAG,IAAI,CAAC,eAAe;YACvB,GAAG,OAAO;SACV,CAAC;IACH,CAAC;IAED,IAAI,OAAO;QACV,OAAO,IAAI,CAAC,QAAQ,CAAC;IACtB,CAAC;CACD,CAAA;AAjEY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,gBAAO,GAAE;;GACG,oBAAoB,CAiEhC","sourcesContent":["import { FirebaseOptions } from 'firebase/app';\nimport { ServiceAccount } from 'firebase-admin';\nimport { Service } from 'typedi';\nimport { EnvironmentConfigurationType } from './types/EnvironmentConfigurationType';\n\nexport interface ConfigurationOptions {\n\ttenet?: string;\n\tredisURL?: string;\n\tinstanceType?: string;\n\tmongoDbUrl?: string;\n\tmongooseDebug?: boolean;\n\tfirebaseAdmin?: {\n\t\tsuper: {\n\t\t\tfirebaseAdminServiceAccount: ServiceAccount;\n\t\t\tfirebaseAdminAppName?: string;\n\t\t};\n\t\tuser: {\n\t\t\tfirebaseAdminServiceAccount: ServiceAccount;\n\t\t\tfirebaseAdminAppName?: string;\n\t\t};\n\t\tshop: {\n\t\t\tfirebaseAdminServiceAccount: ServiceAccount;\n\t\t\tfirebaseAdminAppName?: string;\n\t\t};\n\t\trider: {\n\t\t\tfirebaseAdminServiceAccount: ServiceAccount;\n\t\t\tfirebaseAdminAppName?: string;\n\t\t};\n\t\tcpanel: {\n\t\t\tfirebaseAdminServiceAccount: ServiceAccount;\n\t\t\tfirebaseAdminAppName?: string;\n\t\t};\n\t};\n\tenvironment: EnvironmentConfigurationType;\n}\n\n@Service()\nexport class ConfigurationService {\n\tprivate readonly _defaultOptions: ConfigurationOptions = {\n\t\ttenet: 'default',\n\t\tinstanceType: 'unknown',\n\t\tfirebaseAdmin: {\n\t\t\tsuper: {\n\t\t\t\tfirebaseAdminServiceAccount: {\n\t\t\t\t\tprojectId: 'for-poc-325210',\n\t\t\t\t\tprivateKey:\n\t\t\t\t\t\t'-----BEGIN PRIVATE KEY-----\\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC5aI2nsMHkJbZf\\nem9ycpd57RjRDsBt9Nb/uMjsFcBRuAKcKgh4lgNO6ZmcRwK10IRygCmbY5XxmtVA\\nq9CT5tYlVN4SDzN1y4lL8/CL5owW2RZOURKcM0lsNOB9uGwkv1t3bfbBNc2hh9JX\\n72t7URAtrtPAkUxtgEPm6WL03uNu8KCZ0G9uoA/oM7o8OIGkjC575D9V6QjYC9fn\\nPjBRQ3K42fUWFmf31jtUBSHB0xE5qJI+MOi+OcXAJLxKQBbW+vqr2KfMwVYpNclp\\nk0Ptfe8xZxVfKEJAAkacQ36Hp14wFK/q+2mmhOQlbruksOZCpaIkh5IdvGkkG8ZH\\n566FgFHDAgMBAAECggEAJkuuqprLSZTyiOEQoOqDWBc9X3z1CSEfwV0I/x51BUwF\\nGf1il4mgsE12wX03VZd2q/HF5kcZAvjQoFV8tPfidn6DieZi4itCthHyNutNNzDq\\ntw1u0x2SxktbrQwJJkPyIAZyB7FVwk38B9a3dBanyU/JhAZe62UpYUoGev6IqnKm\\nIiw7r4lc47XgJNrDjXhCtTwHBmXA6qt/HrBcu4fSZlnZMhvsgnO6iafXaBo15Rpy\\nyVBVCPCGJBqpbqI8w3lVTcUqvD2DS+wGJAZSNFagt5qg+vCN8xVUsyQKrM1qIXZm\\nxvPX5oE6CWaD5a7yzpwqKLghKIpsb+3gezyQiFw5rQKBgQDh9U+VdFipH2o8Rezd\\n2d9Kp+ya8+kAog4NMeMyD/xyvKbmv6hW2SZqLhc5MacO0GiCnFR+dMLJxRBGnn+e\\ngYP26OE2fG9Kn7JrSGafu7siKnonfaN/1IcHcZe/77P/s/o2lNxaVl9i1iPQlzr/\\nN8RRaYa+pvazR4VNMS+Z6keD5QKBgQDSDxfKGwOt/GlPKRDmw3bKD4tseK36JsJw\\n5u7im6CpiTEgSSbOCr1ggITv6VbHUK/Nv3mExJH6uuzd9szb94JUAxGbZ16Liwn4\\nse+K2XlnLEnqxzFSkprOJAJkfbffrH+IxW8gNrK/UbjKT/xgEVH1ZeKUMPLCQG+y\\nLAW6NY50hwKBgCYQTPfAQa87u4mrvdsheJv67cCslfOlWPigDsXAK6aoYPU+E/2N\\nVwtL+F2KH7o/IVvfOdyTjryula9Pw+/PoYtWb5neHGFVxZiM+byuwzdeMHW2lHRU\\nOOroF8gdeRT6HIxVR0lwg2EC8cWRtD6KBmgwfqJfPe+1fJ8kSgCDlsiBAoGBAI1D\\nOyNeYW4bBhMHMeeOYY9nPsL2sUE92Zslolbgg/4fVds5dpAvpsWECGJy0Dn/6Ap8\\njtMbgnRUSsDGnWP8IjgvTCLvNCSxn0YRG1+L+tnIbfkmdePq1ZJ1oupDpWkVTzsC\\nU0Ydor2IzrW3bqiIXU6jculntYmu3a67biqYo7F3AoGBALoinJdtNLLqOqf/MumD\\n+YmbzHqsuID2dGyct7GESIBx3a67hwyJQfCK8nyHNyWN7lFg+H1rZlu1Cjmo0hlu\\nOxzdbWON5Rg2n3TbGw3AM1M55khsedbmm8MOSRdhIkz5RuYESSNAvVC6CBcfg5gb\\nCPq8jrR+oljMjBwAaQmFlPF7\\n-----END PRIVATE KEY-----\\n',\n\t\t\t\t\tclientEmail: 'lyxa-core@for-poc-325210.iam.gserviceaccount.com',\n\t\t\t\t},\n\t\t\t},\n\t\t\tuser: {\n\t\t\t\tfirebaseAdminServiceAccount: {\n\t\t\t\t\tprojectId: 'for-poc-325210',\n\t\t\t\t\tprivateKey:\n\t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P+DcFwGKvBe2vntFYz\\nafCNlYK7wT/t7ChlCUSXuU/bSrXe4Wc4KGnJ6YzNmykMJku2b845layB1PxEhHHA\\nRl2NEx9RoQKBgHJvETx+m2UIGEAtZXlBvTQh7TkIxOV6NPt/IHtrdsJ7ZX15vytM\\nltbqlUTe160Z1zhGfOw3vzbczT5/UKN0KlPvw/WoShT3HuRBk97tRcxZUS19i2sS\\nT/Jf3JJvfSngSX439+mZXZ5OuUEgoRGgMzeuQhLXBmcUI3rF1DlyFvdpAoGAfmq5\\nbn8fSzUNn+/6MGFt8Tb/JAscS87vCTZpkb+xXUlfCJaoQqxTuLEBzAC2Nsr0XDAg\\n2UqsUxBSs3VDjIRPVJc9adx9wH+sLAHhzn5fquR6OBesZ8gSjs8BjzqmPeAi6P09\\nZ60z8lh6S1RH0N1WqhBh7q2dEnbirqoV41CnNuECgYEAr26tTBIvEeZY3gmAmOVl\\nCw6gkxaHdzZplFl8Qnv272VllQpwbR1zaF6RfWsTEsrhrT+VtrZO6DDh9O6iJkbB\\n7Re3BnMOhGfUS3HlPCFnkdodeaoeVpg4llYwuunmyj+SmNxnC56TiznML1owmUYd\\ndLFeY+JZ0GpSBO0qYlY5QGk=\\n-----END PRIVATE KEY-----\\n',\n\t\t\t\t\tclientEmail: 'firebase-adminsdk-onusy@for-poc-325210.iam.gserviceaccount.com',\n\t\t\t\t},\n\t\t\t\tfirebaseAdminAppName: 'lyxa-user',\n\t\t\t},\n\t\t\trider: {\n\t\t\t\tfirebaseAdminServiceAccount: {\n\t\t\t\t\tprojectId: 'lyxa-rider-88939',\n\t\t\t\t\tprivateKey:\n\t\t\t\t\t\t'-----BEGIN PRIVATE KEY-----\\nMIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC08zRqUjHFO7Ir\\n4UNHIjxVp7oJkK3rrV1UGfHeHsijm6CSWjViVqsFKUZliYXTjg9S8rIMmC3OAMrh\\n5FTdNfDell8YHPbVRWZ0OFBNWglvKMgMK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kiGxecCvLe/D8RSeW9KDpRqFrPrv\\nn+05pcng2js4gZAYOPaSmq+Z4WOUEzMs+jYpz8zseTwUqykEVWuplvulAoGAF8y9\\n4RBZx4pVW01u9BP7LUWJlJoE/gKQ5YlCBP5s5kVJm5omu2lOwYb2X9F2JvPamFnE\\nHta3BQ2ZcdwDRcp7rA05KcgbbeAJ28L6zN6nMTMHKfJWGtmZyNfQioOyNdKhAaEI\\nSKiawhhOMjbEz5GQjtSFG8gz/l9t+IOBOlfj2fECgYBC8gGC7YHm+PvV5F1CVRZD\\nUYVlAnqOMJ1VvfTemW/kPzuCMd/JEKSE+b21h3rObMvUZU5AnkM3VT1+hDv6tyEt\\nblgh89YsHUor7wXSrYnVmYsrm91JABTWsLhLy92iqylg0xBs3Q5RGCt/s9f3YFFw\\nKghNmTDraGggnf5U/Z4LJw==\\n-----END PRIVATE KEY-----\\n',\n\t\t\t\t\tclientEmail: 'firebase-adminsdk-qwhrd@lyxa-rider-88939.iam.gserviceaccount.com',\n\t\t\t\t},\n\t\t\t\tfirebaseAdminAppName: 'lyxa-rider',\n\t\t\t},\n\t\t\tshop: {\n\t\t\t\tfirebaseAdminServiceAccount: {\n\t\t\t\t\tprojectId: 'lyxa-shop',\n\t\t\t\t\tprivateKey:\n\t\t\t\t\t\t'-----BEGIN PRIVATE KEY-----\\nMIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDTWaf/QGSjk7po\\nri+6Nzo/tep1UtgMSY4KscT3iCbepiAsw7C8NCQqz3wYEAFRwywbaCwUcUs5KUC7\\n/e9TvpSQQksu10P9uP+c7wnAy+l0ay/15vWUV0usmDhMMvfjtDwS2RYTMEAdNUiZ\\nOuMC3/DDCBHt0SC5WCNzz11jj/n5bdVOS02qHd8V/lbd46iVEYfFswkI5NBgV7CY\\nnR2CoVcakPIeu9kEKdjXsJvf8+zCYtXPaFvcubQcnybOcg6usU+AHD1iwCRd6BrK\\n2PpM3gy/eASLJtzg/JoU0Cgq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CIEuUJgbXbDvYyqEES6j435i2HH+FIRDZilC16T4G2Wt+PJZ\\nQhy7f9vGb9WBp7AXT35bGql1pdyQ6rl80+hkKv2tAoGAe4yFOvIdEEdgEokp5Dem\\nuPf1rikk5mYPMkXhrX0cH9Wd2rh9MiP2gJuL3PD3R9LLon+9EzdBs31MwpP9C06Y\\nZmnuEfgYIewBHZbpRO+nsGX+AK15gbJUNk1RbWmUU7AvkHyo4eE6NnNVbygxaFSk\\n0+8aYRpYzZRnyAn8Oo6o2No=\\n-----END PRIVATE KEY-----\\n',\n\t\t\t\t\tclientEmail: 'firebase-adminsdk-w4v98@lyxa-shop.iam.gserviceaccount.com',\n\t\t\t\t},\n\t\t\t\tfirebaseAdminAppName: 'lyxa-shop',\n\t\t\t},\n\t\t\tcpanel: {\n\t\t\t\tfirebaseAdminServiceAccount: {\n\t\t\t\t\tprojectId: 'lyxa-cpanel',\n\t\t\t\t\tprivateKey:\n\t\t\t\t\t\t'-----BEGIN PRIVATE KEY-----\\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDJpYsdNZcdGY/L\\nN+E3nzxsEWL157vzb7RL/yIzn1shGeyzwNtv3Ew26c8yLxGBJx/1IFe/qwomWNOt\\nK8oLgExlwYYzHA9sP+pKBYmxoL2Jqy8A0Ug0T0Cm8Bc78xy7810WCr07rbzFsDup\\nmtaVNMQh0A3CFEW/2+ZjiTN8628T7ziZDvjj+rTR01Kchqv1Lh5uCFiyKryc0lpF\\nL2LI8TKTZ0gikrqxqmKukv/o0aiiBVZxpghZbZ6oevc3XFGCWs6taVsnATecel57\\nvqcV6uZKGbDRU4OKrqTMlCJH6aAt6G1xN2DaCFSzqf5On+O7LkmlNiK/unjgewAt\\nINldmEAdAgMBAAECggEAG92JDmXH9qkAInyb3mReZK64ZrP52KewmintL4YPgVEE\\nUUjO6jPewl3oGI7Bk//0nhq0lZOMyQTQZ6db+d/mbs9h/LEdfn+MoGMIhqfoWVxz\\nF+FT4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Pmf+2+sIT7nCALz++xOjjKO39bN20X/Eowe34HnukIlSSMj9rW5jYAjd+R\\n4ZLd2xuo+DIXvLfGGniZazVC\\n-----END PRIVATE KEY-----\\n',\n\t\t\t\t\tclientEmail: 'firebase-adminsdk-fbsvc@lyxa-cpanel.iam.gserviceaccount.com',\n\t\t\t\t},\n\t\t\t\tfirebaseAdminAppName: 'lyxa-cpanel',\n\t\t\t},\n\t\t},\n\t\tenvironment: EnvironmentConfigurationType.DEV,\n\t};\n\n\tprivate readonly _options: ConfigurationOptions;\n\n\tconstructor(options?: ConfigurationOptions) {\n\t\tthis._options = {\n\t\t\t...this._defaultOptions,\n\t\t\t...options,\n\t\t};\n\t}\n\n\tget options(): ConfigurationOptions {\n\t\treturn this._options;\n\t}\n}\n"]}
@@ -1,5 +1,7 @@
1
1
  import { RedisService } from '../redis';
2
2
  import { ConfigurationService } from '../configuration';
3
+ import { EnvironmentConfigurationType } from '../configuration/types/EnvironmentConfigurationType';
4
+ export declare function fetchSecretDirect(environment: EnvironmentConfigurationType, key: string): Promise<string | undefined>;
3
5
  export declare class SecretManagerService {
4
6
  private _configurationService;
5
7
  private _redisManager;
@@ -10,10 +10,38 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.SecretManagerService = void 0;
13
+ exports.fetchSecretDirect = fetchSecretDirect;
13
14
  const secret_manager_1 = require("@google-cloud/secret-manager");
14
15
  const typedi_1 = require("typedi");
15
16
  const redis_1 = require("../redis");
16
17
  const configuration_1 = require("../configuration");
18
+ const SECRETS_PROJECT_ID = '899369746265';
19
+ function createSecretManagerClient() {
20
+ return new secret_manager_1.SecretManagerServiceClient({
21
+ credentials: {
22
+ client_id: '107840895824406590900',
23
+ private_key_id: 'ece1ebdfde57414700f23f1f4014f5e83d4f7644',
24
+ type: 'service_account',
25
+ universe_domain: 'googleapis.com',
26
+ projectId: 'for-poc-325210',
27
+ private_key: '-----BEGIN PRI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LmCSH4eiFe83kFLUUzhnYE6DU/17i6T4V+ofawToasu3wag\nf7LzT2BzEwKBgQDlVD5lktDOQtWtj+yC607bVAZzhrCbUfX8FFEh6ZL3A2zgzXhN\nZmBtaqfew3URf47UICy894MrCyYi2gSOZCfoz2vu+egLt0QBw/lCOQ4dD1gM/u+B\nP5wifI14eIb2dLCZBV/83F5n24zo4gjBSNfS/6Jcbs/KvbAfjCptTkX10wKBgDxb\nwy5WtlRVcqxaf50ilWzr8I/7fH7YceYDG4EbKxTHD0m+BOjbhrlmAlMO2sIUM3WK\nfpmPCZiuLyCTmuC+kd8xK5ap79h3libgh/2/ReUpvdBhm+PQDOLC4CtCPYdtIn7T\nP57jN8dRLXJokIIIBw+nH32dS62AQ9oXWYvZ1UKzAoGBAOWOSphZMnPlLeLN54/4\nwKPI+D6G1JhzqQrUf8Z99J7m3r3ya+0ug5gRGQCoSRfqz9o87+fLCdSdc38L+j4T\nBnuwIcY6n4LF+3yAPIF1rnrIBFRqzPta7epYPXHtUTvWOkEkKzNmsFVCZKF7nQjS\ns/ucyyfUssPsTznYW3gXf3To\n-----END PRIVATE KEY-----\n',
28
+ client_email: 'lyxa-core@for-poc-325210.iam.gserviceaccount.com',
29
+ },
30
+ });
31
+ }
32
+ async function fetchSecretDirect(environment, key) {
33
+ try {
34
+ const client = createSecretManagerClient();
35
+ const environmentTransformedKey = environment + '_' + key;
36
+ const [accessResponse] = await client.accessSecretVersion({
37
+ name: 'projects/' + SECRETS_PROJECT_ID + '/secrets/' + environmentTransformedKey + '/versions/latest',
38
+ });
39
+ return accessResponse.payload.data.toString();
40
+ }
41
+ catch (e) {
42
+ console.error(e);
43
+ }
44
+ }
17
45
  let SecretManagerService = class SecretManagerService {
18
46
  _configurationService;
19
47
  _redisManager;
@@ -21,17 +49,7 @@ let SecretManagerService = class SecretManagerService {
21
49
  constructor(configurationService, redisManager) {
22
50
  this._configurationService = configurationService;
23
51
  this._redisManager = redisManager;
24
- this._client = new secret_manager_1.SecretManagerServiceClient({
25
- credentials: {
26
- client_id: '107840895824406590900',
27
- private_key_id: 'ece1ebdfde57414700f23f1f4014f5e83d4f7644',
28
- type: 'service_account',
29
- universe_domain: 'googleapis.com',
30
- projectId: 'for-poc-325210',
31
- private_key: '-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDPTk9M5nCDYJhC\nLuyP+gqBXIHPrXegygco5tB50Y7Q9s/f4hm+xp/usYy5UCYyFVNjZ2mdjWQcr3Ta\nT3GZV9OiHej8ejveY0iyFBi0IlfGNm9blYlOIyQT4i6MoevNul7u4EQL8bid/sp/\nJ/XPNC+Jnk8Ke2G9FdfDYs+1O6Nf37HuPUmMwLAzcyl+k1v9UzInrgNPj+nactY7\nEPCVSM6XcZI3UL86n574iQBvUXsMpUt3csYVOxPap1Vd1TBEo1k85jZepMvaXHoK\nJUwQT7p1F1D0weVKJ1BjwQgmADZWfUKdwRyS8zFPbUGeptlA2XlxyVMasGzCCMi4\n6jzJGC81AgMBAAECggEAXoaLnDn7Fbym0I7K6T+PKLtAqaykPpnAOAM/DjzijR/t\nW12idZ3l8RXeX+VO9UlKE6pkuyVsf7P1aVIOL2ifpG1U/kLSJ65HyINnXEPImCXc\nEvuVdx6I5dQde5ydg9o2TV/PR0756njyZpaW+9sEzhB0ZAgsYeai0oGsyiuebCkm\nqlOnf5DO/kWlNvf8yZ7GMEa0WBYyan4O7YcVF13c7oM19XZfvw+lliU/geOwVNW5\nEfSn91UWIEMB60Q5XKHg11LAvbq8mvcHD+6ujeoPMfoZJrHZj5ucBP5auyRNFCUM\nWE2IILLpgdhDfE5I323xHIyMblMSc1OOkZzjhuNYRQKBgQDuEa/jMqEDu7ZpDo/g\nf+M4Qmmyh1WIjnORwqbf8INi5oN1NoIv6tcJ++COAWcBpyerW9aknLRMX9FXrNH5\nAPyRvHQt2IpRCqjdcEr2b3VwZmcjRVbpsISwqE0RBvXSXOnvbDzZ53bC70anL5OY\n7UYwOotbQXpcEGC57wy8G+VVlwKBgQDe63bcubV1W2+WPbdtzb7tzIS5PPz19U5i\n5PjVQ4E34FH0ZBnk2v1fjtVxR72mrzCg2xz72rWgdsHJ/1QZAfw+4troJV9LI9SG\nYRMeh86NSfNObdkY+LmCSH4eiFe83kFLUUzhnYE6DU/17i6T4V+ofawToasu3wag\nf7LzT2BzEwKBgQDlVD5lktDOQtWtj+yC607bVAZzhrCbUfX8FFEh6ZL3A2zgzXhN\nZmBtaqfew3URf47UICy894MrCyYi2gSOZCfoz2vu+egLt0QBw/lCOQ4dD1gM/u+B\nP5wifI14eIb2dLCZBV/83F5n24zo4gjBSNfS/6Jcbs/KvbAfjCptTkX10wKBgDxb\nwy5WtlRVcqxaf50ilWzr8I/7fH7YceYDG4EbKxTHD0m+BOjbhrlmAlMO2sIUM3WK\nfpmPCZiuLyCTmuC+kd8xK5ap79h3libgh/2/ReUpvdBhm+PQDOLC4CtCPYdtIn7T\nP57jN8dRLXJokIIIBw+nH32dS62AQ9oXWYvZ1UKzAoGBAOWOSphZMnPlLeLN54/4\nwKPI+D6G1JhzqQrUf8Z99J7m3r3ya+0ug5gRGQCoSRfqz9o87+fLCdSdc38L+j4T\nBnuwIcY6n4LF+3yAPIF1rnrIBFRqzPta7epYPXHtUTvWOkEkKzNmsFVCZKF7nQjS\ns/ucyyfUssPsTznYW3gXf3To\n-----END PRIVATE KEY-----\n',
32
- client_email: 'lyxa-core@for-poc-325210.iam.gserviceaccount.com',
33
- },
34
- });
52
+ this._client = createSecretManagerClient();
35
53
  }
36
54
  async getKey(key) {
37
55
  const environmentTransformedKey = this._configurationService?.options?.environment + '_' + key;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["libraries/secrets/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,iEAA0E;AAC1E,mCAAiC;AACjC,oCAAwC;AACxC,oDAAwD;AAGjD,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IACxB,qBA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C;YACZ,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACF,CAAC;IAEM,KAAK,CAAC,MAAM,CAAC,GAAW,EAAE,KAAa;QAC7C,MAAM,IAAI,CAAC,aAAa,CAAC,sBAAsB,CAC9C,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC,WAAW,GAAG,OAAO,EACxD,GAAG,EACH,KAAK,CACL,CAAC;QACF,OAAO,KAAK,CAAC;IACd,CAAC;CACD,CAAA;AAzDY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,gBAAO,GAAE;qCAMyB,oCAAoB,EAAgB,oBAAY;GALtE,oBAAoB,CAyDhC","sourcesContent":["import { SecretManagerServiceClient } from '@google-cloud/secret-manager';\nimport { Service } from 'typedi';\nimport { RedisService } from '../redis';\nimport { ConfigurationService } from '../configuration';\n\n@Service()\nexport class SecretManagerService {\n\tprivate _configurationService!: ConfigurationService;\n\tprivate _redisManager!: RedisService;\n\tprivate _client!: SecretManagerServiceClient;\n\n\tconstructor(configurationService: ConfigurationService, redisManager: RedisService) {\n\t\tthis._configurationService = configurationService;\n\t\tthis._redisManager = redisManager;\n\t\tthis._client = new SecretManagerServiceClient({\n\t\t\tcredentials: {\n\t\t\t\tclient_id: '107840895824406590900',\n\t\t\t\tprivate_key_id: 'ece1ebdfde57414700f23f1f4014f5e83d4f7644',\n\t\t\t\ttype: 'service_account',\n\t\t\t\tuniverse_domain: 'googleapis.com',\n\t\t\t\tprojectId: 'for-poc-325210',\n\t\t\t\tprivate_key:\n\t\t\t\t\t'-----BEGIN PRIVATE KEY-----\\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDPTk9M5nCDYJhC\\nLuyP+gqBXIHPrXegygco5tB50Y7Q9s/f4hm+xp/usYy5UCYyFVNjZ2mdjWQcr3Ta\\nT3GZV9OiHej8ejveY0iyFBi0IlfGNm9blYlOIyQT4i6MoevNul7u4EQL8bid/sp/\\nJ/XPNC+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zo4gjBSNfS/6Jcbs/KvbAfjCptTkX10wKBgDxb\\nwy5WtlRVcqxaf50ilWzr8I/7fH7YceYDG4EbKxTHD0m+BOjbhrlmAlMO2sIUM3WK\\nfpmPCZiuLyCTmuC+kd8xK5ap79h3libgh/2/ReUpvdBhm+PQDOLC4CtCPYdtIn7T\\nP57jN8dRLXJokIIIBw+nH32dS62AQ9oXWYvZ1UKzAoGBAOWOSphZMnPlLeLN54/4\\nwKPI+D6G1JhzqQrUf8Z99J7m3r3ya+0ug5gRGQCoSRfqz9o87+fLCdSdc38L+j4T\\nBnuwIcY6n4LF+3yAPIF1rnrIBFRqzPta7epYPXHtUTvWOkEkKzNmsFVCZKF7nQjS\\ns/ucyyfUssPsTznYW3gXf3To\\n-----END PRIVATE KEY-----\\n',\n\t\t\t\tclient_email: 'lyxa-core@for-poc-325210.iam.gserviceaccount.com',\n\t\t\t},\n\t\t});\n\t}\n\n\tpublic async getKey(key: string): Promise<string | undefined> {\n\t\tconst environmentTransformedKey = this._configurationService?.options?.environment + '_' + key;\n\n\t\ttry {\n\t\t\tconst data = await this._redisManager.getCachedObjectByGroup<string>(\n\t\t\t\tthis?._configurationService?.options?.environment + '_KEYS',\n\t\t\t\tkey\n\t\t\t);\n\n\t\t\tif (data != undefined) {\n\t\t\t\treturn data;\n\t\t\t}\n\n\t\t\tconst [accessResponse] = await this._client.accessSecretVersion({\n\t\t\t\tname: 'projects/899369746265/secrets/' + environmentTransformedKey + '/versions/latest',\n\t\t\t});\n\n\t\t\tconst val = accessResponse.payload!.data!.toString();\n\n\t\t\tawait this.setKey(key, val);\n\n\t\t\treturn val;\n\t\t} catch (e) {\n\t\t\tconsole.error(e);\n\t\t}\n\t}\n\n\tpublic async setKey(key: string, value: string): Promise<string> {\n\t\tawait this._redisManager.setCachedObjectByGroup<string>(\n\t\t\tthis._configurationService.options.environment + '_KEYS',\n\t\t\tkey,\n\t\t\tvalue\n\t\t);\n\t\treturn value;\n\t}\n}\n"]}
1
+ {"version":3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B,CA8ChC","sourcesContent":["import { SecretManagerServiceClient } from '@google-cloud/secret-manager';\nimport { Service } from 'typedi';\nimport { RedisService } from '../redis';\nimport { ConfigurationService } from '../configuration';\nimport { EnvironmentConfigurationType } from '../configuration/types/EnvironmentConfigurationType';\n\nconst SECRETS_PROJECT_ID = '899369746265';\n\nfunction createSecretManagerClient(): SecretManagerServiceClient {\n\treturn new SecretManagerServiceClient({\n\t\tcredentials: {\n\t\t\tclient_id: '107840895824406590900',\n\t\t\tprivate_key_id: 'ece1ebdfde57414700f23f1f4014f5e83d4f7644',\n\t\t\ttype: 'service_account',\n\t\t\tuniverse_domain: 'googleapis.com',\n\t\t\tprojectId: 'for-poc-325210',\n\t\t\tprivate_key:\n\t\t\t\t'-----BEGIN PRIVATE KEY-----\\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDPTk9M5nCDYJhC\\nLuyP+gqBXIHPrXegygco5tB50Y7Q9s/f4hm+xp/usYy5UCYyFVNjZ2mdjWQcr3Ta\\nT3GZV9OiHej8ejveY0iyFBi0IlfGNm9blYlOIyQT4i6MoevNul7u4EQL8bid/sp/\\nJ/XPNC+Jnk8Ke2G9FdfDYs+1O6Nf37HuPUmMwLAzcyl+k1v9UzInrgNPj+nactY7\\nEPCVSM6XcZI3UL86n574iQBvUXsMpUt3csYVOxPap1Vd1TBEo1k85jZepMvaXHoK\\nJUwQT7p1F1D0weVKJ1BjwQgmADZWfUKdwRyS8zFPbUGeptlA2XlxyVMasGzCCMi4\\n6jzJGC81AgMBAAECggEAXoaLnDn7Fbym0I7K6T+PKLtAqaykPpnAOAM/DjzijR/t\\nW12idZ3l8RXeX+VO9UlKE6pkuyVsf7P1aVIOL2ifpG1U/kLSJ65HyINnXEPImCXc\\nEvuVdx6I5dQde5ydg9o2TV/PR0756njyZpaW+9sEzhB0ZAgsYeai0oGsyiuebCkm\\nqlOnf5DO/kWlNvf8yZ7GMEa0WBYyan4O7YcVF13c7oM19XZfvw+l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a-core@for-poc-325210.iam.gserviceaccount.com',\n\t\t},\n\t});\n}\n\n/**\n * Fetches a secret directly from Secret Manager, bypassing the Redis-backed cache.\n * Needed for secrets required to construct {@link RedisService} itself (e.g. REDIS_URL),\n * since {@link SecretManagerService.getKey} depends on an already-constructed RedisService.\n */\nexport async function fetchSecretDirect(\n\tenvironment: EnvironmentConfigurationType,\n\tkey: string\n): Promise<string | undefined> {\n\ttry {\n\t\tconst client = createSecretManagerClient();\n\t\tconst environmentTransformedKey = environment + '_' + key;\n\n\t\tconst [accessResponse] = await client.accessSecretVersion({\n\t\t\tname: 'projects/' + SECRETS_PROJECT_ID + '/secrets/' + environmentTransformedKey + '/versions/latest',\n\t\t});\n\n\t\treturn accessResponse.payload!.data!.toString();\n\t} catch (e) {\n\t\tconsole.error(e);\n\t}\n}\n\n@Service()\nexport class SecretManagerService {\n\tprivate _configurationService!: ConfigurationService;\n\tprivate _redisManager!: RedisService;\n\tprivate _client!: SecretManagerServiceClient;\n\n\tconstructor(configurationService: ConfigurationService, redisManager: RedisService) {\n\t\tthis._configurationService = configurationService;\n\t\tthis._redisManager = redisManager;\n\t\tthis._client = createSecretManagerClient();\n\t}\n\n\tpublic async getKey(key: string): Promise<string | undefined> {\n\t\tconst environmentTransformedKey = this._configurationService?.options?.environment + '_' + key;\n\n\t\ttry {\n\t\t\tconst data = await this._redisManager.getCachedObjectByGroup<string>(\n\t\t\t\tthis?._configurationService?.options?.environment + '_KEYS',\n\t\t\t\tkey\n\t\t\t);\n\n\t\t\tif (data != undefined) {\n\t\t\t\treturn data;\n\t\t\t}\n\n\t\t\tconst [accessResponse] = await this._client.accessSecretVersion({\n\t\t\t\tname: 'projects/899369746265/secrets/' + environmentTransformedKey + '/versions/latest',\n\t\t\t});\n\n\t\t\tconst val = accessResponse.payload!.data!.toString();\n\n\t\t\tawait this.setKey(key, val);\n\n\t\t\treturn val;\n\t\t} catch (e) {\n\t\t\tconsole.error(e);\n\t\t}\n\t}\n\n\tpublic async setKey(key: string, value: string): Promise<string> {\n\t\tawait this._redisManager.setCachedObjectByGroup<string>(\n\t\t\tthis._configurationService.options.environment + '_KEYS',\n\t\t\tkey,\n\t\t\tvalue\n\t\t);\n\t\treturn value;\n\t}\n}\n"]}
@@ -20,13 +20,13 @@ export declare const ChatroomMessageSendOutputSchema: z.ZodObject<{
20
20
  name: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
21
21
  type: z.ZodNativeEnum<typeof UserRef>;
22
22
  }, "strip", z.ZodTypeAny, {
23
- type: UserRef;
24
23
  name: string;
25
24
  id: import("mongoose").Types.ObjectId;
26
- }, {
27
25
  type: UserRef;
26
+ }, {
28
27
  name: string;
29
28
  id: import("mongoose").Types.ObjectId;
29
+ type: UserRef;
30
30
  }>;
31
31
  content: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
32
32
  media: z.ZodArray<z.ZodObject<{
@@ -36,14 +36,14 @@ export declare const ChatroomMessageSendOutputSchema: z.ZodObject<{
36
36
  thumbnailUrl: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
37
37
  name: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
38
38
  }, "strip", z.ZodTypeAny, {
39
- mediaUrl: string;
40
39
  mediaType: MediaType;
40
+ mediaUrl: string;
41
41
  mimeType: string;
42
42
  name?: string | undefined;
43
43
  thumbnailUrl?: string | undefined;
44
44
  }, {
45
- mediaUrl: string;
46
45
  mediaType: MediaType;
46
+ mediaUrl: string;
47
47
  mimeType: string;
48
48
  name?: string | undefined;
49
49
  thumbnailUrl?: string | undefined;
@@ -63,17 +63,17 @@ export declare const ChatroomMessageSendOutputSchema: z.ZodObject<{
63
63
  orderId: z.ZodOptional<z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>>;
64
64
  createdAt: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, Date>;
65
65
  }, "strip", z.ZodTypeAny, {
66
- _id: import("mongoose").Types.ObjectId;
67
66
  createdAt: Date;
67
+ _id: import("mongoose").Types.ObjectId;
68
68
  sender: {
69
- type: UserRef;
70
69
  name: string;
71
70
  id: import("mongoose").Types.ObjectId;
71
+ type: UserRef;
72
72
  };
73
73
  senderType: UserRef;
74
74
  media: {
75
- mediaUrl: string;
76
75
  mediaType: MediaType;
76
+ mediaUrl: string;
77
77
  mimeType: string;
78
78
  name?: string | undefined;
79
79
  thumbnailUrl?: string | undefined;
@@ -89,17 +89,17 @@ export declare const ChatroomMessageSendOutputSchema: z.ZodObject<{
89
89
  content?: string | undefined;
90
90
  chatroomId?: import("mongoose").Types.ObjectId | undefined;
91
91
  }, {
92
- _id: import("mongoose").Types.ObjectId;
93
92
  createdAt: Date;
93
+ _id: import("mongoose").Types.ObjectId;
94
94
  sender: {
95
- type: UserRef;
96
95
  name: string;
97
96
  id: import("mongoose").Types.ObjectId;
97
+ type: UserRef;
98
98
  };
99
99
  senderType: UserRef;
100
100
  media: {
101
- mediaUrl: string;
102
101
  mediaType: MediaType;
102
+ mediaUrl: string;
103
103
  mimeType: string;
104
104
  name?: string | undefined;
105
105
  thumbnailUrl?: string | undefined;
@@ -124,14 +124,14 @@ export declare const ChatroomMessageSendPushOutputSchema: z.ZodObject<{
124
124
  }, "strip", z.ZodTypeAny, {
125
125
  type: ChatroomType;
126
126
  orderId?: import("mongoose").Types.ObjectId | undefined;
127
- ticketId?: import("mongoose").Types.ObjectId | undefined;
128
127
  lastMessage?: string | undefined;
128
+ ticketId?: import("mongoose").Types.ObjectId | undefined;
129
129
  chatroomId?: import("mongoose").Types.ObjectId | undefined;
130
130
  }, {
131
131
  type: ChatroomType;
132
132
  orderId?: import("mongoose").Types.ObjectId | undefined;
133
- ticketId?: import("mongoose").Types.ObjectId | undefined;
134
133
  lastMessage?: string | undefined;
134
+ ticketId?: import("mongoose").Types.ObjectId | undefined;
135
135
  chatroomId?: import("mongoose").Types.ObjectId | undefined;
136
136
  }>;
137
137
  export type ChatlistMessageSendPushOutputDTO = DTO<typeof ChatroomMessageSendPushOutputSchema>;
@@ -156,13 +156,13 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
156
156
  name: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
157
157
  type: z.ZodNativeEnum<typeof UserRef>;
158
158
  }, "strip", z.ZodTypeAny, {
159
- type: UserRef;
160
159
  name: string;
161
160
  id: import("mongoose").Types.ObjectId;
162
- }, {
163
161
  type: UserRef;
162
+ }, {
164
163
  name: string;
165
164
  id: import("mongoose").Types.ObjectId;
165
+ type: UserRef;
166
166
  }>;
167
167
  content: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
168
168
  media: z.ZodArray<z.ZodObject<{
@@ -172,14 +172,14 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
172
172
  thumbnailUrl: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
173
173
  name: z.ZodOptional<z.ZodString> | z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
174
174
  }, "strip", z.ZodTypeAny, {
175
- mediaUrl: string;
176
175
  mediaType: MediaType;
176
+ mediaUrl: string;
177
177
  mimeType: string;
178
178
  name?: string | undefined;
179
179
  thumbnailUrl?: string | undefined;
180
180
  }, {
181
- mediaUrl: string;
182
181
  mediaType: MediaType;
182
+ mediaUrl: string;
183
183
  mimeType: string;
184
184
  name?: string | undefined;
185
185
  thumbnailUrl?: string | undefined;
@@ -199,17 +199,17 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
199
199
  orderId: z.ZodOptional<z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>>;
200
200
  createdAt: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, Date>;
201
201
  }, "strip", z.ZodTypeAny, {
202
- _id: import("mongoose").Types.ObjectId;
203
202
  createdAt: Date;
203
+ _id: import("mongoose").Types.ObjectId;
204
204
  sender: {
205
- type: UserRef;
206
205
  name: string;
207
206
  id: import("mongoose").Types.ObjectId;
207
+ type: UserRef;
208
208
  };
209
209
  senderType: UserRef;
210
210
  media: {
211
- mediaUrl: string;
212
211
  mediaType: MediaType;
212
+ mediaUrl: string;
213
213
  mimeType: string;
214
214
  name?: string | undefined;
215
215
  thumbnailUrl?: string | undefined;
@@ -225,17 +225,17 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
225
225
  content?: string | undefined;
226
226
  chatroomId?: import("mongoose").Types.ObjectId | undefined;
227
227
  }, {
228
- _id: import("mongoose").Types.ObjectId;
229
228
  createdAt: Date;
229
+ _id: import("mongoose").Types.ObjectId;
230
230
  sender: {
231
- type: UserRef;
232
231
  name: string;
233
232
  id: import("mongoose").Types.ObjectId;
233
+ type: UserRef;
234
234
  };
235
235
  senderType: UserRef;
236
236
  media: {
237
- mediaUrl: string;
238
237
  mediaType: MediaType;
238
+ mediaUrl: string;
239
239
  mimeType: string;
240
240
  name?: string | undefined;
241
241
  thumbnailUrl?: string | undefined;
@@ -260,14 +260,14 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
260
260
  }, "strip", z.ZodTypeAny, {
261
261
  type: ChatroomType;
262
262
  orderId?: import("mongoose").Types.ObjectId | undefined;
263
- ticketId?: import("mongoose").Types.ObjectId | undefined;
264
263
  lastMessage?: string | undefined;
264
+ ticketId?: import("mongoose").Types.ObjectId | undefined;
265
265
  chatroomId?: import("mongoose").Types.ObjectId | undefined;
266
266
  }, {
267
267
  type: ChatroomType;
268
268
  orderId?: import("mongoose").Types.ObjectId | undefined;
269
- ticketId?: import("mongoose").Types.ObjectId | undefined;
270
269
  lastMessage?: string | undefined;
270
+ ticketId?: import("mongoose").Types.ObjectId | undefined;
271
271
  chatroomId?: import("mongoose").Types.ObjectId | undefined;
272
272
  }>;
273
273
  };
@@ -278,8 +278,8 @@ export declare class ChatroomMessageSendSocketEvent extends BaseSocketEvent<type
278
278
  getPushNotificationPayload(): {
279
279
  type: ChatroomType;
280
280
  orderId?: import("mongoose").Types.ObjectId | undefined;
281
- ticketId?: import("mongoose").Types.ObjectId | undefined;
282
281
  lastMessage?: string | undefined;
282
+ ticketId?: import("mongoose").Types.ObjectId | undefined;
283
283
  chatroomId?: import("mongoose").Types.ObjectId | undefined;
284
284
  } | undefined;
285
285
  protected getIdentifier(): string;
@@ -16,11 +16,11 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
16
16
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>;
17
17
  name: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
18
18
  }, "strip", z.ZodTypeAny, {
19
- _id: import("mongoose").Types.ObjectId;
20
19
  name: string;
20
+ _id: import("mongoose").Types.ObjectId;
21
21
  }, {
22
- _id: string | import("mongoose").Types.ObjectId;
23
22
  name: string;
23
+ _id: string | import("mongoose").Types.ObjectId;
24
24
  }>;
25
25
  orderStatus: z.ZodNativeEnum<typeof RegularOrderStatus>;
26
26
  orderAction: z.ZodNativeEnum<typeof OrderAction>;
@@ -39,8 +39,8 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
39
39
  riderTips: z.ZodNumber;
40
40
  secondaryRiderTips: z.ZodNumber;
41
41
  }, "strip", z.ZodTypeAny, {
42
- total: number;
43
42
  deliveryFee: number;
43
+ total: number;
44
44
  secondaryDeliveryFee: number;
45
45
  riderTips: number;
46
46
  secondaryRiderTips: number;
@@ -48,8 +48,8 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
48
48
  paidAmount: number;
49
49
  secondaryPaidAmount: number;
50
50
  }, {
51
- total: number;
52
51
  deliveryFee: number;
52
+ total: number;
53
53
  secondaryDeliveryFee: number;
54
54
  riderTips: number;
55
55
  secondaryRiderTips: number;
@@ -60,8 +60,8 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
60
60
  }, "strip", z.ZodTypeAny, {
61
61
  paymentMethod: PaymentMethod;
62
62
  pricing: {
63
- total: number;
64
63
  deliveryFee: number;
64
+ total: number;
65
65
  secondaryDeliveryFee: number;
66
66
  riderTips: number;
67
67
  secondaryRiderTips: number;
@@ -73,8 +73,8 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
73
73
  }, {
74
74
  paymentMethod: PaymentMethod;
75
75
  pricing: {
76
- total: number;
77
76
  deliveryFee: number;
77
+ total: number;
78
78
  secondaryDeliveryFee: number;
79
79
  riderTips: number;
80
80
  secondaryRiderTips: number;
@@ -88,21 +88,20 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
88
88
  triggerAt: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, Date>;
89
89
  orderActionType: z.ZodNativeEnum<typeof OrderAction>;
90
90
  }, "strip", z.ZodTypeAny, {
91
- _id: import("mongoose").Types.ObjectId;
92
91
  createdAt: Date;
92
+ _id: import("mongoose").Types.ObjectId;
93
93
  user: {
94
- _id: import("mongoose").Types.ObjectId;
95
94
  name: string;
95
+ _id: import("mongoose").Types.ObjectId;
96
96
  };
97
97
  orderId: string;
98
98
  shopId: import("mongoose").Types.ObjectId;
99
- paymentMethod: PaymentMethod;
100
99
  triggerAt: Date;
101
100
  adjustedFinance: {
102
101
  paymentMethod: PaymentMethod;
103
102
  pricing: {
104
- total: number;
105
103
  deliveryFee: number;
104
+ total: number;
106
105
  secondaryDeliveryFee: number;
107
106
  riderTips: number;
108
107
  secondaryRiderTips: number;
@@ -112,26 +111,26 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
112
111
  };
113
112
  shopProfit: number;
114
113
  };
114
+ paymentMethod: PaymentMethod;
115
115
  orderActionType: OrderAction;
116
116
  orderStatus: RegularOrderStatus;
117
117
  orderAction: OrderAction;
118
118
  preparationTimeMinutes: number;
119
119
  }, {
120
- _id: string | import("mongoose").Types.ObjectId;
121
120
  createdAt: Date;
121
+ _id: string | import("mongoose").Types.ObjectId;
122
122
  user: {
123
- _id: string | import("mongoose").Types.ObjectId;
124
123
  name: string;
124
+ _id: string | import("mongoose").Types.ObjectId;
125
125
  };
126
126
  orderId: string;
127
127
  shopId: string | import("mongoose").Types.ObjectId;
128
- paymentMethod: PaymentMethod;
129
128
  triggerAt: Date;
130
129
  adjustedFinance: {
131
130
  paymentMethod: PaymentMethod;
132
131
  pricing: {
133
- total: number;
134
132
  deliveryFee: number;
133
+ total: number;
135
134
  secondaryDeliveryFee: number;
136
135
  riderTips: number;
137
136
  secondaryRiderTips: number;
@@ -141,6 +140,7 @@ export declare const OrderActionsOutputSchema: z.ZodObject<{
141
140
  };
142
141
  shopProfit: number;
143
142
  };
143
+ paymentMethod: PaymentMethod;
144
144
  orderActionType: OrderAction;
145
145
  orderStatus: RegularOrderStatus;
146
146
  orderAction: OrderAction;
@@ -160,11 +160,11 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
160
160
  _id: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, import("mongoose").Types.ObjectId, string>, z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>]>;
161
161
  name: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
162
162
  }, "strip", z.ZodTypeAny, {
163
- _id: import("mongoose").Types.ObjectId;
164
163
  name: string;
164
+ _id: import("mongoose").Types.ObjectId;
165
165
  }, {
166
- _id: string | import("mongoose").Types.ObjectId;
167
166
  name: string;
167
+ _id: string | import("mongoose").Types.ObjectId;
168
168
  }>;
169
169
  orderStatus: z.ZodNativeEnum<typeof RegularOrderStatus>;
170
170
  orderAction: z.ZodNativeEnum<typeof OrderAction>;
@@ -183,8 +183,8 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
183
183
  riderTips: z.ZodNumber;
184
184
  secondaryRiderTips: z.ZodNumber;
185
185
  }, "strip", z.ZodTypeAny, {
186
- total: number;
187
186
  deliveryFee: number;
187
+ total: number;
188
188
  secondaryDeliveryFee: number;
189
189
  riderTips: number;
190
190
  secondaryRiderTips: number;
@@ -192,8 +192,8 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
192
192
  paidAmount: number;
193
193
  secondaryPaidAmount: number;
194
194
  }, {
195
- total: number;
196
195
  deliveryFee: number;
196
+ total: number;
197
197
  secondaryDeliveryFee: number;
198
198
  riderTips: number;
199
199
  secondaryRiderTips: number;
@@ -204,8 +204,8 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
204
204
  }, "strip", z.ZodTypeAny, {
205
205
  paymentMethod: PaymentMethod;
206
206
  pricing: {
207
- total: number;
208
207
  deliveryFee: number;
208
+ total: number;
209
209
  secondaryDeliveryFee: number;
210
210
  riderTips: number;
211
211
  secondaryRiderTips: number;
@@ -217,8 +217,8 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
217
217
  }, {
218
218
  paymentMethod: PaymentMethod;
219
219
  pricing: {
220
- total: number;
221
220
  deliveryFee: number;
221
+ total: number;
222
222
  secondaryDeliveryFee: number;
223
223
  riderTips: number;
224
224
  secondaryRiderTips: number;
@@ -232,21 +232,20 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
232
232
  triggerAt: z.ZodEffects<z.ZodEffects<z.ZodDate, Date, Date>, Date, Date>;
233
233
  orderActionType: z.ZodNativeEnum<typeof OrderAction>;
234
234
  }, "strip", z.ZodTypeAny, {
235
- _id: import("mongoose").Types.ObjectId;
236
235
  createdAt: Date;
236
+ _id: import("mongoose").Types.ObjectId;
237
237
  user: {
238
- _id: import("mongoose").Types.ObjectId;
239
238
  name: string;
239
+ _id: import("mongoose").Types.ObjectId;
240
240
  };
241
241
  orderId: string;
242
242
  shopId: import("mongoose").Types.ObjectId;
243
- paymentMethod: PaymentMethod;
244
243
  triggerAt: Date;
245
244
  adjustedFinance: {
246
245
  paymentMethod: PaymentMethod;
247
246
  pricing: {
248
- total: number;
249
247
  deliveryFee: number;
248
+ total: number;
250
249
  secondaryDeliveryFee: number;
251
250
  riderTips: number;
252
251
  secondaryRiderTips: number;
@@ -256,26 +255,26 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
256
255
  };
257
256
  shopProfit: number;
258
257
  };
258
+ paymentMethod: PaymentMethod;
259
259
  orderActionType: OrderAction;
260
260
  orderStatus: RegularOrderStatus;
261
261
  orderAction: OrderAction;
262
262
  preparationTimeMinutes: number;
263
263
  }, {
264
- _id: string | import("mongoose").Types.ObjectId;
265
264
  createdAt: Date;
265
+ _id: string | import("mongoose").Types.ObjectId;
266
266
  user: {
267
- _id: string | import("mongoose").Types.ObjectId;
268
267
  name: string;
268
+ _id: string | import("mongoose").Types.ObjectId;
269
269
  };
270
270
  orderId: string;
271
271
  shopId: string | import("mongoose").Types.ObjectId;
272
- paymentMethod: PaymentMethod;
273
272
  triggerAt: Date;
274
273
  adjustedFinance: {
275
274
  paymentMethod: PaymentMethod;
276
275
  pricing: {
277
- total: number;
278
276
  deliveryFee: number;
277
+ total: number;
279
278
  secondaryDeliveryFee: number;
280
279
  riderTips: number;
281
280
  secondaryRiderTips: number;
@@ -285,6 +284,7 @@ export declare class OrderActionsSocketEvent extends BaseSocketEvent<typeof Orde
285
284
  };
286
285
  shopProfit: number;
287
286
  };
287
+ paymentMethod: PaymentMethod;
288
288
  orderActionType: OrderAction;
289
289
  orderStatus: RegularOrderStatus;
290
290
  orderAction: OrderAction;
@@ -19,18 +19,18 @@ export declare const RiderLocationUpdateSocketOutputSchema: z.ZodObject<{
19
19
  bearing: z.ZodOptional<z.ZodNumber>;
20
20
  updatedAt: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Date, string>, z.ZodDate]>, Date, string | Date>, Date, string | Date>;
21
21
  }, "strip", z.ZodTypeAny, {
22
- _id: import("mongoose").Types.ObjectId;
23
22
  updatedAt: Date;
23
+ _id: import("mongoose").Types.ObjectId;
24
+ riderId: import("mongoose").Types.ObjectId;
24
25
  latitude: number;
25
26
  longitude: number;
26
- riderId: import("mongoose").Types.ObjectId;
27
27
  bearing?: number | undefined;
28
28
  }, {
29
- _id: string | import("mongoose").Types.ObjectId;
30
29
  updatedAt: string | Date;
30
+ _id: string | import("mongoose").Types.ObjectId;
31
+ riderId: string | import("mongoose").Types.ObjectId;
31
32
  latitude: number;
32
33
  longitude: number;
33
- riderId: string | import("mongoose").Types.ObjectId;
34
34
  bearing?: number | undefined;
35
35
  }>;
36
36
  export type RiderLocationUpdateSocketInputDTO = DTO<typeof RiderLocationUpdateSocketInputSchema>;
@@ -55,18 +55,18 @@ export declare class RiderLocationUpdateSocketEvent extends BaseSocketEvent<type
55
55
  bearing: z.ZodOptional<z.ZodNumber>;
56
56
  updatedAt: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Date, string>, z.ZodDate]>, Date, string | Date>, Date, string | Date>;
57
57
  }, "strip", z.ZodTypeAny, {
58
- _id: import("mongoose").Types.ObjectId;
59
58
  updatedAt: Date;
59
+ _id: import("mongoose").Types.ObjectId;
60
+ riderId: import("mongoose").Types.ObjectId;
60
61
  latitude: number;
61
62
  longitude: number;
62
- riderId: import("mongoose").Types.ObjectId;
63
63
  bearing?: number | undefined;
64
64
  }, {
65
- _id: string | import("mongoose").Types.ObjectId;
66
65
  updatedAt: string | Date;
66
+ _id: string | import("mongoose").Types.ObjectId;
67
+ riderId: string | import("mongoose").Types.ObjectId;
67
68
  latitude: number;
68
69
  longitude: number;
69
- riderId: string | import("mongoose").Types.ObjectId;
70
70
  bearing?: number | undefined;
71
71
  }>;
72
72
  };
@@ -13,18 +13,18 @@ export declare const TicketActionsSocketOutputSchema: z.ZodObject<{
13
13
  silent: z.ZodOptional<z.ZodBoolean>;
14
14
  }, "strip", z.ZodTypeAny, {
15
15
  status: TicketStatus;
16
- type: TicketType;
17
16
  _id: import("mongoose").Types.ObjectId;
18
- silent?: boolean | undefined;
17
+ type: TicketType;
19
18
  title?: string | undefined;
20
19
  content?: string | undefined;
20
+ silent?: boolean | undefined;
21
21
  }, {
22
22
  status: TicketStatus;
23
- type: TicketType;
24
23
  _id: import("mongoose").Types.ObjectId;
25
- silent?: boolean | undefined;
24
+ type: TicketType;
26
25
  title?: string | undefined;
27
26
  content?: string | undefined;
27
+ silent?: boolean | undefined;
28
28
  }>;
29
29
  export declare const TicketActionsPushOutputSchema: z.ZodObject<{
30
30
  ticketId: z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>;
@@ -60,18 +60,18 @@ export declare class TicketActionsSocketEvent extends BaseSocketEvent<typeof Tic
60
60
  silent: z.ZodOptional<z.ZodBoolean>;
61
61
  }, "strip", z.ZodTypeAny, {
62
62
  status: TicketStatus;
63
- type: TicketType;
64
63
  _id: import("mongoose").Types.ObjectId;
65
- silent?: boolean | undefined;
64
+ type: TicketType;
66
65
  title?: string | undefined;
67
66
  content?: string | undefined;
67
+ silent?: boolean | undefined;
68
68
  }, {
69
69
  status: TicketStatus;
70
- type: TicketType;
71
70
  _id: import("mongoose").Types.ObjectId;
72
- silent?: boolean | undefined;
71
+ type: TicketType;
73
72
  title?: string | undefined;
74
73
  content?: string | undefined;
74
+ silent?: boolean | undefined;
75
75
  }>;
76
76
  pushNotificationOutput: z.ZodObject<{
77
77
  ticketId: z.ZodEffects<z.ZodType<import("mongoose").Types.ObjectId, z.ZodTypeDef, import("mongoose").Types.ObjectId>, import("mongoose").Types.ObjectId, import("mongoose").Types.ObjectId>;
@@ -13,14 +13,14 @@ export declare const TicketAssignSocketOutputSchema: z.ZodObject<{
13
13
  name: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
14
14
  profilePhoto: z.ZodNullable<z.ZodString> | z.ZodNullable<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
15
15
  }, "strip", z.ZodTypeAny, {
16
- type: UserRef;
17
- _id: import("mongoose").Types.ObjectId;
18
16
  name: string;
17
+ _id: import("mongoose").Types.ObjectId;
18
+ type: UserRef;
19
19
  profilePhoto: string | null;
20
20
  }, {
21
- type: UserRef;
22
- _id: string | import("mongoose").Types.ObjectId;
23
21
  name: string;
22
+ _id: string | import("mongoose").Types.ObjectId;
23
+ type: UserRef;
24
24
  profilePhoto: string | null;
25
25
  }>;
26
26
  createdAt: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Date, string>, z.ZodDate]>, Date, string | Date>, Date, string | Date>;
@@ -40,40 +40,40 @@ export declare const TicketAssignSocketOutputSchema: z.ZodObject<{
40
40
  unreadCount: z.ZodNumber;
41
41
  }, "strip", z.ZodTypeAny, {
42
42
  status: TicketStatus;
43
- type: TicketType;
44
- _id: import("mongoose").Types.ObjectId;
45
43
  createdAt: Date;
46
44
  updatedAt: Date;
45
+ _id: import("mongoose").Types.ObjectId;
46
+ type: TicketType;
47
47
  lastMessage: {
48
48
  createdAt: Date;
49
49
  content: string;
50
50
  };
51
- unreadCount: number;
52
51
  client: {
53
- type: UserRef;
54
- _id: import("mongoose").Types.ObjectId;
55
52
  name: string;
53
+ _id: import("mongoose").Types.ObjectId;
54
+ type: UserRef;
56
55
  profilePhoto: string | null;
57
56
  };
57
+ unreadCount: number;
58
58
  chatroomId: import("mongoose").Types.ObjectId;
59
59
  orderId?: import("mongoose").Types.ObjectId | undefined;
60
60
  }, {
61
61
  status: TicketStatus;
62
- type: TicketType;
63
- _id: string | import("mongoose").Types.ObjectId;
64
62
  createdAt: string | Date;
65
63
  updatedAt: string | Date;
64
+ _id: string | import("mongoose").Types.ObjectId;
65
+ type: TicketType;
66
66
  lastMessage: {
67
67
  createdAt: string | Date;
68
68
  content: string;
69
69
  };
70
- unreadCount: number;
71
70
  client: {
72
- type: UserRef;
73
- _id: string | import("mongoose").Types.ObjectId;
74
71
  name: string;
72
+ _id: string | import("mongoose").Types.ObjectId;
73
+ type: UserRef;
75
74
  profilePhoto: string | null;
76
75
  };
76
+ unreadCount: number;
77
77
  chatroomId: string | import("mongoose").Types.ObjectId;
78
78
  orderId?: string | import("mongoose").Types.ObjectId | undefined;
79
79
  }>;
@@ -91,14 +91,14 @@ export declare class TicketAssignEvent extends BaseSocketEvent<typeof TicketAssi
91
91
  name: z.ZodString | z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
92
92
  profilePhoto: z.ZodNullable<z.ZodString> | z.ZodNullable<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
93
93
  }, "strip", z.ZodTypeAny, {
94
- type: UserRef;
95
- _id: import("mongoose").Types.ObjectId;
96
94
  name: string;
95
+ _id: import("mongoose").Types.ObjectId;
96
+ type: UserRef;
97
97
  profilePhoto: string | null;
98
98
  }, {
99
- type: UserRef;
100
- _id: string | import("mongoose").Types.ObjectId;
101
99
  name: string;
100
+ _id: string | import("mongoose").Types.ObjectId;
101
+ type: UserRef;
102
102
  profilePhoto: string | null;
103
103
  }>;
104
104
  createdAt: z.ZodEffects<z.ZodEffects<z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, Date, string>, z.ZodDate]>, Date, string | Date>, Date, string | Date>;
@@ -118,40 +118,40 @@ export declare class TicketAssignEvent extends BaseSocketEvent<typeof TicketAssi
118
118
  unreadCount: z.ZodNumber;
119
119
  }, "strip", z.ZodTypeAny, {
120
120
  status: TicketStatus;
121
- type: TicketType;
122
- _id: import("mongoose").Types.ObjectId;
123
121
  createdAt: Date;
124
122
  updatedAt: Date;
123
+ _id: import("mongoose").Types.ObjectId;
124
+ type: TicketType;
125
125
  lastMessage: {
126
126
  createdAt: Date;
127
127
  content: string;
128
128
  };
129
- unreadCount: number;
130
129
  client: {
131
- type: UserRef;
132
- _id: import("mongoose").Types.ObjectId;
133
130
  name: string;
131
+ _id: import("mongoose").Types.ObjectId;
132
+ type: UserRef;
134
133
  profilePhoto: string | null;
135
134
  };
135
+ unreadCount: number;
136
136
  chatroomId: import("mongoose").Types.ObjectId;
137
137
  orderId?: import("mongoose").Types.ObjectId | undefined;
138
138
  }, {
139
139
  status: TicketStatus;
140
- type: TicketType;
141
- _id: string | import("mongoose").Types.ObjectId;
142
140
  createdAt: string | Date;
143
141
  updatedAt: string | Date;
142
+ _id: string | import("mongoose").Types.ObjectId;
143
+ type: TicketType;
144
144
  lastMessage: {
145
145
  createdAt: string | Date;
146
146
  content: string;
147
147
  };
148
- unreadCount: number;
149
148
  client: {
150
- type: UserRef;
151
- _id: string | import("mongoose").Types.ObjectId;
152
149
  name: string;
150
+ _id: string | import("mongoose").Types.ObjectId;
151
+ type: UserRef;
153
152
  profilePhoto: string | null;
154
153
  };
154
+ unreadCount: number;
155
155
  chatroomId: string | import("mongoose").Types.ObjectId;
156
156
  orderId?: string | import("mongoose").Types.ObjectId | undefined;
157
157
  }>;
@@ -22,7 +22,7 @@ Perfect for sharing types between frontend and backend applications.
22
22
 
23
23
  ## Version
24
24
 
25
- Version: 1.4.314
25
+ Version: 1.4.315
26
26
 
27
27
  ## Dependencies
28
28
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyxa.ai/types",
3
- "version": "1.4.314",
3
+ "version": "1.4.315",
4
4
  "description": "Lyxa type definitions and validation schemas for both frontend and backend",
5
5
  "author": "elie <42282499+Internalizable@users.noreply.github.com>",
6
6
  "license": "MIT",
@@ -1,2 +1,3 @@
1
1
  import { EnvironmentConfigurationType } from '../../libraries/configuration/types/EnvironmentConfigurationType';
2
- export declare const RabbitMQUrlMap: Record<EnvironmentConfigurationType, string>;
2
+ import { SecretManagerService } from '../../libraries/secrets';
3
+ export declare function getRabbitMQUrl(environment: EnvironmentConfigurationType, secretManagerService: SecretManagerService): Promise<string>;
@@ -1,14 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RabbitMQUrlMap = void 0;
3
+ exports.getRabbitMQUrl = getRabbitMQUrl;
4
4
  const EnvironmentConfigurationType_1 = require("../../libraries/configuration/types/EnvironmentConfigurationType");
5
- exports.RabbitMQUrlMap = {
6
- [EnvironmentConfigurationType_1.EnvironmentConfigurationType.LOCAL]: '',
7
- [EnvironmentConfigurationType_1.EnvironmentConfigurationType.MOCK]: '',
8
- [EnvironmentConfigurationType_1.EnvironmentConfigurationType.DEV]: 'amqps://adlvedna:oY_X4qH1AphtB83YNcf9DHMO3UVmX23s@dog.lmq.cloudamqp.com/adlvedna',
9
- [EnvironmentConfigurationType_1.EnvironmentConfigurationType.PREPROD]: 'amqps://ndzofsci:ItlgvubZLAdmc13eF6sULXy9TxWKmdPU@dog.lmq.cloudamqp.com/ndzofsci',
10
- [EnvironmentConfigurationType_1.EnvironmentConfigurationType.STAGING]: 'amqps://pkyqvrvt:R5DRopXgBoHkprIyrarUj_MOXiLfgvGW@dog.lmq.cloudamqp.com/pkyqvrvt',
11
- [EnvironmentConfigurationType_1.EnvironmentConfigurationType.MIGRATION]: 'amqps://napncdtl:cRqTXDMdEQ02u_hnBnyJ5I20TOPc4C36@dog.lmq.cloudamqp.com/napncdtl',
12
- [EnvironmentConfigurationType_1.EnvironmentConfigurationType.PROD]: 'amqps://witvvsxj:etcoOPd_L1X4wX6Y9r9MUtuSmDK11Kmb@dog.lmq.cloudamqp.com/witvvsxj',
13
- };
5
+ const LOCAL_ENVIRONMENTS = new Set([
6
+ EnvironmentConfigurationType_1.EnvironmentConfigurationType.LOCAL,
7
+ EnvironmentConfigurationType_1.EnvironmentConfigurationType.MOCK,
8
+ ]);
9
+ async function getRabbitMQUrl(environment, secretManagerService) {
10
+ if (LOCAL_ENVIRONMENTS.has(environment)) {
11
+ return '';
12
+ }
13
+ const rabbitMQUrl = await secretManagerService.getKey('RABBITMQ_URL');
14
+ return rabbitMQUrl ?? '';
15
+ }
14
16
  //# sourceMappingURL=rabbitmq-environments.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rabbitmq-environments.js","sourceRoot":"/","sources":["utilities/environment/rabbitmq-environments.ts"],"names":[],"mappings":";;;AAAA,mHAAgH;AAEnG,QAAA,cAAc,GAAiD;IAC3E,CAAC,2DAA4B,CAAC,KAAK,CAAC,EAAE,EAAE;IACxC,CAAC,2DAA4B,CAAC,IAAI,CAAC,EAAE,EAAE;IACvC,CAAC,2DAA4B,CAAC,GAAG,CAAC,EACjC,kFAAkF;IACnF,CAAC,2DAA4B,CAAC,OAAO,CAAC,EACpC,kFAAkF;IAEpF,CAAC,2DAA4B,CAAC,OAAO,CAAC,EACrC,kFAAkF;IACnF,CAAC,2DAA4B,CAAC,SAAS,CAAC,EACvC,kFAAkF;IACnF,CAAC,2DAA4B,CAAC,IAAI,CAAC,EAClC,kFAAkF;CACnF,CAAC","sourcesContent":["import { EnvironmentConfigurationType } from '../../libraries/configuration/types/EnvironmentConfigurationType';\n\nexport const RabbitMQUrlMap: Record<EnvironmentConfigurationType, string> = {\n\t[EnvironmentConfigurationType.LOCAL]: '',\n\t[EnvironmentConfigurationType.MOCK]: '',\n\t[EnvironmentConfigurationType.DEV]:\n\t\t'amqps://adlvedna:oY_X4qH1AphtB83YNcf9DHMO3UVmX23s@dog.lmq.cloudamqp.com/adlvedna',\n\t[EnvironmentConfigurationType.PREPROD]:\n\t\t\t'amqps://ndzofsci:ItlgvubZLAdmc13eF6sULXy9TxWKmdPU@dog.lmq.cloudamqp.com/ndzofsci',\n\t\t// 'amqp://ndzofsci:ItlgvubZLAdmc13eF6sULXy9TxWKmdPU@34.62.237.172:5672', // SELF HOSTED\n\t[EnvironmentConfigurationType.STAGING]:\n\t\t'amqps://pkyqvrvt:R5DRopXgBoHkprIyrarUj_MOXiLfgvGW@dog.lmq.cloudamqp.com/pkyqvrvt',\n\t[EnvironmentConfigurationType.MIGRATION]:\n\t\t'amqps://napncdtl:cRqTXDMdEQ02u_hnBnyJ5I20TOPc4C36@dog.lmq.cloudamqp.com/napncdtl',\n\t[EnvironmentConfigurationType.PROD]:\n\t\t'amqps://witvvsxj:etcoOPd_L1X4wX6Y9r9MUtuSmDK11Kmb@dog.lmq.cloudamqp.com/witvvsxj',\n};\n"]}
1
+ {"version":3,"file":"rabbitmq-environments.js","sourceRoot":"/","sources":["utilities/environment/rabbitmq-environments.ts"],"names":[],"mappings":";;AAQA,wCAWC;AAnBD,mHAAgH;AAGhH,MAAM,kBAAkB,GAA8C,IAAI,GAAG,CAAC;IAC7E,2DAA4B,CAAC,KAAK;IAClC,2DAA4B,CAAC,IAAI;CACjC,CAAC,CAAC;AAEI,KAAK,UAAU,cAAc,CACnC,WAAyC,EACzC,oBAA0C;IAE1C,IAAI,kBAAkB,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;QACzC,OAAO,EAAE,CAAC;IACX,CAAC;IAED,MAAM,WAAW,GAAG,MAAM,oBAAoB,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;IAEtE,OAAO,WAAW,IAAI,EAAE,CAAC;AAC1B,CAAC","sourcesContent":["import { EnvironmentConfigurationType } from '../../libraries/configuration/types/EnvironmentConfigurationType';\nimport { SecretManagerService } from '../../libraries/secrets';\n\nconst LOCAL_ENVIRONMENTS: ReadonlySet<EnvironmentConfigurationType> = new Set([\n\tEnvironmentConfigurationType.LOCAL,\n\tEnvironmentConfigurationType.MOCK,\n]);\n\nexport async function getRabbitMQUrl(\n\tenvironment: EnvironmentConfigurationType,\n\tsecretManagerService: SecretManagerService\n): Promise<string> {\n\tif (LOCAL_ENVIRONMENTS.has(environment)) {\n\t\treturn '';\n\t}\n\n\tconst rabbitMQUrl = await secretManagerService.getKey('RABBITMQ_URL');\n\n\treturn rabbitMQUrl ?? '';\n}\n"]}
@@ -1,2 +1,2 @@
1
1
  import { EnvironmentConfigurationType } from '../../libraries/configuration/types/EnvironmentConfigurationType';
2
- export declare const RedisUrlMap: Record<EnvironmentConfigurationType, string>;
2
+ export declare function getRedisUrl(environment: EnvironmentConfigurationType): Promise<string>;
@@ -1,14 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RedisUrlMap = void 0;
3
+ exports.getRedisUrl = getRedisUrl;
4
4
  const EnvironmentConfigurationType_1 = require("../../libraries/configuration/types/EnvironmentConfigurationType");
5
- exports.RedisUrlMap = {
6
- [EnvironmentConfigurationType_1.EnvironmentConfigurationType.LOCAL]: '',
7
- [EnvironmentConfigurationType_1.EnvironmentConfigurationType.MOCK]: '',
8
- [EnvironmentConfigurationType_1.EnvironmentConfigurationType.DEV]: 'redis://default:nkrBeCA41QyMaLH00mj67CWf3Muz9ubc@redis-12266.fcrce173.eu-west-1-1.ec2.redns.redis-cloud.com:12266',
9
- [EnvironmentConfigurationType_1.EnvironmentConfigurationType.PREPROD]: 'redis://default:ngpwdRevVIBGVIvtBoLO7tE8jPzBdGLh@redis-12965.fcrce173.eu-west-1-1.ec2.redns.redis-cloud.com:12965',
10
- [EnvironmentConfigurationType_1.EnvironmentConfigurationType.STAGING]: 'redis://default:5QynNeFWdCcBcu3QVNR2LbfLlWcxdP4o@redis-10162.fcrce173.eu-west-1-1.ec2.redns.redis-cloud.com:10162',
11
- [EnvironmentConfigurationType_1.EnvironmentConfigurationType.MIGRATION]: 'redis://default:E7qfnmO5ENgWi51Wfk1LAZJHamJS1HpY@redis-17414.c304.europe-west1-2.gce.cloud.redislabs.com:17414',
12
- [EnvironmentConfigurationType_1.EnvironmentConfigurationType.PROD]: 'redis://default:RFdRld7ZxRKRLzUS3dfNgobSjw44QDir@redis-15191.c304.europe-west1-2.gce.cloud.redislabs.com:15191',
13
- };
5
+ const secrets_1 = require("../../libraries/secrets");
6
+ const LOCAL_ENVIRONMENTS = new Set([
7
+ EnvironmentConfigurationType_1.EnvironmentConfigurationType.LOCAL,
8
+ EnvironmentConfigurationType_1.EnvironmentConfigurationType.MOCK,
9
+ ]);
10
+ async function getRedisUrl(environment) {
11
+ if (LOCAL_ENVIRONMENTS.has(environment)) {
12
+ return '';
13
+ }
14
+ const redisUrl = await (0, secrets_1.fetchSecretDirect)(environment, 'REDIS_URL');
15
+ return redisUrl ?? '';
16
+ }
14
17
  //# sourceMappingURL=redis-environments.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"redis-environments.js","sourceRoot":"/","sources":["utilities/environment/redis-environments.ts"],"names":[],"mappings":";;;AAAA,mHAAgH;AAEnG,QAAA,WAAW,GAAiD;IACxE,CAAC,2DAA4B,CAAC,KAAK,CAAC,EAAE,EAAE;IACxC,CAAC,2DAA4B,CAAC,IAAI,CAAC,EAAE,EAAE;IACvC,CAAC,2DAA4B,CAAC,GAAG,CAAC,EACjC,mHAAmH;IACpH,CAAC,2DAA4B,CAAC,OAAO,CAAC,EACrC,mHAAmH;IACpH,CAAC,2DAA4B,CAAC,OAAO,CAAC,EACrC,mHAAmH;IACpH,CAAC,2DAA4B,CAAC,SAAS,CAAC,EACvC,gHAAgH;IACjH,CAAC,2DAA4B,CAAC,IAAI,CAAC,EAClC,gHAAgH;CACjH,CAAC","sourcesContent":["import { EnvironmentConfigurationType } from '../../libraries/configuration/types/EnvironmentConfigurationType';\n\nexport const RedisUrlMap: Record<EnvironmentConfigurationType, string> = {\n\t[EnvironmentConfigurationType.LOCAL]: '',\n\t[EnvironmentConfigurationType.MOCK]: '',\n\t[EnvironmentConfigurationType.DEV]:\n\t\t'redis://default:nkrBeCA41QyMaLH00mj67CWf3Muz9ubc@redis-12266.fcrce173.eu-west-1-1.ec2.redns.redis-cloud.com:12266',\n\t[EnvironmentConfigurationType.PREPROD]:\n\t\t'redis://default:ngpwdRevVIBGVIvtBoLO7tE8jPzBdGLh@redis-12965.fcrce173.eu-west-1-1.ec2.redns.redis-cloud.com:12965',\n\t[EnvironmentConfigurationType.STAGING]:\n\t\t'redis://default:5QynNeFWdCcBcu3QVNR2LbfLlWcxdP4o@redis-10162.fcrce173.eu-west-1-1.ec2.redns.redis-cloud.com:10162',\n\t[EnvironmentConfigurationType.MIGRATION]:\n\t\t'redis://default:E7qfnmO5ENgWi51Wfk1LAZJHamJS1HpY@redis-17414.c304.europe-west1-2.gce.cloud.redislabs.com:17414',\n\t[EnvironmentConfigurationType.PROD]:\n\t\t'redis://default:RFdRld7ZxRKRLzUS3dfNgobSjw44QDir@redis-15191.c304.europe-west1-2.gce.cloud.redislabs.com:15191',\n};\n"]}
1
+ {"version":3,"file":"redis-environments.js","sourceRoot":"/","sources":["utilities/environment/redis-environments.ts"],"names":[],"mappings":";;AAQA,kCAQC;AAhBD,mHAAgH;AAChH,qDAA4D;AAE5D,MAAM,kBAAkB,GAA8C,IAAI,GAAG,CAAC;IAC7E,2DAA4B,CAAC,KAAK;IAClC,2DAA4B,CAAC,IAAI;CACjC,CAAC,CAAC;AAEI,KAAK,UAAU,WAAW,CAAC,WAAyC;IAC1E,IAAI,kBAAkB,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;QACzC,OAAO,EAAE,CAAC;IACX,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,IAAA,2BAAiB,EAAC,WAAW,EAAE,WAAW,CAAC,CAAC;IAEnE,OAAO,QAAQ,IAAI,EAAE,CAAC;AACvB,CAAC","sourcesContent":["import { EnvironmentConfigurationType } from '../../libraries/configuration/types/EnvironmentConfigurationType';\nimport { fetchSecretDirect } from '../../libraries/secrets';\n\nconst LOCAL_ENVIRONMENTS: ReadonlySet<EnvironmentConfigurationType> = new Set([\n\tEnvironmentConfigurationType.LOCAL,\n\tEnvironmentConfigurationType.MOCK,\n]);\n\nexport async function getRedisUrl(environment: EnvironmentConfigurationType): Promise<string> {\n\tif (LOCAL_ENVIRONMENTS.has(environment)) {\n\t\treturn '';\n\t}\n\n\tconst redisUrl = await fetchSecretDirect(environment, 'REDIS_URL');\n\n\treturn redisUrl ?? '';\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lyxa.ai/core",
3
- "version": "1.4.314",
3
+ "version": "1.4.315",
4
4
  "description": "The Core system of the Lyxa services.",
5
5
  "author": "elie <42282499+Internalizable@users.noreply.github.com>",
6
6
  "license": "MIT",