Merge branch 'master' into typing/stores-grid-datasources

This commit is contained in:
Adria Navarro 2024-12-24 13:31:03 +01:00 committed by GitHub
commit b4d6ad9a2c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 602 additions and 458 deletions

View File

@ -94,6 +94,7 @@
"@sveltejs/vite-plugin-svelte": "1.4.0", "@sveltejs/vite-plugin-svelte": "1.4.0",
"@testing-library/jest-dom": "6.4.2", "@testing-library/jest-dom": "6.4.2",
"@testing-library/svelte": "^4.1.0", "@testing-library/svelte": "^4.1.0",
"@types/shortid": "^2.2.0",
"babel-jest": "^29.6.2", "babel-jest": "^29.6.2",
"identity-obj-proxy": "^3.0.0", "identity-obj-proxy": "^3.0.0",
"jest": "29.7.0", "jest": "29.7.0",

View File

@ -1507,7 +1507,12 @@ export const updateReferencesInObject = ({
// Migrate references // Migrate references
// Switch all bindings to reference their ids // Switch all bindings to reference their ids
export const migrateReferencesInObject = ({ obj, label = "steps", steps }) => { export const migrateReferencesInObject = ({
obj,
label = "steps",
steps,
originalIndex,
}) => {
const stepIndexRegex = new RegExp(`{{\\s*${label}\\.(\\d+)\\.`, "g") const stepIndexRegex = new RegExp(`{{\\s*${label}\\.(\\d+)\\.`, "g")
const updateActionStep = (str, index, replaceWith) => const updateActionStep = (str, index, replaceWith) =>
str.replace(`{{ ${label}.${index}.`, `{{ ${label}.${replaceWith}.`) str.replace(`{{ ${label}.${index}.`, `{{ ${label}.${replaceWith}.`)
@ -1528,6 +1533,7 @@ export const migrateReferencesInObject = ({ obj, label = "steps", steps }) => {
migrateReferencesInObject({ migrateReferencesInObject({
obj: obj[key], obj: obj[key],
steps, steps,
originalIndex,
}) })
} }
} }

View File

@ -22,6 +22,7 @@ export const createLicensingStore = () => {
backupsEnabled: false, backupsEnabled: false,
brandingEnabled: false, brandingEnabled: false,
scimEnabled: false, scimEnabled: false,
environmentVariablesEnabled: false,
budibaseAIEnabled: false, budibaseAIEnabled: false,
customAIConfigsEnabled: false, customAIConfigsEnabled: false,
auditLogsEnabled: false, auditLogsEnabled: false,

View File

@ -456,7 +456,7 @@ export function filterAutomation(appId: string, tableId?: string): Automation {
icon: "Icon", icon: "Icon",
id: "a", id: "a",
type: AutomationStepType.TRIGGER, type: AutomationStepType.TRIGGER,
event: "row:save", event: AutomationEventType.ROW_SAVE,
stepId: AutomationTriggerStepId.ROW_SAVED, stepId: AutomationTriggerStepId.ROW_SAVED,
inputs: { inputs: {
tableId: tableId!, tableId: tableId!,
@ -498,7 +498,7 @@ export function updateRowAutomationWithFilters(
icon: "Icon", icon: "Icon",
id: "a", id: "a",
type: AutomationStepType.TRIGGER, type: AutomationStepType.TRIGGER,
event: "row:update", event: AutomationEventType.ROW_UPDATE,
stepId: AutomationTriggerStepId.ROW_UPDATED, stepId: AutomationTriggerStepId.ROW_UPDATED,
inputs: { tableId }, inputs: { tableId },
schema: TRIGGER_DEFINITIONS.ROW_UPDATED.schema, schema: TRIGGER_DEFINITIONS.ROW_UPDATED.schema,
@ -513,7 +513,7 @@ export function basicAutomationResults(
return { return {
automationId, automationId,
status: AutomationStatus.SUCCESS, status: AutomationStatus.SUCCESS,
trigger: "trigger", trigger: "trigger" as any,
steps: [ steps: [
{ {
stepId: AutomationActionStepId.SERVER_LOG, stepId: AutomationActionStepId.SERVER_LOG,

View File

@ -148,6 +148,7 @@ export interface Automation extends Document {
interface BaseIOStructure { interface BaseIOStructure {
type?: AutomationIOType type?: AutomationIOType
subtype?: AutomationIOType
customType?: AutomationCustomIOType customType?: AutomationCustomIOType
title?: string title?: string
description?: string description?: string
@ -192,7 +193,7 @@ export enum AutomationStoppedReason {
export interface AutomationResults { export interface AutomationResults {
automationId?: string automationId?: string
status?: AutomationStatus status?: AutomationStatus
trigger?: any trigger?: AutomationTrigger
steps: { steps: {
stepId: AutomationTriggerStepId | AutomationActionStepId stepId: AutomationTriggerStepId | AutomationActionStepId
inputs: { inputs: {

View File

@ -6,6 +6,7 @@ import {
AutomationFeature, AutomationFeature,
InputOutputBlock, InputOutputBlock,
AutomationTriggerStepId, AutomationTriggerStepId,
AutomationEventType,
} from "./automation" } from "./automation"
import { import {
CollectStepInputs, CollectStepInputs,
@ -142,6 +143,7 @@ export type ActionImplementations<T extends Hosting> = {
export interface AutomationStepSchemaBase { export interface AutomationStepSchemaBase {
name: string name: string
stepTitle?: string stepTitle?: string
event?: AutomationEventType
tagline: string tagline: string
icon: string icon: string
description: string description: string
@ -344,7 +346,7 @@ export interface AutomationTriggerSchema<
> extends AutomationStepSchemaBase { > extends AutomationStepSchemaBase {
id: string id: string
type: AutomationStepType.TRIGGER type: AutomationStepType.TRIGGER
event?: string event?: AutomationEventType
cronJobId?: string cronJobId?: string
stepId: TTrigger stepId: TTrigger
inputs: AutomationTriggerInputs<TTrigger> & Record<string, any> // The record union to be removed once the types are fixed inputs: AutomationTriggerInputs<TTrigger> & Record<string, any> // The record union to be removed once the types are fixed

View File

@ -0,0 +1,12 @@
export interface BranchPath {
stepIdx: number
branchIdx: number
branchStepId: string
id: string
}
export interface BlockDefinitions {
TRIGGER: Record<string, any>
CREATABLE_TRIGGER: Record<string, any>
ACTION: Record<string, any>
}

View File

@ -1,2 +1,3 @@
export * from "./integration" export * from "./integration"
export * from "./automations"
export * from "./grid" export * from "./grid"

View File

@ -5946,6 +5946,11 @@
dependencies: dependencies:
"@types/node" "*" "@types/node" "*"
"@types/shortid@^2.2.0":
version "2.2.0"
resolved "https://registry.yarnpkg.com/@types/shortid/-/shortid-2.2.0.tgz#905990fc4275f77e60ab0cd9f791b91a3d4bff04"
integrity sha512-jBG2FgBxcaSf0h662YloTGA32M8UtNbnTPekUr/eCmWXq0JWQXgNEQ/P5Gf05Cv66QZtE1Ttr83I1AJBPdzCBg==
"@types/ssh2-streams@*": "@types/ssh2-streams@*":
version "0.1.12" version "0.1.12"
resolved "https://registry.yarnpkg.com/@types/ssh2-streams/-/ssh2-streams-0.1.12.tgz#e68795ba2bf01c76b93f9c9809e1f42f0eaaec5f" resolved "https://registry.yarnpkg.com/@types/ssh2-streams/-/ssh2-streams-0.1.12.tgz#e68795ba2bf01c76b93f9c9809e1f42f0eaaec5f"
@ -18639,16 +18644,7 @@ string-length@^4.0.1:
char-regex "^1.0.2" char-regex "^1.0.2"
strip-ansi "^6.0.0" strip-ansi "^6.0.0"
"string-width-cjs@npm:string-width@^4.2.0": "string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"
"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.0.0, string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.2, string-width@^4.2.3:
version "4.2.3" version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
@ -18740,7 +18736,7 @@ stringify-object@^3.2.1:
is-obj "^1.0.1" is-obj "^1.0.1"
is-regexp "^1.0.0" is-regexp "^1.0.0"
"strip-ansi-cjs@npm:strip-ansi@^6.0.1": "strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1" version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
@ -18754,13 +18750,6 @@ strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0:
dependencies: dependencies:
ansi-regex "^4.1.0" ansi-regex "^4.1.0"
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies:
ansi-regex "^5.0.1"
strip-ansi@^7.0.1: strip-ansi@^7.0.1:
version "7.0.1" version "7.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.0.1.tgz#61740a08ce36b61e50e65653f07060d000975fb2" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.0.1.tgz#61740a08ce36b61e50e65653f07060d000975fb2"
@ -20508,7 +20497,7 @@ worker-farm@1.7.0:
dependencies: dependencies:
errno "~0.1.7" errno "~0.1.7"
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": "wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
version "7.0.0" version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
@ -20526,15 +20515,6 @@ wrap-ansi@^5.1.0:
string-width "^3.0.0" string-width "^3.0.0"
strip-ansi "^5.0.0" strip-ansi "^5.0.0"
wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
dependencies:
ansi-styles "^4.0.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"
wrap-ansi@^8.1.0: wrap-ansi@^8.1.0:
version "8.1.0" version "8.1.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"