@budibase/backend-core 3.2.4 → 3.2.6
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.map +1 -1
- package/dist/index.js.meta.json +1 -1
- package/dist/package.json +11 -4
- package/dist/plugins.js.meta.json +1 -1
- package/package.json +11 -4
- package/src/accounts/accounts.ts +0 -82
- package/src/accounts/api.ts +0 -59
- package/src/accounts/index.ts +0 -1
- package/src/auth/auth.ts +0 -210
- package/src/auth/index.ts +0 -1
- package/src/auth/tests/auth.spec.ts +0 -14
- package/src/blacklist/blacklist.ts +0 -54
- package/src/blacklist/index.ts +0 -1
- package/src/blacklist/tests/blacklist.spec.ts +0 -46
- package/src/cache/appMetadata.ts +0 -88
- package/src/cache/base/index.ts +0 -150
- package/src/cache/docWritethrough.ts +0 -105
- package/src/cache/generic.ts +0 -33
- package/src/cache/index.ts +0 -8
- package/src/cache/invite.ts +0 -86
- package/src/cache/passwordReset.ts +0 -49
- package/src/cache/tests/docWritethrough.spec.ts +0 -296
- package/src/cache/tests/user.spec.ts +0 -145
- package/src/cache/tests/writethrough.spec.ts +0 -139
- package/src/cache/user.ts +0 -154
- package/src/cache/writethrough.ts +0 -133
- package/src/configs/configs.ts +0 -263
- package/src/configs/index.ts +0 -1
- package/src/configs/tests/configs.spec.ts +0 -184
- package/src/constants/db.ts +0 -75
- package/src/constants/index.ts +0 -2
- package/src/constants/misc.ts +0 -36
- package/src/context/Context.ts +0 -14
- package/src/context/identity.ts +0 -58
- package/src/context/index.ts +0 -3
- package/src/context/mainContext.ts +0 -422
- package/src/context/tests/index.spec.ts +0 -255
- package/src/context/types.ts +0 -26
- package/src/db/Replication.ts +0 -94
- package/src/db/couch/DatabaseImpl.ts +0 -511
- package/src/db/couch/connections.ts +0 -89
- package/src/db/couch/index.ts +0 -4
- package/src/db/couch/pouchDB.ts +0 -97
- package/src/db/couch/pouchDump.ts +0 -0
- package/src/db/couch/tests/DatabaseImpl.spec.ts +0 -118
- package/src/db/couch/utils.ts +0 -55
- package/src/db/db.ts +0 -34
- package/src/db/errors.ts +0 -14
- package/src/db/index.ts +0 -12
- package/src/db/instrumentation.ts +0 -199
- package/src/db/lucene.ts +0 -721
- package/src/db/searchIndexes/index.ts +0 -1
- package/src/db/searchIndexes/searchIndexes.ts +0 -62
- package/src/db/tests/DatabaseImpl.spec.ts +0 -55
- package/src/db/tests/connections.spec.ts +0 -22
- package/src/db/tests/index.spec.ts +0 -32
- package/src/db/tests/lucene.spec.ts +0 -400
- package/src/db/tests/pouch.spec.js +0 -62
- package/src/db/tests/utils.spec.ts +0 -63
- package/src/db/utils.ts +0 -208
- package/src/db/views.ts +0 -245
- package/src/docIds/conversions.ts +0 -60
- package/src/docIds/ids.ts +0 -126
- package/src/docIds/index.ts +0 -2
- package/src/docIds/newid.ts +0 -5
- package/src/docIds/params.ts +0 -189
- package/src/docUpdates/index.ts +0 -24
- package/src/environment.ts +0 -293
- package/src/errors/errors.ts +0 -119
- package/src/errors/index.ts +0 -1
- package/src/events/analytics.ts +0 -6
- package/src/events/asyncEvents/index.ts +0 -2
- package/src/events/asyncEvents/publisher.ts +0 -12
- package/src/events/asyncEvents/queue.ts +0 -22
- package/src/events/backfill.ts +0 -183
- package/src/events/documentId.ts +0 -56
- package/src/events/events.ts +0 -47
- package/src/events/identification.ts +0 -311
- package/src/events/index.ts +0 -15
- package/src/events/processors/AnalyticsProcessor.ts +0 -64
- package/src/events/processors/AuditLogsProcessor.ts +0 -92
- package/src/events/processors/LoggingProcessor.ts +0 -36
- package/src/events/processors/Processors.ts +0 -52
- package/src/events/processors/async/DocumentUpdateProcessor.ts +0 -38
- package/src/events/processors/index.ts +0 -19
- package/src/events/processors/posthog/PosthogProcessor.ts +0 -118
- package/src/events/processors/posthog/index.ts +0 -3
- package/src/events/processors/posthog/rateLimiting.ts +0 -106
- package/src/events/processors/posthog/tests/PosthogProcessor.spec.ts +0 -164
- package/src/events/processors/types.ts +0 -1
- package/src/events/publishers/account.ts +0 -41
- package/src/events/publishers/ai.ts +0 -21
- package/src/events/publishers/app.ts +0 -168
- package/src/events/publishers/auditLog.ts +0 -26
- package/src/events/publishers/auth.ts +0 -73
- package/src/events/publishers/automation.ts +0 -110
- package/src/events/publishers/backfill.ts +0 -74
- package/src/events/publishers/backup.ts +0 -42
- package/src/events/publishers/datasource.ts +0 -48
- package/src/events/publishers/email.ts +0 -17
- package/src/events/publishers/environmentVariable.ts +0 -38
- package/src/events/publishers/group.ts +0 -99
- package/src/events/publishers/index.ts +0 -25
- package/src/events/publishers/installation.ts +0 -38
- package/src/events/publishers/layout.ts +0 -26
- package/src/events/publishers/license.ts +0 -84
- package/src/events/publishers/org.ts +0 -37
- package/src/events/publishers/plugin.ts +0 -47
- package/src/events/publishers/query.ts +0 -89
- package/src/events/publishers/role.ts +0 -62
- package/src/events/publishers/rows.ts +0 -29
- package/src/events/publishers/screen.ts +0 -36
- package/src/events/publishers/serve.ts +0 -43
- package/src/events/publishers/table.ts +0 -70
- package/src/events/publishers/user.ts +0 -202
- package/src/events/publishers/view.ts +0 -107
- package/src/features/features.ts +0 -277
- package/src/features/index.ts +0 -2
- package/src/features/tests/features.spec.ts +0 -267
- package/src/features/tests/utils.ts +0 -64
- package/src/helpers.ts +0 -9
- package/src/index.ts +0 -59
- package/src/installation.ts +0 -115
- package/src/logging/alerts.ts +0 -26
- package/src/logging/correlation/correlation.ts +0 -15
- package/src/logging/correlation/index.ts +0 -1
- package/src/logging/correlation/middleware.ts +0 -18
- package/src/logging/index.ts +0 -4
- package/src/logging/pino/logger.ts +0 -239
- package/src/logging/pino/middleware.ts +0 -48
- package/src/logging/system.ts +0 -81
- package/src/logging/tests/system.spec.ts +0 -61
- package/src/middleware/adminOnly.ts +0 -9
- package/src/middleware/auditLog.ts +0 -6
- package/src/middleware/authenticated.ts +0 -247
- package/src/middleware/builderOnly.ts +0 -21
- package/src/middleware/builderOrAdmin.ts +0 -21
- package/src/middleware/contentSecurityPolicy.ts +0 -113
- package/src/middleware/csrf.ts +0 -81
- package/src/middleware/errorHandling.ts +0 -43
- package/src/middleware/index.ts +0 -24
- package/src/middleware/internalApi.ts +0 -23
- package/src/middleware/ip.ts +0 -12
- package/src/middleware/joi-validator.ts +0 -58
- package/src/middleware/matchers.ts +0 -39
- package/src/middleware/passport/datasource/google.ts +0 -102
- package/src/middleware/passport/local.ts +0 -54
- package/src/middleware/passport/sso/google.ts +0 -77
- package/src/middleware/passport/sso/oidc.ts +0 -152
- package/src/middleware/passport/sso/sso.ts +0 -138
- package/src/middleware/passport/sso/tests/google.spec.ts +0 -68
- package/src/middleware/passport/sso/tests/oidc.spec.ts +0 -144
- package/src/middleware/passport/sso/tests/sso.spec.ts +0 -197
- package/src/middleware/passport/utils.ts +0 -38
- package/src/middleware/querystringToBody.ts +0 -28
- package/src/middleware/tenancy.ts +0 -36
- package/src/middleware/tests/builder.spec.ts +0 -181
- package/src/middleware/tests/contentSecurityPolicy.spec.ts +0 -75
- package/src/middleware/tests/matchers.spec.ts +0 -100
- package/src/migrations/definitions.ts +0 -40
- package/src/migrations/index.ts +0 -2
- package/src/migrations/migrations.ts +0 -186
- package/src/migrations/tests/__snapshots__/migrations.spec.ts.snap +0 -11
- package/src/migrations/tests/migrations.spec.ts +0 -64
- package/src/objectStore/buckets/app.ts +0 -53
- package/src/objectStore/buckets/global.ts +0 -29
- package/src/objectStore/buckets/index.ts +0 -3
- package/src/objectStore/buckets/plugins.ts +0 -71
- package/src/objectStore/buckets/tests/app.spec.ts +0 -161
- package/src/objectStore/buckets/tests/global.spec.ts +0 -74
- package/src/objectStore/buckets/tests/plugins.spec.ts +0 -111
- package/src/objectStore/cloudfront.ts +0 -41
- package/src/objectStore/index.ts +0 -3
- package/src/objectStore/objectStore.ts +0 -585
- package/src/objectStore/utils.ts +0 -113
- package/src/platform/index.ts +0 -3
- package/src/platform/platformDb.ts +0 -6
- package/src/platform/tenants.ts +0 -101
- package/src/platform/tests/tenants.spec.ts +0 -26
- package/src/platform/users.ts +0 -129
- package/src/plugin/index.ts +0 -1
- package/src/plugin/tests/validation.spec.ts +0 -209
- package/src/plugin/utils.ts +0 -175
- package/src/queue/constants.ts +0 -8
- package/src/queue/inMemoryQueue.ts +0 -189
- package/src/queue/index.ts +0 -2
- package/src/queue/listeners.ts +0 -199
- package/src/queue/queue.ts +0 -84
- package/src/redis/index.ts +0 -6
- package/src/redis/init.ts +0 -118
- package/src/redis/redis.ts +0 -358
- package/src/redis/redlockImpl.ts +0 -155
- package/src/redis/tests/redis.spec.ts +0 -207
- package/src/redis/tests/redlockImpl.spec.ts +0 -105
- package/src/redis/utils.ts +0 -128
- package/src/security/auth.ts +0 -24
- package/src/security/encryption.ts +0 -185
- package/src/security/index.ts +0 -1
- package/src/security/permissions.ts +0 -166
- package/src/security/roles.ts +0 -655
- package/src/security/secrets.ts +0 -20
- package/src/security/sessions.ts +0 -123
- package/src/security/tests/auth.spec.ts +0 -45
- package/src/security/tests/encryption.spec.ts +0 -31
- package/src/security/tests/permissions.spec.ts +0 -146
- package/src/security/tests/secrets.spec.ts +0 -35
- package/src/security/tests/sessions.spec.ts +0 -12
- package/src/sql/designDoc.ts +0 -17
- package/src/sql/index.ts +0 -5
- package/src/sql/sql.ts +0 -1854
- package/src/sql/sqlTable.ts +0 -319
- package/src/sql/utils.ts +0 -193
- package/src/tenancy/db.ts +0 -6
- package/src/tenancy/index.ts +0 -2
- package/src/tenancy/tenancy.ts +0 -148
- package/src/tenancy/tests/tenancy.spec.ts +0 -184
- package/src/timers/index.ts +0 -1
- package/src/timers/timers.ts +0 -22
- package/src/users/db.ts +0 -582
- package/src/users/events.ts +0 -176
- package/src/users/index.ts +0 -4
- package/src/users/lookup.ts +0 -99
- package/src/users/test/db.spec.ts +0 -188
- package/src/users/test/utils.spec.ts +0 -67
- package/src/users/users.ts +0 -353
- package/src/users/utils.ts +0 -81
- package/src/utils/Duration.ts +0 -56
- package/src/utils/hashing.ts +0 -15
- package/src/utils/index.ts +0 -4
- package/src/utils/stringUtils.ts +0 -8
- package/src/utils/tests/Duration.spec.ts +0 -19
- package/src/utils/tests/utils.spec.ts +0 -204
- package/src/utils/utils.ts +0 -249
- package/tests/core/logging.ts +0 -34
- package/tests/core/users/users.spec.js +0 -53
- package/tests/core/utilities/index.ts +0 -7
- package/tests/core/utilities/jestUtils.ts +0 -33
- package/tests/core/utilities/mocks/alerts.ts +0 -4
- package/tests/core/utilities/mocks/date.ts +0 -3
- package/tests/core/utilities/mocks/events.ts +0 -132
- package/tests/core/utilities/mocks/index.ts +0 -9
- package/tests/core/utilities/mocks/licenses.ts +0 -119
- package/tests/core/utilities/queue.ts +0 -9
- package/tests/core/utilities/structures/Chance.ts +0 -20
- package/tests/core/utilities/structures/accounts.ts +0 -80
- package/tests/core/utilities/structures/apps.ts +0 -21
- package/tests/core/utilities/structures/common.ts +0 -7
- package/tests/core/utilities/structures/db.ts +0 -12
- package/tests/core/utilities/structures/documents/index.ts +0 -1
- package/tests/core/utilities/structures/documents/platform/index.ts +0 -1
- package/tests/core/utilities/structures/documents/platform/installation.ts +0 -12
- package/tests/core/utilities/structures/generator.ts +0 -3
- package/tests/core/utilities/structures/index.ts +0 -15
- package/tests/core/utilities/structures/koa.ts +0 -16
- package/tests/core/utilities/structures/licenses.ts +0 -190
- package/tests/core/utilities/structures/plugins.ts +0 -19
- package/tests/core/utilities/structures/quotas.ts +0 -72
- package/tests/core/utilities/structures/scim.ts +0 -80
- package/tests/core/utilities/structures/sso.ts +0 -118
- package/tests/core/utilities/structures/tenants.ts +0 -5
- package/tests/core/utilities/structures/userGroups.ts +0 -10
- package/tests/core/utilities/structures/users.ts +0 -89
- package/tests/core/utilities/testContainerUtils.ts +0 -165
- package/tests/core/utilities/utils/index.ts +0 -2
- package/tests/core/utilities/utils/queue.ts +0 -27
- package/tests/core/utilities/utils/time.ts +0 -3
- package/tests/extra/DBTestConfiguration.ts +0 -36
- package/tests/extra/index.ts +0 -2
- package/tests/extra/testEnv.ts +0 -95
- package/tests/index.ts +0 -2
- package/tests/jestEnv.ts +0 -10
- package/tests/jestSetup.ts +0 -36
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export { default as account } from "./account"
|
|
2
|
-
export { default as app } from "./app"
|
|
3
|
-
export { default as auth } from "./auth"
|
|
4
|
-
export { default as automation } from "./automation"
|
|
5
|
-
export { default as datasource } from "./datasource"
|
|
6
|
-
export { default as email } from "./email"
|
|
7
|
-
export { default as ai } from "./ai"
|
|
8
|
-
export { default as license } from "./license"
|
|
9
|
-
export { default as layout } from "./layout"
|
|
10
|
-
export { default as org } from "./org"
|
|
11
|
-
export { default as query } from "./query"
|
|
12
|
-
export { default as role } from "./role"
|
|
13
|
-
export { default as screen } from "./screen"
|
|
14
|
-
export { default as rows } from "./rows"
|
|
15
|
-
export { default as table } from "./table"
|
|
16
|
-
export { default as serve } from "./serve"
|
|
17
|
-
export { default as user } from "./user"
|
|
18
|
-
export { default as view } from "./view"
|
|
19
|
-
export { default as installation } from "./installation"
|
|
20
|
-
export { default as backfill } from "./backfill"
|
|
21
|
-
export { default as group } from "./group"
|
|
22
|
-
export { default as plugin } from "./plugin"
|
|
23
|
-
export { default as backup } from "./backup"
|
|
24
|
-
export { default as environmentVariable } from "./environmentVariable"
|
|
25
|
-
export { default as auditLog } from "./auditLog"
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { publishEvent } from "../events"
|
|
2
|
-
import { Event, VersionCheckedEvent, VersionChangeEvent } from "@budibase/types"
|
|
3
|
-
|
|
4
|
-
async function versionChecked(version: string) {
|
|
5
|
-
const properties: VersionCheckedEvent = {
|
|
6
|
-
currentVersion: version,
|
|
7
|
-
}
|
|
8
|
-
await publishEvent(Event.INSTALLATION_VERSION_CHECKED, properties)
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
async function upgraded(from: string, to: string) {
|
|
12
|
-
const properties: VersionChangeEvent = {
|
|
13
|
-
from,
|
|
14
|
-
to,
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
await publishEvent(Event.INSTALLATION_VERSION_UPGRADED, properties)
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
async function downgraded(from: string, to: string) {
|
|
21
|
-
const properties: VersionChangeEvent = {
|
|
22
|
-
from,
|
|
23
|
-
to,
|
|
24
|
-
}
|
|
25
|
-
await publishEvent(Event.INSTALLATION_VERSION_DOWNGRADED, properties)
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
async function firstStartup() {
|
|
29
|
-
const properties = {}
|
|
30
|
-
await publishEvent(Event.INSTALLATION_FIRST_STARTUP, properties)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export default {
|
|
34
|
-
versionChecked,
|
|
35
|
-
upgraded,
|
|
36
|
-
downgraded,
|
|
37
|
-
firstStartup,
|
|
38
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { publishEvent } from "../events"
|
|
2
|
-
import {
|
|
3
|
-
Event,
|
|
4
|
-
Layout,
|
|
5
|
-
LayoutCreatedEvent,
|
|
6
|
-
LayoutDeletedEvent,
|
|
7
|
-
} from "@budibase/types"
|
|
8
|
-
|
|
9
|
-
async function created(layout: Layout, timestamp?: string | number) {
|
|
10
|
-
const properties: LayoutCreatedEvent = {
|
|
11
|
-
layoutId: layout._id as string,
|
|
12
|
-
}
|
|
13
|
-
await publishEvent(Event.LAYOUT_CREATED, properties, timestamp)
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
async function deleted(layoutId: string) {
|
|
17
|
-
const properties: LayoutDeletedEvent = {
|
|
18
|
-
layoutId,
|
|
19
|
-
}
|
|
20
|
-
await publishEvent(Event.LAYOUT_DELETED, properties)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export default {
|
|
24
|
-
created,
|
|
25
|
-
deleted,
|
|
26
|
-
}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { publishEvent } from "../events"
|
|
2
|
-
import {
|
|
3
|
-
Event,
|
|
4
|
-
LicenseActivatedEvent,
|
|
5
|
-
LicensePlanChangedEvent,
|
|
6
|
-
PlanType,
|
|
7
|
-
Account,
|
|
8
|
-
LicensePortalOpenedEvent,
|
|
9
|
-
LicenseCheckoutSuccessEvent,
|
|
10
|
-
LicenseCheckoutOpenedEvent,
|
|
11
|
-
LicensePaymentFailedEvent,
|
|
12
|
-
LicensePaymentRecoveredEvent,
|
|
13
|
-
PriceDuration,
|
|
14
|
-
} from "@budibase/types"
|
|
15
|
-
|
|
16
|
-
async function planChanged(
|
|
17
|
-
account: Account,
|
|
18
|
-
opts: {
|
|
19
|
-
from: PlanType
|
|
20
|
-
to: PlanType
|
|
21
|
-
fromQuantity: number | undefined
|
|
22
|
-
toQuantity: number | undefined
|
|
23
|
-
fromDuration: PriceDuration | undefined
|
|
24
|
-
toDuration: PriceDuration | undefined
|
|
25
|
-
}
|
|
26
|
-
) {
|
|
27
|
-
const properties: LicensePlanChangedEvent = {
|
|
28
|
-
accountId: account.accountId,
|
|
29
|
-
...opts,
|
|
30
|
-
}
|
|
31
|
-
await publishEvent(Event.LICENSE_PLAN_CHANGED, properties)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
async function activated(account: Account) {
|
|
35
|
-
const properties: LicenseActivatedEvent = {
|
|
36
|
-
accountId: account.accountId,
|
|
37
|
-
}
|
|
38
|
-
await publishEvent(Event.LICENSE_ACTIVATED, properties)
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
async function checkoutOpened(account: Account) {
|
|
42
|
-
const properties: LicenseCheckoutOpenedEvent = {
|
|
43
|
-
accountId: account.accountId,
|
|
44
|
-
}
|
|
45
|
-
await publishEvent(Event.LICENSE_CHECKOUT_OPENED, properties)
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
async function checkoutSuccess(account: Account) {
|
|
49
|
-
const properties: LicenseCheckoutSuccessEvent = {
|
|
50
|
-
accountId: account.accountId,
|
|
51
|
-
}
|
|
52
|
-
await publishEvent(Event.LICENSE_CHECKOUT_SUCCESS, properties)
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
async function portalOpened(account: Account) {
|
|
56
|
-
const properties: LicensePortalOpenedEvent = {
|
|
57
|
-
accountId: account.accountId,
|
|
58
|
-
}
|
|
59
|
-
await publishEvent(Event.LICENSE_PORTAL_OPENED, properties)
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
async function paymentFailed(account: Account) {
|
|
63
|
-
const properties: LicensePaymentFailedEvent = {
|
|
64
|
-
accountId: account.accountId,
|
|
65
|
-
}
|
|
66
|
-
await publishEvent(Event.LICENSE_PAYMENT_FAILED, properties)
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
async function paymentRecovered(account: Account) {
|
|
70
|
-
const properties: LicensePaymentRecoveredEvent = {
|
|
71
|
-
accountId: account.accountId,
|
|
72
|
-
}
|
|
73
|
-
await publishEvent(Event.LICENSE_PAYMENT_RECOVERED, properties)
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export default {
|
|
77
|
-
planChanged,
|
|
78
|
-
activated,
|
|
79
|
-
checkoutOpened,
|
|
80
|
-
checkoutSuccess,
|
|
81
|
-
portalOpened,
|
|
82
|
-
paymentFailed,
|
|
83
|
-
paymentRecovered,
|
|
84
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { publishEvent } from "../events"
|
|
2
|
-
import { Event } from "@budibase/types"
|
|
3
|
-
|
|
4
|
-
async function nameUpdated(timestamp?: string | number) {
|
|
5
|
-
const properties = {}
|
|
6
|
-
await publishEvent(Event.ORG_NAME_UPDATED, properties, timestamp)
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
async function logoUpdated(timestamp?: string | number) {
|
|
10
|
-
const properties = {}
|
|
11
|
-
await publishEvent(Event.ORG_LOGO_UPDATED, properties, timestamp)
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
async function platformURLUpdated(timestamp?: string | number) {
|
|
15
|
-
const properties = {}
|
|
16
|
-
await publishEvent(Event.ORG_PLATFORM_URL_UPDATED, properties, timestamp)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// TODO
|
|
20
|
-
|
|
21
|
-
async function analyticsOptOut() {
|
|
22
|
-
const properties = {}
|
|
23
|
-
await publishEvent(Event.ANALYTICS_OPT_OUT, properties)
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
async function analyticsOptIn() {
|
|
27
|
-
const properties = {}
|
|
28
|
-
await publishEvent(Event.ANALYTICS_OPT_OUT, properties)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export default {
|
|
32
|
-
nameUpdated,
|
|
33
|
-
logoUpdated,
|
|
34
|
-
platformURLUpdated,
|
|
35
|
-
analyticsOptOut,
|
|
36
|
-
analyticsOptIn,
|
|
37
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { publishEvent } from "../events"
|
|
2
|
-
import {
|
|
3
|
-
Event,
|
|
4
|
-
Plugin,
|
|
5
|
-
PluginDeletedEvent,
|
|
6
|
-
PluginImportedEvent,
|
|
7
|
-
PluginInitEvent,
|
|
8
|
-
} from "@budibase/types"
|
|
9
|
-
|
|
10
|
-
async function init(plugin: Plugin) {
|
|
11
|
-
const properties: PluginInitEvent = {
|
|
12
|
-
type: plugin.schema.type,
|
|
13
|
-
name: plugin.name,
|
|
14
|
-
description: plugin.description,
|
|
15
|
-
version: plugin.version,
|
|
16
|
-
}
|
|
17
|
-
await publishEvent(Event.PLUGIN_INIT, properties)
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
async function imported(plugin: Plugin) {
|
|
21
|
-
const properties: PluginImportedEvent = {
|
|
22
|
-
pluginId: plugin._id as string,
|
|
23
|
-
type: plugin.schema.type,
|
|
24
|
-
source: plugin.source,
|
|
25
|
-
name: plugin.name,
|
|
26
|
-
description: plugin.description,
|
|
27
|
-
version: plugin.version,
|
|
28
|
-
}
|
|
29
|
-
await publishEvent(Event.PLUGIN_IMPORTED, properties)
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
async function deleted(plugin: Plugin) {
|
|
33
|
-
const properties: PluginDeletedEvent = {
|
|
34
|
-
pluginId: plugin._id as string,
|
|
35
|
-
type: plugin.schema.type,
|
|
36
|
-
name: plugin.name,
|
|
37
|
-
description: plugin.description,
|
|
38
|
-
version: plugin.version,
|
|
39
|
-
}
|
|
40
|
-
await publishEvent(Event.PLUGIN_DELETED, properties)
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export default {
|
|
44
|
-
init,
|
|
45
|
-
imported,
|
|
46
|
-
deleted,
|
|
47
|
-
}
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { publishEvent } from "../events"
|
|
2
|
-
import {
|
|
3
|
-
Event,
|
|
4
|
-
Datasource,
|
|
5
|
-
Query,
|
|
6
|
-
QueryPreview,
|
|
7
|
-
QueryCreatedEvent,
|
|
8
|
-
QueryUpdatedEvent,
|
|
9
|
-
QueryDeletedEvent,
|
|
10
|
-
QueryImportedEvent,
|
|
11
|
-
QueryPreviewedEvent,
|
|
12
|
-
QueriesRunEvent,
|
|
13
|
-
} from "@budibase/types"
|
|
14
|
-
|
|
15
|
-
/* eslint-disable */
|
|
16
|
-
|
|
17
|
-
const created = async (
|
|
18
|
-
datasource: Datasource,
|
|
19
|
-
query: Query,
|
|
20
|
-
timestamp?: string | number
|
|
21
|
-
) => {
|
|
22
|
-
const properties: QueryCreatedEvent = {
|
|
23
|
-
queryId: query._id as string,
|
|
24
|
-
datasourceId: datasource._id as string,
|
|
25
|
-
source: datasource.source,
|
|
26
|
-
queryVerb: query.queryVerb,
|
|
27
|
-
}
|
|
28
|
-
await publishEvent(Event.QUERY_CREATED, properties, timestamp)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const updated = async (datasource: Datasource, query: Query) => {
|
|
32
|
-
const properties: QueryUpdatedEvent = {
|
|
33
|
-
queryId: query._id as string,
|
|
34
|
-
datasourceId: datasource._id as string,
|
|
35
|
-
source: datasource.source,
|
|
36
|
-
queryVerb: query.queryVerb,
|
|
37
|
-
}
|
|
38
|
-
await publishEvent(Event.QUERY_UPDATED, properties)
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const deleted = async (datasource: Datasource, query: Query) => {
|
|
42
|
-
const properties: QueryDeletedEvent = {
|
|
43
|
-
queryId: query._id as string,
|
|
44
|
-
datasourceId: datasource._id as string,
|
|
45
|
-
source: datasource.source,
|
|
46
|
-
queryVerb: query.queryVerb,
|
|
47
|
-
}
|
|
48
|
-
await publishEvent(Event.QUERY_DELETED, properties)
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const imported = async (
|
|
52
|
-
datasource: Datasource,
|
|
53
|
-
importSource: any,
|
|
54
|
-
count: any
|
|
55
|
-
) => {
|
|
56
|
-
const properties: QueryImportedEvent = {
|
|
57
|
-
datasourceId: datasource._id as string,
|
|
58
|
-
source: datasource.source,
|
|
59
|
-
count,
|
|
60
|
-
importSource,
|
|
61
|
-
}
|
|
62
|
-
await publishEvent(Event.QUERY_IMPORT, properties)
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const run = async (count: number, timestamp?: string | number) => {
|
|
66
|
-
const properties: QueriesRunEvent = {
|
|
67
|
-
count,
|
|
68
|
-
}
|
|
69
|
-
await publishEvent(Event.QUERIES_RUN, properties, timestamp)
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
const previewed = async (datasource: Datasource, query: QueryPreview) => {
|
|
73
|
-
const properties: QueryPreviewedEvent = {
|
|
74
|
-
queryId: query.queryId,
|
|
75
|
-
datasourceId: datasource._id as string,
|
|
76
|
-
source: datasource.source,
|
|
77
|
-
queryVerb: query.queryVerb,
|
|
78
|
-
}
|
|
79
|
-
await publishEvent(Event.QUERY_PREVIEWED, properties)
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export default {
|
|
83
|
-
created,
|
|
84
|
-
updated,
|
|
85
|
-
deleted,
|
|
86
|
-
imported,
|
|
87
|
-
run,
|
|
88
|
-
previewed,
|
|
89
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { publishEvent } from "../events"
|
|
2
|
-
import {
|
|
3
|
-
Event,
|
|
4
|
-
Role,
|
|
5
|
-
RoleAssignedEvent,
|
|
6
|
-
RoleCreatedEvent,
|
|
7
|
-
RoleDeletedEvent,
|
|
8
|
-
RoleUnassignedEvent,
|
|
9
|
-
RoleUpdatedEvent,
|
|
10
|
-
User,
|
|
11
|
-
} from "@budibase/types"
|
|
12
|
-
|
|
13
|
-
async function created(role: Role, timestamp?: string | number) {
|
|
14
|
-
const properties: RoleCreatedEvent = {
|
|
15
|
-
roleId: role._id as string,
|
|
16
|
-
permissionId: role.permissionId,
|
|
17
|
-
inherits: role.inherits,
|
|
18
|
-
}
|
|
19
|
-
await publishEvent(Event.ROLE_CREATED, properties, timestamp)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
async function updated(role: Role) {
|
|
23
|
-
const properties: RoleUpdatedEvent = {
|
|
24
|
-
roleId: role._id as string,
|
|
25
|
-
permissionId: role.permissionId,
|
|
26
|
-
inherits: role.inherits,
|
|
27
|
-
}
|
|
28
|
-
await publishEvent(Event.ROLE_UPDATED, properties)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
async function deleted(role: Role) {
|
|
32
|
-
const properties: RoleDeletedEvent = {
|
|
33
|
-
roleId: role._id as string,
|
|
34
|
-
permissionId: role.permissionId,
|
|
35
|
-
inherits: role.inherits,
|
|
36
|
-
}
|
|
37
|
-
await publishEvent(Event.ROLE_DELETED, properties)
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
async function assigned(user: User, roleId: string, timestamp?: number) {
|
|
41
|
-
const properties: RoleAssignedEvent = {
|
|
42
|
-
userId: user._id as string,
|
|
43
|
-
roleId,
|
|
44
|
-
}
|
|
45
|
-
await publishEvent(Event.ROLE_ASSIGNED, properties, timestamp)
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
async function unassigned(user: User, roleId: string) {
|
|
49
|
-
const properties: RoleUnassignedEvent = {
|
|
50
|
-
userId: user._id as string,
|
|
51
|
-
roleId,
|
|
52
|
-
}
|
|
53
|
-
await publishEvent(Event.ROLE_UNASSIGNED, properties)
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export default {
|
|
57
|
-
created,
|
|
58
|
-
updated,
|
|
59
|
-
deleted,
|
|
60
|
-
assigned,
|
|
61
|
-
unassigned,
|
|
62
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { publishEvent } from "../events"
|
|
2
|
-
import {
|
|
3
|
-
Event,
|
|
4
|
-
RowsImportedEvent,
|
|
5
|
-
RowsCreatedEvent,
|
|
6
|
-
Table,
|
|
7
|
-
} from "@budibase/types"
|
|
8
|
-
|
|
9
|
-
/* eslint-disable */
|
|
10
|
-
|
|
11
|
-
const created = async (count: number, timestamp?: string | number) => {
|
|
12
|
-
const properties: RowsCreatedEvent = {
|
|
13
|
-
count,
|
|
14
|
-
}
|
|
15
|
-
await publishEvent(Event.ROWS_CREATED, properties, timestamp)
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const imported = async (table: Table, count: number) => {
|
|
19
|
-
const properties: RowsImportedEvent = {
|
|
20
|
-
tableId: table._id as string,
|
|
21
|
-
count,
|
|
22
|
-
}
|
|
23
|
-
await publishEvent(Event.ROWS_IMPORTED, properties)
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export default {
|
|
27
|
-
created,
|
|
28
|
-
imported,
|
|
29
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { publishEvent } from "../events"
|
|
2
|
-
import {
|
|
3
|
-
Event,
|
|
4
|
-
Screen,
|
|
5
|
-
ScreenCreatedEvent,
|
|
6
|
-
ScreenDeletedEvent,
|
|
7
|
-
} from "@budibase/types"
|
|
8
|
-
|
|
9
|
-
async function created(screen: Screen, timestamp?: string | number) {
|
|
10
|
-
const properties: ScreenCreatedEvent = {
|
|
11
|
-
layoutId: screen.layoutId,
|
|
12
|
-
screenId: screen._id as string,
|
|
13
|
-
roleId: screen.routing.roleId,
|
|
14
|
-
audited: {
|
|
15
|
-
name: screen.routing?.route,
|
|
16
|
-
},
|
|
17
|
-
}
|
|
18
|
-
await publishEvent(Event.SCREEN_CREATED, properties, timestamp)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
async function deleted(screen: Screen) {
|
|
22
|
-
const properties: ScreenDeletedEvent = {
|
|
23
|
-
layoutId: screen.layoutId,
|
|
24
|
-
screenId: screen._id as string,
|
|
25
|
-
roleId: screen.routing.roleId,
|
|
26
|
-
audited: {
|
|
27
|
-
name: screen.routing?.route,
|
|
28
|
-
},
|
|
29
|
-
}
|
|
30
|
-
await publishEvent(Event.SCREEN_DELETED, properties)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export default {
|
|
34
|
-
created,
|
|
35
|
-
deleted,
|
|
36
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { publishEvent } from "../events"
|
|
2
|
-
import {
|
|
3
|
-
App,
|
|
4
|
-
BuilderServedEvent,
|
|
5
|
-
Event,
|
|
6
|
-
AppPreviewServedEvent,
|
|
7
|
-
AppServedEvent,
|
|
8
|
-
} from "@budibase/types"
|
|
9
|
-
|
|
10
|
-
async function servedBuilder(timezone: string) {
|
|
11
|
-
const properties: BuilderServedEvent = {
|
|
12
|
-
timezone,
|
|
13
|
-
}
|
|
14
|
-
await publishEvent(Event.SERVED_BUILDER, properties)
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
async function servedApp(
|
|
18
|
-
app: App,
|
|
19
|
-
timezone: string,
|
|
20
|
-
embed?: boolean | undefined
|
|
21
|
-
) {
|
|
22
|
-
const properties: AppServedEvent = {
|
|
23
|
-
appVersion: app.version,
|
|
24
|
-
timezone,
|
|
25
|
-
embed: embed === true,
|
|
26
|
-
}
|
|
27
|
-
await publishEvent(Event.SERVED_APP, properties)
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
async function servedAppPreview(app: App, timezone: string) {
|
|
31
|
-
const properties: AppPreviewServedEvent = {
|
|
32
|
-
appId: app.appId,
|
|
33
|
-
appVersion: app.version,
|
|
34
|
-
timezone,
|
|
35
|
-
}
|
|
36
|
-
await publishEvent(Event.SERVED_APP_PREVIEW, properties)
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export default {
|
|
40
|
-
servedBuilder,
|
|
41
|
-
servedApp,
|
|
42
|
-
servedAppPreview,
|
|
43
|
-
}
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { publishEvent } from "../events"
|
|
2
|
-
import {
|
|
3
|
-
Event,
|
|
4
|
-
TableExportFormat,
|
|
5
|
-
Table,
|
|
6
|
-
TableCreatedEvent,
|
|
7
|
-
TableUpdatedEvent,
|
|
8
|
-
TableDeletedEvent,
|
|
9
|
-
TableExportedEvent,
|
|
10
|
-
TableImportedEvent,
|
|
11
|
-
} from "@budibase/types"
|
|
12
|
-
|
|
13
|
-
async function created(table: Table, timestamp?: string | number) {
|
|
14
|
-
const properties: TableCreatedEvent = {
|
|
15
|
-
tableId: table._id as string,
|
|
16
|
-
audited: {
|
|
17
|
-
name: table.name,
|
|
18
|
-
},
|
|
19
|
-
}
|
|
20
|
-
await publishEvent(Event.TABLE_CREATED, properties, timestamp)
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
async function updated(table: Table) {
|
|
24
|
-
const properties: TableUpdatedEvent = {
|
|
25
|
-
tableId: table._id as string,
|
|
26
|
-
audited: {
|
|
27
|
-
name: table.name,
|
|
28
|
-
},
|
|
29
|
-
}
|
|
30
|
-
await publishEvent(Event.TABLE_UPDATED, properties)
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
async function deleted(table: Table) {
|
|
34
|
-
const properties: TableDeletedEvent = {
|
|
35
|
-
tableId: table._id as string,
|
|
36
|
-
audited: {
|
|
37
|
-
name: table.name,
|
|
38
|
-
},
|
|
39
|
-
}
|
|
40
|
-
await publishEvent(Event.TABLE_DELETED, properties)
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
async function exported(table: Table, format: TableExportFormat) {
|
|
44
|
-
const properties: TableExportedEvent = {
|
|
45
|
-
tableId: table._id as string,
|
|
46
|
-
format,
|
|
47
|
-
audited: {
|
|
48
|
-
name: table.name,
|
|
49
|
-
},
|
|
50
|
-
}
|
|
51
|
-
await publishEvent(Event.TABLE_EXPORTED, properties)
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
async function imported(table: Table) {
|
|
55
|
-
const properties: TableImportedEvent = {
|
|
56
|
-
tableId: table._id as string,
|
|
57
|
-
audited: {
|
|
58
|
-
name: table.name,
|
|
59
|
-
},
|
|
60
|
-
}
|
|
61
|
-
await publishEvent(Event.TABLE_IMPORTED, properties)
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export default {
|
|
65
|
-
created,
|
|
66
|
-
updated,
|
|
67
|
-
deleted,
|
|
68
|
-
exported,
|
|
69
|
-
imported,
|
|
70
|
-
}
|