@budibase/types 2.5.6-alpha.1 → 2.5.6-alpha.10
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/cjs/documents/app/automation.d.ts +57 -8
- package/dist/cjs/documents/app/automation.js +37 -1
- package/dist/cjs/documents/app/automation.js.map +1 -1
- package/dist/cjs/documents/app/table.d.ts +3 -0
- package/dist/cjs/documents/app/user.d.ts +1 -0
- package/dist/cjs/documents/global/plugin.d.ts +2 -1
- package/dist/cjs/documents/global/plugin.js +1 -0
- package/dist/cjs/documents/global/plugin.js.map +1 -1
- package/dist/cjs/sdk/events/event.d.ts +14 -0
- package/dist/cjs/sdk/events/event.js +17 -1
- package/dist/cjs/sdk/events/event.js.map +1 -1
- package/dist/cjs/sdk/events/identification.d.ts +1 -0
- package/dist/cjs/tsconfig-cjs.build.tsbuildinfo +1 -1
- package/dist/mjs/documents/app/automation.d.ts +57 -8
- package/dist/mjs/documents/app/automation.js +36 -0
- package/dist/mjs/documents/app/automation.js.map +1 -1
- package/dist/mjs/documents/app/table.d.ts +3 -0
- package/dist/mjs/documents/app/user.d.ts +1 -0
- package/dist/mjs/documents/global/plugin.d.ts +2 -1
- package/dist/mjs/documents/global/plugin.js +1 -0
- package/dist/mjs/documents/global/plugin.js.map +1 -1
- package/dist/mjs/sdk/events/event.d.ts +14 -0
- package/dist/mjs/sdk/events/event.js +16 -0
- package/dist/mjs/sdk/events/event.js.map +1 -1
- package/dist/mjs/sdk/events/identification.d.ts +1 -0
- package/dist/mjs/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/documents/app/automation.ts +65 -8
- package/src/documents/app/table.ts +3 -0
- package/src/documents/app/user.ts +1 -0
- package/src/documents/global/plugin.ts +1 -0
- package/src/sdk/events/event.ts +37 -0
- package/src/sdk/events/identification.ts +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@budibase/types",
|
|
3
|
-
"version": "2.5.6-alpha.
|
|
3
|
+
"version": "2.5.6-alpha.10",
|
|
4
4
|
"description": "Budibase types",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"types": "dist/mjs/index.d.ts",
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"scim-patch": "^0.7.0"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "5cd18e57d5c371d2dc375e20469f123e81aaec13"
|
|
37
37
|
}
|
|
@@ -1,6 +1,32 @@
|
|
|
1
1
|
import { Document } from "../document"
|
|
2
2
|
import { EventEmitter } from "events"
|
|
3
3
|
|
|
4
|
+
export enum AutomationIOType {
|
|
5
|
+
OBJECT = "object",
|
|
6
|
+
STRING = "string",
|
|
7
|
+
BOOLEAN = "boolean",
|
|
8
|
+
NUMBER = "number",
|
|
9
|
+
ARRAY = "array",
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export enum AutomationCustomIOType {
|
|
13
|
+
TABLE = "table",
|
|
14
|
+
ROW = "row",
|
|
15
|
+
ROWS = "rows",
|
|
16
|
+
WIDE = "wide",
|
|
17
|
+
QUERY = "query",
|
|
18
|
+
QUERY_PARAMS = "queryParams",
|
|
19
|
+
QUERY_LIMIT = "queryLimit",
|
|
20
|
+
LOOP_OPTION = "loopOption",
|
|
21
|
+
ITEM = "item",
|
|
22
|
+
CODE = "code",
|
|
23
|
+
FILTERS = "filters",
|
|
24
|
+
COLUMN = "column",
|
|
25
|
+
TRIGGER_SCHEMA = "triggerSchema",
|
|
26
|
+
CRON = "cron",
|
|
27
|
+
WEBHOOK_URL = "webhookUrl",
|
|
28
|
+
}
|
|
29
|
+
|
|
4
30
|
export enum AutomationTriggerStepId {
|
|
5
31
|
ROW_SAVED = "ROW_SAVED",
|
|
6
32
|
ROW_UPDATED = "ROW_UPDATED",
|
|
@@ -10,6 +36,12 @@ export enum AutomationTriggerStepId {
|
|
|
10
36
|
CRON = "CRON",
|
|
11
37
|
}
|
|
12
38
|
|
|
39
|
+
export enum AutomationStepType {
|
|
40
|
+
LOGIC = "LOGIC",
|
|
41
|
+
ACTION = "ACTION",
|
|
42
|
+
TRIGGER = "TRIGGER",
|
|
43
|
+
}
|
|
44
|
+
|
|
13
45
|
export enum AutomationActionStepId {
|
|
14
46
|
SEND_EMAIL_SMTP = "SEND_EMAIL_SMTP",
|
|
15
47
|
CREATE_ROW = "CREATE_ROW",
|
|
@@ -31,14 +63,43 @@ export enum AutomationActionStepId {
|
|
|
31
63
|
integromat = "integromat",
|
|
32
64
|
}
|
|
33
65
|
|
|
66
|
+
export const AutomationStepIdArray = [
|
|
67
|
+
...Object.values(AutomationActionStepId),
|
|
68
|
+
...Object.values(AutomationTriggerStepId),
|
|
69
|
+
]
|
|
70
|
+
|
|
34
71
|
export interface Automation extends Document {
|
|
35
72
|
definition: {
|
|
36
73
|
steps: AutomationStep[]
|
|
37
74
|
trigger: AutomationTrigger
|
|
38
75
|
}
|
|
76
|
+
screenId?: string
|
|
77
|
+
uiTree?: any
|
|
39
78
|
appId: string
|
|
40
79
|
live?: boolean
|
|
41
80
|
name: string
|
|
81
|
+
internal?: boolean
|
|
82
|
+
type?: string
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
interface BaseIOStructure {
|
|
86
|
+
type?: AutomationIOType
|
|
87
|
+
customType?: AutomationCustomIOType
|
|
88
|
+
title?: string
|
|
89
|
+
description?: string
|
|
90
|
+
enum?: string[]
|
|
91
|
+
pretty?: string[]
|
|
92
|
+
properties?: {
|
|
93
|
+
[key: string]: BaseIOStructure
|
|
94
|
+
}
|
|
95
|
+
required?: string[]
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
interface InputOutputBlock {
|
|
99
|
+
properties: {
|
|
100
|
+
[key: string]: BaseIOStructure
|
|
101
|
+
}
|
|
102
|
+
required?: string[]
|
|
42
103
|
}
|
|
43
104
|
|
|
44
105
|
export interface AutomationStepSchema {
|
|
@@ -46,7 +107,7 @@ export interface AutomationStepSchema {
|
|
|
46
107
|
tagline: string
|
|
47
108
|
icon: string
|
|
48
109
|
description: string
|
|
49
|
-
type:
|
|
110
|
+
type: AutomationStepType
|
|
50
111
|
internal?: boolean
|
|
51
112
|
deprecated?: boolean
|
|
52
113
|
stepId: AutomationTriggerStepId | AutomationActionStepId
|
|
@@ -55,14 +116,10 @@ export interface AutomationStepSchema {
|
|
|
55
116
|
[key: string]: any
|
|
56
117
|
}
|
|
57
118
|
schema: {
|
|
58
|
-
inputs:
|
|
59
|
-
|
|
60
|
-
}
|
|
61
|
-
outputs: {
|
|
62
|
-
[key: string]: any
|
|
63
|
-
}
|
|
64
|
-
required?: string[]
|
|
119
|
+
inputs: InputOutputBlock
|
|
120
|
+
outputs: InputOutputBlock
|
|
65
121
|
}
|
|
122
|
+
custom?: boolean
|
|
66
123
|
}
|
|
67
124
|
|
|
68
125
|
export interface AutomationStep extends AutomationStepSchema {
|
|
@@ -31,6 +31,8 @@ export interface FieldSchema {
|
|
|
31
31
|
timeOnly?: boolean
|
|
32
32
|
lastID?: number
|
|
33
33
|
useRichText?: boolean | null
|
|
34
|
+
order?: number
|
|
35
|
+
width?: number
|
|
34
36
|
meta?: {
|
|
35
37
|
toTable: string
|
|
36
38
|
toKey: string
|
|
@@ -77,6 +79,7 @@ export interface Table extends Document {
|
|
|
77
79
|
indexes?: { [key: string]: any }
|
|
78
80
|
rows?: { [key: string]: any }
|
|
79
81
|
created?: boolean
|
|
82
|
+
rowHeight?: number
|
|
80
83
|
}
|
|
81
84
|
|
|
82
85
|
export interface TableRequest extends Table {
|
package/src/sdk/events/event.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Hosting } from "../hosting"
|
|
2
|
+
import { Group, Identity } from "./identification"
|
|
2
3
|
|
|
3
4
|
export enum Event {
|
|
4
5
|
// USER
|
|
@@ -186,6 +187,24 @@ export enum Event {
|
|
|
186
187
|
AUDIT_LOGS_DOWNLOADED = "audit_log:downloaded",
|
|
187
188
|
}
|
|
188
189
|
|
|
190
|
+
export const UserGroupSyncEvents: Event[] = [
|
|
191
|
+
Event.USER_CREATED,
|
|
192
|
+
Event.USER_UPDATED,
|
|
193
|
+
Event.USER_DELETED,
|
|
194
|
+
Event.USER_PERMISSION_ADMIN_ASSIGNED,
|
|
195
|
+
Event.USER_PERMISSION_ADMIN_REMOVED,
|
|
196
|
+
Event.USER_PERMISSION_BUILDER_ASSIGNED,
|
|
197
|
+
Event.USER_PERMISSION_BUILDER_REMOVED,
|
|
198
|
+
Event.USER_GROUP_CREATED,
|
|
199
|
+
Event.USER_GROUP_UPDATED,
|
|
200
|
+
Event.USER_GROUP_DELETED,
|
|
201
|
+
Event.USER_GROUP_USERS_ADDED,
|
|
202
|
+
Event.USER_GROUP_USERS_REMOVED,
|
|
203
|
+
Event.USER_GROUP_PERMISSIONS_EDITED,
|
|
204
|
+
]
|
|
205
|
+
|
|
206
|
+
export const AsyncEvents: Event[] = [...UserGroupSyncEvents]
|
|
207
|
+
|
|
189
208
|
// all events that are not audited have been added to this record as undefined, this means
|
|
190
209
|
// that Typescript can protect us against new events being added and auditing of those
|
|
191
210
|
// events not being considered. This might be a little ugly, but provides a level of
|
|
@@ -383,3 +402,21 @@ export interface BaseEvent {
|
|
|
383
402
|
}
|
|
384
403
|
|
|
385
404
|
export type TableExportFormat = "json" | "csv"
|
|
405
|
+
|
|
406
|
+
export type DocUpdateEvent = {
|
|
407
|
+
id: string
|
|
408
|
+
tenantId: string
|
|
409
|
+
appId?: string
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
export interface EventProcessor {
|
|
413
|
+
processEvent(
|
|
414
|
+
event: Event,
|
|
415
|
+
identity: Identity,
|
|
416
|
+
properties: any,
|
|
417
|
+
timestamp?: string | number
|
|
418
|
+
): Promise<void>
|
|
419
|
+
identify?(identity: Identity, timestamp?: string | number): Promise<void>
|
|
420
|
+
identifyGroup?(group: Group, timestamp?: string | number): Promise<void>
|
|
421
|
+
shutdown?(): void
|
|
422
|
+
}
|