@budibase/backend-core 2.9.38 → 2.9.39-alpha.1
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 +3027 -3025
- package/dist/index.js.map +4 -4
- package/dist/index.js.meta.json +1 -1
- package/dist/package.json +5 -5
- package/dist/plugins.js +1 -1
- package/dist/plugins.js.map +2 -2
- package/dist/plugins.js.meta.json +1 -1
- 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.d.ts +1 -1
- 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.d.ts +2 -1
- 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.d.ts +1 -1
- 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/{featureFlags → features}/index.d.ts +1 -0
- package/dist/src/features/index.js +105 -0
- package/dist/src/features/index.js.map +7 -0
- package/dist/src/features/installation.d.ts +1 -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.d.ts +2 -1
- 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.d.ts +1 -12
- 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.d.ts +9 -1
- 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.d.ts +2 -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 -8476
- package/dist/tests.js.map +0 -7
- package/dist/tests.js.meta.json +0 -1
|
@@ -0,0 +1,43 @@
|
|
|
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 rows_exports = {};
|
|
20
|
+
__export(rows_exports, {
|
|
21
|
+
default: () => rows_default
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(rows_exports);
|
|
24
|
+
var import_events = require("../events");
|
|
25
|
+
var import_types = require("@budibase/types");
|
|
26
|
+
const created = async (count, timestamp) => {
|
|
27
|
+
const properties = {
|
|
28
|
+
count
|
|
29
|
+
};
|
|
30
|
+
await (0, import_events.publishEvent)(import_types.Event.ROWS_CREATED, properties, timestamp);
|
|
31
|
+
};
|
|
32
|
+
const imported = async (table, count) => {
|
|
33
|
+
const properties = {
|
|
34
|
+
tableId: table._id,
|
|
35
|
+
count
|
|
36
|
+
};
|
|
37
|
+
await (0, import_events.publishEvent)(import_types.Event.ROWS_IMPORTED, properties);
|
|
38
|
+
};
|
|
39
|
+
var rows_default = {
|
|
40
|
+
created,
|
|
41
|
+
imported
|
|
42
|
+
};
|
|
43
|
+
//# sourceMappingURL=rows.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/events/publishers/rows.ts"],
|
|
4
|
+
"sourcesContent": ["import { publishEvent } from \"../events\"\nimport {\n Event,\n RowsImportedEvent,\n RowsCreatedEvent,\n Table,\n} from \"@budibase/types\"\n\n/* eslint-disable */\n\nconst created = async (count: number, timestamp?: string | number) => {\n const properties: RowsCreatedEvent = {\n count,\n }\n await publishEvent(Event.ROWS_CREATED, properties, timestamp)\n}\n\nconst imported = async (table: Table, count: number) => {\n const properties: RowsImportedEvent = {\n tableId: table._id as string,\n count,\n }\n await publishEvent(Event.ROWS_IMPORTED, properties)\n}\n\nexport default {\n created,\n imported,\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA6B;AAC7B,mBAKO;AAIP,MAAM,UAAU,OAAO,OAAe,cAAgC;AACpE,QAAM,aAA+B;AAAA,IACnC;AAAA,EACF;AACA,YAAM,4BAAa,mBAAM,cAAc,YAAY,SAAS;AAC9D;AAEA,MAAM,WAAW,OAAO,OAAc,UAAkB;AACtD,QAAM,aAAgC;AAAA,IACpC,SAAS,MAAM;AAAA,IACf;AAAA,EACF;AACA,YAAM,4BAAa,mBAAM,eAAe,UAAU;AACpD;AAEA,IAAO,eAAQ;AAAA,EACb;AAAA,EACA;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
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 screen_exports = {};
|
|
20
|
+
__export(screen_exports, {
|
|
21
|
+
default: () => screen_default
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(screen_exports);
|
|
24
|
+
var import_events = require("../events");
|
|
25
|
+
var import_types = require("@budibase/types");
|
|
26
|
+
async function created(screen, timestamp) {
|
|
27
|
+
const properties = {
|
|
28
|
+
layoutId: screen.layoutId,
|
|
29
|
+
screenId: screen._id,
|
|
30
|
+
roleId: screen.routing.roleId,
|
|
31
|
+
audited: {
|
|
32
|
+
name: screen.routing?.route
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
await (0, import_events.publishEvent)(import_types.Event.SCREEN_CREATED, properties, timestamp);
|
|
36
|
+
}
|
|
37
|
+
async function deleted(screen) {
|
|
38
|
+
const properties = {
|
|
39
|
+
layoutId: screen.layoutId,
|
|
40
|
+
screenId: screen._id,
|
|
41
|
+
roleId: screen.routing.roleId,
|
|
42
|
+
audited: {
|
|
43
|
+
name: screen.routing?.route
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
await (0, import_events.publishEvent)(import_types.Event.SCREEN_DELETED, properties);
|
|
47
|
+
}
|
|
48
|
+
var screen_default = {
|
|
49
|
+
created,
|
|
50
|
+
deleted
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=screen.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/events/publishers/screen.ts"],
|
|
4
|
+
"sourcesContent": ["import { publishEvent } from \"../events\"\nimport {\n Event,\n Screen,\n ScreenCreatedEvent,\n ScreenDeletedEvent,\n} from \"@budibase/types\"\n\nasync function created(screen: Screen, timestamp?: string | number) {\n const properties: ScreenCreatedEvent = {\n layoutId: screen.layoutId,\n screenId: screen._id as string,\n roleId: screen.routing.roleId,\n audited: {\n name: screen.routing?.route,\n },\n }\n await publishEvent(Event.SCREEN_CREATED, properties, timestamp)\n}\n\nasync function deleted(screen: Screen) {\n const properties: ScreenDeletedEvent = {\n layoutId: screen.layoutId,\n screenId: screen._id as string,\n roleId: screen.routing.roleId,\n audited: {\n name: screen.routing?.route,\n },\n }\n await publishEvent(Event.SCREEN_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,IACjB,UAAU,OAAO;AAAA,IACjB,QAAQ,OAAO,QAAQ;AAAA,IACvB,SAAS;AAAA,MACP,MAAM,OAAO,SAAS;AAAA,IACxB;AAAA,EACF;AACA,YAAM,4BAAa,mBAAM,gBAAgB,YAAY,SAAS;AAChE;AAEA,eAAe,QAAQ,QAAgB;AACrC,QAAM,aAAiC;AAAA,IACrC,UAAU,OAAO;AAAA,IACjB,UAAU,OAAO;AAAA,IACjB,QAAQ,OAAO,QAAQ;AAAA,IACvB,SAAS;AAAA,MACP,MAAM,OAAO,SAAS;AAAA,IACxB;AAAA,EACF;AACA,YAAM,4BAAa,mBAAM,gBAAgB,UAAU;AACrD;AAEA,IAAO,iBAAQ;AAAA,EACb;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 serve_exports = {};
|
|
20
|
+
__export(serve_exports, {
|
|
21
|
+
default: () => serve_default
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(serve_exports);
|
|
24
|
+
var import_events = require("../events");
|
|
25
|
+
var import_types = require("@budibase/types");
|
|
26
|
+
async function servedBuilder(timezone) {
|
|
27
|
+
const properties = {
|
|
28
|
+
timezone
|
|
29
|
+
};
|
|
30
|
+
await (0, import_events.publishEvent)(import_types.Event.SERVED_BUILDER, properties);
|
|
31
|
+
}
|
|
32
|
+
async function servedApp(app, timezone, embed) {
|
|
33
|
+
const properties = {
|
|
34
|
+
appVersion: app.version,
|
|
35
|
+
timezone,
|
|
36
|
+
embed: embed === true
|
|
37
|
+
};
|
|
38
|
+
await (0, import_events.publishEvent)(import_types.Event.SERVED_APP, properties);
|
|
39
|
+
}
|
|
40
|
+
async function servedAppPreview(app, timezone) {
|
|
41
|
+
const properties = {
|
|
42
|
+
appId: app.appId,
|
|
43
|
+
appVersion: app.version,
|
|
44
|
+
timezone
|
|
45
|
+
};
|
|
46
|
+
await (0, import_events.publishEvent)(import_types.Event.SERVED_APP_PREVIEW, properties);
|
|
47
|
+
}
|
|
48
|
+
var serve_default = {
|
|
49
|
+
servedBuilder,
|
|
50
|
+
servedApp,
|
|
51
|
+
servedAppPreview
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=serve.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/events/publishers/serve.ts"],
|
|
4
|
+
"sourcesContent": ["import { publishEvent } from \"../events\"\nimport {\n App,\n BuilderServedEvent,\n Event,\n AppPreviewServedEvent,\n AppServedEvent,\n} from \"@budibase/types\"\n\nasync function servedBuilder(timezone: string) {\n const properties: BuilderServedEvent = {\n timezone,\n }\n await publishEvent(Event.SERVED_BUILDER, properties)\n}\n\nasync function servedApp(\n app: App,\n timezone: string,\n embed?: boolean | undefined\n) {\n const properties: AppServedEvent = {\n appVersion: app.version,\n timezone,\n embed: embed === true,\n }\n await publishEvent(Event.SERVED_APP, properties)\n}\n\nasync function servedAppPreview(app: App, timezone: string) {\n const properties: AppPreviewServedEvent = {\n appId: app.appId,\n appVersion: app.version,\n timezone,\n }\n await publishEvent(Event.SERVED_APP_PREVIEW, properties)\n}\n\nexport default {\n servedBuilder,\n servedApp,\n servedAppPreview,\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA6B;AAC7B,mBAMO;AAEP,eAAe,cAAc,UAAkB;AAC7C,QAAM,aAAiC;AAAA,IACrC;AAAA,EACF;AACA,YAAM,4BAAa,mBAAM,gBAAgB,UAAU;AACrD;AAEA,eAAe,UACb,KACA,UACA,OACA;AACA,QAAM,aAA6B;AAAA,IACjC,YAAY,IAAI;AAAA,IAChB;AAAA,IACA,OAAO,UAAU;AAAA,EACnB;AACA,YAAM,4BAAa,mBAAM,YAAY,UAAU;AACjD;AAEA,eAAe,iBAAiB,KAAU,UAAkB;AAC1D,QAAM,aAAoC;AAAA,IACxC,OAAO,IAAI;AAAA,IACX,YAAY,IAAI;AAAA,IAChB;AAAA,EACF;AACA,YAAM,4BAAa,mBAAM,oBAAoB,UAAU;AACzD;AAEA,IAAO,gBAAQ;AAAA,EACb;AAAA,EACA;AAAA,EACA;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
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 table_exports = {};
|
|
20
|
+
__export(table_exports, {
|
|
21
|
+
default: () => table_default
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(table_exports);
|
|
24
|
+
var import_events = require("../events");
|
|
25
|
+
var import_types = require("@budibase/types");
|
|
26
|
+
async function created(table, timestamp) {
|
|
27
|
+
const properties = {
|
|
28
|
+
tableId: table._id,
|
|
29
|
+
audited: {
|
|
30
|
+
name: table.name
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
await (0, import_events.publishEvent)(import_types.Event.TABLE_CREATED, properties, timestamp);
|
|
34
|
+
}
|
|
35
|
+
async function updated(table) {
|
|
36
|
+
const properties = {
|
|
37
|
+
tableId: table._id,
|
|
38
|
+
audited: {
|
|
39
|
+
name: table.name
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
await (0, import_events.publishEvent)(import_types.Event.TABLE_UPDATED, properties);
|
|
43
|
+
}
|
|
44
|
+
async function deleted(table) {
|
|
45
|
+
const properties = {
|
|
46
|
+
tableId: table._id,
|
|
47
|
+
audited: {
|
|
48
|
+
name: table.name
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
await (0, import_events.publishEvent)(import_types.Event.TABLE_DELETED, properties);
|
|
52
|
+
}
|
|
53
|
+
async function exported(table, format) {
|
|
54
|
+
const properties = {
|
|
55
|
+
tableId: table._id,
|
|
56
|
+
format,
|
|
57
|
+
audited: {
|
|
58
|
+
name: table.name
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
await (0, import_events.publishEvent)(import_types.Event.TABLE_EXPORTED, properties);
|
|
62
|
+
}
|
|
63
|
+
async function imported(table) {
|
|
64
|
+
const properties = {
|
|
65
|
+
tableId: table._id,
|
|
66
|
+
audited: {
|
|
67
|
+
name: table.name
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
await (0, import_events.publishEvent)(import_types.Event.TABLE_IMPORTED, properties);
|
|
71
|
+
}
|
|
72
|
+
var table_default = {
|
|
73
|
+
created,
|
|
74
|
+
updated,
|
|
75
|
+
deleted,
|
|
76
|
+
exported,
|
|
77
|
+
imported
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=table.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/events/publishers/table.ts"],
|
|
4
|
+
"sourcesContent": ["import { publishEvent } from \"../events\"\nimport {\n Event,\n TableExportFormat,\n Table,\n TableCreatedEvent,\n TableUpdatedEvent,\n TableDeletedEvent,\n TableExportedEvent,\n TableImportedEvent,\n} from \"@budibase/types\"\n\nasync function created(table: Table, timestamp?: string | number) {\n const properties: TableCreatedEvent = {\n tableId: table._id as string,\n audited: {\n name: table.name,\n },\n }\n await publishEvent(Event.TABLE_CREATED, properties, timestamp)\n}\n\nasync function updated(table: Table) {\n const properties: TableUpdatedEvent = {\n tableId: table._id as string,\n audited: {\n name: table.name,\n },\n }\n await publishEvent(Event.TABLE_UPDATED, properties)\n}\n\nasync function deleted(table: Table) {\n const properties: TableDeletedEvent = {\n tableId: table._id as string,\n audited: {\n name: table.name,\n },\n }\n await publishEvent(Event.TABLE_DELETED, properties)\n}\n\nasync function exported(table: Table, format: TableExportFormat) {\n const properties: TableExportedEvent = {\n tableId: table._id as string,\n format,\n audited: {\n name: table.name,\n },\n }\n await publishEvent(Event.TABLE_EXPORTED, properties)\n}\n\nasync function imported(table: Table) {\n const properties: TableImportedEvent = {\n tableId: table._id as string,\n audited: {\n name: table.name,\n },\n }\n await publishEvent(Event.TABLE_IMPORTED, properties)\n}\n\nexport default {\n created,\n updated,\n deleted,\n exported,\n imported,\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA6B;AAC7B,mBASO;AAEP,eAAe,QAAQ,OAAc,WAA6B;AAChE,QAAM,aAAgC;AAAA,IACpC,SAAS,MAAM;AAAA,IACf,SAAS;AAAA,MACP,MAAM,MAAM;AAAA,IACd;AAAA,EACF;AACA,YAAM,4BAAa,mBAAM,eAAe,YAAY,SAAS;AAC/D;AAEA,eAAe,QAAQ,OAAc;AACnC,QAAM,aAAgC;AAAA,IACpC,SAAS,MAAM;AAAA,IACf,SAAS;AAAA,MACP,MAAM,MAAM;AAAA,IACd;AAAA,EACF;AACA,YAAM,4BAAa,mBAAM,eAAe,UAAU;AACpD;AAEA,eAAe,QAAQ,OAAc;AACnC,QAAM,aAAgC;AAAA,IACpC,SAAS,MAAM;AAAA,IACf,SAAS;AAAA,MACP,MAAM,MAAM;AAAA,IACd;AAAA,EACF;AACA,YAAM,4BAAa,mBAAM,eAAe,UAAU;AACpD;AAEA,eAAe,SAAS,OAAc,QAA2B;AAC/D,QAAM,aAAiC;AAAA,IACrC,SAAS,MAAM;AAAA,IACf;AAAA,IACA,SAAS;AAAA,MACP,MAAM,MAAM;AAAA,IACd;AAAA,EACF;AACA,YAAM,4BAAa,mBAAM,gBAAgB,UAAU;AACrD;AAEA,eAAe,SAAS,OAAc;AACpC,QAAM,aAAiC;AAAA,IACrC,SAAS,MAAM;AAAA,IACf,SAAS;AAAA,MACP,MAAM,MAAM;AAAA,IACd;AAAA,EACF;AACA,YAAM,4BAAa,mBAAM,gBAAgB,UAAU;AACrD;AAEA,IAAO,gBAAQ;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,191 @@
|
|
|
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 user_exports = {};
|
|
20
|
+
__export(user_exports, {
|
|
21
|
+
default: () => user_default,
|
|
22
|
+
onboardingComplete: () => onboardingComplete
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(user_exports);
|
|
25
|
+
var import_events = require("../events");
|
|
26
|
+
var import_types = require("@budibase/types");
|
|
27
|
+
var import_context = require("../../context");
|
|
28
|
+
async function created(user, timestamp) {
|
|
29
|
+
const properties = {
|
|
30
|
+
userId: user._id,
|
|
31
|
+
viaScim: (0, import_context.isScim)(),
|
|
32
|
+
audited: {
|
|
33
|
+
email: user.email
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
await (0, import_events.publishEvent)(import_types.Event.USER_CREATED, properties, timestamp);
|
|
37
|
+
}
|
|
38
|
+
async function updated(user) {
|
|
39
|
+
const properties = {
|
|
40
|
+
userId: user._id,
|
|
41
|
+
viaScim: (0, import_context.isScim)(),
|
|
42
|
+
audited: {
|
|
43
|
+
email: user.email
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
await (0, import_events.publishEvent)(import_types.Event.USER_UPDATED, properties);
|
|
47
|
+
}
|
|
48
|
+
async function deleted(user) {
|
|
49
|
+
const properties = {
|
|
50
|
+
userId: user._id,
|
|
51
|
+
viaScim: (0, import_context.isScim)(),
|
|
52
|
+
audited: {
|
|
53
|
+
email: user.email
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
await (0, import_events.publishEvent)(import_types.Event.USER_DELETED, properties);
|
|
57
|
+
}
|
|
58
|
+
async function onboardingComplete(user) {
|
|
59
|
+
const properties = {
|
|
60
|
+
userId: user._id,
|
|
61
|
+
audited: {
|
|
62
|
+
email: user.email
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
await (0, import_events.publishEvent)(import_types.Event.USER_ONBOARDING_COMPLETE, properties);
|
|
66
|
+
}
|
|
67
|
+
async function permissionAdminAssigned(user, timestamp) {
|
|
68
|
+
const properties = {
|
|
69
|
+
userId: user._id,
|
|
70
|
+
audited: {
|
|
71
|
+
email: user.email
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
await (0, import_events.publishEvent)(
|
|
75
|
+
import_types.Event.USER_PERMISSION_ADMIN_ASSIGNED,
|
|
76
|
+
properties,
|
|
77
|
+
timestamp
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
async function permissionAdminRemoved(user) {
|
|
81
|
+
const properties = {
|
|
82
|
+
userId: user._id,
|
|
83
|
+
audited: {
|
|
84
|
+
email: user.email
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
await (0, import_events.publishEvent)(import_types.Event.USER_PERMISSION_ADMIN_REMOVED, properties);
|
|
88
|
+
}
|
|
89
|
+
async function permissionBuilderAssigned(user, timestamp) {
|
|
90
|
+
const properties = {
|
|
91
|
+
userId: user._id,
|
|
92
|
+
audited: {
|
|
93
|
+
email: user.email
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
await (0, import_events.publishEvent)(
|
|
97
|
+
import_types.Event.USER_PERMISSION_BUILDER_ASSIGNED,
|
|
98
|
+
properties,
|
|
99
|
+
timestamp
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
async function permissionBuilderRemoved(user) {
|
|
103
|
+
const properties = {
|
|
104
|
+
userId: user._id,
|
|
105
|
+
audited: {
|
|
106
|
+
email: user.email
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
await (0, import_events.publishEvent)(import_types.Event.USER_PERMISSION_BUILDER_REMOVED, properties);
|
|
110
|
+
}
|
|
111
|
+
async function invited(email) {
|
|
112
|
+
const properties = {
|
|
113
|
+
audited: {
|
|
114
|
+
email
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
await (0, import_events.publishEvent)(import_types.Event.USER_INVITED, properties);
|
|
118
|
+
}
|
|
119
|
+
async function inviteAccepted(user) {
|
|
120
|
+
const properties = {
|
|
121
|
+
userId: user._id,
|
|
122
|
+
audited: {
|
|
123
|
+
email: user.email
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
await (0, import_events.publishEvent)(import_types.Event.USER_INVITED_ACCEPTED, properties);
|
|
127
|
+
}
|
|
128
|
+
async function passwordForceReset(user) {
|
|
129
|
+
const properties = {
|
|
130
|
+
userId: user._id,
|
|
131
|
+
audited: {
|
|
132
|
+
email: user.email
|
|
133
|
+
}
|
|
134
|
+
};
|
|
135
|
+
await (0, import_events.publishEvent)(import_types.Event.USER_PASSWORD_FORCE_RESET, properties);
|
|
136
|
+
}
|
|
137
|
+
async function passwordUpdated(user) {
|
|
138
|
+
const properties = {
|
|
139
|
+
userId: user._id,
|
|
140
|
+
audited: {
|
|
141
|
+
email: user.email
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
await (0, import_events.publishEvent)(import_types.Event.USER_PASSWORD_UPDATED, properties);
|
|
145
|
+
}
|
|
146
|
+
async function passwordResetRequested(user) {
|
|
147
|
+
const properties = {
|
|
148
|
+
userId: user._id,
|
|
149
|
+
audited: {
|
|
150
|
+
email: user.email
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
await (0, import_events.publishEvent)(import_types.Event.USER_PASSWORD_RESET_REQUESTED, properties);
|
|
154
|
+
}
|
|
155
|
+
async function passwordReset(user) {
|
|
156
|
+
const properties = {
|
|
157
|
+
userId: user._id,
|
|
158
|
+
audited: {
|
|
159
|
+
email: user.email
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
await (0, import_events.publishEvent)(import_types.Event.USER_PASSWORD_RESET, properties);
|
|
163
|
+
}
|
|
164
|
+
async function dataCollaboration(users) {
|
|
165
|
+
const properties = {
|
|
166
|
+
users
|
|
167
|
+
};
|
|
168
|
+
await (0, import_events.publishEvent)(import_types.Event.USER_DATA_COLLABORATION, properties);
|
|
169
|
+
}
|
|
170
|
+
var user_default = {
|
|
171
|
+
created,
|
|
172
|
+
updated,
|
|
173
|
+
deleted,
|
|
174
|
+
permissionAdminAssigned,
|
|
175
|
+
permissionAdminRemoved,
|
|
176
|
+
permissionBuilderAssigned,
|
|
177
|
+
permissionBuilderRemoved,
|
|
178
|
+
onboardingComplete,
|
|
179
|
+
invited,
|
|
180
|
+
inviteAccepted,
|
|
181
|
+
passwordForceReset,
|
|
182
|
+
passwordUpdated,
|
|
183
|
+
passwordResetRequested,
|
|
184
|
+
passwordReset,
|
|
185
|
+
dataCollaboration
|
|
186
|
+
};
|
|
187
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
188
|
+
0 && (module.exports = {
|
|
189
|
+
onboardingComplete
|
|
190
|
+
});
|
|
191
|
+
//# sourceMappingURL=user.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/events/publishers/user.ts"],
|
|
4
|
+
"sourcesContent": ["import { publishEvent } from \"../events\"\nimport {\n Event,\n User,\n UserCreatedEvent,\n UserDataCollaborationEvent,\n UserDeletedEvent,\n UserInviteAcceptedEvent,\n UserInvitedEvent,\n UserPasswordForceResetEvent,\n UserPasswordResetEvent,\n UserPasswordResetRequestedEvent,\n UserPasswordUpdatedEvent,\n UserPermissionAssignedEvent,\n UserPermissionRemovedEvent,\n UserUpdatedEvent,\n UserOnboardingEvent,\n} from \"@budibase/types\"\nimport { isScim } from \"../../context\"\n\nasync function created(user: User, timestamp?: number) {\n const properties: UserCreatedEvent = {\n userId: user._id as string,\n viaScim: isScim(),\n audited: {\n email: user.email,\n },\n }\n await publishEvent(Event.USER_CREATED, properties, timestamp)\n}\n\nasync function updated(user: User) {\n const properties: UserUpdatedEvent = {\n userId: user._id as string,\n viaScim: isScim(),\n audited: {\n email: user.email,\n },\n }\n await publishEvent(Event.USER_UPDATED, properties)\n}\n\nasync function deleted(user: User) {\n const properties: UserDeletedEvent = {\n userId: user._id as string,\n viaScim: isScim(),\n audited: {\n email: user.email,\n },\n }\n await publishEvent(Event.USER_DELETED, properties)\n}\n\nexport async function onboardingComplete(user: User) {\n const properties: UserOnboardingEvent = {\n userId: user._id as string,\n audited: {\n email: user.email,\n },\n }\n await publishEvent(Event.USER_ONBOARDING_COMPLETE, properties)\n}\n\n// PERMISSIONS\n\nasync function permissionAdminAssigned(user: User, timestamp?: number) {\n const properties: UserPermissionAssignedEvent = {\n userId: user._id as string,\n audited: {\n email: user.email,\n },\n }\n await publishEvent(\n Event.USER_PERMISSION_ADMIN_ASSIGNED,\n properties,\n timestamp\n )\n}\n\nasync function permissionAdminRemoved(user: User) {\n const properties: UserPermissionRemovedEvent = {\n userId: user._id as string,\n audited: {\n email: user.email,\n },\n }\n await publishEvent(Event.USER_PERMISSION_ADMIN_REMOVED, properties)\n}\n\nasync function permissionBuilderAssigned(user: User, timestamp?: number) {\n const properties: UserPermissionAssignedEvent = {\n userId: user._id as string,\n audited: {\n email: user.email,\n },\n }\n await publishEvent(\n Event.USER_PERMISSION_BUILDER_ASSIGNED,\n properties,\n timestamp\n )\n}\n\nasync function permissionBuilderRemoved(user: User) {\n const properties: UserPermissionRemovedEvent = {\n userId: user._id as string,\n audited: {\n email: user.email,\n },\n }\n await publishEvent(Event.USER_PERMISSION_BUILDER_REMOVED, properties)\n}\n\n// INVITE\n\nasync function invited(email: string) {\n const properties: UserInvitedEvent = {\n audited: {\n email,\n },\n }\n await publishEvent(Event.USER_INVITED, properties)\n}\n\nasync function inviteAccepted(user: User) {\n const properties: UserInviteAcceptedEvent = {\n userId: user._id as string,\n audited: {\n email: user.email,\n },\n }\n await publishEvent(Event.USER_INVITED_ACCEPTED, properties)\n}\n\n// PASSWORD\n\nasync function passwordForceReset(user: User) {\n const properties: UserPasswordForceResetEvent = {\n userId: user._id as string,\n audited: {\n email: user.email,\n },\n }\n await publishEvent(Event.USER_PASSWORD_FORCE_RESET, properties)\n}\n\nasync function passwordUpdated(user: User) {\n const properties: UserPasswordUpdatedEvent = {\n userId: user._id as string,\n audited: {\n email: user.email,\n },\n }\n await publishEvent(Event.USER_PASSWORD_UPDATED, properties)\n}\n\nasync function passwordResetRequested(user: User) {\n const properties: UserPasswordResetRequestedEvent = {\n userId: user._id as string,\n audited: {\n email: user.email,\n },\n }\n await publishEvent(Event.USER_PASSWORD_RESET_REQUESTED, properties)\n}\n\nasync function passwordReset(user: User) {\n const properties: UserPasswordResetEvent = {\n userId: user._id as string,\n audited: {\n email: user.email,\n },\n }\n await publishEvent(Event.USER_PASSWORD_RESET, properties)\n}\n\n// COLLABORATION\n\nasync function dataCollaboration(users: number) {\n const properties: UserDataCollaborationEvent = {\n users,\n }\n await publishEvent(Event.USER_DATA_COLLABORATION, properties)\n}\n\nexport default {\n created,\n updated,\n deleted,\n permissionAdminAssigned,\n permissionAdminRemoved,\n permissionBuilderAssigned,\n permissionBuilderRemoved,\n onboardingComplete,\n invited,\n inviteAccepted,\n passwordForceReset,\n passwordUpdated,\n passwordResetRequested,\n passwordReset,\n dataCollaboration,\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA6B;AAC7B,mBAgBO;AACP,qBAAuB;AAEvB,eAAe,QAAQ,MAAY,WAAoB;AACrD,QAAM,aAA+B;AAAA,IACnC,QAAQ,KAAK;AAAA,IACb,aAAS,uBAAO;AAAA,IAChB,SAAS;AAAA,MACP,OAAO,KAAK;AAAA,IACd;AAAA,EACF;AACA,YAAM,4BAAa,mBAAM,cAAc,YAAY,SAAS;AAC9D;AAEA,eAAe,QAAQ,MAAY;AACjC,QAAM,aAA+B;AAAA,IACnC,QAAQ,KAAK;AAAA,IACb,aAAS,uBAAO;AAAA,IAChB,SAAS;AAAA,MACP,OAAO,KAAK;AAAA,IACd;AAAA,EACF;AACA,YAAM,4BAAa,mBAAM,cAAc,UAAU;AACnD;AAEA,eAAe,QAAQ,MAAY;AACjC,QAAM,aAA+B;AAAA,IACnC,QAAQ,KAAK;AAAA,IACb,aAAS,uBAAO;AAAA,IAChB,SAAS;AAAA,MACP,OAAO,KAAK;AAAA,IACd;AAAA,EACF;AACA,YAAM,4BAAa,mBAAM,cAAc,UAAU;AACnD;AAEA,eAAsB,mBAAmB,MAAY;AACnD,QAAM,aAAkC;AAAA,IACtC,QAAQ,KAAK;AAAA,IACb,SAAS;AAAA,MACP,OAAO,KAAK;AAAA,IACd;AAAA,EACF;AACA,YAAM,4BAAa,mBAAM,0BAA0B,UAAU;AAC/D;AAIA,eAAe,wBAAwB,MAAY,WAAoB;AACrE,QAAM,aAA0C;AAAA,IAC9C,QAAQ,KAAK;AAAA,IACb,SAAS;AAAA,MACP,OAAO,KAAK;AAAA,IACd;AAAA,EACF;AACA,YAAM;AAAA,IACJ,mBAAM;AAAA,IACN;AAAA,IACA;AAAA,EACF;AACF;AAEA,eAAe,uBAAuB,MAAY;AAChD,QAAM,aAAyC;AAAA,IAC7C,QAAQ,KAAK;AAAA,IACb,SAAS;AAAA,MACP,OAAO,KAAK;AAAA,IACd;AAAA,EACF;AACA,YAAM,4BAAa,mBAAM,+BAA+B,UAAU;AACpE;AAEA,eAAe,0BAA0B,MAAY,WAAoB;AACvE,QAAM,aAA0C;AAAA,IAC9C,QAAQ,KAAK;AAAA,IACb,SAAS;AAAA,MACP,OAAO,KAAK;AAAA,IACd;AAAA,EACF;AACA,YAAM;AAAA,IACJ,mBAAM;AAAA,IACN;AAAA,IACA;AAAA,EACF;AACF;AAEA,eAAe,yBAAyB,MAAY;AAClD,QAAM,aAAyC;AAAA,IAC7C,QAAQ,KAAK;AAAA,IACb,SAAS;AAAA,MACP,OAAO,KAAK;AAAA,IACd;AAAA,EACF;AACA,YAAM,4BAAa,mBAAM,iCAAiC,UAAU;AACtE;AAIA,eAAe,QAAQ,OAAe;AACpC,QAAM,aAA+B;AAAA,IACnC,SAAS;AAAA,MACP;AAAA,IACF;AAAA,EACF;AACA,YAAM,4BAAa,mBAAM,cAAc,UAAU;AACnD;AAEA,eAAe,eAAe,MAAY;AACxC,QAAM,aAAsC;AAAA,IAC1C,QAAQ,KAAK;AAAA,IACb,SAAS;AAAA,MACP,OAAO,KAAK;AAAA,IACd;AAAA,EACF;AACA,YAAM,4BAAa,mBAAM,uBAAuB,UAAU;AAC5D;AAIA,eAAe,mBAAmB,MAAY;AAC5C,QAAM,aAA0C;AAAA,IAC9C,QAAQ,KAAK;AAAA,IACb,SAAS;AAAA,MACP,OAAO,KAAK;AAAA,IACd;AAAA,EACF;AACA,YAAM,4BAAa,mBAAM,2BAA2B,UAAU;AAChE;AAEA,eAAe,gBAAgB,MAAY;AACzC,QAAM,aAAuC;AAAA,IAC3C,QAAQ,KAAK;AAAA,IACb,SAAS;AAAA,MACP,OAAO,KAAK;AAAA,IACd;AAAA,EACF;AACA,YAAM,4BAAa,mBAAM,uBAAuB,UAAU;AAC5D;AAEA,eAAe,uBAAuB,MAAY;AAChD,QAAM,aAA8C;AAAA,IAClD,QAAQ,KAAK;AAAA,IACb,SAAS;AAAA,MACP,OAAO,KAAK;AAAA,IACd;AAAA,EACF;AACA,YAAM,4BAAa,mBAAM,+BAA+B,UAAU;AACpE;AAEA,eAAe,cAAc,MAAY;AACvC,QAAM,aAAqC;AAAA,IACzC,QAAQ,KAAK;AAAA,IACb,SAAS;AAAA,MACP,OAAO,KAAK;AAAA,IACd;AAAA,EACF;AACA,YAAM,4BAAa,mBAAM,qBAAqB,UAAU;AAC1D;AAIA,eAAe,kBAAkB,OAAe;AAC9C,QAAM,aAAyC;AAAA,IAC7C;AAAA,EACF;AACA,YAAM,4BAAa,mBAAM,yBAAyB,UAAU;AAC9D;AAEA,IAAO,eAAQ;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
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 view_exports = {};
|
|
20
|
+
__export(view_exports, {
|
|
21
|
+
default: () => view_default
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(view_exports);
|
|
24
|
+
var import_events = require("../events");
|
|
25
|
+
var import_types = require("@budibase/types");
|
|
26
|
+
async function created(view, timestamp) {
|
|
27
|
+
const properties = {
|
|
28
|
+
tableId: view.tableId
|
|
29
|
+
};
|
|
30
|
+
await (0, import_events.publishEvent)(import_types.Event.VIEW_CREATED, properties, timestamp);
|
|
31
|
+
}
|
|
32
|
+
async function updated(view) {
|
|
33
|
+
const properties = {
|
|
34
|
+
tableId: view.tableId
|
|
35
|
+
};
|
|
36
|
+
await (0, import_events.publishEvent)(import_types.Event.VIEW_UPDATED, properties);
|
|
37
|
+
}
|
|
38
|
+
async function deleted(view) {
|
|
39
|
+
const properties = {
|
|
40
|
+
tableId: view.tableId
|
|
41
|
+
};
|
|
42
|
+
await (0, import_events.publishEvent)(import_types.Event.VIEW_DELETED, properties);
|
|
43
|
+
}
|
|
44
|
+
async function exported(table, format) {
|
|
45
|
+
const properties = {
|
|
46
|
+
tableId: table._id,
|
|
47
|
+
format
|
|
48
|
+
};
|
|
49
|
+
await (0, import_events.publishEvent)(import_types.Event.VIEW_EXPORTED, properties);
|
|
50
|
+
}
|
|
51
|
+
async function filterCreated(view, timestamp) {
|
|
52
|
+
const properties = {
|
|
53
|
+
tableId: view.tableId
|
|
54
|
+
};
|
|
55
|
+
await (0, import_events.publishEvent)(import_types.Event.VIEW_FILTER_CREATED, properties, timestamp);
|
|
56
|
+
}
|
|
57
|
+
async function filterUpdated(view) {
|
|
58
|
+
const properties = {
|
|
59
|
+
tableId: view.tableId
|
|
60
|
+
};
|
|
61
|
+
await (0, import_events.publishEvent)(import_types.Event.VIEW_FILTER_UPDATED, properties);
|
|
62
|
+
}
|
|
63
|
+
async function filterDeleted(view) {
|
|
64
|
+
const properties = {
|
|
65
|
+
tableId: view.tableId
|
|
66
|
+
};
|
|
67
|
+
await (0, import_events.publishEvent)(import_types.Event.VIEW_FILTER_DELETED, properties);
|
|
68
|
+
}
|
|
69
|
+
async function calculationCreated(view, timestamp) {
|
|
70
|
+
const properties = {
|
|
71
|
+
tableId: view.tableId,
|
|
72
|
+
calculation: view.calculation
|
|
73
|
+
};
|
|
74
|
+
await (0, import_events.publishEvent)(import_types.Event.VIEW_CALCULATION_CREATED, properties, timestamp);
|
|
75
|
+
}
|
|
76
|
+
async function calculationUpdated(view) {
|
|
77
|
+
const properties = {
|
|
78
|
+
tableId: view.tableId,
|
|
79
|
+
calculation: view.calculation
|
|
80
|
+
};
|
|
81
|
+
await (0, import_events.publishEvent)(import_types.Event.VIEW_CALCULATION_UPDATED, properties);
|
|
82
|
+
}
|
|
83
|
+
async function calculationDeleted(existingView) {
|
|
84
|
+
const properties = {
|
|
85
|
+
tableId: existingView.tableId,
|
|
86
|
+
calculation: existingView.calculation
|
|
87
|
+
};
|
|
88
|
+
await (0, import_events.publishEvent)(import_types.Event.VIEW_CALCULATION_DELETED, properties);
|
|
89
|
+
}
|
|
90
|
+
var view_default = {
|
|
91
|
+
created,
|
|
92
|
+
updated,
|
|
93
|
+
deleted,
|
|
94
|
+
exported,
|
|
95
|
+
filterCreated,
|
|
96
|
+
filterUpdated,
|
|
97
|
+
filterDeleted,
|
|
98
|
+
calculationCreated,
|
|
99
|
+
calculationUpdated,
|
|
100
|
+
calculationDeleted
|
|
101
|
+
};
|
|
102
|
+
//# sourceMappingURL=view.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/events/publishers/view.ts"],
|
|
4
|
+
"sourcesContent": ["import { publishEvent } from \"../events\"\nimport {\n Event,\n ViewCalculationCreatedEvent,\n ViewCalculationDeletedEvent,\n ViewCalculationUpdatedEvent,\n ViewCreatedEvent,\n ViewDeletedEvent,\n ViewExportedEvent,\n ViewFilterCreatedEvent,\n ViewFilterDeletedEvent,\n ViewFilterUpdatedEvent,\n ViewUpdatedEvent,\n View,\n ViewCalculation,\n Table,\n TableExportFormat,\n} from \"@budibase/types\"\n\n/* eslint-disable */\n\nasync function created(view: View, timestamp?: string | number) {\n const properties: ViewCreatedEvent = {\n tableId: view.tableId,\n }\n await publishEvent(Event.VIEW_CREATED, properties, timestamp)\n}\n\nasync function updated(view: View) {\n const properties: ViewUpdatedEvent = {\n tableId: view.tableId,\n }\n await publishEvent(Event.VIEW_UPDATED, properties)\n}\n\nasync function deleted(view: View) {\n const properties: ViewDeletedEvent = {\n tableId: view.tableId,\n }\n await publishEvent(Event.VIEW_DELETED, properties)\n}\n\nasync function exported(table: Table, format: TableExportFormat) {\n const properties: ViewExportedEvent = {\n tableId: table._id as string,\n format,\n }\n await publishEvent(Event.VIEW_EXPORTED, properties)\n}\n\nasync function filterCreated(view: View, timestamp?: string | number) {\n const properties: ViewFilterCreatedEvent = {\n tableId: view.tableId,\n }\n await publishEvent(Event.VIEW_FILTER_CREATED, properties, timestamp)\n}\n\nasync function filterUpdated(view: View) {\n const properties: ViewFilterUpdatedEvent = {\n tableId: view.tableId,\n }\n await publishEvent(Event.VIEW_FILTER_UPDATED, properties)\n}\n\nasync function filterDeleted(view: View) {\n const properties: ViewFilterDeletedEvent = {\n tableId: view.tableId,\n }\n await publishEvent(Event.VIEW_FILTER_DELETED, properties)\n}\n\nasync function calculationCreated(view: View, timestamp?: string | number) {\n const properties: ViewCalculationCreatedEvent = {\n tableId: view.tableId,\n calculation: view.calculation as ViewCalculation,\n }\n await publishEvent(Event.VIEW_CALCULATION_CREATED, properties, timestamp)\n}\n\nasync function calculationUpdated(view: View) {\n const properties: ViewCalculationUpdatedEvent = {\n tableId: view.tableId,\n calculation: view.calculation as ViewCalculation,\n }\n await publishEvent(Event.VIEW_CALCULATION_UPDATED, properties)\n}\n\nasync function calculationDeleted(existingView: View) {\n const properties: ViewCalculationDeletedEvent = {\n tableId: existingView.tableId,\n calculation: existingView.calculation as ViewCalculation,\n }\n await publishEvent(Event.VIEW_CALCULATION_DELETED, properties)\n}\n\nexport default {\n created,\n updated,\n deleted,\n exported,\n filterCreated,\n filterUpdated,\n filterDeleted,\n calculationCreated,\n calculationUpdated,\n calculationDeleted,\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA6B;AAC7B,mBAgBO;AAIP,eAAe,QAAQ,MAAY,WAA6B;AAC9D,QAAM,aAA+B;AAAA,IACnC,SAAS,KAAK;AAAA,EAChB;AACA,YAAM,4BAAa,mBAAM,cAAc,YAAY,SAAS;AAC9D;AAEA,eAAe,QAAQ,MAAY;AACjC,QAAM,aAA+B;AAAA,IACnC,SAAS,KAAK;AAAA,EAChB;AACA,YAAM,4BAAa,mBAAM,cAAc,UAAU;AACnD;AAEA,eAAe,QAAQ,MAAY;AACjC,QAAM,aAA+B;AAAA,IACnC,SAAS,KAAK;AAAA,EAChB;AACA,YAAM,4BAAa,mBAAM,cAAc,UAAU;AACnD;AAEA,eAAe,SAAS,OAAc,QAA2B;AAC/D,QAAM,aAAgC;AAAA,IACpC,SAAS,MAAM;AAAA,IACf;AAAA,EACF;AACA,YAAM,4BAAa,mBAAM,eAAe,UAAU;AACpD;AAEA,eAAe,cAAc,MAAY,WAA6B;AACpE,QAAM,aAAqC;AAAA,IACzC,SAAS,KAAK;AAAA,EAChB;AACA,YAAM,4BAAa,mBAAM,qBAAqB,YAAY,SAAS;AACrE;AAEA,eAAe,cAAc,MAAY;AACvC,QAAM,aAAqC;AAAA,IACzC,SAAS,KAAK;AAAA,EAChB;AACA,YAAM,4BAAa,mBAAM,qBAAqB,UAAU;AAC1D;AAEA,eAAe,cAAc,MAAY;AACvC,QAAM,aAAqC;AAAA,IACzC,SAAS,KAAK;AAAA,EAChB;AACA,YAAM,4BAAa,mBAAM,qBAAqB,UAAU;AAC1D;AAEA,eAAe,mBAAmB,MAAY,WAA6B;AACzE,QAAM,aAA0C;AAAA,IAC9C,SAAS,KAAK;AAAA,IACd,aAAa,KAAK;AAAA,EACpB;AACA,YAAM,4BAAa,mBAAM,0BAA0B,YAAY,SAAS;AAC1E;AAEA,eAAe,mBAAmB,MAAY;AAC5C,QAAM,aAA0C;AAAA,IAC9C,SAAS,KAAK;AAAA,IACd,aAAa,KAAK;AAAA,EACpB;AACA,YAAM,4BAAa,mBAAM,0BAA0B,UAAU;AAC/D;AAEA,eAAe,mBAAmB,cAAoB;AACpD,QAAM,aAA0C;AAAA,IAC9C,SAAS,aAAa;AAAA,IACtB,aAAa,aAAa;AAAA,EAC5B;AACA,YAAM,4BAAa,mBAAM,0BAA0B,UAAU;AAC/D;AAEA,IAAO,eAAQ;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|