@budibase/backend-core 2.9.16 → 2.9.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +12544 -0
- package/dist/index.js.map +7 -0
- package/dist/index.js.meta.json +1 -0
- package/dist/package.json +5 -5
- package/dist/plugins.js +288 -16
- package/dist/plugins.js.map +7 -1
- package/dist/plugins.js.meta.json +1 -0
- package/dist/tests.js +8476 -0
- package/dist/tests.js.map +7 -0
- package/dist/tests.js.meta.json +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/scripts/build.js +6 -0
- package/tsconfig.build.json +5 -1
- package/tsconfig.json +0 -8
- package/dist/jest.config.js +0 -25
- package/dist/jest.config.js.map +0 -1
- package/dist/plugins.d.ts +0 -1
- package/dist/src/accounts/accounts.js +0 -83
- package/dist/src/accounts/accounts.js.map +0 -1
- package/dist/src/accounts/api.js +0 -92
- package/dist/src/accounts/api.js.map +0 -1
- package/dist/src/accounts/index.js +0 -18
- package/dist/src/accounts/index.js.map +0 -1
- package/dist/src/auth/auth.js +0 -189
- package/dist/src/auth/auth.js.map +0 -1
- package/dist/src/auth/index.js +0 -18
- package/dist/src/auth/index.js.map +0 -1
- package/dist/src/blacklist/blacklist.js +0 -76
- package/dist/src/blacklist/blacklist.js.map +0 -1
- package/dist/src/blacklist/index.js +0 -18
- package/dist/src/blacklist/index.js.map +0 -1
- package/dist/src/cache/appMetadata.js +0 -96
- package/dist/src/cache/appMetadata.js.map +0 -1
- package/dist/src/cache/base/index.js +0 -120
- package/dist/src/cache/base/index.js.map +0 -1
- package/dist/src/cache/generic.js +0 -31
- package/dist/src/cache/generic.js.map +0 -1
- package/dist/src/cache/index.js +0 -35
- package/dist/src/cache/index.js.map +0 -1
- package/dist/src/cache/user.js +0 -108
- package/dist/src/cache/user.js.map +0 -1
- package/dist/src/cache/writethrough.js +0 -159
- package/dist/src/cache/writethrough.js.map +0 -1
- package/dist/src/configs/configs.js +0 -278
- package/dist/src/configs/configs.js.map +0 -1
- package/dist/src/configs/index.js +0 -18
- package/dist/src/configs/index.js.map +0 -1
- package/dist/src/constants/db.js +0 -67
- package/dist/src/constants/db.js.map +0 -1
- package/dist/src/constants/index.js +0 -19
- package/dist/src/constants/index.js.map +0 -1
- package/dist/src/constants/misc.js +0 -54
- package/dist/src/constants/misc.js.map +0 -1
- package/dist/src/context/Context.js +0 -14
- package/dist/src/context/Context.js.map +0 -1
- package/dist/src/context/identity.js +0 -72
- package/dist/src/context/identity.js.map +0 -1
- package/dist/src/context/index.js +0 -34
- package/dist/src/context/index.js.map +0 -1
- package/dist/src/context/mainContext.js +0 -331
- package/dist/src/context/mainContext.js.map +0 -1
- package/dist/src/context/types.js +0 -3
- package/dist/src/context/types.js.map +0 -1
- package/dist/src/db/Replication.js +0 -85
- package/dist/src/db/Replication.js.map +0 -1
- package/dist/src/db/constants.js +0 -13
- package/dist/src/db/constants.js.map +0 -1
- package/dist/src/db/couch/DatabaseImpl.js +0 -248
- package/dist/src/db/couch/DatabaseImpl.js.map +0 -1
- package/dist/src/db/couch/connections.js +0 -88
- package/dist/src/db/couch/connections.js.map +0 -1
- package/dist/src/db/couch/index.js +0 -27
- package/dist/src/db/couch/index.js.map +0 -1
- package/dist/src/db/couch/pouchDB.js +0 -108
- package/dist/src/db/couch/pouchDB.js.map +0 -1
- package/dist/src/db/couch/pouchDump.js +0 -2
- package/dist/src/db/couch/pouchDump.js.map +0 -1
- package/dist/src/db/couch/utils.js +0 -55
- package/dist/src/db/couch/utils.js.map +0 -1
- package/dist/src/db/db.js +0 -59
- package/dist/src/db/db.js.map +0 -1
- package/dist/src/db/errors.js +0 -22
- package/dist/src/db/errors.js.map +0 -1
- package/dist/src/db/index.js +0 -48
- package/dist/src/db/index.js.map +0 -1
- package/dist/src/db/lucene.js +0 -650
- package/dist/src/db/lucene.js.map +0 -1
- package/dist/src/db/searchIndexes/index.js +0 -18
- package/dist/src/db/searchIndexes/index.js.map +0 -1
- package/dist/src/db/searchIndexes/searchIndexes.js +0 -77
- package/dist/src/db/searchIndexes/searchIndexes.js.map +0 -1
- package/dist/src/db/utils.js +0 -213
- package/dist/src/db/utils.js.map +0 -1
- package/dist/src/db/views.js +0 -219
- package/dist/src/db/views.js.map +0 -1
- package/dist/src/docIds/conversions.js +0 -62
- package/dist/src/docIds/conversions.js.map +0 -1
- package/dist/src/docIds/ids.js +0 -112
- package/dist/src/docIds/ids.js.map +0 -1
- package/dist/src/docIds/index.js +0 -19
- package/dist/src/docIds/index.js.map +0 -1
- package/dist/src/docIds/newid.js +0 -9
- package/dist/src/docIds/newid.js.map +0 -1
- package/dist/src/docIds/params.js +0 -138
- package/dist/src/docIds/params.js.map +0 -1
- package/dist/src/docUpdates/index.js +0 -36
- package/dist/src/docUpdates/index.js.map +0 -1
- package/dist/src/environment.js +0 -110
- package/dist/src/environment.js.map +0 -1
- package/dist/src/errors/errors.js +0 -97
- package/dist/src/errors/errors.js.map +0 -1
- package/dist/src/errors/index.js +0 -18
- package/dist/src/errors/index.js.map +0 -1
- package/dist/src/events/analytics.js +0 -42
- package/dist/src/events/analytics.js.map +0 -1
- package/dist/src/events/asyncEvents/index.js +0 -19
- package/dist/src/events/asyncEvents/index.js.map +0 -1
- package/dist/src/events/asyncEvents/publisher.js +0 -27
- package/dist/src/events/asyncEvents/publisher.js.map +0 -1
- package/dist/src/events/asyncEvents/queue.js +0 -26
- package/dist/src/events/asyncEvents/queue.js.map +0 -1
- package/dist/src/events/backfill.js +0 -179
- package/dist/src/events/backfill.js.map +0 -1
- package/dist/src/events/documentId.js +0 -28
- package/dist/src/events/documentId.js.map +0 -1
- package/dist/src/events/events.js +0 -73
- package/dist/src/events/events.js.map +0 -1
- package/dist/src/events/identification.js +0 -300
- package/dist/src/events/identification.js.map +0 -1
- package/dist/src/events/index.js +0 -47
- package/dist/src/events/index.js.map +0 -1
- package/dist/src/events/processors/AnalyticsProcessor.js +0 -93
- package/dist/src/events/processors/AnalyticsProcessor.js.map +0 -1
- package/dist/src/events/processors/AuditLogsProcessor.js +0 -86
- package/dist/src/events/processors/AuditLogsProcessor.js.map +0 -1
- package/dist/src/events/processors/LoggingProcessor.js +0 -47
- package/dist/src/events/processors/LoggingProcessor.js.map +0 -1
- package/dist/src/events/processors/Processors.js +0 -52
- package/dist/src/events/processors/Processors.js.map +0 -1
- package/dist/src/events/processors/async/DocumentUpdateProcessor.js +0 -44
- package/dist/src/events/processors/async/DocumentUpdateProcessor.js.map +0 -1
- package/dist/src/events/processors/index.js +0 -23
- package/dist/src/events/processors/index.js.map +0 -1
- package/dist/src/events/processors/posthog/PosthogProcessor.js +0 -139
- package/dist/src/events/processors/posthog/PosthogProcessor.js.map +0 -1
- package/dist/src/events/processors/posthog/index.js +0 -8
- package/dist/src/events/processors/posthog/index.js.map +0 -1
- package/dist/src/events/processors/posthog/rateLimiting.js +0 -119
- package/dist/src/events/processors/posthog/rateLimiting.js.map +0 -1
- package/dist/src/events/processors/types.js +0 -3
- package/dist/src/events/processors/types.js.map +0 -1
- package/dist/src/events/publishers/account.js +0 -43
- package/dist/src/events/publishers/account.js.map +0 -1
- package/dist/src/events/publishers/app.js +0 -153
- package/dist/src/events/publishers/app.js.map +0 -1
- package/dist/src/events/publishers/auditLog.js +0 -34
- package/dist/src/events/publishers/auditLog.js.map +0 -1
- package/dist/src/events/publishers/auth.js +0 -80
- package/dist/src/events/publishers/auth.js.map +0 -1
- package/dist/src/events/publishers/automation.js +0 -117
- package/dist/src/events/publishers/automation.js.map +0 -1
- package/dist/src/events/publishers/backfill.js +0 -85
- package/dist/src/events/publishers/backfill.js.map +0 -1
- package/dist/src/events/publishers/backup.js +0 -41
- package/dist/src/events/publishers/backup.js.map +0 -1
- package/dist/src/events/publishers/datasource.js +0 -54
- package/dist/src/events/publishers/datasource.js.map +0 -1
- package/dist/src/events/publishers/email.js +0 -30
- package/dist/src/events/publishers/email.js.map +0 -1
- package/dist/src/events/publishers/environmentVariable.js +0 -44
- package/dist/src/events/publishers/environmentVariable.js.map +0 -1
- package/dist/src/events/publishers/group.js +0 -107
- package/dist/src/events/publishers/group.js.map +0 -1
- package/dist/src/events/publishers/index.js +0 -55
- package/dist/src/events/publishers/index.js.map +0 -1
- package/dist/src/events/publishers/installation.js +0 -52
- package/dist/src/events/publishers/installation.js.map +0 -1
- package/dist/src/events/publishers/layout.js +0 -34
- package/dist/src/events/publishers/layout.js.map +0 -1
- package/dist/src/events/publishers/license.js +0 -77
- package/dist/src/events/publishers/license.js.map +0 -1
- package/dist/src/events/publishers/org.js +0 -52
- package/dist/src/events/publishers/org.js.map +0 -1
- package/dist/src/events/publishers/plugin.js +0 -55
- package/dist/src/events/publishers/plugin.js.map +0 -1
- package/dist/src/events/publishers/query.js +0 -74
- package/dist/src/events/publishers/query.js.map +0 -1
- package/dist/src/events/publishers/role.js +0 -69
- package/dist/src/events/publishers/role.js.map +0 -1
- package/dist/src/events/publishers/rows.js +0 -32
- package/dist/src/events/publishers/rows.js.map +0 -1
- package/dist/src/events/publishers/screen.js +0 -46
- package/dist/src/events/publishers/screen.js.map +0 -1
- package/dist/src/events/publishers/serve.js +0 -47
- package/dist/src/events/publishers/serve.js.map +0 -1
- package/dist/src/events/publishers/table.js +0 -77
- package/dist/src/events/publishers/table.js.map +0 -1
- package/dist/src/events/publishers/user.js +0 -202
- package/dist/src/events/publishers/user.js.map +0 -1
- package/dist/src/events/publishers/view.js +0 -111
- package/dist/src/events/publishers/view.js.map +0 -1
- package/dist/src/featureFlags/index.js +0 -96
- package/dist/src/featureFlags/index.js.map +0 -1
- package/dist/src/helpers.js +0 -14
- package/dist/src/helpers.js.map +0 -1
- package/dist/src/index.js +0 -82
- package/dist/src/index.js.map +0 -1
- package/dist/src/installation.js +0 -138
- package/dist/src/installation.js.map +0 -1
- package/dist/src/logging/alerts.js +0 -24
- package/dist/src/logging/alerts.js.map +0 -1
- package/dist/src/logging/correlation/correlation.js +0 -17
- package/dist/src/logging/correlation/correlation.js.map +0 -1
- package/dist/src/logging/correlation/index.js +0 -18
- package/dist/src/logging/correlation/index.js.map +0 -1
- package/dist/src/logging/correlation/middleware.js +0 -17
- package/dist/src/logging/correlation/middleware.js.map +0 -1
- package/dist/src/logging/index.js +0 -35
- package/dist/src/logging/index.js.map +0 -1
- package/dist/src/logging/pino/logger.js +0 -218
- package/dist/src/logging/pino/logger.js.map +0 -1
- package/dist/src/logging/pino/middleware.js +0 -47
- package/dist/src/logging/pino/middleware.js.map +0 -1
- package/dist/src/logging/system.js +0 -101
- package/dist/src/logging/system.js.map +0 -1
- package/dist/src/middleware/adminOnly.js +0 -19
- package/dist/src/middleware/adminOnly.js.map +0 -1
- package/dist/src/middleware/auditLog.js +0 -16
- package/dist/src/middleware/auditLog.js.map +0 -1
- package/dist/src/middleware/authenticated.js +0 -204
- package/dist/src/middleware/authenticated.js.map +0 -1
- package/dist/src/middleware/builderOnly.js +0 -33
- package/dist/src/middleware/builderOnly.js.map +0 -1
- package/dist/src/middleware/builderOrAdmin.js +0 -33
- package/dist/src/middleware/builderOrAdmin.js.map +0 -1
- package/dist/src/middleware/csrf.js +0 -81
- package/dist/src/middleware/csrf.js.map +0 -1
- package/dist/src/middleware/errorHandling.js +0 -64
- package/dist/src/middleware/errorHandling.js.map +0 -1
- package/dist/src/middleware/index.js +0 -65
- package/dist/src/middleware/index.js.map +0 -1
- package/dist/src/middleware/internalApi.js +0 -30
- package/dist/src/middleware/internalApi.js.map +0 -1
- package/dist/src/middleware/joi-validator.js +0 -47
- package/dist/src/middleware/joi-validator.js.map +0 -1
- package/dist/src/middleware/matchers.js +0 -43
- package/dist/src/middleware/matchers.js.map +0 -1
- package/dist/src/middleware/passport/datasource/google.js +0 -95
- package/dist/src/middleware/passport/datasource/google.js.map +0 -1
- package/dist/src/middleware/passport/local.js +0 -81
- package/dist/src/middleware/passport/local.js.map +0 -1
- package/dist/src/middleware/passport/sso/google.js +0 -90
- package/dist/src/middleware/passport/sso/google.js.map +0 -1
- package/dist/src/middleware/passport/sso/oidc.js +0 -151
- package/dist/src/middleware/passport/sso/oidc.js.map +0 -1
- package/dist/src/middleware/passport/sso/sso.js +0 -165
- package/dist/src/middleware/passport/sso/sso.js.map +0 -1
- package/dist/src/middleware/passport/utils.js +0 -66
- package/dist/src/middleware/passport/utils.js.map +0 -1
- package/dist/src/middleware/querystringToBody.js +0 -29
- package/dist/src/middleware/querystringToBody.js.map +0 -1
- package/dist/src/middleware/tenancy.js +0 -37
- package/dist/src/middleware/tenancy.js.map +0 -1
- package/dist/src/migrations/definitions.js +0 -39
- package/dist/src/migrations/definitions.js.map +0 -1
- package/dist/src/migrations/index.js +0 -19
- package/dist/src/migrations/index.js.map +0 -1
- package/dist/src/migrations/migrations.js +0 -198
- package/dist/src/migrations/migrations.js.map +0 -1
- package/dist/src/objectStore/buckets/app.js +0 -73
- package/dist/src/objectStore/buckets/app.js.map +0 -1
- package/dist/src/objectStore/buckets/global.js +0 -58
- package/dist/src/objectStore/buckets/global.js.map +0 -1
- package/dist/src/objectStore/buckets/index.js +0 -20
- package/dist/src/objectStore/buckets/index.js.map +0 -1
- package/dist/src/objectStore/buckets/plugins.js +0 -95
- package/dist/src/objectStore/buckets/plugins.js.map +0 -1
- package/dist/src/objectStore/cloudfront.js +0 -40
- package/dist/src/objectStore/cloudfront.js.map +0 -1
- package/dist/src/objectStore/index.js +0 -20
- package/dist/src/objectStore/index.js.map +0 -1
- package/dist/src/objectStore/objectStore.js +0 -382
- package/dist/src/objectStore/objectStore.js.map +0 -1
- package/dist/src/objectStore/utils.js +0 -32
- package/dist/src/objectStore/utils.js.map +0 -1
- package/dist/src/platform/index.js +0 -33
- package/dist/src/platform/index.js.map +0 -1
- package/dist/src/platform/platformDb.js +0 -10
- package/dist/src/platform/platformDb.js.map +0 -1
- package/dist/src/platform/tenants.js +0 -139
- package/dist/src/platform/tenants.js.map +0 -1
- package/dist/src/platform/users.js +0 -96
- package/dist/src/platform/users.js.map +0 -1
- package/dist/src/plugin/index.js +0 -18
- package/dist/src/plugin/index.js.map +0 -1
- package/dist/src/plugin/utils.js +0 -145
- package/dist/src/plugin/utils.js.map +0 -1
- package/dist/src/queue/constants.js +0 -11
- package/dist/src/queue/constants.js.map +0 -1
- package/dist/src/queue/inMemoryQueue.js +0 -145
- package/dist/src/queue/inMemoryQueue.js.map +0 -1
- package/dist/src/queue/index.js +0 -19
- package/dist/src/queue/index.js.map +0 -1
- package/dist/src/queue/listeners.js +0 -186
- package/dist/src/queue/listeners.js.map +0 -1
- package/dist/src/queue/queue.js +0 -92
- package/dist/src/queue/queue.js.map +0 -1
- package/dist/src/redis/index.js +0 -37
- package/dist/src/redis/index.js.map +0 -1
- package/dist/src/redis/init.js +0 -138
- package/dist/src/redis/init.js.map +0 -1
- package/dist/src/redis/redis.js +0 -335
- package/dist/src/redis/redis.js.map +0 -1
- package/dist/src/redis/redlockImpl.js +0 -162
- package/dist/src/redis/redlockImpl.js.map +0 -1
- package/dist/src/redis/utils.js +0 -123
- package/dist/src/redis/utils.js.map +0 -1
- package/dist/src/security/encryption.js +0 -163
- package/dist/src/security/encryption.js.map +0 -1
- package/dist/src/security/permissions.js +0 -151
- package/dist/src/security/permissions.js.map +0 -1
- package/dist/src/security/roles.js +0 -388
- package/dist/src/security/roles.js.map +0 -1
- package/dist/src/security/sessions.js +0 -121
- package/dist/src/security/sessions.js.map +0 -1
- package/dist/src/tenancy/db.js +0 -10
- package/dist/src/tenancy/db.js.map +0 -1
- package/dist/src/tenancy/index.js +0 -19
- package/dist/src/tenancy/index.js.map +0 -1
- package/dist/src/tenancy/tenancy.js +0 -116
- package/dist/src/tenancy/tenancy.js.map +0 -1
- package/dist/src/timers/index.js +0 -18
- package/dist/src/timers/index.js.map +0 -1
- package/dist/src/timers/timers.js +0 -26
- package/dist/src/timers/timers.js.map +0 -1
- package/dist/src/users/db.js +0 -407
- package/dist/src/users/db.js.map +0 -1
- package/dist/src/users/events.js +0 -169
- package/dist/src/users/events.js.map +0 -1
- package/dist/src/users/index.js +0 -23
- package/dist/src/users/index.js.map +0 -1
- package/dist/src/users/lookup.js +0 -112
- package/dist/src/users/lookup.js.map +0 -1
- package/dist/src/users/users.js +0 -261
- package/dist/src/users/users.js.map +0 -1
- package/dist/src/users/utils.js +0 -92
- package/dist/src/users/utils.js.map +0 -1
- package/dist/src/utils/hashing.js +0 -47
- package/dist/src/utils/hashing.js.map +0 -1
- package/dist/src/utils/index.js +0 -20
- package/dist/src/utils/index.js.map +0 -1
- package/dist/src/utils/stringUtils.js +0 -9
- package/dist/src/utils/stringUtils.js.map +0 -1
- package/dist/src/utils/utils.js +0 -247
- package/dist/src/utils/utils.js.map +0 -1
- package/dist/tests/core/logging.js +0 -33
- package/dist/tests/core/logging.js.map +0 -1
- package/dist/tests/core/utilities/index.js +0 -37
- package/dist/tests/core/utilities/index.js.map +0 -1
- package/dist/tests/core/utilities/jestUtils.js +0 -21
- package/dist/tests/core/utilities/jestUtils.js.map +0 -1
- package/dist/tests/core/utilities/mocks/alerts.js +0 -30
- package/dist/tests/core/utilities/mocks/alerts.js.map +0 -1
- package/dist/tests/core/utilities/mocks/date.js +0 -6
- package/dist/tests/core/utilities/mocks/date.js.map +0 -1
- package/dist/tests/core/utilities/mocks/events.js +0 -143
- package/dist/tests/core/utilities/mocks/events.js.map +0 -1
- package/dist/tests/core/utilities/mocks/fetch.js +0 -15
- package/dist/tests/core/utilities/mocks/fetch.js.map +0 -1
- package/dist/tests/core/utilities/mocks/index.js +0 -43
- package/dist/tests/core/utilities/mocks/index.js.map +0 -1
- package/dist/tests/core/utilities/mocks/licenses.js +0 -97
- package/dist/tests/core/utilities/mocks/licenses.js.map +0 -1
- package/dist/tests/core/utilities/mocks/posthog.js +0 -9
- package/dist/tests/core/utilities/mocks/posthog.js.map +0 -1
- package/dist/tests/core/utilities/structures/Chance.js +0 -21
- package/dist/tests/core/utilities/structures/Chance.js.map +0 -1
- package/dist/tests/core/utilities/structures/accounts.js +0 -78
- package/dist/tests/core/utilities/structures/accounts.js.map +0 -1
- package/dist/tests/core/utilities/structures/apps.js +0 -24
- package/dist/tests/core/utilities/structures/apps.js.map +0 -1
- package/dist/tests/core/utilities/structures/common.js +0 -11
- package/dist/tests/core/utilities/structures/common.js.map +0 -1
- package/dist/tests/core/utilities/structures/db.js +0 -16
- package/dist/tests/core/utilities/structures/db.js.map +0 -1
- package/dist/tests/core/utilities/structures/documents/index.js +0 -18
- package/dist/tests/core/utilities/structures/documents/index.js.map +0 -1
- package/dist/tests/core/utilities/structures/documents/platform/index.js +0 -28
- package/dist/tests/core/utilities/structures/documents/platform/index.js.map +0 -1
- package/dist/tests/core/utilities/structures/documents/platform/installation.js +0 -38
- package/dist/tests/core/utilities/structures/documents/platform/installation.js.map +0 -1
- package/dist/tests/core/utilities/structures/generator.js +0 -9
- package/dist/tests/core/utilities/structures/generator.js.map +0 -1
- package/dist/tests/core/utilities/structures/index.js +0 -46
- package/dist/tests/core/utilities/structures/index.js.map +0 -1
- package/dist/tests/core/utilities/structures/koa.js +0 -10
- package/dist/tests/core/utilities/structures/koa.js.map +0 -1
- package/dist/tests/core/utilities/structures/licenses.js +0 -140
- package/dist/tests/core/utilities/structures/licenses.js.map +0 -1
- package/dist/tests/core/utilities/structures/plugins.js +0 -23
- package/dist/tests/core/utilities/structures/plugins.js.map +0 -1
- package/dist/tests/core/utilities/structures/quotas.js +0 -71
- package/dist/tests/core/utilities/structures/quotas.js.map +0 -1
- package/dist/tests/core/utilities/structures/scim.js +0 -63
- package/dist/tests/core/utilities/structures/scim.js.map +0 -1
- package/dist/tests/core/utilities/structures/shared.js +0 -14
- package/dist/tests/core/utilities/structures/shared.js.map +0 -1
- package/dist/tests/core/utilities/structures/sso.js +0 -132
- package/dist/tests/core/utilities/structures/sso.js.map +0 -1
- package/dist/tests/core/utilities/structures/tenants.js +0 -9
- package/dist/tests/core/utilities/structures/tenants.js.map +0 -1
- package/dist/tests/core/utilities/structures/userGroups.js +0 -13
- package/dist/tests/core/utilities/structures/userGroups.js.map +0 -1
- package/dist/tests/core/utilities/structures/users.js +0 -48
- package/dist/tests/core/utilities/structures/users.js.map +0 -1
- package/dist/tests/core/utilities/testContainerUtils.js +0 -84
- package/dist/tests/core/utilities/testContainerUtils.js.map +0 -1
- package/dist/tests/core/utilities/utils/index.js +0 -28
- package/dist/tests/core/utilities/utils/index.js.map +0 -1
- package/dist/tests/core/utilities/utils/time.js +0 -8
- package/dist/tests/core/utilities/utils/time.js.map +0 -1
- package/dist/tests/extra/DBTestConfiguration.js +0 -55
- package/dist/tests/extra/DBTestConfiguration.js.map +0 -1
- package/dist/tests/extra/index.js +0 -33
- package/dist/tests/extra/index.js.map +0 -1
- package/dist/tests/extra/testEnv.js +0 -127
- package/dist/tests/extra/testEnv.js.map +0 -1
- package/dist/tests/index.js +0 -18
- package/dist/tests/index.js.map +0 -1
- package/dist/tests/jestEnv.js +0 -8
- package/dist/tests/jestEnv.js.map +0 -1
- package/dist/tests/jestSetup.js +0 -28
- package/dist/tests/jestSetup.js.map +0 -1
- package/plugins.ts +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"listeners.js","sourceRoot":"","sources":["../../../src/queue/listeners.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,2CAAsC;AACtC,oDAAqC;AAIrC,SAAgB,YAAY,CAC1B,KAAY,EACZ,QAAkB,EAClB,eAA2B;IAE3B,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;IACxB,IAAI,eAAe,EAAE;QACnB,aAAa,CAAC,KAAK,EAAE,eAAe,CAAC,CAAA;KACtC;AACH,CAAC;AATD,oCASC;AAED,SAAS,aAAa,CAAC,KAAY,EAAE,eAA2B;IAC9D,KAAK,CAAC,EAAE,CAAC,SAAS,EAAE,CAAO,GAAQ,EAAE,EAAE;QACrC,IAAI,eAAe,EAAE;YACnB,MAAM,eAAe,CAAC,GAAG,CAAC,CAAA;SAC3B;aAAM,IAAI,GAAG,CAAC,IAAI,CAAC,MAAM,EA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AW,EAAE,IAAY,EAAE,EAAE;YACnD,2EAA2E;YAC3E,gDAAgD;YAChD,OAAO,CAAC,IAAI,CACV,GAAG,YAAY,CACb,SAAS,EACT,SAAS,CAAC,OAAO,EACjB,EAAE,EACF,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,CAC9B,CACF,CAAA;QACH,CAAC,CAAC;aACD,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,GAAG,EAAE;YAC1B,6HAA6H;YAC7H,OAAO,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,SAAS,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;QAC7D,CAAC,CAAC;aACD,EAAE,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,GAAQ,EAAE,EAAE;YAClC,8BAA8B;YAC9B,OAAO,CAAC,IAAI,CAAC,GAAG,YAAY,CAAC,SAAS,EAAE,SAAS,CAAC,OAAO,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,CAAA;QACtE,CAAC,CAAC,CAAA;KACL;AACH,CAAC"}
|
package/dist/src/queue/queue.js
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
-
};
|
|
37
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
exports.shutdown = exports.createQueue = void 0;
|
|
39
|
-
const environment_1 = __importDefault(require("../environment"));
|
|
40
|
-
const utils_1 = require("../redis/utils");
|
|
41
|
-
const inMemoryQueue_1 = __importDefault(require("./inMemoryQueue"));
|
|
42
|
-
const bull_1 = __importDefault(require("bull"));
|
|
43
|
-
const listeners_1 = require("./listeners");
|
|
44
|
-
const timers = __importStar(require("../timers"));
|
|
45
|
-
const CLEANUP_PERIOD_MS = 60 * 1000;
|
|
46
|
-
let QUEUES = [];
|
|
47
|
-
let cleanupInterval;
|
|
48
|
-
function cleanup() {
|
|
49
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
-
for (let queue of QUEUES) {
|
|
51
|
-
yield queue.clean(CLEANUP_PERIOD_MS, "completed");
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
function createQueue(jobQueue, opts = {}) {
|
|
56
|
-
const { opts: redisOpts, redisProtocolUrl } = (0, utils_1.getRedisOptions)();
|
|
57
|
-
const queueConfig = redisProtocolUrl || { redis: redisOpts };
|
|
58
|
-
let queue;
|
|
59
|
-
if (!environment_1.default.isTest()) {
|
|
60
|
-
queue = new bull_1.default(jobQueue, queueConfig);
|
|
61
|
-
}
|
|
62
|
-
else {
|
|
63
|
-
queue = new inMemoryQueue_1.default(jobQueue, queueConfig);
|
|
64
|
-
}
|
|
65
|
-
(0, listeners_1.addListeners)(queue, jobQueue, opts === null || opts === void 0 ? void 0 : opts.removeStalledCb);
|
|
66
|
-
QUEUES.push(queue);
|
|
67
|
-
if (!cleanupInterval && !environment_1.default.isTest()) {
|
|
68
|
-
cleanupInterval = timers.set(cleanup, CLEANUP_PERIOD_MS);
|
|
69
|
-
// fire off an initial cleanup
|
|
70
|
-
cleanup().catch(err => {
|
|
71
|
-
console.error(`Unable to cleanup automation queue initially - ${err}`);
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
return queue;
|
|
75
|
-
}
|
|
76
|
-
exports.createQueue = createQueue;
|
|
77
|
-
function shutdown() {
|
|
78
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
79
|
-
if (cleanupInterval) {
|
|
80
|
-
timers.clear(cleanupInterval);
|
|
81
|
-
}
|
|
82
|
-
if (QUEUES.length) {
|
|
83
|
-
for (let queue of QUEUES) {
|
|
84
|
-
yield queue.close();
|
|
85
|
-
}
|
|
86
|
-
QUEUES = [];
|
|
87
|
-
}
|
|
88
|
-
console.log("Queues shutdown");
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
exports.shutdown = shutdown;
|
|
92
|
-
//# source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,EAAE,iBAAiB,CAAC,CAAA;QACxD,8BAA8B;QAC9B,OAAO,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE;YACpB,OAAO,CAAC,KAAK,CAAC,kDAAkD,GAAG,EAAE,CAAC,CAAA;QACxE,CAAC,CAAC,CAAA;KACH;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAtBD,kCAsBC;AAED,SAAsB,QAAQ;;QAC5B,IAAI,eAAe,EAAE;YACnB,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,CAAA;SAC9B;QACD,IAAI,MAAM,CAAC,MAAM,EAAE;YACjB,KAAK,IAAI,KAAK,IAAI,MAAM,EAAE;gBACxB,MAAM,KAAK,CAAC,KAAK,EAAE,CAAA;aACpB;YACD,MAAM,GAAG,EAAE,CAAA;SACZ;QACD,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;IAChC,CAAC;CAAA;AAXD,4BAWC"}
|
package/dist/src/redis/index.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.locks = exports.clients = exports.utils = exports.Client = void 0;
|
|
30
|
-
// Mimic the outer package export for usage in index.ts
|
|
31
|
-
// The outer exports can't be used as they now reference dist directly
|
|
32
|
-
var redis_1 = require("./redis");
|
|
33
|
-
Object.defineProperty(exports, "Client", { enumerable: true, get: function () { return __importDefault(redis_1).default; } });
|
|
34
|
-
exports.utils = __importStar(require("./utils"));
|
|
35
|
-
exports.clients = __importStar(require("./init"));
|
|
36
|
-
exports.locks = __importStar(require("./redlockImpl"));
|
|
37
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/redis/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uDAAuD;AACvD,sEAAsE;AACtE,iCAA2C;AAAlC,gHAAA,OAAO,OAAU;AAC1B,iDAAgC;AAChC,kDAAiC;AACjC,uDAAsC"}
|
package/dist/src/redis/init.js
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
-
};
|
|
37
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
exports.getSocketClient = exports.getLockClient = exports.getWritethroughClient = exports.getCacheClient = exports.getAppClient = exports.getSessionClient = exports.getUserClient = exports.shutdown = void 0;
|
|
39
|
-
const redis_1 = __importDefault(require("./redis"));
|
|
40
|
-
const utils = __importStar(require("./utils"));
|
|
41
|
-
let userClient, sessionClient, appClient, cacheClient, writethroughClient, lockClient, socketClient;
|
|
42
|
-
function init() {
|
|
43
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
-
userClient = yield new redis_1.default(utils.Databases.USER_CACHE).init();
|
|
45
|
-
sessionClient = yield new redis_1.default(utils.Databases.SESSIONS).init();
|
|
46
|
-
appClient = yield new redis_1.default(utils.Databases.APP_METADATA).init();
|
|
47
|
-
cacheClient = yield new redis_1.default(utils.Databases.GENERIC_CACHE).init();
|
|
48
|
-
lockClient = yield new redis_1.default(utils.Databases.LOCKS).init();
|
|
49
|
-
writethroughClient = yield new redis_1.default(utils.Databases.WRITE_THROUGH).init();
|
|
50
|
-
socketClient = yield new redis_1.default(utils.Databases.SOCKET_IO, utils.SelectableDatabase.SOCKET_IO).init();
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
function shutdown() {
|
|
54
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
55
|
-
if (userClient)
|
|
56
|
-
yield userClient.finish();
|
|
57
|
-
if (sessionClient)
|
|
58
|
-
yield sessionClient.finish();
|
|
59
|
-
if (appClient)
|
|
60
|
-
yield appClient.finish();
|
|
61
|
-
if (cacheClient)
|
|
62
|
-
yield cacheClient.finish();
|
|
63
|
-
if (writethroughClient)
|
|
64
|
-
yield writethroughClient.finish();
|
|
65
|
-
if (lockClient)
|
|
66
|
-
yield lockClient.finish();
|
|
67
|
-
if (socketClient)
|
|
68
|
-
yield socketClient.finish();
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
exports.shutdown = shutdown;
|
|
72
|
-
process.on("exit", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
73
|
-
yield shutdown();
|
|
74
|
-
}));
|
|
75
|
-
function getUserClient() {
|
|
76
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
-
if (!userClient) {
|
|
78
|
-
yield init();
|
|
79
|
-
}
|
|
80
|
-
return userClient;
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
exports.getUserClient = getUserClient;
|
|
84
|
-
function getSessionClient() {
|
|
85
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
86
|
-
if (!sessionClient) {
|
|
87
|
-
yield init();
|
|
88
|
-
}
|
|
89
|
-
return sessionClient;
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
exports.getSessionClient = getSessionClient;
|
|
93
|
-
function getAppClient() {
|
|
94
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
95
|
-
if (!appClient) {
|
|
96
|
-
yield init();
|
|
97
|
-
}
|
|
98
|
-
return appClient;
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
exports.getAppClient = getAppClient;
|
|
102
|
-
function getCacheClient() {
|
|
103
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
104
|
-
if (!cacheClient) {
|
|
105
|
-
yield init();
|
|
106
|
-
}
|
|
107
|
-
return cacheClient;
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
exports.getCacheClient = getCacheClient;
|
|
111
|
-
function getWritethroughClient() {
|
|
112
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
113
|
-
if (!writethroughClient) {
|
|
114
|
-
yield init();
|
|
115
|
-
}
|
|
116
|
-
return writethroughClient;
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
exports.getWritethroughClient = getWritethroughClient;
|
|
120
|
-
function getLockClient() {
|
|
121
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
122
|
-
if (!lockClient) {
|
|
123
|
-
yield init();
|
|
124
|
-
}
|
|
125
|
-
return lockClient;
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
exports.getLockClient = getLockClient;
|
|
129
|
-
function getSocketClient() {
|
|
130
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
131
|
-
if (!socketClient) {
|
|
132
|
-
yield init();
|
|
133
|
-
}
|
|
134
|
-
return socketClient;
|
|
135
|
-
});
|
|
136
|
-
}
|
|
137
|
-
exports.getSocketClient = getSocketClient;
|
|
138
|
-
//# sourceMappingURL=init.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/redis/init.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAA4B;AAC5B,+CAAgC;AAEhC,IAAI,UAAkB,EACpB,aAAqB,EACrB,SAAiB,EACjB,WAAmB,EACnB,kBAA0B,EAC1B,UAAkB,EAClB,YAAoB,CAAA;AAEtB,SAAe,IAAI;;QACjB,UAAU,GAAG,MAAM,IAAI,eAAM,CAAC,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,IAAI,EAAE,CAAA;QAChE,aAAa,GAAG,MAAM,IAAI,eAAM,CAAC,KAAK,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAA;QACjE,SAAS,GAAG,MAAM,IAAI,eAAM,CAAC,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,IAAI,EAAE,CAAA;QACjE,WAAW,GAAG,MAAM,IAAI,eAAM,CAAC,KAAK,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,IAAI,EAAE,CAAA;QACpE,UAAU,GAAG,MAAM,IAAI,eAAM,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAA;QAC3D,kBAAkB,GAAG,MAAM,IAAI,eAAM,CAAC,KAAK,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC,IAAI,EAAE,CAAA;QAC3E,YAAY,GAAG,MAAM,IAAI,eAAM,CAC7B,KAAK,CAAC,SAAS,CAAC,SAAS,EACzB,KAAK,CAAC,kBAAkB,CAAC,SAAS,CACnC,CAAC,IAAI,EAAE,CAAA;IACV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EAAE,CAAA;SACb;QACD,OAAO,kBAAkB,CAAA;IAC3B,CAAC;CAAA;AALD,sDAKC;AAED,SAAsB,aAAa;;QACjC,IAAI,CAAC,UAAU,EAAE;YACf,MAAM,IAAI,EAAE,CAAA;SACb;QACD,OAAO,UAAU,CAAA;IACnB,CAAC;CAAA;AALD,sCAKC;AAED,SAAsB,eAAe;;QACnC,IAAI,CAAC,YAAY,EAAE;YACjB,MAAM,IAAI,EAAE,CAAA;SACb;QACD,OAAO,YAAY,CAAA;IACrB,CAAC;CAAA;AALD,0CAKC"}
|
package/dist/src/redis/redis.js
DELETED
|
@@ -1,335 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
35
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
36
|
-
};
|
|
37
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
const environment_1 = __importDefault(require("../environment"));
|
|
39
|
-
const ioredis_1 = __importDefault(require("ioredis"));
|
|
40
|
-
// mock-redis doesn't have any typing
|
|
41
|
-
let MockRedis;
|
|
42
|
-
if (environment_1.default.MOCK_REDIS) {
|
|
43
|
-
try {
|
|
44
|
-
// ioredis mock is all in memory
|
|
45
|
-
MockRedis = require("ioredis-mock");
|
|
46
|
-
}
|
|
47
|
-
catch (err) {
|
|
48
|
-
console.log("Mock redis unavailable");
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
const utils_1 = require("./utils");
|
|
52
|
-
const timers = __importStar(require("../timers"));
|
|
53
|
-
const RETRY_PERIOD_MS = 2000;
|
|
54
|
-
const STARTUP_TIMEOUT_MS = 5000;
|
|
55
|
-
const CLUSTERED = environment_1.default.REDIS_CLUSTERED;
|
|
56
|
-
const DEFAULT_SELECT_DB = utils_1.SelectableDatabase.DEFAULT;
|
|
57
|
-
// for testing just generate the client once
|
|
58
|
-
let CLOSED = false;
|
|
59
|
-
let CLIENTS = {};
|
|
60
|
-
0;
|
|
61
|
-
let CONNECTED = false;
|
|
62
|
-
// mock redis always connected
|
|
63
|
-
if (environment_1.default.MOCK_REDIS) {
|
|
64
|
-
CONNECTED = true;
|
|
65
|
-
}
|
|
66
|
-
function pickClient(selectDb) {
|
|
67
|
-
return CLIENTS[selectDb];
|
|
68
|
-
}
|
|
69
|
-
function connectionError(selectDb, timeout, err) {
|
|
70
|
-
// manually shut down, ignore errors
|
|
71
|
-
if (CLOSED) {
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
pickClient(selectDb).disconnect();
|
|
75
|
-
CLOSED = true;
|
|
76
|
-
// always clear this on error
|
|
77
|
-
clearTimeout(timeout);
|
|
78
|
-
CONNECTED = false;
|
|
79
|
-
console.error("Redis connection failed - " + err);
|
|
80
|
-
setTimeout(() => {
|
|
81
|
-
init();
|
|
82
|
-
}, RETRY_PERIOD_MS);
|
|
83
|
-
}
|
|
84
|
-
/**
|
|
85
|
-
* Inits the system, will error if unable to connect to redis cluster (may take up to 10 seconds) otherwise
|
|
86
|
-
* will return the ioredis client which will be ready to use.
|
|
87
|
-
*/
|
|
88
|
-
function init(selectDb = DEFAULT_SELECT_DB) {
|
|
89
|
-
const RedisCore = environment_1.default.MOCK_REDIS && MockRedis ? MockRedis : ioredis_1.default;
|
|
90
|
-
let timeout;
|
|
91
|
-
CLOSED = false;
|
|
92
|
-
let client = pickClient(selectDb);
|
|
93
|
-
// already connected, ignore
|
|
94
|
-
if (client && CONNECTED) {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
// testing uses a single in memory client
|
|
98
|
-
if (environment_1.default.MOCK_REDIS) {
|
|
99
|
-
CLIENTS[selectDb] = new RedisCore((0, utils_1.getRedisOptions)());
|
|
100
|
-
}
|
|
101
|
-
// start the timer - only allowed 5 seconds to connect
|
|
102
|
-
timeout = setTimeout(() => {
|
|
103
|
-
if (!CONNECTED) {
|
|
104
|
-
connectionError(selectDb, timeout, "Did not successfully connect in timeout");
|
|
105
|
-
}
|
|
106
|
-
}, STARTUP_TIMEOUT_MS);
|
|
107
|
-
// disconnect any lingering client
|
|
108
|
-
if (client) {
|
|
109
|
-
client.disconnect();
|
|
110
|
-
}
|
|
111
|
-
const { redisProtocolUrl, opts, host, port } = (0, utils_1.getRedisOptions)();
|
|
112
|
-
if (CLUSTERED) {
|
|
113
|
-
client = new RedisCore.Cluster([{ host, port }], opts);
|
|
114
|
-
}
|
|
115
|
-
else if (redisProtocolUrl) {
|
|
116
|
-
client = new RedisCore(redisProtocolUrl);
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
client = new RedisCore(opts);
|
|
120
|
-
}
|
|
121
|
-
// attach handlers
|
|
122
|
-
client.on("end", (err) => {
|
|
123
|
-
if (environment_1.default.isTest()) {
|
|
124
|
-
// don't try to re-connect in test env
|
|
125
|
-
// allow the process to exit
|
|
126
|
-
return;
|
|
127
|
-
}
|
|
128
|
-
connectionError(selectDb, timeout, err);
|
|
129
|
-
});
|
|
130
|
-
client.on("error", (err) => {
|
|
131
|
-
connectionError(selectDb, timeout, err);
|
|
132
|
-
});
|
|
133
|
-
client.on("connect", () => {
|
|
134
|
-
clearTimeout(timeout);
|
|
135
|
-
CONNECTED = true;
|
|
136
|
-
});
|
|
137
|
-
CLIENTS[selectDb] = client;
|
|
138
|
-
}
|
|
139
|
-
function waitForConnection(selectDb = DEFAULT_SELECT_DB) {
|
|
140
|
-
return new Promise(resolve => {
|
|
141
|
-
if (pickClient(selectDb) == null) {
|
|
142
|
-
init();
|
|
143
|
-
}
|
|
144
|
-
else if (CONNECTED) {
|
|
145
|
-
resolve("");
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
// check if the connection is ready
|
|
149
|
-
const interval = timers.set(() => {
|
|
150
|
-
if (CONNECTED) {
|
|
151
|
-
timers.clear(interval);
|
|
152
|
-
resolve("");
|
|
153
|
-
}
|
|
154
|
-
}, 500);
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Utility function, takes a redis stream and converts it to a promisified response -
|
|
159
|
-
* this can only be done with redis streams because they will have an end.
|
|
160
|
-
* @param stream A redis stream, specifically as this type of stream will have an end.
|
|
161
|
-
* @param client The client to use for further lookups.
|
|
162
|
-
* @return {Promise<object>} The final output of the stream
|
|
163
|
-
*/
|
|
164
|
-
function promisifyStream(stream, client) {
|
|
165
|
-
return new Promise((resolve, reject) => {
|
|
166
|
-
const outputKeys = new Set();
|
|
167
|
-
stream.on("data", (keys) => {
|
|
168
|
-
keys.forEach(key => {
|
|
169
|
-
outputKeys.add(key);
|
|
170
|
-
});
|
|
171
|
-
});
|
|
172
|
-
stream.on("error", (err) => {
|
|
173
|
-
reject(err);
|
|
174
|
-
});
|
|
175
|
-
stream.on("end", () => __awaiter(this, void 0, void 0, function* () {
|
|
176
|
-
const keysArray = Array.from(outputKeys);
|
|
177
|
-
try {
|
|
178
|
-
let getPromises = [];
|
|
179
|
-
for (let key of keysArray) {
|
|
180
|
-
getPromises.push(client.get(key));
|
|
181
|
-
}
|
|
182
|
-
const jsonArray = yield Promise.all(getPromises);
|
|
183
|
-
resolve(keysArray.map(key => ({
|
|
184
|
-
key: (0, utils_1.removeDbPrefix)(key),
|
|
185
|
-
value: JSON.parse(jsonArray.shift()),
|
|
186
|
-
})));
|
|
187
|
-
}
|
|
188
|
-
catch (err) {
|
|
189
|
-
reject(err);
|
|
190
|
-
}
|
|
191
|
-
}));
|
|
192
|
-
});
|
|
193
|
-
}
|
|
194
|
-
class RedisWrapper {
|
|
195
|
-
constructor(db, selectDb = null) {
|
|
196
|
-
this._db = db;
|
|
197
|
-
this._select = selectDb || DEFAULT_SELECT_DB;
|
|
198
|
-
}
|
|
199
|
-
getClient() {
|
|
200
|
-
return pickClient(this._select);
|
|
201
|
-
}
|
|
202
|
-
init() {
|
|
203
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
204
|
-
CLOSED = false;
|
|
205
|
-
init(this._select);
|
|
206
|
-
yield waitForConnection(this._select);
|
|
207
|
-
if (this._select && !environment_1.default.isTest()) {
|
|
208
|
-
this.getClient().select(this._select);
|
|
209
|
-
}
|
|
210
|
-
return this;
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
finish() {
|
|
214
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
215
|
-
CLOSED = true;
|
|
216
|
-
this.getClient().disconnect();
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
scan(key = "") {
|
|
220
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
221
|
-
const db = this._db;
|
|
222
|
-
key = `${db}${utils_1.SEPARATOR}${key}`;
|
|
223
|
-
let stream;
|
|
224
|
-
if (CLUSTERED) {
|
|
225
|
-
let node = this.getClient().nodes("master");
|
|
226
|
-
stream = node[0].scanStream({ match: key + "*", count: 100 });
|
|
227
|
-
}
|
|
228
|
-
else {
|
|
229
|
-
stream = this.getClient().scanStream({ match: key + "*", count: 100 });
|
|
230
|
-
}
|
|
231
|
-
return promisifyStream(stream, this.getClient());
|
|
232
|
-
});
|
|
233
|
-
}
|
|
234
|
-
keys(pattern) {
|
|
235
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
236
|
-
const db = this._db;
|
|
237
|
-
return this.getClient().keys((0, utils_1.addDbPrefix)(db, pattern));
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
exists(key) {
|
|
241
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
242
|
-
const db = this._db;
|
|
243
|
-
return yield this.getClient().exists((0, utils_1.addDbPrefix)(db, key));
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
get(key) {
|
|
247
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
248
|
-
const db = this._db;
|
|
249
|
-
let response = yield this.getClient().get((0, utils_1.addDbPrefix)(db, key));
|
|
250
|
-
// overwrite the prefixed key
|
|
251
|
-
if (response != null && response.key) {
|
|
252
|
-
response.key = key;
|
|
253
|
-
}
|
|
254
|
-
// if its not an object just return the response
|
|
255
|
-
try {
|
|
256
|
-
return JSON.parse(response);
|
|
257
|
-
}
|
|
258
|
-
catch (err) {
|
|
259
|
-
return response;
|
|
260
|
-
}
|
|
261
|
-
});
|
|
262
|
-
}
|
|
263
|
-
bulkGet(keys) {
|
|
264
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
265
|
-
const db = this._db;
|
|
266
|
-
if (keys.length === 0) {
|
|
267
|
-
return {};
|
|
268
|
-
}
|
|
269
|
-
const prefixedKeys = keys.map(key => (0, utils_1.addDbPrefix)(db, key));
|
|
270
|
-
let response = yield this.getClient().mget(prefixedKeys);
|
|
271
|
-
if (Array.isArray(response)) {
|
|
272
|
-
let final = {};
|
|
273
|
-
let count = 0;
|
|
274
|
-
for (let result of response) {
|
|
275
|
-
if (result) {
|
|
276
|
-
let parsed;
|
|
277
|
-
try {
|
|
278
|
-
parsed = JSON.parse(result);
|
|
279
|
-
}
|
|
280
|
-
catch (err) {
|
|
281
|
-
parsed = result;
|
|
282
|
-
}
|
|
283
|
-
final[keys[count]] = parsed;
|
|
284
|
-
}
|
|
285
|
-
count++;
|
|
286
|
-
}
|
|
287
|
-
return final;
|
|
288
|
-
}
|
|
289
|
-
else {
|
|
290
|
-
throw new Error(`Invalid response: ${response}`);
|
|
291
|
-
}
|
|
292
|
-
});
|
|
293
|
-
}
|
|
294
|
-
store(key, value, expirySeconds = null) {
|
|
295
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
296
|
-
const db = this._db;
|
|
297
|
-
if (typeof value === "object") {
|
|
298
|
-
value = JSON.stringify(value);
|
|
299
|
-
}
|
|
300
|
-
const prefixedKey = (0, utils_1.addDbPrefix)(db, key);
|
|
301
|
-
yield this.getClient().set(prefixedKey, value);
|
|
302
|
-
if (expirySeconds) {
|
|
303
|
-
yield this.getClient().expire(prefixedKey, expirySeconds);
|
|
304
|
-
}
|
|
305
|
-
});
|
|
306
|
-
}
|
|
307
|
-
getTTL(key) {
|
|
308
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
309
|
-
const db = this._db;
|
|
310
|
-
const prefixedKey = (0, utils_1.addDbPrefix)(db, key);
|
|
311
|
-
return this.getClient().ttl(prefixedKey);
|
|
312
|
-
});
|
|
313
|
-
}
|
|
314
|
-
setExpiry(key, expirySeconds) {
|
|
315
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
316
|
-
const db = this._db;
|
|
317
|
-
const prefixedKey = (0, utils_1.addDbPrefix)(db, key);
|
|
318
|
-
yield this.getClient().expire(prefixedKey, expirySeconds);
|
|
319
|
-
});
|
|
320
|
-
}
|
|
321
|
-
delete(key) {
|
|
322
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
323
|
-
const db = this._db;
|
|
324
|
-
yield this.getClient().del((0, utils_1.addDbPrefix)(db, key));
|
|
325
|
-
});
|
|
326
|
-
}
|
|
327
|
-
clear() {
|
|
328
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
329
|
-
let items = yield this.scan();
|
|
330
|
-
yield Promise.all(items.map((obj) => this.delete(obj.key)));
|
|
331
|
-
});
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
exports.default = RedisWrapper;
|
|
335
|
-
//# sourceMappingURL=redis.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"redis.js","sourceRoot":"","sources":["../../../src/redis/redis.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iEAAgC;AAChC,sDAA2B;AAC3B,qCAAqC;AACrC,IAAI,SAA0B,CAAA;AAC9B,IAAI,qBAAG,CAAC,UAAU,EAAE;IAClB,IAAI;QACF,gCAAgC;QAChC,SAAS,GAAG,OAAO,CAAC,cAAc,CAAC,CAAA;KACpC;IAAC,OAAO,GAAG,EAAE;QACZ,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,CAAA;KACtC;CACF;AACD,mCAMgB;AAChB,kDAAmC;AAEnC,MAAM,eAAe,GAAG,IAAI,CAAA;AAC5B,MAAM,kBAAkB,GAAG,IAAI,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