@budibase/backend-core 2.9.39-alpha.0 → 2.9.39-alpha.2
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/package.json +5 -5
- package/dist/src/accounts/accounts.js +100 -0
- package/dist/src/accounts/accounts.js.map +7 -0
- package/dist/src/accounts/api.js +78 -0
- package/dist/src/accounts/api.js.map +7 -0
- package/dist/src/accounts/index.js +23 -0
- package/dist/src/accounts/index.js.map +7 -0
- package/dist/src/auth/auth.js +208 -0
- package/dist/src/auth/auth.js.map +7 -0
- package/dist/src/auth/index.js +23 -0
- package/dist/src/auth/index.js.map +7 -0
- package/dist/src/auth/tests/auth.spec.js +37 -0
- package/dist/src/auth/tests/auth.spec.js.map +7 -0
- package/dist/src/blacklist/blacklist.js +88 -0
- package/dist/src/blacklist/blacklist.js.map +7 -0
- package/dist/src/blacklist/index.js +23 -0
- package/dist/src/blacklist/index.js.map +7 -0
- package/dist/src/blacklist/tests/blacklist.spec.js +61 -0
- package/dist/src/blacklist/tests/blacklist.spec.js.map +7 -0
- package/dist/src/cache/appMetadata.js +86 -0
- package/dist/src/cache/appMetadata.js.map +7 -0
- package/dist/src/cache/base/index.js +102 -0
- package/dist/src/cache/base/index.js.map +7 -0
- package/dist/src/cache/generic.js +69 -0
- package/dist/src/cache/generic.js.map +7 -0
- package/dist/src/cache/index.js +51 -0
- package/dist/src/cache/index.js.map +7 -0
- package/dist/src/cache/tests/writethrough.spec.js +132 -0
- package/dist/src/cache/tests/writethrough.spec.js.map +7 -0
- package/dist/src/cache/user.js +99 -0
- package/dist/src/cache/user.js.map +7 -0
- package/dist/src/cache/writethrough.js +144 -0
- package/dist/src/cache/writethrough.js.map +7 -0
- package/dist/src/configs/configs.js +228 -0
- package/dist/src/configs/configs.js.map +7 -0
- package/dist/src/configs/index.js +23 -0
- package/dist/src/configs/index.js.map +7 -0
- package/dist/src/configs/tests/configs.spec.js +182 -0
- package/dist/src/configs/tests/configs.spec.js.map +7 -0
- package/dist/src/constants/db.js +107 -0
- package/dist/src/constants/db.js.map +7 -0
- package/dist/src/constants/index.js +25 -0
- package/dist/src/constants/index.js.map +7 -0
- package/dist/src/constants/misc.js +92 -0
- package/dist/src/constants/misc.js.map +7 -0
- package/dist/src/context/Context.js +36 -0
- package/dist/src/context/Context.js.map +7 -0
- package/dist/src/context/identity.js +87 -0
- package/dist/src/context/identity.js.map +7 -0
- package/dist/src/context/index.js +45 -0
- package/dist/src/context/index.js.map +7 -0
- package/dist/src/context/mainContext.js +320 -0
- package/dist/src/context/mainContext.js.map +7 -0
- package/dist/src/context/tests/index.spec.js +147 -0
- package/dist/src/context/tests/index.spec.js.map +7 -0
- package/dist/src/context/types.js +17 -0
- package/dist/src/context/types.js.map +7 -0
- package/dist/src/db/Replication.js +89 -0
- package/dist/src/db/Replication.js.map +7 -0
- package/dist/src/db/constants.js +39 -0
- package/dist/src/db/constants.js.map +7 -0
- package/dist/src/db/couch/DatabaseImpl.js +224 -0
- package/dist/src/db/couch/DatabaseImpl.js.map +7 -0
- package/dist/src/db/couch/connections.js +103 -0
- package/dist/src/db/couch/connections.js.map +7 -0
- package/dist/src/db/couch/index.js +44 -0
- package/dist/src/db/couch/index.js.map +7 -0
- package/dist/src/db/couch/pouchDB.js +118 -0
- package/dist/src/db/couch/pouchDB.js.map +7 -0
- package/dist/src/db/couch/pouchDump.js +2 -0
- package/dist/src/db/couch/pouchDump.js.map +7 -0
- package/dist/src/db/couch/utils.js +76 -0
- package/dist/src/db/couch/utils.js.map +7 -0
- package/dist/src/db/db.js +73 -0
- package/dist/src/db/db.js.map +7 -0
- package/dist/src/db/errors.js +43 -0
- package/dist/src/db/errors.js.map +7 -0
- package/dist/src/db/index.js +64 -0
- package/dist/src/db/index.js.map +7 -0
- package/dist/src/db/lucene.js +595 -0
- package/dist/src/db/lucene.js.map +7 -0
- package/dist/src/db/searchIndexes/index.js +23 -0
- package/dist/src/db/searchIndexes/index.js.map +7 -0
- package/dist/src/db/searchIndexes/searchIndexes.js +82 -0
- package/dist/src/db/searchIndexes/searchIndexes.js.map +7 -0
- package/dist/src/db/tests/index.spec.js +24 -0
- package/dist/src/db/tests/index.spec.js.map +7 -0
- package/dist/src/db/tests/lucene.spec.js +312 -0
- package/dist/src/db/tests/lucene.spec.js.map +7 -0
- package/dist/src/db/tests/pouch.spec.js +63 -0
- package/dist/src/db/tests/pouch.spec.js.map +7 -0
- package/dist/src/db/tests/utils.spec.js +50 -0
- package/dist/src/db/tests/utils.spec.js.map +7 -0
- package/dist/src/db/utils.js +198 -0
- package/dist/src/db/utils.js.map +7 -0
- package/dist/src/db/views.js +223 -0
- package/dist/src/db/views.js.map +7 -0
- package/dist/src/docIds/conversions.js +83 -0
- package/dist/src/docIds/conversions.js.map +7 -0
- package/dist/src/docIds/ids.js +101 -0
- package/dist/src/docIds/ids.js.map +7 -0
- package/dist/src/docIds/index.js +25 -0
- package/dist/src/docIds/index.js.map +7 -0
- package/dist/src/docIds/newid.js +32 -0
- package/dist/src/docIds/newid.js.map +7 -0
- package/dist/src/docIds/params.js +136 -0
- package/dist/src/docIds/params.js.map +7 -0
- package/dist/src/docUpdates/index.js +61 -0
- package/dist/src/docUpdates/index.js.map +7 -0
- package/dist/src/environment.js +181 -0
- package/dist/src/environment.js.map +7 -0
- package/dist/src/errors/errors.js +126 -0
- package/dist/src/errors/errors.js.map +7 -0
- package/dist/src/errors/index.js +23 -0
- package/dist/src/errors/index.js.map +7 -0
- package/dist/src/events/analytics.js +42 -0
- package/dist/src/events/analytics.js.map +7 -0
- package/dist/src/events/asyncEvents/index.js +25 -0
- package/dist/src/events/asyncEvents/index.js.map +7 -0
- package/dist/src/events/asyncEvents/publisher.js +39 -0
- package/dist/src/events/asyncEvents/publisher.js.map +7 -0
- package/dist/src/events/asyncEvents/queue.js +42 -0
- package/dist/src/events/asyncEvents/queue.js.map +7 -0
- package/dist/src/events/backfill.js +172 -0
- package/dist/src/events/backfill.js.map +7 -0
- package/dist/src/events/documentId.js +51 -0
- package/dist/src/events/documentId.js.map +7 -0
- package/dist/src/events/events.js +63 -0
- package/dist/src/events/events.js.map +7 -0
- package/dist/src/events/identification.js +275 -0
- package/dist/src/events/identification.js.map +7 -0
- package/dist/src/events/index.js +62 -0
- package/dist/src/events/index.js.map +7 -0
- package/dist/src/events/processors/AnalyticsProcessor.js +76 -0
- package/dist/src/events/processors/AnalyticsProcessor.js.map +7 -0
- package/dist/src/events/processors/AuditLogsProcessor.js +97 -0
- package/dist/src/events/processors/AuditLogsProcessor.js.map +7 -0
- package/dist/src/events/processors/LoggingProcessor.js +58 -0
- package/dist/src/events/processors/LoggingProcessor.js.map +7 -0
- package/dist/src/events/processors/Processors.js +57 -0
- package/dist/src/events/processors/Processors.js.map +7 -0
- package/dist/src/events/processors/async/DocumentUpdateProcessor.js +53 -0
- package/dist/src/events/processors/async/DocumentUpdateProcessor.js.map +7 -0
- package/dist/src/events/processors/index.js +57 -0
- package/dist/src/events/processors/index.js.map +7 -0
- package/dist/src/events/processors/posthog/PosthogProcessor.js +126 -0
- package/dist/src/events/processors/posthog/PosthogProcessor.js.map +7 -0
- package/dist/src/events/processors/posthog/index.js +36 -0
- package/dist/src/events/processors/posthog/index.js.map +7 -0
- package/dist/src/events/processors/posthog/rateLimiting.js +105 -0
- package/dist/src/events/processors/posthog/rateLimiting.js.map +7 -0
- package/dist/src/events/processors/posthog/tests/PosthogProcessor.spec.js +154 -0
- package/dist/src/events/processors/posthog/tests/PosthogProcessor.spec.js.map +7 -0
- package/dist/src/events/processors/types.js +29 -0
- package/dist/src/events/processors/types.js.map +7 -0
- package/dist/src/events/publishers/account.js +49 -0
- package/dist/src/events/publishers/account.js.map +7 -0
- package/dist/src/events/publishers/app.js +145 -0
- package/dist/src/events/publishers/app.js.map +7 -0
- package/dist/src/events/publishers/auditLog.js +42 -0
- package/dist/src/events/publishers/auditLog.js.map +7 -0
- package/dist/src/events/publishers/auth.js +80 -0
- package/dist/src/events/publishers/auth.js.map +7 -0
- package/dist/src/events/publishers/automation.js +111 -0
- package/dist/src/events/publishers/automation.js.map +7 -0
- package/dist/src/events/publishers/backfill.js +92 -0
- package/dist/src/events/publishers/backfill.js.map +7 -0
- package/dist/src/events/publishers/backup.js +49 -0
- package/dist/src/events/publishers/backup.js.map +7 -0
- package/dist/src/events/publishers/datasource.js +59 -0
- package/dist/src/events/publishers/datasource.js.map +7 -0
- package/dist/src/events/publishers/email.js +38 -0
- package/dist/src/events/publishers/email.js.map +7 -0
- package/dist/src/events/publishers/environmentVariable.js +53 -0
- package/dist/src/events/publishers/environmentVariable.js.map +7 -0
- package/dist/src/events/publishers/group.js +105 -0
- package/dist/src/events/publishers/group.js.map +7 -0
- package/dist/src/events/publishers/index.js +108 -0
- package/dist/src/events/publishers/index.js.map +7 -0
- package/dist/src/events/publishers/installation.js +56 -0
- package/dist/src/events/publishers/installation.js.map +7 -0
- package/dist/src/events/publishers/layout.js +42 -0
- package/dist/src/events/publishers/layout.js.map +7 -0
- package/dist/src/events/publishers/license.js +78 -0
- package/dist/src/events/publishers/license.js.map +7 -0
- package/dist/src/events/publishers/org.js +53 -0
- package/dist/src/events/publishers/org.js.map +7 -0
- package/dist/src/events/publishers/plugin.js +61 -0
- package/dist/src/events/publishers/plugin.js.map +7 -0
- package/dist/src/events/publishers/query.js +85 -0
- package/dist/src/events/publishers/query.js.map +7 -0
- package/dist/src/events/publishers/role.js +71 -0
- package/dist/src/events/publishers/role.js.map +7 -0
- package/dist/src/events/publishers/rows.js +43 -0
- package/dist/src/events/publishers/rows.js.map +7 -0
- package/dist/src/events/publishers/screen.js +52 -0
- package/dist/src/events/publishers/screen.js.map +7 -0
- package/dist/src/events/publishers/serve.js +53 -0
- package/dist/src/events/publishers/serve.js.map +7 -0
- package/dist/src/events/publishers/table.js +79 -0
- package/dist/src/events/publishers/table.js.map +7 -0
- package/dist/src/events/publishers/user.js +191 -0
- package/dist/src/events/publishers/user.js.map +7 -0
- package/dist/src/events/publishers/view.js +102 -0
- package/dist/src/events/publishers/view.js.map +7 -0
- package/dist/src/features/index.js +105 -0
- package/dist/src/features/index.js.map +7 -0
- package/dist/src/features/installation.js +42 -0
- package/dist/src/features/installation.js.map +7 -0
- package/dist/src/features/tests/featureFlags.spec.js +86 -0
- package/dist/src/features/tests/featureFlags.spec.js.map +7 -0
- package/dist/src/helpers.js +31 -0
- package/dist/src/helpers.js.map +7 -0
- package/dist/src/index.js +154 -0
- package/dist/src/index.js.map +7 -0
- package/dist/src/installation.js +139 -0
- package/dist/src/installation.js.map +7 -0
- package/dist/src/logging/alerts.js +49 -0
- package/dist/src/logging/alerts.js.map +7 -0
- package/dist/src/logging/correlation/correlation.js +41 -0
- package/dist/src/logging/correlation/correlation.js.map +7 -0
- package/dist/src/logging/correlation/index.js +23 -0
- package/dist/src/logging/correlation/index.js.map +7 -0
- package/dist/src/logging/correlation/middleware.js +37 -0
- package/dist/src/logging/correlation/middleware.js.map +7 -0
- package/dist/src/logging/index.js +48 -0
- package/dist/src/logging/index.js.map +7 -0
- package/dist/src/logging/pino/logger.js +197 -0
- package/dist/src/logging/pino/logger.js.map +7 -0
- package/dist/src/logging/pino/middleware.js +77 -0
- package/dist/src/logging/pino/middleware.js.map +7 -0
- package/dist/src/logging/system.js +110 -0
- package/dist/src/logging/system.js.map +7 -0
- package/dist/src/logging/tests/system.spec.js +59 -0
- package/dist/src/logging/tests/system.spec.js.map +7 -0
- package/dist/src/middleware/adminOnly.js +31 -0
- package/dist/src/middleware/adminOnly.js.map +7 -0
- package/dist/src/middleware/auditLog.js +27 -0
- package/dist/src/middleware/auditLog.js.map +7 -0
- package/dist/src/middleware/authenticated.js +178 -0
- package/dist/src/middleware/authenticated.js.map +7 -0
- package/dist/src/middleware/builderOnly.js +48 -0
- package/dist/src/middleware/builderOnly.js.map +7 -0
- package/dist/src/middleware/builderOrAdmin.js +48 -0
- package/dist/src/middleware/builderOrAdmin.js.map +7 -0
- package/dist/src/middleware/csrf.js +60 -0
- package/dist/src/middleware/csrf.js.map +7 -0
- package/dist/src/middleware/errorHandling.js +62 -0
- package/dist/src/middleware/errorHandling.js.map +7 -0
- package/dist/src/middleware/index.js +95 -0
- package/dist/src/middleware/index.js.map +7 -0
- package/dist/src/middleware/internalApi.js +39 -0
- package/dist/src/middleware/internalApi.js.map +7 -0
- package/dist/src/middleware/joi-validator.js +73 -0
- package/dist/src/middleware/joi-validator.js.map +7 -0
- package/dist/src/middleware/matchers.js +62 -0
- package/dist/src/middleware/matchers.js.map +7 -0
- package/dist/src/middleware/passport/datasource/google.js +103 -0
- package/dist/src/middleware/passport/datasource/google.js.map +7 -0
- package/dist/src/middleware/passport/local.js +73 -0
- package/dist/src/middleware/passport/local.js.map +7 -0
- package/dist/src/middleware/passport/sso/google.js +93 -0
- package/dist/src/middleware/passport/sso/google.js.map +7 -0
- package/dist/src/middleware/passport/sso/oidc.js +135 -0
- package/dist/src/middleware/passport/sso/oidc.js.map +7 -0
- package/dist/src/middleware/passport/sso/sso.js +149 -0
- package/dist/src/middleware/passport/sso/sso.js.map +7 -0
- package/dist/src/middleware/passport/sso/tests/google.spec.js +77 -0
- package/dist/src/middleware/passport/sso/tests/google.spec.js.map +7 -0
- package/dist/src/middleware/passport/sso/tests/oidc.spec.js +143 -0
- package/dist/src/middleware/passport/sso/tests/oidc.spec.js.map +7 -0
- package/dist/src/middleware/passport/sso/tests/sso.spec.js +167 -0
- package/dist/src/middleware/passport/sso/tests/sso.spec.js.map +7 -0
- package/dist/src/middleware/passport/utils.js +62 -0
- package/dist/src/middleware/passport/utils.js.map +7 -0
- package/dist/src/middleware/querystringToBody.js +45 -0
- package/dist/src/middleware/querystringToBody.js.map +7 -0
- package/dist/src/middleware/tenancy.js +46 -0
- package/dist/src/middleware/tenancy.js.map +7 -0
- package/dist/src/middleware/tests/builder.spec.js +169 -0
- package/dist/src/middleware/tests/builder.spec.js.map +7 -0
- package/dist/src/middleware/tests/matchers.spec.js +120 -0
- package/dist/src/middleware/tests/matchers.spec.js.map +7 -0
- package/dist/src/migrations/definitions.js +63 -0
- package/dist/src/migrations/definitions.js.map +7 -0
- package/dist/src/migrations/index.js +25 -0
- package/dist/src/migrations/index.js.map +7 -0
- package/dist/src/migrations/migrations.js +178 -0
- package/dist/src/migrations/migrations.js.map +7 -0
- package/dist/src/migrations/tests/migrations.spec.js +78 -0
- package/dist/src/migrations/tests/migrations.spec.js.map +7 -0
- package/dist/src/objectStore/buckets/app.js +65 -0
- package/dist/src/objectStore/buckets/app.js.map +7 -0
- package/dist/src/objectStore/buckets/global.js +63 -0
- package/dist/src/objectStore/buckets/global.js.map +7 -0
- package/dist/src/objectStore/buckets/index.js +27 -0
- package/dist/src/objectStore/buckets/index.js.map +7 -0
- package/dist/src/objectStore/buckets/plugins.js +101 -0
- package/dist/src/objectStore/buckets/plugins.js.map +7 -0
- package/dist/src/objectStore/buckets/tests/app.spec.js +171 -0
- package/dist/src/objectStore/buckets/tests/app.spec.js.map +7 -0
- package/dist/src/objectStore/buckets/tests/global.spec.js +87 -0
- package/dist/src/objectStore/buckets/tests/global.spec.js.map +7 -0
- package/dist/src/objectStore/buckets/tests/plugins.spec.js +123 -0
- package/dist/src/objectStore/buckets/tests/plugins.spec.js.map +7 -0
- package/dist/src/objectStore/cloudfront.js +74 -0
- package/dist/src/objectStore/cloudfront.js.map +7 -0
- package/dist/src/objectStore/index.js +27 -0
- package/dist/src/objectStore/index.js.map +7 -0
- package/dist/src/objectStore/objectStore.js +372 -0
- package/dist/src/objectStore/objectStore.js.map +7 -0
- package/dist/src/objectStore/utils.js +58 -0
- package/dist/src/objectStore/utils.js.map +7 -0
- package/dist/src/platform/index.js +45 -0
- package/dist/src/platform/index.js.map +7 -0
- package/dist/src/platform/platformDb.js +33 -0
- package/dist/src/platform/platformDb.js.map +7 -0
- package/dist/src/platform/tenants.js +123 -0
- package/dist/src/platform/tenants.js.map +7 -0
- package/dist/src/platform/tests/tenants.spec.js +46 -0
- package/dist/src/platform/tests/tenants.spec.js.map +7 -0
- package/dist/src/platform/users.js +104 -0
- package/dist/src/platform/users.js.map +7 -0
- package/dist/src/plugin/index.js +23 -0
- package/dist/src/plugin/index.js.map +7 -0
- package/dist/src/plugin/tests/validation.spec.js +97 -0
- package/dist/src/plugin/tests/validation.spec.js.map +7 -0
- package/dist/src/plugin/utils.js +153 -0
- package/dist/src/plugin/utils.js.map +7 -0
- package/dist/src/queue/constants.js +35 -0
- package/dist/src/queue/constants.js.map +7 -0
- package/dist/src/queue/inMemoryQueue.js +139 -0
- package/dist/src/queue/inMemoryQueue.js.map +7 -0
- package/dist/src/queue/index.js +25 -0
- package/dist/src/queue/index.js.map +7 -0
- package/dist/src/queue/listeners.js +177 -0
- package/dist/src/queue/listeners.js.map +7 -0
- package/dist/src/queue/queue.js +85 -0
- package/dist/src/queue/queue.js.map +7 -0
- package/dist/src/redis/index.js +48 -0
- package/dist/src/redis/index.js.map +7 -0
- package/dist/src/redis/init.js +128 -0
- package/dist/src/redis/init.js.map +7 -0
- package/dist/src/redis/redis.js +277 -0
- package/dist/src/redis/redis.js.map +7 -0
- package/dist/src/redis/redlockImpl.js +145 -0
- package/dist/src/redis/redlockImpl.js.map +7 -0
- package/dist/src/redis/utils.js +136 -0
- package/dist/src/redis/utils.js.map +7 -0
- package/dist/src/security/encryption.js +184 -0
- package/dist/src/security/encryption.js.map +7 -0
- package/dist/src/security/permissions.js +188 -0
- package/dist/src/security/permissions.js.map +7 -0
- package/dist/src/security/roles.js +337 -0
- package/dist/src/security/roles.js.map +7 -0
- package/dist/src/security/sessions.js +135 -0
- package/dist/src/security/sessions.js.map +7 -0
- package/dist/src/security/tests/encryption.spec.js +51 -0
- package/dist/src/security/tests/encryption.spec.js.map +7 -0
- package/dist/src/security/tests/permissions.spec.js +154 -0
- package/dist/src/security/tests/permissions.spec.js.map +7 -0
- package/dist/src/security/tests/sessions.spec.js +33 -0
- package/dist/src/security/tests/sessions.spec.js.map +7 -0
- package/dist/src/tenancy/db.js +33 -0
- package/dist/src/tenancy/db.js.map +7 -0
- package/dist/src/tenancy/index.js +25 -0
- package/dist/src/tenancy/index.js.map +7 -0
- package/dist/src/tenancy/tenancy.js +129 -0
- package/dist/src/tenancy/tenancy.js.map +7 -0
- package/dist/src/tenancy/tests/tenancy.spec.js +154 -0
- package/dist/src/tenancy/tests/tenancy.spec.js.map +7 -0
- package/dist/src/timers/index.js +23 -0
- package/dist/src/timers/index.js.map +7 -0
- package/dist/src/timers/timers.js +51 -0
- package/dist/src/timers/timers.js.map +7 -0
- package/dist/src/users/db.js +381 -0
- package/dist/src/users/db.js.map +7 -0
- package/dist/src/users/events.js +152 -0
- package/dist/src/users/events.js.map +7 -0
- package/dist/src/users/index.js +36 -0
- package/dist/src/users/index.js.map +7 -0
- package/dist/src/users/lookup.js +110 -0
- package/dist/src/users/lookup.js.map +7 -0
- package/dist/src/users/users.js +257 -0
- package/dist/src/users/users.js.map +7 -0
- package/dist/src/users/utils.js +95 -0
- package/dist/src/users/utils.js.map +7 -0
- package/dist/src/utils/hashing.js +53 -0
- package/dist/src/utils/hashing.js.map +7 -0
- package/dist/src/utils/index.js +27 -0
- package/dist/src/utils/index.js.map +7 -0
- package/dist/src/utils/stringUtils.js +33 -0
- package/dist/src/utils/stringUtils.js.map +7 -0
- package/dist/src/utils/tests/utils.spec.js +165 -0
- package/dist/src/utils/tests/utils.spec.js.map +7 -0
- package/dist/src/utils/utils.js +207 -0
- package/dist/src/utils/utils.js.map +7 -0
- package/dist/tests/core/logging.js +57 -0
- package/dist/tests/core/logging.js.map +7 -0
- package/dist/tests/core/utilities/index.js +54 -0
- package/dist/tests/core/utilities/index.js.map +7 -0
- package/dist/tests/core/utilities/jestUtils.js +50 -0
- package/dist/tests/core/utilities/jestUtils.js.map +7 -0
- package/dist/tests/core/utilities/mocks/alerts.js +41 -0
- package/dist/tests/core/utilities/mocks/alerts.js.map +7 -0
- package/dist/tests/core/utilities/mocks/date.js +32 -0
- package/dist/tests/core/utilities/mocks/date.js.map +7 -0
- package/dist/tests/core/utilities/mocks/events.js +133 -0
- package/dist/tests/core/utilities/mocks/events.js.map +7 -0
- package/dist/tests/core/utilities/mocks/fetch.js +39 -0
- package/dist/tests/core/utilities/mocks/fetch.js.map +7 -0
- package/dist/tests/core/utilities/mocks/index.js +55 -0
- package/dist/tests/core/utilities/mocks/index.js.map +7 -0
- package/dist/tests/core/utilities/mocks/licenses.js +145 -0
- package/dist/tests/core/utilities/mocks/licenses.js.map +7 -0
- package/dist/tests/core/utilities/mocks/posthog.js +9 -0
- package/dist/tests/core/utilities/mocks/posthog.js.map +7 -0
- package/dist/tests/core/utilities/structures/Chance.js +48 -0
- package/dist/tests/core/utilities/structures/Chance.js.map +7 -0
- package/dist/tests/core/utilities/structures/accounts.js +148 -0
- package/dist/tests/core/utilities/structures/accounts.js.map +7 -0
- package/dist/tests/core/utilities/structures/apps.js +47 -0
- package/dist/tests/core/utilities/structures/apps.js.map +7 -0
- package/dist/tests/core/utilities/structures/common.js +35 -0
- package/dist/tests/core/utilities/structures/common.js.map +7 -0
- package/dist/tests/core/utilities/structures/db.js +40 -0
- package/dist/tests/core/utilities/structures/db.js.map +7 -0
- package/dist/tests/core/utilities/structures/documents/index.js +23 -0
- package/dist/tests/core/utilities/structures/documents/index.js.map +7 -0
- package/dist/tests/core/utilities/structures/documents/platform/index.js +39 -0
- package/dist/tests/core/utilities/structures/documents/platform/index.js.map +7 -0
- package/dist/tests/core/utilities/structures/documents/platform/installation.js +48 -0
- package/dist/tests/core/utilities/structures/documents/platform/installation.js.map +7 -0
- package/dist/tests/core/utilities/structures/generator.js +40 -0
- package/dist/tests/core/utilities/structures/generator.js.map +7 -0
- package/dist/tests/core/utilities/structures/index.js +81 -0
- package/dist/tests/core/utilities/structures/index.js.map +7 -0
- package/dist/tests/core/utilities/structures/koa.js +42 -0
- package/dist/tests/core/utilities/structures/koa.js.map +7 -0
- package/dist/tests/core/utilities/structures/licenses.js +175 -0
- package/dist/tests/core/utilities/structures/licenses.js.map +7 -0
- package/dist/tests/core/utilities/structures/plugins.js +46 -0
- package/dist/tests/core/utilities/structures/plugins.js.map +7 -0
- package/dist/tests/core/utilities/structures/quotas.js +94 -0
- package/dist/tests/core/utilities/structures/quotas.js.map +7 -0
- package/dist/tests/core/utilities/structures/scim.js +90 -0
- package/dist/tests/core/utilities/structures/scim.js.map +7 -0
- package/dist/tests/core/utilities/structures/shared.js +46 -0
- package/dist/tests/core/utilities/structures/shared.js.map +7 -0
- package/dist/tests/core/utilities/structures/sso.js +144 -0
- package/dist/tests/core/utilities/structures/sso.js.map +7 -0
- package/dist/tests/core/utilities/structures/tenants.js +32 -0
- package/dist/tests/core/utilities/structures/tenants.js.map +7 -0
- package/dist/tests/core/utilities/structures/userGroups.js +36 -0
- package/dist/tests/core/utilities/structures/userGroups.js.map +7 -0
- package/dist/tests/core/utilities/structures/users.js +96 -0
- package/dist/tests/core/utilities/structures/users.js.map +7 -0
- package/dist/tests/core/utilities/testContainerUtils.js +100 -0
- package/dist/tests/core/utilities/testContainerUtils.js.map +7 -0
- package/dist/tests/core/utilities/utils/index.js +39 -0
- package/dist/tests/core/utilities/utils/index.js.map +7 -0
- package/dist/tests/core/utilities/utils/time.js +31 -0
- package/dist/tests/core/utilities/utils/time.js.map +7 -0
- package/dist/tests/extra/DBTestConfiguration.js +61 -0
- package/dist/tests/extra/DBTestConfiguration.js.map +7 -0
- package/dist/tests/extra/index.js +42 -0
- package/dist/tests/extra/index.js.map +7 -0
- package/dist/tests/extra/testEnv.js +106 -0
- package/dist/tests/extra/testEnv.js.map +7 -0
- package/dist/tests/index.js +23 -0
- package/dist/tests/index.js.map +7 -0
- package/dist/tests/jestEnv.js +8 -0
- package/dist/tests/jestEnv.js.map +7 -0
- package/dist/tests/jestSetup.js +41 -0
- package/dist/tests/jestSetup.js.map +7 -0
- package/package.json +5 -5
- package/dist/tests.js +0 -8467
- package/dist/tests.js.map +0 -7
- package/dist/tests.js.meta.json +0 -1
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var publishers_exports = {};
|
|
30
|
+
__export(publishers_exports, {
|
|
31
|
+
account: () => import_account.default,
|
|
32
|
+
app: () => import_app.default,
|
|
33
|
+
auditLog: () => import_auditLog.default,
|
|
34
|
+
auth: () => import_auth.default,
|
|
35
|
+
automation: () => import_automation.default,
|
|
36
|
+
backfill: () => import_backfill.default,
|
|
37
|
+
backup: () => import_backup.default,
|
|
38
|
+
datasource: () => import_datasource.default,
|
|
39
|
+
email: () => import_email.default,
|
|
40
|
+
environmentVariable: () => import_environmentVariable.default,
|
|
41
|
+
group: () => import_group.default,
|
|
42
|
+
installation: () => import_installation.default,
|
|
43
|
+
layout: () => import_layout.default,
|
|
44
|
+
license: () => import_license.default,
|
|
45
|
+
org: () => import_org.default,
|
|
46
|
+
plugin: () => import_plugin.default,
|
|
47
|
+
query: () => import_query.default,
|
|
48
|
+
role: () => import_role.default,
|
|
49
|
+
rows: () => import_rows.default,
|
|
50
|
+
screen: () => import_screen.default,
|
|
51
|
+
serve: () => import_serve.default,
|
|
52
|
+
table: () => import_table.default,
|
|
53
|
+
user: () => import_user.default,
|
|
54
|
+
view: () => import_view.default
|
|
55
|
+
});
|
|
56
|
+
module.exports = __toCommonJS(publishers_exports);
|
|
57
|
+
var import_account = __toESM(require("./account"));
|
|
58
|
+
var import_app = __toESM(require("./app"));
|
|
59
|
+
var import_auth = __toESM(require("./auth"));
|
|
60
|
+
var import_automation = __toESM(require("./automation"));
|
|
61
|
+
var import_datasource = __toESM(require("./datasource"));
|
|
62
|
+
var import_email = __toESM(require("./email"));
|
|
63
|
+
var import_license = __toESM(require("./license"));
|
|
64
|
+
var import_layout = __toESM(require("./layout"));
|
|
65
|
+
var import_org = __toESM(require("./org"));
|
|
66
|
+
var import_query = __toESM(require("./query"));
|
|
67
|
+
var import_role = __toESM(require("./role"));
|
|
68
|
+
var import_screen = __toESM(require("./screen"));
|
|
69
|
+
var import_rows = __toESM(require("./rows"));
|
|
70
|
+
var import_table = __toESM(require("./table"));
|
|
71
|
+
var import_serve = __toESM(require("./serve"));
|
|
72
|
+
var import_user = __toESM(require("./user"));
|
|
73
|
+
var import_view = __toESM(require("./view"));
|
|
74
|
+
var import_installation = __toESM(require("./installation"));
|
|
75
|
+
var import_backfill = __toESM(require("./backfill"));
|
|
76
|
+
var import_group = __toESM(require("./group"));
|
|
77
|
+
var import_plugin = __toESM(require("./plugin"));
|
|
78
|
+
var import_backup = __toESM(require("./backup"));
|
|
79
|
+
var import_environmentVariable = __toESM(require("./environmentVariable"));
|
|
80
|
+
var import_auditLog = __toESM(require("./auditLog"));
|
|
81
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
82
|
+
0 && (module.exports = {
|
|
83
|
+
account,
|
|
84
|
+
app,
|
|
85
|
+
auditLog,
|
|
86
|
+
auth,
|
|
87
|
+
automation,
|
|
88
|
+
backfill,
|
|
89
|
+
backup,
|
|
90
|
+
datasource,
|
|
91
|
+
email,
|
|
92
|
+
environmentVariable,
|
|
93
|
+
group,
|
|
94
|
+
installation,
|
|
95
|
+
layout,
|
|
96
|
+
license,
|
|
97
|
+
org,
|
|
98
|
+
plugin,
|
|
99
|
+
query,
|
|
100
|
+
role,
|
|
101
|
+
rows,
|
|
102
|
+
screen,
|
|
103
|
+
serve,
|
|
104
|
+
table,
|
|
105
|
+
user,
|
|
106
|
+
view
|
|
107
|
+
});
|
|
108
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/events/publishers/index.ts"],
|
|
4
|
+
"sourcesContent": ["export { default as account } from \"./account\"\nexport { default as app } from \"./app\"\nexport { default as auth } from \"./auth\"\nexport { default as automation } from \"./automation\"\nexport { default as datasource } from \"./datasource\"\nexport { default as email } from \"./email\"\nexport { default as license } from \"./license\"\nexport { default as layout } from \"./layout\"\nexport { default as org } from \"./org\"\nexport { default as query } from \"./query\"\nexport { default as role } from \"./role\"\nexport { default as screen } from \"./screen\"\nexport { default as rows } from \"./rows\"\nexport { default as table } from \"./table\"\nexport { default as serve } from \"./serve\"\nexport { default as user } from \"./user\"\nexport { default as view } from \"./view\"\nexport { default as installation } from \"./installation\"\nexport { default as backfill } from \"./backfill\"\nexport { default as group } from \"./group\"\nexport { default as plugin } from \"./plugin\"\nexport { default as backup } from \"./backup\"\nexport { default as environmentVariable } from \"./environmentVariable\"\nexport { default as auditLog } from \"./auditLog\"\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAmC;AACnC,iBAA+B;AAC/B,kBAAgC;AAChC,wBAAsC;AACtC,wBAAsC;AACtC,mBAAiC;AACjC,qBAAmC;AACnC,oBAAkC;AAClC,iBAA+B;AAC/B,mBAAiC;AACjC,kBAAgC;AAChC,oBAAkC;AAClC,kBAAgC;AAChC,mBAAiC;AACjC,mBAAiC;AACjC,kBAAgC;AAChC,kBAAgC;AAChC,0BAAwC;AACxC,sBAAoC;AACpC,mBAAiC;AACjC,oBAAkC;AAClC,oBAAkC;AAClC,iCAA+C;AAC/C,sBAAoC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var installation_exports = {};
|
|
20
|
+
__export(installation_exports, {
|
|
21
|
+
default: () => installation_default
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(installation_exports);
|
|
24
|
+
var import_events = require("../events");
|
|
25
|
+
var import_types = require("@budibase/types");
|
|
26
|
+
async function versionChecked(version) {
|
|
27
|
+
const properties = {
|
|
28
|
+
currentVersion: version
|
|
29
|
+
};
|
|
30
|
+
await (0, import_events.publishEvent)(import_types.Event.INSTALLATION_VERSION_CHECKED, properties);
|
|
31
|
+
}
|
|
32
|
+
async function upgraded(from, to) {
|
|
33
|
+
const properties = {
|
|
34
|
+
from,
|
|
35
|
+
to
|
|
36
|
+
};
|
|
37
|
+
await (0, import_events.publishEvent)(import_types.Event.INSTALLATION_VERSION_UPGRADED, properties);
|
|
38
|
+
}
|
|
39
|
+
async function downgraded(from, to) {
|
|
40
|
+
const properties = {
|
|
41
|
+
from,
|
|
42
|
+
to
|
|
43
|
+
};
|
|
44
|
+
await (0, import_events.publishEvent)(import_types.Event.INSTALLATION_VERSION_DOWNGRADED, properties);
|
|
45
|
+
}
|
|
46
|
+
async function firstStartup() {
|
|
47
|
+
const properties = {};
|
|
48
|
+
await (0, import_events.publishEvent)(import_types.Event.INSTALLATION_FIRST_STARTUP, properties);
|
|
49
|
+
}
|
|
50
|
+
var installation_default = {
|
|
51
|
+
versionChecked,
|
|
52
|
+
upgraded,
|
|
53
|
+
downgraded,
|
|
54
|
+
firstStartup
|
|
55
|
+
};
|
|
56
|
+
//# sourceMappingURL=installation.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/events/publishers/installation.ts"],
|
|
4
|
+
"sourcesContent": ["import { publishEvent } from \"../events\"\nimport { Event, VersionCheckedEvent, VersionChangeEvent } from \"@budibase/types\"\n\nasync function versionChecked(version: string) {\n const properties: VersionCheckedEvent = {\n currentVersion: version,\n }\n await publishEvent(Event.INSTALLATION_VERSION_CHECKED, properties)\n}\n\nasync function upgraded(from: string, to: string) {\n const properties: VersionChangeEvent = {\n from,\n to,\n }\n\n await publishEvent(Event.INSTALLATION_VERSION_UPGRADED, properties)\n}\n\nasync function downgraded(from: string, to: string) {\n const properties: VersionChangeEvent = {\n from,\n to,\n }\n await publishEvent(Event.INSTALLATION_VERSION_DOWNGRADED, properties)\n}\n\nasync function firstStartup() {\n const properties = {}\n await publishEvent(Event.INSTALLATION_FIRST_STARTUP, properties)\n}\n\nexport default {\n versionChecked,\n upgraded,\n downgraded,\n firstStartup,\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA6B;AAC7B,mBAA+D;AAE/D,eAAe,eAAe,SAAiB;AAC7C,QAAM,aAAkC;AAAA,IACtC,gBAAgB;AAAA,EAClB;AACA,YAAM,4BAAa,mBAAM,8BAA8B,UAAU;AACnE;AAEA,eAAe,SAAS,MAAc,IAAY;AAChD,QAAM,aAAiC;AAAA,IACrC;AAAA,IACA;AAAA,EACF;AAEA,YAAM,4BAAa,mBAAM,+BAA+B,UAAU;AACpE;AAEA,eAAe,WAAW,MAAc,IAAY;AAClD,QAAM,aAAiC;AAAA,IACrC;AAAA,IACA;AAAA,EACF;AACA,YAAM,4BAAa,mBAAM,iCAAiC,UAAU;AACtE;AAEA,eAAe,eAAe;AAC5B,QAAM,aAAa,CAAC;AACpB,YAAM,4BAAa,mBAAM,4BAA4B,UAAU;AACjE;AAEA,IAAO,uBAAQ;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var layout_exports = {};
|
|
20
|
+
__export(layout_exports, {
|
|
21
|
+
default: () => layout_default
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(layout_exports);
|
|
24
|
+
var import_events = require("../events");
|
|
25
|
+
var import_types = require("@budibase/types");
|
|
26
|
+
async function created(layout, timestamp) {
|
|
27
|
+
const properties = {
|
|
28
|
+
layoutId: layout._id
|
|
29
|
+
};
|
|
30
|
+
await (0, import_events.publishEvent)(import_types.Event.LAYOUT_CREATED, properties, timestamp);
|
|
31
|
+
}
|
|
32
|
+
async function deleted(layoutId) {
|
|
33
|
+
const properties = {
|
|
34
|
+
layoutId
|
|
35
|
+
};
|
|
36
|
+
await (0, import_events.publishEvent)(import_types.Event.LAYOUT_DELETED, properties);
|
|
37
|
+
}
|
|
38
|
+
var layout_default = {
|
|
39
|
+
created,
|
|
40
|
+
deleted
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=layout.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/events/publishers/layout.ts"],
|
|
4
|
+
"sourcesContent": ["import { publishEvent } from \"../events\"\nimport {\n Event,\n Layout,\n LayoutCreatedEvent,\n LayoutDeletedEvent,\n} from \"@budibase/types\"\n\nasync function created(layout: Layout, timestamp?: string | number) {\n const properties: LayoutCreatedEvent = {\n layoutId: layout._id as string,\n }\n await publishEvent(Event.LAYOUT_CREATED, properties, timestamp)\n}\n\nasync function deleted(layoutId: string) {\n const properties: LayoutDeletedEvent = {\n layoutId,\n }\n await publishEvent(Event.LAYOUT_DELETED, properties)\n}\n\nexport default {\n created,\n deleted,\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA6B;AAC7B,mBAKO;AAEP,eAAe,QAAQ,QAAgB,WAA6B;AAClE,QAAM,aAAiC;AAAA,IACrC,UAAU,OAAO;AAAA,EACnB;AACA,YAAM,4BAAa,mBAAM,gBAAgB,YAAY,SAAS;AAChE;AAEA,eAAe,QAAQ,UAAkB;AACvC,QAAM,aAAiC;AAAA,IACrC;AAAA,EACF;AACA,YAAM,4BAAa,mBAAM,gBAAgB,UAAU;AACrD;AAEA,IAAO,iBAAQ;AAAA,EACb;AAAA,EACA;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var license_exports = {};
|
|
20
|
+
__export(license_exports, {
|
|
21
|
+
default: () => license_default
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(license_exports);
|
|
24
|
+
var import_events = require("../events");
|
|
25
|
+
var import_types = require("@budibase/types");
|
|
26
|
+
async function planChanged(account, opts) {
|
|
27
|
+
const properties = {
|
|
28
|
+
accountId: account.accountId,
|
|
29
|
+
...opts
|
|
30
|
+
};
|
|
31
|
+
await (0, import_events.publishEvent)(import_types.Event.LICENSE_PLAN_CHANGED, properties);
|
|
32
|
+
}
|
|
33
|
+
async function activated(account) {
|
|
34
|
+
const properties = {
|
|
35
|
+
accountId: account.accountId
|
|
36
|
+
};
|
|
37
|
+
await (0, import_events.publishEvent)(import_types.Event.LICENSE_ACTIVATED, properties);
|
|
38
|
+
}
|
|
39
|
+
async function checkoutOpened(account) {
|
|
40
|
+
const properties = {
|
|
41
|
+
accountId: account.accountId
|
|
42
|
+
};
|
|
43
|
+
await (0, import_events.publishEvent)(import_types.Event.LICENSE_CHECKOUT_OPENED, properties);
|
|
44
|
+
}
|
|
45
|
+
async function checkoutSuccess(account) {
|
|
46
|
+
const properties = {
|
|
47
|
+
accountId: account.accountId
|
|
48
|
+
};
|
|
49
|
+
await (0, import_events.publishEvent)(import_types.Event.LICENSE_CHECKOUT_SUCCESS, properties);
|
|
50
|
+
}
|
|
51
|
+
async function portalOpened(account) {
|
|
52
|
+
const properties = {
|
|
53
|
+
accountId: account.accountId
|
|
54
|
+
};
|
|
55
|
+
await (0, import_events.publishEvent)(import_types.Event.LICENSE_PORTAL_OPENED, properties);
|
|
56
|
+
}
|
|
57
|
+
async function paymentFailed(account) {
|
|
58
|
+
const properties = {
|
|
59
|
+
accountId: account.accountId
|
|
60
|
+
};
|
|
61
|
+
await (0, import_events.publishEvent)(import_types.Event.LICENSE_PAYMENT_FAILED, properties);
|
|
62
|
+
}
|
|
63
|
+
async function paymentRecovered(account) {
|
|
64
|
+
const properties = {
|
|
65
|
+
accountId: account.accountId
|
|
66
|
+
};
|
|
67
|
+
await (0, import_events.publishEvent)(import_types.Event.LICENSE_PAYMENT_RECOVERED, properties);
|
|
68
|
+
}
|
|
69
|
+
var license_default = {
|
|
70
|
+
planChanged,
|
|
71
|
+
activated,
|
|
72
|
+
checkoutOpened,
|
|
73
|
+
checkoutSuccess,
|
|
74
|
+
portalOpened,
|
|
75
|
+
paymentFailed,
|
|
76
|
+
paymentRecovered
|
|
77
|
+
};
|
|
78
|
+
//# sourceMappingURL=license.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/events/publishers/license.ts"],
|
|
4
|
+
"sourcesContent": ["import { publishEvent } from \"../events\"\nimport {\n Event,\n LicenseActivatedEvent,\n LicensePlanChangedEvent,\n PlanType,\n Account,\n LicensePortalOpenedEvent,\n LicenseCheckoutSuccessEvent,\n LicenseCheckoutOpenedEvent,\n LicensePaymentFailedEvent,\n LicensePaymentRecoveredEvent,\n PriceDuration,\n} from \"@budibase/types\"\n\nasync function planChanged(\n account: Account,\n opts: {\n from: PlanType\n to: PlanType\n fromQuantity: number | undefined\n toQuantity: number | undefined\n fromDuration: PriceDuration | undefined\n toDuration: PriceDuration | undefined\n }\n) {\n const properties: LicensePlanChangedEvent = {\n accountId: account.accountId,\n ...opts,\n }\n await publishEvent(Event.LICENSE_PLAN_CHANGED, properties)\n}\n\nasync function activated(account: Account) {\n const properties: LicenseActivatedEvent = {\n accountId: account.accountId,\n }\n await publishEvent(Event.LICENSE_ACTIVATED, properties)\n}\n\nasync function checkoutOpened(account: Account) {\n const properties: LicenseCheckoutOpenedEvent = {\n accountId: account.accountId,\n }\n await publishEvent(Event.LICENSE_CHECKOUT_OPENED, properties)\n}\n\nasync function checkoutSuccess(account: Account) {\n const properties: LicenseCheckoutSuccessEvent = {\n accountId: account.accountId,\n }\n await publishEvent(Event.LICENSE_CHECKOUT_SUCCESS, properties)\n}\n\nasync function portalOpened(account: Account) {\n const properties: LicensePortalOpenedEvent = {\n accountId: account.accountId,\n }\n await publishEvent(Event.LICENSE_PORTAL_OPENED, properties)\n}\n\nasync function paymentFailed(account: Account) {\n const properties: LicensePaymentFailedEvent = {\n accountId: account.accountId,\n }\n await publishEvent(Event.LICENSE_PAYMENT_FAILED, properties)\n}\n\nasync function paymentRecovered(account: Account) {\n const properties: LicensePaymentRecoveredEvent = {\n accountId: account.accountId,\n }\n await publishEvent(Event.LICENSE_PAYMENT_RECOVERED, properties)\n}\n\nexport default {\n planChanged,\n activated,\n checkoutOpened,\n checkoutSuccess,\n portalOpened,\n paymentFailed,\n paymentRecovered,\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA6B;AAC7B,mBAYO;AAEP,eAAe,YACb,SACA,MAQA;AACA,QAAM,aAAsC;AAAA,IAC1C,WAAW,QAAQ;AAAA,IACnB,GAAG;AAAA,EACL;AACA,YAAM,4BAAa,mBAAM,sBAAsB,UAAU;AAC3D;AAEA,eAAe,UAAU,SAAkB;AACzC,QAAM,aAAoC;AAAA,IACxC,WAAW,QAAQ;AAAA,EACrB;AACA,YAAM,4BAAa,mBAAM,mBAAmB,UAAU;AACxD;AAEA,eAAe,eAAe,SAAkB;AAC9C,QAAM,aAAyC;AAAA,IAC7C,WAAW,QAAQ;AAAA,EACrB;AACA,YAAM,4BAAa,mBAAM,yBAAyB,UAAU;AAC9D;AAEA,eAAe,gBAAgB,SAAkB;AAC/C,QAAM,aAA0C;AAAA,IAC9C,WAAW,QAAQ;AAAA,EACrB;AACA,YAAM,4BAAa,mBAAM,0BAA0B,UAAU;AAC/D;AAEA,eAAe,aAAa,SAAkB;AAC5C,QAAM,aAAuC;AAAA,IAC3C,WAAW,QAAQ;AAAA,EACrB;AACA,YAAM,4BAAa,mBAAM,uBAAuB,UAAU;AAC5D;AAEA,eAAe,cAAc,SAAkB;AAC7C,QAAM,aAAwC;AAAA,IAC5C,WAAW,QAAQ;AAAA,EACrB;AACA,YAAM,4BAAa,mBAAM,wBAAwB,UAAU;AAC7D;AAEA,eAAe,iBAAiB,SAAkB;AAChD,QAAM,aAA2C;AAAA,IAC/C,WAAW,QAAQ;AAAA,EACrB;AACA,YAAM,4BAAa,mBAAM,2BAA2B,UAAU;AAChE;AAEA,IAAO,kBAAQ;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var org_exports = {};
|
|
20
|
+
__export(org_exports, {
|
|
21
|
+
default: () => org_default
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(org_exports);
|
|
24
|
+
var import_events = require("../events");
|
|
25
|
+
var import_types = require("@budibase/types");
|
|
26
|
+
async function nameUpdated(timestamp) {
|
|
27
|
+
const properties = {};
|
|
28
|
+
await (0, import_events.publishEvent)(import_types.Event.ORG_NAME_UPDATED, properties, timestamp);
|
|
29
|
+
}
|
|
30
|
+
async function logoUpdated(timestamp) {
|
|
31
|
+
const properties = {};
|
|
32
|
+
await (0, import_events.publishEvent)(import_types.Event.ORG_LOGO_UPDATED, properties, timestamp);
|
|
33
|
+
}
|
|
34
|
+
async function platformURLUpdated(timestamp) {
|
|
35
|
+
const properties = {};
|
|
36
|
+
await (0, import_events.publishEvent)(import_types.Event.ORG_PLATFORM_URL_UPDATED, properties, timestamp);
|
|
37
|
+
}
|
|
38
|
+
async function analyticsOptOut() {
|
|
39
|
+
const properties = {};
|
|
40
|
+
await (0, import_events.publishEvent)(import_types.Event.ANALYTICS_OPT_OUT, properties);
|
|
41
|
+
}
|
|
42
|
+
async function analyticsOptIn() {
|
|
43
|
+
const properties = {};
|
|
44
|
+
await (0, import_events.publishEvent)(import_types.Event.ANALYTICS_OPT_OUT, properties);
|
|
45
|
+
}
|
|
46
|
+
var org_default = {
|
|
47
|
+
nameUpdated,
|
|
48
|
+
logoUpdated,
|
|
49
|
+
platformURLUpdated,
|
|
50
|
+
analyticsOptOut,
|
|
51
|
+
analyticsOptIn
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=org.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/events/publishers/org.ts"],
|
|
4
|
+
"sourcesContent": ["import { publishEvent } from \"../events\"\nimport { Event } from \"@budibase/types\"\n\nasync function nameUpdated(timestamp?: string | number) {\n const properties = {}\n await publishEvent(Event.ORG_NAME_UPDATED, properties, timestamp)\n}\n\nasync function logoUpdated(timestamp?: string | number) {\n const properties = {}\n await publishEvent(Event.ORG_LOGO_UPDATED, properties, timestamp)\n}\n\nasync function platformURLUpdated(timestamp?: string | number) {\n const properties = {}\n await publishEvent(Event.ORG_PLATFORM_URL_UPDATED, properties, timestamp)\n}\n\n// TODO\n\nasync function analyticsOptOut() {\n const properties = {}\n await publishEvent(Event.ANALYTICS_OPT_OUT, properties)\n}\n\nasync function analyticsOptIn() {\n const properties = {}\n await publishEvent(Event.ANALYTICS_OPT_OUT, properties)\n}\n\nexport default {\n nameUpdated,\n logoUpdated,\n platformURLUpdated,\n analyticsOptOut,\n analyticsOptIn,\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA6B;AAC7B,mBAAsB;AAEtB,eAAe,YAAY,WAA6B;AACtD,QAAM,aAAa,CAAC;AACpB,YAAM,4BAAa,mBAAM,kBAAkB,YAAY,SAAS;AAClE;AAEA,eAAe,YAAY,WAA6B;AACtD,QAAM,aAAa,CAAC;AACpB,YAAM,4BAAa,mBAAM,kBAAkB,YAAY,SAAS;AAClE;AAEA,eAAe,mBAAmB,WAA6B;AAC7D,QAAM,aAAa,CAAC;AACpB,YAAM,4BAAa,mBAAM,0BAA0B,YAAY,SAAS;AAC1E;AAIA,eAAe,kBAAkB;AAC/B,QAAM,aAAa,CAAC;AACpB,YAAM,4BAAa,mBAAM,mBAAmB,UAAU;AACxD;AAEA,eAAe,iBAAiB;AAC9B,QAAM,aAAa,CAAC;AACpB,YAAM,4BAAa,mBAAM,mBAAmB,UAAU;AACxD;AAEA,IAAO,cAAQ;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var plugin_exports = {};
|
|
20
|
+
__export(plugin_exports, {
|
|
21
|
+
default: () => plugin_default
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(plugin_exports);
|
|
24
|
+
var import_events = require("../events");
|
|
25
|
+
var import_types = require("@budibase/types");
|
|
26
|
+
async function init(plugin) {
|
|
27
|
+
const properties = {
|
|
28
|
+
type: plugin.schema.type,
|
|
29
|
+
name: plugin.name,
|
|
30
|
+
description: plugin.description,
|
|
31
|
+
version: plugin.version
|
|
32
|
+
};
|
|
33
|
+
await (0, import_events.publishEvent)(import_types.Event.PLUGIN_INIT, properties);
|
|
34
|
+
}
|
|
35
|
+
async function imported(plugin) {
|
|
36
|
+
const properties = {
|
|
37
|
+
pluginId: plugin._id,
|
|
38
|
+
type: plugin.schema.type,
|
|
39
|
+
source: plugin.source,
|
|
40
|
+
name: plugin.name,
|
|
41
|
+
description: plugin.description,
|
|
42
|
+
version: plugin.version
|
|
43
|
+
};
|
|
44
|
+
await (0, import_events.publishEvent)(import_types.Event.PLUGIN_IMPORTED, properties);
|
|
45
|
+
}
|
|
46
|
+
async function deleted(plugin) {
|
|
47
|
+
const properties = {
|
|
48
|
+
pluginId: plugin._id,
|
|
49
|
+
type: plugin.schema.type,
|
|
50
|
+
name: plugin.name,
|
|
51
|
+
description: plugin.description,
|
|
52
|
+
version: plugin.version
|
|
53
|
+
};
|
|
54
|
+
await (0, import_events.publishEvent)(import_types.Event.PLUGIN_DELETED, properties);
|
|
55
|
+
}
|
|
56
|
+
var plugin_default = {
|
|
57
|
+
init,
|
|
58
|
+
imported,
|
|
59
|
+
deleted
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/events/publishers/plugin.ts"],
|
|
4
|
+
"sourcesContent": ["import { publishEvent } from \"../events\"\nimport {\n Event,\n Plugin,\n PluginDeletedEvent,\n PluginImportedEvent,\n PluginInitEvent,\n} from \"@budibase/types\"\n\nasync function init(plugin: Plugin) {\n const properties: PluginInitEvent = {\n type: plugin.schema.type,\n name: plugin.name,\n description: plugin.description,\n version: plugin.version,\n }\n await publishEvent(Event.PLUGIN_INIT, properties)\n}\n\nasync function imported(plugin: Plugin) {\n const properties: PluginImportedEvent = {\n pluginId: plugin._id as string,\n type: plugin.schema.type,\n source: plugin.source,\n name: plugin.name,\n description: plugin.description,\n version: plugin.version,\n }\n await publishEvent(Event.PLUGIN_IMPORTED, properties)\n}\n\nasync function deleted(plugin: Plugin) {\n const properties: PluginDeletedEvent = {\n pluginId: plugin._id as string,\n type: plugin.schema.type,\n name: plugin.name,\n description: plugin.description,\n version: plugin.version,\n }\n await publishEvent(Event.PLUGIN_DELETED, properties)\n}\n\nexport default {\n init,\n imported,\n deleted,\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA6B;AAC7B,mBAMO;AAEP,eAAe,KAAK,QAAgB;AAClC,QAAM,aAA8B;AAAA,IAClC,MAAM,OAAO,OAAO;AAAA,IACpB,MAAM,OAAO;AAAA,IACb,aAAa,OAAO;AAAA,IACpB,SAAS,OAAO;AAAA,EAClB;AACA,YAAM,4BAAa,mBAAM,aAAa,UAAU;AAClD;AAEA,eAAe,SAAS,QAAgB;AACtC,QAAM,aAAkC;AAAA,IACtC,UAAU,OAAO;AAAA,IACjB,MAAM,OAAO,OAAO;AAAA,IACpB,QAAQ,OAAO;AAAA,IACf,MAAM,OAAO;AAAA,IACb,aAAa,OAAO;AAAA,IACpB,SAAS,OAAO;AAAA,EAClB;AACA,YAAM,4BAAa,mBAAM,iBAAiB,UAAU;AACtD;AAEA,eAAe,QAAQ,QAAgB;AACrC,QAAM,aAAiC;AAAA,IACrC,UAAU,OAAO;AAAA,IACjB,MAAM,OAAO,OAAO;AAAA,IACpB,MAAM,OAAO;AAAA,IACb,aAAa,OAAO;AAAA,IACpB,SAAS,OAAO;AAAA,EAClB;AACA,YAAM,4BAAa,mBAAM,gBAAgB,UAAU;AACrD;AAEA,IAAO,iBAAQ;AAAA,EACb;AAAA,EACA;AAAA,EACA;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var query_exports = {};
|
|
20
|
+
__export(query_exports, {
|
|
21
|
+
default: () => query_default
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(query_exports);
|
|
24
|
+
var import_events = require("../events");
|
|
25
|
+
var import_types = require("@budibase/types");
|
|
26
|
+
const created = async (datasource, query, timestamp) => {
|
|
27
|
+
const properties = {
|
|
28
|
+
queryId: query._id,
|
|
29
|
+
datasourceId: datasource._id,
|
|
30
|
+
source: datasource.source,
|
|
31
|
+
queryVerb: query.queryVerb
|
|
32
|
+
};
|
|
33
|
+
await (0, import_events.publishEvent)(import_types.Event.QUERY_CREATED, properties, timestamp);
|
|
34
|
+
};
|
|
35
|
+
const updated = async (datasource, query) => {
|
|
36
|
+
const properties = {
|
|
37
|
+
queryId: query._id,
|
|
38
|
+
datasourceId: datasource._id,
|
|
39
|
+
source: datasource.source,
|
|
40
|
+
queryVerb: query.queryVerb
|
|
41
|
+
};
|
|
42
|
+
await (0, import_events.publishEvent)(import_types.Event.QUERY_UPDATED, properties);
|
|
43
|
+
};
|
|
44
|
+
const deleted = async (datasource, query) => {
|
|
45
|
+
const properties = {
|
|
46
|
+
queryId: query._id,
|
|
47
|
+
datasourceId: datasource._id,
|
|
48
|
+
source: datasource.source,
|
|
49
|
+
queryVerb: query.queryVerb
|
|
50
|
+
};
|
|
51
|
+
await (0, import_events.publishEvent)(import_types.Event.QUERY_DELETED, properties);
|
|
52
|
+
};
|
|
53
|
+
const imported = async (datasource, importSource, count) => {
|
|
54
|
+
const properties = {
|
|
55
|
+
datasourceId: datasource._id,
|
|
56
|
+
source: datasource.source,
|
|
57
|
+
count,
|
|
58
|
+
importSource
|
|
59
|
+
};
|
|
60
|
+
await (0, import_events.publishEvent)(import_types.Event.QUERY_IMPORT, properties);
|
|
61
|
+
};
|
|
62
|
+
const run = async (count, timestamp) => {
|
|
63
|
+
const properties = {
|
|
64
|
+
count
|
|
65
|
+
};
|
|
66
|
+
await (0, import_events.publishEvent)(import_types.Event.QUERIES_RUN, properties, timestamp);
|
|
67
|
+
};
|
|
68
|
+
const previewed = async (datasource, query) => {
|
|
69
|
+
const properties = {
|
|
70
|
+
queryId: query._id,
|
|
71
|
+
datasourceId: datasource._id,
|
|
72
|
+
source: datasource.source,
|
|
73
|
+
queryVerb: query.queryVerb
|
|
74
|
+
};
|
|
75
|
+
await (0, import_events.publishEvent)(import_types.Event.QUERY_PREVIEWED, properties);
|
|
76
|
+
};
|
|
77
|
+
var query_default = {
|
|
78
|
+
created,
|
|
79
|
+
updated,
|
|
80
|
+
deleted,
|
|
81
|
+
imported,
|
|
82
|
+
run,
|
|
83
|
+
previewed
|
|
84
|
+
};
|
|
85
|
+
//# sourceMappingURL=query.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/events/publishers/query.ts"],
|
|
4
|
+
"sourcesContent": ["import { publishEvent } from \"../events\"\nimport {\n Event,\n Datasource,\n Query,\n QueryCreatedEvent,\n QueryUpdatedEvent,\n QueryDeletedEvent,\n QueryImportedEvent,\n QueryPreviewedEvent,\n QueriesRunEvent,\n} from \"@budibase/types\"\n\n/* eslint-disable */\n\nconst created = async (\n datasource: Datasource,\n query: Query,\n timestamp?: string | number\n) => {\n const properties: QueryCreatedEvent = {\n queryId: query._id as string,\n datasourceId: datasource._id as string,\n source: datasource.source,\n queryVerb: query.queryVerb,\n }\n await publishEvent(Event.QUERY_CREATED, properties, timestamp)\n}\n\nconst updated = async (datasource: Datasource, query: Query) => {\n const properties: QueryUpdatedEvent = {\n queryId: query._id as string,\n datasourceId: datasource._id as string,\n source: datasource.source,\n queryVerb: query.queryVerb,\n }\n await publishEvent(Event.QUERY_UPDATED, properties)\n}\n\nconst deleted = async (datasource: Datasource, query: Query) => {\n const properties: QueryDeletedEvent = {\n queryId: query._id as string,\n datasourceId: datasource._id as string,\n source: datasource.source,\n queryVerb: query.queryVerb,\n }\n await publishEvent(Event.QUERY_DELETED, properties)\n}\n\nconst imported = async (\n datasource: Datasource,\n importSource: any,\n count: any\n) => {\n const properties: QueryImportedEvent = {\n datasourceId: datasource._id as string,\n source: datasource.source,\n count,\n importSource,\n }\n await publishEvent(Event.QUERY_IMPORT, properties)\n}\n\nconst run = async (count: number, timestamp?: string | number) => {\n const properties: QueriesRunEvent = {\n count,\n }\n await publishEvent(Event.QUERIES_RUN, properties, timestamp)\n}\n\nconst previewed = async (datasource: Datasource, query: Query) => {\n const properties: QueryPreviewedEvent = {\n queryId: query._id,\n datasourceId: datasource._id as string,\n source: datasource.source,\n queryVerb: query.queryVerb,\n }\n await publishEvent(Event.QUERY_PREVIEWED, properties)\n}\n\nexport default {\n created,\n updated,\n deleted,\n imported,\n run,\n previewed,\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA6B;AAC7B,mBAUO;AAIP,MAAM,UAAU,OACd,YACA,OACA,cACG;AACH,QAAM,aAAgC;AAAA,IACpC,SAAS,MAAM;AAAA,IACf,cAAc,WAAW;AAAA,IACzB,QAAQ,WAAW;AAAA,IACnB,WAAW,MAAM;AAAA,EACnB;AACA,YAAM,4BAAa,mBAAM,eAAe,YAAY,SAAS;AAC/D;AAEA,MAAM,UAAU,OAAO,YAAwB,UAAiB;AAC9D,QAAM,aAAgC;AAAA,IACpC,SAAS,MAAM;AAAA,IACf,cAAc,WAAW;AAAA,IACzB,QAAQ,WAAW;AAAA,IACnB,WAAW,MAAM;AAAA,EACnB;AACA,YAAM,4BAAa,mBAAM,eAAe,UAAU;AACpD;AAEA,MAAM,UAAU,OAAO,YAAwB,UAAiB;AAC9D,QAAM,aAAgC;AAAA,IACpC,SAAS,MAAM;AAAA,IACf,cAAc,WAAW;AAAA,IACzB,QAAQ,WAAW;AAAA,IACnB,WAAW,MAAM;AAAA,EACnB;AACA,YAAM,4BAAa,mBAAM,eAAe,UAAU;AACpD;AAEA,MAAM,WAAW,OACf,YACA,cACA,UACG;AACH,QAAM,aAAiC;AAAA,IACrC,cAAc,WAAW;AAAA,IACzB,QAAQ,WAAW;AAAA,IACnB;AAAA,IACA;AAAA,EACF;AACA,YAAM,4BAAa,mBAAM,cAAc,UAAU;AACnD;AAEA,MAAM,MAAM,OAAO,OAAe,cAAgC;AAChE,QAAM,aAA8B;AAAA,IAClC;AAAA,EACF;AACA,YAAM,4BAAa,mBAAM,aAAa,YAAY,SAAS;AAC7D;AAEA,MAAM,YAAY,OAAO,YAAwB,UAAiB;AAChE,QAAM,aAAkC;AAAA,IACtC,SAAS,MAAM;AAAA,IACf,cAAc,WAAW;AAAA,IACzB,QAAQ,WAAW;AAAA,IACnB,WAAW,MAAM;AAAA,EACnB;AACA,YAAM,4BAAa,mBAAM,iBAAiB,UAAU;AACtD;AAEA,IAAO,gBAAQ;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var role_exports = {};
|
|
20
|
+
__export(role_exports, {
|
|
21
|
+
default: () => role_default
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(role_exports);
|
|
24
|
+
var import_events = require("../events");
|
|
25
|
+
var import_types = require("@budibase/types");
|
|
26
|
+
async function created(role, timestamp) {
|
|
27
|
+
const properties = {
|
|
28
|
+
roleId: role._id,
|
|
29
|
+
permissionId: role.permissionId,
|
|
30
|
+
inherits: role.inherits
|
|
31
|
+
};
|
|
32
|
+
await (0, import_events.publishEvent)(import_types.Event.ROLE_CREATED, properties, timestamp);
|
|
33
|
+
}
|
|
34
|
+
async function updated(role) {
|
|
35
|
+
const properties = {
|
|
36
|
+
roleId: role._id,
|
|
37
|
+
permissionId: role.permissionId,
|
|
38
|
+
inherits: role.inherits
|
|
39
|
+
};
|
|
40
|
+
await (0, import_events.publishEvent)(import_types.Event.ROLE_UPDATED, properties);
|
|
41
|
+
}
|
|
42
|
+
async function deleted(role) {
|
|
43
|
+
const properties = {
|
|
44
|
+
roleId: role._id,
|
|
45
|
+
permissionId: role.permissionId,
|
|
46
|
+
inherits: role.inherits
|
|
47
|
+
};
|
|
48
|
+
await (0, import_events.publishEvent)(import_types.Event.ROLE_DELETED, properties);
|
|
49
|
+
}
|
|
50
|
+
async function assigned(user, roleId, timestamp) {
|
|
51
|
+
const properties = {
|
|
52
|
+
userId: user._id,
|
|
53
|
+
roleId
|
|
54
|
+
};
|
|
55
|
+
await (0, import_events.publishEvent)(import_types.Event.ROLE_ASSIGNED, properties, timestamp);
|
|
56
|
+
}
|
|
57
|
+
async function unassigned(user, roleId) {
|
|
58
|
+
const properties = {
|
|
59
|
+
userId: user._id,
|
|
60
|
+
roleId
|
|
61
|
+
};
|
|
62
|
+
await (0, import_events.publishEvent)(import_types.Event.ROLE_UNASSIGNED, properties);
|
|
63
|
+
}
|
|
64
|
+
var role_default = {
|
|
65
|
+
created,
|
|
66
|
+
updated,
|
|
67
|
+
deleted,
|
|
68
|
+
assigned,
|
|
69
|
+
unassigned
|
|
70
|
+
};
|
|
71
|
+
//# sourceMappingURL=role.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/events/publishers/role.ts"],
|
|
4
|
+
"sourcesContent": ["import { publishEvent } from \"../events\"\nimport {\n Event,\n Role,\n RoleAssignedEvent,\n RoleCreatedEvent,\n RoleDeletedEvent,\n RoleUnassignedEvent,\n RoleUpdatedEvent,\n User,\n} from \"@budibase/types\"\n\nasync function created(role: Role, timestamp?: string | number) {\n const properties: RoleCreatedEvent = {\n roleId: role._id as string,\n permissionId: role.permissionId,\n inherits: role.inherits,\n }\n await publishEvent(Event.ROLE_CREATED, properties, timestamp)\n}\n\nasync function updated(role: Role) {\n const properties: RoleUpdatedEvent = {\n roleId: role._id as string,\n permissionId: role.permissionId,\n inherits: role.inherits,\n }\n await publishEvent(Event.ROLE_UPDATED, properties)\n}\n\nasync function deleted(role: Role) {\n const properties: RoleDeletedEvent = {\n roleId: role._id as string,\n permissionId: role.permissionId,\n inherits: role.inherits,\n }\n await publishEvent(Event.ROLE_DELETED, properties)\n}\n\nasync function assigned(user: User, roleId: string, timestamp?: number) {\n const properties: RoleAssignedEvent = {\n userId: user._id as string,\n roleId,\n }\n await publishEvent(Event.ROLE_ASSIGNED, properties, timestamp)\n}\n\nasync function unassigned(user: User, roleId: string) {\n const properties: RoleUnassignedEvent = {\n userId: user._id as string,\n roleId,\n }\n await publishEvent(Event.ROLE_UNASSIGNED, properties)\n}\n\nexport default {\n created,\n updated,\n deleted,\n assigned,\n unassigned,\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA6B;AAC7B,mBASO;AAEP,eAAe,QAAQ,MAAY,WAA6B;AAC9D,QAAM,aAA+B;AAAA,IACnC,QAAQ,KAAK;AAAA,IACb,cAAc,KAAK;AAAA,IACnB,UAAU,KAAK;AAAA,EACjB;AACA,YAAM,4BAAa,mBAAM,cAAc,YAAY,SAAS;AAC9D;AAEA,eAAe,QAAQ,MAAY;AACjC,QAAM,aAA+B;AAAA,IACnC,QAAQ,KAAK;AAAA,IACb,cAAc,KAAK;AAAA,IACnB,UAAU,KAAK;AAAA,EACjB;AACA,YAAM,4BAAa,mBAAM,cAAc,UAAU;AACnD;AAEA,eAAe,QAAQ,MAAY;AACjC,QAAM,aAA+B;AAAA,IACnC,QAAQ,KAAK;AAAA,IACb,cAAc,KAAK;AAAA,IACnB,UAAU,KAAK;AAAA,EACjB;AACA,YAAM,4BAAa,mBAAM,cAAc,UAAU;AACnD;AAEA,eAAe,SAAS,MAAY,QAAgB,WAAoB;AACtE,QAAM,aAAgC;AAAA,IACpC,QAAQ,KAAK;AAAA,IACb;AAAA,EACF;AACA,YAAM,4BAAa,mBAAM,eAAe,YAAY,SAAS;AAC/D;AAEA,eAAe,WAAW,MAAY,QAAgB;AACpD,QAAM,aAAkC;AAAA,IACtC,QAAQ,KAAK;AAAA,IACb;AAAA,EACF;AACA,YAAM,4BAAa,mBAAM,iBAAiB,UAAU;AACtD;AAEA,IAAO,eAAQ;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|