Add @budibase/types package

This commit is contained in:
Rory Powell 2022-05-03 17:13:13 +01:00
parent 185b591db5
commit 8b4f4c813a
86 changed files with 1097 additions and 723 deletions

View File

@ -44,6 +44,7 @@
"@types/jest": "^27.4.1", "@types/jest": "^27.4.1",
"@types/node": "^15.12.4", "@types/node": "^15.12.4",
"@types/node-fetch": "^2.6.1", "@types/node-fetch": "^2.6.1",
"@budibase/types": "^1.0.126-alpha.0",
"typescript": "^4.5.5", "typescript": "^4.5.5",
"@shopify/jest-koa-mocks": "^3.1.5", "@shopify/jest-koa-mocks": "^3.1.5",
"ioredis-mock": "^5.5.5", "ioredis-mock": "^5.5.5",

View File

@ -1,141 +0,0 @@
exports.Events = {
// USER
USER_CREATED: "user:created",
USER_UPDATED: "user:updated",
USER_DELETED: "user:deleted",
// USER / PERMISSIONS
USER_PERMISSION_ADMIN_ASSIGNED: "user:admin:assigned",
USER_PERMISSION_ADMIN_REMOVED: "user:admin:removed",
USER_PERMISSION_BUILDER_ASSIGNED: "user:builder:assigned",
USER_PERMISSION_BUILDER_REMOVED: "userbuilder:removed",
// USER / INVITE
USER_INVITED: "user:invited",
USER_INVITED_ACCEPTED: "user:invite:accepted",
// USER / PASSWORD
USER_PASSWORD_FORCE_RESET: "user:password:force:reset",
USER_PASSWORD_UPDATED: "user:password:updated",
USER_PASSWORD_RESET_REQUESTED: "user:password:reset:requested",
USER_PASSWORD_RESET: "user:password:reset",
// EMAIL
EMAIL_SMTP_CREATED: "email:smtp:created",
EMAIL_SMTP_UPDATED: "email:smtp:updated",
// AUTH
AUTH_SSO_CREATED: "auth:sso:created",
AUTH_SSO_UPDATED: "auth:sso:updated",
AUTH_SSO_ACTIVATED: "auth:sso:activated",
AUTH_SSO_DEACTIVATED: "auth:sso:deactivated",
AUTH_LOGIN: "auth:login",
AUTH_LOGOUT: "auth:logout",
// ORG
ORG_NAME_UPDATED: "org:info:name:updated",
ORG_LOGO_UPDATED: "org:info:logo:updated",
ORG_PLATFORM_URL_UPDATED: "org:platformurl:updated",
// ORG / UPDATE
UPDATE_VERSION_CHECKED: "version:checked",
// ORG / ANALYTICS
ANALYTICS_OPT_OUT: "analytics:opt:out",
// APP
APP_CREATED: "app:created",
APP_UPDATED: "app:updated",
APP_DELETED: "app:deleted",
APP_PUBLISHED: "app:published",
APP_UNPUBLISHED: "app:unpublished",
APP_TEMPLATE_IMPORTED: "app:template:imported",
APP_FILE_IMPORTED: "app:file:imported",
APP_VERSION_UPDATED: "app:version:updated",
APP_VERSION_REVERTED: "app:version:reverted",
APP_REVERTED: "app:reverted",
APP_EXPORTED: "app:exported",
// ROLE
ROLE_CREATED: "role:created",
ROLE_UPDATED: "role:updated",
ROLE_DELETED: "role:deleted",
ROLE_ASSIGNED: "role:assigned",
ROLE_UNASSIGNED: "role:unassigned",
// SERVE
SERVED_BUILDER: "served:builder",
SERVED_APP: "served:app",
SERVED_APP_PREVIEW: "served:app:preview",
// DATASOURCE
DATASOURCE_CREATED: "datasource:created",
DATASOURCE_UPDATED: "datasource:updated",
DATASOURCE_DELETED: "datasource:deleted",
// QUERY
QUERY_CREATED: "query:created",
QUERY_UPDATED: "query:updated",
QUERY_DELETED: "query:deleted",
QUERY_IMPORT: "query:import",
// QUERY_RUN: "query:run",
QUERY_PREVIEWED: "query:previewed",
// TABLE
TABLE_CREATED: "table:created",
TABLE_UPDATED: "table:updated",
TABLE_DELETED: "table:deleted",
TABLE_EXPORTED: "table:exported",
TABLE_IMPORTED: "table:imported",
TABLE_DATA_IMPORTED: "table:data:imported",
TABLE_PERMISSION_UPDATED: "table:permission:updated",
// VIEW
VIEW_CREATED: "view:created",
VIEW_UPDATED: "view:updated",
VIEW_DELETED: "view:deleted",
VIEW_EXPORTED: "view:exported",
VIEW_FILTER_CREATED: "view:filter:created",
VIEW_FILTER_UPDATED: "view:filter:updated",
VIEW_FILTER_DELETED: "view:filter:deleted",
VIEW_CALCULATION_CREATED: "view:calculation:created",
VIEW_CALCULATION_UPDATED: "view:calculation:updated",
VIEW_CALCULATION_DELETED: "view:calculation:deleted",
// ROW
// ROW_CREATED: "row:created",
ROW_IMPORT: "row:import",
// COMPONENT
COMPONENT_CREATED: "component:created",
COMPONENT_DELETED: "component:deleted",
// SCREEN
SCREEN_CREATED: "screen:created",
SCREEN_DELETED: "screen:deleted",
// LAYOUT
LAYOUT_CREATED: "layout:created",
LAYOUT_DELETED: "layout:deleted",
// AUTOMATION
AUTOMATION_CREATED: "automation:created",
AUTOMATION_DELETED: "automation:deleted",
AUTOMATION_TESTED: "automation:tested",
// AUTOMATION_RUN: "automation:run",
AUTOMATION_STEP_CREATED: "automation:step:created",
AUTOMATION_STEP_DELETED: "automation:step:deleted",
AUTOMATION_TRIGGER_UPDATED: "automation:trigger:updated",
// LICENSE
LICENSE_UPGRADED: "license:upgraded",
LICENSE_DOWNGRADED: "license:downgraded",
LICENSE_UPDATED: "license:updated",
LICENSE_ACTIVATED: "license:activated",
LICENSE_QUOTA_EXCEEDED: "license:quota:exceeded",
// ACCOUNT
ACCOUNT_CREATED: "account:created",
ACCOUNT_DELETED: "account:deleted",
ACCOUNT_VERIFIED: "account:verified",
}

View File

@ -1,5 +1,5 @@
const { getTenantId } = require("../context") import { getTenantId } from "../context"
const analytics = require("../analytics") import { captureEvent } from "../analytics"
const logEvent = messsage => { const logEvent = messsage => {
const tenantId = getTenantId() const tenantId = getTenantId()
@ -7,10 +7,10 @@ const logEvent = messsage => {
console.log(`[audit] [tenant=${tenantId}] [user=${userId}] ${messsage}`) console.log(`[audit] [tenant=${tenantId}] [user=${userId}] ${messsage}`)
} }
exports.processEvent = (event, properties) => { export const processEvent = (event, properties) => {
// logging // logging
logEvent(event) logEvent(event)
// analytics // analytics
analytics.captureEvent(event, properties) captureEvent(event, properties)
} }

View File

@ -1,17 +0,0 @@
const events = require("../events")
const { Events } = require("../constants")
exports.created = () => {
const properties = {}
events.processEvent(Events.ACCOUNT_CREATED, properties)
}
exports.deleted = () => {
const properties = {}
events.processEvent(Events.ACCOUNT_DELETED, properties)
}
exports.verified = () => {
const properties = {}
events.processEvent(Events.ACCOUNT_VERIFIED, properties)
}

View File

@ -0,0 +1,17 @@
import { processEvent } from "../events"
import { Events, Account } from "@budibase/types"
export function created(account: Account) {
const properties = {}
processEvent(Events.ACCOUNT_CREATED, properties)
}
export function deleted(account: Account) {
const properties = {}
processEvent(Events.ACCOUNT_DELETED, properties)
}
export function verified(account: Account) {
const properties = {}
processEvent(Events.ACCOUNT_VERIFIED, properties)
}

View File

@ -1,59 +0,0 @@
const events = require("../events")
const { Events } = require("../constants")
exports.created = () => {
const properties = {}
events.processEvent(Events.APP_CREATED, properties)
}
exports.updated = () => {
const properties = {}
events.processEvent(Events.APP_UPDATED, properties)
}
exports.deleted = () => {
const properties = {}
events.processEvent(Events.APP_DELETED, properties)
}
exports.published = () => {
const properties = {}
events.processEvent(Events.APP_PUBLISHED, properties)
}
exports.unpublished = () => {
const properties = {}
events.processEvent(Events.APP_UNPUBLISHED, properties)
}
exports.fileImported = () => {
const properties = {}
events.processEvent(Events.APP_FILE_IMPORTED, properties)
}
exports.templateImported = templateKey => {
const properties = {
templateKey,
}
events.processEvent(Events.APP_TEMPLATE_IMPORTED, properties)
}
exports.versionUpdated = () => {
const properties = {}
events.processEvent(Events.APP_VERSION_UPDATED, properties)
}
exports.versionReverted = () => {
const properties = {}
events.processEvent(Events.APP_VERSION_REVERTED, properties)
}
exports.reverted = () => {
const properties = {}
events.processEvent(Events.APP_REVERTED, properties)
}
exports.exported = () => {
const properties = {}
events.processEvent(Events.APP_EXPORTED, properties)
}

View File

@ -0,0 +1,73 @@
import { processEvent } from "../events"
import {
Events,
App,
AppCreatedEvent,
AppUpdatedEvent,
AppDeletedEvent,
AppPublishedEvent,
AppUnpublishedEvent,
AppFileImportedEvent,
AppTemplateImportedEvent,
AppVersionUpdatedEvent,
AppVersionRevertedEvent,
AppRevertedEvent,
AppExportedEvent,
} from "@budibase/types"
export function created(app: App) {
const properties: AppCreatedEvent = {}
processEvent(Events.APP_CREATED, properties)
}
export function updated(app: App) {
const properties: AppUpdatedEvent = {}
processEvent(Events.APP_UPDATED, properties)
}
export function deleted(app: App) {
const properties: AppDeletedEvent = {}
processEvent(Events.APP_DELETED, properties)
}
export function published(app: App) {
const properties: AppPublishedEvent = {}
processEvent(Events.APP_PUBLISHED, properties)
}
export function unpublished(app: App) {
const properties: AppUnpublishedEvent = {}
processEvent(Events.APP_UNPUBLISHED, properties)
}
export function fileImported(app: App) {
const properties: AppFileImportedEvent = {}
processEvent(Events.APP_FILE_IMPORTED, properties)
}
export function templateImported(templateKey: string) {
const properties: AppTemplateImportedEvent = {
templateKey,
}
processEvent(Events.APP_TEMPLATE_IMPORTED, properties)
}
export function versionUpdated(app: App) {
const properties: AppVersionUpdatedEvent = {}
processEvent(Events.APP_VERSION_UPDATED, properties)
}
export function versionReverted(app: App) {
const properties: AppVersionRevertedEvent = {}
processEvent(Events.APP_VERSION_REVERTED, properties)
}
export function reverted(app: App) {
const properties: AppRevertedEvent = {}
processEvent(Events.APP_REVERTED, properties)
}
export function exported(app: App) {
const properties: AppExportedEvent = {}
processEvent(Events.APP_EXPORTED, properties)
}

View File

@ -1,42 +0,0 @@
const events = require("../events")
const { Events } = require("../constants")
exports.login = source => {
const properties = {
source,
}
events.processEvent(Events.AUTH_LOGIN, properties)
}
exports.logout = () => {
const properties = {}
events.processEvent(Events.AUTH_LOGOUT, properties)
}
exports.SSOCreated = type => {
const properties = {
type,
}
events.processEvent(Events.AUTH_SSO_CREATED, properties)
}
exports.SSOUpdated = type => {
const properties = {
type,
}
events.processEvent(Events.AUTH_SSO_UPDATED, properties)
}
exports.SSOActivated = type => {
const properties = {
type,
}
events.processEvent(Events.AUTH_SSO_ACTIVATED, properties)
}
exports.SSODeactivated = type => {
const properties = {
type,
}
events.processEvent(Events.AUTH_SSO_DEACTIVATED, properties)
}

View File

@ -0,0 +1,52 @@
import { processEvent } from "../events"
import {
Events,
LoginEvent,
LoginSource,
LogoutEvent,
SSOActivatedEvent,
SSOCreatedEvent,
SSODeactivatedEvent,
SSOType,
SSOUpdatedEvent,
} from "@budibase/types"
export function login(source: LoginSource) {
const properties: LoginEvent = {
source,
}
processEvent(Events.AUTH_LOGIN, properties)
}
export function logout() {
const properties: LogoutEvent = {}
processEvent(Events.AUTH_LOGOUT, properties)
}
export function SSOCreated(type: SSOType) {
const properties: SSOCreatedEvent = {
type,
}
processEvent(Events.AUTH_SSO_CREATED, properties)
}
export function SSOUpdated(type: SSOType) {
const properties: SSOUpdatedEvent = {
type,
}
processEvent(Events.AUTH_SSO_UPDATED, properties)
}
export function SSOActivated(type: SSOType) {
const properties: SSOActivatedEvent = {
type,
}
processEvent(Events.AUTH_SSO_ACTIVATED, properties)
}
export function SSODeactivated(type: SSOType) {
const properties: SSODeactivatedEvent = {
type,
}
processEvent(Events.AUTH_SSO_DEACTIVATED, properties)
}

View File

@ -1,38 +0,0 @@
const events = require("../events")
const { Events } = require("../constants")
exports.created = () => {
const properties = {}
events.processEvent(Events.AUTOMATION_CREATED, properties)
}
exports.deleted = () => {
const properties = {}
events.processEvent(Events.AUTOMATION_DELETED, properties)
}
exports.tested = () => {
const properties = {}
events.processEvent(Events.AUTOMATION_TESTED, properties)
}
// TODO
// exports.run = () => {
// const properties = {}
// events.processEvent(Events.AUTOMATION_RUN, properties)
// }
exports.stepCreated = () => {
const properties = {}
events.processEvent(Events.AUTOMATION_STEP_CREATED, properties)
}
exports.stepDeleted = () => {
const properties = {}
events.processEvent(Events.AUTOMATION_STEP_DELETED, properties)
}
exports.triggerUpdated = () => {
const properties = {}
events.processEvent(Events.AUTOMATION_TRIGGER_UPDATED, properties)
}

View File

@ -0,0 +1,52 @@
import { processEvent } from "../events"
import {
Automation,
Events,
AutomationStep,
AutomationTrigger,
AutomationCreatedEvent,
AutomationDeletedEvent,
AutomationTestedEvent,
AutomationStepCreatedEvent,
AutomationStepDeletedEvent,
AutomationTriggerUpdatedEvent,
} from "@budibase/types"
export function created(automation: Automation) {
const properties: AutomationCreatedEvent = {}
processEvent(Events.AUTOMATION_CREATED, properties)
}
export function deleted(automation: Automation) {
const properties: AutomationDeletedEvent = {}
processEvent(Events.AUTOMATION_DELETED, properties)
}
export function tested(automation: Automation) {
const properties: AutomationTestedEvent = {}
processEvent(Events.AUTOMATION_TESTED, properties)
}
// TODO
// exports.run = () => {
// const properties = {}
// events.processEvent(Events.AUTOMATION_RUN, properties)
// }
export function stepCreated(automation: Automation, step: AutomationStep) {
const properties: AutomationStepCreatedEvent = {}
processEvent(Events.AUTOMATION_STEP_CREATED, properties)
}
export function stepDeleted(automation: Automation, step: AutomationStep) {
const properties: AutomationStepDeletedEvent = {}
processEvent(Events.AUTOMATION_STEP_DELETED, properties)
}
export function triggerUpdated(
automation: Automation,
trigger: AutomationTrigger
) {
const properties: AutomationTriggerUpdatedEvent = {}
processEvent(Events.AUTOMATION_TRIGGER_UPDATED, properties)
}

View File

@ -1,17 +0,0 @@
const events = require("../events")
const { Events } = require("../constants")
exports.created = () => {
const properties = {}
events.processEvent(Events.DATASOURCE_CREATED, properties)
}
exports.updated = () => {
const properties = {}
events.processEvent(Events.DATASOURCE_UPDATED, properties)
}
exports.deleted = () => {
const properties = {}
events.processEvent(Events.DATASOURCE_DELETED, properties)
}

View File

@ -0,0 +1,23 @@
import { processEvent } from "../events"
import {
Events,
Datasource,
DatasourceCreatedEvent,
DatasourceUpdatedEvent,
DatasourceDeletedEvent,
} from "@budibase/types"
export function created(datasource: Datasource) {
const properties: DatasourceCreatedEvent = {}
processEvent(Events.DATASOURCE_CREATED, properties)
}
export function updated(datasource: Datasource) {
const properties: DatasourceUpdatedEvent = {}
processEvent(Events.DATASOURCE_UPDATED, properties)
}
export function deleted(datasource: Datasource) {
const properties: DatasourceDeletedEvent = {}
processEvent(Events.DATASOURCE_DELETED, properties)
}

View File

@ -1,12 +0,0 @@
const events = require("../events")
const { Events } = require("../constants")
exports.SMTPCreated = () => {
const properties = {}
events.processEvent(Events.EMAIL_SMTP_CREATED, properties)
}
exports.SMTPUpdated = () => {
const properties = {}
events.processEvent(Events.EMAIL_SMTP_UPDATED, properties)
}

View File

@ -0,0 +1,17 @@
import { processEvent } from "../events"
import {
Events,
SMTPConfig,
SMTPCreatedEvent,
SMTPUpdatedEvent,
} from "@budibase/types"
export function SMTPCreated(config: SMTPConfig) {
const properties: SMTPCreatedEvent = {}
processEvent(Events.EMAIL_SMTP_CREATED, properties)
}
export function SMTPUpdated(config: SMTPConfig) {
const properties: SMTPUpdatedEvent = {}
processEvent(Events.EMAIL_SMTP_UPDATED, properties)
}

View File

@ -1,37 +0,0 @@
const account = require("./account")
const app = require("./app")
const auth = require("./auth")
const automation = require("./automation")
const datasource = require("./datasource")
const email = require("./email")
const license = require("./license")
const layout = require("./layout")
const org = require("./org")
const query = require("./query")
const role = require("./role")
const screen = require("./screen")
const row = require("./row")
const table = require("./table")
const serve = require("./serve")
const user = require("./user")
const view = require("./view")
module.exports = {
account,
app,
auth,
automation,
datasource,
email,
license,
layout,
org,
query,
role,
screen,
row,
table,
serve,
user,
view,
}

View File

@ -0,0 +1,17 @@
export * as account from "./account"
export * as app from "./app"
export * as auth from "./auth"
export * as automation from "./automation"
export * as datasource from "./datasource"
export * as email from "./email"
export * as license from "./license"
export * as layout from "./layout"
export * as org from "./org"
export * as query from "./query"
export * as role from "./role"
export * as screen from "./screen"
export * as row from "./row"
export * as table from "./table"
export * as serve from "./serve"
export * as user from "./user"
export * as view from "./view"

View File

@ -1,12 +0,0 @@
const events = require("../events")
const { Events } = require("../constants")
exports.created = () => {
const properties = {}
events.processEvent(Events.LAYOUT_CREATED, properties)
}
exports.deleted = () => {
const properties = {}
events.processEvent(Events.LAYOUT_DELETED, properties)
}

View File

@ -0,0 +1,17 @@
import { processEvent } from "../events"
import {
Events,
Layout,
LayoutCreatedEvent,
LayoutDeletedEvent,
} from "@budibase/types"
export function created(layout: Layout) {
const properties: LayoutCreatedEvent = {}
processEvent(Events.LAYOUT_CREATED, properties)
}
export function deleted(layout: Layout) {
const properties: LayoutDeletedEvent = {}
processEvent(Events.LAYOUT_DELETED, properties)
}

View File

@ -1,35 +0,0 @@
const events = require("../events")
const { Events } = require("../constants")
// TODO
exports.updgraded = () => {
const properties = {}
events.processEvent(Events.LICENSE_UPGRADED, properties)
}
// TODO
exports.downgraded = () => {
const properties = {}
events.processEvent(Events.LICENSE_DOWNGRADED, properties)
}
// TODO
exports.updated = () => {
const properties = {}
events.processEvent(Events.LICENSE_UPDATED, properties)
}
// TODO
exports.activated = () => {
const properties = {}
events.processEvent(Events.LICENSE_ACTIVATED, properties)
}
// TODO
exports.quotaExceeded = (quotaName, value) => {
const properties = {
name: quotaName,
value,
}
events.processEvent(Events.LICENSE_QUOTA_EXCEEDED, properties)
}

View File

@ -0,0 +1,43 @@
import { processEvent } from "../events"
import {
Events,
License,
LicenseActivatedEvent,
LicenseDowngradedEvent,
LicenseQuotaExceededEvent,
LicenseUpdatedEvent,
LicenseUpgradedEvent,
} from "@budibase/types"
// TODO
export function updgraded(license: License) {
const properties: LicenseUpgradedEvent = {}
processEvent(Events.LICENSE_UPGRADED, properties)
}
// TODO
export function downgraded(license: License) {
const properties: LicenseDowngradedEvent = {}
processEvent(Events.LICENSE_DOWNGRADED, properties)
}
// TODO
export function updated(license: License) {
const properties: LicenseUpdatedEvent = {}
processEvent(Events.LICENSE_UPDATED, properties)
}
// TODO
export function activated(license: License) {
const properties: LicenseActivatedEvent = {}
processEvent(Events.LICENSE_ACTIVATED, properties)
}
// TODO
export function quotaExceeded(quotaName: string, value: number) {
const properties: LicenseQuotaExceededEvent = {
name: quotaName,
value,
}
processEvent(Events.LICENSE_QUOTA_EXCEEDED, properties)
}

View File

@ -1,30 +0,0 @@
const events = require("../events")
const { Events } = require("../constants")
exports.nameUpdated = () => {
const properties = {}
events.processEvent(Events.ORG_NAME_UPDATED, properties)
}
exports.logoUpdated = () => {
const properties = {}
events.processEvent(Events.ORG_LOGO_UPDATED, properties)
}
exports.platformURLUpdated = () => {
const properties = {}
events.processEvent(Events.ORG_PLATFORM_URL_UPDATED, properties)
}
exports.versionChecked = version => {
const properties = {
version,
}
events.processEvent(Events.UPDATE_VERSION_CHECKED, properties)
}
// TODO
exports.analyticsOptOut = () => {
const properties = {}
events.processEvent(Events.ANALYTICS_OPT_OUT, properties)
}

View File

@ -0,0 +1,30 @@
import { processEvent } from "../events"
import { Events, VersionCheckedEvent } from "@budibase/types"
export function nameUpdated() {
const properties = {}
processEvent(Events.ORG_NAME_UPDATED, properties)
}
export function logoUpdated() {
const properties = {}
processEvent(Events.ORG_LOGO_UPDATED, properties)
}
export function platformURLUpdated() {
const properties = {}
processEvent(Events.ORG_PLATFORM_URL_UPDATED, properties)
}
export function versionChecked(version: number) {
const properties: VersionCheckedEvent = {
version,
}
processEvent(Events.UPDATE_VERSION_CHECKED, properties)
}
// TODO
export function analyticsOptOut() {
const properties = {}
processEvent(Events.ANALYTICS_OPT_OUT, properties)
}

View File

@ -1,35 +0,0 @@
const events = require("../events")
const { Events } = require("../constants")
/* eslint-disable */
exports.created = (datasource, query) => {
const properties = {}
events.processEvent(Events.QUERY_CREATED, properties)
}
exports.updated = (datasource, query) => {
const properties = {}
events.processEvent(Events.QUERY_UPDATED, properties)
}
exports.deleted = (datasource, query) => {
const properties = {}
events.processEvent(Events.QUERY_DELETED, properties)
}
exports.import = (datasource, importSource, count) => {
const properties = {}
events.processEvent(Events.QUERY_IMPORT, properties)
}
// TODO
// exports.run = () => {
// const properties = {}
// events.processEvent(Events.QUERY_RUN, properties)
// }
exports.previewed = datasource => {
const properties = {}
events.processEvent(Events.QUERY_PREVIEWED, properties)
}

View File

@ -0,0 +1,48 @@
import { processEvent } from "../events"
import {
Events,
Datasource,
Query,
QueryCreatedEvent,
QueryUpdatedEvent,
QueryDeletedEvent,
QueryImportedEvent,
QueryPreviewedEvent,
} from "@budibase/types"
/* eslint-disable */
export const created = (datasource: Datasource, query: Query) => {
const properties: QueryCreatedEvent = {}
processEvent(Events.QUERY_CREATED, properties)
}
export const updated = (datasource: Datasource, query: Query) => {
const properties: QueryUpdatedEvent = {}
processEvent(Events.QUERY_UPDATED, properties)
}
export const deleted = (datasource: Datasource, query: Query) => {
const properties: QueryDeletedEvent = {}
processEvent(Events.QUERY_DELETED, properties)
}
export const imported = (
datasource: Datasource,
importSource: any,
count: any
) => {
const properties: QueryImportedEvent = {}
processEvent(Events.QUERY_IMPORT, properties)
}
// TODO
// exports.run = () => {
// const properties = {}
// events.processEvent(Events.QUERY_RUN, properties)
// }
export const previewed = (datasource: Datasource) => {
const properties: QueryPreviewedEvent = {}
processEvent(Events.QUERY_PREVIEWED, properties)
}

View File

@ -1,29 +0,0 @@
const events = require("../events")
const { Events } = require("../constants")
/* eslint-disable */
exports.created = role => {
const properties = {}
events.processEvent(Events.ROLE_CREATED, properties)
}
exports.updated = role => {
const properties = {}
events.processEvent(Events.ROLE_UPDATED, properties)
}
exports.deleted = role => {
const properties = {}
events.processEvent(Events.ROLE_DELETED, properties)
}
exports.assigned = (user, role) => {
const properties = {}
events.processEvent(Events.ROLE_ASSIGNED, properties)
}
exports.unassigned = (user, role) => {
const properties = {}
events.processEvent(Events.ROLE_UNASSIGNED, properties)
}

View File

@ -0,0 +1,38 @@
import { processEvent } from "../events"
import {
Events,
Role,
RoleAssignedEvent,
RoleCreatedEvent,
RoleDeletedEvent,
RoleUnassignedEvent,
RoleUpdatedEvent,
User,
} from "@budibase/types"
/* eslint-disable */
export function created(role: Role) {
const properties: RoleCreatedEvent = {}
processEvent(Events.ROLE_CREATED, properties)
}
export function updated(role: Role) {
const properties: RoleUpdatedEvent = {}
processEvent(Events.ROLE_UPDATED, properties)
}
export function deleted(role: Role) {
const properties: RoleDeletedEvent = {}
processEvent(Events.ROLE_DELETED, properties)
}
export function assigned(user: User, role: Role) {
const properties: RoleAssignedEvent = {}
processEvent(Events.ROLE_ASSIGNED, properties)
}
export function unassigned(user: User, role: Role) {
const properties: RoleUnassignedEvent = {}
processEvent(Events.ROLE_UNASSIGNED, properties)
}

View File

@ -1,14 +0,0 @@
const events = require("../events")
const { Events } = require("../constants")
/* eslint-disable */
// exports.created = () => {
// const properties = {}
// events.processEvent(Events.ROW_CREATED, properties)
// }
exports.import = (table, format, count) => {
const properties = {}
events.processEvent(Events.ROW_IMPORT, properties)
}

View File

@ -0,0 +1,23 @@
import { processEvent } from "../events"
import {
Events,
RowImportedEvent,
RowImportFormat,
Table,
} from "@budibase/types"
/* eslint-disable */
// exports.created = () => {
// const properties = {}
// events.processEvent(Events.ROW_CREATED, properties)
// }
export const imported = (
table: Table,
format: RowImportFormat,
count: number
) => {
const properties: RowImportedEvent = {}
processEvent(Events.ROW_IMPORT, properties)
}

View File

@ -1,12 +0,0 @@
const events = require("../events")
const { Events } = require("../constants")
exports.created = () => {
const properties = {}
events.processEvent(Events.SCREEN_CREATED, properties)
}
exports.deleted = () => {
const properties = {}
events.processEvent(Events.SCREEN_DELETED, properties)
}

View File

@ -0,0 +1,17 @@
import { processEvent } from "../events"
import {
Events,
Screen,
ScreenCreatedEvent,
ScreenDeletedEvent,
} from "@budibase/types"
export function created(screen: Screen) {
const properties: ScreenCreatedEvent = {}
processEvent(Events.SCREEN_CREATED, properties)
}
export function deleted(screen: Screen) {
const properties: ScreenDeletedEvent = {}
processEvent(Events.SCREEN_DELETED, properties)
}

View File

@ -1,19 +0,0 @@
const events = require("../events")
const { Events } = require("../constants")
/* eslint-disable */
exports.servedBuilder = version => {
const properties = {}
events.processEvent(Events.SERVED_BUILDER, properties)
}
exports.servedApp = appMetadata => {
const properties = {}
events.processEvent(Events.SERVED_APP, properties)
}
exports.servedAppPreview = appMetadata => {
const properties = {}
events.processEvent(Events.SERVED_APP_PREVIEW, properties)
}

View File

@ -0,0 +1,25 @@
import { AppServedEvent } from "./../../../../types/src/events/serve"
import { processEvent } from "../events"
import {
App,
BuilderServedEvent,
Events,
AppPreviewServedEvent,
} from "@budibase/types"
/* eslint-disable */
export function servedBuilder(version: number) {
const properties: BuilderServedEvent = {}
processEvent(Events.SERVED_BUILDER, properties)
}
export function servedApp(app: App) {
const properties: AppServedEvent = {}
processEvent(Events.SERVED_APP, properties)
}
export function servedAppPreview(app: App) {
const properties: AppPreviewServedEvent = {}
processEvent(Events.SERVED_APP_PREVIEW, properties)
}

View File

@ -1,35 +0,0 @@
const events = require("../events")
const { Events } = require("../constants")
/* eslint-disable */
exports.created = table => {
const properties = {}
events.processEvent(Events.TABLE_CREATED, properties)
}
exports.updated = table => {
const properties = {}
events.processEvent(Events.TABLE_UPDATED, properties)
}
exports.deleted = table => {
const properties = {}
events.processEvent(Events.TABLE_DELETED, properties)
}
exports.exported = (table, format) => {
const properties = {}
events.processEvent(Events.TABLE_EXPORTED, properties)
}
exports.imported = (table, format) => {
const properties = {}
events.processEvent(Events.TABLE_IMPORTED, properties)
}
// TODO
exports.permissionUpdated = () => {
const properties = {}
events.processEvent(Events.TABLE_PERMISSION_UPDATED, properties)
}

View File

@ -0,0 +1,45 @@
import { processEvent } from "../events"
import {
Events,
TableExportFormat,
TableImportFormat,
Table,
TableCreatedEvent,
TableUpdatedEvent,
TableDeletedEvent,
TableExportedEvent,
TableImportedEvent,
} from "@budibase/types"
/* eslint-disable */
export function created(table: Table) {
const properties: TableCreatedEvent = {}
processEvent(Events.TABLE_CREATED, properties)
}
export function updated(table: Table) {
const properties: TableUpdatedEvent = {}
processEvent(Events.TABLE_UPDATED, properties)
}
export function deleted(table: Table) {
const properties: TableDeletedEvent = {}
processEvent(Events.TABLE_DELETED, properties)
}
export function exported(table: Table, format: TableExportFormat) {
const properties: TableExportedEvent = {}
processEvent(Events.TABLE_EXPORTED, properties)
}
export function imported(table: Table, format: TableImportFormat) {
const properties: TableImportedEvent = {}
processEvent(Events.TABLE_IMPORTED, properties)
}
// TODO
export function permissionUpdated() {
const properties = {}
processEvent(Events.TABLE_PERMISSION_UPDATED, properties)
}

View File

@ -1,75 +0,0 @@
const events = require("../events")
const { Events } = require("../constants")
/* eslint-disable */
exports.created = user => {
const properties = {}
events.processEvent(Events.USER_CREATED, properties)
}
exports.updated = user => {
const properties = {}
events.processEvent(Events.USER_UPDATED, properties)
}
exports.deleted = user => {
const properties = {}
events.processEvent(Events.USER_DELETED, properties)
}
// PERMISSIONS
exports.permissionAdminAssigned = user => {
const properties = {}
events.processEvent(Events.USER_PERMISSION_ADMIN_ASSIGNED, properties)
}
exports.permissionAdminRemoved = user => {
const properties = {}
events.processEvent(Events.USER_PERMISSION_ADMIN_REMOVED, properties)
}
exports.permissionBuilderAssigned = user => {
const properties = {}
events.processEvent(Events.USER_PERMISSION_BUILDER_ASSIGNED, properties)
}
exports.permissionBuilderRemoved = user => {
const properties = {}
events.processEvent(Events.USER_PERMISSION_BUILDER_REMOVED, properties)
}
// INVITE
exports.invited = userInfo => {
const properties = {}
events.processEvent(Events.USER_INVITED, properties)
}
exports.inviteAccepted = user => {
const properties = {}
events.processEvent(Events.USER_INVITED_ACCEPTED, properties)
}
// PASSWORD
exports.passwordForceReset = user => {
const properties = {}
events.processEvent(Events.USER_PASSWORD_FORCE_RESET, properties)
}
exports.passwordUpdated = user => {
const properties = {}
events.processEvent(Events.USER_PASSWORD_UPDATED, properties)
}
exports.passwordResetRequested = user => {
const properties = {}
events.processEvent(Events.USER_PASSWORD_RESET_REQUESTED, properties)
}
exports.passwordReset = user => {
const properties = {}
events.processEvent(Events.USER_PASSWORD_RESET, properties)
}

View File

@ -0,0 +1,89 @@
import { processEvent } from "../events"
import {
Events,
User,
UserCreatedEvent,
UserDeletedEvent,
UserInviteAcceptedEvent,
UserInvitedEvent,
UserPasswordForceResetEvent,
UserPasswordResetEvent,
UserPasswordResetRequestedEvent,
UserPasswordUpdatedEvent,
UserPermissionAssignedEvent,
UserPermissionRemovedEvent,
UserUpdatedEvent,
} from "@budibase/types"
/* eslint-disable */
export function created(user: User) {
const properties: UserCreatedEvent = {}
processEvent(Events.USER_CREATED, properties)
}
export function updated(user: User) {
const properties: UserUpdatedEvent = {}
processEvent(Events.USER_UPDATED, properties)
}
export function deleted(user: User) {
const properties: UserDeletedEvent = {}
processEvent(Events.USER_DELETED, properties)
}
// PERMISSIONS
export function permissionAdminAssigned(user: User) {
const properties: UserPermissionAssignedEvent = {}
processEvent(Events.USER_PERMISSION_ADMIN_ASSIGNED, properties)
}
export function permissionAdminRemoved(user: User) {
const properties: UserPermissionRemovedEvent = {}
processEvent(Events.USER_PERMISSION_ADMIN_REMOVED, properties)
}
export function permissionBuilderAssigned(user: User) {
const properties: UserPermissionAssignedEvent = {}
processEvent(Events.USER_PERMISSION_BUILDER_ASSIGNED, properties)
}
export function permissionBuilderRemoved(user: User) {
const properties: UserPermissionRemovedEvent = {}
processEvent(Events.USER_PERMISSION_BUILDER_REMOVED, properties)
}
// INVITE
export function invited(userInfo: any) {
const properties: UserInvitedEvent = {}
processEvent(Events.USER_INVITED, properties)
}
export function inviteAccepted(user: User) {
const properties: UserInviteAcceptedEvent = {}
processEvent(Events.USER_INVITED_ACCEPTED, properties)
}
// PASSWORD
export function passwordForceReset(user: User) {
const properties: UserPasswordForceResetEvent = {}
processEvent(Events.USER_PASSWORD_FORCE_RESET, properties)
}
export function passwordUpdated(user: User) {
const properties: UserPasswordUpdatedEvent = {}
processEvent(Events.USER_PASSWORD_UPDATED, properties)
}
export function passwordResetRequested(user: User) {
const properties: UserPasswordResetRequestedEvent = {}
processEvent(Events.USER_PASSWORD_RESET_REQUESTED, properties)
}
export function passwordReset(user: User) {
const properties: UserPasswordResetEvent = {}
processEvent(Events.USER_PASSWORD_RESET, properties)
}

View File

@ -1,54 +0,0 @@
const events = require("../events")
const { Events } = require("../constants")
/* eslint-disable */
exports.created = () => {
const properties = {}
events.processEvent(Events.VIEW_CREATED, properties)
}
exports.updated = () => {
const properties = {}
events.processEvent(Events.VIEW_UPDATED, properties)
}
exports.deleted = () => {
const properties = {}
events.processEvent(Events.VIEW_DELETED, properties)
}
exports.exported = (table, format) => {
const properties = {}
events.processEvent(Events.VIEW_EXPORTED, properties)
}
exports.filterCreated = () => {
const properties = {}
events.processEvent(Events.VIEW_FILTER_CREATED, properties)
}
exports.filterUpdated = () => {
const properties = {}
events.processEvent(Events.VIEW_FILTER_UPDATED, properties)
}
exports.filterDeleted = () => {
const properties = {}
events.processEvent(Events.VIEW_FILTER_DELETED, properties)
}
exports.calculationCreated = () => {
const properties = {}
events.processEvent(Events.VIEW_CALCULATION_CREATED, properties)
}
exports.calculationUpdated = () => {
const properties = {}
events.processEvent(Events.VIEW_CALCULATION_UPDATED, properties)
}
exports.calculationDeleted = () => {
const properties = {}
events.processEvent(Events.VIEW_CALCULATION_DELETED, properties)
}

View File

@ -0,0 +1,66 @@
import { processEvent } from "../events"
import {
Events,
ViewCalculationCreatedEvent,
ViewCalculationDeletedEvent,
ViewCalculationUpdatedEvent,
ViewCreatedEvent,
ViewDeletedEvent,
ViewExportedEvent,
ViewFilterCreatedEvent,
ViewFilterDeletedEvent,
ViewFilterUpdatedEvent,
ViewUpdatedEvent,
} from "@budibase/types"
/* eslint-disable */
export function created(view: View) {
const properties: ViewCreatedEvent = {}
processEvent(Events.VIEW_CREATED, properties)
}
export function updated(view: View) {
const properties: ViewUpdatedEvent = {}
processEvent(Events.VIEW_UPDATED, properties)
}
export function deleted() {
const properties: ViewDeletedEvent = {}
processEvent(Events.VIEW_DELETED, properties)
}
export function exported(table, format) {
const properties: ViewExportedEvent = {}
processEvent(Events.VIEW_EXPORTED, properties)
}
export function filterCreated() {
const properties: ViewFilterCreatedEvent = {}
processEvent(Events.VIEW_FILTER_CREATED, properties)
}
export function filterUpdated() {
const properties: ViewFilterUpdatedEvent = {}
processEvent(Events.VIEW_FILTER_UPDATED, properties)
}
export function filterDeleted() {
const properties: ViewFilterDeletedEvent = {}
processEvent(Events.VIEW_FILTER_DELETED, properties)
}
export function calculationCreated() {
const properties: ViewCalculationCreatedEvent = {}
processEvent(Events.VIEW_CALCULATION_CREATED, properties)
}
export function calculationUpdated() {
const properties: ViewCalculationUpdatedEvent = {}
processEvent(Events.VIEW_CALCULATION_UPDATED, properties)
}
export function calculationDeleted() {
const properties: ViewCalculationDeletedEvent = {}
processEvent(Events.VIEW_CALCULATION_DELETED, properties)
}

View File

@ -1,5 +1 @@
const handlers = require("./handlers") export * from "./handlers"
module.exports = {
...handlers,
}

View File

@ -1,5 +1,6 @@
const db = require("./db") const db = require("./db")
const errors = require("./errors") const errors = require("./errors")
import * as events from "./events"
module.exports = { module.exports = {
init(opts = {}) { init(opts = {}) {
@ -23,7 +24,7 @@ module.exports = {
accounts: require("./cloud/accounts"), accounts: require("./cloud/accounts"),
tenancy: require("./tenancy"), tenancy: require("./tenancy"),
featureFlags: require("./featureFlags"), featureFlags: require("./featureFlags"),
events: require("./events"), events,
analytics: require("./analytics"), analytics: require("./analytics"),
sessions: require("./security/sessions"), sessions: require("./security/sessions"),
deprovisioning: require("./context/deprovision"), deprovisioning: require("./context/deprovision"),

3
packages/types/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
node_modules/
dist
coverage/

View File

@ -0,0 +1,18 @@
{
"name": "@budibase/types",
"version": "1.0.126-alpha.0",
"description": "Budibase types",
"main": "src/index.ts",
"types": "src/index.ts",
"author": "Budibase",
"license": "GPL-3.0",
"scripts": {
"build": "rimraf dist/ && tsc -p tsconfig.json"
},
"jest": {
},
"devDependencies": {
"@types/node": "^15.12.4",
"typescript": "^4.5.5"
}
}

View File

View File

View File

@ -0,0 +1 @@
export interface Account {}

View File

@ -0,0 +1 @@
export * from "./account"

View File

@ -0,0 +1 @@
export interface App {}

View File

@ -0,0 +1,5 @@
export interface Automation {}
export interface AutomationStep {}
export interface AutomationTrigger {}

View File

@ -0,0 +1 @@
export interface Datasource {}

View File

@ -0,0 +1,9 @@
export * from "./app"
export * from "./automation"
export * from "./datasource"
export * from "./layout"
export * from "./query"
export * from "./role"
export * from "./table"
export * from "./screen"
export * from "./view"

View File

@ -0,0 +1 @@
export interface Layout {}

View File

@ -0,0 +1 @@
export interface Query {}

View File

@ -0,0 +1 @@
export interface Role {}

View File

@ -0,0 +1 @@
export interface Screen {}

View File

@ -0,0 +1 @@
export interface Table {}

View File

@ -0,0 +1 @@
export interface View {}

View File

@ -0,0 +1 @@
export interface SMTPConfig {}

View File

@ -0,0 +1,2 @@
export * from "./config"
export * from "./user"

View File

@ -0,0 +1 @@
export interface User {}

View File

@ -0,0 +1,4 @@
export * from "./account"
export * from "./app"
export * from "./global"
export * from "./platform"

View File

@ -0,0 +1 @@
export * from "./info"

View File

@ -0,0 +1 @@
export interface GlobalInfo {}

View File

@ -0,0 +1,21 @@
export interface AppCreatedEvent {}
export interface AppUpdatedEvent {}
export interface AppDeletedEvent {}
export interface AppPublishedEvent {}
export interface AppUnpublishedEvent {}
export interface AppFileImportedEvent {}
export interface AppTemplateImportedEvent {}
export interface AppVersionUpdatedEvent {}
export interface AppVersionRevertedEvent {}
export interface AppRevertedEvent {}
export interface AppExportedEvent {}

View File

@ -0,0 +1,16 @@
export type LoginSource = "local" | "sso"
export type SSOType = "oidc" | "google"
export interface LoginEvent {
source: LoginSource
}
export interface LogoutEvent {}
export interface SSOCreatedEvent {}
export interface SSOUpdatedEvent {}
export interface SSOActivatedEvent {}
export interface SSODeactivatedEvent {}

View File

@ -0,0 +1,11 @@
export interface AutomationCreatedEvent {}
export interface AutomationDeletedEvent {}
export interface AutomationTestedEvent {}
export interface AutomationStepCreatedEvent {}
export interface AutomationStepDeletedEvent {}
export interface AutomationTriggerUpdatedEvent {}

View File

@ -0,0 +1,3 @@
export interface SMTPCreatedEvent {}
export interface SMTPUpdatedEvent {}

View File

@ -0,0 +1,5 @@
export interface DatasourceCreatedEvent {}
export interface DatasourceUpdatedEvent {}
export interface DatasourceDeletedEvent {}

View File

@ -0,0 +1,145 @@
export enum Events {
// USER
USER_CREATED = "user:created",
USER_UPDATED = "user:updated",
USER_DELETED = "user:deleted",
// USER / PERMISSIONS
USER_PERMISSION_ADMIN_ASSIGNED = "user:admin:assigned",
USER_PERMISSION_ADMIN_REMOVED = "user:admin:removed",
USER_PERMISSION_BUILDER_ASSIGNED = "user:builder:assigned",
USER_PERMISSION_BUILDER_REMOVED = "userbuilder:removed",
// USER / INVITE
USER_INVITED = "user:invited",
USER_INVITED_ACCEPTED = "user:invite:accepted",
// USER / PASSWORD
USER_PASSWORD_FORCE_RESET = "user:password:force:reset",
USER_PASSWORD_UPDATED = "user:password:updated",
USER_PASSWORD_RESET_REQUESTED = "user:password:reset:requested",
USER_PASSWORD_RESET = "user:password:reset",
// EMAIL
EMAIL_SMTP_CREATED = "email:smtp:created",
EMAIL_SMTP_UPDATED = "email:smtp:updated",
// AUTH
AUTH_SSO_CREATED = "auth:sso:created",
AUTH_SSO_UPDATED = "auth:sso:updated",
AUTH_SSO_ACTIVATED = "auth:sso:activated",
AUTH_SSO_DEACTIVATED = "auth:sso:deactivated",
AUTH_LOGIN = "auth:login",
AUTH_LOGOUT = "auth:logout",
// ORG
ORG_NAME_UPDATED = "org:info:name:updated",
ORG_LOGO_UPDATED = "org:info:logo:updated",
ORG_PLATFORM_URL_UPDATED = "org:platformurl:updated",
// ORG / UPDATE
UPDATE_VERSION_CHECKED = "version:checked",
// ORG / ANALYTICS
ANALYTICS_OPT_OUT = "analytics:opt:out",
// APP
APP_CREATED = "app:created",
APP_UPDATED = "app:updated",
APP_DELETED = "app:deleted",
APP_PUBLISHED = "app:published",
APP_UNPUBLISHED = "app:unpublished",
APP_TEMPLATE_IMPORTED = "app:template:imported",
APP_FILE_IMPORTED = "app:file:imported",
APP_VERSION_UPDATED = "app:version:updated",
APP_VERSION_REVERTED = "app:version:reverted",
APP_REVERTED = "app:reverted",
APP_EXPORTED = "app:exported",
// ROLE
ROLE_CREATED = "role:created",
ROLE_UPDATED = "role:updated",
ROLE_DELETED = "role:deleted",
ROLE_ASSIGNED = "role:assigned",
ROLE_UNASSIGNED = "role:unassigned",
// SERVE
SERVED_BUILDER = "served:builder",
SERVED_APP = "served:app",
SERVED_APP_PREVIEW = "served:app:preview",
// DATASOURCE
DATASOURCE_CREATED = "datasource:created",
DATASOURCE_UPDATED = "datasource:updated",
DATASOURCE_DELETED = "datasource:deleted",
// QUERY
QUERY_CREATED = "query:created",
QUERY_UPDATED = "query:updated",
QUERY_DELETED = "query:deleted",
QUERY_IMPORT = "query:import",
// QUERY_RUN = "query:run",
QUERY_PREVIEWED = "query:previewed",
// TABLE
TABLE_CREATED = "table:created",
TABLE_UPDATED = "table:updated",
TABLE_DELETED = "table:deleted",
TABLE_EXPORTED = "table:exported",
TABLE_IMPORTED = "table:imported",
TABLE_DATA_IMPORTED = "table:data:imported",
TABLE_PERMISSION_UPDATED = "table:permission:updated",
// VIEW
VIEW_CREATED = "view:created",
VIEW_UPDATED = "view:updated",
VIEW_DELETED = "view:deleted",
VIEW_EXPORTED = "view:exported",
VIEW_FILTER_CREATED = "view:filter:created",
VIEW_FILTER_UPDATED = "view:filter:updated",
VIEW_FILTER_DELETED = "view:filter:deleted",
VIEW_CALCULATION_CREATED = "view:calculation:created",
VIEW_CALCULATION_UPDATED = "view:calculation:updated",
VIEW_CALCULATION_DELETED = "view:calculation:deleted",
// ROW
// ROW_CREATED = "row:created",
ROW_IMPORT = "row:import",
// COMPONENT
COMPONENT_CREATED = "component:created",
COMPONENT_DELETED = "component:deleted",
// SCREEN
SCREEN_CREATED = "screen:created",
SCREEN_DELETED = "screen:deleted",
// LAYOUT
LAYOUT_CREATED = "layout:created",
LAYOUT_DELETED = "layout:deleted",
// AUTOMATION
AUTOMATION_CREATED = "automation:created",
AUTOMATION_DELETED = "automation:deleted",
AUTOMATION_TESTED = "automation:tested",
// AUTOMATION_RUN = "automation:run",
AUTOMATION_STEP_CREATED = "automation:step:created",
AUTOMATION_STEP_DELETED = "automation:step:deleted",
AUTOMATION_TRIGGER_UPDATED = "automation:trigger:updated",
// LICENSE
LICENSE_UPGRADED = "license:upgraded",
LICENSE_DOWNGRADED = "license:downgraded",
LICENSE_UPDATED = "license:updated",
LICENSE_ACTIVATED = "license:activated",
LICENSE_QUOTA_EXCEEDED = "license:quota:exceeded",
// ACCOUNT
ACCOUNT_CREATED = "account:created",
ACCOUNT_DELETED = "account:deleted",
ACCOUNT_VERIFIED = "account:verified",
}
export type RowImportFormat = "csv"
export type TableExportFormat = "json" | "csv"
export type TableImportFormat = "csv"

View File

@ -0,0 +1,17 @@
export * from "./app"
export * from "./auth"
export * from "./automation"
export * from "./config"
export * from "./datasource"
export * from "./events"
export * from "./layout"
export * from "./license"
export * from "./org"
export * from "./query"
export * from "./role"
export * from "./row"
export * from "./screen"
export * from "./serve"
export * from "./table"
export * from "./user"
export * from "./view"

View File

@ -0,0 +1,3 @@
export interface LayoutCreatedEvent {}
export interface LayoutDeletedEvent {}

View File

@ -0,0 +1,9 @@
export interface LicenseUpgradedEvent {}
export interface LicenseDowngradedEvent {}
export interface LicenseUpdatedEvent {}
export interface LicenseActivatedEvent {}
export interface LicenseQuotaExceededEvent {}

View File

@ -0,0 +1 @@
export interface VersionCheckedEvent {}

View File

@ -0,0 +1,9 @@
export interface QueryCreatedEvent {}
export interface QueryUpdatedEvent {}
export interface QueryDeletedEvent {}
export interface QueryImportedEvent {}
export interface QueryPreviewedEvent {}

View File

@ -0,0 +1,9 @@
export interface RoleCreatedEvent {}
export interface RoleUpdatedEvent {}
export interface RoleDeletedEvent {}
export interface RoleAssignedEvent {}
export interface RoleUnassignedEvent {}

View File

@ -0,0 +1 @@
export interface RowImportedEvent {}

View File

@ -0,0 +1,3 @@
export interface ScreenCreatedEvent {}
export interface ScreenDeletedEvent {}

View File

@ -0,0 +1,5 @@
export interface BuilderServedEvent {}
export interface AppServedEvent {}
export interface AppPreviewServedEvent {}

View File

@ -0,0 +1,9 @@
export interface TableCreatedEvent {}
export interface TableUpdatedEvent {}
export interface TableDeletedEvent {}
export interface TableExportedEvent {}
export interface TableImportedEvent {}

View File

@ -0,0 +1,21 @@
export interface UserCreatedEvent {}
export interface UserUpdatedEvent {}
export interface UserDeletedEvent {}
export interface UserPermissionAssignedEvent {}
export interface UserPermissionRemovedEvent {}
export interface UserInvitedEvent {}
export interface UserInviteAcceptedEvent {}
export interface UserPasswordForceResetEvent {}
export interface UserPasswordUpdatedEvent {}
export interface UserPasswordResetRequestedEvent {}
export interface UserPasswordResetEvent {}

View File

@ -0,0 +1,19 @@
export interface ViewCreatedEvent {}
export interface ViewUpdatedEvent {}
export interface ViewDeletedEvent {}
export interface ViewExportedEvent {}
export interface ViewFilterCreatedEvent {}
export interface ViewFilterUpdatedEvent {}
export interface ViewFilterDeletedEvent {}
export interface ViewCalculationCreatedEvent {}
export interface ViewCalculationUpdatedEvent {}
export interface ViewCalculationDeletedEvent {}

View File

@ -0,0 +1,3 @@
export * from "./documents"
export * from "./events"
export * from "./licensing"

View File

@ -0,0 +1 @@
export * from "./license"

View File

@ -0,0 +1 @@
export interface License {}

View File

@ -0,0 +1,17 @@
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"lib": ["es2020"],
"outDir": "dist",
"strict": true,
"noImplicitAny": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"incremental": true,
"types": [ "node"],
},
"include": [
"**/*.ts",
]
}

13
packages/types/yarn.lock Normal file
View File

@ -0,0 +1,13 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@types/node@^15.12.4":
version "15.14.9"
resolved "https://registry.yarnpkg.com/@types/node/-/node-15.14.9.tgz#bc43c990c3c9be7281868bbc7b8fdd6e2b57adfa"
integrity sha512-qjd88DrCxupx/kJD5yQgZdcYKZKSIGBVDIBE1/LTGcNm3d2Np/jxojkdePDdfnBHJc5W7vSMpbJ1aB7p/Py69A==
typescript@^4.5.5:
version "4.6.4"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.6.4.tgz#caa78bbc3a59e6a5c510d35703f6a09877ce45e9"
integrity sha512-9ia/jWHIEbo49HfjrLGfKbZSuWo9iTMwXO+Ca3pRsSpbsMbc7/IU8NKdCZVRRBafVPGnoJeFL76ZOAA84I9fEg==