@ductape/sdk 0.1.7 → 0.1.8
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/package.json +4 -2
- package/dist/agents/agent-context.d.ts +0 -100
- package/dist/agents/agent-context.js +0 -604
- package/dist/agents/agent-context.js.map +0 -1
- package/dist/agents/agent-executor.d.ts +0 -180
- package/dist/agents/agent-executor.js +0 -715
- package/dist/agents/agent-executor.js.map +0 -1
- package/dist/agents/agents.service.d.ts +0 -310
- package/dist/agents/agents.service.js +0 -1255
- package/dist/agents/agents.service.js.map +0 -1
- package/dist/agents/index.d.ts +0 -55
- package/dist/agents/index.js +0 -110
- package/dist/agents/index.js.map +0 -1
- package/dist/agents/memory-manager.d.ts +0 -182
- package/dist/agents/memory-manager.js +0 -383
- package/dist/agents/memory-manager.js.map +0 -1
- package/dist/agents/tool-registry.d.ts +0 -141
- package/dist/agents/tool-registry.js +0 -355
- package/dist/agents/tool-registry.js.map +0 -1
- package/dist/agents/types/agents.types.d.ts +0 -1240
- package/dist/agents/types/agents.types.js +0 -12
- package/dist/agents/types/agents.types.js.map +0 -1
- package/dist/agents/types/index.d.ts +0 -6
- package/dist/agents/types/index.js +0 -23
- package/dist/agents/types/index.js.map +0 -1
- package/dist/agents/vector-store-adapter.d.ts +0 -108
- package/dist/agents/vector-store-adapter.js +0 -213
- package/dist/agents/vector-store-adapter.js.map +0 -1
- package/dist/api/services/appApi.service.d.ts +0 -78
- package/dist/api/services/appApi.service.js +0 -303
- package/dist/api/services/appApi.service.js.map +0 -1
- package/dist/api/services/logsApi.service.d.ts +0 -62
- package/dist/api/services/logsApi.service.js +0 -67
- package/dist/api/services/logsApi.service.js.map +0 -1
- package/dist/api/services/pricingApi.service.d.ts +0 -10
- package/dist/api/services/pricingApi.service.js +0 -34
- package/dist/api/services/pricingApi.service.js.map +0 -1
- package/dist/api/services/processorApi.service.d.ts +0 -927
- package/dist/api/services/processorApi.service.js +0 -787
- package/dist/api/services/processorApi.service.js.map +0 -1
- package/dist/api/services/productsApi.service.d.ts +0 -150
- package/dist/api/services/productsApi.service.js +0 -279
- package/dist/api/services/productsApi.service.js.map +0 -1
- package/dist/api/services/resilienceApi.service.d.ts +0 -106
- package/dist/api/services/resilienceApi.service.js +0 -224
- package/dist/api/services/resilienceApi.service.js.map +0 -1
- package/dist/api/services/secretsApi.service.d.ts +0 -51
- package/dist/api/services/secretsApi.service.js +0 -126
- package/dist/api/services/secretsApi.service.js.map +0 -1
- package/dist/api/services/userApi.service.d.ts +0 -10
- package/dist/api/services/userApi.service.js +0 -20
- package/dist/api/services/userApi.service.js.map +0 -1
- package/dist/api/services/webhooksApi.service.d.ts +0 -14
- package/dist/api/services/webhooksApi.service.js +0 -65
- package/dist/api/services/webhooksApi.service.js.map +0 -1
- package/dist/api/services/workflowApi.service.d.ts +0 -199
- package/dist/api/services/workflowApi.service.js +0 -201
- package/dist/api/services/workflowApi.service.js.map +0 -1
- package/dist/api/services/workspaceApi.service.d.ts +0 -20
- package/dist/api/services/workspaceApi.service.js +0 -54
- package/dist/api/services/workspaceApi.service.js.map +0 -1
- package/dist/api/urls.d.ts +0 -136
- package/dist/api/urls.js +0 -185
- package/dist/api/urls.js.map +0 -1
- package/dist/api/utils/auth.utils.d.ts +0 -10
- package/dist/api/utils/auth.utils.js +0 -24
- package/dist/api/utils/auth.utils.js.map +0 -1
- package/dist/api/utils/cache.utils.d.ts +0 -3
- package/dist/api/utils/cache.utils.js +0 -18
- package/dist/api/utils/cache.utils.js.map +0 -1
- package/dist/api/utils/strings.utils.d.ts +0 -7
- package/dist/api/utils/strings.utils.js +0 -64
- package/dist/api/utils/strings.utils.js.map +0 -1
- package/dist/apps/services/app.service.d.ts +0 -126
- package/dist/apps/services/app.service.js +0 -1436
- package/dist/apps/services/app.service.js.map +0 -1
- package/dist/apps/utils/auth-context-manager.d.ts +0 -137
- package/dist/apps/utils/auth-context-manager.js +0 -248
- package/dist/apps/utils/auth-context-manager.js.map +0 -1
- package/dist/apps/utils/credential-manager.d.ts +0 -128
- package/dist/apps/utils/credential-manager.js +0 -199
- package/dist/apps/utils/credential-manager.js.map +0 -1
- package/dist/apps/utils/index.d.ts +0 -10
- package/dist/apps/utils/index.js +0 -54
- package/dist/apps/utils/index.js.map +0 -1
- package/dist/apps/utils/input-helpers.d.ts +0 -67
- package/dist/apps/utils/input-helpers.js +0 -185
- package/dist/apps/utils/input-helpers.js.map +0 -1
- package/dist/apps/utils/input-resolver.d.ts +0 -165
- package/dist/apps/utils/input-resolver.js +0 -477
- package/dist/apps/utils/input-resolver.js.map +0 -1
- package/dist/apps/utils/oauth-manager.d.ts +0 -196
- package/dist/apps/utils/oauth-manager.js +0 -429
- package/dist/apps/utils/oauth-manager.js.map +0 -1
- package/dist/apps/utils/objects.utils.d.ts +0 -4
- package/dist/apps/utils/objects.utils.js +0 -59
- package/dist/apps/utils/objects.utils.js.map +0 -1
- package/dist/apps/utils/string.utils.d.ts +0 -9
- package/dist/apps/utils/string.utils.js +0 -89
- package/dist/apps/utils/string.utils.js.map +0 -1
- package/dist/apps/validators/index.d.ts +0 -17
- package/dist/apps/validators/index.js +0 -39
- package/dist/apps/validators/index.js.map +0 -1
- package/dist/apps/validators/joi-validators/create.app.validator.d.ts +0 -3
- package/dist/apps/validators/joi-validators/create.app.validator.js +0 -43
- package/dist/apps/validators/joi-validators/create.app.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/create.appAction.validator.d.ts +0 -3
- package/dist/apps/validators/joi-validators/create.appAction.validator.js +0 -72
- package/dist/apps/validators/joi-validators/create.appAction.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/create.appActionResponse.validator.d.ts +0 -7
- package/dist/apps/validators/joi-validators/create.appActionResponse.validator.js +0 -81
- package/dist/apps/validators/joi-validators/create.appActionResponse.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/create.appAuth.validator.d.ts +0 -3
- package/dist/apps/validators/joi-validators/create.appAuth.validator.js +0 -64
- package/dist/apps/validators/joi-validators/create.appAuth.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/create.appBody.validators.d.ts +0 -4
- package/dist/apps/validators/joi-validators/create.appBody.validators.js +0 -44
- package/dist/apps/validators/joi-validators/create.appBody.validators.js.map +0 -1
- package/dist/apps/validators/joi-validators/create.appConstants.validator.d.ts +0 -4
- package/dist/apps/validators/joi-validators/create.appConstants.validator.js +0 -45
- package/dist/apps/validators/joi-validators/create.appConstants.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/create.appEnv.validator.d.ts +0 -4
- package/dist/apps/validators/joi-validators/create.appEnv.validator.js +0 -50
- package/dist/apps/validators/joi-validators/create.appEnv.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/create.appVariable.validator.d.ts +0 -4
- package/dist/apps/validators/joi-validators/create.appVariable.validator.js +0 -47
- package/dist/apps/validators/joi-validators/create.appVariable.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/create.appWebhook.validator.d.ts +0 -4
- package/dist/apps/validators/joi-validators/create.appWebhook.validator.js +0 -60
- package/dist/apps/validators/joi-validators/create.appWebhook.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/create.appWebhookEvent.validator.d.ts +0 -3
- package/dist/apps/validators/joi-validators/create.appWebhookEvent.validator.js +0 -48
- package/dist/apps/validators/joi-validators/create.appWebhookEvent.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/sample.validator.d.ts +0 -6
- package/dist/apps/validators/joi-validators/sample.validator.js +0 -65
- package/dist/apps/validators/joi-validators/sample.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/update.app.validator.d.ts +0 -4
- package/dist/apps/validators/joi-validators/update.app.validator.js +0 -66
- package/dist/apps/validators/joi-validators/update.app.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/update.appAction.validator.d.ts +0 -4
- package/dist/apps/validators/joi-validators/update.appAction.validator.js +0 -76
- package/dist/apps/validators/joi-validators/update.appAction.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/update.appActionResponse.validator.d.ts +0 -3
- package/dist/apps/validators/joi-validators/update.appActionResponse.validator.js +0 -57
- package/dist/apps/validators/joi-validators/update.appActionResponse.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/update.appAuth.validator.d.ts +0 -4
- package/dist/apps/validators/joi-validators/update.appAuth.validator.js +0 -52
- package/dist/apps/validators/joi-validators/update.appAuth.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/update.appConstants.validator.d.ts +0 -4
- package/dist/apps/validators/joi-validators/update.appConstants.validator.js +0 -45
- package/dist/apps/validators/joi-validators/update.appConstants.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/update.appEnv.validator.d.ts +0 -4
- package/dist/apps/validators/joi-validators/update.appEnv.validator.js +0 -50
- package/dist/apps/validators/joi-validators/update.appEnv.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/update.appVariables.validator.d.ts +0 -4
- package/dist/apps/validators/joi-validators/update.appVariables.validator.js +0 -47
- package/dist/apps/validators/joi-validators/update.appVariables.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/update.appWebhook.validator.d.ts +0 -4
- package/dist/apps/validators/joi-validators/update.appWebhook.validator.js +0 -59
- package/dist/apps/validators/joi-validators/update.appWebhook.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/update.appWebhookEvent.validator.d.ts +0 -3
- package/dist/apps/validators/joi-validators/update.appWebhookEvent.validator.js +0 -48
- package/dist/apps/validators/joi-validators/update.appWebhookEvent.validator.js.map +0 -1
- package/dist/apps/validators/joi-validators/update.validation.entityData.validator.d.ts +0 -3
- package/dist/apps/validators/joi-validators/update.validation.entityData.validator.js +0 -60
- package/dist/apps/validators/joi-validators/update.validation.entityData.validator.js.map +0 -1
- package/dist/bin.d.ts +0 -26
- package/dist/bin.js +0 -28
- package/dist/bin.js.map +0 -1
- package/dist/brokers/brokers.service.d.ts +0 -438
- package/dist/brokers/brokers.service.js +0 -1294
- package/dist/brokers/brokers.service.js.map +0 -1
- package/dist/brokers/index.d.ts +0 -46
- package/dist/brokers/index.js +0 -83
- package/dist/brokers/index.js.map +0 -1
- package/dist/brokers/types/index.d.ts +0 -569
- package/dist/brokers/types/index.js +0 -8
- package/dist/brokers/types/index.js.map +0 -1
- package/dist/brokers/utils/broker.util.d.ts +0 -33
- package/dist/brokers/utils/broker.util.js +0 -125
- package/dist/brokers/utils/broker.util.js.map +0 -1
- package/dist/brokers/utils/providers/aws-sqs.service.d.ts +0 -16
- package/dist/brokers/utils/providers/aws-sqs.service.js +0 -71
- package/dist/brokers/utils/providers/aws-sqs.service.js.map +0 -1
- package/dist/brokers/utils/providers/google-pubsub.service.d.ts +0 -16
- package/dist/brokers/utils/providers/google-pubsub.service.js +0 -43
- package/dist/brokers/utils/providers/google-pubsub.service.js.map +0 -1
- package/dist/brokers/utils/providers/index.d.ts +0 -6
- package/dist/brokers/utils/providers/index.js +0 -16
- package/dist/brokers/utils/providers/index.js.map +0 -1
- package/dist/brokers/utils/providers/kafka.service.d.ts +0 -23
- package/dist/brokers/utils/providers/kafka.service.js +0 -131
- package/dist/brokers/utils/providers/kafka.service.js.map +0 -1
- package/dist/brokers/utils/providers/nats.service.d.ts +0 -18
- package/dist/brokers/utils/providers/nats.service.js +0 -63
- package/dist/brokers/utils/providers/nats.service.js.map +0 -1
- package/dist/brokers/utils/providers/rabbitmq.service.d.ts +0 -25
- package/dist/brokers/utils/providers/rabbitmq.service.js +0 -138
- package/dist/brokers/utils/providers/rabbitmq.service.js.map +0 -1
- package/dist/brokers/utils/providers/redis.service.d.ts +0 -18
- package/dist/brokers/utils/providers/redis.service.js +0 -93
- package/dist/brokers/utils/providers/redis.service.js.map +0 -1
- package/dist/cache/cache.manager.d.ts +0 -308
- package/dist/cache/cache.manager.js +0 -900
- package/dist/cache/cache.manager.js.map +0 -1
- package/dist/cache/cache.service.d.ts +0 -192
- package/dist/cache/cache.service.js +0 -596
- package/dist/cache/cache.service.js.map +0 -1
- package/dist/cache/index.d.ts +0 -52
- package/dist/cache/index.js +0 -81
- package/dist/cache/index.js.map +0 -1
- package/dist/cache/types/index.d.ts +0 -112
- package/dist/cache/types/index.js +0 -6
- package/dist/cache/types/index.js.map +0 -1
- package/dist/clients/apps.client.d.ts +0 -4
- package/dist/clients/apps.client.js +0 -31
- package/dist/clients/apps.client.js.map +0 -1
- package/dist/clients/email.client.d.ts +0 -4
- package/dist/clients/email.client.js +0 -29
- package/dist/clients/email.client.js.map +0 -1
- package/dist/clients/expo.client.d.ts +0 -3
- package/dist/clients/expo.client.js +0 -28
- package/dist/clients/expo.client.js.map +0 -1
- package/dist/clients/function.client.d.ts +0 -3
- package/dist/clients/function.client.js +0 -27
- package/dist/clients/function.client.js.map +0 -1
- package/dist/clients/http.client.d.ts +0 -3
- package/dist/clients/http.client.js +0 -27
- package/dist/clients/http.client.js.map +0 -1
- package/dist/clients/logs.client.d.ts +0 -4
- package/dist/clients/logs.client.js +0 -34
- package/dist/clients/logs.client.js.map +0 -1
- package/dist/clients/pricing.client.d.ts +0 -4
- package/dist/clients/pricing.client.js +0 -34
- package/dist/clients/pricing.client.js.map +0 -1
- package/dist/clients/products.client.d.ts +0 -3
- package/dist/clients/products.client.js +0 -32
- package/dist/clients/products.client.js.map +0 -1
- package/dist/clients/users.client.d.ts +0 -4
- package/dist/clients/users.client.js +0 -34
- package/dist/clients/users.client.js.map +0 -1
- package/dist/clients/webhooks.client.d.ts +0 -4
- package/dist/clients/webhooks.client.js +0 -34
- package/dist/clients/webhooks.client.js.map +0 -1
- package/dist/clients/workspace.client.d.ts +0 -7
- package/dist/clients/workspace.client.js +0 -39
- package/dist/clients/workspace.client.js.map +0 -1
- package/dist/database/actions/action-manager.d.ts +0 -170
- package/dist/database/actions/action-manager.js +0 -465
- package/dist/database/actions/action-manager.js.map +0 -1
- package/dist/database/actions/index.d.ts +0 -6
- package/dist/database/actions/index.js +0 -13
- package/dist/database/actions/index.js.map +0 -1
- package/dist/database/adapters/adapter.factory.d.ts +0 -62
- package/dist/database/adapters/adapter.factory.js +0 -97
- package/dist/database/adapters/adapter.factory.js.map +0 -1
- package/dist/database/adapters/base.adapter.d.ts +0 -423
- package/dist/database/adapters/base.adapter.js +0 -260
- package/dist/database/adapters/base.adapter.js.map +0 -1
- package/dist/database/adapters/cassandra.adapter.d.ts +0 -92
- package/dist/database/adapters/cassandra.adapter.js +0 -1091
- package/dist/database/adapters/cassandra.adapter.js.map +0 -1
- package/dist/database/adapters/dynamodb.adapter.d.ts +0 -110
- package/dist/database/adapters/dynamodb.adapter.js +0 -1564
- package/dist/database/adapters/dynamodb.adapter.js.map +0 -1
- package/dist/database/adapters/index.d.ts +0 -11
- package/dist/database/adapters/index.js +0 -27
- package/dist/database/adapters/index.js.map +0 -1
- package/dist/database/adapters/mariadb.adapter.d.ts +0 -100
- package/dist/database/adapters/mariadb.adapter.js +0 -247
- package/dist/database/adapters/mariadb.adapter.js.map +0 -1
- package/dist/database/adapters/mongodb.adapter.d.ts +0 -121
- package/dist/database/adapters/mongodb.adapter.js +0 -1284
- package/dist/database/adapters/mongodb.adapter.js.map +0 -1
- package/dist/database/adapters/mysql.adapter.d.ts +0 -86
- package/dist/database/adapters/mysql.adapter.js +0 -1371
- package/dist/database/adapters/mysql.adapter.js.map +0 -1
- package/dist/database/adapters/postgresql.adapter.d.ts +0 -90
- package/dist/database/adapters/postgresql.adapter.js +0 -1487
- package/dist/database/adapters/postgresql.adapter.js.map +0 -1
- package/dist/database/databases.service.d.ts +0 -1496
- package/dist/database/databases.service.js +0 -3294
- package/dist/database/databases.service.js.map +0 -1
- package/dist/database/index.d.ts +0 -46
- package/dist/database/index.js +0 -109
- package/dist/database/index.js.map +0 -1
- package/dist/database/migrations/index.d.ts +0 -6
- package/dist/database/migrations/index.js +0 -12
- package/dist/database/migrations/index.js.map +0 -1
- package/dist/database/migrations/migration-engine.d.ts +0 -136
- package/dist/database/migrations/migration-engine.js +0 -1421
- package/dist/database/migrations/migration-engine.js.map +0 -1
- package/dist/database/operators/aggregation-builder.d.ts +0 -67
- package/dist/database/operators/aggregation-builder.js +0 -841
- package/dist/database/operators/aggregation-builder.js.map +0 -1
- package/dist/database/operators/index.d.ts +0 -7
- package/dist/database/operators/index.js +0 -15
- package/dist/database/operators/index.js.map +0 -1
- package/dist/database/operators/query-builder.d.ts +0 -69
- package/dist/database/operators/query-builder.js +0 -447
- package/dist/database/operators/query-builder.js.map +0 -1
- package/dist/database/presave/decrypt.d.ts +0 -25
- package/dist/database/presave/decrypt.js +0 -146
- package/dist/database/presave/decrypt.js.map +0 -1
- package/dist/database/presave/index.d.ts +0 -9
- package/dist/database/presave/index.js +0 -18
- package/dist/database/presave/index.js.map +0 -1
- package/dist/database/presave/presave-processor.d.ts +0 -148
- package/dist/database/presave/presave-processor.js +0 -702
- package/dist/database/presave/presave-processor.js.map +0 -1
- package/dist/database/schema/index.d.ts +0 -7
- package/dist/database/schema/index.js +0 -13
- package/dist/database/schema/index.js.map +0 -1
- package/dist/database/schema/schema-manager.d.ts +0 -258
- package/dist/database/schema/schema-manager.js +0 -638
- package/dist/database/schema/schema-manager.js.map +0 -1
- package/dist/database/transactions/index.d.ts +0 -6
- package/dist/database/transactions/index.js +0 -13
- package/dist/database/transactions/index.js.map +0 -1
- package/dist/database/transactions/transaction-manager.d.ts +0 -113
- package/dist/database/transactions/transaction-manager.js +0 -344
- package/dist/database/transactions/transaction-manager.js.map +0 -1
- package/dist/database/triggers/index.d.ts +0 -7
- package/dist/database/triggers/index.js +0 -14
- package/dist/database/triggers/index.js.map +0 -1
- package/dist/database/triggers/trigger-processor.d.ts +0 -239
- package/dist/database/triggers/trigger-processor.js +0 -1034
- package/dist/database/triggers/trigger-processor.js.map +0 -1
- package/dist/database/types/action.interface.d.ts +0 -148
- package/dist/database/types/action.interface.js +0 -6
- package/dist/database/types/action.interface.js.map +0 -1
- package/dist/database/types/aggregation.interface.d.ts +0 -185
- package/dist/database/types/aggregation.interface.js +0 -6
- package/dist/database/types/aggregation.interface.js.map +0 -1
- package/dist/database/types/connection.interface.d.ts +0 -137
- package/dist/database/types/connection.interface.js +0 -6
- package/dist/database/types/connection.interface.js.map +0 -1
- package/dist/database/types/dashboard.interface.d.ts +0 -74
- package/dist/database/types/dashboard.interface.js +0 -7
- package/dist/database/types/dashboard.interface.js.map +0 -1
- package/dist/database/types/enums.d.ts +0 -195
- package/dist/database/types/enums.js +0 -244
- package/dist/database/types/enums.js.map +0 -1
- package/dist/database/types/index.d.ts +0 -15
- package/dist/database/types/index.js +0 -31
- package/dist/database/types/index.js.map +0 -1
- package/dist/database/types/migration.interface.d.ts +0 -686
- package/dist/database/types/migration.interface.js +0 -9
- package/dist/database/types/migration.interface.js.map +0 -1
- package/dist/database/types/presave.interface.d.ts +0 -292
- package/dist/database/types/presave.interface.js +0 -60
- package/dist/database/types/presave.interface.js.map +0 -1
- package/dist/database/types/query.interface.d.ts +0 -205
- package/dist/database/types/query.interface.js +0 -6
- package/dist/database/types/query.interface.js.map +0 -1
- package/dist/database/types/schema.interface.d.ts +0 -412
- package/dist/database/types/schema.interface.js +0 -6
- package/dist/database/types/schema.interface.js.map +0 -1
- package/dist/database/types/transaction.interface.d.ts +0 -84
- package/dist/database/types/transaction.interface.js +0 -6
- package/dist/database/types/transaction.interface.js.map +0 -1
- package/dist/database/types/trigger.interface.d.ts +0 -612
- package/dist/database/types/trigger.interface.js +0 -121
- package/dist/database/types/trigger.interface.js.map +0 -1
- package/dist/database/types/write.interface.d.ts +0 -216
- package/dist/database/types/write.interface.js +0 -6
- package/dist/database/types/write.interface.js.map +0 -1
- package/dist/database/utils/database-error.d.ts +0 -96
- package/dist/database/utils/database-error.js +0 -221
- package/dist/database/utils/database-error.js.map +0 -1
- package/dist/database/utils/index.d.ts +0 -6
- package/dist/database/utils/index.js +0 -11
- package/dist/database/utils/index.js.map +0 -1
- package/dist/graph/adapters/adapter.factory.d.ts +0 -47
- package/dist/graph/adapters/adapter.factory.js +0 -77
- package/dist/graph/adapters/adapter.factory.js.map +0 -1
- package/dist/graph/adapters/arangodb.adapter.d.ts +0 -86
- package/dist/graph/adapters/arangodb.adapter.js +0 -1588
- package/dist/graph/adapters/arangodb.adapter.js.map +0 -1
- package/dist/graph/adapters/base.adapter.d.ts +0 -264
- package/dist/graph/adapters/base.adapter.js +0 -156
- package/dist/graph/adapters/base.adapter.js.map +0 -1
- package/dist/graph/adapters/index.d.ts +0 -11
- package/dist/graph/adapters/index.js +0 -21
- package/dist/graph/adapters/index.js.map +0 -1
- package/dist/graph/adapters/memgraph.adapter.d.ts +0 -110
- package/dist/graph/adapters/memgraph.adapter.js +0 -1452
- package/dist/graph/adapters/memgraph.adapter.js.map +0 -1
- package/dist/graph/adapters/neo4j.adapter.d.ts +0 -81
- package/dist/graph/adapters/neo4j.adapter.js +0 -1317
- package/dist/graph/adapters/neo4j.adapter.js.map +0 -1
- package/dist/graph/adapters/neptune.adapter.d.ts +0 -82
- package/dist/graph/adapters/neptune.adapter.js +0 -1369
- package/dist/graph/adapters/neptune.adapter.js.map +0 -1
- package/dist/graph/graphs.service.d.ts +0 -617
- package/dist/graph/graphs.service.js +0 -2594
- package/dist/graph/graphs.service.js.map +0 -1
- package/dist/graph/index.d.ts +0 -57
- package/dist/graph/index.js +0 -77
- package/dist/graph/index.js.map +0 -1
- package/dist/graph/transactions/index.d.ts +0 -4
- package/dist/graph/transactions/index.js +0 -9
- package/dist/graph/transactions/index.js.map +0 -1
- package/dist/graph/transactions/transaction-manager.d.ts +0 -61
- package/dist/graph/transactions/transaction-manager.js +0 -126
- package/dist/graph/transactions/transaction-manager.js.map +0 -1
- package/dist/graph/types/connection.interface.d.ts +0 -149
- package/dist/graph/types/connection.interface.js +0 -9
- package/dist/graph/types/connection.interface.js.map +0 -1
- package/dist/graph/types/enums.d.ts +0 -101
- package/dist/graph/types/enums.js +0 -114
- package/dist/graph/types/enums.js.map +0 -1
- package/dist/graph/types/index.d.ts +0 -13
- package/dist/graph/types/index.js +0 -20
- package/dist/graph/types/index.js.map +0 -1
- package/dist/graph/types/node.interface.d.ts +0 -248
- package/dist/graph/types/node.interface.js +0 -9
- package/dist/graph/types/node.interface.js.map +0 -1
- package/dist/graph/types/query.interface.d.ts +0 -175
- package/dist/graph/types/query.interface.js +0 -9
- package/dist/graph/types/query.interface.js.map +0 -1
- package/dist/graph/types/relationship.interface.d.ts +0 -207
- package/dist/graph/types/relationship.interface.js +0 -9
- package/dist/graph/types/relationship.interface.js.map +0 -1
- package/dist/graph/types/schema.interface.d.ts +0 -295
- package/dist/graph/types/schema.interface.js +0 -9
- package/dist/graph/types/schema.interface.js.map +0 -1
- package/dist/graph/types/transaction.interface.d.ts +0 -55
- package/dist/graph/types/transaction.interface.js +0 -9
- package/dist/graph/types/transaction.interface.js.map +0 -1
- package/dist/graph/types/traversal.interface.d.ts +0 -181
- package/dist/graph/types/traversal.interface.js +0 -9
- package/dist/graph/types/traversal.interface.js.map +0 -1
- package/dist/graph/utils/graph-error.d.ts +0 -71
- package/dist/graph/utils/graph-error.js +0 -142
- package/dist/graph/utils/graph-error.js.map +0 -1
- package/dist/graph/utils/index.d.ts +0 -4
- package/dist/graph/utils/index.js +0 -9
- package/dist/graph/utils/index.js.map +0 -1
- package/dist/imports/imports.repo.d.ts +0 -0
- package/dist/imports/imports.repo.js +0 -1
- package/dist/imports/imports.repo.js.map +0 -1
- package/dist/imports/imports.service.d.ts +0 -23
- package/dist/imports/imports.service.js +0 -71
- package/dist/imports/imports.service.js.map +0 -1
- package/dist/imports/imports.types.d.ts +0 -350
- package/dist/imports/imports.types.js +0 -33
- package/dist/imports/imports.types.js.map +0 -1
- package/dist/imports/openAPI3.0.types.d.ts +0 -52
- package/dist/imports/openAPI3.0.types.js +0 -3
- package/dist/imports/openAPI3.0.types.js.map +0 -1
- package/dist/imports/repos/openApi.repo.d.ts +0 -6
- package/dist/imports/repos/openApi.repo.js +0 -422
- package/dist/imports/repos/openApi.repo.js.map +0 -1
- package/dist/imports/repos/postmanV21.repo.d.ts +0 -14
- package/dist/imports/repos/postmanV21.repo.js +0 -257
- package/dist/imports/repos/postmanV21.repo.js.map +0 -1
- package/dist/imports/utils/imports.utils.d.ts +0 -80
- package/dist/imports/utils/imports.utils.js +0 -114
- package/dist/imports/utils/imports.utils.js.map +0 -1
- package/dist/imports/validators/index.d.ts +0 -0
- package/dist/imports/validators/index.js +0 -1
- package/dist/imports/validators/index.js.map +0 -1
- package/dist/imports/validators/joi-validators/postmanV21.validator.d.ts +0 -5
- package/dist/imports/validators/joi-validators/postmanV21.validator.js +0 -96
- package/dist/imports/validators/joi-validators/postmanV21.validator.js.map +0 -1
- package/dist/index.d.ts +0 -4021
- package/dist/index.js +0 -5895
- package/dist/index.js.map +0 -1
- package/dist/init.interface.d.ts +0 -407
- package/dist/init.interface.js +0 -3
- package/dist/init.interface.js.map +0 -1
- package/dist/inputs/inputs.repo.d.ts +0 -7
- package/dist/inputs/inputs.repo.js +0 -16
- package/dist/inputs/inputs.repo.js.map +0 -1
- package/dist/inputs/inputs.service.d.ts +0 -61
- package/dist/inputs/inputs.service.js +0 -468
- package/dist/inputs/inputs.service.js.map +0 -1
- package/dist/inputs/utils/inputs.utils.create.d.ts +0 -11
- package/dist/inputs/utils/inputs.utils.create.js +0 -273
- package/dist/inputs/utils/inputs.utils.create.js.map +0 -1
- package/dist/inputs/validators/inputs.validator.parse.d.ts +0 -4
- package/dist/inputs/validators/inputs.validator.parse.js +0 -53
- package/dist/inputs/validators/inputs.validator.parse.js.map +0 -1
- package/dist/jobs/index.d.ts +0 -38
- package/dist/jobs/index.js +0 -50
- package/dist/jobs/index.js.map +0 -1
- package/dist/jobs/jobs.service.d.ts +0 -154
- package/dist/jobs/jobs.service.js +0 -491
- package/dist/jobs/jobs.service.js.map +0 -1
- package/dist/jobs/jobs.state.d.ts +0 -113
- package/dist/jobs/jobs.state.js +0 -447
- package/dist/jobs/jobs.state.js.map +0 -1
- package/dist/jobs/types.d.ts +0 -449
- package/dist/jobs/types.js +0 -74
- package/dist/jobs/types.js.map +0 -1
- package/dist/logs/logs.repo.d.ts +0 -6
- package/dist/logs/logs.repo.js +0 -12
- package/dist/logs/logs.repo.js.map +0 -1
- package/dist/logs/logs.service.d.ts +0 -30
- package/dist/logs/logs.service.js +0 -89
- package/dist/logs/logs.service.js.map +0 -1
- package/dist/logs/logs.types.d.ts +0 -85
- package/dist/logs/logs.types.js +0 -52
- package/dist/logs/logs.types.js.map +0 -1
- package/dist/logs/utils/logs.utils.create.d.ts +0 -0
- package/dist/logs/utils/logs.utils.create.js +0 -1
- package/dist/logs/utils/logs.utils.create.js.map +0 -1
- package/dist/logs/utils/logs.utils.errors.d.ts +0 -2
- package/dist/logs/utils/logs.utils.errors.js +0 -8
- package/dist/logs/utils/logs.utils.errors.js.map +0 -1
- package/dist/models/index.d.ts +0 -6
- package/dist/models/index.js +0 -11
- package/dist/models/index.js.map +0 -1
- package/dist/models/models.service.d.ts +0 -137
- package/dist/models/models.service.js +0 -195
- package/dist/models/models.service.js.map +0 -1
- package/dist/notifications/index.d.ts +0 -13
- package/dist/notifications/index.js +0 -26
- package/dist/notifications/index.js.map +0 -1
- package/dist/notifications/notifications.service.d.ts +0 -268
- package/dist/notifications/notifications.service.js +0 -907
- package/dist/notifications/notifications.service.js.map +0 -1
- package/dist/notifications/types/index.d.ts +0 -4
- package/dist/notifications/types/index.js +0 -21
- package/dist/notifications/types/index.js.map +0 -1
- package/dist/notifications/types/notifications.types.d.ts +0 -454
- package/dist/notifications/types/notifications.types.js +0 -51
- package/dist/notifications/types/notifications.types.js.map +0 -1
- package/dist/parsers/index.d.ts +0 -3
- package/dist/parsers/index.js +0 -27
- package/dist/parsers/index.js.map +0 -1
- package/dist/parsers/pipelines/postman.pipelines.d.ts +0 -15
- package/dist/parsers/pipelines/postman.pipelines.js +0 -103
- package/dist/parsers/pipelines/postman.pipelines.js.map +0 -1
- package/dist/parsers/types/postman.types.d.ts +0 -200
- package/dist/parsers/types/postman.types.js +0 -3
- package/dist/parsers/types/postman.types.js.map +0 -1
- package/dist/parsers/utils/postman.utils.d.ts +0 -12
- package/dist/parsers/utils/postman.utils.js +0 -116
- package/dist/parsers/utils/postman.utils.js.map +0 -1
- package/dist/parsers/validators/postman-auth.validators.d.ts +0 -10
- package/dist/parsers/validators/postman-auth.validators.js +0 -127
- package/dist/parsers/validators/postman-auth.validators.js.map +0 -1
- package/dist/parsers/validators/postman-request.validators.d.ts +0 -13
- package/dist/parsers/validators/postman-request.validators.js +0 -139
- package/dist/parsers/validators/postman-request.validators.js.map +0 -1
- package/dist/parsers/validators/postman-response.validators.d.ts +0 -13
- package/dist/parsers/validators/postman-response.validators.js +0 -150
- package/dist/parsers/validators/postman-response.validators.js.map +0 -1
- package/dist/parsers/validators/postman-variable.validators.d.ts +0 -14
- package/dist/parsers/validators/postman-variable.validators.js +0 -163
- package/dist/parsers/validators/postman-variable.validators.js.map +0 -1
- package/dist/pricing/pricing.repo.d.ts +0 -0
- package/dist/pricing/pricing.repo.js +0 -1
- package/dist/pricing/pricing.repo.js.map +0 -1
- package/dist/pricing/pricing.service.d.ts +0 -24
- package/dist/pricing/pricing.service.js +0 -51
- package/dist/pricing/pricing.service.js.map +0 -1
- package/dist/pricing/pricing.types.d.ts +0 -76
- package/dist/pricing/pricing.types.js +0 -21
- package/dist/pricing/pricing.types.js.map +0 -1
- package/dist/pricing/utils/string.utils.d.ts +0 -1
- package/dist/pricing/utils/string.utils.js +0 -9
- package/dist/pricing/utils/string.utils.js.map +0 -1
- package/dist/processor/repos/mongo.repo.d.ts +0 -39
- package/dist/processor/repos/mongo.repo.js +0 -260
- package/dist/processor/repos/mongo.repo.js.map +0 -1
- package/dist/processor/repos/postgres.repo.d.ts +0 -31
- package/dist/processor/repos/postgres.repo.js +0 -185
- package/dist/processor/repos/postgres.repo.js.map +0 -1
- package/dist/processor/repos/sms.repo.d.ts +0 -39
- package/dist/processor/repos/sms.repo.js +0 -124
- package/dist/processor/repos/sms.repo.js.map +0 -1
- package/dist/processor/services/processor.service.d.ts +0 -465
- package/dist/processor/services/processor.service.js +0 -5343
- package/dist/processor/services/processor.service.js.map +0 -1
- package/dist/processor/services/request.service.d.ts +0 -36
- package/dist/processor/services/request.service.js +0 -304
- package/dist/processor/services/request.service.js.map +0 -1
- package/dist/processor/types/request.types.d.ts +0 -14
- package/dist/processor/types/request.types.js +0 -3
- package/dist/processor/types/request.types.js.map +0 -1
- package/dist/processor/utils/processor.utils.d.ts +0 -104
- package/dist/processor/utils/processor.utils.js +0 -1066
- package/dist/processor/utils/processor.utils.js.map +0 -1
- package/dist/processor/utils/request.utils.d.ts +0 -20
- package/dist/processor/utils/request.utils.js +0 -113
- package/dist/processor/utils/request.utils.js.map +0 -1
- package/dist/processor/utils/storage.util.d.ts +0 -8
- package/dist/processor/utils/storage.util.js +0 -106
- package/dist/processor/utils/storage.util.js.map +0 -1
- package/dist/products/services/products.service.d.ts +0 -577
- package/dist/products/services/products.service.js +0 -5845
- package/dist/products/services/products.service.js.map +0 -1
- package/dist/products/utils/crypt.utils.d.ts +0 -1
- package/dist/products/utils/crypt.utils.js +0 -17
- package/dist/products/utils/crypt.utils.js.map +0 -1
- package/dist/products/utils/functions.utils.d.ts +0 -13
- package/dist/products/utils/functions.utils.js +0 -294
- package/dist/products/utils/functions.utils.js.map +0 -1
- package/dist/products/utils/objects.utils.d.ts +0 -13
- package/dist/products/utils/objects.utils.js +0 -89
- package/dist/products/utils/objects.utils.js.map +0 -1
- package/dist/products/utils/string.utils.d.ts +0 -12
- package/dist/products/utils/string.utils.js +0 -168
- package/dist/products/utils/string.utils.js.map +0 -1
- package/dist/products/validators/index.d.ts +0 -33
- package/dist/products/validators/index.js +0 -75
- package/dist/products/validators/index.js.map +0 -1
- package/dist/products/validators/joi-validators/create.html.validator.d.ts +0 -2
- package/dist/products/validators/joi-validators/create.html.validator.js +0 -55
- package/dist/products/validators/joi-validators/create.html.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productAgent.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/create.productAgent.validator.js +0 -266
- package/dist/products/validators/joi-validators/create.productAgent.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productApp.validator.d.ts +0 -4
- package/dist/products/validators/joi-validators/create.productApp.validator.js +0 -61
- package/dist/products/validators/joi-validators/create.productApp.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productCache.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/create.productCache.validator.js +0 -46
- package/dist/products/validators/joi-validators/create.productCache.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productDatabase.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/create.productDatabase.validator.js +0 -77
- package/dist/products/validators/joi-validators/create.productDatabase.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productDatabaseAction.validator.d.ts +0 -7
- package/dist/products/validators/joi-validators/create.productDatabaseAction.validator.js +0 -194
- package/dist/products/validators/joi-validators/create.productDatabaseAction.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productDatabaseMigration.validator.d.ts +0 -4
- package/dist/products/validators/joi-validators/create.productDatabaseMigration.validator.js +0 -63
- package/dist/products/validators/joi-validators/create.productDatabaseMigration.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productEnv.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/create.productEnv.validator.js +0 -45
- package/dist/products/validators/joi-validators/create.productEnv.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productFallback.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/create.productFallback.validator.js +0 -64
- package/dist/products/validators/joi-validators/create.productFallback.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productFeature.validator.d.ts +0 -14
- package/dist/products/validators/joi-validators/create.productFeature.validator.js +0 -140
- package/dist/products/validators/joi-validators/create.productFeature.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productFunction.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/create.productFunction.validator.js +0 -57
- package/dist/products/validators/joi-validators/create.productFunction.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productGraph.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/create.productGraph.validator.js +0 -89
- package/dist/products/validators/joi-validators/create.productGraph.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productHealthcheck.validator.d.ts +0 -4
- package/dist/products/validators/joi-validators/create.productHealthcheck.validator.js +0 -58
- package/dist/products/validators/joi-validators/create.productHealthcheck.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productJob.validator.d.ts +0 -12
- package/dist/products/validators/joi-validators/create.productJob.validator.js +0 -60
- package/dist/products/validators/joi-validators/create.productJob.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productMessageBrokerTopic.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/create.productMessageBrokerTopic.validator.js +0 -52
- package/dist/products/validators/joi-validators/create.productMessageBrokerTopic.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productMessageBrokers.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/create.productMessageBrokers.validator.js +0 -193
- package/dist/products/validators/joi-validators/create.productMessageBrokers.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productModel.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/create.productModel.validator.js +0 -132
- package/dist/products/validators/joi-validators/create.productModel.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productNotification.validator.d.ts +0 -4
- package/dist/products/validators/joi-validators/create.productNotification.validator.js +0 -241
- package/dist/products/validators/joi-validators/create.productNotification.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productNotificationMessage.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/create.productNotificationMessage.validator.js +0 -57
- package/dist/products/validators/joi-validators/create.productNotificationMessage.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productNotifications.validator.d.ts +0 -0
- package/dist/products/validators/joi-validators/create.productNotifications.validator.js +0 -1
- package/dist/products/validators/joi-validators/create.productNotifications.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productQuota.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/create.productQuota.validator.js +0 -67
- package/dist/products/validators/joi-validators/create.productQuota.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productStorage.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/create.productStorage.validator.js +0 -158
- package/dist/products/validators/joi-validators/create.productStorage.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.productVector.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/create.productVector.validator.js +0 -136
- package/dist/products/validators/joi-validators/create.productVector.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.products.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/create.products.validator.js +0 -43
- package/dist/products/validators/joi-validators/create.products.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.requestAction.validator.d.ts +0 -2
- package/dist/products/validators/joi-validators/create.requestAction.validator.js +0 -45
- package/dist/products/validators/joi-validators/create.requestAction.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/create.userAuth.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/create.userAuth.validator.js +0 -48
- package/dist/products/validators/joi-validators/create.userAuth.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/register.productWebhooks.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/register.productWebhooks.validator.js +0 -48
- package/dist/products/validators/joi-validators/register.productWebhooks.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/update.dataValue.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/update.dataValue.validator.js +0 -103
- package/dist/products/validators/joi-validators/update.dataValue.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/update.productApp.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/update.productApp.validator.js +0 -42
- package/dist/products/validators/joi-validators/update.productApp.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/update.productCache.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/update.productCache.validator.js +0 -45
- package/dist/products/validators/joi-validators/update.productCache.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/update.productDatabase.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/update.productDatabase.validator.js +0 -76
- package/dist/products/validators/joi-validators/update.productDatabase.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/update.productDatabaseAction.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/update.productDatabaseAction.validator.js +0 -79
- package/dist/products/validators/joi-validators/update.productDatabaseAction.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/update.productDatabaseMigration.validator.d.ts +0 -4
- package/dist/products/validators/joi-validators/update.productDatabaseMigration.validator.js +0 -64
- package/dist/products/validators/joi-validators/update.productDatabaseMigration.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/update.productEnv.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/update.productEnv.validator.js +0 -46
- package/dist/products/validators/joi-validators/update.productEnv.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/update.productFallback.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/update.productFallback.validator.js +0 -60
- package/dist/products/validators/joi-validators/update.productFallback.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/update.productFeature.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/update.productFeature.validator.js +0 -53
- package/dist/products/validators/joi-validators/update.productFeature.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/update.productFunction.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/update.productFunction.validator.js +0 -41
- package/dist/products/validators/joi-validators/update.productFunction.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/update.productGraph.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/update.productGraph.validator.js +0 -88
- package/dist/products/validators/joi-validators/update.productGraph.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/update.productJob.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/update.productJob.validator.js +0 -50
- package/dist/products/validators/joi-validators/update.productJob.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/update.productMessageBrokerTopic.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/update.productMessageBrokerTopic.validator.js +0 -52
- package/dist/products/validators/joi-validators/update.productMessageBrokerTopic.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/update.productNotification.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/update.productNotification.validator.js +0 -47
- package/dist/products/validators/joi-validators/update.productNotification.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/update.productNotificationMessage.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/update.productNotificationMessage.validator.js +0 -58
- package/dist/products/validators/joi-validators/update.productNotificationMessage.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/update.productQuota.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/update.productQuota.validator.js +0 -64
- package/dist/products/validators/joi-validators/update.productQuota.validator.js.map +0 -1
- package/dist/products/validators/joi-validators/update.userAuth.validator.d.ts +0 -3
- package/dist/products/validators/joi-validators/update.userAuth.validator.js +0 -48
- package/dist/products/validators/joi-validators/update.userAuth.validator.js.map +0 -1
- package/dist/resilience/fallback.service.d.ts +0 -141
- package/dist/resilience/fallback.service.js +0 -766
- package/dist/resilience/fallback.service.js.map +0 -1
- package/dist/resilience/healthcheck.service.d.ts +0 -163
- package/dist/resilience/healthcheck.service.js +0 -1012
- package/dist/resilience/healthcheck.service.js.map +0 -1
- package/dist/resilience/index.d.ts +0 -104
- package/dist/resilience/index.js +0 -140
- package/dist/resilience/index.js.map +0 -1
- package/dist/resilience/quota.service.d.ts +0 -83
- package/dist/resilience/quota.service.js +0 -518
- package/dist/resilience/quota.service.js.map +0 -1
- package/dist/resilience/resilience.service.d.ts +0 -98
- package/dist/resilience/resilience.service.js +0 -560
- package/dist/resilience/resilience.service.js.map +0 -1
- package/dist/resilience/types/index.d.ts +0 -513
- package/dist/resilience/types/index.js +0 -29
- package/dist/resilience/types/index.js.map +0 -1
- package/dist/secrets/index.d.ts +0 -10
- package/dist/secrets/index.js +0 -33
- package/dist/secrets/index.js.map +0 -1
- package/dist/secrets/secrets.resolver.d.ts +0 -52
- package/dist/secrets/secrets.resolver.js +0 -236
- package/dist/secrets/secrets.resolver.js.map +0 -1
- package/dist/secrets/secrets.service.d.ts +0 -93
- package/dist/secrets/secrets.service.js +0 -246
- package/dist/secrets/secrets.service.js.map +0 -1
- package/dist/secrets/secrets.types.d.ts +0 -188
- package/dist/secrets/secrets.types.js +0 -87
- package/dist/secrets/secrets.types.js.map +0 -1
- package/dist/sessions/index.d.ts +0 -50
- package/dist/sessions/index.js +0 -96
- package/dist/sessions/index.js.map +0 -1
- package/dist/sessions/sessions.helper.d.ts +0 -88
- package/dist/sessions/sessions.helper.js +0 -190
- package/dist/sessions/sessions.helper.js.map +0 -1
- package/dist/sessions/sessions.resolver.d.ts +0 -188
- package/dist/sessions/sessions.resolver.js +0 -603
- package/dist/sessions/sessions.resolver.js.map +0 -1
- package/dist/sessions/sessions.service.d.ts +0 -194
- package/dist/sessions/sessions.service.js +0 -988
- package/dist/sessions/sessions.service.js.map +0 -1
- package/dist/sessions/types/index.d.ts +0 -344
- package/dist/sessions/types/index.js +0 -6
- package/dist/sessions/types/index.js.map +0 -1
- package/dist/storage/index.d.ts +0 -66
- package/dist/storage/index.js +0 -99
- package/dist/storage/index.js.map +0 -1
- package/dist/storage/storage.service.d.ts +0 -177
- package/dist/storage/storage.service.js +0 -905
- package/dist/storage/storage.service.js.map +0 -1
- package/dist/storage/types/index.d.ts +0 -270
- package/dist/storage/types/index.js +0 -6
- package/dist/storage/types/index.js.map +0 -1
- package/dist/storage/utils/storage.util.d.ts +0 -62
- package/dist/storage/utils/storage.util.js +0 -593
- package/dist/storage/utils/storage.util.js.map +0 -1
- package/dist/types/actions.types.d.ts +0 -0
- package/dist/types/actions.types.js +0 -1
- package/dist/types/actions.types.js.map +0 -1
- package/dist/types/appBuilder.types.d.ts +0 -316
- package/dist/types/appBuilder.types.js +0 -3
- package/dist/types/appBuilder.types.js.map +0 -1
- package/dist/types/database.types.d.ts +0 -9
- package/dist/types/database.types.js +0 -3
- package/dist/types/database.types.js.map +0 -1
- package/dist/types/enums.d.ts +0 -231
- package/dist/types/enums.js +0 -261
- package/dist/types/enums.js.map +0 -1
- package/dist/types/index.d.ts +0 -12
- package/dist/types/index.js +0 -29
- package/dist/types/index.js.map +0 -1
- package/dist/types/index.types.d.ts +0 -30
- package/dist/types/index.types.js +0 -9
- package/dist/types/index.types.js.map +0 -1
- package/dist/types/inputs.types.d.ts +0 -114
- package/dist/types/inputs.types.js +0 -44
- package/dist/types/inputs.types.js.map +0 -1
- package/dist/types/logs.types.d.ts +0 -19
- package/dist/types/logs.types.js +0 -8
- package/dist/types/logs.types.js.map +0 -1
- package/dist/types/pricing.types.d.ts +0 -4
- package/dist/types/pricing.types.js +0 -3
- package/dist/types/pricing.types.js.map +0 -1
- package/dist/types/processor.types.d.ts +0 -602
- package/dist/types/processor.types.js +0 -19
- package/dist/types/processor.types.js.map +0 -1
- package/dist/types/productsBuilder.types.d.ts +0 -1566
- package/dist/types/productsBuilder.types.js +0 -303
- package/dist/types/productsBuilder.types.js.map +0 -1
- package/dist/types/request-tracker.interface.d.ts +0 -0
- package/dist/types/request-tracker.interface.js +0 -1
- package/dist/types/request-tracker.interface.js.map +0 -1
- package/dist/types/requests.types.d.ts +0 -8
- package/dist/types/requests.types.js +0 -3
- package/dist/types/requests.types.js.map +0 -1
- package/dist/types/workspaces.types.d.ts +0 -28
- package/dist/types/workspaces.types.js +0 -4
- package/dist/types/workspaces.types.js.map +0 -1
- package/dist/utils/constants.d.ts +0 -1
- package/dist/utils/constants.js +0 -5
- package/dist/utils/constants.js.map +0 -1
- package/dist/utils/index.d.ts +0 -2
- package/dist/utils/index.js +0 -109
- package/dist/utils/index.js.map +0 -1
- package/dist/vector/actions/action-manager.d.ts +0 -140
- package/dist/vector/actions/action-manager.js +0 -356
- package/dist/vector/actions/action-manager.js.map +0 -1
- package/dist/vector/adapters/base.adapter.d.ts +0 -169
- package/dist/vector/adapters/base.adapter.js +0 -218
- package/dist/vector/adapters/base.adapter.js.map +0 -1
- package/dist/vector/adapters/index.d.ts +0 -10
- package/dist/vector/adapters/index.js +0 -19
- package/dist/vector/adapters/index.js.map +0 -1
- package/dist/vector/adapters/memory.adapter.d.ts +0 -85
- package/dist/vector/adapters/memory.adapter.js +0 -505
- package/dist/vector/adapters/memory.adapter.js.map +0 -1
- package/dist/vector/adapters/pinecone.adapter.d.ts +0 -52
- package/dist/vector/adapters/pinecone.adapter.js +0 -433
- package/dist/vector/adapters/pinecone.adapter.js.map +0 -1
- package/dist/vector/adapters/qdrant.adapter.d.ts +0 -56
- package/dist/vector/adapters/qdrant.adapter.js +0 -442
- package/dist/vector/adapters/qdrant.adapter.js.map +0 -1
- package/dist/vector/adapters/weaviate.adapter.d.ts +0 -68
- package/dist/vector/adapters/weaviate.adapter.js +0 -661
- package/dist/vector/adapters/weaviate.adapter.js.map +0 -1
- package/dist/vector/index.d.ts +0 -36
- package/dist/vector/index.js +0 -70
- package/dist/vector/index.js.map +0 -1
- package/dist/vector/types/action.interface.d.ts +0 -195
- package/dist/vector/types/action.interface.js +0 -100
- package/dist/vector/types/action.interface.js.map +0 -1
- package/dist/vector/types/connection.interface.d.ts +0 -151
- package/dist/vector/types/connection.interface.js +0 -8
- package/dist/vector/types/connection.interface.js.map +0 -1
- package/dist/vector/types/embedding.interface.d.ts +0 -144
- package/dist/vector/types/embedding.interface.js +0 -8
- package/dist/vector/types/embedding.interface.js.map +0 -1
- package/dist/vector/types/enums.d.ts +0 -104
- package/dist/vector/types/enums.js +0 -113
- package/dist/vector/types/enums.js.map +0 -1
- package/dist/vector/types/index.d.ts +0 -11
- package/dist/vector/types/index.js +0 -23
- package/dist/vector/types/index.js.map +0 -1
- package/dist/vector/types/vector.interface.d.ts +0 -315
- package/dist/vector/types/vector.interface.js +0 -8
- package/dist/vector/types/vector.interface.js.map +0 -1
- package/dist/vector/utils/index.d.ts +0 -6
- package/dist/vector/utils/index.js +0 -11
- package/dist/vector/utils/index.js.map +0 -1
- package/dist/vector/utils/vector-error.d.ts +0 -69
- package/dist/vector/utils/vector-error.js +0 -116
- package/dist/vector/utils/vector-error.js.map +0 -1
- package/dist/vector/vector-database.service.d.ts +0 -484
- package/dist/vector/vector-database.service.js +0 -1002
- package/dist/vector/vector-database.service.js.map +0 -1
- package/dist/vector/vector.service.d.ts +0 -283
- package/dist/vector/vector.service.js +0 -544
- package/dist/vector/vector.service.js.map +0 -1
- package/dist/warehouse/executor/index.d.ts +0 -5
- package/dist/warehouse/executor/index.js +0 -12
- package/dist/warehouse/executor/index.js.map +0 -1
- package/dist/warehouse/executor/joins/index.d.ts +0 -5
- package/dist/warehouse/executor/joins/index.js +0 -11
- package/dist/warehouse/executor/joins/index.js.map +0 -1
- package/dist/warehouse/executor/joins/join-executor.d.ts +0 -101
- package/dist/warehouse/executor/joins/join-executor.js +0 -493
- package/dist/warehouse/executor/joins/join-executor.js.map +0 -1
- package/dist/warehouse/executor/joins/semantic-join.d.ts +0 -64
- package/dist/warehouse/executor/joins/semantic-join.js +0 -241
- package/dist/warehouse/executor/joins/semantic-join.js.map +0 -1
- package/dist/warehouse/executor/single-source-executor.d.ts +0 -155
- package/dist/warehouse/executor/single-source-executor.js +0 -573
- package/dist/warehouse/executor/single-source-executor.js.map +0 -1
- package/dist/warehouse/index.d.ts +0 -79
- package/dist/warehouse/index.js +0 -111
- package/dist/warehouse/index.js.map +0 -1
- package/dist/warehouse/parser/index.d.ts +0 -4
- package/dist/warehouse/parser/index.js +0 -10
- package/dist/warehouse/parser/index.js.map +0 -1
- package/dist/warehouse/parser/query-parser.d.ts +0 -181
- package/dist/warehouse/parser/query-parser.js +0 -415
- package/dist/warehouse/parser/query-parser.js.map +0 -1
- package/dist/warehouse/registry/data-source-registry.d.ts +0 -207
- package/dist/warehouse/registry/data-source-registry.js +0 -396
- package/dist/warehouse/registry/data-source-registry.js.map +0 -1
- package/dist/warehouse/registry/index.d.ts +0 -4
- package/dist/warehouse/registry/index.js +0 -9
- package/dist/warehouse/registry/index.js.map +0 -1
- package/dist/warehouse/transactions/index.d.ts +0 -4
- package/dist/warehouse/transactions/index.js +0 -9
- package/dist/warehouse/transactions/index.js.map +0 -1
- package/dist/warehouse/transactions/saga-orchestrator.d.ts +0 -92
- package/dist/warehouse/transactions/saga-orchestrator.js +0 -383
- package/dist/warehouse/transactions/saga-orchestrator.js.map +0 -1
- package/dist/warehouse/types/index.d.ts +0 -9
- package/dist/warehouse/types/index.js +0 -33
- package/dist/warehouse/types/index.js.map +0 -1
- package/dist/warehouse/types/join.interface.d.ts +0 -225
- package/dist/warehouse/types/join.interface.js +0 -87
- package/dist/warehouse/types/join.interface.js.map +0 -1
- package/dist/warehouse/types/query.interface.d.ts +0 -232
- package/dist/warehouse/types/query.interface.js +0 -9
- package/dist/warehouse/types/query.interface.js.map +0 -1
- package/dist/warehouse/types/transaction.interface.d.ts +0 -236
- package/dist/warehouse/types/transaction.interface.js +0 -74
- package/dist/warehouse/types/transaction.interface.js.map +0 -1
- package/dist/warehouse/types/where.interface.d.ts +0 -208
- package/dist/warehouse/types/where.interface.js +0 -89
- package/dist/warehouse/types/where.interface.js.map +0 -1
- package/dist/warehouse/warehouse.service.d.ts +0 -200
- package/dist/warehouse/warehouse.service.js +0 -470
- package/dist/warehouse/warehouse.service.js.map +0 -1
- package/dist/workflows/index.d.ts +0 -30
- package/dist/workflows/index.js +0 -64
- package/dist/workflows/index.js.map +0 -1
- package/dist/workflows/types/index.d.ts +0 -6
- package/dist/workflows/types/index.js +0 -23
- package/dist/workflows/types/index.js.map +0 -1
- package/dist/workflows/types/workflows.types.d.ts +0 -1095
- package/dist/workflows/types/workflows.types.js +0 -13
- package/dist/workflows/types/workflows.types.js.map +0 -1
- package/dist/workflows/workflow-builder.d.ts +0 -70
- package/dist/workflows/workflow-builder.js +0 -353
- package/dist/workflows/workflow-builder.js.map +0 -1
- package/dist/workflows/workflow-executor.d.ts +0 -289
- package/dist/workflows/workflow-executor.js +0 -2467
- package/dist/workflows/workflow-executor.js.map +0 -1
- package/dist/workflows/workflows.service.d.ts +0 -412
- package/dist/workflows/workflows.service.js +0 -2233
- package/dist/workflows/workflows.service.js.map +0 -1
|
@@ -1,907 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/**
|
|
3
|
-
* NotificationsService - Main Notifications Service Class
|
|
4
|
-
*
|
|
5
|
-
* Provides a unified interface for sending notifications through multiple channels:
|
|
6
|
-
* - Push notifications (Firebase, Expo)
|
|
7
|
-
* - Email (SMTP)
|
|
8
|
-
* - SMS (Twilio, Nexmo, Plivo)
|
|
9
|
-
* - Callbacks (HTTP webhooks)
|
|
10
|
-
*/
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.NotificationsService = void 0;
|
|
16
|
-
exports.notificationsService = notificationsService;
|
|
17
|
-
const products_service_1 = __importDefault(require("../products/services/products.service"));
|
|
18
|
-
const processor_service_1 = __importDefault(require("../processor/services/processor.service"));
|
|
19
|
-
const logs_service_1 = __importDefault(require("../logs/logs.service"));
|
|
20
|
-
const logs_types_1 = require("../logs/logs.types");
|
|
21
|
-
const processor_utils_1 = require("../processor/utils/processor.utils");
|
|
22
|
-
const cache_manager_1 = require("../cache/cache.manager");
|
|
23
|
-
const sessions_1 = require("../sessions");
|
|
24
|
-
const types_1 = require("./types");
|
|
25
|
-
/**
|
|
26
|
-
* NotificationsService - Send notifications through push, email, SMS, and callbacks
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* ```typescript
|
|
30
|
-
* const notifications = new NotificationsService({
|
|
31
|
-
* workspace_id: 'ws-123',
|
|
32
|
-
* public_key: 'pk-123',
|
|
33
|
-
* user_id: 'user-123',
|
|
34
|
-
* token: 'token-123',
|
|
35
|
-
* env_type: 'production',
|
|
36
|
-
* });
|
|
37
|
-
*
|
|
38
|
-
* // Send push notification
|
|
39
|
-
* await notifications.push({
|
|
40
|
-
* product: 'my-product',
|
|
41
|
-
* env: 'production',
|
|
42
|
-
* notification: 'alerts:welcome-message',
|
|
43
|
-
* input: {
|
|
44
|
-
* device_tokens: ['token1', 'token2'],
|
|
45
|
-
* title: { name: 'John' },
|
|
46
|
-
* body: { message: 'Welcome!' },
|
|
47
|
-
* },
|
|
48
|
-
* });
|
|
49
|
-
*
|
|
50
|
-
* // Send email
|
|
51
|
-
* await notifications.email({
|
|
52
|
-
* product: 'my-product',
|
|
53
|
-
* env: 'production',
|
|
54
|
-
* notification: 'emails:order-confirmation',
|
|
55
|
-
* input: {
|
|
56
|
-
* recipients: ['user@example.com'],
|
|
57
|
-
* subject: { orderId: '12345' },
|
|
58
|
-
* template: { orderDetails: '...' },
|
|
59
|
-
* },
|
|
60
|
-
* });
|
|
61
|
-
* ```
|
|
62
|
-
*/
|
|
63
|
-
class NotificationsService {
|
|
64
|
-
/**
|
|
65
|
-
* Create a new NotificationsService instance
|
|
66
|
-
* @param config - Configuration for authentication and workspace context
|
|
67
|
-
*/
|
|
68
|
-
constructor(config) {
|
|
69
|
-
/** ProductBuilder instances cache (keyed by product tag) */
|
|
70
|
-
this.productBuilders = new Map();
|
|
71
|
-
/** LogService instance for logging operations */
|
|
72
|
-
this.logService = null;
|
|
73
|
-
/** Current product ID for logging */
|
|
74
|
-
this.productId = '';
|
|
75
|
-
/** Cache manager for 3-tier caching */
|
|
76
|
-
this.cacheManager = null;
|
|
77
|
-
/** Private keys per product for cache encryption */
|
|
78
|
-
this.privateKeys = new Map();
|
|
79
|
-
/** Local cache for cache configurations to avoid repeated API calls */
|
|
80
|
-
this.cacheConfigCache = new Map();
|
|
81
|
-
this.config = config;
|
|
82
|
-
this._privateKey = config.private_key;
|
|
83
|
-
// Initialize CacheManager if Redis client is provided
|
|
84
|
-
if (config.redis_client) {
|
|
85
|
-
this.cacheManager = new cache_manager_1.CacheManager({
|
|
86
|
-
workspace_id: config.workspace_id,
|
|
87
|
-
public_key: config.public_key,
|
|
88
|
-
user_id: config.user_id,
|
|
89
|
-
token: config.token,
|
|
90
|
-
env_type: config.env_type,
|
|
91
|
-
redis_client: config.redis_client,
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
// ==================== INTERNAL HELPERS ====================
|
|
96
|
-
/**
|
|
97
|
-
* Create a new ProductBuilder instance
|
|
98
|
-
*/
|
|
99
|
-
createNewProductBuilder() {
|
|
100
|
-
return new products_service_1.default({
|
|
101
|
-
workspace_id: this.config.workspace_id,
|
|
102
|
-
public_key: this.config.public_key,
|
|
103
|
-
user_id: this.config.user_id,
|
|
104
|
-
token: this.config.token,
|
|
105
|
-
env_type: this.config.env_type,
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
/**
|
|
109
|
-
* Get or create a ProductBuilder instance for the given product tag
|
|
110
|
-
*/
|
|
111
|
-
async getProductBuilder(productTag) {
|
|
112
|
-
let builder = this.productBuilders.get(productTag);
|
|
113
|
-
if (!builder) {
|
|
114
|
-
builder = this.createNewProductBuilder();
|
|
115
|
-
await builder.initializeProductByTag(productTag);
|
|
116
|
-
this.productBuilders.set(productTag, builder);
|
|
117
|
-
this.productId = builder.fetchProductId() || '';
|
|
118
|
-
}
|
|
119
|
-
return builder;
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Initialize logging service
|
|
123
|
-
*/
|
|
124
|
-
initializeLogService() {
|
|
125
|
-
var _a;
|
|
126
|
-
if (!this.logService) {
|
|
127
|
-
this.logService = new logs_service_1.default({
|
|
128
|
-
product_id: this.productId,
|
|
129
|
-
workspace_id: this.config.workspace_id,
|
|
130
|
-
public_key: this.config.public_key,
|
|
131
|
-
user_id: this.config.user_id,
|
|
132
|
-
token: this.config.token,
|
|
133
|
-
env_type: this.config.env_type,
|
|
134
|
-
workspace_private_key: (_a = this._privateKey) !== null && _a !== void 0 ? _a : undefined,
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
/**
|
|
139
|
-
* Validate cache tag exists in product and return cache configuration
|
|
140
|
-
* Uses local in-memory cache to avoid repeated API calls (5 minute TTL)
|
|
141
|
-
*/
|
|
142
|
-
async validateCache(productTag, cacheTag) {
|
|
143
|
-
const cacheKey = `${productTag}:${cacheTag}`;
|
|
144
|
-
const cached = this.cacheConfigCache.get(cacheKey);
|
|
145
|
-
const now = Date.now();
|
|
146
|
-
const CACHE_TTL = 5 * 60 * 1000; // 5 minutes
|
|
147
|
-
// Return cached config if still valid
|
|
148
|
-
if (cached && (now - cached.fetchedAt) < CACHE_TTL) {
|
|
149
|
-
return { expiry: cached.expiry };
|
|
150
|
-
}
|
|
151
|
-
// Fetch from API and cache the result
|
|
152
|
-
const builder = await this.getProductBuilder(productTag);
|
|
153
|
-
const cache = await builder.fetchCache(cacheTag);
|
|
154
|
-
if (!cache) {
|
|
155
|
-
throw new Error(`Cache configuration '${cacheTag}' does not exist`);
|
|
156
|
-
}
|
|
157
|
-
this.cacheConfigCache.set(cacheKey, { expiry: cache.expiry, fetchedAt: now });
|
|
158
|
-
return { expiry: cache.expiry };
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* Create a new ProcessorService instance
|
|
162
|
-
*/
|
|
163
|
-
createNewProcessor() {
|
|
164
|
-
return new processor_service_1.default({
|
|
165
|
-
workspace_id: this.config.workspace_id,
|
|
166
|
-
public_key: this.config.public_key,
|
|
167
|
-
user_id: this.config.user_id,
|
|
168
|
-
token: this.config.token,
|
|
169
|
-
env_type: this.config.env_type,
|
|
170
|
-
private_key: this._privateKey,
|
|
171
|
-
});
|
|
172
|
-
}
|
|
173
|
-
/**
|
|
174
|
-
* Parse notification tag to extract notification and message tags
|
|
175
|
-
* Format: notification_tag:message_tag
|
|
176
|
-
*/
|
|
177
|
-
parseNotificationTag(tag) {
|
|
178
|
-
const parts = tag.split(':');
|
|
179
|
-
if (parts.length !== 2) {
|
|
180
|
-
throw new Error(`Invalid notification tag format: "${tag}". Expected format: "notification_tag:message_tag"`);
|
|
181
|
-
}
|
|
182
|
-
return {
|
|
183
|
-
notificationTag: parts[0],
|
|
184
|
-
messageTag: parts[1],
|
|
185
|
-
};
|
|
186
|
-
}
|
|
187
|
-
/**
|
|
188
|
-
* Build INotificationRequest from channel-specific input
|
|
189
|
-
*/
|
|
190
|
-
buildNotificationRequest(options) {
|
|
191
|
-
const request = {};
|
|
192
|
-
if (options.push_notification) {
|
|
193
|
-
request.push_notification = {
|
|
194
|
-
device_tokens: options.push_notification.device_tokens,
|
|
195
|
-
title: options.push_notification.title,
|
|
196
|
-
body: options.push_notification.body,
|
|
197
|
-
data: options.push_notification.data,
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
if (options.email) {
|
|
201
|
-
request.email = {
|
|
202
|
-
recipients: options.email.recipients,
|
|
203
|
-
subject: options.email.subject,
|
|
204
|
-
template: options.email.template,
|
|
205
|
-
};
|
|
206
|
-
}
|
|
207
|
-
if (options.sms) {
|
|
208
|
-
request.sms = {
|
|
209
|
-
recipients: options.sms.recipients,
|
|
210
|
-
body: options.sms.body,
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
if (options.callback) {
|
|
214
|
-
request.callback = {
|
|
215
|
-
query: options.callback.query,
|
|
216
|
-
headers: options.callback.headers,
|
|
217
|
-
params: options.callback.params,
|
|
218
|
-
body: options.callback.body,
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
return request;
|
|
222
|
-
}
|
|
223
|
-
// ==================== PUSH NOTIFICATIONS ====================
|
|
224
|
-
/**
|
|
225
|
-
* Send a push notification
|
|
226
|
-
*
|
|
227
|
-
* @param options - Push notification options
|
|
228
|
-
* @returns Notification result
|
|
229
|
-
*
|
|
230
|
-
* @example
|
|
231
|
-
* ```typescript
|
|
232
|
-
* const result = await notifications.push({
|
|
233
|
-
* product: 'my-product',
|
|
234
|
-
* env: 'production',
|
|
235
|
-
* notification: 'alerts:welcome',
|
|
236
|
-
* input: {
|
|
237
|
-
* device_tokens: ['device-token-1', 'device-token-2'],
|
|
238
|
-
* title: { name: 'John' },
|
|
239
|
-
* body: { message: 'Welcome to our app!' },
|
|
240
|
-
* data: { action: 'open_home' },
|
|
241
|
-
* },
|
|
242
|
-
* });
|
|
243
|
-
* ```
|
|
244
|
-
*/
|
|
245
|
-
async push(options) {
|
|
246
|
-
var _a, _b, _c;
|
|
247
|
-
const { product, env, notification, input, session, cache } = options;
|
|
248
|
-
const start = Date.now();
|
|
249
|
-
const { notificationTag, messageTag } = this.parseNotificationTag(notification);
|
|
250
|
-
let sessionLogFields = {};
|
|
251
|
-
let resolvedInput = input;
|
|
252
|
-
try {
|
|
253
|
-
await this.getProductBuilder(product);
|
|
254
|
-
this.initializeLogService();
|
|
255
|
-
// Store private key for cache operations
|
|
256
|
-
this.privateKeys.set(product, this._privateKey);
|
|
257
|
-
// Process session if provided - verify and resolve $Session{} references
|
|
258
|
-
if (session && this._privateKey) {
|
|
259
|
-
const productBuilder = await this.getProductBuilder(product);
|
|
260
|
-
const sessionResult = await (0, sessions_1.processSessionForExecution)(session, this._privateKey, input, env, {
|
|
261
|
-
fetchSessionSelector: async (sessionTag) => {
|
|
262
|
-
const sessionConfig = await productBuilder.fetchSession(sessionTag);
|
|
263
|
-
return sessionConfig === null || sessionConfig === void 0 ? void 0 : sessionConfig.selector;
|
|
264
|
-
},
|
|
265
|
-
});
|
|
266
|
-
if (sessionResult.error) {
|
|
267
|
-
throw new Error(`Session validation failed: ${sessionResult.error}`);
|
|
268
|
-
}
|
|
269
|
-
sessionLogFields = sessionResult.logFields;
|
|
270
|
-
resolvedInput = sessionResult.input;
|
|
271
|
-
}
|
|
272
|
-
const processId = (0, processor_utils_1.generateObjectId)();
|
|
273
|
-
// Check cache for idempotency (prevent duplicate sends with same data)
|
|
274
|
-
if (cache && this.cacheManager && this._privateKey) {
|
|
275
|
-
const cacheConfig = await this.validateCache(product, cache);
|
|
276
|
-
const cacheOptions = {
|
|
277
|
-
cache_tag: cache,
|
|
278
|
-
product_tag: product,
|
|
279
|
-
component_tag: `${notificationTag}:${messageTag}`,
|
|
280
|
-
component_type: 'notification',
|
|
281
|
-
operation: 'push',
|
|
282
|
-
input: { notification, device_tokens: input.device_tokens, title: input.title, body: input.body },
|
|
283
|
-
privateKey: this._privateKey,
|
|
284
|
-
expiry: cacheConfig.expiry,
|
|
285
|
-
};
|
|
286
|
-
const cached = await this.cacheManager.fetch(cacheOptions);
|
|
287
|
-
if (cached.hit && cached.data) {
|
|
288
|
-
const end = Date.now();
|
|
289
|
-
(_a = this.logService) === null || _a === void 0 ? void 0 : _a.add({
|
|
290
|
-
process_id: processId,
|
|
291
|
-
product_tag: product,
|
|
292
|
-
env,
|
|
293
|
-
start,
|
|
294
|
-
end,
|
|
295
|
-
type: logs_types_1.LogEventTypes.NOTIFICATIONS,
|
|
296
|
-
name: 'Push notification - cache hit',
|
|
297
|
-
message: `Push notification cache hit (${cached.source})`,
|
|
298
|
-
data: { notification, cache_source: cached.source },
|
|
299
|
-
status: logs_types_1.LogEventStatus.SUCCESS,
|
|
300
|
-
cache_tag: cache,
|
|
301
|
-
cache_key: cached.key,
|
|
302
|
-
cache_status: true,
|
|
303
|
-
});
|
|
304
|
-
return cached.data;
|
|
305
|
-
}
|
|
306
|
-
}
|
|
307
|
-
const processor = this.createNewProcessor();
|
|
308
|
-
const notificationInput = {
|
|
309
|
-
product,
|
|
310
|
-
env,
|
|
311
|
-
event: notification,
|
|
312
|
-
input: {
|
|
313
|
-
push_notification: {
|
|
314
|
-
device_tokens: resolvedInput.device_tokens,
|
|
315
|
-
title: resolvedInput.title,
|
|
316
|
-
body: resolvedInput.body,
|
|
317
|
-
data: resolvedInput.data,
|
|
318
|
-
},
|
|
319
|
-
},
|
|
320
|
-
session,
|
|
321
|
-
cache,
|
|
322
|
-
};
|
|
323
|
-
await processor.processNotification(notificationInput);
|
|
324
|
-
const result = {
|
|
325
|
-
success: true,
|
|
326
|
-
channel: types_1.NotificationChannelType.PUSH,
|
|
327
|
-
messageId: processId,
|
|
328
|
-
};
|
|
329
|
-
// Store in cache for idempotency (fire-and-forget)
|
|
330
|
-
if (cache && this.cacheManager && this._privateKey) {
|
|
331
|
-
const cacheConfig = await this.validateCache(product, cache);
|
|
332
|
-
this.cacheManager.store({
|
|
333
|
-
cache_tag: cache,
|
|
334
|
-
product_tag: product,
|
|
335
|
-
component_tag: `${notificationTag}:${messageTag}`,
|
|
336
|
-
component_type: 'notification',
|
|
337
|
-
operation: 'push',
|
|
338
|
-
input: { notification, device_tokens: resolvedInput.device_tokens, title: resolvedInput.title, body: resolvedInput.body },
|
|
339
|
-
privateKey: this._privateKey,
|
|
340
|
-
expiry: cacheConfig.expiry,
|
|
341
|
-
}, result);
|
|
342
|
-
}
|
|
343
|
-
const end = Date.now();
|
|
344
|
-
(_b = this.logService) === null || _b === void 0 ? void 0 : _b.add(Object.assign({ process_id: processId, product_tag: product, env,
|
|
345
|
-
start,
|
|
346
|
-
end, type: logs_types_1.LogEventTypes.NOTIFICATIONS, name: 'Push notification sent', message: 'Push notification sent successfully', data: { notification, recipients: resolvedInput.device_tokens.length }, status: logs_types_1.LogEventStatus.SUCCESS }, sessionLogFields));
|
|
347
|
-
return result;
|
|
348
|
-
}
|
|
349
|
-
catch (error) {
|
|
350
|
-
const end = Date.now();
|
|
351
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
352
|
-
(_c = this.logService) === null || _c === void 0 ? void 0 : _c.add(Object.assign({ process_id: (0, processor_utils_1.generateObjectId)(), product_tag: product, env,
|
|
353
|
-
start,
|
|
354
|
-
end, type: logs_types_1.LogEventTypes.NOTIFICATIONS, name: 'Push notification failed', message: errorMessage, data: { notification }, status: logs_types_1.LogEventStatus.FAIL }, sessionLogFields));
|
|
355
|
-
return {
|
|
356
|
-
success: false,
|
|
357
|
-
channel: types_1.NotificationChannelType.PUSH,
|
|
358
|
-
error: errorMessage,
|
|
359
|
-
};
|
|
360
|
-
}
|
|
361
|
-
}
|
|
362
|
-
// ==================== EMAIL ====================
|
|
363
|
-
/**
|
|
364
|
-
* Send an email
|
|
365
|
-
*
|
|
366
|
-
* @param options - Email options
|
|
367
|
-
* @returns Notification result
|
|
368
|
-
*
|
|
369
|
-
* @example
|
|
370
|
-
* ```typescript
|
|
371
|
-
* const result = await notifications.email({
|
|
372
|
-
* product: 'my-product',
|
|
373
|
-
* env: 'production',
|
|
374
|
-
* notification: 'emails:order-confirmation',
|
|
375
|
-
* input: {
|
|
376
|
-
* recipients: ['user@example.com', 'admin@example.com'],
|
|
377
|
-
* subject: { orderId: '12345' },
|
|
378
|
-
* template: {
|
|
379
|
-
* customerName: 'John Doe',
|
|
380
|
-
* orderTotal: '$99.99',
|
|
381
|
-
* },
|
|
382
|
-
* },
|
|
383
|
-
* });
|
|
384
|
-
* ```
|
|
385
|
-
*/
|
|
386
|
-
async email(options) {
|
|
387
|
-
var _a, _b, _c;
|
|
388
|
-
const { product, env, notification, input, session, cache } = options;
|
|
389
|
-
const start = Date.now();
|
|
390
|
-
const { notificationTag, messageTag } = this.parseNotificationTag(notification);
|
|
391
|
-
let sessionLogFields = {};
|
|
392
|
-
let resolvedInput = input;
|
|
393
|
-
try {
|
|
394
|
-
await this.getProductBuilder(product);
|
|
395
|
-
this.initializeLogService();
|
|
396
|
-
// Store private key for cache operations
|
|
397
|
-
this.privateKeys.set(product, this._privateKey);
|
|
398
|
-
// Process session if provided - verify and resolve $Session{} references
|
|
399
|
-
if (session && this._privateKey) {
|
|
400
|
-
const productBuilder = await this.getProductBuilder(product);
|
|
401
|
-
const sessionResult = await (0, sessions_1.processSessionForExecution)(session, this._privateKey, input, env, {
|
|
402
|
-
fetchSessionSelector: async (sessionTag) => {
|
|
403
|
-
const sessionConfig = await productBuilder.fetchSession(sessionTag);
|
|
404
|
-
return sessionConfig === null || sessionConfig === void 0 ? void 0 : sessionConfig.selector;
|
|
405
|
-
},
|
|
406
|
-
});
|
|
407
|
-
if (sessionResult.error) {
|
|
408
|
-
throw new Error(`Session validation failed: ${sessionResult.error}`);
|
|
409
|
-
}
|
|
410
|
-
sessionLogFields = sessionResult.logFields;
|
|
411
|
-
resolvedInput = sessionResult.input;
|
|
412
|
-
}
|
|
413
|
-
const processId = (0, processor_utils_1.generateObjectId)();
|
|
414
|
-
// Check cache for idempotency (prevent duplicate sends with same data)
|
|
415
|
-
if (cache && this.cacheManager && this._privateKey) {
|
|
416
|
-
const cacheConfig = await this.validateCache(product, cache);
|
|
417
|
-
const cacheOptions = {
|
|
418
|
-
cache_tag: cache,
|
|
419
|
-
product_tag: product,
|
|
420
|
-
component_tag: `${notificationTag}:${messageTag}`,
|
|
421
|
-
component_type: 'notification',
|
|
422
|
-
operation: 'email',
|
|
423
|
-
input: { notification, recipients: input.recipients, subject: input.subject },
|
|
424
|
-
privateKey: this._privateKey,
|
|
425
|
-
expiry: cacheConfig.expiry,
|
|
426
|
-
};
|
|
427
|
-
const cached = await this.cacheManager.fetch(cacheOptions);
|
|
428
|
-
if (cached.hit && cached.data) {
|
|
429
|
-
const end = Date.now();
|
|
430
|
-
(_a = this.logService) === null || _a === void 0 ? void 0 : _a.add({
|
|
431
|
-
process_id: processId,
|
|
432
|
-
product_tag: product,
|
|
433
|
-
env,
|
|
434
|
-
start,
|
|
435
|
-
end,
|
|
436
|
-
type: logs_types_1.LogEventTypes.NOTIFICATIONS,
|
|
437
|
-
name: 'Email - cache hit',
|
|
438
|
-
message: `Email cache hit (${cached.source})`,
|
|
439
|
-
data: { notification, cache_source: cached.source },
|
|
440
|
-
status: logs_types_1.LogEventStatus.SUCCESS,
|
|
441
|
-
cache_tag: cache,
|
|
442
|
-
cache_key: cached.key,
|
|
443
|
-
cache_status: true,
|
|
444
|
-
});
|
|
445
|
-
return cached.data;
|
|
446
|
-
}
|
|
447
|
-
}
|
|
448
|
-
const processor = this.createNewProcessor();
|
|
449
|
-
const notificationInput = {
|
|
450
|
-
product,
|
|
451
|
-
env,
|
|
452
|
-
event: notification,
|
|
453
|
-
input: {
|
|
454
|
-
email: {
|
|
455
|
-
recipients: resolvedInput.recipients,
|
|
456
|
-
subject: resolvedInput.subject,
|
|
457
|
-
template: resolvedInput.template,
|
|
458
|
-
},
|
|
459
|
-
},
|
|
460
|
-
session,
|
|
461
|
-
cache,
|
|
462
|
-
};
|
|
463
|
-
await processor.processNotification(notificationInput);
|
|
464
|
-
const result = {
|
|
465
|
-
success: true,
|
|
466
|
-
channel: types_1.NotificationChannelType.EMAIL,
|
|
467
|
-
messageId: processId,
|
|
468
|
-
};
|
|
469
|
-
// Store in cache for idempotency (fire-and-forget)
|
|
470
|
-
if (cache && this.cacheManager && this._privateKey) {
|
|
471
|
-
const cacheConfig = await this.validateCache(product, cache);
|
|
472
|
-
this.cacheManager.store({
|
|
473
|
-
cache_tag: cache,
|
|
474
|
-
product_tag: product,
|
|
475
|
-
component_tag: `${notificationTag}:${messageTag}`,
|
|
476
|
-
component_type: 'notification',
|
|
477
|
-
operation: 'email',
|
|
478
|
-
input: { notification, recipients: resolvedInput.recipients, subject: resolvedInput.subject },
|
|
479
|
-
privateKey: this._privateKey,
|
|
480
|
-
expiry: cacheConfig.expiry,
|
|
481
|
-
}, result);
|
|
482
|
-
}
|
|
483
|
-
const end = Date.now();
|
|
484
|
-
(_b = this.logService) === null || _b === void 0 ? void 0 : _b.add(Object.assign({ process_id: processId, product_tag: product, env,
|
|
485
|
-
start,
|
|
486
|
-
end, type: logs_types_1.LogEventTypes.NOTIFICATIONS, name: 'Email sent', message: 'Email sent successfully', data: { notification, recipients: resolvedInput.recipients.length }, status: logs_types_1.LogEventStatus.SUCCESS }, sessionLogFields));
|
|
487
|
-
return result;
|
|
488
|
-
}
|
|
489
|
-
catch (error) {
|
|
490
|
-
const end = Date.now();
|
|
491
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
492
|
-
(_c = this.logService) === null || _c === void 0 ? void 0 : _c.add(Object.assign({ process_id: (0, processor_utils_1.generateObjectId)(), product_tag: product, env,
|
|
493
|
-
start,
|
|
494
|
-
end, type: logs_types_1.LogEventTypes.NOTIFICATIONS, name: 'Email failed', message: errorMessage, data: { notification }, status: logs_types_1.LogEventStatus.FAIL }, sessionLogFields));
|
|
495
|
-
return {
|
|
496
|
-
success: false,
|
|
497
|
-
channel: types_1.NotificationChannelType.EMAIL,
|
|
498
|
-
error: errorMessage,
|
|
499
|
-
};
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
// ==================== SMS ====================
|
|
503
|
-
/**
|
|
504
|
-
* Send an SMS
|
|
505
|
-
*
|
|
506
|
-
* @param options - SMS options
|
|
507
|
-
* @returns Notification result
|
|
508
|
-
*
|
|
509
|
-
* @example
|
|
510
|
-
* ```typescript
|
|
511
|
-
* const result = await notifications.sms({
|
|
512
|
-
* product: 'my-product',
|
|
513
|
-
* env: 'production',
|
|
514
|
-
* notification: 'sms:verification',
|
|
515
|
-
* input: {
|
|
516
|
-
* recipients: ['+1234567890', '+0987654321'],
|
|
517
|
-
* body: { code: '123456' },
|
|
518
|
-
* },
|
|
519
|
-
* });
|
|
520
|
-
* ```
|
|
521
|
-
*/
|
|
522
|
-
async sms(options) {
|
|
523
|
-
var _a, _b, _c;
|
|
524
|
-
const { product, env, notification, input, session, cache } = options;
|
|
525
|
-
const start = Date.now();
|
|
526
|
-
const { notificationTag, messageTag } = this.parseNotificationTag(notification);
|
|
527
|
-
let sessionLogFields = {};
|
|
528
|
-
let resolvedInput = input;
|
|
529
|
-
try {
|
|
530
|
-
await this.getProductBuilder(product);
|
|
531
|
-
this.initializeLogService();
|
|
532
|
-
// Store private key for cache operations
|
|
533
|
-
this.privateKeys.set(product, this._privateKey);
|
|
534
|
-
// Process session if provided - verify and resolve $Session{} references
|
|
535
|
-
if (session && this._privateKey) {
|
|
536
|
-
const productBuilder = await this.getProductBuilder(product);
|
|
537
|
-
const sessionResult = await (0, sessions_1.processSessionForExecution)(session, this._privateKey, input, env, {
|
|
538
|
-
fetchSessionSelector: async (sessionTag) => {
|
|
539
|
-
const sessionConfig = await productBuilder.fetchSession(sessionTag);
|
|
540
|
-
return sessionConfig === null || sessionConfig === void 0 ? void 0 : sessionConfig.selector;
|
|
541
|
-
},
|
|
542
|
-
});
|
|
543
|
-
if (sessionResult.error) {
|
|
544
|
-
throw new Error(`Session validation failed: ${sessionResult.error}`);
|
|
545
|
-
}
|
|
546
|
-
sessionLogFields = sessionResult.logFields;
|
|
547
|
-
resolvedInput = sessionResult.input;
|
|
548
|
-
}
|
|
549
|
-
const processId = (0, processor_utils_1.generateObjectId)();
|
|
550
|
-
// Check cache for idempotency (prevent duplicate sends with same data)
|
|
551
|
-
if (cache && this.cacheManager && this._privateKey) {
|
|
552
|
-
const cacheConfig = await this.validateCache(product, cache);
|
|
553
|
-
const cacheOptions = {
|
|
554
|
-
cache_tag: cache,
|
|
555
|
-
product_tag: product,
|
|
556
|
-
component_tag: `${notificationTag}:${messageTag}`,
|
|
557
|
-
component_type: 'notification',
|
|
558
|
-
operation: 'sms',
|
|
559
|
-
input: { notification, recipients: resolvedInput.recipients, body: resolvedInput.body },
|
|
560
|
-
privateKey: this._privateKey,
|
|
561
|
-
expiry: cacheConfig.expiry,
|
|
562
|
-
};
|
|
563
|
-
const cached = await this.cacheManager.fetch(cacheOptions);
|
|
564
|
-
if (cached.hit && cached.data) {
|
|
565
|
-
const end = Date.now();
|
|
566
|
-
(_a = this.logService) === null || _a === void 0 ? void 0 : _a.add(Object.assign({ process_id: processId, product_tag: product, env,
|
|
567
|
-
start,
|
|
568
|
-
end, type: logs_types_1.LogEventTypes.NOTIFICATIONS, name: 'SMS - cache hit', message: `SMS cache hit (${cached.source})`, data: { notification, cache_source: cached.source }, status: logs_types_1.LogEventStatus.SUCCESS, cache_tag: cache, cache_key: cached.key, cache_status: true }, sessionLogFields));
|
|
569
|
-
return cached.data;
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
const processor = this.createNewProcessor();
|
|
573
|
-
const notificationInput = {
|
|
574
|
-
product,
|
|
575
|
-
env,
|
|
576
|
-
event: notification,
|
|
577
|
-
input: {
|
|
578
|
-
sms: {
|
|
579
|
-
recipients: resolvedInput.recipients,
|
|
580
|
-
body: resolvedInput.body,
|
|
581
|
-
},
|
|
582
|
-
},
|
|
583
|
-
session,
|
|
584
|
-
cache,
|
|
585
|
-
};
|
|
586
|
-
await processor.processNotification(notificationInput);
|
|
587
|
-
const result = {
|
|
588
|
-
success: true,
|
|
589
|
-
channel: types_1.NotificationChannelType.SMS,
|
|
590
|
-
messageId: processId,
|
|
591
|
-
};
|
|
592
|
-
// Store in cache for idempotency (fire-and-forget)
|
|
593
|
-
if (cache && this.cacheManager && this._privateKey) {
|
|
594
|
-
const cacheConfig = await this.validateCache(product, cache);
|
|
595
|
-
this.cacheManager.store({
|
|
596
|
-
cache_tag: cache,
|
|
597
|
-
product_tag: product,
|
|
598
|
-
component_tag: `${notificationTag}:${messageTag}`,
|
|
599
|
-
component_type: 'notification',
|
|
600
|
-
operation: 'sms',
|
|
601
|
-
input: { notification, recipients: resolvedInput.recipients, body: resolvedInput.body },
|
|
602
|
-
privateKey: this._privateKey,
|
|
603
|
-
expiry: cacheConfig.expiry,
|
|
604
|
-
}, result);
|
|
605
|
-
}
|
|
606
|
-
const end = Date.now();
|
|
607
|
-
(_b = this.logService) === null || _b === void 0 ? void 0 : _b.add(Object.assign({ process_id: processId, product_tag: product, env,
|
|
608
|
-
start,
|
|
609
|
-
end, type: logs_types_1.LogEventTypes.NOTIFICATIONS, name: 'SMS sent', message: 'SMS sent successfully', data: { notification, recipients: resolvedInput.recipients.length }, status: logs_types_1.LogEventStatus.SUCCESS }, sessionLogFields));
|
|
610
|
-
return result;
|
|
611
|
-
}
|
|
612
|
-
catch (error) {
|
|
613
|
-
const end = Date.now();
|
|
614
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
615
|
-
(_c = this.logService) === null || _c === void 0 ? void 0 : _c.add(Object.assign({ process_id: (0, processor_utils_1.generateObjectId)(), product_tag: product, env,
|
|
616
|
-
start,
|
|
617
|
-
end, type: logs_types_1.LogEventTypes.NOTIFICATIONS, name: 'SMS failed', message: errorMessage, data: { notification }, status: logs_types_1.LogEventStatus.FAIL }, sessionLogFields));
|
|
618
|
-
return {
|
|
619
|
-
success: false,
|
|
620
|
-
channel: types_1.NotificationChannelType.SMS,
|
|
621
|
-
error: errorMessage,
|
|
622
|
-
};
|
|
623
|
-
}
|
|
624
|
-
}
|
|
625
|
-
// ==================== CALLBACK ====================
|
|
626
|
-
/**
|
|
627
|
-
* Send a callback (HTTP webhook)
|
|
628
|
-
*
|
|
629
|
-
* @param options - Callback options
|
|
630
|
-
* @returns Notification result
|
|
631
|
-
*
|
|
632
|
-
* @example
|
|
633
|
-
* ```typescript
|
|
634
|
-
* const result = await notifications.callback({
|
|
635
|
-
* product: 'my-product',
|
|
636
|
-
* env: 'production',
|
|
637
|
-
* notification: 'webhooks:order-created',
|
|
638
|
-
* input: {
|
|
639
|
-
* body: {
|
|
640
|
-
* orderId: '12345',
|
|
641
|
-
* status: 'created',
|
|
642
|
-
* timestamp: Date.now(),
|
|
643
|
-
* },
|
|
644
|
-
* headers: {
|
|
645
|
-
* 'X-Custom-Header': 'value',
|
|
646
|
-
* },
|
|
647
|
-
* },
|
|
648
|
-
* });
|
|
649
|
-
* ```
|
|
650
|
-
*/
|
|
651
|
-
async callback(options) {
|
|
652
|
-
var _a, _b, _c;
|
|
653
|
-
const { product, env, notification, input, session, cache } = options;
|
|
654
|
-
const start = Date.now();
|
|
655
|
-
const { notificationTag, messageTag } = this.parseNotificationTag(notification);
|
|
656
|
-
let sessionLogFields = {};
|
|
657
|
-
let resolvedInput = input;
|
|
658
|
-
try {
|
|
659
|
-
await this.getProductBuilder(product);
|
|
660
|
-
this.initializeLogService();
|
|
661
|
-
// Store private key for cache operations
|
|
662
|
-
this.privateKeys.set(product, this._privateKey);
|
|
663
|
-
// Process session if provided - verify and resolve $Session{} references
|
|
664
|
-
if (session && this._privateKey) {
|
|
665
|
-
const productBuilder = await this.getProductBuilder(product);
|
|
666
|
-
const sessionResult = await (0, sessions_1.processSessionForExecution)(session, this._privateKey, input, env, {
|
|
667
|
-
fetchSessionSelector: async (sessionTag) => {
|
|
668
|
-
const sessionConfig = await productBuilder.fetchSession(sessionTag);
|
|
669
|
-
return sessionConfig === null || sessionConfig === void 0 ? void 0 : sessionConfig.selector;
|
|
670
|
-
},
|
|
671
|
-
});
|
|
672
|
-
if (sessionResult.error) {
|
|
673
|
-
throw new Error(`Session validation failed: ${sessionResult.error}`);
|
|
674
|
-
}
|
|
675
|
-
sessionLogFields = sessionResult.logFields;
|
|
676
|
-
resolvedInput = sessionResult.input;
|
|
677
|
-
}
|
|
678
|
-
const processId = (0, processor_utils_1.generateObjectId)();
|
|
679
|
-
// Check cache for idempotency (prevent duplicate sends with same data)
|
|
680
|
-
if (cache && this.cacheManager && this._privateKey) {
|
|
681
|
-
const cacheConfig = await this.validateCache(product, cache);
|
|
682
|
-
const cacheOptions = {
|
|
683
|
-
cache_tag: cache,
|
|
684
|
-
product_tag: product,
|
|
685
|
-
component_tag: `${notificationTag}:${messageTag}`,
|
|
686
|
-
component_type: 'notification',
|
|
687
|
-
operation: 'callback',
|
|
688
|
-
input: { notification, body: resolvedInput.body, query: resolvedInput.query },
|
|
689
|
-
privateKey: this._privateKey,
|
|
690
|
-
expiry: cacheConfig.expiry,
|
|
691
|
-
};
|
|
692
|
-
const cached = await this.cacheManager.fetch(cacheOptions);
|
|
693
|
-
if (cached.hit && cached.data) {
|
|
694
|
-
const end = Date.now();
|
|
695
|
-
(_a = this.logService) === null || _a === void 0 ? void 0 : _a.add(Object.assign({ process_id: processId, product_tag: product, env,
|
|
696
|
-
start,
|
|
697
|
-
end, type: logs_types_1.LogEventTypes.NOTIFICATIONS, name: 'Callback - cache hit', message: `Callback cache hit (${cached.source})`, data: { notification, cache_source: cached.source }, status: logs_types_1.LogEventStatus.SUCCESS, cache_tag: cache, cache_key: cached.key, cache_status: true }, sessionLogFields));
|
|
698
|
-
return cached.data;
|
|
699
|
-
}
|
|
700
|
-
}
|
|
701
|
-
const processor = this.createNewProcessor();
|
|
702
|
-
const notificationInput = {
|
|
703
|
-
product,
|
|
704
|
-
env,
|
|
705
|
-
event: notification,
|
|
706
|
-
input: {
|
|
707
|
-
callback: {
|
|
708
|
-
query: resolvedInput.query,
|
|
709
|
-
headers: resolvedInput.headers,
|
|
710
|
-
params: resolvedInput.params,
|
|
711
|
-
body: resolvedInput.body,
|
|
712
|
-
},
|
|
713
|
-
},
|
|
714
|
-
session,
|
|
715
|
-
cache,
|
|
716
|
-
};
|
|
717
|
-
await processor.processNotification(notificationInput);
|
|
718
|
-
const result = {
|
|
719
|
-
success: true,
|
|
720
|
-
channel: types_1.NotificationChannelType.CALLBACK,
|
|
721
|
-
messageId: processId,
|
|
722
|
-
};
|
|
723
|
-
// Store in cache for idempotency (fire-and-forget)
|
|
724
|
-
if (cache && this.cacheManager && this._privateKey) {
|
|
725
|
-
const cacheConfig = await this.validateCache(product, cache);
|
|
726
|
-
this.cacheManager.store({
|
|
727
|
-
cache_tag: cache,
|
|
728
|
-
product_tag: product,
|
|
729
|
-
component_tag: `${notificationTag}:${messageTag}`,
|
|
730
|
-
component_type: 'notification',
|
|
731
|
-
operation: 'callback',
|
|
732
|
-
input: { notification, body: resolvedInput.body, query: resolvedInput.query },
|
|
733
|
-
privateKey: this._privateKey,
|
|
734
|
-
expiry: cacheConfig.expiry,
|
|
735
|
-
}, result);
|
|
736
|
-
}
|
|
737
|
-
const end = Date.now();
|
|
738
|
-
(_b = this.logService) === null || _b === void 0 ? void 0 : _b.add(Object.assign({ process_id: processId, product_tag: product, env,
|
|
739
|
-
start,
|
|
740
|
-
end, type: logs_types_1.LogEventTypes.NOTIFICATIONS, name: 'Callback sent', message: 'Callback sent successfully', data: { notification }, status: logs_types_1.LogEventStatus.SUCCESS }, sessionLogFields));
|
|
741
|
-
return result;
|
|
742
|
-
}
|
|
743
|
-
catch (error) {
|
|
744
|
-
const end = Date.now();
|
|
745
|
-
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
746
|
-
(_c = this.logService) === null || _c === void 0 ? void 0 : _c.add(Object.assign({ process_id: (0, processor_utils_1.generateObjectId)(), product_tag: product, env,
|
|
747
|
-
start,
|
|
748
|
-
end, type: logs_types_1.LogEventTypes.NOTIFICATIONS, name: 'Callback failed', message: errorMessage, data: { notification }, status: logs_types_1.LogEventStatus.FAIL }, sessionLogFields));
|
|
749
|
-
return {
|
|
750
|
-
success: false,
|
|
751
|
-
channel: types_1.NotificationChannelType.CALLBACK,
|
|
752
|
-
error: errorMessage,
|
|
753
|
-
};
|
|
754
|
-
}
|
|
755
|
-
}
|
|
756
|
-
// ==================== MULTI-CHANNEL SEND ====================
|
|
757
|
-
/**
|
|
758
|
-
* Send notifications to multiple channels at once
|
|
759
|
-
*
|
|
760
|
-
* @param options - Multi-channel notification options
|
|
761
|
-
* @returns Results for each channel
|
|
762
|
-
*
|
|
763
|
-
* @example
|
|
764
|
-
* ```typescript
|
|
765
|
-
* const result = await notifications.send({
|
|
766
|
-
* product: 'my-product',
|
|
767
|
-
* env: 'production',
|
|
768
|
-
* notification: 'alerts:order-placed',
|
|
769
|
-
* push_notification: {
|
|
770
|
-
* device_tokens: ['token1'],
|
|
771
|
-
* title: { order: 'New Order' },
|
|
772
|
-
* body: { message: 'Order #12345 placed' },
|
|
773
|
-
* },
|
|
774
|
-
* email: {
|
|
775
|
-
* recipients: ['user@example.com'],
|
|
776
|
-
* subject: { orderId: '12345' },
|
|
777
|
-
* template: { orderDetails: '...' },
|
|
778
|
-
* },
|
|
779
|
-
* sms: {
|
|
780
|
-
* recipients: ['+1234567890'],
|
|
781
|
-
* body: { message: 'Order #12345 placed' },
|
|
782
|
-
* },
|
|
783
|
-
* });
|
|
784
|
-
* ```
|
|
785
|
-
*/
|
|
786
|
-
async send(options) {
|
|
787
|
-
const results = {
|
|
788
|
-
success: false,
|
|
789
|
-
channels: {},
|
|
790
|
-
};
|
|
791
|
-
const promises = [];
|
|
792
|
-
if (options.push_notification) {
|
|
793
|
-
promises.push(this.push({
|
|
794
|
-
product: options.product,
|
|
795
|
-
env: options.env,
|
|
796
|
-
notification: options.notification,
|
|
797
|
-
input: options.push_notification,
|
|
798
|
-
session: options.session,
|
|
799
|
-
cache: options.cache,
|
|
800
|
-
}).then((result) => {
|
|
801
|
-
results.channels.push = result;
|
|
802
|
-
}));
|
|
803
|
-
}
|
|
804
|
-
if (options.email) {
|
|
805
|
-
promises.push(this.email({
|
|
806
|
-
product: options.product,
|
|
807
|
-
env: options.env,
|
|
808
|
-
notification: options.notification,
|
|
809
|
-
input: options.email,
|
|
810
|
-
session: options.session,
|
|
811
|
-
cache: options.cache,
|
|
812
|
-
}).then((result) => {
|
|
813
|
-
results.channels.email = result;
|
|
814
|
-
}));
|
|
815
|
-
}
|
|
816
|
-
if (options.sms) {
|
|
817
|
-
promises.push(this.sms({
|
|
818
|
-
product: options.product,
|
|
819
|
-
env: options.env,
|
|
820
|
-
notification: options.notification,
|
|
821
|
-
input: options.sms,
|
|
822
|
-
session: options.session,
|
|
823
|
-
cache: options.cache,
|
|
824
|
-
}).then((result) => {
|
|
825
|
-
results.channels.sms = result;
|
|
826
|
-
}));
|
|
827
|
-
}
|
|
828
|
-
if (options.callback) {
|
|
829
|
-
promises.push(this.callback({
|
|
830
|
-
product: options.product,
|
|
831
|
-
env: options.env,
|
|
832
|
-
notification: options.notification,
|
|
833
|
-
input: options.callback,
|
|
834
|
-
session: options.session,
|
|
835
|
-
cache: options.cache,
|
|
836
|
-
}).then((result) => {
|
|
837
|
-
results.channels.callback = result;
|
|
838
|
-
}));
|
|
839
|
-
}
|
|
840
|
-
await Promise.all(promises);
|
|
841
|
-
// Overall success if at least one channel succeeded
|
|
842
|
-
results.success = Object.values(results.channels).some((channel) => channel === null || channel === void 0 ? void 0 : channel.success);
|
|
843
|
-
return results;
|
|
844
|
-
}
|
|
845
|
-
// ==================== SCHEDULING ====================
|
|
846
|
-
/**
|
|
847
|
-
* Schedule a notification to be sent at a later time
|
|
848
|
-
*
|
|
849
|
-
* @param options - Notification options with scheduling
|
|
850
|
-
* @returns Dispatch result with job ID
|
|
851
|
-
*
|
|
852
|
-
* @example
|
|
853
|
-
* ```typescript
|
|
854
|
-
* const result = await notifications.dispatch({
|
|
855
|
-
* product: 'my-product',
|
|
856
|
-
* env: 'production',
|
|
857
|
-
* notification: 'reminders:payment-due',
|
|
858
|
-
* input: {
|
|
859
|
-
* push_notification: {
|
|
860
|
-
* device_tokens: ['token1'],
|
|
861
|
-
* title: { name: 'Payment' },
|
|
862
|
-
* body: { message: 'Your payment is due' },
|
|
863
|
-
* },
|
|
864
|
-
* },
|
|
865
|
-
* schedule: {
|
|
866
|
-
* start_at: Date.now() + 86400000, // 24 hours from now
|
|
867
|
-
* },
|
|
868
|
-
* });
|
|
869
|
-
* ```
|
|
870
|
-
*/
|
|
871
|
-
async dispatch(options) {
|
|
872
|
-
const { product, env, notification, schedule, retries = 3 } = options;
|
|
873
|
-
await this.getProductBuilder(product);
|
|
874
|
-
this.initializeLogService();
|
|
875
|
-
const processor = this.createNewProcessor();
|
|
876
|
-
const notificationRequest = this.buildNotificationRequest(options);
|
|
877
|
-
// TODO: dispatchNotification is not yet implemented in ProcessorService
|
|
878
|
-
// For now, fall back to immediate processing
|
|
879
|
-
const notificationInput = {
|
|
880
|
-
product,
|
|
881
|
-
env,
|
|
882
|
-
event: notification,
|
|
883
|
-
input: notificationRequest,
|
|
884
|
-
session: options.session,
|
|
885
|
-
cache: options.cache,
|
|
886
|
-
retries,
|
|
887
|
-
};
|
|
888
|
-
await processor.processNotification(notificationInput);
|
|
889
|
-
const scheduledAt = (schedule === null || schedule === void 0 ? void 0 : schedule.start_at) ? Number(schedule.start_at) : Date.now();
|
|
890
|
-
return {
|
|
891
|
-
job_id: (0, processor_utils_1.generateObjectId)(),
|
|
892
|
-
status: 'queued',
|
|
893
|
-
scheduled_at: scheduledAt,
|
|
894
|
-
recurring: !!(schedule === null || schedule === void 0 ? void 0 : schedule.cron) || !!(schedule === null || schedule === void 0 ? void 0 : schedule.every),
|
|
895
|
-
next_run_at: (schedule === null || schedule === void 0 ? void 0 : schedule.cron) || (schedule === null || schedule === void 0 ? void 0 : schedule.every) ? scheduledAt : undefined,
|
|
896
|
-
};
|
|
897
|
-
}
|
|
898
|
-
}
|
|
899
|
-
exports.NotificationsService = NotificationsService;
|
|
900
|
-
/**
|
|
901
|
-
* Factory function for creating NotificationsService instances
|
|
902
|
-
*/
|
|
903
|
-
function notificationsService(config) {
|
|
904
|
-
return new NotificationsService(config);
|
|
905
|
-
}
|
|
906
|
-
exports.default = NotificationsService;
|
|
907
|
-
//# sourceMappingURL=notifications.service.js.map
|