@budibase/types 3.18.1 → 3.18.2

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.
@@ -1,5 +1,6 @@
1
1
  import { Document } from "../document";
2
- import { BasicOperator } from "../../sdk";
2
+ import { ArrayOperator, BasicOperator } from "../../sdk";
3
+ import { FieldType } from "./row";
3
4
  export interface Component extends Document {
4
5
  _instanceName: string;
5
6
  _styles: {
@@ -12,11 +13,13 @@ export interface Component extends Document {
12
13
  }
13
14
  export interface ComponentCondition {
14
15
  id: string;
15
- operator: BasicOperator;
16
+ operator: ArrayOperator | BasicOperator;
16
17
  action: "update" | "show" | "hide";
18
+ type: FieldType;
17
19
  valueType: "string" | "number" | "datetime" | "boolean";
18
- newValue?: any;
19
- referenceValue?: any;
20
+ newValue?: unknown;
21
+ referenceValue?: unknown;
20
22
  setting?: string;
21
- settingValue?: any;
23
+ settingValue?: unknown;
24
+ noValue?: boolean;
22
25
  }
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../node_modules/lodash/_freeGlobal.js", "../../../node_modules/lodash/_root.js", "../../../node_modules/lodash/_Symbol.js", "../../../node_modules/lodash/_getRawTag.js", "../../../node_modules/lodash/_objectToString.js", "../../../node_modules/lodash/_baseGetTag.js", "../../../node_modules/lodash/_overArg.js", "../../../node_modules/lodash/_getPrototype.js", "../../../node_modules/lodash/isObjectLike.js", "../../../node_modules/lodash/isPlainObject.js", "../src/index.ts", "../src/sdk/ai.ts", "../src/sdk/hosting.ts", "../src/sdk/events/event.ts", "../src/sdk/events/identification.ts", "../src/sdk/licensing/plan.ts", "../src/sdk/licensing/quota.ts", "../src/sdk/licensing/feature.ts", "../src/sdk/datasources.ts", "../src/sdk/search.ts", "../src/sdk/koa.ts", "../src/sdk/locks.ts", "../src/sdk/db.ts", "../src/sdk/middleware/tenancy.ts", "../src/sdk/featureFlag.ts", "../src/sdk/environmentVariables.ts", "../src/sdk/cli/constants.ts", "../src/sdk/permissions.ts", "../src/sdk/row.ts", "../src/documents/account/account.ts", "../src/documents/document.ts", "../src/documents/app/automation/automation.ts", "../src/documents/app/automation/schema.ts", "../src/documents/app/automation/StepInputsOutputs.ts", "../src/documents/app/backup.ts", "../src/documents/app/datasource.ts", "../src/documents/app/deployment.ts", "../src/documents/app/metadata.ts", "../src/documents/app/oauth2.ts", "../src/documents/app/query.ts", "../src/documents/app/table/table.ts", "../src/documents/app/table/constants.ts", "../src/documents/app/table/schema.ts", "../src/documents/app/row.ts", "../src/documents/app/screen.ts", "../src/documents/app/sqlite.ts", "../src/documents/app/theme.ts", "../src/documents/app/view.ts", "../src/documents/app/webhook.ts", "../src/documents/global/config.ts", "../src/documents/global/user.ts", "../src/documents/global/plugin.ts", "../src/documents/global/quotas.ts", "../src/documents/global/schedule.ts", "../src/documents/global/auditLogs.ts", "../src/api/web/analytics.ts", "../src/api/web/errors.ts", "../src/api/web/app/automation.ts", "../src/api/web/app/deployment.ts", "../src/api/web/pagination.ts", "../src/api/web/app/rows/search.ts", "../src/api/web/app/resource.ts", "../src/api/web/app/workspaceFavourites.ts", "../src/api/web/global/auditLogs.ts", "../src/api/web/global/events.ts", "../src/api/web/global/email.ts", "../src/api/web/template.ts", "../src/core/installation.ts", "../src/core/events.ts", "../src/ui/bindings/binding.ts", "../src/ui/components/index.ts", "../src/ui/stores/misc.ts", "../src/ui/stores/automations.ts", "../src/ui/stores/dataEnvironment.ts"],
4
- "sourcesContent": ["/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n", "var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n", "var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n", "var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n", "/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n", "var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n", "/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;\n", "var overArg = require('./_overArg');\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nmodule.exports = getPrototype;\n", "/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n", "var baseGetTag = require('./_baseGetTag'),\n getPrototype = require('./_getPrototype'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nmodule.exports = isPlainObject;\n", "export * from \"./documents\"\nexport * from \"./sdk\"\nexport * from \"./api\"\nexport * from \"./core\"\nexport * from \"./shared\"\nexport * from \"./ui\"\n", "import { Message } from \"../api\"\nimport { AgentChat, AIProvider } from \"../documents\"\n\nexport enum AIOperationEnum {\n SUMMARISE_TEXT = \"SUMMARISE_TEXT\",\n CLEAN_DATA = \"CLEAN_DATA\",\n TRANSLATE = \"TRANSLATE\",\n CATEGORISE_TEXT = \"CATEGORISE_TEXT\",\n SENTIMENT_ANALYSIS = \"SENTIMENT_ANALYSIS\",\n PROMPT = \"PROMPT\",\n SEARCH_WEB = \"SEARCH_WEB\",\n}\n\nexport enum OperationFieldTypeEnum {\n MULTI_COLUMN = \"columns\",\n COLUMN = \"column\",\n BINDABLE_TEXT = \"prompt\",\n}\n\nexport type OperationFieldsType = {\n [AIOperationEnum.SUMMARISE_TEXT]: {\n columns: OperationFieldTypeEnum.MULTI_COLUMN\n }\n [AIOperationEnum.CLEAN_DATA]: {\n column: OperationFieldTypeEnum.COLUMN\n }\n [AIOperationEnum.TRANSLATE]: {\n column: OperationFieldTypeEnum.COLUMN\n language: OperationFieldTypeEnum.BINDABLE_TEXT\n }\n [AIOperationEnum.CATEGORISE_TEXT]: {\n columns: OperationFieldTypeEnum.MULTI_COLUMN\n categories: OperationFieldTypeEnum.BINDABLE_TEXT\n }\n [AIOperationEnum.SENTIMENT_ANALYSIS]: {\n column: OperationFieldTypeEnum.COLUMN\n }\n [AIOperationEnum.PROMPT]: {\n prompt: OperationFieldTypeEnum.BINDABLE_TEXT\n }\n [AIOperationEnum.SEARCH_WEB]: {\n columns: OperationFieldTypeEnum.MULTI_COLUMN\n }\n}\n\ntype BaseSchema = {\n operation: AIOperationEnum\n}\n\ntype SummariseTextSchema = BaseSchema & {\n operation: AIOperationEnum.SUMMARISE_TEXT\n columns: string[]\n}\n\ntype CleanDataSchema = BaseSchema & {\n operation: AIOperationEnum.CLEAN_DATA\n column: string\n}\n\ntype TranslateSchema = BaseSchema & {\n operation: AIOperationEnum.TRANSLATE\n column: string\n language: string\n}\n\ntype CategoriseTextSchema = BaseSchema & {\n operation: AIOperationEnum.CATEGORISE_TEXT\n columns: string[]\n categories: string[]\n}\n\ntype SentimentAnalysisSchema = BaseSchema & {\n operation: AIOperationEnum.SENTIMENT_ANALYSIS\n column: string\n}\n\ntype PromptSchema = BaseSchema & {\n operation: AIOperationEnum.PROMPT\n prompt: string\n}\n\ntype SearchWebSchema = BaseSchema & {\n operation: AIOperationEnum.SEARCH_WEB\n columns: string[]\n}\n\nexport type AIColumnSchema =\n | SummariseTextSchema\n | CleanDataSchema\n | TranslateSchema\n | CategoriseTextSchema\n | SentimentAnalysisSchema\n | PromptSchema\n | SearchWebSchema\n\nexport interface LLMConfigOptions {\n model: string\n apiKey?: string\n maxTokens?: number\n max_completion_tokens?: number\n // Primarily here for Azure OpenAI, because each customer has their own endpoint\n baseUrl?: string\n}\n\nexport interface LLMProviderConfig extends LLMConfigOptions {\n provider: AIProvider\n}\n\nexport interface LLMStreamChunk {\n type:\n | \"content\"\n | \"tool_call_start\"\n | \"tool_call_result\"\n | \"done\"\n | \"error\"\n | \"chat_saved\"\n content?: string\n toolCall?: {\n id: string\n name: string\n arguments: string\n }\n toolResult?: {\n id: string\n result: string\n error?: string\n }\n messages?: Message[]\n chat?: AgentChat\n tokensUsed?: number\n}\n", "export enum Hosting {\n CLOUD = \"cloud\",\n SELF = \"self\",\n}\n", "import { Hosting } from \"../hosting\"\nimport { Group, Identity } from \"./identification\"\n\nexport enum Event {\n // USER\n USER_CREATED = \"user:created\",\n USER_UPDATED = \"user:updated\",\n USER_DELETED = \"user:deleted\",\n\n // USER / ONBOARDING\n USER_ONBOARDING_COMPLETE = \"user:onboarding:complete\",\n\n // USER / PERMISSIONS\n USER_PERMISSION_ADMIN_ASSIGNED = \"user:admin:assigned\",\n USER_PERMISSION_ADMIN_REMOVED = \"user:admin:removed\",\n USER_PERMISSION_BUILDER_ASSIGNED = \"user:builder:assigned\",\n USER_PERMISSION_BUILDER_REMOVED = \"user:builder:removed\",\n\n // USER / INVITE\n USER_INVITED = \"user:invited\",\n USER_INVITED_ACCEPTED = \"user:invite:accepted\",\n\n // USER / PASSWORD\n USER_PASSWORD_FORCE_RESET = \"user:password:force:reset\",\n USER_PASSWORD_UPDATED = \"user:password:updated\",\n USER_PASSWORD_RESET_REQUESTED = \"user:password:reset:requested\",\n USER_PASSWORD_RESET = \"user:password:reset\",\n\n // USER / COLLABORATION\n USER_DATA_COLLABORATION = \"user:data:collaboration\",\n\n // EMAIL\n EMAIL_SMTP_CREATED = \"email:smtp:created\",\n EMAIL_SMTP_UPDATED = \"email:smtp:updated\",\n\n // AI\n AI_CONFIG_CREATED = \"ai:config:created\",\n AI_CONFIG_UPDATED = \"ai:config:updated\",\n\n // AUTH\n AUTH_SSO_CREATED = \"auth:sso:created\",\n AUTH_SSO_UPDATED = \"auth:sso:updated\",\n AUTH_SSO_ACTIVATED = \"auth:sso:activated\",\n AUTH_SSO_DEACTIVATED = \"auth:sso:deactivated\",\n AUTH_LOGIN = \"auth:login\",\n AUTH_LOGOUT = \"auth:logout\",\n\n // ORG\n ORG_NAME_UPDATED = \"org:info:name:updated\",\n ORG_LOGO_UPDATED = \"org:info:logo:updated\",\n ORG_PLATFORM_URL_UPDATED = \"org:platformurl:updated\",\n\n // INSTALLATION\n INSTALLATION_VERSION_CHECKED = \"installation:version:checked\",\n INSTALLATION_VERSION_UPGRADED = \"installation:version:upgraded\",\n INSTALLATION_VERSION_DOWNGRADED = \"installation:version:downgraded\",\n INSTALLATION_FIRST_STARTUP = \"installation:firstStartup\",\n\n // ORG / ANALYTICS\n ANALYTICS_OPT_OUT = \"analytics:opt:out\",\n ANALYTICS_OPT_IN = \"analytics:opt:in\",\n\n // APP\n APP_CREATED = \"app:created\",\n APP_UPDATED = \"app:updated\",\n APP_DELETED = \"app:deleted\",\n APP_DUPLICATED = \"app:duplicated\",\n APP_PUBLISHED = \"app:published\",\n APP_UNPUBLISHED = \"app:unpublished\",\n APP_TEMPLATE_IMPORTED = \"app:template:imported\",\n APP_FILE_IMPORTED = \"app:file:imported\",\n APP_VERSION_UPDATED = \"app:version:updated\",\n APP_VERSION_REVERTED = \"app:version:reverted\",\n APP_REVERTED = \"app:reverted\",\n APP_EXPORTED = \"app:exported\",\n\n // ROLE\n ROLE_CREATED = \"role:created\",\n ROLE_UPDATED = \"role:updated\",\n ROLE_DELETED = \"role:deleted\",\n ROLE_ASSIGNED = \"role:assigned\",\n ROLE_UNASSIGNED = \"role:unassigned\",\n\n // SERVE\n SERVED_BUILDER = \"served:builder\",\n SERVED_APP = \"served:app\",\n SERVED_APP_PREVIEW = \"served:app:preview\",\n\n // DATASOURCE\n DATASOURCE_CREATED = \"datasource:created\",\n DATASOURCE_UPDATED = \"datasource:updated\",\n DATASOURCE_DELETED = \"datasource:deleted\",\n\n // QUERY\n QUERY_CREATED = \"query:created\",\n QUERY_UPDATED = \"query:updated\",\n QUERY_DELETED = \"query:deleted\",\n QUERY_IMPORT = \"query:import\",\n QUERIES_RUN = \"queries:run\",\n QUERY_PREVIEWED = \"query:previewed\",\n\n // TABLE\n TABLE_CREATED = \"table:created\",\n TABLE_UPDATED = \"table:updated\",\n TABLE_DELETED = \"table:deleted\",\n TABLE_EXPORTED = \"table:exported\",\n TABLE_IMPORTED = \"table:imported\",\n TABLE_DATA_IMPORTED = \"table:data:imported\",\n\n // VIEW\n VIEW_CREATED = \"view:created\",\n VIEW_UPDATED = \"view:updated\",\n VIEW_DELETED = \"view:deleted\",\n VIEW_EXPORTED = \"view:exported\",\n VIEW_FILTER_CREATED = \"view:filter:created\",\n VIEW_FILTER_UPDATED = \"view:filter:updated\",\n VIEW_FILTER_DELETED = \"view:filter:deleted\",\n VIEW_CALCULATION_CREATED = \"view:calculation:created\",\n VIEW_CALCULATION_UPDATED = \"view:calculation:updated\",\n VIEW_CALCULATION_DELETED = \"view:calculation:deleted\",\n VIEW_JOIN_CREATED = \"view:join:created\",\n\n // ROWS\n ROWS_CREATED = \"rows:created\",\n ROWS_IMPORTED = \"rows:imported\",\n\n // COMPONENT\n COMPONENT_CREATED = \"component:created\",\n COMPONENT_DELETED = \"component:deleted\",\n\n // SCREEN\n SCREEN_CREATED = \"screen:created\",\n SCREEN_DELETED = \"screen:deleted\",\n\n // LAYOUT\n LAYOUT_CREATED = \"layout:created\",\n LAYOUT_DELETED = \"layout:deleted\",\n\n // AUTOMATION\n AUTOMATION_CREATED = \"automation:created\",\n AUTOMATION_DELETED = \"automation:deleted\",\n AUTOMATION_TESTED = \"automation:tested\",\n AUTOMATIONS_RUN = \"automations:run\",\n AUTOMATION_STEP_CREATED = \"automation:step:created\",\n AUTOMATION_STEP_DELETED = \"automation:step:deleted\",\n AUTOMATION_TRIGGER_UPDATED = \"automation:trigger:updated\",\n\n // LICENSE\n LICENSE_PLAN_CHANGED = \"license:plan:changed\",\n LICENSE_ACTIVATED = \"license:activated\",\n LICENSE_PAYMENT_FAILED = \"license:payment:failed\",\n LICENSE_PAYMENT_RECOVERED = \"license:payment:recovered\",\n LICENSE_CHECKOUT_OPENED = \"license:checkout:opened\",\n LICENSE_CHECKOUT_SUCCESS = \"license:checkout:success\",\n LICENSE_PORTAL_OPENED = \"license:portal:opened\",\n\n // ACCOUNT\n ACCOUNT_CREATED = \"account:created\",\n ACCOUNT_DELETED = \"account:deleted\",\n ACCOUNT_VERIFIED = \"account:verified\",\n\n // BACKFILL\n APP_BACKFILL_SUCCEEDED = \"app:backfill:succeeded\",\n APP_BACKFILL_FAILED = \"app:backfill:failed\",\n TENANT_BACKFILL_SUCCEEDED = \"tenant:backfill:succeeded\",\n TENANT_BACKFILL_FAILED = \"tenant:backfill:failed\",\n INSTALLATION_BACKFILL_SUCCEEDED = \"installation:backfill:succeeded\",\n INSTALLATION_BACKFILL_FAILED = \"installation:backfill:failed\",\n\n // USER\n USER_GROUP_CREATED = \"user_group:created\",\n USER_GROUP_UPDATED = \"user_group:updated\",\n USER_GROUP_DELETED = \"user_group:deleted\",\n USER_GROUP_USERS_ADDED = \"user_group:user_added\",\n USER_GROUP_USERS_REMOVED = \"user_group:users_deleted\",\n USER_GROUP_PERMISSIONS_EDITED = \"user_group:permissions_edited\",\n USER_GROUP_ONBOARDING = \"user_group:onboarding_added\",\n\n // PLUGIN\n PLUGIN_INIT = \"plugin:init\",\n PLUGIN_IMPORTED = \"plugin:imported\",\n PLUGIN_DELETED = \"plugin:deleted\",\n\n // BACKUP\n APP_BACKUP_RESTORED = \"app:backup:restored\",\n APP_BACKUP_TRIGGERED = \"app:backup:triggered\",\n\n // ENVIRONMENT VARIABLE\n ENVIRONMENT_VARIABLE_CREATED = \"environment_variable:created\",\n ENVIRONMENT_VARIABLE_DELETED = \"environment_variable:deleted\",\n ENVIRONMENT_VARIABLE_UPGRADE_PANEL_OPENED = \"environment_variable:upgrade_panel_opened\",\n\n // AUDIT LOG\n AUDIT_LOGS_FILTERED = \"audit_log:filtered\",\n AUDIT_LOGS_DOWNLOADED = \"audit_log:downloaded\",\n\n // ROW ACTION\n ROW_ACTION_CREATED = \"row_action:created\",\n\n //ACTION\n ACTION_AUTOMATION_STEP_EXECUTED = \"action:automation_step:executed\",\n ACTION_CRUD_EXECUTED = \"action:crud:executed\",\n ACTION_AI_AGENT_EXECUTED = \"action:ai_agent:executed\",\n\n // WORKSPACE\n WORKSPACE_CREATED = \"workspace:created\",\n WORKSPACE_UPDATED = \"workspace:updated\",\n WORKSPACE_DELETED = \"workspace:deleted\",\n\n // WORKSPACE APP\n WORKSPACE_APP_CREATED = \"workspace_app:created\",\n WORKSPACE_APP_UPDATED = \"workspace_app:updated\",\n WORKSPACE_APP_DELETED = \"workspace_app:deleted\",\n}\n\nexport const UserGroupSyncEvents: Event[] = [\n Event.USER_CREATED,\n Event.USER_UPDATED,\n Event.USER_DELETED,\n Event.USER_PERMISSION_ADMIN_ASSIGNED,\n Event.USER_PERMISSION_ADMIN_REMOVED,\n Event.USER_PERMISSION_BUILDER_ASSIGNED,\n Event.USER_PERMISSION_BUILDER_REMOVED,\n Event.USER_GROUP_CREATED,\n Event.USER_GROUP_UPDATED,\n Event.USER_GROUP_DELETED,\n Event.USER_GROUP_USERS_ADDED,\n Event.USER_GROUP_USERS_REMOVED,\n Event.USER_GROUP_PERMISSIONS_EDITED,\n]\n\n// Favourites\nexport const WorkspaceResourceEvents: Event[] = [\n Event.AUTOMATION_DELETED,\n Event.WORKSPACE_APP_DELETED,\n Event.DATASOURCE_DELETED,\n Event.TABLE_DELETED,\n Event.QUERY_DELETED,\n Event.VIEW_DELETED,\n]\n\nexport const AsyncEvents: Event[] = [\n ...UserGroupSyncEvents,\n ...WorkspaceResourceEvents,\n]\n\n// all events that are not audited have been added to this record as undefined, this means\n// that Typescript can protect us against new events being added and auditing of those\n// events not being considered. This might be a little ugly, but provides a level of\n// Typescript build protection for the audit log feature, any new event also needs to be\n// added to this map, during which the developer will need to consider if it should be\n// a user facing event or not.\nexport const AuditedEventFriendlyName: Record<Event, string | undefined> = {\n // USER\n [Event.USER_CREATED]: `User \"{{ email }}\" created{{#if viaScim}} via SCIM{{/if}}`,\n [Event.USER_UPDATED]: `User \"{{ email }}\" updated{{#if viaScim}} via SCIM{{/if}}`,\n [Event.USER_DELETED]: `User \"{{ email }}\" deleted{{#if viaScim}} via SCIM{{/if}}`,\n [Event.USER_PERMISSION_ADMIN_ASSIGNED]: `User \"{{ email }}\" admin role assigned`,\n [Event.USER_PERMISSION_ADMIN_REMOVED]: `User \"{{ email }}\" admin role removed`,\n [Event.USER_PERMISSION_BUILDER_ASSIGNED]: `User \"{{ email }}\" builder role assigned`,\n [Event.USER_PERMISSION_BUILDER_REMOVED]: `User \"{{ email }}\" builder role removed`,\n [Event.USER_INVITED]: `User \"{{ email }}\" invited`,\n [Event.USER_INVITED_ACCEPTED]: `User \"{{ email }}\" accepted invite`,\n [Event.USER_PASSWORD_UPDATED]: `User \"{{ email }}\" password updated`,\n [Event.USER_PASSWORD_RESET_REQUESTED]: `User \"{{ email }}\" password reset requested`,\n [Event.USER_PASSWORD_RESET]: `User \"{{ email }}\" password reset`,\n [Event.USER_GROUP_CREATED]: `User group \"{{ name }}\" created{{#if viaScim}} via SCIM{{/if}}`,\n [Event.USER_GROUP_UPDATED]: `User group \"{{ name }}\" updated{{#if viaScim}} via SCIM{{/if}}`,\n [Event.USER_GROUP_DELETED]: `User group \"{{ name }}\" deleted{{#if viaScim}} via SCIM{{/if}}`,\n [Event.USER_GROUP_USERS_ADDED]: `User group \"{{ name }}\" {{ count }} users added{{#if viaScim}} via SCIM{{/if}}`,\n [Event.USER_GROUP_USERS_REMOVED]: `User group \"{{ name }}\" {{ count }} users removed{{#if viaScim}} via SCIM{{/if}}`,\n [Event.USER_GROUP_PERMISSIONS_EDITED]: `User group \"{{ name }}\" permissions edited`,\n [Event.USER_PASSWORD_FORCE_RESET]: undefined,\n [Event.USER_GROUP_ONBOARDING]: undefined,\n [Event.USER_ONBOARDING_COMPLETE]: undefined,\n [Event.USER_DATA_COLLABORATION]: undefined,\n\n // EMAIL\n [Event.EMAIL_SMTP_CREATED]: `Email configuration created`,\n [Event.EMAIL_SMTP_UPDATED]: `Email configuration updated`,\n\n // AI\n [Event.AI_CONFIG_CREATED]: `AI configuration created`,\n [Event.AI_CONFIG_UPDATED]: `AI configuration updated`,\n\n // AUTH\n [Event.AUTH_SSO_CREATED]: `SSO configuration created`,\n [Event.AUTH_SSO_UPDATED]: `SSO configuration updated`,\n [Event.AUTH_SSO_ACTIVATED]: `SSO configuration activated`,\n [Event.AUTH_SSO_DEACTIVATED]: `SSO configuration deactivated`,\n [Event.AUTH_LOGIN]: `User \"{{ email }}\" logged in`,\n [Event.AUTH_LOGOUT]: `User \"{{ email }}\" logged out`,\n\n // ORG\n [Event.ORG_NAME_UPDATED]: `Organisation name updated`,\n [Event.ORG_LOGO_UPDATED]: `Organisation logo updated`,\n [Event.ORG_PLATFORM_URL_UPDATED]: `Organisation platform URL updated`,\n\n // APP\n [Event.APP_CREATED]: `App \"{{ name }}\" created`,\n [Event.APP_UPDATED]: `App \"{{ name }}\" updated`,\n [Event.APP_DELETED]: `App \"{{ name }}\" deleted`,\n [Event.APP_DUPLICATED]: `App \"{{ name }}\" duplicated`,\n [Event.APP_PUBLISHED]: `App \"{{ name }}\" published`,\n [Event.APP_UNPUBLISHED]: `App \"{{ name }}\" unpublished`,\n [Event.APP_TEMPLATE_IMPORTED]: `App \"{{ name }}\" template imported`,\n [Event.APP_FILE_IMPORTED]: `App \"{{ name }}\" file imported`,\n [Event.APP_VERSION_UPDATED]: `App \"{{ name }}\" version updated`,\n [Event.APP_VERSION_REVERTED]: `App \"{{ name }}\" version reverted`,\n [Event.APP_REVERTED]: `App \"{{ name }}\" reverted`,\n [Event.APP_EXPORTED]: `App \"{{ name }}\" exported`,\n [Event.APP_BACKUP_RESTORED]: `App backup \"{{ name }}\" restored`,\n [Event.APP_BACKUP_TRIGGERED]: `App backup \"{{ name }}\" triggered`,\n\n // DATASOURCE\n [Event.DATASOURCE_CREATED]: `Datasource created`,\n [Event.DATASOURCE_UPDATED]: `Datasource updated`,\n [Event.DATASOURCE_DELETED]: `Datasource deleted`,\n\n // QUERY\n [Event.QUERY_CREATED]: `Query created`,\n [Event.QUERY_UPDATED]: `Query updated`,\n [Event.QUERY_DELETED]: `Query deleted`,\n [Event.QUERY_IMPORT]: `Query import`,\n [Event.QUERIES_RUN]: undefined,\n [Event.QUERY_PREVIEWED]: undefined,\n\n // TABLE\n [Event.TABLE_CREATED]: `Table \"{{ name }}\" created`,\n [Event.TABLE_UPDATED]: `Table \"{{ name }}\" updated`,\n [Event.TABLE_DELETED]: `Table \"{{ name }}\" deleted`,\n [Event.TABLE_EXPORTED]: `Table \"{{ name }}\" exported`,\n [Event.TABLE_IMPORTED]: `Table \"{{ name }}\" imported`,\n [Event.TABLE_DATA_IMPORTED]: `Data imported to table`,\n\n // ROWS\n [Event.ROWS_CREATED]: `Rows created`,\n [Event.ROWS_IMPORTED]: `Rows imported`,\n\n // AUTOMATION\n [Event.AUTOMATION_CREATED]: `Automation \"{{ name }}\" created`,\n [Event.AUTOMATION_DELETED]: `Automation \"{{ name }}\" deleted`,\n [Event.AUTOMATION_STEP_CREATED]: `Automation \"{{ name }}\" step added`,\n [Event.AUTOMATION_STEP_DELETED]: `Automation \"{{ name }}\" step removed`,\n [Event.AUTOMATION_TESTED]: undefined,\n [Event.AUTOMATIONS_RUN]: undefined,\n [Event.AUTOMATION_TRIGGER_UPDATED]: undefined,\n\n // SCREEN\n [Event.SCREEN_CREATED]: `Screen \"{{ name }}\" created`,\n [Event.SCREEN_DELETED]: `Screen \"{{ name }}\" deleted`,\n\n // COMPONENT\n [Event.COMPONENT_CREATED]: `Component created`,\n [Event.COMPONENT_DELETED]: `Component deleted`,\n\n // ENVIRONMENT VARIABLE\n [Event.ENVIRONMENT_VARIABLE_CREATED]: `Environment variable created`,\n [Event.ENVIRONMENT_VARIABLE_DELETED]: `Environment variable deleted`,\n [Event.ENVIRONMENT_VARIABLE_UPGRADE_PANEL_OPENED]: undefined,\n\n // PLUGIN\n [Event.PLUGIN_IMPORTED]: `Plugin imported`,\n [Event.PLUGIN_DELETED]: `Plugin deleted`,\n [Event.PLUGIN_INIT]: undefined,\n\n // ACTIONS - NOT AUDITED\n [Event.ACTION_AUTOMATION_STEP_EXECUTED]: undefined,\n [Event.ACTION_CRUD_EXECUTED]: undefined,\n [Event.ACTION_AI_AGENT_EXECUTED]: undefined,\n\n // ROLE - NOT AUDITED\n [Event.ROLE_CREATED]: undefined,\n [Event.ROLE_UPDATED]: undefined,\n [Event.ROLE_DELETED]: undefined,\n [Event.ROLE_ASSIGNED]: undefined,\n [Event.ROLE_UNASSIGNED]: undefined,\n\n // LICENSE - NOT AUDITED\n [Event.LICENSE_PLAN_CHANGED]: undefined,\n [Event.LICENSE_ACTIVATED]: undefined,\n [Event.LICENSE_PAYMENT_FAILED]: undefined,\n [Event.LICENSE_PAYMENT_RECOVERED]: undefined,\n [Event.LICENSE_CHECKOUT_OPENED]: undefined,\n [Event.LICENSE_CHECKOUT_SUCCESS]: undefined,\n [Event.LICENSE_PORTAL_OPENED]: undefined,\n\n // ACCOUNT - NOT AUDITED\n [Event.ACCOUNT_CREATED]: undefined,\n [Event.ACCOUNT_DELETED]: undefined,\n [Event.ACCOUNT_VERIFIED]: undefined,\n\n // BACKFILL - NOT AUDITED\n [Event.APP_BACKFILL_SUCCEEDED]: undefined,\n [Event.APP_BACKFILL_FAILED]: undefined,\n [Event.TENANT_BACKFILL_SUCCEEDED]: undefined,\n [Event.TENANT_BACKFILL_FAILED]: undefined,\n [Event.INSTALLATION_BACKFILL_SUCCEEDED]: undefined,\n [Event.INSTALLATION_BACKFILL_FAILED]: undefined,\n\n // LAYOUT - NOT AUDITED\n [Event.LAYOUT_CREATED]: undefined,\n [Event.LAYOUT_DELETED]: undefined,\n\n // VIEW - NOT AUDITED\n [Event.VIEW_CREATED]: undefined,\n [Event.VIEW_UPDATED]: undefined,\n [Event.VIEW_DELETED]: undefined,\n [Event.VIEW_EXPORTED]: undefined,\n [Event.VIEW_FILTER_CREATED]: undefined,\n [Event.VIEW_FILTER_UPDATED]: undefined,\n [Event.VIEW_FILTER_DELETED]: undefined,\n [Event.VIEW_CALCULATION_CREATED]: undefined,\n [Event.VIEW_CALCULATION_UPDATED]: undefined,\n [Event.VIEW_CALCULATION_DELETED]: undefined,\n [Event.VIEW_JOIN_CREATED]: undefined,\n\n // SERVED - NOT AUDITED\n [Event.SERVED_BUILDER]: undefined,\n [Event.SERVED_APP]: undefined,\n [Event.SERVED_APP_PREVIEW]: undefined,\n\n // ANALYTICS - NOT AUDITED\n [Event.ANALYTICS_OPT_OUT]: undefined,\n [Event.ANALYTICS_OPT_IN]: undefined,\n\n // INSTALLATION - NOT AUDITED\n [Event.INSTALLATION_VERSION_CHECKED]: undefined,\n [Event.INSTALLATION_VERSION_UPGRADED]: undefined,\n [Event.INSTALLATION_VERSION_DOWNGRADED]: undefined,\n [Event.INSTALLATION_FIRST_STARTUP]: undefined,\n\n // AUDIT LOG - NOT AUDITED\n [Event.AUDIT_LOGS_FILTERED]: undefined,\n [Event.AUDIT_LOGS_DOWNLOADED]: undefined,\n\n // ROW ACTIONS - NOT AUDITED\n [Event.ROW_ACTION_CREATED]: undefined,\n\n // WORKSPACE\n [Event.WORKSPACE_CREATED]: undefined,\n [Event.WORKSPACE_DELETED]: undefined,\n [Event.WORKSPACE_UPDATED]: undefined,\n\n // WORKSPACE APP\n [Event.WORKSPACE_APP_CREATED]: undefined,\n [Event.WORKSPACE_APP_DELETED]: undefined,\n [Event.WORKSPACE_APP_UPDATED]: undefined,\n}\n\n// properties added at the final stage of the event pipeline\nexport interface BaseEvent {\n version?: string\n service?: string\n environment?: string\n appId?: string\n installationId?: string\n tenantId?: string\n hosting?: Hosting\n // any props in the audited section will be removed before passing events\n // up out of system (purely for use with auditing)\n audited?: {\n [key: string]: any\n }\n}\n\nexport type TableExportFormat = \"json\" | \"csv\"\n\nexport type DocUpdateEvent = {\n id: string\n tenantId: string\n appId?: string\n}\n\nexport interface EventProcessor {\n processEvent(\n event: Event,\n identity: Identity,\n properties: any,\n timestamp?: string | number\n ): Promise<void>\n identify?(identity: Identity, timestamp?: string | number): Promise<void>\n identifyGroup?(group: Group, timestamp?: string | number): Promise<void>\n shutdown?(): Promise<void>\n}\n", "import { Hosting } from \"..\"\n\n// GROUPS\n\nexport enum GroupType {\n TENANT = \"tenant\",\n INSTALLATION = \"installation\",\n}\n\nexport interface Group {\n id: string\n type: IdentityType\n environment: string\n hosting: Hosting\n}\n\nexport interface TenantGroup extends Group {\n // account level information is associated with the tenant group\n // as we don't have this at the user level\n profession?: string // only available in cloud\n companySize?: string // only available in cloud\n createdAt?: string | number\n createdVersion: string\n installationId: string\n}\n\nexport interface InstallationGroup extends Group {\n version: string\n}\n\n// IDENTITIES\n\nexport enum IdentityType {\n USER = \"user\",\n TENANT = \"tenant\",\n INSTALLATION = \"installation\",\n}\n\nexport interface HostInfo {\n ipAddress?: string\n userAgent?: string\n}\n\nexport interface Identity {\n id: string\n type: IdentityType\n hosting: Hosting\n environment: string\n installationId?: string\n tenantId?: string\n // usable - no unique format\n realTenantId?: string\n hostInfo?: HostInfo\n}\n\nexport interface UserIdentity extends Identity {\n verified: boolean\n accountHolder: boolean\n providerType?: string\n builder?: boolean\n admin?: boolean\n}\n", "export enum PlanType {\n FREE = \"free\",\n /** @deprecated */\n PRO = \"pro\",\n /** @deprecated */\n TEAM = \"team\",\n /** @deprecated */\n PREMIUM = \"premium\",\n PREMIUM_PLUS = \"premium_plus\",\n PREMIUM_PLUS_TRIAL = \"premium_plus_trial\",\n /** @deprecated */\n BUSINESS = \"business\",\n ENTERPRISE_BASIC = \"enterprise_basic\",\n ENTERPRISE_BASIC_TRIAL = \"enterprise_basic_trial\",\n ENTERPRISE = \"enterprise\",\n}\n\nexport enum PriceDuration {\n MONTHLY = \"monthly\",\n YEARLY = \"yearly\",\n}\n\nexport interface AvailablePlan {\n type: PlanType\n maxUsers: number\n prices: AvailablePrice[]\n}\n\nexport interface AvailablePrice {\n amount: number\n amountMonthly: number\n currency: string\n duration: PriceDuration\n priceId: string\n type?: string\n}\n\nexport enum PlanModel {\n PER_USER = \"perUser\",\n PER_CREATOR_PER_USER = \"per_creator_per_user\",\n}\n\nexport interface PurchasedPlan {\n type: PlanType\n model: PlanModel\n usesInvoicing: boolean\n price?: PurchasedPrice\n}\n\nexport interface PurchasedPrice extends AvailablePrice {\n /** @deprecated - now at the plan level via model */\n isPerUser: boolean\n}\n", "import { PlanType } from \".\"\n\nexport enum QuotaUsageType {\n STATIC = \"static\",\n MONTHLY = \"monthly\",\n}\n\nexport enum QuotaType {\n USAGE = \"usage\",\n CONSTANT = \"constant\",\n}\n\nexport enum StaticQuotaName {\n ROWS = \"rows\",\n APPS = \"apps\",\n USERS = \"users\",\n CREATORS = \"creators\",\n USER_GROUPS = \"userGroups\",\n PLUGINS = \"plugins\",\n AI_CUSTOM_CONFIGS = \"aiCustomConfigs\",\n}\n\nexport enum MonthlyQuotaName {\n QUERIES = \"queries\",\n AUTOMATIONS = \"automations\",\n BUDIBASE_AI_CREDITS = \"budibaseAICredits\",\n ACTIONS = \"actions\",\n}\n\nexport enum ConstantQuotaName {\n AUTOMATION_LOG_RETENTION_DAYS = \"automationLogRetentionDays\",\n APP_BACKUPS_RETENTION_DAYS = \"appBackupRetentionDays\",\n}\n\nexport type MeteredQuotaName = StaticQuotaName | MonthlyQuotaName\nexport type QuotaName = StaticQuotaName | MonthlyQuotaName | ConstantQuotaName\n\nexport const isStaticQuota = (\n quotaType: QuotaType,\n usageType: QuotaUsageType,\n name: QuotaName\n): name is StaticQuotaName => {\n return quotaType === QuotaType.USAGE && usageType === QuotaUsageType.STATIC\n}\n\nexport const isMonthlyQuota = (\n quotaType: QuotaType,\n usageType: QuotaUsageType,\n name: QuotaName\n): name is MonthlyQuotaName => {\n return quotaType === QuotaType.USAGE && usageType === QuotaUsageType.MONTHLY\n}\n\nexport const isConstantQuota = (\n quotaType: QuotaType,\n name: QuotaName\n): name is ConstantQuotaName => {\n return quotaType === QuotaType.CONSTANT\n}\n\nexport type PlanQuotas = { [key in PlanType]: Quotas | undefined }\n\nexport type MonthlyQuotas = {\n [MonthlyQuotaName.QUERIES]: Quota\n [MonthlyQuotaName.AUTOMATIONS]: Quota\n [MonthlyQuotaName.BUDIBASE_AI_CREDITS]: Quota\n [MonthlyQuotaName.ACTIONS]: Quota\n}\n\nexport type StaticQuotas = {\n [StaticQuotaName.ROWS]: Quota\n [StaticQuotaName.APPS]: Quota\n [StaticQuotaName.USERS]: Quota\n [StaticQuotaName.CREATORS]: Quota\n [StaticQuotaName.USER_GROUPS]: Quota\n [StaticQuotaName.PLUGINS]: Quota\n [StaticQuotaName.AI_CUSTOM_CONFIGS]: Quota\n}\n\nexport type ConstantQuotas = {\n [ConstantQuotaName.AUTOMATION_LOG_RETENTION_DAYS]: Quota\n [ConstantQuotaName.APP_BACKUPS_RETENTION_DAYS]: Quota\n}\n\nexport type Quotas = {\n [QuotaType.USAGE]: {\n [QuotaUsageType.MONTHLY]: MonthlyQuotas\n [QuotaUsageType.STATIC]: StaticQuotas\n }\n [QuotaType.CONSTANT]: ConstantQuotas\n}\n\nexport interface Quota {\n name: string\n value: number\n /**\n * Array of whole numbers (1-100) that dictate the percentage that this quota should trigger\n * at in relation to the corresponding usage inside budibase.\n *\n * Triggering results in a budibase installation sending a request to account-portal,\n * which can have subsequent effects such as sending emails to users.\n */\n triggers: number[]\n startDate?: number\n}\n", "import { PlanType } from \"./plan\"\n\nexport enum Feature {\n USER_GROUPS = \"userGroups\",\n APP_BACKUPS = \"appBackups\",\n ENVIRONMENT_VARIABLES = \"environmentVariables\",\n AUDIT_LOGS = \"auditLogs\",\n ENFORCEABLE_SSO = \"enforceableSSO\",\n BRANDING = \"branding\",\n SCIM = \"scim\",\n SYNC_AUTOMATIONS = \"syncAutomations\",\n TRIGGER_AUTOMATION_RUN = \"triggerAutomationRun\",\n APP_BUILDERS = \"appBuilders\",\n OFFLINE = \"offline\",\n EXPANDED_PUBLIC_API = \"expandedPublicApi\",\n CUSTOM_APP_SCRIPTS = \"customAppScripts\",\n PDF = \"pdf\",\n // deprecated - no longer licensed\n VIEW_PERMISSIONS = \"viewPermissions\",\n VIEW_READONLY_COLUMNS = \"viewReadonlyColumns\",\n BUDIBASE_AI = \"budibaseAI\",\n AI_CUSTOM_CONFIGS = \"aiCustomConfigs\",\n PWA = \"pwa\",\n RECAPTCHA = \"recaptcha\",\n PKCE_OIDC = \"pkceOidc\",\n}\n\nexport type PlanFeatures = { [key in PlanType]: Feature[] | undefined }\n", "import { Table, Row } from \"../documents\"\nimport { EnrichedQueryJson } from \"./search\"\n\nexport const PASSWORD_REPLACEMENT = \"--secret-value--\"\n\nexport enum Operation {\n CREATE = \"CREATE\",\n READ = \"READ\",\n UPDATE = \"UPDATE\",\n DELETE = \"DELETE\",\n COUNT = \"COUNT\",\n BULK_CREATE = \"BULK_CREATE\",\n BULK_UPSERT = \"BULK_UPSERT\",\n CREATE_TABLE = \"CREATE_TABLE\",\n UPDATE_TABLE = \"UPDATE_TABLE\",\n DELETE_TABLE = \"DELETE_TABLE\",\n}\n\nexport const RowOperations = [\n Operation.CREATE,\n Operation.READ,\n Operation.UPDATE,\n Operation.DELETE,\n Operation.BULK_CREATE,\n Operation.BULK_UPSERT,\n]\n\nexport enum QueryType {\n SQL = \"sql\",\n JSON = \"json\",\n FIELDS = \"fields\",\n}\n\nexport enum DatasourceFieldType {\n STRING = \"string\",\n CODE = \"code\",\n LONGFORM = \"longForm\",\n BOOLEAN = \"boolean\",\n NUMBER = \"number\",\n PASSWORD = \"password\",\n LIST = \"list\",\n OBJECT = \"object\",\n JSON = \"json\",\n FILE = \"file\",\n FIELD_GROUP = \"fieldGroup\",\n SELECT = \"select\",\n}\n\nexport enum SourceName {\n AIRTABLE = \"AIRTABLE\",\n ARANGODB = \"ARANGODB\",\n BUDIBASE = \"BUDIBASE\",\n COUCHDB = \"COUCHDB\",\n DYNAMODB = \"DYNAMODB\",\n ELASTICSEARCH = \"ELASTICSEARCH\",\n FIRESTORE = \"FIRESTORE\",\n GOOGLE_SHEETS = \"GOOGLE_SHEETS\",\n MONGODB = \"MONGODB\",\n MYSQL = \"MYSQL\",\n ORACLE = \"ORACLE\",\n POSTGRES = \"POSTGRES\",\n REDIS = \"REDIS\",\n REST = \"REST\",\n S3 = \"S3\",\n SNOWFLAKE = \"SNOWFLAKE\",\n SQL_SERVER = \"SQL_SERVER\",\n}\n\nexport enum IncludeRelationship {\n INCLUDE = 1,\n EXCLUDE = 0,\n}\n\nexport enum FilterType {\n STRING = \"string\",\n FUZZY = \"fuzzy\",\n RANGE = \"range\",\n EQUAL = \"equal\",\n NOT_EQUAL = \"notEqual\",\n EMPTY = \"empty\",\n NOT_EMPTY = \"notEmpty\",\n ONE_OF = \"oneOf\",\n}\n\nexport enum DatasourceFeature {\n CONNECTION_CHECKING = \"connection\",\n FETCH_TABLE_NAMES = \"fetch_table_names\",\n EXPORT_SCHEMA = \"export_schema\",\n}\n\nexport interface StepDefinition {\n key: string\n template: string\n}\n\nexport interface QueryDefinition {\n type: QueryType\n displayName?: string\n readable?: boolean\n customisable?: boolean\n fields?: object\n urlDisplay?: boolean\n steps?: Array<StepDefinition>\n}\n\nexport interface ExtraQueryConfig {\n [key: string]: {\n displayName: string\n type: string\n required: boolean\n data?: object\n }\n}\n\ninterface DatasourceBasicFieldConfig {\n type: DatasourceFieldType\n display?: string\n required?: boolean\n default?: any\n deprecated?: boolean\n hidden?: string\n placeholder?: string\n}\n\ninterface DatasourceSelectFieldConfig extends DatasourceBasicFieldConfig {\n type: DatasourceFieldType.SELECT\n config: { options: string[] }\n}\n\ninterface DatasourceFieldGroupConfig extends DatasourceBasicFieldConfig {\n type: DatasourceFieldType.FIELD_GROUP\n config: {\n openByDefault?: boolean\n nestedFields?: boolean\n }\n}\n\ntype DatasourceFieldConfig =\n | DatasourceSelectFieldConfig\n | DatasourceFieldGroupConfig\n | DatasourceBasicFieldConfig\n\nexport interface DatasourceConfig {\n [key: string]: DatasourceFieldConfig & {\n fields?: DatasourceConfig\n }\n}\n\nexport interface Integration {\n docs: string\n plus?: boolean\n isSQL?: boolean\n auth?: { type: string }\n features?: Partial<Record<DatasourceFeature, boolean>>\n relationships?: boolean\n description: string\n friendlyName: string\n type?: string\n iconUrl?: string\n datasource?: DatasourceConfig\n query: {\n [key: string]: QueryDefinition\n }\n extra?: ExtraQueryConfig\n}\n\nexport type ConnectionInfo = {\n connected: boolean\n error?: string\n}\n\nexport interface IntegrationBase {\n create?(query: any): Promise<any[] | any>\n read?(query: any): Promise<any[] | any>\n update?(query: any): Promise<any[] | any>\n delete?(query: any): Promise<any[] | any>\n patch?(query: any): Promise<any[] | any>\n testConnection?(): Promise<ConnectionInfo>\n getExternalSchema?(): Promise<string>\n defineTypeCastingFromSchema?(schema: {\n [key: string]: {\n name: string\n type: string\n }\n }): void\n}\n\nexport interface Schema {\n tables: Record<string, Table>\n errors: Record<string, string>\n}\n\n// return these when an operation occurred but we got no response\nexport enum DSPlusOperation {\n CREATE = \"create\",\n READ = \"read\",\n UPDATE = \"update\",\n DELETE = \"delete\",\n}\n\nexport type DatasourcePlusQueryResponse =\n | Row[]\n | Record<DSPlusOperation, boolean>[]\n | { total: number }[]\n | void\n\nexport interface DatasourcePlus extends IntegrationBase {\n // if the datasource supports the use of bindings directly (to protect against SQL injection)\n // this returns the format of the identifier\n getBindingIdentifier(): string\n getStringConcat(parts: string[]): string\n query(json: EnrichedQueryJson): Promise<DatasourcePlusQueryResponse>\n buildSchema(\n datasourceId: string,\n entities: Record<string, Table>,\n filter?: string[]\n ): Promise<Schema>\n getTableNames(): Promise<string[]>\n}\n", "import { Operation } from \"./datasources\"\nimport { Row, DocumentType, Table, Datasource } from \"../documents\"\nimport { SortOrder, SortType } from \"../api\"\nimport { Knex } from \"knex\"\nimport { Aggregation } from \"./row\"\nimport isPlainObject from \"lodash/isPlainObject\"\n\nexport enum BasicOperator {\n EQUAL = \"equal\",\n NOT_EQUAL = \"notEqual\",\n EMPTY = \"empty\",\n NOT_EMPTY = \"notEmpty\",\n FUZZY = \"fuzzy\",\n STRING = \"string\",\n}\n\nexport enum ArrayOperator {\n CONTAINS = \"contains\",\n NOT_CONTAINS = \"notContains\",\n CONTAINS_ANY = \"containsAny\",\n ONE_OF = \"oneOf\",\n}\n\nexport enum RangeOperator {\n RANGE = \"range\",\n}\n\nexport enum LogicalOperator {\n AND = \"$and\",\n OR = \"$or\",\n}\n\nexport function isLogicalSearchOperator(\n value: string\n): value is LogicalOperator {\n return Object.values(LogicalOperator).includes(value as LogicalOperator)\n}\n\nexport function isBasicSearchOperator(value: string): value is BasicOperator {\n return Object.values(BasicOperator).includes(value as BasicOperator)\n}\n\nexport function isArraySearchOperator(value: string): value is ArrayOperator {\n return Object.values(ArrayOperator).includes(value as ArrayOperator)\n}\n\nexport function isRangeSearchOperator(value: string): value is RangeOperator {\n return Object.values(RangeOperator).includes(value as RangeOperator)\n}\n\nexport type SearchFilterOperator =\n | BasicOperator\n | ArrayOperator\n | RangeOperator\n | LogicalOperator\n\nexport enum InternalSearchFilterOperator {\n COMPLEX_ID_OPERATOR = \"_complexIdOperator\",\n}\n\ntype BasicFilter<T = any> = Record<string, T> & {\n [InternalSearchFilterOperator.COMPLEX_ID_OPERATOR]?: never\n}\n\nexport type ArrayFilter = Record<string, any[]> & {\n [InternalSearchFilterOperator.COMPLEX_ID_OPERATOR]?: {\n id: string[]\n values: string[]\n }\n}\n\ntype RangeFilter = Record<\n string,\n | {\n high: number | string\n low: number | string\n }\n | { high: number | string }\n | { low: number | string }\n> & {\n [InternalSearchFilterOperator.COMPLEX_ID_OPERATOR]?: never\n}\n\ntype LogicalFilter = { conditions: SearchFilters[] }\n\nexport function isLogicalFilter(filter: any): filter is LogicalFilter {\n return isPlainObject(filter) && \"conditions\" in filter\n}\n\nexport type AnySearchFilter = BasicFilter | ArrayFilter | RangeFilter\n\nexport interface SearchFilters {\n allOr?: boolean\n // TODO: this is just around for now - we need a better way to do or/and\n // allows just fuzzy to be or - all the fuzzy/like parameters\n fuzzyOr?: boolean\n onEmptyFilter?: EmptyFilterOption\n [BasicOperator.STRING]?: BasicFilter<string>\n [BasicOperator.FUZZY]?: BasicFilter<string>\n [RangeOperator.RANGE]?: RangeFilter\n [BasicOperator.EQUAL]?: BasicFilter\n [BasicOperator.NOT_EQUAL]?: BasicFilter\n [BasicOperator.EMPTY]?: BasicFilter\n [BasicOperator.NOT_EMPTY]?: BasicFilter\n [ArrayOperator.ONE_OF]?: ArrayFilter\n [ArrayOperator.CONTAINS]?: ArrayFilter\n [ArrayOperator.NOT_CONTAINS]?: ArrayFilter\n [ArrayOperator.CONTAINS_ANY]?: ArrayFilter\n // specific to SQS/SQLite search on internal tables this can be used\n // to make sure the documents returned are always filtered down to a\n // specific document type (such as just rows)\n documentType?: DocumentType\n\n [LogicalOperator.AND]?: LogicalFilter\n [LogicalOperator.OR]?: LogicalFilter\n}\n\nexport type SearchFilterKey = keyof Omit<\n SearchFilters,\n \"allOr\" | \"onEmptyFilter\" | \"fuzzyOr\" | \"documentType\"\n>\n\nexport type SearchQueryFields = Omit<SearchFilters, \"allOr\" | \"onEmptyFilter\">\n\nexport interface SortJson {\n [key: string]: {\n direction: SortOrder\n type?: SortType\n }\n}\n\nexport interface PaginationJson {\n limit: number\n page?: string | number\n offset?: number\n}\n\nexport interface RenameColumn {\n old: string\n updated: string\n}\n\nexport interface RelationshipsJson {\n through?: string\n from?: string\n to?: string\n fromPrimary?: string\n toPrimary?: string\n tableName: string\n column: string\n}\n\n// TODO - this can be combined with the above type\nexport interface ManyToManyRelationshipJson {\n through: string\n from: string\n to: string\n fromPrimary: string\n toPrimary: string\n tableName: string\n column: string\n}\n\nexport interface QueryJson {\n endpoint: {\n datasourceId: string | Datasource\n entityId: string | Table\n operation: Operation\n schema?: string\n }\n resource?: {\n fields: string[]\n aggregations?: Aggregation[]\n }\n filters?: SearchFilters\n sort?: SortJson\n paginate?: PaginationJson\n body?: Row | Row[]\n meta?: {\n renamed?: RenameColumn\n oldTable?: Table\n // can specify something that columns could be prefixed with\n columnPrefix?: string\n }\n extra?: {\n idFilter?: SearchFilters\n }\n relationships?: RelationshipsJson[]\n tableAliases?: Record<string, string>\n}\n\nexport interface EnrichedQueryJson extends Omit<QueryJson, \"endpoint\"> {\n operation: Operation\n table: Table\n tables: Record<string, Table>\n datasource?: Datasource\n schema?: string\n}\n\nexport interface QueryOptions {\n disableReturning?: boolean\n disableBindings?: boolean\n}\n\nexport type SqlQueryBinding = Knex.Value[]\n\nexport interface SqlQuery {\n sql: string\n bindings?: SqlQueryBinding\n}\n\nexport enum EmptyFilterOption {\n RETURN_ALL = \"all\",\n RETURN_NONE = \"none\",\n}\n\nexport enum UILogicalOperator {\n ALL = \"all\",\n ANY = \"any\",\n}\n\nexport enum SqlClient {\n MS_SQL = \"mssql\",\n POSTGRES = \"pg\",\n MY_SQL = \"mysql2\",\n MARIADB = \"mariadb\",\n ORACLE = \"oracledb\",\n SQL_LITE = \"sqlite3\",\n}\n", "import { Context, Request } from \"koa\"\nimport {\n Role,\n UserRoles,\n Account,\n Row,\n Table,\n UserBindings,\n User,\n UserSSO,\n} from \"../documents\"\nimport { FeatureFlag, License } from \"../sdk\"\nimport { Files } from \"formidable\"\nimport { EventType } from \"../core\"\nimport { UserAgentContext } from \"koa-useragent\"\n\nexport enum LoginMethod {\n API_KEY = \"api_key\",\n COOKIE = \"cookie\",\n}\n\nexport interface ContextUser extends Omit<User & Partial<UserSSO>, \"roles\"> {\n globalId?: string\n license?: License\n userId?: string\n roleId?: string | null\n role?: Role\n roles?: UserRoles\n csrfToken?: string\n featureFlags?: FeatureFlag[]\n accountPortalAccess?: boolean\n account?: Account\n}\n\n/**\n * Add support for koa-body in context.\n */\nexport interface BBRequest<RequestBody> extends Request {\n body: RequestBody\n files?: Files\n}\n\n/**\n * Basic context with no user.\n */\nexport interface Ctx<\n RequestBody = any,\n ResponseBody = any,\n Params extends Record<string, any> = any,\n> extends Context {\n params: Params\n request: BBRequest<RequestBody>\n body: ResponseBody\n userAgent: UserAgentContext[\"userAgent\"]\n state: { nonce?: string }\n}\n\n/**\n * Authenticated context.\n */\nexport interface UserCtx<\n RequestBody = any,\n ResponseBody = any,\n Params extends Record<string, any> = any,\n> extends Ctx<RequestBody, ResponseBody, Params> {\n user: ContextUser\n state: { nonce?: string }\n roleId?: string\n eventEmitter?: ContextEmitter\n loginMethod?: LoginMethod\n}\n\n/**\n * @deprecated: Use UserCtx / Ctx appropriately\n * Authenticated context.\n */\nexport interface BBContext extends Ctx {\n user?: ContextUser\n}\n\nexport interface ContextEmitter {\n emitRow(values: {\n eventName: EventType.ROW_SAVE\n appId: string\n row: Row\n table: Table\n user: UserBindings\n }): void\n emitRow(values: {\n eventName: EventType.ROW_UPDATE\n appId: string\n row: Row\n table: Table\n oldRow: Row\n user: UserBindings\n }): void\n emitRow(values: {\n eventName: EventType.ROW_DELETE\n appId: string\n row: Row\n user: UserBindings\n }): void\n emitTable(\n eventName: EventType.TABLE_SAVE | EventType.TABLE_DELETE,\n appId: string,\n table?: Table\n ): void\n}\n", "import Redlock from \"redlock\"\n\nexport enum LockType {\n /**\n * If this lock is already held the attempted operation will not be performed.\n * No retries will take place and no error will be thrown.\n */\n TRY_ONCE = \"try_once\",\n TRY_TWICE = \"try_twice\",\n DEFAULT = \"default\",\n DELAY_500 = \"delay_500\",\n CUSTOM = \"custom\",\n AUTO_EXTEND = \"auto_extend\",\n}\n\nexport enum LockName {\n MIGRATIONS = \"migrations\",\n TRIGGER_QUOTA = \"trigger_quota\",\n SYNC_ACCOUNT_LICENSE = \"sync_account_license\",\n UPDATE_TENANTS_DOC = \"update_tenants_doc\",\n PERSIST_WRITETHROUGH = \"persist_writethrough\",\n QUOTA_USAGE_EVENT = \"quota_usage_event\",\n APP_MIGRATION = \"app_migrations\",\n PROCESS_USER_INVITE = \"process_user_invite\",\n SQS_SYNC_DEFINITIONS = \"sys_sync_definitions\",\n}\n\nexport type LockOptions = {\n /**\n * The lock type determines which client to use\n */\n type: LockType\n /**\n * The custom options to use when creating the redlock instance\n * type must be set to custom for the options to be applied\n */\n customOptions?: Redlock.Options\n /**\n * The name for the lock\n */\n name: LockName\n /**\n * The individual resource to lock. This is useful for locking around very specific identifiers, e.g. a document that is prone to conflicts\n */\n resource?: string\n /**\n * This is a system-wide lock - don't use tenancy in lock key\n */\n systemLock?: boolean\n} & (\n | {\n /**\n * The ttl to auto-expire the lock if not unlocked manually\n */\n ttl: number\n type: Exclude<LockType, LockType.AUTO_EXTEND>\n }\n | {\n type: LockType.AUTO_EXTEND\n onExtend?: () => void\n }\n)\n", "import type Nano from \"@budibase/nano\"\nimport {\n AllDocsResponse,\n AnyDocument,\n Document,\n RowValue,\n SqlQueryBinding,\n ViewTemplateOpts,\n} from \"../\"\nimport { Writable } from \"stream\"\nimport { ReadStream } from \"fs\"\n\nexport enum SearchIndex {\n ROWS = \"rows\",\n USER = \"user\",\n}\n\nexport type PouchOptions = {\n inMemory?: boolean\n replication?: boolean\n onDisk?: boolean\n find?: boolean\n}\n\nexport enum SortOption {\n ASCENDING = \"asc\",\n DESCENDING = \"desc\",\n}\n\nexport type IndexAnalyzer = {\n name: string\n default?: string\n fields?: Record<string, string>\n}\n\nexport type DBView = {\n name?: string\n map: string\n reduce?: string\n meta?: ViewTemplateOpts\n groupBy?: string\n version?: number\n}\n\nexport type DatabaseOpts = {\n skip_setup?: boolean\n}\n\nexport interface DesignDocument extends Document {\n // we use this static reference for all design documents\n _id: \"_design/database\"\n language?: string\n // CouchDB views\n views?: {\n [viewName: string]: DBView\n }\n // Lucene indexes\n indexes?: {\n [indexName: string]: {\n index: string\n analyzer?: string | IndexAnalyzer\n }\n }\n}\n\nexport type DatabasePutOpts = {\n force?: boolean\n returnDoc?: boolean\n}\n\nexport type DatabaseCreateIndexOpts = {\n index: {\n fields: string[]\n name?: string | undefined\n ddoc?: string | undefined\n type?: string | undefined\n }\n}\n\nexport type DatabaseDeleteIndexOpts = {\n name: string\n ddoc: string\n type?: string | undefined\n}\n\ntype DBPrimitiveKey = string | number | {}\nexport type DatabaseKey = DBPrimitiveKey | DBPrimitiveKey[]\n\nexport type DatabaseQueryOpts = {\n include_docs?: boolean\n startkey?: DatabaseKey\n endkey?: DatabaseKey\n limit?: number\n skip?: number\n descending?: boolean\n key?: DatabaseKey\n keys?: DatabaseKey[]\n group?: boolean\n startkey_docid?: string\n}\n\nexport const isDocument = (doc: any): doc is Document => {\n return typeof doc === \"object\" && doc._id && doc._rev\n}\n\nexport interface DatabaseDumpOpts {\n filter?: (doc: AnyDocument) => boolean\n batch_size?: number\n batch_limit?: number\n style?: \"main_only\" | \"all_docs\"\n timeout?: number\n doc_ids?: string[]\n query_params?: any\n view?: string\n selector?: any\n}\n\nexport interface Database {\n name: string\n\n exists(): Promise<boolean>\n exists(docId: string): Promise<boolean>\n /**\n * @deprecated the plan is to get everything using `tryGet` instead, then rename\n * `tryGet` to `get`.\n */\n get<T extends Document>(id?: string): Promise<T>\n tryGet<T extends Document>(id?: string): Promise<T | undefined>\n getMultiple<T extends Document>(\n ids?: string[],\n opts?: { allowMissing?: boolean; excludeDocs?: boolean }\n ): Promise<T[]>\n remove(idOrDoc: Document): Promise<Nano.DocumentDestroyResponse>\n remove(idOrDoc: string, rev?: string): Promise<Nano.DocumentDestroyResponse>\n bulkRemove(\n documents: Document[],\n opts?: { silenceErrors?: boolean }\n ): Promise<void>\n put<T extends AnyDocument>(\n document: T,\n opts: DatabasePutOpts & { returnDoc: true }\n ): Promise<Nano.DocumentInsertResponse & { doc: T }>\n put<T extends AnyDocument>(\n document: T,\n opts?: DatabasePutOpts & { returnDoc?: false }\n ): Promise<Nano.DocumentInsertResponse>\n bulkDocs(documents: AnyDocument[]): Promise<Nano.DocumentBulkResponse[]>\n sql<T extends Document>(\n sql: string,\n parameters?: SqlQueryBinding\n ): Promise<T[]>\n sqlPurgeDocument(docIds: string[] | string): Promise<void>\n sqlDiskCleanup(): Promise<void>\n find<T extends Document>(\n params: Nano.MangoQuery\n ): Promise<Nano.MangoResponse<T>>\n allDocs<T extends Document | RowValue>(\n params: DatabaseQueryOpts\n ): Promise<AllDocsResponse<T>>\n query<T extends Document>(\n viewName: string,\n params: DatabaseQueryOpts\n ): Promise<AllDocsResponse<T>>\n destroy(): Promise<Nano.OkResponse>\n compact(): Promise<Nano.OkResponse>\n // these are all PouchDB related functions that are rarely used - in future\n // should be replaced by better typed/non-pouch implemented methods\n dump(stream: Writable, opts?: DatabaseDumpOpts): Promise<any>\n load(stream: ReadStream): Promise<any>\n createIndex(opts: DatabaseCreateIndexOpts): Promise<any>\n deleteIndex(opts: DatabaseDeleteIndexOpts): Promise<any>\n getIndexes(): Promise<any>\n}\n\nexport interface DBError extends Error {\n status: number\n statusCode: number\n reason: string\n name: string\n errid: string\n error: string\n description: string\n}\n", "export interface GetTenantIdOptions {\n allowNoTenant?: boolean\n excludeStrategies?: TenantResolutionStrategy[]\n includeStrategies?: TenantResolutionStrategy[]\n}\n\nexport enum TenantResolutionStrategy {\n USER = \"user\",\n HEADER = \"header\",\n QUERY = \"query\",\n SUBDOMAIN = \"subdomain\",\n PATH = \"path\",\n}\n", "export enum FeatureFlag {\n DEBUG_UI = \"DEBUG_UI\",\n USE_ZOD_VALIDATOR = \"USE_ZOD_VALIDATOR\",\n AI_AGENTS = \"AI_AGENTS\",\n WORKSPACES = \"WORKSPACES\",\n\n // Account-portal\n DIRECT_LOGIN_TO_ACCOUNT_PORTAL = \"DIRECT_LOGIN_TO_ACCOUNT_PORTAL\",\n}\n\nexport const FeatureFlagDefaults: Record<FeatureFlag, boolean> = {\n [FeatureFlag.USE_ZOD_VALIDATOR]: false,\n [FeatureFlag.AI_AGENTS]: false,\n [FeatureFlag.WORKSPACES]: true,\n\n // Account-portal\n [FeatureFlag.DIRECT_LOGIN_TO_ACCOUNT_PORTAL]: false,\n\n [FeatureFlag.DEBUG_UI]: false,\n}\n\nexport type FeatureFlags = typeof FeatureFlagDefaults\n", "export enum AppEnvironment {\n PRODUCTION = \"production\",\n DEVELOPMENT = \"development\",\n}\n", "import { Event } from \"../events\"\n\nexport enum CommandWord {\n BACKUPS = \"backups\",\n HOSTING = \"hosting\",\n ANALYTICS = \"analytics\",\n HELP = \"help\",\n PLUGIN = \"plugins\",\n}\n\nexport enum InitType {\n QUICK = \"quick\",\n DIGITAL_OCEAN = \"do\",\n}\n\nexport const AnalyticsEvent = {\n OptOut: \"analytics:opt:out\",\n OptIn: \"analytics:opt:in\",\n SelfHostInit: \"hosting:init\",\n PluginInit: Event.PLUGIN_INIT,\n}\n", "// used in resource permissions - permissions can be at one of these levels\n// endpoints will set what type of permission they require (e.g. searching requires READ)\nexport enum PermissionLevel {\n READ = \"read\",\n WRITE = \"write\",\n EXECUTE = \"execute\",\n ADMIN = \"admin\",\n}\n\n// used within the role, specifies base permissions\nexport enum BuiltinPermissionID {\n PUBLIC = \"public\",\n READ_ONLY = \"read_only\",\n WRITE = \"write\",\n ADMIN = \"admin\",\n POWER = \"power\",\n}\n\n// these are the global types, that govern the underlying default behaviour\nexport enum PermissionType {\n APP = \"app\",\n TABLE = \"table\",\n USER = \"user\",\n AUTOMATION = \"automation\",\n WEBHOOK = \"webhook\",\n BUILDER = \"builder\",\n CREATOR = \"creator\",\n GLOBAL_BUILDER = \"globalBuilder\",\n QUERY = \"query\",\n VIEW = \"view\",\n LEGACY_VIEW = \"legacy_view\",\n}\n\nexport enum PermissionSource {\n EXPLICIT = \"EXPLICIT\",\n INHERITED = \"INHERITED\",\n BASE = \"BASE\",\n}\n\nexport interface Permission {\n type: PermissionType\n level: PermissionLevel\n}\n\nexport interface BuiltinPermission {\n _id: BuiltinPermissionID\n name: string\n permissions: Permission[]\n}\n\nexport type BuiltinPermissions = {\n [key in keyof typeof BuiltinPermissionID]: {\n _id: (typeof BuiltinPermissionID)[key]\n name: string\n permissions: Permission[]\n }\n}\n", "import { SortOrder, SortType } from \"../api\"\nimport { SearchFilters } from \"./search\"\nimport { CalculationType, Row } from \"../documents\"\nimport { WithRequired } from \"../shared\"\n\nexport interface BaseAggregation {\n name: string\n}\n\nexport interface NumericAggregation extends BaseAggregation {\n calculationType:\n | CalculationType.AVG\n | CalculationType.MAX\n | CalculationType.MIN\n | CalculationType.SUM\n field: string\n}\n\nexport interface CountAggregation extends BaseAggregation {\n calculationType: CalculationType.COUNT\n field: string\n}\n\nexport interface CountDistinctAggregation extends CountAggregation {\n distinct: true\n}\n\nexport type Aggregation =\n | NumericAggregation\n | CountAggregation\n | CountDistinctAggregation\n\nexport interface SearchParams {\n tableId?: string\n viewId?: string\n query?: SearchFilters\n paginate?: boolean\n bookmark?: string | number\n limit?: number\n sort?: string\n sortOrder?: SortOrder\n sortType?: SortType\n version?: string\n disableEscaping?: boolean\n fields?: string[]\n indexer?: () => Promise<any>\n rows?: Row[]\n countRows?: boolean\n}\n\n// when searching for rows we want a more extensive search type that requires certain properties\nexport interface RowSearchParams\n extends WithRequired<SearchParams, \"tableId\" | \"query\"> {}\n\nexport interface SearchResponse<T> {\n rows: T[]\n hasNextPage?: boolean\n bookmark?: string | number\n totalRows?: number\n}\n\nexport enum RowExportFormat {\n CSV = \"csv\",\n JSON = \"json\",\n JSON_WITH_SCHEMA = \"jsonWithSchema\",\n}\n", "import { Feature, Hosting, License, PlanType, Quotas } from \"../../sdk\"\nimport { DeepPartial } from \"../../shared\"\nimport { QuotaUsage } from \"../global\"\n\nexport interface CreateAccount {\n email: string\n tenantId: string\n hosting: Hosting\n authType: AuthType\n accountName: string\n // optional fields - for sso based sign ups\n registrationStep?: string\n name?: string\n size?: string\n profession?: string\n}\n\nexport interface CreatePassswordAccount extends CreateAccount {\n password: string\n}\n\nexport const isCreatePasswordAccount = (\n account: CreateAccount\n): account is CreatePassswordAccount => account.authType === AuthType.PASSWORD\n\nexport interface LicenseOverrides {\n features?: Feature[]\n quotas?: DeepPartial<Quotas>\n}\n\nexport interface Account extends CreateAccount {\n // generated\n accountId: string\n createdAt: number\n // registration\n verified: boolean\n verificationSent: boolean\n // licensing\n planType?: PlanType\n license?: License\n installId?: string\n installTenantId?: string\n installVersion?: string\n stripeCustomerId?: string\n licenseKey?: string\n licenseKeyActivatedAt?: number\n licenseRequestedAt?: number\n licenseOverrides?: LicenseOverrides\n provider?: AccountSSOProvider\n providerType?: AccountSSOProviderType\n quotaUsage?: QuotaUsage\n offlineLicenseToken?: string\n tenantName?: string\n}\n\nexport interface PasswordAccount extends Account {\n password: string\n}\n\nexport const isPasswordAccount = (\n account: Account\n): account is PasswordAccount =>\n account.authType === AuthType.PASSWORD && account.hosting === Hosting.SELF\n\nexport interface CloudAccount extends Account {\n password?: string\n budibaseUserId: string\n}\n\nexport const isCloudAccount = (account: Account): account is CloudAccount =>\n account.hosting === Hosting.CLOUD\n\nexport const isSelfHostAccount = (account: Account) =>\n account.hosting === Hosting.SELF\n\nexport const isSSOAccount = (account: Account): account is SSOAccount =>\n account.authType === AuthType.SSO\n\nexport enum AccountSSOProviderType {\n GOOGLE = \"google\",\n MICROSOFT = \"microsoft\",\n}\n\nexport enum AccountSSOProvider {\n GOOGLE = \"google\",\n MICROSOFT = \"microsoft\",\n}\n\nconst verifiableSSOProviders: AccountSSOProvider[] = [\n AccountSSOProvider.MICROSOFT,\n]\nexport function isVerifiableSSOProvider(provider: AccountSSOProvider): boolean {\n return verifiableSSOProviders.includes(provider)\n}\n\nexport interface AccountSSO {\n ssoId?: string\n provider: AccountSSOProvider\n providerType: AccountSSOProviderType\n oauth2?: OAuthTokens\n}\n\nexport type SSOAccount = (Account | CloudAccount) & AccountSSO\n\nexport enum AuthType {\n SSO = \"sso\",\n PASSWORD = \"password\",\n}\n\nexport interface OAuthTokens {\n accessToken: string\n refreshToken: string\n}\n", "export const SEPARATOR = \"_\"\nexport const UNICODE_MAX = \"\\ufff0\"\n\nexport const prefixed = (type: DocumentType) => `${type}${SEPARATOR}`\n\nexport enum DocumentType {\n USER = \"us\",\n GROUP = \"gr\",\n WORKSPACE = \"workspace\",\n CONFIG = \"config\",\n TEMPLATE = \"template\",\n APP = \"app\",\n DEV = \"dev\",\n APP_DEV = \"app_dev\",\n APP_METADATA = \"app_metadata\",\n ROLE = \"role\",\n DEV_INFO = \"devinfo\",\n AUTOMATION_LOG = \"log_au\",\n ACCOUNT_METADATA = \"acc_metadata\",\n PLUGIN = \"plg\",\n DATASOURCE = \"datasource\",\n DATASOURCE_PLUS = \"datasource_plus\",\n APP_BACKUP = \"backup\",\n TABLE = \"ta\",\n ROW = \"ro\",\n AUTOMATION = \"au\",\n LINK = \"li\",\n WEBHOOK = \"wh\",\n INSTANCE = \"inst\",\n LAYOUT = \"layout\",\n SCREEN = \"screen\",\n QUERY = \"query\",\n DEPLOYMENTS = \"deployments\",\n METADATA = \"metadata\",\n MEM_VIEW = \"view\",\n USER_FLAG = \"flag\",\n AUTOMATION_METADATA = \"meta_au\",\n AUDIT_LOG = \"al\",\n SCIM_LOG = \"scimlog\",\n ROW_ACTIONS = \"ra\",\n OAUTH2_CONFIG = \"oauth2\",\n OAUTH2_CONFIG_LOG = \"oauth2log\",\n AGENT_CHAT = \"agentchat\",\n AGENT_TOOL_SOURCE = \"agenttoolsource\",\n WORKSPACE_APP = \"workspace_app\",\n WORKSPACE_FAVOURITE = \"workspace_favourite\",\n}\n\n// these are the core documents that make up the data, design\n// and automation sections of an app. This excludes any internal\n// rows as we shouldn't import data.\nexport const DocumentTypesToImport: DocumentType[] = [\n DocumentType.ROLE,\n DocumentType.DATASOURCE,\n DocumentType.DATASOURCE_PLUS,\n DocumentType.TABLE,\n DocumentType.AUTOMATION,\n DocumentType.WEBHOOK,\n DocumentType.SCREEN,\n DocumentType.QUERY,\n DocumentType.METADATA,\n DocumentType.MEM_VIEW,\n DocumentType.WORKSPACE_APP,\n DocumentType.WORKSPACE_FAVOURITE,\n // Deprecated but still copied\n DocumentType.INSTANCE,\n DocumentType.LAYOUT,\n]\n\nexport enum InternalTable {\n USER_METADATA = \"ta_users\",\n}\n\n// these documents don't really exist, they are part of other\n// documents or enriched into existence as part of get requests\nexport enum VirtualDocumentType {\n VIEW = \"view\",\n ROW_ACTION = \"row_action\",\n}\n\nexport interface Document {\n _id?: string\n _rev?: string\n // document has been tombstoned - needed for replication\n _deleted?: boolean\n createdAt?: string | number\n updatedAt?: string\n}\n\nexport interface AnyDocument extends Document {\n [key: string]: any\n}\n", "import { Document } from \"../../document\"\nimport { User } from \"../../global\"\nimport { Row } from \"../row\"\nimport { Table } from \"../table\"\nimport { AutomationStep, AutomationTrigger } from \"./schema\"\nimport { ContextEmitter } from \"../../../sdk\"\nimport { Readable } from \"stream\"\nimport { LoopSummary } from \"./StepInputsOutputs\"\n\nexport enum AutomationIOType {\n OBJECT = \"object\",\n STRING = \"string\",\n BOOLEAN = \"boolean\",\n NUMBER = \"number\",\n ARRAY = \"array\",\n JSON = \"json\",\n DATE = \"date\",\n DATETIME = \"datetime\",\n ATTACHMENT = \"attachment\",\n LONGFORM = \"longform\",\n}\n\nexport enum AutomationCustomIOType {\n TABLE = \"table\",\n ROW = \"row\",\n ROWS = \"rows\",\n WIDE = \"wide\",\n QUERY = \"query\",\n QUERY_PARAMS = \"queryParams\",\n QUERY_LIMIT = \"queryLimit\",\n LOOP_OPTION = \"loopOption\",\n ITEM = \"item\",\n CODE = \"code\",\n FILTERS = \"filters\",\n COLUMN = \"column\",\n TRIGGER_SCHEMA = \"triggerSchema\",\n CRON = \"cron\",\n WEBHOOK_URL = \"webhookUrl\",\n AUTOMATION = \"automation\",\n AUTOMATION_FIELDS = \"automationFields\",\n MULTI_ATTACHMENTS = \"multi_attachments\",\n TRIGGER_FILTER = \"trigger_filter\",\n CATEGORIES = \"categories\",\n}\n\nexport enum AutomationTriggerStepId {\n ROW_SAVED = \"ROW_SAVED\",\n ROW_UPDATED = \"ROW_UPDATED\",\n ROW_DELETED = \"ROW_DELETED\",\n WEBHOOK = \"WEBHOOK\",\n APP = \"APP\",\n CRON = \"CRON\",\n ROW_ACTION = \"ROW_ACTION\",\n}\n\nexport enum AutomationStepType {\n LOGIC = \"LOGIC\",\n ACTION = \"ACTION\",\n TRIGGER = \"TRIGGER\",\n}\n\nexport enum AutomationActionStepId {\n SEND_EMAIL_SMTP = \"SEND_EMAIL_SMTP\",\n CREATE_ROW = \"CREATE_ROW\",\n UPDATE_ROW = \"UPDATE_ROW\",\n DELETE_ROW = \"DELETE_ROW\",\n EXECUTE_BASH = \"EXECUTE_BASH\",\n OUTGOING_WEBHOOK = \"OUTGOING_WEBHOOK\",\n EXECUTE_SCRIPT = \"EXECUTE_SCRIPT\",\n EXECUTE_SCRIPT_V2 = \"EXECUTE_SCRIPT_V2\",\n EXECUTE_QUERY = \"EXECUTE_QUERY\",\n SERVER_LOG = \"SERVER_LOG\",\n DELAY = \"DELAY\",\n FILTER = \"FILTER\",\n API_REQUEST = \"API_REQUEST\",\n QUERY_ROWS = \"QUERY_ROWS\",\n LOOP = \"LOOP\",\n COLLECT = \"COLLECT\",\n OPENAI = \"OPENAI\",\n TRIGGER_AUTOMATION_RUN = \"TRIGGER_AUTOMATION_RUN\",\n BRANCH = \"BRANCH\",\n CLASSIFY_CONTENT = \"CLASSIFY_CONTENT\",\n PROMPT_LLM = \"PROMPT_LLM\",\n TRANSLATE = \"TRANSLATE\",\n SUMMARISE = \"SUMMARISE\",\n GENERATE_TEXT = \"GENERATE_TEXT\",\n EXTRACT_FILE_DATA = \"EXTRACT_FILE_DATA\",\n EXTRACT_STATE = \"EXTRACT_STATE\",\n LOOP_V2 = \"LOOP_V2\",\n // these used to be lowercase step IDs, maintain for backwards compat\n discord = \"discord\",\n slack = \"slack\",\n zapier = \"zapier\",\n integromat = \"integromat\",\n n8n = \"n8n\",\n}\n\nexport interface EmailInvite {\n startTime: Date\n endTime: Date\n summary: string\n location?: string\n url?: string\n}\n\nexport interface EmailAttachment {\n url: string\n filename: string\n}\n\nexport interface SendEmailOpts {\n to?: string\n // workspaceId If finer grain controls being used then this will lookup config for workspace.\n workspaceId?: string\n // user If sending to an existing user the object can be provided, this is used in the context.\n user?: User\n // from If sending from an address that is not what is configured in the SMTP config.\n from?: string\n // contents If sending a custom email then can supply contents which will be added to it.\n contents?: string\n // subject A custom subject can be specified if the config one is not desired.\n subject: string\n // info Pass in a structure of information to be stored alongside the invitation.\n info?: any\n cc?: string\n bcc?: string\n automation?: boolean\n invite?: EmailInvite\n attachments?: EmailAttachment[]\n}\n\nexport const AutomationStepIdArray = [\n ...Object.values(AutomationActionStepId),\n ...Object.values(AutomationTriggerStepId),\n]\n\nexport interface Automation extends Document {\n definition: {\n steps: AutomationStep[]\n trigger: AutomationTrigger\n // stepNames is used to lookup step names from their correspnding step ID.\n stepNames?: Record<string, string>\n }\n screenId?: string\n uiTree?: any\n appId: string\n live?: boolean\n name: string\n internal?: boolean\n type?: string\n disabled?: boolean\n testData?: AutomationTriggerResultOutputs\n}\n\nexport interface BaseIOStructure {\n type?: AutomationIOType\n subtype?: AutomationIOType\n customType?: AutomationCustomIOType\n title?: string\n description?: string\n dependsOn?: string | { field: string; value: string | string[] }\n enum?: string[]\n pretty?: string[]\n properties?: AutomationIOProps\n required?: string[]\n readonly?: true\n}\n\nexport interface InputOutputBlock {\n properties: AutomationIOProps\n required?: string[]\n}\n\nexport interface AutomationIOProps {\n [key: string]: BaseIOStructure\n}\n\nexport enum AutomationFeature {\n LOOPING = \"LOOPING\",\n}\n\nexport enum AutomationStepStatus {\n NO_ITERATIONS = \"no_iterations\",\n MAX_ITERATIONS = \"max_iterations_reached\",\n FAILURE_CONDITION = \"FAILURE_CONDITION_MET\",\n INCORRECT_TYPE = \"INCORRECT_TYPE\",\n}\n\nexport enum AutomationStatus {\n SUCCESS = \"success\",\n ERROR = \"error\",\n STOPPED = \"stopped\",\n STOPPED_ERROR = \"stopped_error\",\n NO_CONDITION_MET = \"No branch condition met\",\n TIMED_OUT = \"timed_out\",\n}\n\nexport enum AutomationStoppedReason {\n TRIGGER_FILTER_NOT_MET = \"Automation did not run. Filter conditions in trigger were not met.\",\n TIMED_OUT = \"Automation timed out.\",\n}\n\nexport interface AutomationStepResultOutputs {\n success: boolean\n [key: string]: any\n}\n\nexport interface AutomationStepResultInputs {\n [key: string]: any\n}\n\nexport interface AutomationStepResult {\n id: string\n name?: string\n icon?: string\n stepId: AutomationActionStepId\n inputs: AutomationStepResultInputs\n outputs: AutomationStepResultOutputs\n}\n\nexport type AutomationTriggerResultInputs = Record<string, any>\nexport type AutomationTriggerResultOutputs = Record<string, any>\n\nexport interface AutomationTriggerResult {\n id: string\n name?: string\n icon?: string\n stepId: AutomationTriggerStepId\n inputs?: AutomationTriggerResultInputs | null\n outputs: AutomationTriggerResultOutputs\n}\n\nexport interface AutomationResults {\n automationId?: string\n status: AutomationStatus\n trigger: AutomationTriggerResult\n steps: [AutomationTriggerResult, ...AutomationStepResult[]]\n state?: Record<string, any>\n}\n\nexport interface DidNotTriggerResponse {\n outputs: {\n success: false\n status: AutomationStatus.STOPPED\n }\n message: AutomationStoppedReason.TRIGGER_FILTER_NOT_MET\n}\n\nexport interface AutomationLog extends AutomationResults, Document {\n automationName: string\n _rev?: string\n}\n\nexport interface AutomationLogPage {\n data: AutomationLog[]\n hasNextPage: boolean\n nextPage?: string\n}\n\nexport interface AutomationStepInputBase {\n context: Record<string, any>\n emitter: ContextEmitter\n appId: string\n apiKey?: string\n}\n\nexport type ActionImplementation<TInputs, TOutputs> = (\n params: {\n inputs: TInputs\n } & AutomationStepInputBase\n) => Promise<TOutputs>\n\nexport interface AutomationMetadata extends Document {\n errorCount?: number\n automationChainCount?: number\n}\n\nexport type AutomationAttachment = {\n url: string\n filename: string\n}\n\nexport type AutomationAttachmentContent = {\n filename: string\n content: Readable\n}\n\nexport type BucketedContent = AutomationAttachmentContent & {\n bucket: string\n path: string\n}\n\nexport enum AutomationEventType {\n ROW_SAVE = \"row:save\",\n ROW_UPDATE = \"row:update\",\n ROW_DELETE = \"row:delete\",\n APP_TRIGGER = \"app:trigger\",\n CRON_TRIGGER = \"cron:trigger\",\n WEBHOOK_TRIGGER = \"web:trigger\",\n ROW_ACTION = \"row:action\",\n}\n\nexport type UpdatedRowEventEmitter = {\n row: Row\n oldRow: Row\n table: Table\n appId: string\n user: User\n}\n\nexport enum LoopStepType {\n ARRAY = \"Array\",\n STRING = \"String\",\n}\n\nexport enum ContentType {\n EMAIL = \"email\",\n DOCUMENT = \"document\",\n BLOG_POST = \"blog_post\",\n CHAT_MESSAGE = \"chat_message\",\n LETTER = \"letter\",\n PROPOSAL = \"proposal\",\n OTHER = \"other\",\n}\n\nexport const PrettyContentTypes = {\n [ContentType.EMAIL]: \"Email\",\n [ContentType.DOCUMENT]: \"Document\",\n [ContentType.BLOG_POST]: \"Blog post\",\n [ContentType.CHAT_MESSAGE]: \"Chat message\",\n [ContentType.LETTER]: \"Letter\",\n [ContentType.PROPOSAL]: \"Proposal\",\n [ContentType.OTHER]: \"Other\",\n}\n\nexport enum DocumentSourceType {\n URL = \"URL\",\n ATTACHMENT = \"Attachment\",\n}\n\nexport enum SupportedFileType {\n PDF = \"pdf\",\n JPG = \"jpg\",\n PNG = \"png\",\n JPEG = \"jpeg\",\n}\n\nexport const ImageContentTypes = [\n \"png\",\n \"jpg\",\n \"jpeg\",\n \"image/png\",\n \"image/jpeg\",\n \"image/jpg\",\n \"image/jpeg\",\n]\n\nexport interface LoopStorage {\n results: Record<string, AutomationStepResult[]>\n summary: LoopSummary\n nestedSummaries: Record<string, LoopSummary[]>\n maxStoredResults: number\n}\n", "import { Hosting } from \"../../../sdk\"\nimport {\n AutomationActionStepId,\n ActionImplementation,\n AutomationStepType,\n AutomationFeature,\n InputOutputBlock,\n AutomationTriggerStepId,\n AutomationEventType,\n AutomationIOType,\n} from \"./automation\"\nimport {\n CollectStepInputs,\n CollectStepOutputs,\n CreateRowStepInputs,\n CreateRowStepOutputs,\n DelayStepInputs,\n DelayStepOutputs,\n DeleteRowStepInputs,\n DeleteRowStepOutputs,\n ExecuteQueryStepInputs,\n ExecuteQueryStepOutputs,\n ExecuteScriptStepInputs,\n ExecuteScriptStepOutputs,\n FilterStepInputs,\n FilterStepOutputs,\n QueryRowsStepInputs,\n QueryRowsStepOutputs,\n SmtpEmailStepInputs,\n ServerLogStepInputs,\n ServerLogStepOutputs,\n TriggerAutomationStepInputs,\n TriggerAutomationStepOutputs,\n UpdateRowStepInputs,\n UpdateRowStepOutputs,\n OutgoingWebhookStepInputs,\n ExternalAppStepOutputs,\n DiscordStepInputs,\n SlackStepInputs,\n ZapierStepInputs,\n ZapierStepOutputs,\n MakeIntegrationInputs,\n n8nStepInputs,\n BashStepInputs,\n BashStepOutputs,\n OpenAIStepInputs,\n OpenAIStepOutputs,\n LoopStepInputs,\n CronTriggerInputs,\n RowUpdatedTriggerInputs,\n RowCreatedTriggerInputs,\n RowDeletedTriggerInputs,\n BranchStepInputs,\n BaseAutomationOutputs,\n AppActionTriggerOutputs,\n CronTriggerOutputs,\n RowDeletedTriggerOutputs,\n RowCreatedTriggerOutputs,\n RowUpdatedTriggerOutputs,\n WebhookTriggerOutputs,\n RowActionTriggerInputs,\n ClassifyContentStepOutputs,\n ClassifyContentStepInputs,\n PromptLLMStepOutputs,\n PromptLLMStepInputs,\n TranslateStepOutputs,\n TranslateStepInputs,\n SummariseStepInputs,\n SummariseStepOutputs,\n GenerateTextStepInputs,\n GenerateTextStepOutputs,\n ExtractFileDataStepOutputs,\n ExtractFileDataStepInputs,\n APIRequestStepInputs,\n APIRequestStepOutputs,\n BranchSearchFilters,\n ExtractStateStepInputs,\n ExtractStateStepOutputs,\n LoopV2StepInputs,\n LoopV2StepOutputs,\n} from \"./StepInputsOutputs\"\n\nexport type ActionImplementations<T extends Hosting> = {\n [AutomationActionStepId.COLLECT]: ActionImplementation<\n CollectStepInputs,\n CollectStepOutputs\n >\n [AutomationActionStepId.CREATE_ROW]: ActionImplementation<\n CreateRowStepInputs,\n CreateRowStepOutputs\n >\n [AutomationActionStepId.DELAY]: ActionImplementation<\n DelayStepInputs,\n DelayStepOutputs\n >\n [AutomationActionStepId.DELETE_ROW]: ActionImplementation<\n DeleteRowStepInputs,\n DeleteRowStepOutputs\n >\n [AutomationActionStepId.EXECUTE_QUERY]: ActionImplementation<\n ExecuteQueryStepInputs,\n ExecuteQueryStepOutputs\n >\n [AutomationActionStepId.API_REQUEST]: ActionImplementation<\n APIRequestStepInputs,\n APIRequestStepOutputs\n >\n [AutomationActionStepId.EXECUTE_SCRIPT]: ActionImplementation<\n ExecuteScriptStepInputs,\n ExecuteScriptStepOutputs\n >\n [AutomationActionStepId.EXECUTE_SCRIPT_V2]: ActionImplementation<\n ExecuteScriptStepInputs,\n ExecuteScriptStepOutputs\n >\n [AutomationActionStepId.FILTER]: ActionImplementation<\n FilterStepInputs,\n FilterStepOutputs\n >\n [AutomationActionStepId.QUERY_ROWS]: ActionImplementation<\n QueryRowsStepInputs,\n QueryRowsStepOutputs\n >\n [AutomationActionStepId.SEND_EMAIL_SMTP]: ActionImplementation<\n SmtpEmailStepInputs,\n BaseAutomationOutputs\n >\n [AutomationActionStepId.SERVER_LOG]: ActionImplementation<\n ServerLogStepInputs,\n ServerLogStepOutputs\n >\n [AutomationActionStepId.TRIGGER_AUTOMATION_RUN]: ActionImplementation<\n TriggerAutomationStepInputs,\n TriggerAutomationStepOutputs\n >\n [AutomationActionStepId.UPDATE_ROW]: ActionImplementation<\n UpdateRowStepInputs,\n UpdateRowStepOutputs\n >\n [AutomationActionStepId.OUTGOING_WEBHOOK]: ActionImplementation<\n OutgoingWebhookStepInputs,\n ExternalAppStepOutputs\n >\n [AutomationActionStepId.discord]: ActionImplementation<\n DiscordStepInputs,\n ExternalAppStepOutputs\n >\n [AutomationActionStepId.slack]: ActionImplementation<\n SlackStepInputs,\n ExternalAppStepOutputs\n >\n [AutomationActionStepId.zapier]: ActionImplementation<\n ZapierStepInputs,\n ZapierStepOutputs\n >\n [AutomationActionStepId.integromat]: ActionImplementation<\n MakeIntegrationInputs,\n ExternalAppStepOutputs\n >\n [AutomationActionStepId.n8n]: ActionImplementation<\n n8nStepInputs,\n ExternalAppStepOutputs\n >\n [AutomationActionStepId.OPENAI]: ActionImplementation<\n OpenAIStepInputs,\n OpenAIStepOutputs\n >\n [AutomationActionStepId.CLASSIFY_CONTENT]: ActionImplementation<\n ClassifyContentStepInputs,\n ClassifyContentStepOutputs\n >\n [AutomationActionStepId.PROMPT_LLM]: ActionImplementation<\n PromptLLMStepInputs,\n PromptLLMStepOutputs\n >\n [AutomationActionStepId.TRANSLATE]: ActionImplementation<\n TranslateStepInputs,\n TranslateStepOutputs\n >\n [AutomationActionStepId.SUMMARISE]: ActionImplementation<\n SummariseStepInputs,\n SummariseStepOutputs\n >\n [AutomationActionStepId.GENERATE_TEXT]: ActionImplementation<\n GenerateTextStepInputs,\n GenerateTextStepOutputs\n >\n [AutomationActionStepId.EXTRACT_FILE_DATA]: ActionImplementation<\n ExtractFileDataStepInputs,\n ExtractFileDataStepOutputs\n >\n [AutomationActionStepId.EXTRACT_STATE]: ActionImplementation<\n ExtractStateStepInputs,\n ExtractStateStepOutputs\n >\n} & (T extends \"self\"\n ? {\n [AutomationActionStepId.EXECUTE_BASH]: ActionImplementation<\n BashStepInputs,\n BashStepOutputs\n >\n }\n : {})\n\nexport interface AutomationStepSchemaBase {\n name: string\n stepTitle?: string\n event?: AutomationEventType\n tagline: string\n icon: string\n description: string\n type: AutomationStepType\n internal?: boolean\n deprecated?: boolean\n new?: boolean\n blockToLoop?: string\n isLegacyLoop?: boolean\n schema: {\n inputs: InputOutputBlock\n outputs: InputOutputBlock\n }\n custom?: boolean\n features?: Partial<Record<AutomationFeature, boolean>>\n}\n\nexport type AutomationStepInputs<T extends AutomationActionStepId> =\n T extends AutomationActionStepId.COLLECT\n ? CollectStepInputs\n : T extends AutomationActionStepId.CREATE_ROW\n ? CreateRowStepInputs\n : T extends AutomationActionStepId.DELAY\n ? DelayStepInputs\n : T extends AutomationActionStepId.DELETE_ROW\n ? DeleteRowStepInputs\n : T extends AutomationActionStepId.EXECUTE_QUERY\n ? ExecuteQueryStepInputs\n : T extends AutomationActionStepId.API_REQUEST\n ? APIRequestStepInputs\n : T extends AutomationActionStepId.EXECUTE_SCRIPT\n ? ExecuteScriptStepInputs\n : T extends AutomationActionStepId.EXECUTE_SCRIPT_V2\n ? ExecuteScriptStepInputs\n : T extends AutomationActionStepId.FILTER\n ? FilterStepInputs\n : T extends AutomationActionStepId.QUERY_ROWS\n ? QueryRowsStepInputs\n : T extends AutomationActionStepId.SEND_EMAIL_SMTP\n ? SmtpEmailStepInputs\n : T extends AutomationActionStepId.SERVER_LOG\n ? ServerLogStepInputs\n : T extends AutomationActionStepId.TRIGGER_AUTOMATION_RUN\n ? TriggerAutomationStepInputs\n : T extends AutomationActionStepId.UPDATE_ROW\n ? UpdateRowStepInputs\n : T extends AutomationActionStepId.OUTGOING_WEBHOOK\n ? OutgoingWebhookStepInputs\n : T extends AutomationActionStepId.discord\n ? DiscordStepInputs\n : T extends AutomationActionStepId.slack\n ? SlackStepInputs\n : T extends AutomationActionStepId.zapier\n ? ZapierStepInputs\n : T extends AutomationActionStepId.integromat\n ? MakeIntegrationInputs\n : T extends AutomationActionStepId.n8n\n ? n8nStepInputs\n : T extends AutomationActionStepId.EXECUTE_BASH\n ? BashStepInputs\n : T extends AutomationActionStepId.OPENAI\n ? OpenAIStepInputs\n : T extends AutomationActionStepId.LOOP\n ? LoopStepInputs\n : T extends AutomationActionStepId.BRANCH\n ? BranchStepInputs\n : T extends AutomationActionStepId.CLASSIFY_CONTENT\n ? ClassifyContentStepInputs\n : T extends AutomationActionStepId.PROMPT_LLM\n ? PromptLLMStepInputs\n : T extends AutomationActionStepId.TRANSLATE\n ? TranslateStepInputs\n : T extends AutomationActionStepId.SUMMARISE\n ? SummariseStepInputs\n : T extends AutomationActionStepId.GENERATE_TEXT\n ? GenerateTextStepInputs\n : T extends AutomationActionStepId.EXTRACT_FILE_DATA\n ? ExtractFileDataStepInputs\n : T extends AutomationActionStepId.EXTRACT_STATE\n ? ExtractStateStepInputs\n : T extends AutomationActionStepId.LOOP_V2\n ? LoopV2StepInputs\n : never\n\nexport type AutomationStepOutputs<T extends AutomationActionStepId> =\n T extends AutomationActionStepId.COLLECT\n ? CollectStepOutputs\n : T extends AutomationActionStepId.CREATE_ROW\n ? CreateRowStepOutputs\n : T extends AutomationActionStepId.DELAY\n ? DelayStepOutputs\n : T extends AutomationActionStepId.DELETE_ROW\n ? DeleteRowStepOutputs\n : T extends AutomationActionStepId.EXECUTE_QUERY\n ? ExecuteQueryStepOutputs\n : T extends AutomationActionStepId.API_REQUEST\n ? APIRequestStepOutputs\n : T extends AutomationActionStepId.EXECUTE_SCRIPT\n ? ExecuteScriptStepOutputs\n : T extends AutomationActionStepId.EXECUTE_SCRIPT_V2\n ? ExecuteScriptStepOutputs\n : T extends AutomationActionStepId.FILTER\n ? FilterStepOutputs\n : T extends AutomationActionStepId.QUERY_ROWS\n ? QueryRowsStepOutputs\n : T extends AutomationActionStepId.SEND_EMAIL_SMTP\n ? BaseAutomationOutputs\n : T extends AutomationActionStepId.SERVER_LOG\n ? ServerLogStepOutputs\n : T extends AutomationActionStepId.TRIGGER_AUTOMATION_RUN\n ? TriggerAutomationStepOutputs\n : T extends AutomationActionStepId.UPDATE_ROW\n ? UpdateRowStepOutputs\n : T extends AutomationActionStepId.OUTGOING_WEBHOOK\n ? ExternalAppStepOutputs\n : T extends AutomationActionStepId.discord\n ? ExternalAppStepOutputs\n : T extends AutomationActionStepId.slack\n ? ExternalAppStepOutputs\n : T extends AutomationActionStepId.zapier\n ? ZapierStepOutputs\n : T extends AutomationActionStepId.integromat\n ? ExternalAppStepOutputs\n : T extends AutomationActionStepId.EXECUTE_BASH\n ? BashStepOutputs\n : T extends AutomationActionStepId.OPENAI\n ? OpenAIStepOutputs\n : T extends AutomationActionStepId.LOOP\n ? BaseAutomationOutputs\n : T extends AutomationActionStepId.CLASSIFY_CONTENT\n ? ClassifyContentStepOutputs\n : T extends AutomationActionStepId.PROMPT_LLM\n ? PromptLLMStepOutputs\n : T extends AutomationActionStepId.TRANSLATE\n ? TranslateStepOutputs\n : T extends AutomationActionStepId.SUMMARISE\n ? SummariseStepOutputs\n : T extends AutomationActionStepId.GENERATE_TEXT\n ? GenerateTextStepOutputs\n : T extends AutomationActionStepId.EXTRACT_FILE_DATA\n ? ExtractFileDataStepOutputs\n : T extends AutomationActionStepId.EXTRACT_STATE\n ? ExtractStateStepOutputs\n : T extends AutomationActionStepId.LOOP_V2\n ? LoopV2StepOutputs\n : never\n\nexport interface AutomationStepSchema<TStep extends AutomationActionStepId>\n extends AutomationStepSchemaBase {\n id: string\n stepId: TStep\n inputs: AutomationStepInputs<TStep>\n}\n\nexport type CollectStep = AutomationStepSchema<AutomationActionStepId.COLLECT>\n\nexport type CreateRowStep =\n AutomationStepSchema<AutomationActionStepId.CREATE_ROW>\n\nexport type DelayStep = AutomationStepSchema<AutomationActionStepId.DELAY>\n\nexport type DeleteRowStep =\n AutomationStepSchema<AutomationActionStepId.DELETE_ROW>\n\nexport type ExecuteQueryStep =\n AutomationStepSchema<AutomationActionStepId.EXECUTE_QUERY>\n\nexport type APIRequestStep =\n AutomationStepSchema<AutomationActionStepId.API_REQUEST>\n\nexport type ExecuteScriptStep =\n AutomationStepSchema<AutomationActionStepId.EXECUTE_SCRIPT>\n\nexport type ExecuteScriptV2Step =\n AutomationStepSchema<AutomationActionStepId.EXECUTE_SCRIPT_V2>\n\nexport type FilterStep = AutomationStepSchema<AutomationActionStepId.FILTER>\n\nexport type QueryRowsStep =\n AutomationStepSchema<AutomationActionStepId.QUERY_ROWS>\n\nexport type SendEmailSmtpStep =\n AutomationStepSchema<AutomationActionStepId.SEND_EMAIL_SMTP>\n\nexport type ServerLogStep =\n AutomationStepSchema<AutomationActionStepId.SERVER_LOG>\n\nexport type TriggerAutomationRunStep =\n AutomationStepSchema<AutomationActionStepId.TRIGGER_AUTOMATION_RUN>\n\nexport type UpdateRowStep =\n AutomationStepSchema<AutomationActionStepId.UPDATE_ROW>\n\nexport type OutgoingWebhookStep =\n AutomationStepSchema<AutomationActionStepId.OUTGOING_WEBHOOK>\n\nexport type DiscordStep = AutomationStepSchema<AutomationActionStepId.discord>\n\nexport type SlackStep = AutomationStepSchema<AutomationActionStepId.slack>\n\nexport type ZapierStep = AutomationStepSchema<AutomationActionStepId.zapier>\n\nexport type IntegromatStep =\n AutomationStepSchema<AutomationActionStepId.integromat>\n\nexport type N8nStep = AutomationStepSchema<AutomationActionStepId.n8n>\n\nexport type ExecuteBashStep =\n AutomationStepSchema<AutomationActionStepId.EXECUTE_BASH>\n\nexport type OpenAIStep = AutomationStepSchema<AutomationActionStepId.OPENAI>\n\nexport type LoopStep = AutomationStepSchema<AutomationActionStepId.LOOP>\n\nexport type ClassifyContentStep =\n AutomationStepSchema<AutomationActionStepId.CLASSIFY_CONTENT>\n\nexport type PromptLLMStep =\n AutomationStepSchema<AutomationActionStepId.PROMPT_LLM>\n\nexport type TranslateStep =\n AutomationStepSchema<AutomationActionStepId.TRANSLATE>\n\nexport type SummariseStep =\n AutomationStepSchema<AutomationActionStepId.SUMMARISE>\n\nexport type GenerateTextStep =\n AutomationStepSchema<AutomationActionStepId.GENERATE_TEXT>\n\nexport type ExtractFileDataStep =\n AutomationStepSchema<AutomationActionStepId.EXTRACT_FILE_DATA>\n\nexport type ExtractStateStep =\n AutomationStepSchema<AutomationActionStepId.EXTRACT_STATE>\n\nexport type LoopV2Step = AutomationStepSchema<AutomationActionStepId.LOOP_V2>\n\nexport type BranchStep = AutomationStepSchema<AutomationActionStepId.BRANCH> & {\n conditionUI?: {\n groups: BranchSearchFilters[]\n }\n}\nexport type AutomationStep =\n | CollectStep\n | CreateRowStep\n | DelayStep\n | DeleteRowStep\n | ExecuteQueryStep\n | APIRequestStep\n | ExecuteScriptStep\n | ExecuteScriptV2Step\n | FilterStep\n | QueryRowsStep\n | SendEmailSmtpStep\n | ServerLogStep\n | TriggerAutomationRunStep\n | UpdateRowStep\n | OutgoingWebhookStep\n | DiscordStep\n | SlackStep\n | ZapierStep\n | IntegromatStep\n | N8nStep\n | LoopStep\n | ExecuteBashStep\n | OpenAIStep\n | BranchStep\n | ClassifyContentStep\n | PromptLLMStep\n | TranslateStep\n | SummariseStep\n | GenerateTextStep\n | ExtractFileDataStep\n | ExtractStateStep\n | LoopV2Step\n\nexport function isBranchStep(\n step: AutomationStep | AutomationTrigger\n): step is BranchStep {\n return step.stepId === AutomationActionStepId.BRANCH\n}\n\nexport function isTrigger(\n step: AutomationStep | AutomationTrigger\n): step is AutomationTrigger {\n return step.type === AutomationStepType.TRIGGER\n}\n\nexport function isRowUpdateTrigger(\n step: AutomationStep | AutomationTrigger\n): step is RowUpdatedTrigger {\n return step.stepId === AutomationTriggerStepId.ROW_UPDATED\n}\n\nexport function isRowSaveTrigger(\n step: AutomationStep | AutomationTrigger\n): step is RowSavedTrigger {\n return step.stepId === AutomationTriggerStepId.ROW_SAVED\n}\n\nexport function isAppTrigger(\n step: AutomationStep | AutomationTrigger\n): step is AppActionTrigger {\n return step.stepId === AutomationTriggerStepId.APP\n}\n\nexport function isWebhookTrigger(\n step: AutomationStep | AutomationTrigger\n): step is AppActionTrigger {\n return step.stepId === AutomationTriggerStepId.WEBHOOK\n}\n\nexport function isRowActionTrigger(\n step: AutomationStep | AutomationTrigger\n): step is AppActionTrigger {\n return step.stepId === AutomationTriggerStepId.ROW_ACTION\n}\n\nexport function isFilterStep(\n step: AutomationStep | AutomationTrigger\n): step is FilterStep {\n return step.stepId === AutomationActionStepId.FILTER\n}\n\nexport function isLoopStep(\n step: AutomationStep | AutomationTrigger\n): step is LoopStep {\n return step.stepId === AutomationActionStepId.LOOP\n}\n\nexport function isActionStep(\n step: AutomationStep | AutomationTrigger\n): step is AutomationStep {\n return step.type === AutomationStepType.ACTION\n}\n\nexport function isCronTrigger(\n trigger: AutomationStep | AutomationTrigger\n): trigger is CronTrigger {\n return trigger.stepId === AutomationTriggerStepId.CRON\n}\n\ntype EmptyInputs = {}\nexport type AutomationStepDefinition = Omit<AutomationStep, \"id\" | \"inputs\"> & {\n inputs: EmptyInputs\n deprecated?: boolean\n}\n\nexport type AutomationTriggerDefinition = Omit<\n AutomationTrigger,\n \"id\" | \"inputs\"\n> & {\n inputs: EmptyInputs\n deprecated?: boolean\n}\n\nexport type AutomationTriggerInputs<T extends AutomationTriggerStepId> =\n T extends AutomationTriggerStepId.APP\n ?\n | void\n | (Record<string, any> & { fields?: Record<string, AutomationIOType> })\n : T extends AutomationTriggerStepId.CRON\n ? CronTriggerInputs\n : T extends AutomationTriggerStepId.ROW_ACTION\n ? RowActionTriggerInputs\n : T extends AutomationTriggerStepId.ROW_DELETED\n ? RowDeletedTriggerInputs\n : T extends AutomationTriggerStepId.ROW_SAVED\n ? RowCreatedTriggerInputs\n : T extends AutomationTriggerStepId.ROW_UPDATED\n ? RowUpdatedTriggerInputs\n : T extends AutomationTriggerStepId.WEBHOOK\n ? Record<string, any>\n : never\n\nexport type AutomationTriggerOutputs<T extends AutomationTriggerStepId> =\n T extends AutomationTriggerStepId.APP\n ? AppActionTriggerOutputs\n : T extends AutomationTriggerStepId.CRON\n ? CronTriggerOutputs\n : T extends AutomationTriggerStepId.ROW_ACTION\n ? Record<string, any>\n : T extends AutomationTriggerStepId.ROW_DELETED\n ? RowDeletedTriggerOutputs\n : T extends AutomationTriggerStepId.ROW_SAVED\n ? RowCreatedTriggerOutputs\n : T extends AutomationTriggerStepId.ROW_UPDATED\n ? RowUpdatedTriggerOutputs\n : T extends AutomationTriggerStepId.WEBHOOK\n ? WebhookTriggerOutputs\n : never\n\nexport interface AutomationTriggerSchema<\n TTrigger extends AutomationTriggerStepId,\n> extends AutomationStepSchemaBase {\n id: string\n type: AutomationStepType.TRIGGER\n event?: AutomationEventType\n cronJobId?: string\n stepId: TTrigger\n inputs: AutomationTriggerInputs<TTrigger>\n}\n\nexport type AutomationTrigger =\n | AppActionTrigger\n | CronTrigger\n | RowActionTrigger\n | RowDeletedTrigger\n | RowSavedTrigger\n | RowUpdatedTrigger\n | WebhookTrigger\n\nexport type AppActionTrigger =\n AutomationTriggerSchema<AutomationTriggerStepId.APP>\n\nexport type CronTrigger = AutomationTriggerSchema<AutomationTriggerStepId.CRON>\n\nexport type RowActionTrigger =\n AutomationTriggerSchema<AutomationTriggerStepId.ROW_ACTION>\n\nexport type RowDeletedTrigger =\n AutomationTriggerSchema<AutomationTriggerStepId.ROW_DELETED>\n\nexport type RowSavedTrigger =\n AutomationTriggerSchema<AutomationTriggerStepId.ROW_SAVED>\n\nexport type RowUpdatedTrigger =\n AutomationTriggerSchema<AutomationTriggerStepId.ROW_UPDATED>\n\nexport type WebhookTrigger =\n AutomationTriggerSchema<AutomationTriggerStepId.WEBHOOK>\n", "import { Table } from \"@budibase/types\"\nimport { SortOrder } from \"../../../api\"\nimport {\n SearchFilters,\n EmptyFilterOption,\n BasicOperator,\n LogicalOperator,\n} from \"../../../sdk\"\nimport { HttpMethod } from \"../query\"\nimport { Row, RowAttachment } from \"../row\"\nimport {\n LoopStepType,\n EmailAttachment,\n AutomationResults,\n AutomationStepResult,\n} from \"./automation\"\nimport { AutomationStep } from \"./schema\"\n\nexport enum FilterCondition {\n EQUAL = \"EQUAL\",\n NOT_EQUAL = \"NOT_EQUAL\",\n GREATER_THAN = \"GREATER_THAN\",\n LESS_THAN = \"LESS_THAN\",\n}\n\nexport type BaseAutomationOutputs = {\n success?: boolean\n response?: {\n [key: string]: any\n message?: string\n }\n}\nexport type ExternalAppStepOutputs = {\n httpStatus?: number\n response: string\n success: boolean\n}\n\nexport type BashStepInputs = {\n code: string\n}\n\nexport type BashStepOutputs = BaseAutomationOutputs & {\n stdout?: string\n}\n\nexport type CollectStepInputs = {\n collection: string\n}\n\nexport type CollectStepOutputs = BaseAutomationOutputs & {\n value?: any\n}\n\nexport type CreateRowStepInputs = {\n row: Row\n}\n\nexport type CreateRowStepOutputs = BaseAutomationOutputs & {\n row?: Row\n id?: string\n revision?: string\n}\n\nexport type DelayStepInputs = {\n time: number\n}\n\nexport type DelayStepOutputs = BaseAutomationOutputs\n\nexport type DeleteRowStepInputs = {\n tableId: string\n id: string\n revision?: string\n}\n\nexport type DeleteRowStepOutputs = BaseAutomationOutputs & {\n row?: Row\n}\n\nexport type DiscordStepInputs = {\n url: string\n username?: string\n avatar_url?: string\n content: string\n}\n\nexport type ExecuteQueryStepInputs = {\n query: {\n queryId: string\n [key: string]: any\n }\n}\n\nexport type ExecuteQueryStepOutputs = BaseAutomationOutputs & {\n info?: any\n}\n\nexport type APIRequestStepInputs = {\n query: {\n queryId: string\n [key: string]: any\n }\n}\n\nexport type APIRequestStepOutputs = BaseAutomationOutputs & {\n info?: any\n}\n\nexport type ExecuteScriptStepInputs = {\n code: string\n}\n\nexport type ExecuteScriptStepOutputs = BaseAutomationOutputs & {\n value?: string\n}\n\nexport type ExtractStateStepInputs = {\n key: string\n value: string\n}\n\nexport type ExtractStateStepOutputs = BaseAutomationOutputs & {\n value?: string\n}\n\nexport type FilterStepInputs = {\n field: any\n condition: FilterCondition\n value: any\n}\n\nexport type FilterStepOutputs = BaseAutomationOutputs & {\n result: boolean\n refValue?: any\n comparisonValue?: any\n}\n\nexport type LoopStepInputs = {\n option: LoopStepType\n binding: any\n iterations?: number\n failure?: string\n}\n\nexport type LoopStepOutputs = {\n items: AutomationStepResult[]\n success: boolean\n iterations: number\n status?: string\n}\n\nexport type BranchStepInputs = {\n branches: Branch[]\n children?: Record<string, AutomationStep[]>\n}\n\nexport type Branch = {\n id: any\n name: string\n condition: BranchSearchFilters\n conditionUI?: {\n groups?: {\n filters?: {\n field: string\n operator: BasicOperator\n value: any\n }[]\n }[]\n }\n}\n\nexport type BranchSearchFilters = Pick<\n SearchFilters,\n | BasicOperator.EQUAL\n | BasicOperator.NOT_EQUAL\n | LogicalOperator.AND\n | LogicalOperator.OR\n>\n\nexport type MakeIntegrationInputs = {\n url: string\n body: any\n}\n\nexport type n8nStepInputs = {\n url: string\n method?: HttpMethod\n authorization: string\n body: any\n}\n\nexport type OpenAIStepInputs = {\n prompt: string\n model: Model\n}\n\nexport type ClassifyContentStepInputs = {\n inputType: string\n textInput: string\n categoryItems: Array<{\n category: string\n }>\n}\n\nexport type ClassifyContentStepOutputs = {\n category?: string\n success: boolean\n response?: string\n}\n\nexport type PromptLLMStepInputs = {\n prompt: string\n model: Model\n}\n\nexport type PromptLLMStepOutputs = {\n response?: string\n success: boolean\n}\n\nexport type TranslateStepInputs = {\n text: string\n language: string\n}\n\nexport type TranslateStepOutputs = {\n response?: string\n success: boolean\n}\n\nexport type SummariseStepInputs = {\n text: string\n length?: SummariseLength\n}\n\nexport type SummariseStepOutputs = {\n response?: string\n success: boolean\n}\n\nexport type GenerateTextStepInputs = {\n contentType: string\n instructions: string\n}\n\nexport type GenerateTextStepOutputs = {\n success: boolean\n response?: string\n}\nexport type ExtractFileDataStepInputs = {\n file: RowAttachment | string\n source: \"URL\" | \"Attachment\"\n fileType?: string\n schema: Record<string, any>\n}\n\nexport type ExtractFileDataStepOutputs = {\n success: boolean\n data: Record<string, any>\n response?: string\n}\n\nexport type LoopV2StepInputs = {\n option: LoopStepType\n binding: any\n iterations?: number\n failure?: string\n children?: AutomationStep[]\n resultOptions?: {\n maxStoredIterations?: number\n storeFullResults?: boolean\n summarizeOnly?: boolean\n }\n}\n\nexport interface LoopSummary {\n totalProcessed: number\n successCount: number\n failureCount: number\n firstFailure?: { iteration: number; error: string }\n}\n\nexport type LoopV2StepOutputs = {\n success: boolean\n iterations: number\n status?: string\n summary: LoopSummary\n items?: Record<string, AutomationStepResult[]>\n recentItems?: Record<string, AutomationStepResult[]>\n nestedSummaries?: Record<string, LoopSummary[]>\n}\n\nexport enum Model {\n GPT_35_TURBO = \"gpt-3.5-turbo\",\n // will only work with api keys that have access to the GPT4 API\n GPT_4 = \"gpt-4\",\n GPT_4O = \"gpt-4o\",\n GPT_4O_MINI = \"gpt-4o-mini\",\n GPT_5_MINI = \"gpt-5-mini\",\n GPT_5 = \"gpt-5\",\n GPT_5_NANO = \"gpt-5-nano\",\n}\n\nexport enum SummariseLength {\n SHORT = \"short\",\n MEDIUM = \"medium\",\n LONG = \"long\",\n}\n\nexport type OpenAIStepOutputs = Omit<BaseAutomationOutputs, \"response\"> & {\n response?: string | null\n}\n\nexport type QueryRowsStepInputs = {\n tableId: string\n filters?: SearchFilters\n \"filters-def\"?: any\n sortColumn?: string\n sortOrder?: SortOrder\n limit?: number\n onEmptyFilter?: EmptyFilterOption\n}\n\nexport type QueryRowsStepOutputs = BaseAutomationOutputs & {\n rows?: Row[]\n}\n\nexport type SmtpEmailStepInputs = {\n to: string\n from: string\n subject: string\n contents: string\n cc: string\n bcc: string\n addInvite?: boolean\n startTime: Date\n endTime: Date\n summary: string\n location?: string\n url?: string\n attachments?: EmailAttachment[]\n}\n\nexport type SmtpEmailStepOutputs = BaseAutomationOutputs\nexport type ServerLogStepInputs = {\n text: string\n}\n\nexport type ServerLogStepOutputs = BaseAutomationOutputs & {\n message: string\n}\nexport type SlackStepInputs = {\n url: string\n text: string\n}\n\nexport type TriggerAutomationStepInputs = {\n automation: {\n automationId: string\n }\n timeout?: number\n}\n\nexport type TriggerAutomationStepOutputs = BaseAutomationOutputs & {\n value?: AutomationResults[\"steps\"]\n status: AutomationResults[\"status\"]\n}\n\nexport type UpdateRowStepInputs = {\n meta: Record<string, any>\n row: Row\n rowId: string\n}\n\nexport type UpdateRowStepOutputs = BaseAutomationOutputs & {\n row?: Row\n id?: string\n revision?: string\n}\n\nexport type ZapierStepInputs = {\n url: string\n body: any\n}\n\nexport type ZapierStepOutputs = Omit<ExternalAppStepOutputs, \"response\"> & {\n response: string\n}\n\nexport enum RequestType {\n POST = \"POST\",\n GET = \"GET\",\n PUT = \"PUT\",\n DELETE = \"DELETE\",\n PATCH = \"PATCH\",\n}\n\nexport type OutgoingWebhookStepInputs = {\n requestMethod: RequestType\n url: string\n requestBody: string\n headers: string | Record<string, string>\n}\n\nexport type AppActionTriggerOutputs = {\n fields: object\n}\n\nexport type CronTriggerInputs = {\n cron: string\n}\n\nexport type CronTriggerOutputs = {\n timestamp: number\n}\n\nexport type RowDeletedTriggerInputs = {\n tableId: string\n}\n\nexport type RowDeletedTriggerOutputs = {\n row: Row\n}\n\nexport type RowCreatedTriggerInputs = {\n tableId: string\n filters?: SearchFilters\n}\n\nexport type RowCreatedTriggerOutputs = {\n row: Row\n id: string\n revision: string\n}\n\nexport type RowUpdatedTriggerInputs = {\n tableId: string\n filters?: SearchFilters\n}\n\nexport type RowUpdatedTriggerOutputs = {\n row: Row\n id: string\n revision?: string\n oldRow?: Row\n}\n\nexport type WebhookTriggerInputs = {\n schemaUrl: string\n triggerUrl: string\n}\n\nexport type WebhookTriggerOutputs = Record<string, any> & {\n body: Record<string, any>\n}\n\nexport type RowActionTriggerInputs = {\n tableId: string\n rowActionId: string\n}\n\nexport type RowActionTriggerOutputs = {\n row: Row\n id: string\n revision?: string\n table: Table\n}\n", "import { Document } from \"../document\"\nimport { User } from \"../../\"\n\nexport enum AppBackupType {\n BACKUP = \"backup\",\n RESTORE = \"restore\",\n}\n\nexport enum AppBackupStatus {\n STARTED = \"started\",\n PENDING = \"pending\",\n COMPLETE = \"complete\",\n FAILED = \"failed\",\n}\n\nexport enum AppBackupTrigger {\n PUBLISH = \"publish\",\n MANUAL = \"manual\",\n SCHEDULED = \"scheduled\",\n RESTORING = \"restoring\",\n}\n\nexport interface AppBackupContents {\n datasources: string[]\n screens: string[]\n automations: string[]\n}\n\nexport interface AppBackupMetadata {\n appId: string\n trigger?: AppBackupTrigger\n type: AppBackupType\n status: AppBackupStatus\n name?: string\n createdBy?: string | User\n timestamp: string\n finishedAt?: string\n startedAt?: string\n contents?: AppBackupContents\n}\n\nexport interface AppBackup extends Document, AppBackupMetadata {\n _id: string\n filename?: string\n}\n\nexport type AppBackupFetchOpts = {\n trigger?: AppBackupTrigger\n type?: AppBackupType\n limit?: number\n page?: string\n paginate?: boolean\n startDate?: string\n endDate?: string\n}\n\nexport interface AppBackupQueueData {\n appId: string\n docId: string\n docRev: string\n export?: {\n trigger: AppBackupTrigger\n name?: string\n createdBy?: string\n }\n import?: {\n backupId: string\n nameForBackup: string\n createdBy?: string\n }\n}\n\nexport interface DevRevertQueueData {\n appId: string\n userId?: string\n}\n", "import { Document } from \"../document\"\nimport { SourceName } from \"../../sdk\"\nimport { Table } from \"./table\"\n\nexport interface Datasource extends Document {\n type: string\n name?: string\n source: SourceName\n // this is a googlesheets specific property which\n // can be found in the GSheets schema - pertains to SSO creds\n auth?: { type: string }\n // the config is defined by the schema\n config?: Record<string, any>\n plus?: boolean\n isSQL?: boolean\n usesEnvironmentVariables?: boolean\n entities?: Record<string, Table>\n}\n\nexport enum RestAuthType {\n BASIC = \"basic\",\n BEARER = \"bearer\",\n OAUTH2 = \"oauth2\",\n}\n\nexport interface RestBasicAuthConfig {\n username: string\n password: string\n}\n\nexport interface RestBearerAuthConfig {\n token: string\n}\n\nexport interface BasicRestAuthConfig {\n _id: string\n name: string\n type: RestAuthType.BASIC\n config: RestBasicAuthConfig\n}\n\nexport interface BearerRestAuthConfig {\n _id: string\n name: string\n type: RestAuthType.BEARER\n config: RestBearerAuthConfig\n}\n\nexport type RestAuthConfig = BasicRestAuthConfig | BearerRestAuthConfig\n\nexport interface DynamicVariable {\n name: string\n queryId: string\n value: string\n}\n\nexport interface RestConfig {\n url: string\n rejectUnauthorized?: boolean\n downloadImages?: boolean\n defaultHeaders?: {\n [key: string]: any\n }\n legacyHttpParser?: boolean\n authConfigs?: RestAuthConfig[]\n staticVariables?: {\n [key: string]: string\n }\n dynamicVariables?: DynamicVariable[]\n}\n\nexport enum SourceType {\n DATASOURCE = \"datasource\",\n QUERY = \"query\",\n TABLE = \"table\",\n VIEW = \"view\",\n}\n", "export enum DeploymentStatus {\n SUCCESS = \"SUCCESS\",\n PENDING = \"PENDING\",\n FAILURE = \"FAILURE\",\n}\n\nexport interface DeploymentDoc {\n _id: string\n verification: any\n status?: DeploymentStatus\n history?: Record<\n string,\n {\n _id: string\n appId: string\n status?: DeploymentStatus\n updatedAt: number\n }\n >\n err?: any\n appUrl?: string\n}\n", "export enum MetadataType {\n AUTOMATION_TEST_INPUT = \"automationTestInput\",\n AUTOMATION_TEST_HISTORY = \"automationTestHistory\",\n}\n", "import { Document } from \"../document\"\n\nexport enum OAuth2CredentialsMethod {\n HEADER = \"HEADER\",\n BODY = \"BODY\",\n}\n\nexport enum OAuth2GrantType {\n CLIENT_CREDENTIALS = \"client_credentials\",\n}\n\nexport interface OAuth2Config extends Document {\n name: string\n url: string\n clientId: string\n clientSecret: string\n method: OAuth2CredentialsMethod\n grantType: OAuth2GrantType\n scope?: string\n}\n", "import { Document } from \"../document\"\nimport { RestAuthType } from \"./datasource\"\nimport { Row } from \"./row\"\n\nexport interface QuerySchema {\n name?: string\n type: string\n subtype?: string\n}\n\nexport type QueryVerb = \"read\" | \"create\" | \"update\" | \"delete\" | \"patch\"\n\nexport interface Query extends Document {\n datasourceId: string\n name: string\n parameters: QueryParameter[]\n fields: RestQueryFields &\n SQLQueryFields &\n MongoQueryFields &\n GoogleSheetsQueryFields\n transformer: string | null\n schema: Record<string, QuerySchema | string>\n nestedSchemaFields?: Record<string, Record<string, QuerySchema | string>>\n readable: boolean\n queryVerb: QueryVerb\n // flag to state whether the default bindings are empty strings (old behaviour) or null\n nullDefaultSupport?: boolean\n}\n\nexport interface QueryPreview extends Omit<Query, \"_id\"> {\n queryId?: string\n}\n\nexport interface QueryParameter {\n name: string\n default: string\n}\n\nexport interface QueryResponse {\n rows: Row[]\n keys: string[]\n info: any\n extra: any\n pagination: any\n}\n\nexport enum BodyType {\n NONE = \"none\",\n FORM_DATA = \"form\",\n XML = \"xml\",\n ENCODED = \"encoded\",\n JSON = \"json\",\n TEXT = \"text\",\n}\n\nexport interface RestQueryFields {\n path?: string\n queryString?: string\n headers?: { [key: string]: any }\n disabledHeaders?: { [key: string]: any }\n requestBody?: any\n bodyType?: BodyType\n method?: string\n authConfigId?: string\n authConfigType?: RestAuthType\n pagination?: PaginationConfig\n paginationValues?: PaginationValues\n}\nexport interface SQLQueryFields {\n sql?: string\n}\n\nexport interface MongoQueryFields {\n extra?: {\n collection?: string\n actionType:\n | \"findOne\"\n | \"find\"\n | \"updateOne\"\n | \"updateMany\"\n | \"findOneAndUpdate\"\n | \"count\"\n | \"distinct\"\n | \"insertOne\"\n | \"deleteOne\"\n | \"deleteMany\"\n }\n json?: object | string\n}\n\nexport interface GoogleSheetsQueryFields {\n sheet?: string\n rowIndex?: string\n row?: Row\n}\n\nexport interface PaginationConfig {\n type: string\n location: string\n pageParam: string\n sizeParam?: string\n responseParam?: string\n}\n\nexport interface PaginationValues {\n page?: string | number\n limit?: number\n}\n\nexport enum HttpMethod {\n GET = \"GET\",\n POST = \"POST\",\n PATCH = \"PATCH\",\n PUT = \"PUT\",\n HEAD = \"HEAD\",\n DELETE = \"DELETE\",\n}\n", "import { Document } from \"../../document\"\nimport { View, ViewV2 } from \"../view\"\nimport { RenameColumn } from \"../../../sdk\"\nimport { TableSchema } from \"./schema\"\n\nexport const INTERNAL_TABLE_SOURCE_ID = \"bb_internal\"\n\nexport enum TableSourceType {\n EXTERNAL = \"external\",\n INTERNAL = \"internal\",\n}\n\nexport interface Table extends Document {\n type: \"table\"\n sourceType: TableSourceType\n views?: { [key: string]: View | ViewV2 }\n name: string\n originalName?: string\n sourceId: string\n primary?: string[]\n schema: TableSchema\n primaryDisplay?: string\n relatedFormula?: string[]\n constrained?: string[]\n sql?: boolean\n indexes?: string[]\n created?: boolean\n rowHeight?: number\n aiGenerated?: boolean\n}\n\nexport interface TableRequest extends Table {\n _rename?: RenameColumn\n created?: boolean\n}\n", "import { FieldType } from \"../row\"\n\nexport enum RelationshipType {\n ONE_TO_MANY = \"one-to-many\",\n MANY_TO_ONE = \"many-to-one\",\n MANY_TO_MANY = \"many-to-many\",\n}\n\nexport enum AutoReason {\n FOREIGN_KEY = \"foreign_key\",\n}\n\nexport type FieldSubType =\n | AutoFieldSubType\n | AttachmentSubType\n | BBReferenceFieldSubType\n | JsonFieldSubType\n | StringFieldSubType\n\nexport enum AutoFieldSubType {\n CREATED_BY = \"createdBy\",\n CREATED_AT = \"createdAt\",\n UPDATED_BY = \"updatedBy\",\n UPDATED_AT = \"updatedAt\",\n AUTO_ID = \"autoID\",\n}\n\nexport enum JsonFieldSubType {\n ARRAY = \"array\",\n}\n\nexport enum FormulaType {\n STATIC = \"static\",\n DYNAMIC = \"dynamic\",\n AI = \"ai\",\n}\n\nexport enum BBReferenceFieldSubType {\n USER = \"user\",\n /** @deprecated this should not be used anymore, left here in order to support the existing usages */\n USERS = \"users\",\n}\n\nexport enum AttachmentSubType {\n IMAGE = \"image\",\n}\n\nexport enum StringFieldSubType {\n ARRAY = \"array\",\n}\n\nexport type SupportedSqlTypes =\n | FieldType.STRING\n | FieldType.BARCODEQR\n | FieldType.LONGFORM\n | FieldType.OPTIONS\n | FieldType.DATETIME\n | FieldType.NUMBER\n | FieldType.BOOLEAN\n | FieldType.FORMULA\n | FieldType.BIGINT\n | FieldType.BB_REFERENCE\n | FieldType.BB_REFERENCE_SINGLE\n | FieldType.LINK\n | FieldType.ARRAY\n", "// all added by grid/table when defining the\n// column size, position and whether it can be viewed\nimport { FieldType, FormulaResponseType } from \"../row\"\nimport {\n AttachmentSubType,\n AutoFieldSubType,\n AutoReason,\n BBReferenceFieldSubType,\n FormulaType,\n JsonFieldSubType,\n RelationshipType,\n StringFieldSubType,\n} from \"./constants\"\nimport { AIOperationEnum } from \"../../../sdk/ai\"\n\nexport interface UIFieldMetadata {\n order?: number\n width?: number\n visible?: boolean\n icon?: string\n}\n\ninterface BaseRelationshipFieldMetadata\n extends Omit<BaseFieldSchema, \"subtype\"> {\n type: FieldType.LINK\n main?: boolean\n fieldName: string\n tableId: string\n tableRev?: string\n subtype?: AutoFieldSubType.CREATED_BY | AutoFieldSubType.UPDATED_BY\n}\n\n// External tables use junction tables, internal tables don't require them\ntype ManyToManyJunctionTableMetadata =\n | {\n through: string\n throughFrom: string\n throughTo: string\n }\n | {\n through?: never\n throughFrom?: never\n throughTo?: never\n }\n\nexport type ManyToManyRelationshipFieldMetadata =\n BaseRelationshipFieldMetadata & {\n relationshipType: RelationshipType.MANY_TO_MANY\n } & ManyToManyJunctionTableMetadata\n\nexport interface OneToManyRelationshipFieldMetadata\n extends BaseRelationshipFieldMetadata {\n relationshipType: RelationshipType.ONE_TO_MANY\n foreignKey?: string\n}\nexport interface ManyToOneRelationshipFieldMetadata\n extends BaseRelationshipFieldMetadata {\n relationshipType: RelationshipType.MANY_TO_ONE\n foreignKey?: string\n}\nexport type RelationshipFieldMetadata =\n | ManyToManyRelationshipFieldMetadata\n | OneToManyRelationshipFieldMetadata\n | ManyToOneRelationshipFieldMetadata\n\nexport interface AutoColumnFieldMetadata\n extends Omit<BaseFieldSchema, \"subtype\"> {\n type: FieldType.AUTO\n autocolumn: true\n subtype: AutoFieldSubType\n lastID?: number\n // if the column was turned to an auto-column for SQL, explains why (primary, foreign etc)\n autoReason?: AutoReason\n}\n\nexport interface NumberFieldMetadata extends Omit<BaseFieldSchema, \"subtype\"> {\n type: FieldType.NUMBER\n subtype?: AutoFieldSubType.AUTO_ID\n lastID?: number\n autoReason?: AutoReason.FOREIGN_KEY\n // used specifically when Budibase generates external tables, this denotes if a number field\n // is a foreign key used for a many-to-many relationship\n meta?: {\n toTable: string\n toKey: string\n }\n default?: string\n}\n\nexport interface JsonFieldMetadata extends Omit<BaseFieldSchema, \"subtype\"> {\n type: FieldType.JSON\n subtype?: JsonFieldSubType.ARRAY\n default?: string\n}\n\nexport interface DateFieldMetadata extends Omit<BaseFieldSchema, \"subtype\"> {\n type: FieldType.DATETIME\n ignoreTimezones?: boolean\n timeOnly?: boolean\n dateOnly?: boolean\n subtype?: AutoFieldSubType.CREATED_AT | AutoFieldSubType.UPDATED_AT\n default?: string\n}\n\nexport interface LongFormFieldMetadata extends BaseFieldSchema {\n type: FieldType.LONGFORM\n useRichText?: boolean | null\n default?: string\n}\n\nexport interface StringFieldMetadata extends Omit<BaseFieldSchema, \"subtype\"> {\n type: FieldType.STRING\n subtype?: StringFieldSubType.ARRAY\n default?: string\n}\n\nexport interface FormulaFieldMetadata extends BaseFieldSchema {\n type: FieldType.FORMULA\n formula: string\n formulaType?: FormulaType\n responseType?: FormulaResponseType\n}\n\nexport interface AIFieldMetadata extends BaseFieldSchema {\n type: FieldType.AI\n operation: AIOperationEnum\n columns?: string[]\n column?: string\n categories?: string\n prompt?: string\n language?: string\n}\n\nexport interface BBReferenceFieldMetadata\n extends Omit<BaseFieldSchema, \"subtype\"> {\n type: FieldType.BB_REFERENCE\n subtype: BBReferenceFieldSubType\n relationshipType?: RelationshipType\n default?: string[]\n}\nexport interface BBReferenceSingleFieldMetadata\n extends Omit<BaseFieldSchema, \"subtype\"> {\n type: FieldType.BB_REFERENCE_SINGLE\n subtype: Exclude<BBReferenceFieldSubType, BBReferenceFieldSubType.USERS>\n default?: string\n}\n\nexport interface AttachmentFieldMetadata\n extends Omit<BaseFieldSchema, \"subtype\"> {\n type: FieldType.ATTACHMENTS\n subtype?: AttachmentSubType\n}\nexport interface SingleAttachmentFieldMetadata\n extends Omit<BaseFieldSchema, \"subtype\"> {\n type: FieldType.ATTACHMENT_SINGLE\n subtype?: AttachmentSubType\n}\n\nexport interface FieldConstraints {\n type?: string\n email?: boolean\n inclusion?: string[]\n length?: {\n minimum?: string | number | null\n maximum?: string | number | null\n message?: string\n }\n numericality?: {\n greaterThanOrEqualTo?: string | null\n lessThanOrEqualTo?: string | null\n }\n presence?:\n | boolean\n | {\n allowEmpty?: boolean\n }\n datetime?: {\n latest?: string\n earliest?: string\n }\n}\n\nexport interface OptionsFieldMetadata extends BaseFieldSchema {\n type: FieldType.OPTIONS\n constraints: FieldConstraints & {\n inclusion: string[]\n }\n default?: string\n}\n\nexport interface ArrayFieldMetadata extends BaseFieldSchema {\n type: FieldType.ARRAY\n constraints: FieldConstraints & {\n type: JsonFieldSubType.ARRAY\n inclusion: string[]\n }\n default?: string[]\n}\n\nexport interface BooleanFieldMetadata extends BaseFieldSchema {\n type: FieldType.BOOLEAN\n default?: string\n}\n\nexport interface BigIntFieldMetadata extends BaseFieldSchema {\n type: FieldType.BIGINT\n default?: string\n}\n\nexport interface BaseFieldSchema extends UIFieldMetadata {\n type: FieldType\n name: string\n sortable?: boolean\n // only used by external databases, to denote the real type\n externalType?: string\n constraints?: FieldConstraints\n autocolumn?: boolean\n autoReason?: AutoReason.FOREIGN_KEY\n subtype?: never\n // added when enriching nested JSON fields into schema\n nestedJSON?: boolean\n aiGenerated?: boolean\n}\n\ninterface OtherFieldMetadata extends BaseFieldSchema {\n type: Exclude<\n FieldType,\n | FieldType.DATETIME\n | FieldType.LINK\n | FieldType.AUTO\n | FieldType.FORMULA\n | FieldType.AI\n | FieldType.NUMBER\n | FieldType.LONGFORM\n | FieldType.BB_REFERENCE\n | FieldType.BB_REFERENCE_SINGLE\n | FieldType.ATTACHMENTS\n | FieldType.STRING\n | FieldType.ARRAY\n | FieldType.OPTIONS\n | FieldType.BOOLEAN\n | FieldType.BIGINT\n | FieldType.JSON\n >\n}\n\nexport type FieldSchema =\n | OtherFieldMetadata\n | DateFieldMetadata\n | RelationshipFieldMetadata\n | AutoColumnFieldMetadata\n | FormulaFieldMetadata\n | AIFieldMetadata\n | NumberFieldMetadata\n | LongFormFieldMetadata\n | StringFieldMetadata\n | BBReferenceFieldMetadata\n | JsonFieldMetadata\n | AttachmentFieldMetadata\n | SingleAttachmentFieldMetadata\n | BBReferenceSingleFieldMetadata\n | ArrayFieldMetadata\n | OptionsFieldMetadata\n | BooleanFieldMetadata\n | BigIntFieldMetadata\n\nexport interface TableSchema {\n [key: string]: FieldSchema\n}\n\nexport function isRelationshipField(\n field: FieldSchema\n): field is RelationshipFieldMetadata {\n return field.type === FieldType.LINK\n}\n\nexport function isManyToMany(\n field: RelationshipFieldMetadata\n): field is ManyToManyRelationshipFieldMetadata {\n return field.relationshipType === RelationshipType.MANY_TO_MANY\n}\n\nexport function isOneToMany(\n field: RelationshipFieldMetadata\n): field is OneToManyRelationshipFieldMetadata {\n return field.relationshipType === RelationshipType.ONE_TO_MANY\n}\n\nexport function isManyToOne(\n field: RelationshipFieldMetadata\n): field is ManyToOneRelationshipFieldMetadata {\n return field.relationshipType === RelationshipType.MANY_TO_ONE\n}\n", "import { Document } from \"../document\"\nimport { FieldSchema, FormulaType } from \"./table\"\n\nexport const EXTERNAL_ROW_REV = \"rev\"\n\nexport enum FieldType {\n /**\n * a primitive type, stores a string, called Text within Budibase. This is one of the default\n * types of Budibase, if an external type is not fully understood, we will treat it as text.\n */\n STRING = \"string\",\n /**\n * similar to string type, called Long Form Text within Budibase. This is mainly a frontend\n * orientated type which enables a larger text input area. This can also be used\n * in conjunction with the 'useRichText' option to support a markdown editor/viewer.\n */\n LONGFORM = \"longform\",\n /**\n * similar to string type, called Options within Budibase. This works very similarly to\n * the string type within the backend, but is validated to a list of options. This will\n * display a <select> input within the builder/client.\n */\n OPTIONS = \"options\",\n /**\n * a primitive type, stores a number, as a floating point, called Number within Budibase.\n * this type will always represent numbers as reals/floating point - there is no integer only\n * type within Budibase.\n */\n NUMBER = \"number\",\n /**\n * a primitive type, stores a boolean, called Boolean within Budibase. This is often represented\n * as a toggle or checkbox within forms/grids.\n */\n BOOLEAN = \"boolean\",\n /**\n * a JSON type, this type is always an array of strings, called Multi-select within Budibase.\n * This type can be compared to the options type, as it functions similarly, but allows picking\n * multiple options rather than a single option.\n */\n ARRAY = \"array\",\n /**\n * a string type, this is always a string when input/returned from the API, called Date/Time within\n * Budibase. We utilise ISO date strings for representing dates, this type has a range of subtypes\n * to restrict it to date only, time only and ignore timezone capabilities.\n */\n DATETIME = \"datetime\",\n /**\n * a JSON type, an array of metadata about files held in object storage, called Attachment List within\n * Budibase. To utilise this type there is an API for uploading files to Budibase, which returns metadata\n * that can be stored against columns of this type. Currently this is not supported on external databases.\n */\n ATTACHMENTS = \"attachment\",\n /**\n * a JSON type, similar to the attachments type, called Attachment within Budibase. This type functions\n * much the same as the attachment list, but only holds a single attachment metadata as an object.\n * This simplifies the binding experience of using this column type.\n */\n ATTACHMENT_SINGLE = \"attachment_single\",\n /**\n * a complex type, called Relationships within Budibase. This is the most complex type of Budibase,\n * nothing should be stored against rows under link columns; this type simply represents the\n * relationship between tables as part of the table schema. When rows are input to the Budibase API\n * relationships to be made are represented as a list of row IDs to link. When rows are returned\n * from the Budibase API it will contain a list of row IDs and display column values of the related rows.\n */\n LINK = \"link\",\n /**\n * a complex type, called Formulas within Budibase. This type has two variants, static and dynamic, with\n * static only being supported against internal tables. Dynamic formulas calculate a provided HBS/JS binding\n * based on the row context and enrich it when rows are being returned from the API. Static bindings calculate\n * this when rows are being stored, so that the formula output can be searched upon within the DB.\n */\n FORMULA = \"formula\",\n /**\n * a complex type, called Auto Column within Budibase. This type has a few variants, with options such as a\n * date for created at/updated at, an auto ID column with auto-increments as rows are saved and a user\n * relationship type which stores the created by/updated by user details. These subtypes all depend on the\n * date, number of link types respectively. There is one case where these will be executed in the browser,\n * that is part of the initial formula definition, the formula will be live evaluated in the browser.\n */\n AUTO = \"auto\",\n /**\n * A complex type, called an AI column within Budibase. This type is only supported against internal tables\n * and calculates the output based on a chosen operation (summarise text, translation etc) which passes to\n * the configured Budibase Large Language Model to retrieve the output and write it back into the row.\n * AI fields function in a similar fashion to static formulas, and possess many of the same characteristics.\n */\n AI = \"ai\",\n /**\n * a JSON type, called JSON within Budibase. This type allows any arbitrary JSON to be input to this column\n * type, which will be represented as a JSON object in the row. This type depends on a schema being\n * provided to make the JSON searchable/bindable, the JSON cannot be fully dynamic.\n */\n JSON = \"json\",\n /**\n * @deprecated an internal type, this is an old deprecated type which is no longer used - still represented to note it\n * could appear in very old tables.\n */\n INTERNAL = \"internal\",\n /**\n * a string type, called Barcode/QR within Budibase. This type is used to denote to forms to that this column\n * should be filled in using a camera to read a barcode, there is a form component which will be used when this\n * type is found. The column will contain the contents of any barcode scanned.\n */\n BARCODEQR = \"barcodeqr\",\n /**\n * a JSON type, called Signature within Budibase. This type functions much the same as ATTACHMENTS but restricted\n * only to signatures.\n */\n SIGNATURE_SINGLE = \"signature_single\",\n /**\n * a string type, this allows representing very large integers, but they are held/managed within Budibase as\n * strings. When stored in external databases Budibase will attempt to use a real big integer type and depend\n * on the database parsing the string to this type as part of saving.\n */\n BIGINT = \"bigint\",\n /**\n * a JSON type, called Users within Budibase. It will hold an array of strings. This type is used to represent a link to an internal Budibase\n * resource, like a user or group, today only users are supported. This type will be represented as an\n * array of internal resource IDs (e.g. user IDs) within the row - this ID list will be enriched with\n * the full resources when rows are returned from the API. The full resources can be input to the API, or\n * an array of resource IDs, the API will squash these down and validate them before saving the row.\n */\n BB_REFERENCE = \"bb_reference\",\n /**\n * a string type, called User within Budibase. Same logic as `bb_reference`, storing a single id as string instead of an array\n */\n BB_REFERENCE_SINGLE = \"bb_reference_single\",\n}\n\nexport const JsonTypes = [\n FieldType.ATTACHMENT_SINGLE,\n FieldType.ATTACHMENTS,\n FieldType.SIGNATURE_SINGLE,\n // only BB_REFERENCE is JSON, it's an array, BB_REFERENCE_SINGLE is a string type\n FieldType.BB_REFERENCE,\n FieldType.JSON,\n FieldType.ARRAY,\n]\n\nexport type FormulaResponseType =\n | FieldType.STRING\n | FieldType.NUMBER\n | FieldType.BOOLEAN\n | FieldType.DATETIME\n\nexport const NumericTypes = [FieldType.NUMBER, FieldType.BIGINT]\n\nexport function isNumeric(type: FieldType) {\n return NumericTypes.includes(type)\n}\n\nexport function isNumericStaticFormula(schema: FieldSchema) {\n return (\n schema.type === FieldType.FORMULA &&\n schema.formulaType === FormulaType.STATIC &&\n schema.responseType &&\n isNumeric(schema.responseType)\n )\n}\n\nexport const GroupByTypes = [\n FieldType.STRING,\n FieldType.LONGFORM,\n FieldType.OPTIONS,\n FieldType.NUMBER,\n FieldType.BOOLEAN,\n FieldType.DATETIME,\n FieldType.BIGINT,\n FieldType.AI,\n]\n\nexport function canGroupBy(type: FieldType) {\n return GroupByTypes.includes(type)\n}\n\nexport interface RowAttachment {\n size: number\n name: string\n extension: string\n key?: string\n // Populated on read\n url?: string\n}\n\nexport interface Row extends Document {\n type?: string\n tableId?: string\n _viewId?: string\n [key: string]: any\n}\n", "import { Document } from \"../document\"\nimport { Component } from \"./component\"\n\nexport interface ScreenProps extends Component {\n size?: string\n gap?: string\n direction?: string\n vAlign?: string\n hAlign?: string\n}\n\nexport interface ScreenRouting {\n route: string\n roleId: string\n homeScreen?: boolean\n}\n\nexport enum ScreenVariant {\n PDF = \"pdf\",\n}\n\nexport interface Screen extends Document {\n layoutId?: string\n showNavigation?: boolean\n width?: string\n routing: ScreenRouting\n props: ScreenProps\n name?: string\n pluginAdded?: boolean\n onLoad?: EventHandler[]\n variant?: ScreenVariant\n workspaceAppId: string\n}\n\nexport interface ScreenRoutesViewOutput extends Document {\n id: string\n routing: ScreenRouting\n}\n\nexport type ScreenRoutingJson = Record<\n string,\n {\n subpaths: Record<string, any>\n }\n>\n\nexport interface EventHandler {\n parameters: {\n key: string\n type: string\n value: string\n persist: any | null\n }\n \"##eventHandlerType\": string\n id: string\n}\n", "export enum SQLiteType {\n REAL = \"REAL\",\n TEXT = \"VARCHAR\",\n INT = \"INTEGER\",\n BLOB = \"BLOB\",\n NUMERIC = \"NUMERIC\",\n}\n\nexport type SQLiteTable = Record<\n string,\n SQLiteType | { field: string; type: SQLiteType }\n>\n\nexport type SQLiteTables = Record<\n string,\n {\n fields: SQLiteTable\n }\n>\n\nexport interface SQLiteDefinition {\n _id: string\n _rev: string\n language: string\n sql: {\n tables: SQLiteTables\n options: {\n table_name: string\n }\n }\n}\n\nexport interface PreSaveSQLiteDefinition\n extends Omit<SQLiteDefinition, \"_rev\"> {\n _rev?: string\n}\n", "export enum Theme {\n LIGHTEST = \"lightest\",\n LIGHT = \"light\",\n DARK = \"dark\",\n DARKEST = \"darkest\",\n NORD = \"nord\",\n MIDNIGHT = \"midnight\",\n}\n\nexport type ThemeMeta = {\n id: string\n name: string\n base?: Theme\n}\n", "import { LegacyFilter, UISearchFilter, SortOrder, SortType } from \"../../api\"\nimport { UIFieldMetadata } from \"./table\"\nimport { Document } from \"../document\"\nimport { DBView, SearchFilters } from \"../../sdk\"\n\nexport type ViewTemplateOpts = {\n field: string\n tableId: string\n groupBy?: string\n filters: ViewFilter[]\n schema: any\n calculation?: string\n groupByMulti?: boolean\n}\n\nexport interface InMemoryView extends Document {\n view: DBView\n name: string\n tableId: string\n groupBy?: string\n}\n\nexport interface View {\n name?: string\n tableId: string\n field?: string\n filters: ViewFilter[]\n schema: ViewSchema\n calculation?: ViewCalculation\n map?: string\n reduce?: any\n meta?: ViewTemplateOpts\n groupBy?: string\n}\n\nexport interface BasicViewFieldMetadata extends UIFieldMetadata {\n readonly?: boolean\n columns?: Record<string, RelationSchemaField>\n}\n\nexport interface RelationSchemaField extends UIFieldMetadata {\n readonly?: boolean\n}\n\nexport interface NumericCalculationFieldMetadata\n extends BasicViewFieldMetadata {\n calculationType:\n | CalculationType.MIN\n | CalculationType.MAX\n | CalculationType.SUM\n | CalculationType.AVG\n field: string\n}\n\nexport interface CountCalculationFieldMetadata extends BasicViewFieldMetadata {\n calculationType: CalculationType.COUNT\n field: string\n}\n\nexport interface CountDistinctCalculationFieldMetadata\n extends CountCalculationFieldMetadata {\n distinct: true\n}\n\nexport type ViewCalculationFieldMetadata =\n | NumericCalculationFieldMetadata\n | CountCalculationFieldMetadata\n | CountDistinctCalculationFieldMetadata\n\nexport type ViewFieldMetadata =\n | BasicViewFieldMetadata\n | ViewCalculationFieldMetadata\n\nexport enum CalculationType {\n SUM = \"sum\",\n AVG = \"avg\",\n COUNT = \"count\",\n MIN = \"min\",\n MAX = \"max\",\n}\n\nexport enum ViewV2Type {\n CALCULATION = \"calculation\",\n}\n\nexport interface ViewV2 {\n version: 2\n id: string\n name: string\n type?: ViewV2Type\n primaryDisplay?: string\n tableId: string\n query?: LegacyFilter[] | SearchFilters\n // duplicate to store UI information about filters\n queryUI?: UISearchFilter\n sort?: {\n field: string\n order?: SortOrder\n type?: SortType\n }\n schema?: ViewV2Schema\n rowHeight?: number\n}\n\nexport interface PublicAPIView extends Omit<ViewV2, \"query\" | \"queryUI\"> {\n query?: UISearchFilter\n}\n\nexport type ViewV2Schema = Record<string, ViewFieldMetadata>\n\nexport type ViewSchema = ViewCountOrSumSchema | ViewStatisticsSchema\n\nexport interface ViewCountOrSumSchema {\n field: string\n value: string\n}\n\n/**\n e.g:\n \"min\": {\n \"type\": \"number\"\n },\n \"max\": {\n \"type\": \"number\"\n }\n */\nexport interface ViewStatisticsSchema {\n [key: string]: {\n type: string\n }\n}\n\nexport interface ViewFilter {\n value?: any\n condition: string\n key: string\n conjunction?: string\n}\n\nexport enum ViewCalculation {\n SUM = \"sum\",\n COUNT = \"count\",\n STATISTICS = \"stats\",\n}\n", "import { Document } from \"../document\"\nimport { JSONSchema7 } from \"json-schema\"\n\nexport enum WebhookActionType {\n AUTOMATION = \"automation\",\n}\n\nexport interface Webhook extends Document {\n live: boolean\n name: string\n action: {\n type: WebhookActionType\n target: string\n }\n bodySchema?: JSONSchema7\n}\n", "import { Document } from \"../document\"\n\nexport interface Config<T = any> extends Document {\n type: ConfigType\n config: T\n}\n\nexport interface SMTPInnerConfig {\n port: number\n host: string\n from: string\n subject?: string\n secure: boolean\n auth?: {\n user: string\n pass: string\n }\n connectionTimeout?: any\n fallback?: boolean\n}\n\nexport interface SMTPConfig extends Config<SMTPInnerConfig> {}\n\n/**\n * Accessible only via pro.\n */\nexport interface SettingsBrandingConfig {\n faviconUrl?: string\n faviconUrlEtag?: string\n emailBrandingEnabled?: boolean\n testimonialsEnabled?: boolean\n platformTitle?: string\n loginHeading?: string\n loginButton?: string\n metaDescription?: string\n metaImageUrl?: string\n metaTitle?: string\n}\n\nexport interface SettingsInnerConfig {\n platformUrl?: string\n company?: string\n logoUrl?: string // Populated on read\n docsUrl?: string\n logoUrlEtag?: string\n uniqueTenantId?: string\n analyticsEnabled?: boolean\n isSSOEnforced?: boolean\n createdVersion?: string\n}\n\nexport interface SettingsConfig extends Config<SettingsInnerConfig> {}\n\nexport type SSOConfigType = ConfigType.GOOGLE | ConfigType.OIDC\nexport type SSOConfig = GoogleInnerConfig | OIDCInnerConfig\n\nexport interface GoogleInnerConfig {\n clientID: string\n clientSecret: string\n activated: boolean\n /**\n * @deprecated read only\n */\n callbackURL?: string\n}\n\nexport interface GoogleConfig extends Config<GoogleInnerConfig> {}\n\nexport interface OIDCStrategyConfiguration {\n issuer: string\n authorizationURL: string\n tokenURL: string\n userInfoURL: string\n clientID: string\n clientSecret: string\n callbackURL: string\n pkce?: PKCEMethod\n}\n\nexport interface OIDCConfigs {\n configs: OIDCInnerConfig[]\n}\n\nexport interface OIDCLogosInnerConfig {\n [key: string]: string\n}\n\nexport interface OIDCLogosConfig extends Config<OIDCLogosInnerConfig> {}\n\nexport interface OIDCInnerConfig {\n configUrl: string\n clientID: string\n clientSecret: string\n logo: string\n name: string\n uuid: string\n activated: boolean\n scopes: string[]\n pkce?: PKCEMethod\n}\n\nexport interface OIDCConfig extends Config<OIDCConfigs> {}\n\nexport interface OIDCWellKnownConfig {\n issuer: string\n authorization_endpoint: string\n token_endpoint: string\n userinfo_endpoint: string\n}\n\nexport interface SCIMInnerConfig {\n enabled: boolean\n}\n\nexport interface SCIMConfig extends Config<SCIMInnerConfig> {}\n\nexport type AIProvider =\n | \"OpenAI\"\n | \"Anthropic\"\n | \"AzureOpenAI\"\n | \"TogetherAI\"\n | \"Custom\"\n | \"BudibaseAI\"\n\nexport interface ProviderConfig {\n provider: AIProvider\n isDefault: boolean\n name: string\n active: boolean\n baseUrl?: string\n apiKey?: string\n defaultModel?: string\n}\n\nexport interface AIInnerConfig {\n [key: string]: ProviderConfig\n}\n\nexport interface AIConfig extends Config<AIInnerConfig> {}\n\nexport interface RecaptchaInnerConfig {\n siteKey: string\n secretKey: string\n}\n\nexport interface RecaptchaConfig extends Config<RecaptchaInnerConfig> {}\n\nexport const isConfig = (config: Object): config is Config =>\n \"type\" in config && \"config\" in config\n\nexport const isSettingsConfig = (config: Config): config is SettingsConfig =>\n config.type === ConfigType.SETTINGS\n\nexport const isSMTPConfig = (config: Config): config is SMTPConfig =>\n config.type === ConfigType.SMTP\n\nexport const isGoogleConfig = (config: Config): config is GoogleConfig =>\n config.type === ConfigType.GOOGLE\n\nexport const isOIDCConfig = (config: Config): config is OIDCConfig =>\n config.type === ConfigType.OIDC\n\nexport const isSCIMConfig = (config: Config): config is SCIMConfig =>\n config.type === ConfigType.SCIM\n\nexport const isAIConfig = (config: Config): config is AIConfig =>\n config.type === ConfigType.AI\n\nexport const isRecaptchaConfig = (config: Config): config is RecaptchaConfig =>\n config.type === ConfigType.RECAPTCHA\n\nexport enum PKCEMethod {\n S256 = \"S256\",\n PLAIN = \"plain\",\n}\n\nexport enum ConfigType {\n SETTINGS = \"settings\",\n ACCOUNT = \"account\",\n SMTP = \"smtp\",\n GOOGLE = \"google\",\n OIDC = \"oidc\",\n OIDC_LOGOS = \"logos_oidc\",\n SCIM = \"scim\",\n AI = \"ai\",\n RECAPTCHA = \"recaptcha\",\n}\n\nexport type ConfigTypeToConfig<T extends ConfigType> =\n T extends ConfigType.SETTINGS\n ? SettingsConfig\n : T extends ConfigType.SMTP\n ? SMTPConfig\n : T extends ConfigType.GOOGLE\n ? GoogleConfig\n : T extends ConfigType.OIDC\n ? OIDCConfig\n : T extends ConfigType.OIDC_LOGOS\n ? OIDCLogosConfig\n : T extends ConfigType.SCIM\n ? SCIMConfig\n : T extends ConfigType.AI\n ? AIConfig\n : never\n", "import { Document } from \"../document\"\nimport { ContextUser } from \"../../sdk\"\n\n// SSO\n\nexport interface SSOProfileJson {\n email?: string\n picture?: string\n}\n\nexport interface OAuth2 {\n accessToken: string\n refreshToken?: string\n}\n\nexport enum SSOProviderType {\n OIDC = \"oidc\",\n GOOGLE = \"google\",\n}\n\nexport interface UserSSO {\n provider: string // the individual provider e.g. Okta, Auth0, Google\n providerType: SSOProviderType\n oauth2?: OAuth2\n profile?: {\n displayName?: string\n name?: {\n givenName?: string\n familyName?: string\n }\n }\n}\n\nexport type SSOUser = User & UserSSO\n\nexport type OIDCUser = User & {\n provider: string | undefined\n providerType: SSOProviderType | undefined\n oauth2?: OAuth2 | undefined\n profile?:\n | {\n displayName?: string\n name?: {\n givenName?: string\n familyName?: string\n }\n }\n | undefined\n thirdPartyProfile?: object | undefined\n}\n\nexport function isSSOUser(user: User | ContextUser): user is SSOUser {\n return !!(user as SSOUser).providerType\n}\n\n// USER\n\nexport interface UserIdentifier {\n userId: string\n email: string\n}\n\nexport interface UserBuilderInfo {\n builder?: {\n global?: boolean\n apps?: string[]\n creator?: boolean\n }\n}\n\nexport interface UserAdminInfo {\n admin?: {\n global: boolean\n }\n}\n\nexport interface UserRoleInfo {\n roles: UserRoles\n}\n\nexport interface User\n extends Document,\n UserBuilderInfo,\n UserAdminInfo,\n UserRoleInfo {\n tenantId: string\n email: string\n userId?: string\n firstName?: string\n lastName?: string\n forceResetPassword?: boolean\n roles: UserRoles\n password?: string\n status?: UserStatus\n createdAt?: number // override the default createdAt behaviour - users sdk historically set this to Date.now()\n userGroups?: string[]\n freeTrialConfirmedAt?: string\n scimInfo?: { isSync: true } & Record<string, any>\n appFavourites?: string[]\n ssoId?: string\n appSort?: string\n budibaseAccess?: boolean\n accountPortalAccess?: boolean\n onboardedAt?: string // deprecated and no longer saved\n tours?: Record<string, Date> // deprecated and no longer saved\n}\n\nexport type StrippedUser = Pick<User, \"_id\" | \"tenantId\" | \"email\" | \"userId\">\n\nexport interface UserBindings extends Document {\n firstName?: string\n lastName?: string\n email?: string\n status?: string\n roleId?: string | null\n globalId?: string\n userId?: string\n oauth2?: OAuth2\n provider?: string\n providerType?: SSOProviderType\n}\n\nexport enum UserStatus {\n ACTIVE = \"active\",\n INACTIVE = \"inactive\",\n}\n\n// specifies a map of app ID to role ID\nexport type UserRoles = Record<string, string>\n\n// UTILITY TYPES\n\nexport interface BuilderUser extends User {\n builder: {\n global?: boolean\n apps?: string[]\n }\n}\n\nexport interface AdminUser extends User {\n admin: {\n global: boolean\n }\n builder: {\n global: boolean\n }\n}\n\nexport interface AdminOnlyUser extends User {\n admin: {\n global: boolean\n }\n}\n\nexport function isUser(user: object): user is User {\n return !!(user as User).roles\n}\n", "import { Document } from \"../document\"\n\nexport enum PluginType {\n DATASOURCE = \"datasource\",\n COMPONENT = \"component\",\n AUTOMATION = \"automation\",\n}\n\nexport enum PluginSource {\n NPM = \"NPM\",\n GITHUB = \"Github\",\n URL = \"URL\",\n FILE = \"File Upload\",\n}\nexport interface KoaFile {\n path: string | null\n name: string | null\n}\n\nexport interface Plugin extends Document {\n description: string\n name: string\n version: string\n source: PluginSource\n package: { [key: string]: any }\n hash: string\n schema: PluginSchema\n iconFileName?: string\n // Populated on read\n jsUrl?: string\n // Populated on read\n iconUrl?: string\n}\n\nexport const PLUGIN_TYPE_ARR = Object.values(PluginType)\n\nexport interface PluginSchema {\n type: PluginType\n [key: string]: any\n}\n\ninterface Package {\n name: string\n version: string\n description: string\n}\n\nexport interface PluginMetadata {\n schema: PluginSchema\n package: Package\n}\n\nexport interface PluginUpload {\n metadata: PluginMetadata\n directory: string\n}\n", "import { MonthlyQuotaName, StaticQuotaName } from \"../../sdk\"\n\nexport enum BreakdownQuotaName {\n ROW_QUERIES = \"rowQueries\",\n DATASOURCE_QUERIES = \"datasourceQueries\",\n AUTOMATIONS = \"automations\",\n}\n\nexport const APP_QUOTA_NAMES = [\n StaticQuotaName.ROWS,\n MonthlyQuotaName.QUERIES,\n MonthlyQuotaName.AUTOMATIONS,\n]\n\nexport const BREAKDOWN_QUOTA_NAMES = [\n MonthlyQuotaName.QUERIES,\n MonthlyQuotaName.AUTOMATIONS,\n]\n\nexport interface UsageBreakdown {\n parent: MonthlyQuotaName\n values: {\n [key: string]: number\n }\n}\n\nexport type QuotaTriggers = {\n [key: string]: string | undefined\n}\n\nexport interface StaticUsage {\n [StaticQuotaName.APPS]: number\n [StaticQuotaName.PLUGINS]: number\n [StaticQuotaName.USERS]: number\n [StaticQuotaName.CREATORS]: number\n [StaticQuotaName.USER_GROUPS]: number\n [StaticQuotaName.ROWS]: number\n [StaticQuotaName.AI_CUSTOM_CONFIGS]: number\n triggers: {\n [key in StaticQuotaName]?: QuotaTriggers\n }\n}\n\nexport interface MonthlyUsage {\n [MonthlyQuotaName.QUERIES]: number\n [MonthlyQuotaName.AUTOMATIONS]: number\n [MonthlyQuotaName.BUDIBASE_AI_CREDITS]: number\n [MonthlyQuotaName.ACTIONS]: number\n triggers: {\n [key in MonthlyQuotaName]?: QuotaTriggers\n }\n breakdown?: {\n [key in BreakdownQuotaName]?: UsageBreakdown\n }\n}\n\nexport interface BaseQuotaUsage {\n usageQuota: StaticUsage\n monthly: {\n [key: string]: MonthlyUsage\n }\n}\n\nexport interface QuotaUsage extends BaseQuotaUsage {\n _id: string\n _rev?: string\n quotaReset: string\n apps?: {\n [key: string]: BaseQuotaUsage\n }\n}\n\nexport type SetUsageValues = {\n total: number\n app?: number\n breakdown?: number\n triggers?: QuotaTriggers\n}\n\nexport type UsageValues = {\n total: number\n app?: number\n breakdown?: number\n}\n", "import { Document } from \"../document\"\n\nexport enum ScheduleType {\n APP_BACKUP = \"app_backup\",\n}\n\nexport enum ScheduleRepeatPeriod {\n DAILY = \"daily\",\n WEEKLY = \"weekly\",\n MONTHLY = \"monthly\",\n}\n\nexport interface Schedule extends Document {\n type: ScheduleType\n name: string\n startDate: string\n repeat: ScheduleRepeatPeriod\n metadata: ScheduleMetadata\n}\n\nexport type ScheduleMetadata = AppBackupScheduleMetadata\n\nexport const isAppBackupMetadata = (\n type: ScheduleType,\n metadata: ScheduleMetadata\n): metadata is AppBackupScheduleMetadata => {\n return type === ScheduleType.APP_BACKUP\n}\n\nexport interface AppBackupScheduleMetadata {\n apps: string[]\n}\n", "import { Document } from \"../document\"\nimport { Event } from \"../../sdk\"\n\nexport const AuditLogSystemUser = \"SYSTEM\"\nexport const AUDIT_LOG_TYPE = \"auditLog\"\n\nexport type FallbackInfo = {\n appName?: string\n email?: string\n}\n\nexport interface AuditLogDoc extends Document {\n appId?: string\n event: Event\n userId: string\n timestamp: string\n metadata: any\n name: string\n type?: \"auditLog\"\n fallback?: FallbackInfo\n}\n", "export enum PingSource {\n BUILDER = \"builder\",\n APP = \"app\",\n}\n\nexport interface AnalyticsEnabledResponse {\n enabled: boolean\n}\n\nexport interface AnalyticsPingRequest {\n source: PingSource\n timezone: string\n embedded?: boolean\n}\nexport interface AnalyticsPingResponse {\n message: string\n source?: PingSource\n}\n", "export interface APIError {\n message: string\n status: number\n error?: any\n validationErrors?: any\n}\n\nexport enum ErrorCode {\n USAGE_LIMIT_EXCEEDED = \"usage_limit_exceeded\",\n FEATURE_DISABLED = \"feature_disabled\",\n INVALID_API_KEY = \"invalid_api_key\",\n HTTP = \"http\",\n}\n", "import { AutomationJob } from \"../../../sdk/automations\"\nimport {\n Automation,\n AutomationActionStepId,\n AutomationLogPage,\n AutomationResults,\n AutomationStatus,\n AutomationStepDefinition,\n AutomationTriggerDefinition,\n AutomationTriggerStepId,\n DidNotTriggerResponse,\n Row,\n} from \"../../../documents\"\nimport { DocumentDestroyResponse } from \"@budibase/nano\"\n\nexport type GetAutomationTriggerDefinitionsResponse = Record<\n keyof typeof AutomationTriggerStepId,\n AutomationTriggerDefinition\n>\n\nexport type GetAutomationActionDefinitionsResponse = Record<\n keyof typeof AutomationActionStepId,\n AutomationStepDefinition\n>\n\nexport interface GetAutomationStepDefinitionsResponse {\n trigger: GetAutomationTriggerDefinitionsResponse\n action: GetAutomationActionDefinitionsResponse\n}\n\nexport interface DeleteAutomationResponse extends DocumentDestroyResponse {}\n\nexport interface FetchAutomationResponse {\n automations: Automation[]\n}\n\nexport interface FindAutomationResponse extends Automation {}\n\nexport interface UpdateAutomationRequest extends Automation {}\nexport interface UpdateAutomationResponse {\n message: string\n automation: Automation\n}\n\nexport interface CreateAutomationRequest extends Automation {}\nexport interface CreateAutomationResponse {\n message: string\n automation: Automation\n}\n\nexport interface SearchAutomationLogsRequest {\n startDate?: string\n status?: AutomationStatus\n automationId?: string\n page?: string\n}\nexport interface SearchAutomationLogsResponse extends AutomationLogPage {}\n\nexport interface ClearAutomationLogRequest {\n automationId: string\n appId: string\n}\nexport interface ClearAutomationLogResponse {\n message: string\n}\n\nexport interface TriggerAutomationRequest {\n fields?: Record<string, any>\n timestamp?: number\n // time in seconds\n timeout: number\n}\nexport type TriggerAutomationResponse = Record<string, any> | undefined\n\nexport interface TestAutomationRequest {\n id?: string\n revision?: string\n timeout?: number\n fields?: Record<string, any>\n row?: Row\n oldRow?: Row\n}\n\nexport function isDidNotTriggerResponse(\n response: TestAutomationResponse\n): response is DidNotTriggerResponse {\n return !!(\"message\" in response && response.message)\n}\n\nexport function isAutomationResults(\n response: TestAutomationResponse\n): response is AutomationResults {\n return !!(\n \"steps\" in response &&\n response.steps &&\n \"trigger\" in response &&\n response.trigger\n )\n}\n\nexport type TestAutomationResponse =\n | AutomationResults\n | DidNotTriggerResponse\n | AutomationJob\n", "import { DeploymentDoc, DeploymentStatus } from \"../../../documents\"\n\nexport interface PublishAppRequest {\n automationIds?: string[]\n workspaceAppIds?: string[]\n seedProductionTables?: boolean\n}\n\nexport interface PublishAppResponse extends DeploymentDoc {}\n\nexport enum PublishResourceState {\n PUBLISHED = \"published\",\n DISABLED = \"disabled\",\n}\n\nexport type PublishStatusResource = {\n published: boolean\n name: string\n publishedAt?: string\n unpublishedChanges?: boolean\n state: PublishResourceState\n}\n\nexport interface PublishStatusResponse {\n workspaceApps: Record<string, PublishStatusResource>\n automations: Record<string, PublishStatusResource>\n tables: Record<string, PublishStatusResource>\n}\n\nexport interface DeploymentProgressResponse {\n _id: string\n appId: string\n status?: DeploymentStatus\n updatedAt: number\n}\n\nexport type FetchDeploymentResponse = DeploymentProgressResponse[]\n", "export enum SortOrder {\n ASCENDING = \"ascending\",\n DESCENDING = \"descending\",\n}\n\nexport enum SortType {\n STRING = \"string\",\n NUMBER = \"number\",\n}\n\nexport interface BasicPaginationRequest {\n bookmark?: string\n}\n\nexport interface PaginationRequest extends BasicPaginationRequest {\n limit?: number\n sort?: {\n order: SortOrder\n column: string\n type: SortType\n }\n}\n\nexport interface PaginationResponse {\n bookmark: string | number | undefined\n hasNextPage?: boolean\n totalRows?: number\n}\n", "import {\n ArrayOperator,\n BasicOperator,\n EmptyFilterOption,\n InternalSearchFilterOperator,\n LogicalOperator,\n RangeOperator,\n SearchFilterKey,\n} from \"../../../../sdk\"\nimport { Row } from \"../../../../documents\"\nimport {\n PaginationResponse,\n SortOrder,\n SortType,\n} from \"../../../../api/web/pagination\"\nimport { z } from \"zod\"\n\nconst fieldKey = z\n .string()\n .refine(s => s !== InternalSearchFilterOperator.COMPLEX_ID_OPERATOR, {\n message: `Key '${InternalSearchFilterOperator.COMPLEX_ID_OPERATOR}' is not allowed`,\n })\n\nconst stringBasicFilter = z.record(fieldKey, z.string())\nconst basicFilter = z.record(fieldKey, z.any())\nconst arrayFilter = z.record(fieldKey, z.union([z.any().array(), z.string()]))\nconst logicFilter = z.lazy(() =>\n z.object({\n conditions: z.array(z.object(queryFilterValidation)),\n })\n)\n\nconst stringOrNumber = z.union([z.string(), z.number()])\n\nconst queryFilterValidation: Record<SearchFilterKey, z.ZodTypeAny> = {\n [BasicOperator.STRING]: stringBasicFilter.optional(),\n [BasicOperator.FUZZY]: stringBasicFilter.optional(),\n [RangeOperator.RANGE]: z\n .record(\n fieldKey,\n z.union([\n z.object({ high: stringOrNumber, low: stringOrNumber }),\n z.object({ high: stringOrNumber }),\n z.object({ low: stringOrNumber }),\n ])\n )\n .optional(),\n [BasicOperator.EQUAL]: basicFilter.optional(),\n [BasicOperator.NOT_EQUAL]: basicFilter.optional(),\n [BasicOperator.EMPTY]: basicFilter.optional(),\n [BasicOperator.NOT_EMPTY]: basicFilter.optional(),\n [ArrayOperator.ONE_OF]: arrayFilter.optional(),\n [ArrayOperator.CONTAINS]: arrayFilter.optional(),\n [ArrayOperator.NOT_CONTAINS]: arrayFilter.optional(),\n [ArrayOperator.CONTAINS_ANY]: arrayFilter.optional(),\n [LogicalOperator.AND]: logicFilter.optional(),\n [LogicalOperator.OR]: logicFilter.optional(),\n}\n\nconst searchRowRequest = z.object({\n query: z\n .object({\n allOr: z.boolean().optional(),\n onEmptyFilter: z.nativeEnum(EmptyFilterOption).optional(),\n ...queryFilterValidation,\n })\n .optional(),\n paginate: z.boolean().optional(),\n bookmark: z.union([z.string(), z.number()]).nullish(),\n limit: z.number().optional(),\n sort: z.string().nullish(),\n sortOrder: z.nativeEnum(SortOrder).optional(),\n sortType: z.nativeEnum(SortType).nullish(),\n version: z.string().optional(),\n disableEscaping: z.boolean().optional(),\n countRows: z.boolean().optional(),\n})\n\nexport const searchRowRequestValidator = searchRowRequest\n\nexport type SearchRowRequest = z.infer<typeof searchRowRequest>\nexport type SearchViewRowRequest = Pick<\n SearchRowRequest,\n | \"sort\"\n | \"sortOrder\"\n | \"sortType\"\n | \"limit\"\n | \"bookmark\"\n | \"paginate\"\n | \"query\"\n | \"countRows\"\n>\n\nexport interface SearchRowResponse {\n rows: Row[]\n}\n\nexport interface PaginatedSearchRowResponse\n extends SearchRowResponse,\n PaginationResponse {}\n", "export interface ResourceUsageRequest {\n workspaceAppIds?: string[]\n automationIds?: string[]\n}\n\nexport enum UsedByType {\n WORKSPACE = \"workspace\",\n AUTOMATION = \"automation\",\n}\n\nexport enum ResourceType {\n DATASOURCE = \"datasource\",\n TABLE = \"table\",\n ROW_ACTION = \"row_action\",\n QUERY = \"query\",\n AUTOMATION = \"automation\",\n}\n\nexport interface UsedResource {\n id: string\n name?: string\n type: ResourceType\n}\n\nexport interface ResourceUsageResponse {\n resources: UsedResource[]\n}\n", "import { DocumentDestroyResponse } from \"@budibase/nano\"\nimport { WorkspaceFavourite } from \"../../../documents\"\n\nexport enum WorkspaceResource {\n DATASOURCE = \"datasource\",\n QUERY = \"query\",\n TABLE = \"table\",\n AUTOMATION = \"automation\",\n WORKSPACE_APP = \"workspace_app\",\n VIEW = \"view\",\n}\n\nexport interface AddWorkspaceFavouriteRequest {\n resourceType: WorkspaceResource\n resourceId: string\n}\n\nexport interface AddWorkspaceFavouriteResponse {\n _id: string\n _rev: string\n resourceType: WorkspaceResource\n resourceId: string\n}\n\nexport interface WorkspaceFavouriteResponse {\n favourites: WorkspaceFavourite[]\n}\n\nexport interface DeleteWorkspaceFavouriteResponse\n extends DocumentDestroyResponse {}\n", "import { Event } from \"../../../sdk\"\nimport { PaginationResponse, BasicPaginationRequest } from \"../\"\nimport { User, App } from \"../../../\"\n\nexport interface AuditLogSearchParams {\n userIds?: string[]\n appIds?: string[]\n events?: Event[]\n startDate?: string\n endDate?: string\n fullSearch?: string\n bookmark?: string\n}\n\nexport interface DownloadAuditLogsRequest extends AuditLogSearchParams {}\n\nexport interface SearchAuditLogsRequest\n extends BasicPaginationRequest,\n AuditLogSearchParams {}\n\nexport enum AuditLogResourceStatus {\n DELETED = \"deleted\",\n}\n\nexport type DeletedResourceInfo = {\n _id: string\n status: AuditLogResourceStatus\n email?: string\n name?: string\n}\n\nexport interface AuditLogEnriched {\n app?: App | DeletedResourceInfo\n user: User | DeletedResourceInfo\n event: Event\n timestamp: string\n name: string\n metadata: any\n}\n\nexport interface SearchAuditLogsResponse extends PaginationResponse {\n data: AuditLogEnriched[]\n}\n\nexport interface DefinitionsAuditLogsResponse {\n events: Record<string, string>\n}\n", "export enum EventPublishType {\n ENVIRONMENT_VARIABLE_UPGRADE_PANEL_OPENED = \"environment_variable_upgrade_panel_opened\",\n}\n\nexport interface PostEventPublishRequest {\n type: EventPublishType\n}\nexport interface PostEventPublishResponse {\n message: string\n}\n", "import { EmailAttachment, EmailInvite } from \"../../../documents\"\nimport SMTPTransport from \"nodemailer/lib/smtp-transport\"\n\nexport enum EmailTemplatePurpose {\n CORE = \"core\",\n BASE = \"base\",\n PASSWORD_RECOVERY = \"password_recovery\",\n INVITATION = \"invitation\",\n WELCOME = \"welcome\",\n CUSTOM = \"custom\",\n}\n\nexport interface SendEmailRequest {\n email: string\n userId?: string\n purpose: EmailTemplatePurpose\n contents?: string\n from?: string\n subject: string\n cc?: string\n bcc?: string\n automation?: boolean\n invite?: EmailInvite\n attachments?: EmailAttachment[]\n}\nexport interface SendEmailResponse extends SMTPTransport.SentMessageInfo {\n message: string\n}\n", "export enum TemplateType {\n APP = \"app\",\n}\n\nexport interface TemplateMetadata {\n background: string\n icon: string\n category: string\n description: string\n name: string\n url: string\n type: TemplateType\n key: string\n image: string\n new: boolean\n}\n\nexport type FetchTemplateResponse = TemplateMetadata[]\n\nexport interface DownloadTemplateResponse {\n message: string\n}\n", "export enum ServiceType {\n WORKER = \"worker\",\n APPS = \"apps\",\n}\n\nexport enum MaintenanceType {\n SQS_MISSING = \"sqs_missing\",\n}\n", "export const enum EventType {\n ROW_SAVE = \"row:save\",\n ROW_UPDATE = \"row:update\",\n ROW_DELETE = \"row:delete\",\n TABLE_SAVE = \"table:save\",\n TABLE_UPDATED = \"table:updated\",\n TABLE_DELETE = \"table:delete\",\n}\n", "export interface EnrichedBinding {\n value?: string\n valueHTML?: string\n runtimeBinding: string\n readableBinding: string\n type?: null | string\n icon?: string\n category: string\n display?: { name: string; type: string }\n fieldSchema?: {\n name: string\n tableId: string\n type: string\n subtype?: string\n prefixKeys?: string\n }\n}\n\nexport enum BindingMode {\n Text = \"Text\",\n JavaScript = \"JavaScript\",\n}\n\nexport type CaretPositionFn = () => { start: number; end: number }\n\nexport type InsertAtPositionFn = (_: {\n start: number\n end?: number\n value: string\n cursor?: { anchor: number }\n}) => void\n\nexport interface UIBinding {\n tableId?: string\n fieldSchema?: {\n name: string\n tableId: string\n type: string\n subtype?: string\n prefixKeys?: string\n }\n component?: string\n providerId: string\n readableBinding?: string\n runtimeBinding?: string\n}\n", "import { FieldType } from \"@budibase/types\"\n\nexport * from \"./codeEditor\"\nexport * from \"./errors\"\n\nexport interface CustomComponent {\n Component: any\n schema: {\n type: \"component\"\n metadata: Record<string, any>\n schema: ComponentDefinition\n }\n version: string\n}\n\nexport interface ComponentDefinition {\n component: string\n name: string\n friendlyName?: string\n hasChildren?: boolean\n settings?: ComponentSetting[]\n features?: Record<string, boolean>\n typeSupportPresets?: Record<string, any>\n legalDirectChildren: string[]\n requiredAncestors?: string[]\n illegalChildren: string[]\n icon?: string\n new?: boolean\n size?: {\n width: number\n height: number\n }\n context?: ComponentContext | ComponentContext[]\n actions?: (string | any)[]\n}\n\nexport type DependsOnComponentSetting =\n | string\n | {\n setting: string\n value: string\n }\n\nexport interface ComponentSetting {\n key: string\n type: string\n label?: string\n section?: string\n name?: string\n required?: boolean\n defaultValue?: any\n selectAllFields?: boolean\n resetOn?: string | string[]\n settings?: ComponentSetting[]\n nested?: boolean\n dependsOn?: DependsOnComponentSetting\n sectionDependsOn?: DependsOnComponentSetting\n contextAccess?: {\n global: boolean\n self: boolean\n }\n}\ninterface ComponentAction {\n type: string\n suffix?: string\n}\n\ninterface ComponentStaticContextValue {\n label: string\n key: string\n type: string // technically this is a long list of options but there are too many to enumerate\n}\n\nexport interface ComponentContext {\n type: ComponentContextType\n scope?: ComponentContextScopes\n actions?: ComponentAction[]\n suffix?: string\n values?: ComponentStaticContextValue[]\n}\n\nexport type ComponentContextType = \"action\" | \"static\" | \"schema\" | \"form\"\n\nexport const enum ComponentContextScopes {\n Local = \"local\",\n Global = \"global\",\n}\n\nexport type FilterConfig = {\n active: boolean\n field: string\n label?: string\n _id?: string\n columnType?: FieldType\n}\n", "// type purely to capture structures that the type is unknown, but maybe known later\nexport type UIObject = Record<string, any>\n\nexport const enum DropPosition {\n ABOVE = \"above\",\n BELOW = \"below\",\n INSIDE = \"inside\",\n}\n", "import {\n GetAutomationActionDefinitionsResponse,\n GetAutomationTriggerDefinitionsResponse,\n PublishStatusResource,\n} from \"../../api\"\nimport { Automation } from \"../../documents\"\n\nexport interface BlockPath {\n stepIdx: number\n branchIdx: number\n branchStepId: string\n id: string\n}\n\nexport interface BlockRef {\n id: string\n looped?: string\n pathTo: BlockPath[]\n terminating?: boolean\n}\n\nexport enum BlockDefinitionTypes {\n TRIGGER = \"TRIGGER\",\n CREATABLE_TRIGGER = \"CREATABLE_TRIGGER\",\n ACTION = \"ACTION\",\n}\n\nexport interface BlockDefinitions {\n [BlockDefinitionTypes.TRIGGER]: Partial<GetAutomationTriggerDefinitionsResponse>\n [BlockDefinitionTypes.CREATABLE_TRIGGER]: Partial<GetAutomationTriggerDefinitionsResponse>\n [BlockDefinitionTypes.ACTION]: Partial<GetAutomationActionDefinitionsResponse>\n}\n\nexport interface UIAutomation extends Automation {\n publishStatus: PublishStatusResource\n}\n", "export enum DataEnvironmentMode {\n DEVELOPMENT = \"development\",\n PRODUCTION = \"production\",\n}\n"],
4
+ "sourcesContent": ["/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n", "var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n", "var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n", "var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n", "/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n", "var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n", "/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;\n", "var overArg = require('./_overArg');\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nmodule.exports = getPrototype;\n", "/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n", "var baseGetTag = require('./_baseGetTag'),\n getPrototype = require('./_getPrototype'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nmodule.exports = isPlainObject;\n", "export * from \"./documents\"\nexport * from \"./sdk\"\nexport * from \"./api\"\nexport * from \"./core\"\nexport * from \"./shared\"\nexport * from \"./ui\"\n", "import { Message } from \"../api\"\nimport { AgentChat, AIProvider } from \"../documents\"\n\nexport enum AIOperationEnum {\n SUMMARISE_TEXT = \"SUMMARISE_TEXT\",\n CLEAN_DATA = \"CLEAN_DATA\",\n TRANSLATE = \"TRANSLATE\",\n CATEGORISE_TEXT = \"CATEGORISE_TEXT\",\n SENTIMENT_ANALYSIS = \"SENTIMENT_ANALYSIS\",\n PROMPT = \"PROMPT\",\n SEARCH_WEB = \"SEARCH_WEB\",\n}\n\nexport enum OperationFieldTypeEnum {\n MULTI_COLUMN = \"columns\",\n COLUMN = \"column\",\n BINDABLE_TEXT = \"prompt\",\n}\n\nexport type OperationFieldsType = {\n [AIOperationEnum.SUMMARISE_TEXT]: {\n columns: OperationFieldTypeEnum.MULTI_COLUMN\n }\n [AIOperationEnum.CLEAN_DATA]: {\n column: OperationFieldTypeEnum.COLUMN\n }\n [AIOperationEnum.TRANSLATE]: {\n column: OperationFieldTypeEnum.COLUMN\n language: OperationFieldTypeEnum.BINDABLE_TEXT\n }\n [AIOperationEnum.CATEGORISE_TEXT]: {\n columns: OperationFieldTypeEnum.MULTI_COLUMN\n categories: OperationFieldTypeEnum.BINDABLE_TEXT\n }\n [AIOperationEnum.SENTIMENT_ANALYSIS]: {\n column: OperationFieldTypeEnum.COLUMN\n }\n [AIOperationEnum.PROMPT]: {\n prompt: OperationFieldTypeEnum.BINDABLE_TEXT\n }\n [AIOperationEnum.SEARCH_WEB]: {\n columns: OperationFieldTypeEnum.MULTI_COLUMN\n }\n}\n\ntype BaseSchema = {\n operation: AIOperationEnum\n}\n\ntype SummariseTextSchema = BaseSchema & {\n operation: AIOperationEnum.SUMMARISE_TEXT\n columns: string[]\n}\n\ntype CleanDataSchema = BaseSchema & {\n operation: AIOperationEnum.CLEAN_DATA\n column: string\n}\n\ntype TranslateSchema = BaseSchema & {\n operation: AIOperationEnum.TRANSLATE\n column: string\n language: string\n}\n\ntype CategoriseTextSchema = BaseSchema & {\n operation: AIOperationEnum.CATEGORISE_TEXT\n columns: string[]\n categories: string[]\n}\n\ntype SentimentAnalysisSchema = BaseSchema & {\n operation: AIOperationEnum.SENTIMENT_ANALYSIS\n column: string\n}\n\ntype PromptSchema = BaseSchema & {\n operation: AIOperationEnum.PROMPT\n prompt: string\n}\n\ntype SearchWebSchema = BaseSchema & {\n operation: AIOperationEnum.SEARCH_WEB\n columns: string[]\n}\n\nexport type AIColumnSchema =\n | SummariseTextSchema\n | CleanDataSchema\n | TranslateSchema\n | CategoriseTextSchema\n | SentimentAnalysisSchema\n | PromptSchema\n | SearchWebSchema\n\nexport interface LLMConfigOptions {\n model: string\n apiKey?: string\n maxTokens?: number\n max_completion_tokens?: number\n // Primarily here for Azure OpenAI, because each customer has their own endpoint\n baseUrl?: string\n}\n\nexport interface LLMProviderConfig extends LLMConfigOptions {\n provider: AIProvider\n}\n\nexport interface LLMStreamChunk {\n type:\n | \"content\"\n | \"tool_call_start\"\n | \"tool_call_result\"\n | \"done\"\n | \"error\"\n | \"chat_saved\"\n content?: string\n toolCall?: {\n id: string\n name: string\n arguments: string\n }\n toolResult?: {\n id: string\n result: string\n error?: string\n }\n messages?: Message[]\n chat?: AgentChat\n tokensUsed?: number\n}\n", "export enum Hosting {\n CLOUD = \"cloud\",\n SELF = \"self\",\n}\n", "import { Hosting } from \"../hosting\"\nimport { Group, Identity } from \"./identification\"\n\nexport enum Event {\n // USER\n USER_CREATED = \"user:created\",\n USER_UPDATED = \"user:updated\",\n USER_DELETED = \"user:deleted\",\n\n // USER / ONBOARDING\n USER_ONBOARDING_COMPLETE = \"user:onboarding:complete\",\n\n // USER / PERMISSIONS\n USER_PERMISSION_ADMIN_ASSIGNED = \"user:admin:assigned\",\n USER_PERMISSION_ADMIN_REMOVED = \"user:admin:removed\",\n USER_PERMISSION_BUILDER_ASSIGNED = \"user:builder:assigned\",\n USER_PERMISSION_BUILDER_REMOVED = \"user:builder:removed\",\n\n // USER / INVITE\n USER_INVITED = \"user:invited\",\n USER_INVITED_ACCEPTED = \"user:invite:accepted\",\n\n // USER / PASSWORD\n USER_PASSWORD_FORCE_RESET = \"user:password:force:reset\",\n USER_PASSWORD_UPDATED = \"user:password:updated\",\n USER_PASSWORD_RESET_REQUESTED = \"user:password:reset:requested\",\n USER_PASSWORD_RESET = \"user:password:reset\",\n\n // USER / COLLABORATION\n USER_DATA_COLLABORATION = \"user:data:collaboration\",\n\n // EMAIL\n EMAIL_SMTP_CREATED = \"email:smtp:created\",\n EMAIL_SMTP_UPDATED = \"email:smtp:updated\",\n\n // AI\n AI_CONFIG_CREATED = \"ai:config:created\",\n AI_CONFIG_UPDATED = \"ai:config:updated\",\n\n // AUTH\n AUTH_SSO_CREATED = \"auth:sso:created\",\n AUTH_SSO_UPDATED = \"auth:sso:updated\",\n AUTH_SSO_ACTIVATED = \"auth:sso:activated\",\n AUTH_SSO_DEACTIVATED = \"auth:sso:deactivated\",\n AUTH_LOGIN = \"auth:login\",\n AUTH_LOGOUT = \"auth:logout\",\n\n // ORG\n ORG_NAME_UPDATED = \"org:info:name:updated\",\n ORG_LOGO_UPDATED = \"org:info:logo:updated\",\n ORG_PLATFORM_URL_UPDATED = \"org:platformurl:updated\",\n\n // INSTALLATION\n INSTALLATION_VERSION_CHECKED = \"installation:version:checked\",\n INSTALLATION_VERSION_UPGRADED = \"installation:version:upgraded\",\n INSTALLATION_VERSION_DOWNGRADED = \"installation:version:downgraded\",\n INSTALLATION_FIRST_STARTUP = \"installation:firstStartup\",\n\n // ORG / ANALYTICS\n ANALYTICS_OPT_OUT = \"analytics:opt:out\",\n ANALYTICS_OPT_IN = \"analytics:opt:in\",\n\n // APP\n APP_CREATED = \"app:created\",\n APP_UPDATED = \"app:updated\",\n APP_DELETED = \"app:deleted\",\n APP_DUPLICATED = \"app:duplicated\",\n APP_PUBLISHED = \"app:published\",\n APP_UNPUBLISHED = \"app:unpublished\",\n APP_TEMPLATE_IMPORTED = \"app:template:imported\",\n APP_FILE_IMPORTED = \"app:file:imported\",\n APP_VERSION_UPDATED = \"app:version:updated\",\n APP_VERSION_REVERTED = \"app:version:reverted\",\n APP_REVERTED = \"app:reverted\",\n APP_EXPORTED = \"app:exported\",\n\n // ROLE\n ROLE_CREATED = \"role:created\",\n ROLE_UPDATED = \"role:updated\",\n ROLE_DELETED = \"role:deleted\",\n ROLE_ASSIGNED = \"role:assigned\",\n ROLE_UNASSIGNED = \"role:unassigned\",\n\n // SERVE\n SERVED_BUILDER = \"served:builder\",\n SERVED_APP = \"served:app\",\n SERVED_APP_PREVIEW = \"served:app:preview\",\n\n // DATASOURCE\n DATASOURCE_CREATED = \"datasource:created\",\n DATASOURCE_UPDATED = \"datasource:updated\",\n DATASOURCE_DELETED = \"datasource:deleted\",\n\n // QUERY\n QUERY_CREATED = \"query:created\",\n QUERY_UPDATED = \"query:updated\",\n QUERY_DELETED = \"query:deleted\",\n QUERY_IMPORT = \"query:import\",\n QUERIES_RUN = \"queries:run\",\n QUERY_PREVIEWED = \"query:previewed\",\n\n // TABLE\n TABLE_CREATED = \"table:created\",\n TABLE_UPDATED = \"table:updated\",\n TABLE_DELETED = \"table:deleted\",\n TABLE_EXPORTED = \"table:exported\",\n TABLE_IMPORTED = \"table:imported\",\n TABLE_DATA_IMPORTED = \"table:data:imported\",\n\n // VIEW\n VIEW_CREATED = \"view:created\",\n VIEW_UPDATED = \"view:updated\",\n VIEW_DELETED = \"view:deleted\",\n VIEW_EXPORTED = \"view:exported\",\n VIEW_FILTER_CREATED = \"view:filter:created\",\n VIEW_FILTER_UPDATED = \"view:filter:updated\",\n VIEW_FILTER_DELETED = \"view:filter:deleted\",\n VIEW_CALCULATION_CREATED = \"view:calculation:created\",\n VIEW_CALCULATION_UPDATED = \"view:calculation:updated\",\n VIEW_CALCULATION_DELETED = \"view:calculation:deleted\",\n VIEW_JOIN_CREATED = \"view:join:created\",\n\n // ROWS\n ROWS_CREATED = \"rows:created\",\n ROWS_IMPORTED = \"rows:imported\",\n\n // COMPONENT\n COMPONENT_CREATED = \"component:created\",\n COMPONENT_DELETED = \"component:deleted\",\n\n // SCREEN\n SCREEN_CREATED = \"screen:created\",\n SCREEN_DELETED = \"screen:deleted\",\n\n // LAYOUT\n LAYOUT_CREATED = \"layout:created\",\n LAYOUT_DELETED = \"layout:deleted\",\n\n // AUTOMATION\n AUTOMATION_CREATED = \"automation:created\",\n AUTOMATION_DELETED = \"automation:deleted\",\n AUTOMATION_TESTED = \"automation:tested\",\n AUTOMATIONS_RUN = \"automations:run\",\n AUTOMATION_STEP_CREATED = \"automation:step:created\",\n AUTOMATION_STEP_DELETED = \"automation:step:deleted\",\n AUTOMATION_TRIGGER_UPDATED = \"automation:trigger:updated\",\n\n // LICENSE\n LICENSE_PLAN_CHANGED = \"license:plan:changed\",\n LICENSE_ACTIVATED = \"license:activated\",\n LICENSE_PAYMENT_FAILED = \"license:payment:failed\",\n LICENSE_PAYMENT_RECOVERED = \"license:payment:recovered\",\n LICENSE_CHECKOUT_OPENED = \"license:checkout:opened\",\n LICENSE_CHECKOUT_SUCCESS = \"license:checkout:success\",\n LICENSE_PORTAL_OPENED = \"license:portal:opened\",\n\n // ACCOUNT\n ACCOUNT_CREATED = \"account:created\",\n ACCOUNT_DELETED = \"account:deleted\",\n ACCOUNT_VERIFIED = \"account:verified\",\n\n // BACKFILL\n APP_BACKFILL_SUCCEEDED = \"app:backfill:succeeded\",\n APP_BACKFILL_FAILED = \"app:backfill:failed\",\n TENANT_BACKFILL_SUCCEEDED = \"tenant:backfill:succeeded\",\n TENANT_BACKFILL_FAILED = \"tenant:backfill:failed\",\n INSTALLATION_BACKFILL_SUCCEEDED = \"installation:backfill:succeeded\",\n INSTALLATION_BACKFILL_FAILED = \"installation:backfill:failed\",\n\n // USER\n USER_GROUP_CREATED = \"user_group:created\",\n USER_GROUP_UPDATED = \"user_group:updated\",\n USER_GROUP_DELETED = \"user_group:deleted\",\n USER_GROUP_USERS_ADDED = \"user_group:user_added\",\n USER_GROUP_USERS_REMOVED = \"user_group:users_deleted\",\n USER_GROUP_PERMISSIONS_EDITED = \"user_group:permissions_edited\",\n USER_GROUP_ONBOARDING = \"user_group:onboarding_added\",\n\n // PLUGIN\n PLUGIN_INIT = \"plugin:init\",\n PLUGIN_IMPORTED = \"plugin:imported\",\n PLUGIN_DELETED = \"plugin:deleted\",\n\n // BACKUP\n APP_BACKUP_RESTORED = \"app:backup:restored\",\n APP_BACKUP_TRIGGERED = \"app:backup:triggered\",\n\n // ENVIRONMENT VARIABLE\n ENVIRONMENT_VARIABLE_CREATED = \"environment_variable:created\",\n ENVIRONMENT_VARIABLE_DELETED = \"environment_variable:deleted\",\n ENVIRONMENT_VARIABLE_UPGRADE_PANEL_OPENED = \"environment_variable:upgrade_panel_opened\",\n\n // AUDIT LOG\n AUDIT_LOGS_FILTERED = \"audit_log:filtered\",\n AUDIT_LOGS_DOWNLOADED = \"audit_log:downloaded\",\n\n // ROW ACTION\n ROW_ACTION_CREATED = \"row_action:created\",\n\n //ACTION\n ACTION_AUTOMATION_STEP_EXECUTED = \"action:automation_step:executed\",\n ACTION_CRUD_EXECUTED = \"action:crud:executed\",\n ACTION_AI_AGENT_EXECUTED = \"action:ai_agent:executed\",\n\n // WORKSPACE\n WORKSPACE_CREATED = \"workspace:created\",\n WORKSPACE_UPDATED = \"workspace:updated\",\n WORKSPACE_DELETED = \"workspace:deleted\",\n\n // WORKSPACE APP\n WORKSPACE_APP_CREATED = \"workspace_app:created\",\n WORKSPACE_APP_UPDATED = \"workspace_app:updated\",\n WORKSPACE_APP_DELETED = \"workspace_app:deleted\",\n}\n\nexport const UserGroupSyncEvents: Event[] = [\n Event.USER_CREATED,\n Event.USER_UPDATED,\n Event.USER_DELETED,\n Event.USER_PERMISSION_ADMIN_ASSIGNED,\n Event.USER_PERMISSION_ADMIN_REMOVED,\n Event.USER_PERMISSION_BUILDER_ASSIGNED,\n Event.USER_PERMISSION_BUILDER_REMOVED,\n Event.USER_GROUP_CREATED,\n Event.USER_GROUP_UPDATED,\n Event.USER_GROUP_DELETED,\n Event.USER_GROUP_USERS_ADDED,\n Event.USER_GROUP_USERS_REMOVED,\n Event.USER_GROUP_PERMISSIONS_EDITED,\n]\n\n// Favourites\nexport const WorkspaceResourceEvents: Event[] = [\n Event.AUTOMATION_DELETED,\n Event.WORKSPACE_APP_DELETED,\n Event.DATASOURCE_DELETED,\n Event.TABLE_DELETED,\n Event.QUERY_DELETED,\n Event.VIEW_DELETED,\n]\n\nexport const AsyncEvents: Event[] = [\n ...UserGroupSyncEvents,\n ...WorkspaceResourceEvents,\n]\n\n// all events that are not audited have been added to this record as undefined, this means\n// that Typescript can protect us against new events being added and auditing of those\n// events not being considered. This might be a little ugly, but provides a level of\n// Typescript build protection for the audit log feature, any new event also needs to be\n// added to this map, during which the developer will need to consider if it should be\n// a user facing event or not.\nexport const AuditedEventFriendlyName: Record<Event, string | undefined> = {\n // USER\n [Event.USER_CREATED]: `User \"{{ email }}\" created{{#if viaScim}} via SCIM{{/if}}`,\n [Event.USER_UPDATED]: `User \"{{ email }}\" updated{{#if viaScim}} via SCIM{{/if}}`,\n [Event.USER_DELETED]: `User \"{{ email }}\" deleted{{#if viaScim}} via SCIM{{/if}}`,\n [Event.USER_PERMISSION_ADMIN_ASSIGNED]: `User \"{{ email }}\" admin role assigned`,\n [Event.USER_PERMISSION_ADMIN_REMOVED]: `User \"{{ email }}\" admin role removed`,\n [Event.USER_PERMISSION_BUILDER_ASSIGNED]: `User \"{{ email }}\" builder role assigned`,\n [Event.USER_PERMISSION_BUILDER_REMOVED]: `User \"{{ email }}\" builder role removed`,\n [Event.USER_INVITED]: `User \"{{ email }}\" invited`,\n [Event.USER_INVITED_ACCEPTED]: `User \"{{ email }}\" accepted invite`,\n [Event.USER_PASSWORD_UPDATED]: `User \"{{ email }}\" password updated`,\n [Event.USER_PASSWORD_RESET_REQUESTED]: `User \"{{ email }}\" password reset requested`,\n [Event.USER_PASSWORD_RESET]: `User \"{{ email }}\" password reset`,\n [Event.USER_GROUP_CREATED]: `User group \"{{ name }}\" created{{#if viaScim}} via SCIM{{/if}}`,\n [Event.USER_GROUP_UPDATED]: `User group \"{{ name }}\" updated{{#if viaScim}} via SCIM{{/if}}`,\n [Event.USER_GROUP_DELETED]: `User group \"{{ name }}\" deleted{{#if viaScim}} via SCIM{{/if}}`,\n [Event.USER_GROUP_USERS_ADDED]: `User group \"{{ name }}\" {{ count }} users added{{#if viaScim}} via SCIM{{/if}}`,\n [Event.USER_GROUP_USERS_REMOVED]: `User group \"{{ name }}\" {{ count }} users removed{{#if viaScim}} via SCIM{{/if}}`,\n [Event.USER_GROUP_PERMISSIONS_EDITED]: `User group \"{{ name }}\" permissions edited`,\n [Event.USER_PASSWORD_FORCE_RESET]: undefined,\n [Event.USER_GROUP_ONBOARDING]: undefined,\n [Event.USER_ONBOARDING_COMPLETE]: undefined,\n [Event.USER_DATA_COLLABORATION]: undefined,\n\n // EMAIL\n [Event.EMAIL_SMTP_CREATED]: `Email configuration created`,\n [Event.EMAIL_SMTP_UPDATED]: `Email configuration updated`,\n\n // AI\n [Event.AI_CONFIG_CREATED]: `AI configuration created`,\n [Event.AI_CONFIG_UPDATED]: `AI configuration updated`,\n\n // AUTH\n [Event.AUTH_SSO_CREATED]: `SSO configuration created`,\n [Event.AUTH_SSO_UPDATED]: `SSO configuration updated`,\n [Event.AUTH_SSO_ACTIVATED]: `SSO configuration activated`,\n [Event.AUTH_SSO_DEACTIVATED]: `SSO configuration deactivated`,\n [Event.AUTH_LOGIN]: `User \"{{ email }}\" logged in`,\n [Event.AUTH_LOGOUT]: `User \"{{ email }}\" logged out`,\n\n // ORG\n [Event.ORG_NAME_UPDATED]: `Organisation name updated`,\n [Event.ORG_LOGO_UPDATED]: `Organisation logo updated`,\n [Event.ORG_PLATFORM_URL_UPDATED]: `Organisation platform URL updated`,\n\n // APP\n [Event.APP_CREATED]: `App \"{{ name }}\" created`,\n [Event.APP_UPDATED]: `App \"{{ name }}\" updated`,\n [Event.APP_DELETED]: `App \"{{ name }}\" deleted`,\n [Event.APP_DUPLICATED]: `App \"{{ name }}\" duplicated`,\n [Event.APP_PUBLISHED]: `App \"{{ name }}\" published`,\n [Event.APP_UNPUBLISHED]: `App \"{{ name }}\" unpublished`,\n [Event.APP_TEMPLATE_IMPORTED]: `App \"{{ name }}\" template imported`,\n [Event.APP_FILE_IMPORTED]: `App \"{{ name }}\" file imported`,\n [Event.APP_VERSION_UPDATED]: `App \"{{ name }}\" version updated`,\n [Event.APP_VERSION_REVERTED]: `App \"{{ name }}\" version reverted`,\n [Event.APP_REVERTED]: `App \"{{ name }}\" reverted`,\n [Event.APP_EXPORTED]: `App \"{{ name }}\" exported`,\n [Event.APP_BACKUP_RESTORED]: `App backup \"{{ name }}\" restored`,\n [Event.APP_BACKUP_TRIGGERED]: `App backup \"{{ name }}\" triggered`,\n\n // DATASOURCE\n [Event.DATASOURCE_CREATED]: `Datasource created`,\n [Event.DATASOURCE_UPDATED]: `Datasource updated`,\n [Event.DATASOURCE_DELETED]: `Datasource deleted`,\n\n // QUERY\n [Event.QUERY_CREATED]: `Query created`,\n [Event.QUERY_UPDATED]: `Query updated`,\n [Event.QUERY_DELETED]: `Query deleted`,\n [Event.QUERY_IMPORT]: `Query import`,\n [Event.QUERIES_RUN]: undefined,\n [Event.QUERY_PREVIEWED]: undefined,\n\n // TABLE\n [Event.TABLE_CREATED]: `Table \"{{ name }}\" created`,\n [Event.TABLE_UPDATED]: `Table \"{{ name }}\" updated`,\n [Event.TABLE_DELETED]: `Table \"{{ name }}\" deleted`,\n [Event.TABLE_EXPORTED]: `Table \"{{ name }}\" exported`,\n [Event.TABLE_IMPORTED]: `Table \"{{ name }}\" imported`,\n [Event.TABLE_DATA_IMPORTED]: `Data imported to table`,\n\n // ROWS\n [Event.ROWS_CREATED]: `Rows created`,\n [Event.ROWS_IMPORTED]: `Rows imported`,\n\n // AUTOMATION\n [Event.AUTOMATION_CREATED]: `Automation \"{{ name }}\" created`,\n [Event.AUTOMATION_DELETED]: `Automation \"{{ name }}\" deleted`,\n [Event.AUTOMATION_STEP_CREATED]: `Automation \"{{ name }}\" step added`,\n [Event.AUTOMATION_STEP_DELETED]: `Automation \"{{ name }}\" step removed`,\n [Event.AUTOMATION_TESTED]: undefined,\n [Event.AUTOMATIONS_RUN]: undefined,\n [Event.AUTOMATION_TRIGGER_UPDATED]: undefined,\n\n // SCREEN\n [Event.SCREEN_CREATED]: `Screen \"{{ name }}\" created`,\n [Event.SCREEN_DELETED]: `Screen \"{{ name }}\" deleted`,\n\n // COMPONENT\n [Event.COMPONENT_CREATED]: `Component created`,\n [Event.COMPONENT_DELETED]: `Component deleted`,\n\n // ENVIRONMENT VARIABLE\n [Event.ENVIRONMENT_VARIABLE_CREATED]: `Environment variable created`,\n [Event.ENVIRONMENT_VARIABLE_DELETED]: `Environment variable deleted`,\n [Event.ENVIRONMENT_VARIABLE_UPGRADE_PANEL_OPENED]: undefined,\n\n // PLUGIN\n [Event.PLUGIN_IMPORTED]: `Plugin imported`,\n [Event.PLUGIN_DELETED]: `Plugin deleted`,\n [Event.PLUGIN_INIT]: undefined,\n\n // ACTIONS - NOT AUDITED\n [Event.ACTION_AUTOMATION_STEP_EXECUTED]: undefined,\n [Event.ACTION_CRUD_EXECUTED]: undefined,\n [Event.ACTION_AI_AGENT_EXECUTED]: undefined,\n\n // ROLE - NOT AUDITED\n [Event.ROLE_CREATED]: undefined,\n [Event.ROLE_UPDATED]: undefined,\n [Event.ROLE_DELETED]: undefined,\n [Event.ROLE_ASSIGNED]: undefined,\n [Event.ROLE_UNASSIGNED]: undefined,\n\n // LICENSE - NOT AUDITED\n [Event.LICENSE_PLAN_CHANGED]: undefined,\n [Event.LICENSE_ACTIVATED]: undefined,\n [Event.LICENSE_PAYMENT_FAILED]: undefined,\n [Event.LICENSE_PAYMENT_RECOVERED]: undefined,\n [Event.LICENSE_CHECKOUT_OPENED]: undefined,\n [Event.LICENSE_CHECKOUT_SUCCESS]: undefined,\n [Event.LICENSE_PORTAL_OPENED]: undefined,\n\n // ACCOUNT - NOT AUDITED\n [Event.ACCOUNT_CREATED]: undefined,\n [Event.ACCOUNT_DELETED]: undefined,\n [Event.ACCOUNT_VERIFIED]: undefined,\n\n // BACKFILL - NOT AUDITED\n [Event.APP_BACKFILL_SUCCEEDED]: undefined,\n [Event.APP_BACKFILL_FAILED]: undefined,\n [Event.TENANT_BACKFILL_SUCCEEDED]: undefined,\n [Event.TENANT_BACKFILL_FAILED]: undefined,\n [Event.INSTALLATION_BACKFILL_SUCCEEDED]: undefined,\n [Event.INSTALLATION_BACKFILL_FAILED]: undefined,\n\n // LAYOUT - NOT AUDITED\n [Event.LAYOUT_CREATED]: undefined,\n [Event.LAYOUT_DELETED]: undefined,\n\n // VIEW - NOT AUDITED\n [Event.VIEW_CREATED]: undefined,\n [Event.VIEW_UPDATED]: undefined,\n [Event.VIEW_DELETED]: undefined,\n [Event.VIEW_EXPORTED]: undefined,\n [Event.VIEW_FILTER_CREATED]: undefined,\n [Event.VIEW_FILTER_UPDATED]: undefined,\n [Event.VIEW_FILTER_DELETED]: undefined,\n [Event.VIEW_CALCULATION_CREATED]: undefined,\n [Event.VIEW_CALCULATION_UPDATED]: undefined,\n [Event.VIEW_CALCULATION_DELETED]: undefined,\n [Event.VIEW_JOIN_CREATED]: undefined,\n\n // SERVED - NOT AUDITED\n [Event.SERVED_BUILDER]: undefined,\n [Event.SERVED_APP]: undefined,\n [Event.SERVED_APP_PREVIEW]: undefined,\n\n // ANALYTICS - NOT AUDITED\n [Event.ANALYTICS_OPT_OUT]: undefined,\n [Event.ANALYTICS_OPT_IN]: undefined,\n\n // INSTALLATION - NOT AUDITED\n [Event.INSTALLATION_VERSION_CHECKED]: undefined,\n [Event.INSTALLATION_VERSION_UPGRADED]: undefined,\n [Event.INSTALLATION_VERSION_DOWNGRADED]: undefined,\n [Event.INSTALLATION_FIRST_STARTUP]: undefined,\n\n // AUDIT LOG - NOT AUDITED\n [Event.AUDIT_LOGS_FILTERED]: undefined,\n [Event.AUDIT_LOGS_DOWNLOADED]: undefined,\n\n // ROW ACTIONS - NOT AUDITED\n [Event.ROW_ACTION_CREATED]: undefined,\n\n // WORKSPACE\n [Event.WORKSPACE_CREATED]: undefined,\n [Event.WORKSPACE_DELETED]: undefined,\n [Event.WORKSPACE_UPDATED]: undefined,\n\n // WORKSPACE APP\n [Event.WORKSPACE_APP_CREATED]: undefined,\n [Event.WORKSPACE_APP_DELETED]: undefined,\n [Event.WORKSPACE_APP_UPDATED]: undefined,\n}\n\n// properties added at the final stage of the event pipeline\nexport interface BaseEvent {\n version?: string\n service?: string\n environment?: string\n appId?: string\n installationId?: string\n tenantId?: string\n hosting?: Hosting\n // any props in the audited section will be removed before passing events\n // up out of system (purely for use with auditing)\n audited?: {\n [key: string]: any\n }\n}\n\nexport type TableExportFormat = \"json\" | \"csv\"\n\nexport type DocUpdateEvent = {\n id: string\n tenantId: string\n appId?: string\n}\n\nexport interface EventProcessor {\n processEvent(\n event: Event,\n identity: Identity,\n properties: any,\n timestamp?: string | number\n ): Promise<void>\n identify?(identity: Identity, timestamp?: string | number): Promise<void>\n identifyGroup?(group: Group, timestamp?: string | number): Promise<void>\n shutdown?(): Promise<void>\n}\n", "import { Hosting } from \"..\"\n\n// GROUPS\n\nexport enum GroupType {\n TENANT = \"tenant\",\n INSTALLATION = \"installation\",\n}\n\nexport interface Group {\n id: string\n type: IdentityType\n environment: string\n hosting: Hosting\n}\n\nexport interface TenantGroup extends Group {\n // account level information is associated with the tenant group\n // as we don't have this at the user level\n profession?: string // only available in cloud\n companySize?: string // only available in cloud\n createdAt?: string | number\n createdVersion: string\n installationId: string\n}\n\nexport interface InstallationGroup extends Group {\n version: string\n}\n\n// IDENTITIES\n\nexport enum IdentityType {\n USER = \"user\",\n TENANT = \"tenant\",\n INSTALLATION = \"installation\",\n}\n\nexport interface HostInfo {\n ipAddress?: string\n userAgent?: string\n}\n\nexport interface Identity {\n id: string\n type: IdentityType\n hosting: Hosting\n environment: string\n installationId?: string\n tenantId?: string\n // usable - no unique format\n realTenantId?: string\n hostInfo?: HostInfo\n}\n\nexport interface UserIdentity extends Identity {\n verified: boolean\n accountHolder: boolean\n providerType?: string\n builder?: boolean\n admin?: boolean\n}\n", "export enum PlanType {\n FREE = \"free\",\n /** @deprecated */\n PRO = \"pro\",\n /** @deprecated */\n TEAM = \"team\",\n /** @deprecated */\n PREMIUM = \"premium\",\n PREMIUM_PLUS = \"premium_plus\",\n PREMIUM_PLUS_TRIAL = \"premium_plus_trial\",\n /** @deprecated */\n BUSINESS = \"business\",\n ENTERPRISE_BASIC = \"enterprise_basic\",\n ENTERPRISE_BASIC_TRIAL = \"enterprise_basic_trial\",\n ENTERPRISE = \"enterprise\",\n}\n\nexport enum PriceDuration {\n MONTHLY = \"monthly\",\n YEARLY = \"yearly\",\n}\n\nexport interface AvailablePlan {\n type: PlanType\n maxUsers: number\n prices: AvailablePrice[]\n}\n\nexport interface AvailablePrice {\n amount: number\n amountMonthly: number\n currency: string\n duration: PriceDuration\n priceId: string\n type?: string\n}\n\nexport enum PlanModel {\n PER_USER = \"perUser\",\n PER_CREATOR_PER_USER = \"per_creator_per_user\",\n}\n\nexport interface PurchasedPlan {\n type: PlanType\n model: PlanModel\n usesInvoicing: boolean\n price?: PurchasedPrice\n}\n\nexport interface PurchasedPrice extends AvailablePrice {\n /** @deprecated - now at the plan level via model */\n isPerUser: boolean\n}\n", "import { PlanType } from \".\"\n\nexport enum QuotaUsageType {\n STATIC = \"static\",\n MONTHLY = \"monthly\",\n}\n\nexport enum QuotaType {\n USAGE = \"usage\",\n CONSTANT = \"constant\",\n}\n\nexport enum StaticQuotaName {\n ROWS = \"rows\",\n APPS = \"apps\",\n USERS = \"users\",\n CREATORS = \"creators\",\n USER_GROUPS = \"userGroups\",\n PLUGINS = \"plugins\",\n AI_CUSTOM_CONFIGS = \"aiCustomConfigs\",\n}\n\nexport enum MonthlyQuotaName {\n QUERIES = \"queries\",\n AUTOMATIONS = \"automations\",\n BUDIBASE_AI_CREDITS = \"budibaseAICredits\",\n ACTIONS = \"actions\",\n}\n\nexport enum ConstantQuotaName {\n AUTOMATION_LOG_RETENTION_DAYS = \"automationLogRetentionDays\",\n APP_BACKUPS_RETENTION_DAYS = \"appBackupRetentionDays\",\n}\n\nexport type MeteredQuotaName = StaticQuotaName | MonthlyQuotaName\nexport type QuotaName = StaticQuotaName | MonthlyQuotaName | ConstantQuotaName\n\nexport const isStaticQuota = (\n quotaType: QuotaType,\n usageType: QuotaUsageType,\n name: QuotaName\n): name is StaticQuotaName => {\n return quotaType === QuotaType.USAGE && usageType === QuotaUsageType.STATIC\n}\n\nexport const isMonthlyQuota = (\n quotaType: QuotaType,\n usageType: QuotaUsageType,\n name: QuotaName\n): name is MonthlyQuotaName => {\n return quotaType === QuotaType.USAGE && usageType === QuotaUsageType.MONTHLY\n}\n\nexport const isConstantQuota = (\n quotaType: QuotaType,\n name: QuotaName\n): name is ConstantQuotaName => {\n return quotaType === QuotaType.CONSTANT\n}\n\nexport type PlanQuotas = { [key in PlanType]: Quotas | undefined }\n\nexport type MonthlyQuotas = {\n [MonthlyQuotaName.QUERIES]: Quota\n [MonthlyQuotaName.AUTOMATIONS]: Quota\n [MonthlyQuotaName.BUDIBASE_AI_CREDITS]: Quota\n [MonthlyQuotaName.ACTIONS]: Quota\n}\n\nexport type StaticQuotas = {\n [StaticQuotaName.ROWS]: Quota\n [StaticQuotaName.APPS]: Quota\n [StaticQuotaName.USERS]: Quota\n [StaticQuotaName.CREATORS]: Quota\n [StaticQuotaName.USER_GROUPS]: Quota\n [StaticQuotaName.PLUGINS]: Quota\n [StaticQuotaName.AI_CUSTOM_CONFIGS]: Quota\n}\n\nexport type ConstantQuotas = {\n [ConstantQuotaName.AUTOMATION_LOG_RETENTION_DAYS]: Quota\n [ConstantQuotaName.APP_BACKUPS_RETENTION_DAYS]: Quota\n}\n\nexport type Quotas = {\n [QuotaType.USAGE]: {\n [QuotaUsageType.MONTHLY]: MonthlyQuotas\n [QuotaUsageType.STATIC]: StaticQuotas\n }\n [QuotaType.CONSTANT]: ConstantQuotas\n}\n\nexport interface Quota {\n name: string\n value: number\n /**\n * Array of whole numbers (1-100) that dictate the percentage that this quota should trigger\n * at in relation to the corresponding usage inside budibase.\n *\n * Triggering results in a budibase installation sending a request to account-portal,\n * which can have subsequent effects such as sending emails to users.\n */\n triggers: number[]\n startDate?: number\n}\n", "import { PlanType } from \"./plan\"\n\nexport enum Feature {\n USER_GROUPS = \"userGroups\",\n APP_BACKUPS = \"appBackups\",\n ENVIRONMENT_VARIABLES = \"environmentVariables\",\n AUDIT_LOGS = \"auditLogs\",\n ENFORCEABLE_SSO = \"enforceableSSO\",\n BRANDING = \"branding\",\n SCIM = \"scim\",\n SYNC_AUTOMATIONS = \"syncAutomations\",\n TRIGGER_AUTOMATION_RUN = \"triggerAutomationRun\",\n APP_BUILDERS = \"appBuilders\",\n OFFLINE = \"offline\",\n EXPANDED_PUBLIC_API = \"expandedPublicApi\",\n CUSTOM_APP_SCRIPTS = \"customAppScripts\",\n PDF = \"pdf\",\n // deprecated - no longer licensed\n VIEW_PERMISSIONS = \"viewPermissions\",\n VIEW_READONLY_COLUMNS = \"viewReadonlyColumns\",\n BUDIBASE_AI = \"budibaseAI\",\n AI_CUSTOM_CONFIGS = \"aiCustomConfigs\",\n PWA = \"pwa\",\n RECAPTCHA = \"recaptcha\",\n PKCE_OIDC = \"pkceOidc\",\n}\n\nexport type PlanFeatures = { [key in PlanType]: Feature[] | undefined }\n", "import { Table, Row } from \"../documents\"\nimport { EnrichedQueryJson } from \"./search\"\n\nexport const PASSWORD_REPLACEMENT = \"--secret-value--\"\n\nexport enum Operation {\n CREATE = \"CREATE\",\n READ = \"READ\",\n UPDATE = \"UPDATE\",\n DELETE = \"DELETE\",\n COUNT = \"COUNT\",\n BULK_CREATE = \"BULK_CREATE\",\n BULK_UPSERT = \"BULK_UPSERT\",\n CREATE_TABLE = \"CREATE_TABLE\",\n UPDATE_TABLE = \"UPDATE_TABLE\",\n DELETE_TABLE = \"DELETE_TABLE\",\n}\n\nexport const RowOperations = [\n Operation.CREATE,\n Operation.READ,\n Operation.UPDATE,\n Operation.DELETE,\n Operation.BULK_CREATE,\n Operation.BULK_UPSERT,\n]\n\nexport enum QueryType {\n SQL = \"sql\",\n JSON = \"json\",\n FIELDS = \"fields\",\n}\n\nexport enum DatasourceFieldType {\n STRING = \"string\",\n CODE = \"code\",\n LONGFORM = \"longForm\",\n BOOLEAN = \"boolean\",\n NUMBER = \"number\",\n PASSWORD = \"password\",\n LIST = \"list\",\n OBJECT = \"object\",\n JSON = \"json\",\n FILE = \"file\",\n FIELD_GROUP = \"fieldGroup\",\n SELECT = \"select\",\n}\n\nexport enum SourceName {\n AIRTABLE = \"AIRTABLE\",\n ARANGODB = \"ARANGODB\",\n BUDIBASE = \"BUDIBASE\",\n COUCHDB = \"COUCHDB\",\n DYNAMODB = \"DYNAMODB\",\n ELASTICSEARCH = \"ELASTICSEARCH\",\n FIRESTORE = \"FIRESTORE\",\n GOOGLE_SHEETS = \"GOOGLE_SHEETS\",\n MONGODB = \"MONGODB\",\n MYSQL = \"MYSQL\",\n ORACLE = \"ORACLE\",\n POSTGRES = \"POSTGRES\",\n REDIS = \"REDIS\",\n REST = \"REST\",\n S3 = \"S3\",\n SNOWFLAKE = \"SNOWFLAKE\",\n SQL_SERVER = \"SQL_SERVER\",\n}\n\nexport enum IncludeRelationship {\n INCLUDE = 1,\n EXCLUDE = 0,\n}\n\nexport enum FilterType {\n STRING = \"string\",\n FUZZY = \"fuzzy\",\n RANGE = \"range\",\n EQUAL = \"equal\",\n NOT_EQUAL = \"notEqual\",\n EMPTY = \"empty\",\n NOT_EMPTY = \"notEmpty\",\n ONE_OF = \"oneOf\",\n}\n\nexport enum DatasourceFeature {\n CONNECTION_CHECKING = \"connection\",\n FETCH_TABLE_NAMES = \"fetch_table_names\",\n EXPORT_SCHEMA = \"export_schema\",\n}\n\nexport interface StepDefinition {\n key: string\n template: string\n}\n\nexport interface QueryDefinition {\n type: QueryType\n displayName?: string\n readable?: boolean\n customisable?: boolean\n fields?: object\n urlDisplay?: boolean\n steps?: Array<StepDefinition>\n}\n\nexport interface ExtraQueryConfig {\n [key: string]: {\n displayName: string\n type: string\n required: boolean\n data?: object\n }\n}\n\ninterface DatasourceBasicFieldConfig {\n type: DatasourceFieldType\n display?: string\n required?: boolean\n default?: any\n deprecated?: boolean\n hidden?: string\n placeholder?: string\n}\n\ninterface DatasourceSelectFieldConfig extends DatasourceBasicFieldConfig {\n type: DatasourceFieldType.SELECT\n config: { options: string[] }\n}\n\ninterface DatasourceFieldGroupConfig extends DatasourceBasicFieldConfig {\n type: DatasourceFieldType.FIELD_GROUP\n config: {\n openByDefault?: boolean\n nestedFields?: boolean\n }\n}\n\ntype DatasourceFieldConfig =\n | DatasourceSelectFieldConfig\n | DatasourceFieldGroupConfig\n | DatasourceBasicFieldConfig\n\nexport interface DatasourceConfig {\n [key: string]: DatasourceFieldConfig & {\n fields?: DatasourceConfig\n }\n}\n\nexport interface Integration {\n docs: string\n plus?: boolean\n isSQL?: boolean\n auth?: { type: string }\n features?: Partial<Record<DatasourceFeature, boolean>>\n relationships?: boolean\n description: string\n friendlyName: string\n type?: string\n iconUrl?: string\n datasource?: DatasourceConfig\n query: {\n [key: string]: QueryDefinition\n }\n extra?: ExtraQueryConfig\n}\n\nexport type ConnectionInfo = {\n connected: boolean\n error?: string\n}\n\nexport interface IntegrationBase {\n create?(query: any): Promise<any[] | any>\n read?(query: any): Promise<any[] | any>\n update?(query: any): Promise<any[] | any>\n delete?(query: any): Promise<any[] | any>\n patch?(query: any): Promise<any[] | any>\n testConnection?(): Promise<ConnectionInfo>\n getExternalSchema?(): Promise<string>\n defineTypeCastingFromSchema?(schema: {\n [key: string]: {\n name: string\n type: string\n }\n }): void\n}\n\nexport interface Schema {\n tables: Record<string, Table>\n errors: Record<string, string>\n}\n\n// return these when an operation occurred but we got no response\nexport enum DSPlusOperation {\n CREATE = \"create\",\n READ = \"read\",\n UPDATE = \"update\",\n DELETE = \"delete\",\n}\n\nexport type DatasourcePlusQueryResponse =\n | Row[]\n | Record<DSPlusOperation, boolean>[]\n | { total: number }[]\n | void\n\nexport interface DatasourcePlus extends IntegrationBase {\n // if the datasource supports the use of bindings directly (to protect against SQL injection)\n // this returns the format of the identifier\n getBindingIdentifier(): string\n getStringConcat(parts: string[]): string\n query(json: EnrichedQueryJson): Promise<DatasourcePlusQueryResponse>\n buildSchema(\n datasourceId: string,\n entities: Record<string, Table>,\n filter?: string[]\n ): Promise<Schema>\n getTableNames(): Promise<string[]>\n}\n", "import { Operation } from \"./datasources\"\nimport { Row, DocumentType, Table, Datasource } from \"../documents\"\nimport { SortOrder, SortType } from \"../api\"\nimport { Knex } from \"knex\"\nimport { Aggregation } from \"./row\"\nimport isPlainObject from \"lodash/isPlainObject\"\n\nexport enum BasicOperator {\n EQUAL = \"equal\",\n NOT_EQUAL = \"notEqual\",\n EMPTY = \"empty\",\n NOT_EMPTY = \"notEmpty\",\n FUZZY = \"fuzzy\",\n STRING = \"string\",\n}\n\nexport enum ArrayOperator {\n CONTAINS = \"contains\",\n NOT_CONTAINS = \"notContains\",\n CONTAINS_ANY = \"containsAny\",\n ONE_OF = \"oneOf\",\n}\n\nexport enum RangeOperator {\n RANGE = \"range\",\n}\n\nexport enum LogicalOperator {\n AND = \"$and\",\n OR = \"$or\",\n}\n\nexport function isLogicalSearchOperator(\n value: string\n): value is LogicalOperator {\n return Object.values(LogicalOperator).includes(value as LogicalOperator)\n}\n\nexport function isBasicSearchOperator(value: string): value is BasicOperator {\n return Object.values(BasicOperator).includes(value as BasicOperator)\n}\n\nexport function isArraySearchOperator(value: string): value is ArrayOperator {\n return Object.values(ArrayOperator).includes(value as ArrayOperator)\n}\n\nexport function isRangeSearchOperator(value: string): value is RangeOperator {\n return Object.values(RangeOperator).includes(value as RangeOperator)\n}\n\nexport type SearchFilterOperator =\n | BasicOperator\n | ArrayOperator\n | RangeOperator\n | LogicalOperator\n\nexport enum InternalSearchFilterOperator {\n COMPLEX_ID_OPERATOR = \"_complexIdOperator\",\n}\n\ntype BasicFilter<T = any> = Record<string, T> & {\n [InternalSearchFilterOperator.COMPLEX_ID_OPERATOR]?: never\n}\n\nexport type ArrayFilter = Record<string, any[]> & {\n [InternalSearchFilterOperator.COMPLEX_ID_OPERATOR]?: {\n id: string[]\n values: string[]\n }\n}\n\ntype RangeFilter = Record<\n string,\n | {\n high: number | string\n low: number | string\n }\n | { high: number | string }\n | { low: number | string }\n> & {\n [InternalSearchFilterOperator.COMPLEX_ID_OPERATOR]?: never\n}\n\ntype LogicalFilter = { conditions: SearchFilters[] }\n\nexport function isLogicalFilter(filter: any): filter is LogicalFilter {\n return isPlainObject(filter) && \"conditions\" in filter\n}\n\nexport type AnySearchFilter = BasicFilter | ArrayFilter | RangeFilter\n\nexport interface SearchFilters {\n allOr?: boolean\n // TODO: this is just around for now - we need a better way to do or/and\n // allows just fuzzy to be or - all the fuzzy/like parameters\n fuzzyOr?: boolean\n onEmptyFilter?: EmptyFilterOption\n [BasicOperator.STRING]?: BasicFilter<string>\n [BasicOperator.FUZZY]?: BasicFilter<string>\n [RangeOperator.RANGE]?: RangeFilter\n [BasicOperator.EQUAL]?: BasicFilter\n [BasicOperator.NOT_EQUAL]?: BasicFilter\n [BasicOperator.EMPTY]?: BasicFilter\n [BasicOperator.NOT_EMPTY]?: BasicFilter\n [ArrayOperator.ONE_OF]?: ArrayFilter\n [ArrayOperator.CONTAINS]?: ArrayFilter\n [ArrayOperator.NOT_CONTAINS]?: ArrayFilter\n [ArrayOperator.CONTAINS_ANY]?: ArrayFilter\n // specific to SQS/SQLite search on internal tables this can be used\n // to make sure the documents returned are always filtered down to a\n // specific document type (such as just rows)\n documentType?: DocumentType\n\n [LogicalOperator.AND]?: LogicalFilter\n [LogicalOperator.OR]?: LogicalFilter\n}\n\nexport type SearchFilterKey = keyof Omit<\n SearchFilters,\n \"allOr\" | \"onEmptyFilter\" | \"fuzzyOr\" | \"documentType\"\n>\n\nexport type SearchQueryFields = Omit<SearchFilters, \"allOr\" | \"onEmptyFilter\">\n\nexport interface SortJson {\n [key: string]: {\n direction: SortOrder\n type?: SortType\n }\n}\n\nexport interface PaginationJson {\n limit: number\n page?: string | number\n offset?: number\n}\n\nexport interface RenameColumn {\n old: string\n updated: string\n}\n\nexport interface RelationshipsJson {\n through?: string\n from?: string\n to?: string\n fromPrimary?: string\n toPrimary?: string\n tableName: string\n column: string\n}\n\n// TODO - this can be combined with the above type\nexport interface ManyToManyRelationshipJson {\n through: string\n from: string\n to: string\n fromPrimary: string\n toPrimary: string\n tableName: string\n column: string\n}\n\nexport interface QueryJson {\n endpoint: {\n datasourceId: string | Datasource\n entityId: string | Table\n operation: Operation\n schema?: string\n }\n resource?: {\n fields: string[]\n aggregations?: Aggregation[]\n }\n filters?: SearchFilters\n sort?: SortJson\n paginate?: PaginationJson\n body?: Row | Row[]\n meta?: {\n renamed?: RenameColumn\n oldTable?: Table\n // can specify something that columns could be prefixed with\n columnPrefix?: string\n }\n extra?: {\n idFilter?: SearchFilters\n }\n relationships?: RelationshipsJson[]\n tableAliases?: Record<string, string>\n}\n\nexport interface EnrichedQueryJson extends Omit<QueryJson, \"endpoint\"> {\n operation: Operation\n table: Table\n tables: Record<string, Table>\n datasource?: Datasource\n schema?: string\n}\n\nexport interface QueryOptions {\n disableReturning?: boolean\n disableBindings?: boolean\n}\n\nexport type SqlQueryBinding = Knex.Value[]\n\nexport interface SqlQuery {\n sql: string\n bindings?: SqlQueryBinding\n}\n\nexport enum EmptyFilterOption {\n RETURN_ALL = \"all\",\n RETURN_NONE = \"none\",\n}\n\nexport enum UILogicalOperator {\n ALL = \"all\",\n ANY = \"any\",\n}\n\nexport enum SqlClient {\n MS_SQL = \"mssql\",\n POSTGRES = \"pg\",\n MY_SQL = \"mysql2\",\n MARIADB = \"mariadb\",\n ORACLE = \"oracledb\",\n SQL_LITE = \"sqlite3\",\n}\n", "import { Context, Request } from \"koa\"\nimport {\n Role,\n UserRoles,\n Account,\n Row,\n Table,\n UserBindings,\n User,\n UserSSO,\n} from \"../documents\"\nimport { FeatureFlag, License } from \"../sdk\"\nimport { Files } from \"formidable\"\nimport { EventType } from \"../core\"\nimport { UserAgentContext } from \"koa-useragent\"\n\nexport enum LoginMethod {\n API_KEY = \"api_key\",\n COOKIE = \"cookie\",\n}\n\nexport interface ContextUser extends Omit<User & Partial<UserSSO>, \"roles\"> {\n globalId?: string\n license?: License\n userId?: string\n roleId?: string | null\n role?: Role\n roles?: UserRoles\n csrfToken?: string\n featureFlags?: FeatureFlag[]\n accountPortalAccess?: boolean\n account?: Account\n}\n\n/**\n * Add support for koa-body in context.\n */\nexport interface BBRequest<RequestBody> extends Request {\n body: RequestBody\n files?: Files\n}\n\n/**\n * Basic context with no user.\n */\nexport interface Ctx<\n RequestBody = any,\n ResponseBody = any,\n Params extends Record<string, any> = any,\n> extends Context {\n params: Params\n request: BBRequest<RequestBody>\n body: ResponseBody\n userAgent: UserAgentContext[\"userAgent\"]\n state: { nonce?: string }\n}\n\n/**\n * Authenticated context.\n */\nexport interface UserCtx<\n RequestBody = any,\n ResponseBody = any,\n Params extends Record<string, any> = any,\n> extends Ctx<RequestBody, ResponseBody, Params> {\n user: ContextUser\n state: { nonce?: string }\n roleId?: string\n eventEmitter?: ContextEmitter\n loginMethod?: LoginMethod\n}\n\n/**\n * @deprecated: Use UserCtx / Ctx appropriately\n * Authenticated context.\n */\nexport interface BBContext extends Ctx {\n user?: ContextUser\n}\n\nexport interface ContextEmitter {\n emitRow(values: {\n eventName: EventType.ROW_SAVE\n appId: string\n row: Row\n table: Table\n user: UserBindings\n }): void\n emitRow(values: {\n eventName: EventType.ROW_UPDATE\n appId: string\n row: Row\n table: Table\n oldRow: Row\n user: UserBindings\n }): void\n emitRow(values: {\n eventName: EventType.ROW_DELETE\n appId: string\n row: Row\n user: UserBindings\n }): void\n emitTable(\n eventName: EventType.TABLE_SAVE | EventType.TABLE_DELETE,\n appId: string,\n table?: Table\n ): void\n}\n", "import Redlock from \"redlock\"\n\nexport enum LockType {\n /**\n * If this lock is already held the attempted operation will not be performed.\n * No retries will take place and no error will be thrown.\n */\n TRY_ONCE = \"try_once\",\n TRY_TWICE = \"try_twice\",\n DEFAULT = \"default\",\n DELAY_500 = \"delay_500\",\n CUSTOM = \"custom\",\n AUTO_EXTEND = \"auto_extend\",\n}\n\nexport enum LockName {\n MIGRATIONS = \"migrations\",\n TRIGGER_QUOTA = \"trigger_quota\",\n SYNC_ACCOUNT_LICENSE = \"sync_account_license\",\n UPDATE_TENANTS_DOC = \"update_tenants_doc\",\n PERSIST_WRITETHROUGH = \"persist_writethrough\",\n QUOTA_USAGE_EVENT = \"quota_usage_event\",\n APP_MIGRATION = \"app_migrations\",\n PROCESS_USER_INVITE = \"process_user_invite\",\n SQS_SYNC_DEFINITIONS = \"sys_sync_definitions\",\n}\n\nexport type LockOptions = {\n /**\n * The lock type determines which client to use\n */\n type: LockType\n /**\n * The custom options to use when creating the redlock instance\n * type must be set to custom for the options to be applied\n */\n customOptions?: Redlock.Options\n /**\n * The name for the lock\n */\n name: LockName\n /**\n * The individual resource to lock. This is useful for locking around very specific identifiers, e.g. a document that is prone to conflicts\n */\n resource?: string\n /**\n * This is a system-wide lock - don't use tenancy in lock key\n */\n systemLock?: boolean\n} & (\n | {\n /**\n * The ttl to auto-expire the lock if not unlocked manually\n */\n ttl: number\n type: Exclude<LockType, LockType.AUTO_EXTEND>\n }\n | {\n type: LockType.AUTO_EXTEND\n onExtend?: () => void\n }\n)\n", "import type Nano from \"@budibase/nano\"\nimport {\n AllDocsResponse,\n AnyDocument,\n Document,\n RowValue,\n SqlQueryBinding,\n ViewTemplateOpts,\n} from \"../\"\nimport { Writable } from \"stream\"\nimport { ReadStream } from \"fs\"\n\nexport enum SearchIndex {\n ROWS = \"rows\",\n USER = \"user\",\n}\n\nexport type PouchOptions = {\n inMemory?: boolean\n replication?: boolean\n onDisk?: boolean\n find?: boolean\n}\n\nexport enum SortOption {\n ASCENDING = \"asc\",\n DESCENDING = \"desc\",\n}\n\nexport type IndexAnalyzer = {\n name: string\n default?: string\n fields?: Record<string, string>\n}\n\nexport type DBView = {\n name?: string\n map: string\n reduce?: string\n meta?: ViewTemplateOpts\n groupBy?: string\n version?: number\n}\n\nexport type DatabaseOpts = {\n skip_setup?: boolean\n}\n\nexport interface DesignDocument extends Document {\n // we use this static reference for all design documents\n _id: \"_design/database\"\n language?: string\n // CouchDB views\n views?: {\n [viewName: string]: DBView\n }\n // Lucene indexes\n indexes?: {\n [indexName: string]: {\n index: string\n analyzer?: string | IndexAnalyzer\n }\n }\n}\n\nexport type DatabasePutOpts = {\n force?: boolean\n returnDoc?: boolean\n}\n\nexport type DatabaseCreateIndexOpts = {\n index: {\n fields: string[]\n name?: string | undefined\n ddoc?: string | undefined\n type?: string | undefined\n }\n}\n\nexport type DatabaseDeleteIndexOpts = {\n name: string\n ddoc: string\n type?: string | undefined\n}\n\ntype DBPrimitiveKey = string | number | {}\nexport type DatabaseKey = DBPrimitiveKey | DBPrimitiveKey[]\n\nexport type DatabaseQueryOpts = {\n include_docs?: boolean\n startkey?: DatabaseKey\n endkey?: DatabaseKey\n limit?: number\n skip?: number\n descending?: boolean\n key?: DatabaseKey\n keys?: DatabaseKey[]\n group?: boolean\n startkey_docid?: string\n}\n\nexport const isDocument = (doc: any): doc is Document => {\n return typeof doc === \"object\" && doc._id && doc._rev\n}\n\nexport interface DatabaseDumpOpts {\n filter?: (doc: AnyDocument) => boolean\n batch_size?: number\n batch_limit?: number\n style?: \"main_only\" | \"all_docs\"\n timeout?: number\n doc_ids?: string[]\n query_params?: any\n view?: string\n selector?: any\n}\n\nexport interface Database {\n name: string\n\n exists(): Promise<boolean>\n exists(docId: string): Promise<boolean>\n /**\n * @deprecated the plan is to get everything using `tryGet` instead, then rename\n * `tryGet` to `get`.\n */\n get<T extends Document>(id?: string): Promise<T>\n tryGet<T extends Document>(id?: string): Promise<T | undefined>\n getMultiple<T extends Document>(\n ids?: string[],\n opts?: { allowMissing?: boolean; excludeDocs?: boolean }\n ): Promise<T[]>\n remove(idOrDoc: Document): Promise<Nano.DocumentDestroyResponse>\n remove(idOrDoc: string, rev?: string): Promise<Nano.DocumentDestroyResponse>\n bulkRemove(\n documents: Document[],\n opts?: { silenceErrors?: boolean }\n ): Promise<void>\n put<T extends AnyDocument>(\n document: T,\n opts: DatabasePutOpts & { returnDoc: true }\n ): Promise<Nano.DocumentInsertResponse & { doc: T }>\n put<T extends AnyDocument>(\n document: T,\n opts?: DatabasePutOpts & { returnDoc?: false }\n ): Promise<Nano.DocumentInsertResponse>\n bulkDocs(documents: AnyDocument[]): Promise<Nano.DocumentBulkResponse[]>\n sql<T extends Document>(\n sql: string,\n parameters?: SqlQueryBinding\n ): Promise<T[]>\n sqlPurgeDocument(docIds: string[] | string): Promise<void>\n sqlDiskCleanup(): Promise<void>\n find<T extends Document>(\n params: Nano.MangoQuery\n ): Promise<Nano.MangoResponse<T>>\n allDocs<T extends Document | RowValue>(\n params: DatabaseQueryOpts\n ): Promise<AllDocsResponse<T>>\n query<T extends Document>(\n viewName: string,\n params: DatabaseQueryOpts\n ): Promise<AllDocsResponse<T>>\n destroy(): Promise<Nano.OkResponse>\n compact(): Promise<Nano.OkResponse>\n // these are all PouchDB related functions that are rarely used - in future\n // should be replaced by better typed/non-pouch implemented methods\n dump(stream: Writable, opts?: DatabaseDumpOpts): Promise<any>\n load(stream: ReadStream): Promise<any>\n createIndex(opts: DatabaseCreateIndexOpts): Promise<any>\n deleteIndex(opts: DatabaseDeleteIndexOpts): Promise<any>\n getIndexes(): Promise<any>\n}\n\nexport interface DBError extends Error {\n status: number\n statusCode: number\n reason: string\n name: string\n errid: string\n error: string\n description: string\n}\n", "export interface GetTenantIdOptions {\n allowNoTenant?: boolean\n excludeStrategies?: TenantResolutionStrategy[]\n includeStrategies?: TenantResolutionStrategy[]\n}\n\nexport enum TenantResolutionStrategy {\n USER = \"user\",\n HEADER = \"header\",\n QUERY = \"query\",\n SUBDOMAIN = \"subdomain\",\n PATH = \"path\",\n}\n", "export enum FeatureFlag {\n DEBUG_UI = \"DEBUG_UI\",\n USE_ZOD_VALIDATOR = \"USE_ZOD_VALIDATOR\",\n AI_AGENTS = \"AI_AGENTS\",\n WORKSPACES = \"WORKSPACES\",\n\n // Account-portal\n DIRECT_LOGIN_TO_ACCOUNT_PORTAL = \"DIRECT_LOGIN_TO_ACCOUNT_PORTAL\",\n}\n\nexport const FeatureFlagDefaults: Record<FeatureFlag, boolean> = {\n [FeatureFlag.USE_ZOD_VALIDATOR]: false,\n [FeatureFlag.AI_AGENTS]: false,\n [FeatureFlag.WORKSPACES]: true,\n\n // Account-portal\n [FeatureFlag.DIRECT_LOGIN_TO_ACCOUNT_PORTAL]: false,\n\n [FeatureFlag.DEBUG_UI]: false,\n}\n\nexport type FeatureFlags = typeof FeatureFlagDefaults\n", "export enum AppEnvironment {\n PRODUCTION = \"production\",\n DEVELOPMENT = \"development\",\n}\n", "import { Event } from \"../events\"\n\nexport enum CommandWord {\n BACKUPS = \"backups\",\n HOSTING = \"hosting\",\n ANALYTICS = \"analytics\",\n HELP = \"help\",\n PLUGIN = \"plugins\",\n}\n\nexport enum InitType {\n QUICK = \"quick\",\n DIGITAL_OCEAN = \"do\",\n}\n\nexport const AnalyticsEvent = {\n OptOut: \"analytics:opt:out\",\n OptIn: \"analytics:opt:in\",\n SelfHostInit: \"hosting:init\",\n PluginInit: Event.PLUGIN_INIT,\n}\n", "// used in resource permissions - permissions can be at one of these levels\n// endpoints will set what type of permission they require (e.g. searching requires READ)\nexport enum PermissionLevel {\n READ = \"read\",\n WRITE = \"write\",\n EXECUTE = \"execute\",\n ADMIN = \"admin\",\n}\n\n// used within the role, specifies base permissions\nexport enum BuiltinPermissionID {\n PUBLIC = \"public\",\n READ_ONLY = \"read_only\",\n WRITE = \"write\",\n ADMIN = \"admin\",\n POWER = \"power\",\n}\n\n// these are the global types, that govern the underlying default behaviour\nexport enum PermissionType {\n APP = \"app\",\n TABLE = \"table\",\n USER = \"user\",\n AUTOMATION = \"automation\",\n WEBHOOK = \"webhook\",\n BUILDER = \"builder\",\n CREATOR = \"creator\",\n GLOBAL_BUILDER = \"globalBuilder\",\n QUERY = \"query\",\n VIEW = \"view\",\n LEGACY_VIEW = \"legacy_view\",\n}\n\nexport enum PermissionSource {\n EXPLICIT = \"EXPLICIT\",\n INHERITED = \"INHERITED\",\n BASE = \"BASE\",\n}\n\nexport interface Permission {\n type: PermissionType\n level: PermissionLevel\n}\n\nexport interface BuiltinPermission {\n _id: BuiltinPermissionID\n name: string\n permissions: Permission[]\n}\n\nexport type BuiltinPermissions = {\n [key in keyof typeof BuiltinPermissionID]: {\n _id: (typeof BuiltinPermissionID)[key]\n name: string\n permissions: Permission[]\n }\n}\n", "import { SortOrder, SortType } from \"../api\"\nimport { SearchFilters } from \"./search\"\nimport { CalculationType, Row } from \"../documents\"\nimport { WithRequired } from \"../shared\"\n\nexport interface BaseAggregation {\n name: string\n}\n\nexport interface NumericAggregation extends BaseAggregation {\n calculationType:\n | CalculationType.AVG\n | CalculationType.MAX\n | CalculationType.MIN\n | CalculationType.SUM\n field: string\n}\n\nexport interface CountAggregation extends BaseAggregation {\n calculationType: CalculationType.COUNT\n field: string\n}\n\nexport interface CountDistinctAggregation extends CountAggregation {\n distinct: true\n}\n\nexport type Aggregation =\n | NumericAggregation\n | CountAggregation\n | CountDistinctAggregation\n\nexport interface SearchParams {\n tableId?: string\n viewId?: string\n query?: SearchFilters\n paginate?: boolean\n bookmark?: string | number\n limit?: number\n sort?: string\n sortOrder?: SortOrder\n sortType?: SortType\n version?: string\n disableEscaping?: boolean\n fields?: string[]\n indexer?: () => Promise<any>\n rows?: Row[]\n countRows?: boolean\n}\n\n// when searching for rows we want a more extensive search type that requires certain properties\nexport interface RowSearchParams\n extends WithRequired<SearchParams, \"tableId\" | \"query\"> {}\n\nexport interface SearchResponse<T> {\n rows: T[]\n hasNextPage?: boolean\n bookmark?: string | number\n totalRows?: number\n}\n\nexport enum RowExportFormat {\n CSV = \"csv\",\n JSON = \"json\",\n JSON_WITH_SCHEMA = \"jsonWithSchema\",\n}\n", "import { Feature, Hosting, License, PlanType, Quotas } from \"../../sdk\"\nimport { DeepPartial } from \"../../shared\"\nimport { QuotaUsage } from \"../global\"\n\nexport interface CreateAccount {\n email: string\n tenantId: string\n hosting: Hosting\n authType: AuthType\n accountName: string\n // optional fields - for sso based sign ups\n registrationStep?: string\n name?: string\n size?: string\n profession?: string\n}\n\nexport interface CreatePassswordAccount extends CreateAccount {\n password: string\n}\n\nexport const isCreatePasswordAccount = (\n account: CreateAccount\n): account is CreatePassswordAccount => account.authType === AuthType.PASSWORD\n\nexport interface LicenseOverrides {\n features?: Feature[]\n quotas?: DeepPartial<Quotas>\n}\n\nexport interface Account extends CreateAccount {\n // generated\n accountId: string\n createdAt: number\n // registration\n verified: boolean\n verificationSent: boolean\n // licensing\n planType?: PlanType\n license?: License\n installId?: string\n installTenantId?: string\n installVersion?: string\n stripeCustomerId?: string\n licenseKey?: string\n licenseKeyActivatedAt?: number\n licenseRequestedAt?: number\n licenseOverrides?: LicenseOverrides\n provider?: AccountSSOProvider\n providerType?: AccountSSOProviderType\n quotaUsage?: QuotaUsage\n offlineLicenseToken?: string\n tenantName?: string\n}\n\nexport interface PasswordAccount extends Account {\n password: string\n}\n\nexport const isPasswordAccount = (\n account: Account\n): account is PasswordAccount =>\n account.authType === AuthType.PASSWORD && account.hosting === Hosting.SELF\n\nexport interface CloudAccount extends Account {\n password?: string\n budibaseUserId: string\n}\n\nexport const isCloudAccount = (account: Account): account is CloudAccount =>\n account.hosting === Hosting.CLOUD\n\nexport const isSelfHostAccount = (account: Account) =>\n account.hosting === Hosting.SELF\n\nexport const isSSOAccount = (account: Account): account is SSOAccount =>\n account.authType === AuthType.SSO\n\nexport enum AccountSSOProviderType {\n GOOGLE = \"google\",\n MICROSOFT = \"microsoft\",\n}\n\nexport enum AccountSSOProvider {\n GOOGLE = \"google\",\n MICROSOFT = \"microsoft\",\n}\n\nconst verifiableSSOProviders: AccountSSOProvider[] = [\n AccountSSOProvider.MICROSOFT,\n]\nexport function isVerifiableSSOProvider(provider: AccountSSOProvider): boolean {\n return verifiableSSOProviders.includes(provider)\n}\n\nexport interface AccountSSO {\n ssoId?: string\n provider: AccountSSOProvider\n providerType: AccountSSOProviderType\n oauth2?: OAuthTokens\n}\n\nexport type SSOAccount = (Account | CloudAccount) & AccountSSO\n\nexport enum AuthType {\n SSO = \"sso\",\n PASSWORD = \"password\",\n}\n\nexport interface OAuthTokens {\n accessToken: string\n refreshToken: string\n}\n", "export const SEPARATOR = \"_\"\nexport const UNICODE_MAX = \"\\ufff0\"\n\nexport const prefixed = (type: DocumentType) => `${type}${SEPARATOR}`\n\nexport enum DocumentType {\n USER = \"us\",\n GROUP = \"gr\",\n WORKSPACE = \"workspace\",\n CONFIG = \"config\",\n TEMPLATE = \"template\",\n APP = \"app\",\n DEV = \"dev\",\n APP_DEV = \"app_dev\",\n APP_METADATA = \"app_metadata\",\n ROLE = \"role\",\n DEV_INFO = \"devinfo\",\n AUTOMATION_LOG = \"log_au\",\n ACCOUNT_METADATA = \"acc_metadata\",\n PLUGIN = \"plg\",\n DATASOURCE = \"datasource\",\n DATASOURCE_PLUS = \"datasource_plus\",\n APP_BACKUP = \"backup\",\n TABLE = \"ta\",\n ROW = \"ro\",\n AUTOMATION = \"au\",\n LINK = \"li\",\n WEBHOOK = \"wh\",\n INSTANCE = \"inst\",\n LAYOUT = \"layout\",\n SCREEN = \"screen\",\n QUERY = \"query\",\n DEPLOYMENTS = \"deployments\",\n METADATA = \"metadata\",\n MEM_VIEW = \"view\",\n USER_FLAG = \"flag\",\n AUTOMATION_METADATA = \"meta_au\",\n AUDIT_LOG = \"al\",\n SCIM_LOG = \"scimlog\",\n ROW_ACTIONS = \"ra\",\n OAUTH2_CONFIG = \"oauth2\",\n OAUTH2_CONFIG_LOG = \"oauth2log\",\n AGENT_CHAT = \"agentchat\",\n AGENT_TOOL_SOURCE = \"agenttoolsource\",\n WORKSPACE_APP = \"workspace_app\",\n WORKSPACE_FAVOURITE = \"workspace_favourite\",\n}\n\n// these are the core documents that make up the data, design\n// and automation sections of an app. This excludes any internal\n// rows as we shouldn't import data.\nexport const DocumentTypesToImport: DocumentType[] = [\n DocumentType.ROLE,\n DocumentType.DATASOURCE,\n DocumentType.DATASOURCE_PLUS,\n DocumentType.TABLE,\n DocumentType.AUTOMATION,\n DocumentType.WEBHOOK,\n DocumentType.SCREEN,\n DocumentType.QUERY,\n DocumentType.METADATA,\n DocumentType.MEM_VIEW,\n DocumentType.WORKSPACE_APP,\n DocumentType.WORKSPACE_FAVOURITE,\n // Deprecated but still copied\n DocumentType.INSTANCE,\n DocumentType.LAYOUT,\n]\n\nexport enum InternalTable {\n USER_METADATA = \"ta_users\",\n}\n\n// these documents don't really exist, they are part of other\n// documents or enriched into existence as part of get requests\nexport enum VirtualDocumentType {\n VIEW = \"view\",\n ROW_ACTION = \"row_action\",\n}\n\nexport interface Document {\n _id?: string\n _rev?: string\n // document has been tombstoned - needed for replication\n _deleted?: boolean\n createdAt?: string | number\n updatedAt?: string\n}\n\nexport interface AnyDocument extends Document {\n [key: string]: any\n}\n", "import { Document } from \"../../document\"\nimport { User } from \"../../global\"\nimport { Row } from \"../row\"\nimport { Table } from \"../table\"\nimport { AutomationStep, AutomationTrigger } from \"./schema\"\nimport { ContextEmitter } from \"../../../sdk\"\nimport { Readable } from \"stream\"\nimport { LoopSummary } from \"./StepInputsOutputs\"\n\nexport enum AutomationIOType {\n OBJECT = \"object\",\n STRING = \"string\",\n BOOLEAN = \"boolean\",\n NUMBER = \"number\",\n ARRAY = \"array\",\n JSON = \"json\",\n DATE = \"date\",\n DATETIME = \"datetime\",\n ATTACHMENT = \"attachment\",\n LONGFORM = \"longform\",\n}\n\nexport enum AutomationCustomIOType {\n TABLE = \"table\",\n ROW = \"row\",\n ROWS = \"rows\",\n WIDE = \"wide\",\n QUERY = \"query\",\n QUERY_PARAMS = \"queryParams\",\n QUERY_LIMIT = \"queryLimit\",\n LOOP_OPTION = \"loopOption\",\n ITEM = \"item\",\n CODE = \"code\",\n FILTERS = \"filters\",\n COLUMN = \"column\",\n TRIGGER_SCHEMA = \"triggerSchema\",\n CRON = \"cron\",\n WEBHOOK_URL = \"webhookUrl\",\n AUTOMATION = \"automation\",\n AUTOMATION_FIELDS = \"automationFields\",\n MULTI_ATTACHMENTS = \"multi_attachments\",\n TRIGGER_FILTER = \"trigger_filter\",\n CATEGORIES = \"categories\",\n}\n\nexport enum AutomationTriggerStepId {\n ROW_SAVED = \"ROW_SAVED\",\n ROW_UPDATED = \"ROW_UPDATED\",\n ROW_DELETED = \"ROW_DELETED\",\n WEBHOOK = \"WEBHOOK\",\n APP = \"APP\",\n CRON = \"CRON\",\n ROW_ACTION = \"ROW_ACTION\",\n}\n\nexport enum AutomationStepType {\n LOGIC = \"LOGIC\",\n ACTION = \"ACTION\",\n TRIGGER = \"TRIGGER\",\n}\n\nexport enum AutomationActionStepId {\n SEND_EMAIL_SMTP = \"SEND_EMAIL_SMTP\",\n CREATE_ROW = \"CREATE_ROW\",\n UPDATE_ROW = \"UPDATE_ROW\",\n DELETE_ROW = \"DELETE_ROW\",\n EXECUTE_BASH = \"EXECUTE_BASH\",\n OUTGOING_WEBHOOK = \"OUTGOING_WEBHOOK\",\n EXECUTE_SCRIPT = \"EXECUTE_SCRIPT\",\n EXECUTE_SCRIPT_V2 = \"EXECUTE_SCRIPT_V2\",\n EXECUTE_QUERY = \"EXECUTE_QUERY\",\n SERVER_LOG = \"SERVER_LOG\",\n DELAY = \"DELAY\",\n FILTER = \"FILTER\",\n API_REQUEST = \"API_REQUEST\",\n QUERY_ROWS = \"QUERY_ROWS\",\n LOOP = \"LOOP\",\n COLLECT = \"COLLECT\",\n OPENAI = \"OPENAI\",\n TRIGGER_AUTOMATION_RUN = \"TRIGGER_AUTOMATION_RUN\",\n BRANCH = \"BRANCH\",\n CLASSIFY_CONTENT = \"CLASSIFY_CONTENT\",\n PROMPT_LLM = \"PROMPT_LLM\",\n TRANSLATE = \"TRANSLATE\",\n SUMMARISE = \"SUMMARISE\",\n GENERATE_TEXT = \"GENERATE_TEXT\",\n EXTRACT_FILE_DATA = \"EXTRACT_FILE_DATA\",\n EXTRACT_STATE = \"EXTRACT_STATE\",\n LOOP_V2 = \"LOOP_V2\",\n // these used to be lowercase step IDs, maintain for backwards compat\n discord = \"discord\",\n slack = \"slack\",\n zapier = \"zapier\",\n integromat = \"integromat\",\n n8n = \"n8n\",\n}\n\nexport interface EmailInvite {\n startTime: Date\n endTime: Date\n summary: string\n location?: string\n url?: string\n}\n\nexport interface EmailAttachment {\n url: string\n filename: string\n}\n\nexport interface SendEmailOpts {\n to?: string\n // workspaceId If finer grain controls being used then this will lookup config for workspace.\n workspaceId?: string\n // user If sending to an existing user the object can be provided, this is used in the context.\n user?: User\n // from If sending from an address that is not what is configured in the SMTP config.\n from?: string\n // contents If sending a custom email then can supply contents which will be added to it.\n contents?: string\n // subject A custom subject can be specified if the config one is not desired.\n subject: string\n // info Pass in a structure of information to be stored alongside the invitation.\n info?: any\n cc?: string\n bcc?: string\n automation?: boolean\n invite?: EmailInvite\n attachments?: EmailAttachment[]\n}\n\nexport const AutomationStepIdArray = [\n ...Object.values(AutomationActionStepId),\n ...Object.values(AutomationTriggerStepId),\n]\n\nexport interface Automation extends Document {\n definition: {\n steps: AutomationStep[]\n trigger: AutomationTrigger\n // stepNames is used to lookup step names from their correspnding step ID.\n stepNames?: Record<string, string>\n }\n screenId?: string\n uiTree?: any\n appId: string\n live?: boolean\n name: string\n internal?: boolean\n type?: string\n disabled?: boolean\n testData?: AutomationTriggerResultOutputs\n}\n\nexport interface BaseIOStructure {\n type?: AutomationIOType\n subtype?: AutomationIOType\n customType?: AutomationCustomIOType\n title?: string\n description?: string\n dependsOn?: string | { field: string; value: string | string[] }\n enum?: string[]\n pretty?: string[]\n properties?: AutomationIOProps\n required?: string[]\n readonly?: true\n}\n\nexport interface InputOutputBlock {\n properties: AutomationIOProps\n required?: string[]\n}\n\nexport interface AutomationIOProps {\n [key: string]: BaseIOStructure\n}\n\nexport enum AutomationFeature {\n LOOPING = \"LOOPING\",\n}\n\nexport enum AutomationStepStatus {\n NO_ITERATIONS = \"no_iterations\",\n MAX_ITERATIONS = \"max_iterations_reached\",\n FAILURE_CONDITION = \"FAILURE_CONDITION_MET\",\n INCORRECT_TYPE = \"INCORRECT_TYPE\",\n}\n\nexport enum AutomationStatus {\n SUCCESS = \"success\",\n ERROR = \"error\",\n STOPPED = \"stopped\",\n STOPPED_ERROR = \"stopped_error\",\n NO_CONDITION_MET = \"No branch condition met\",\n TIMED_OUT = \"timed_out\",\n}\n\nexport enum AutomationStoppedReason {\n TRIGGER_FILTER_NOT_MET = \"Automation did not run. Filter conditions in trigger were not met.\",\n TIMED_OUT = \"Automation timed out.\",\n}\n\nexport interface AutomationStepResultOutputs {\n success: boolean\n [key: string]: any\n}\n\nexport interface AutomationStepResultInputs {\n [key: string]: any\n}\n\nexport interface AutomationStepResult {\n id: string\n name?: string\n icon?: string\n stepId: AutomationActionStepId\n inputs: AutomationStepResultInputs\n outputs: AutomationStepResultOutputs\n}\n\nexport type AutomationTriggerResultInputs = Record<string, any>\nexport type AutomationTriggerResultOutputs = Record<string, any>\n\nexport interface AutomationTriggerResult {\n id: string\n name?: string\n icon?: string\n stepId: AutomationTriggerStepId\n inputs?: AutomationTriggerResultInputs | null\n outputs: AutomationTriggerResultOutputs\n}\n\nexport interface AutomationResults {\n automationId?: string\n status: AutomationStatus\n trigger: AutomationTriggerResult\n steps: [AutomationTriggerResult, ...AutomationStepResult[]]\n state?: Record<string, any>\n}\n\nexport interface DidNotTriggerResponse {\n outputs: {\n success: false\n status: AutomationStatus.STOPPED\n }\n message: AutomationStoppedReason.TRIGGER_FILTER_NOT_MET\n}\n\nexport interface AutomationLog extends AutomationResults, Document {\n automationName: string\n _rev?: string\n}\n\nexport interface AutomationLogPage {\n data: AutomationLog[]\n hasNextPage: boolean\n nextPage?: string\n}\n\nexport interface AutomationStepInputBase {\n context: Record<string, any>\n emitter: ContextEmitter\n appId: string\n apiKey?: string\n}\n\nexport type ActionImplementation<TInputs, TOutputs> = (\n params: {\n inputs: TInputs\n } & AutomationStepInputBase\n) => Promise<TOutputs>\n\nexport interface AutomationMetadata extends Document {\n errorCount?: number\n automationChainCount?: number\n}\n\nexport type AutomationAttachment = {\n url: string\n filename: string\n}\n\nexport type AutomationAttachmentContent = {\n filename: string\n content: Readable\n}\n\nexport type BucketedContent = AutomationAttachmentContent & {\n bucket: string\n path: string\n}\n\nexport enum AutomationEventType {\n ROW_SAVE = \"row:save\",\n ROW_UPDATE = \"row:update\",\n ROW_DELETE = \"row:delete\",\n APP_TRIGGER = \"app:trigger\",\n CRON_TRIGGER = \"cron:trigger\",\n WEBHOOK_TRIGGER = \"web:trigger\",\n ROW_ACTION = \"row:action\",\n}\n\nexport type UpdatedRowEventEmitter = {\n row: Row\n oldRow: Row\n table: Table\n appId: string\n user: User\n}\n\nexport enum LoopStepType {\n ARRAY = \"Array\",\n STRING = \"String\",\n}\n\nexport enum ContentType {\n EMAIL = \"email\",\n DOCUMENT = \"document\",\n BLOG_POST = \"blog_post\",\n CHAT_MESSAGE = \"chat_message\",\n LETTER = \"letter\",\n PROPOSAL = \"proposal\",\n OTHER = \"other\",\n}\n\nexport const PrettyContentTypes = {\n [ContentType.EMAIL]: \"Email\",\n [ContentType.DOCUMENT]: \"Document\",\n [ContentType.BLOG_POST]: \"Blog post\",\n [ContentType.CHAT_MESSAGE]: \"Chat message\",\n [ContentType.LETTER]: \"Letter\",\n [ContentType.PROPOSAL]: \"Proposal\",\n [ContentType.OTHER]: \"Other\",\n}\n\nexport enum DocumentSourceType {\n URL = \"URL\",\n ATTACHMENT = \"Attachment\",\n}\n\nexport enum SupportedFileType {\n PDF = \"pdf\",\n JPG = \"jpg\",\n PNG = \"png\",\n JPEG = \"jpeg\",\n}\n\nexport const ImageContentTypes = [\n \"png\",\n \"jpg\",\n \"jpeg\",\n \"image/png\",\n \"image/jpeg\",\n \"image/jpg\",\n \"image/jpeg\",\n]\n\nexport interface LoopStorage {\n results: Record<string, AutomationStepResult[]>\n summary: LoopSummary\n nestedSummaries: Record<string, LoopSummary[]>\n maxStoredResults: number\n}\n", "import { Hosting } from \"../../../sdk\"\nimport {\n AutomationActionStepId,\n ActionImplementation,\n AutomationStepType,\n AutomationFeature,\n InputOutputBlock,\n AutomationTriggerStepId,\n AutomationEventType,\n AutomationIOType,\n} from \"./automation\"\nimport {\n CollectStepInputs,\n CollectStepOutputs,\n CreateRowStepInputs,\n CreateRowStepOutputs,\n DelayStepInputs,\n DelayStepOutputs,\n DeleteRowStepInputs,\n DeleteRowStepOutputs,\n ExecuteQueryStepInputs,\n ExecuteQueryStepOutputs,\n ExecuteScriptStepInputs,\n ExecuteScriptStepOutputs,\n FilterStepInputs,\n FilterStepOutputs,\n QueryRowsStepInputs,\n QueryRowsStepOutputs,\n SmtpEmailStepInputs,\n ServerLogStepInputs,\n ServerLogStepOutputs,\n TriggerAutomationStepInputs,\n TriggerAutomationStepOutputs,\n UpdateRowStepInputs,\n UpdateRowStepOutputs,\n OutgoingWebhookStepInputs,\n ExternalAppStepOutputs,\n DiscordStepInputs,\n SlackStepInputs,\n ZapierStepInputs,\n ZapierStepOutputs,\n MakeIntegrationInputs,\n n8nStepInputs,\n BashStepInputs,\n BashStepOutputs,\n OpenAIStepInputs,\n OpenAIStepOutputs,\n LoopStepInputs,\n CronTriggerInputs,\n RowUpdatedTriggerInputs,\n RowCreatedTriggerInputs,\n RowDeletedTriggerInputs,\n BranchStepInputs,\n BaseAutomationOutputs,\n AppActionTriggerOutputs,\n CronTriggerOutputs,\n RowDeletedTriggerOutputs,\n RowCreatedTriggerOutputs,\n RowUpdatedTriggerOutputs,\n WebhookTriggerOutputs,\n RowActionTriggerInputs,\n ClassifyContentStepOutputs,\n ClassifyContentStepInputs,\n PromptLLMStepOutputs,\n PromptLLMStepInputs,\n TranslateStepOutputs,\n TranslateStepInputs,\n SummariseStepInputs,\n SummariseStepOutputs,\n GenerateTextStepInputs,\n GenerateTextStepOutputs,\n ExtractFileDataStepOutputs,\n ExtractFileDataStepInputs,\n APIRequestStepInputs,\n APIRequestStepOutputs,\n BranchSearchFilters,\n ExtractStateStepInputs,\n ExtractStateStepOutputs,\n LoopV2StepInputs,\n LoopV2StepOutputs,\n} from \"./StepInputsOutputs\"\n\nexport type ActionImplementations<T extends Hosting> = {\n [AutomationActionStepId.COLLECT]: ActionImplementation<\n CollectStepInputs,\n CollectStepOutputs\n >\n [AutomationActionStepId.CREATE_ROW]: ActionImplementation<\n CreateRowStepInputs,\n CreateRowStepOutputs\n >\n [AutomationActionStepId.DELAY]: ActionImplementation<\n DelayStepInputs,\n DelayStepOutputs\n >\n [AutomationActionStepId.DELETE_ROW]: ActionImplementation<\n DeleteRowStepInputs,\n DeleteRowStepOutputs\n >\n [AutomationActionStepId.EXECUTE_QUERY]: ActionImplementation<\n ExecuteQueryStepInputs,\n ExecuteQueryStepOutputs\n >\n [AutomationActionStepId.API_REQUEST]: ActionImplementation<\n APIRequestStepInputs,\n APIRequestStepOutputs\n >\n [AutomationActionStepId.EXECUTE_SCRIPT]: ActionImplementation<\n ExecuteScriptStepInputs,\n ExecuteScriptStepOutputs\n >\n [AutomationActionStepId.EXECUTE_SCRIPT_V2]: ActionImplementation<\n ExecuteScriptStepInputs,\n ExecuteScriptStepOutputs\n >\n [AutomationActionStepId.FILTER]: ActionImplementation<\n FilterStepInputs,\n FilterStepOutputs\n >\n [AutomationActionStepId.QUERY_ROWS]: ActionImplementation<\n QueryRowsStepInputs,\n QueryRowsStepOutputs\n >\n [AutomationActionStepId.SEND_EMAIL_SMTP]: ActionImplementation<\n SmtpEmailStepInputs,\n BaseAutomationOutputs\n >\n [AutomationActionStepId.SERVER_LOG]: ActionImplementation<\n ServerLogStepInputs,\n ServerLogStepOutputs\n >\n [AutomationActionStepId.TRIGGER_AUTOMATION_RUN]: ActionImplementation<\n TriggerAutomationStepInputs,\n TriggerAutomationStepOutputs\n >\n [AutomationActionStepId.UPDATE_ROW]: ActionImplementation<\n UpdateRowStepInputs,\n UpdateRowStepOutputs\n >\n [AutomationActionStepId.OUTGOING_WEBHOOK]: ActionImplementation<\n OutgoingWebhookStepInputs,\n ExternalAppStepOutputs\n >\n [AutomationActionStepId.discord]: ActionImplementation<\n DiscordStepInputs,\n ExternalAppStepOutputs\n >\n [AutomationActionStepId.slack]: ActionImplementation<\n SlackStepInputs,\n ExternalAppStepOutputs\n >\n [AutomationActionStepId.zapier]: ActionImplementation<\n ZapierStepInputs,\n ZapierStepOutputs\n >\n [AutomationActionStepId.integromat]: ActionImplementation<\n MakeIntegrationInputs,\n ExternalAppStepOutputs\n >\n [AutomationActionStepId.n8n]: ActionImplementation<\n n8nStepInputs,\n ExternalAppStepOutputs\n >\n [AutomationActionStepId.OPENAI]: ActionImplementation<\n OpenAIStepInputs,\n OpenAIStepOutputs\n >\n [AutomationActionStepId.CLASSIFY_CONTENT]: ActionImplementation<\n ClassifyContentStepInputs,\n ClassifyContentStepOutputs\n >\n [AutomationActionStepId.PROMPT_LLM]: ActionImplementation<\n PromptLLMStepInputs,\n PromptLLMStepOutputs\n >\n [AutomationActionStepId.TRANSLATE]: ActionImplementation<\n TranslateStepInputs,\n TranslateStepOutputs\n >\n [AutomationActionStepId.SUMMARISE]: ActionImplementation<\n SummariseStepInputs,\n SummariseStepOutputs\n >\n [AutomationActionStepId.GENERATE_TEXT]: ActionImplementation<\n GenerateTextStepInputs,\n GenerateTextStepOutputs\n >\n [AutomationActionStepId.EXTRACT_FILE_DATA]: ActionImplementation<\n ExtractFileDataStepInputs,\n ExtractFileDataStepOutputs\n >\n [AutomationActionStepId.EXTRACT_STATE]: ActionImplementation<\n ExtractStateStepInputs,\n ExtractStateStepOutputs\n >\n} & (T extends \"self\"\n ? {\n [AutomationActionStepId.EXECUTE_BASH]: ActionImplementation<\n BashStepInputs,\n BashStepOutputs\n >\n }\n : {})\n\nexport interface AutomationStepSchemaBase {\n name: string\n stepTitle?: string\n event?: AutomationEventType\n tagline: string\n icon: string\n description: string\n type: AutomationStepType\n internal?: boolean\n deprecated?: boolean\n new?: boolean\n blockToLoop?: string\n isLegacyLoop?: boolean\n schema: {\n inputs: InputOutputBlock\n outputs: InputOutputBlock\n }\n custom?: boolean\n features?: Partial<Record<AutomationFeature, boolean>>\n}\n\nexport type AutomationStepInputs<T extends AutomationActionStepId> =\n T extends AutomationActionStepId.COLLECT\n ? CollectStepInputs\n : T extends AutomationActionStepId.CREATE_ROW\n ? CreateRowStepInputs\n : T extends AutomationActionStepId.DELAY\n ? DelayStepInputs\n : T extends AutomationActionStepId.DELETE_ROW\n ? DeleteRowStepInputs\n : T extends AutomationActionStepId.EXECUTE_QUERY\n ? ExecuteQueryStepInputs\n : T extends AutomationActionStepId.API_REQUEST\n ? APIRequestStepInputs\n : T extends AutomationActionStepId.EXECUTE_SCRIPT\n ? ExecuteScriptStepInputs\n : T extends AutomationActionStepId.EXECUTE_SCRIPT_V2\n ? ExecuteScriptStepInputs\n : T extends AutomationActionStepId.FILTER\n ? FilterStepInputs\n : T extends AutomationActionStepId.QUERY_ROWS\n ? QueryRowsStepInputs\n : T extends AutomationActionStepId.SEND_EMAIL_SMTP\n ? SmtpEmailStepInputs\n : T extends AutomationActionStepId.SERVER_LOG\n ? ServerLogStepInputs\n : T extends AutomationActionStepId.TRIGGER_AUTOMATION_RUN\n ? TriggerAutomationStepInputs\n : T extends AutomationActionStepId.UPDATE_ROW\n ? UpdateRowStepInputs\n : T extends AutomationActionStepId.OUTGOING_WEBHOOK\n ? OutgoingWebhookStepInputs\n : T extends AutomationActionStepId.discord\n ? DiscordStepInputs\n : T extends AutomationActionStepId.slack\n ? SlackStepInputs\n : T extends AutomationActionStepId.zapier\n ? ZapierStepInputs\n : T extends AutomationActionStepId.integromat\n ? MakeIntegrationInputs\n : T extends AutomationActionStepId.n8n\n ? n8nStepInputs\n : T extends AutomationActionStepId.EXECUTE_BASH\n ? BashStepInputs\n : T extends AutomationActionStepId.OPENAI\n ? OpenAIStepInputs\n : T extends AutomationActionStepId.LOOP\n ? LoopStepInputs\n : T extends AutomationActionStepId.BRANCH\n ? BranchStepInputs\n : T extends AutomationActionStepId.CLASSIFY_CONTENT\n ? ClassifyContentStepInputs\n : T extends AutomationActionStepId.PROMPT_LLM\n ? PromptLLMStepInputs\n : T extends AutomationActionStepId.TRANSLATE\n ? TranslateStepInputs\n : T extends AutomationActionStepId.SUMMARISE\n ? SummariseStepInputs\n : T extends AutomationActionStepId.GENERATE_TEXT\n ? GenerateTextStepInputs\n : T extends AutomationActionStepId.EXTRACT_FILE_DATA\n ? ExtractFileDataStepInputs\n : T extends AutomationActionStepId.EXTRACT_STATE\n ? ExtractStateStepInputs\n : T extends AutomationActionStepId.LOOP_V2\n ? LoopV2StepInputs\n : never\n\nexport type AutomationStepOutputs<T extends AutomationActionStepId> =\n T extends AutomationActionStepId.COLLECT\n ? CollectStepOutputs\n : T extends AutomationActionStepId.CREATE_ROW\n ? CreateRowStepOutputs\n : T extends AutomationActionStepId.DELAY\n ? DelayStepOutputs\n : T extends AutomationActionStepId.DELETE_ROW\n ? DeleteRowStepOutputs\n : T extends AutomationActionStepId.EXECUTE_QUERY\n ? ExecuteQueryStepOutputs\n : T extends AutomationActionStepId.API_REQUEST\n ? APIRequestStepOutputs\n : T extends AutomationActionStepId.EXECUTE_SCRIPT\n ? ExecuteScriptStepOutputs\n : T extends AutomationActionStepId.EXECUTE_SCRIPT_V2\n ? ExecuteScriptStepOutputs\n : T extends AutomationActionStepId.FILTER\n ? FilterStepOutputs\n : T extends AutomationActionStepId.QUERY_ROWS\n ? QueryRowsStepOutputs\n : T extends AutomationActionStepId.SEND_EMAIL_SMTP\n ? BaseAutomationOutputs\n : T extends AutomationActionStepId.SERVER_LOG\n ? ServerLogStepOutputs\n : T extends AutomationActionStepId.TRIGGER_AUTOMATION_RUN\n ? TriggerAutomationStepOutputs\n : T extends AutomationActionStepId.UPDATE_ROW\n ? UpdateRowStepOutputs\n : T extends AutomationActionStepId.OUTGOING_WEBHOOK\n ? ExternalAppStepOutputs\n : T extends AutomationActionStepId.discord\n ? ExternalAppStepOutputs\n : T extends AutomationActionStepId.slack\n ? ExternalAppStepOutputs\n : T extends AutomationActionStepId.zapier\n ? ZapierStepOutputs\n : T extends AutomationActionStepId.integromat\n ? ExternalAppStepOutputs\n : T extends AutomationActionStepId.EXECUTE_BASH\n ? BashStepOutputs\n : T extends AutomationActionStepId.OPENAI\n ? OpenAIStepOutputs\n : T extends AutomationActionStepId.LOOP\n ? BaseAutomationOutputs\n : T extends AutomationActionStepId.CLASSIFY_CONTENT\n ? ClassifyContentStepOutputs\n : T extends AutomationActionStepId.PROMPT_LLM\n ? PromptLLMStepOutputs\n : T extends AutomationActionStepId.TRANSLATE\n ? TranslateStepOutputs\n : T extends AutomationActionStepId.SUMMARISE\n ? SummariseStepOutputs\n : T extends AutomationActionStepId.GENERATE_TEXT\n ? GenerateTextStepOutputs\n : T extends AutomationActionStepId.EXTRACT_FILE_DATA\n ? ExtractFileDataStepOutputs\n : T extends AutomationActionStepId.EXTRACT_STATE\n ? ExtractStateStepOutputs\n : T extends AutomationActionStepId.LOOP_V2\n ? LoopV2StepOutputs\n : never\n\nexport interface AutomationStepSchema<TStep extends AutomationActionStepId>\n extends AutomationStepSchemaBase {\n id: string\n stepId: TStep\n inputs: AutomationStepInputs<TStep>\n}\n\nexport type CollectStep = AutomationStepSchema<AutomationActionStepId.COLLECT>\n\nexport type CreateRowStep =\n AutomationStepSchema<AutomationActionStepId.CREATE_ROW>\n\nexport type DelayStep = AutomationStepSchema<AutomationActionStepId.DELAY>\n\nexport type DeleteRowStep =\n AutomationStepSchema<AutomationActionStepId.DELETE_ROW>\n\nexport type ExecuteQueryStep =\n AutomationStepSchema<AutomationActionStepId.EXECUTE_QUERY>\n\nexport type APIRequestStep =\n AutomationStepSchema<AutomationActionStepId.API_REQUEST>\n\nexport type ExecuteScriptStep =\n AutomationStepSchema<AutomationActionStepId.EXECUTE_SCRIPT>\n\nexport type ExecuteScriptV2Step =\n AutomationStepSchema<AutomationActionStepId.EXECUTE_SCRIPT_V2>\n\nexport type FilterStep = AutomationStepSchema<AutomationActionStepId.FILTER>\n\nexport type QueryRowsStep =\n AutomationStepSchema<AutomationActionStepId.QUERY_ROWS>\n\nexport type SendEmailSmtpStep =\n AutomationStepSchema<AutomationActionStepId.SEND_EMAIL_SMTP>\n\nexport type ServerLogStep =\n AutomationStepSchema<AutomationActionStepId.SERVER_LOG>\n\nexport type TriggerAutomationRunStep =\n AutomationStepSchema<AutomationActionStepId.TRIGGER_AUTOMATION_RUN>\n\nexport type UpdateRowStep =\n AutomationStepSchema<AutomationActionStepId.UPDATE_ROW>\n\nexport type OutgoingWebhookStep =\n AutomationStepSchema<AutomationActionStepId.OUTGOING_WEBHOOK>\n\nexport type DiscordStep = AutomationStepSchema<AutomationActionStepId.discord>\n\nexport type SlackStep = AutomationStepSchema<AutomationActionStepId.slack>\n\nexport type ZapierStep = AutomationStepSchema<AutomationActionStepId.zapier>\n\nexport type IntegromatStep =\n AutomationStepSchema<AutomationActionStepId.integromat>\n\nexport type N8nStep = AutomationStepSchema<AutomationActionStepId.n8n>\n\nexport type ExecuteBashStep =\n AutomationStepSchema<AutomationActionStepId.EXECUTE_BASH>\n\nexport type OpenAIStep = AutomationStepSchema<AutomationActionStepId.OPENAI>\n\nexport type LoopStep = AutomationStepSchema<AutomationActionStepId.LOOP>\n\nexport type ClassifyContentStep =\n AutomationStepSchema<AutomationActionStepId.CLASSIFY_CONTENT>\n\nexport type PromptLLMStep =\n AutomationStepSchema<AutomationActionStepId.PROMPT_LLM>\n\nexport type TranslateStep =\n AutomationStepSchema<AutomationActionStepId.TRANSLATE>\n\nexport type SummariseStep =\n AutomationStepSchema<AutomationActionStepId.SUMMARISE>\n\nexport type GenerateTextStep =\n AutomationStepSchema<AutomationActionStepId.GENERATE_TEXT>\n\nexport type ExtractFileDataStep =\n AutomationStepSchema<AutomationActionStepId.EXTRACT_FILE_DATA>\n\nexport type ExtractStateStep =\n AutomationStepSchema<AutomationActionStepId.EXTRACT_STATE>\n\nexport type LoopV2Step = AutomationStepSchema<AutomationActionStepId.LOOP_V2>\n\nexport type BranchStep = AutomationStepSchema<AutomationActionStepId.BRANCH> & {\n conditionUI?: {\n groups: BranchSearchFilters[]\n }\n}\nexport type AutomationStep =\n | CollectStep\n | CreateRowStep\n | DelayStep\n | DeleteRowStep\n | ExecuteQueryStep\n | APIRequestStep\n | ExecuteScriptStep\n | ExecuteScriptV2Step\n | FilterStep\n | QueryRowsStep\n | SendEmailSmtpStep\n | ServerLogStep\n | TriggerAutomationRunStep\n | UpdateRowStep\n | OutgoingWebhookStep\n | DiscordStep\n | SlackStep\n | ZapierStep\n | IntegromatStep\n | N8nStep\n | LoopStep\n | ExecuteBashStep\n | OpenAIStep\n | BranchStep\n | ClassifyContentStep\n | PromptLLMStep\n | TranslateStep\n | SummariseStep\n | GenerateTextStep\n | ExtractFileDataStep\n | ExtractStateStep\n | LoopV2Step\n\nexport function isBranchStep(\n step: AutomationStep | AutomationTrigger\n): step is BranchStep {\n return step.stepId === AutomationActionStepId.BRANCH\n}\n\nexport function isTrigger(\n step: AutomationStep | AutomationTrigger\n): step is AutomationTrigger {\n return step.type === AutomationStepType.TRIGGER\n}\n\nexport function isRowUpdateTrigger(\n step: AutomationStep | AutomationTrigger\n): step is RowUpdatedTrigger {\n return step.stepId === AutomationTriggerStepId.ROW_UPDATED\n}\n\nexport function isRowSaveTrigger(\n step: AutomationStep | AutomationTrigger\n): step is RowSavedTrigger {\n return step.stepId === AutomationTriggerStepId.ROW_SAVED\n}\n\nexport function isAppTrigger(\n step: AutomationStep | AutomationTrigger\n): step is AppActionTrigger {\n return step.stepId === AutomationTriggerStepId.APP\n}\n\nexport function isWebhookTrigger(\n step: AutomationStep | AutomationTrigger\n): step is AppActionTrigger {\n return step.stepId === AutomationTriggerStepId.WEBHOOK\n}\n\nexport function isRowActionTrigger(\n step: AutomationStep | AutomationTrigger\n): step is AppActionTrigger {\n return step.stepId === AutomationTriggerStepId.ROW_ACTION\n}\n\nexport function isFilterStep(\n step: AutomationStep | AutomationTrigger\n): step is FilterStep {\n return step.stepId === AutomationActionStepId.FILTER\n}\n\nexport function isLoopStep(\n step: AutomationStep | AutomationTrigger\n): step is LoopStep {\n return step.stepId === AutomationActionStepId.LOOP\n}\n\nexport function isActionStep(\n step: AutomationStep | AutomationTrigger\n): step is AutomationStep {\n return step.type === AutomationStepType.ACTION\n}\n\nexport function isCronTrigger(\n trigger: AutomationStep | AutomationTrigger\n): trigger is CronTrigger {\n return trigger.stepId === AutomationTriggerStepId.CRON\n}\n\ntype EmptyInputs = {}\nexport type AutomationStepDefinition = Omit<AutomationStep, \"id\" | \"inputs\"> & {\n inputs: EmptyInputs\n deprecated?: boolean\n}\n\nexport type AutomationTriggerDefinition = Omit<\n AutomationTrigger,\n \"id\" | \"inputs\"\n> & {\n inputs: EmptyInputs\n deprecated?: boolean\n}\n\nexport type AutomationTriggerInputs<T extends AutomationTriggerStepId> =\n T extends AutomationTriggerStepId.APP\n ?\n | void\n | (Record<string, any> & { fields?: Record<string, AutomationIOType> })\n : T extends AutomationTriggerStepId.CRON\n ? CronTriggerInputs\n : T extends AutomationTriggerStepId.ROW_ACTION\n ? RowActionTriggerInputs\n : T extends AutomationTriggerStepId.ROW_DELETED\n ? RowDeletedTriggerInputs\n : T extends AutomationTriggerStepId.ROW_SAVED\n ? RowCreatedTriggerInputs\n : T extends AutomationTriggerStepId.ROW_UPDATED\n ? RowUpdatedTriggerInputs\n : T extends AutomationTriggerStepId.WEBHOOK\n ? Record<string, any>\n : never\n\nexport type AutomationTriggerOutputs<T extends AutomationTriggerStepId> =\n T extends AutomationTriggerStepId.APP\n ? AppActionTriggerOutputs\n : T extends AutomationTriggerStepId.CRON\n ? CronTriggerOutputs\n : T extends AutomationTriggerStepId.ROW_ACTION\n ? Record<string, any>\n : T extends AutomationTriggerStepId.ROW_DELETED\n ? RowDeletedTriggerOutputs\n : T extends AutomationTriggerStepId.ROW_SAVED\n ? RowCreatedTriggerOutputs\n : T extends AutomationTriggerStepId.ROW_UPDATED\n ? RowUpdatedTriggerOutputs\n : T extends AutomationTriggerStepId.WEBHOOK\n ? WebhookTriggerOutputs\n : never\n\nexport interface AutomationTriggerSchema<\n TTrigger extends AutomationTriggerStepId,\n> extends AutomationStepSchemaBase {\n id: string\n type: AutomationStepType.TRIGGER\n event?: AutomationEventType\n cronJobId?: string\n stepId: TTrigger\n inputs: AutomationTriggerInputs<TTrigger>\n}\n\nexport type AutomationTrigger =\n | AppActionTrigger\n | CronTrigger\n | RowActionTrigger\n | RowDeletedTrigger\n | RowSavedTrigger\n | RowUpdatedTrigger\n | WebhookTrigger\n\nexport type AppActionTrigger =\n AutomationTriggerSchema<AutomationTriggerStepId.APP>\n\nexport type CronTrigger = AutomationTriggerSchema<AutomationTriggerStepId.CRON>\n\nexport type RowActionTrigger =\n AutomationTriggerSchema<AutomationTriggerStepId.ROW_ACTION>\n\nexport type RowDeletedTrigger =\n AutomationTriggerSchema<AutomationTriggerStepId.ROW_DELETED>\n\nexport type RowSavedTrigger =\n AutomationTriggerSchema<AutomationTriggerStepId.ROW_SAVED>\n\nexport type RowUpdatedTrigger =\n AutomationTriggerSchema<AutomationTriggerStepId.ROW_UPDATED>\n\nexport type WebhookTrigger =\n AutomationTriggerSchema<AutomationTriggerStepId.WEBHOOK>\n", "import { Table } from \"@budibase/types\"\nimport { SortOrder } from \"../../../api\"\nimport {\n SearchFilters,\n EmptyFilterOption,\n BasicOperator,\n LogicalOperator,\n} from \"../../../sdk\"\nimport { HttpMethod } from \"../query\"\nimport { Row, RowAttachment } from \"../row\"\nimport {\n LoopStepType,\n EmailAttachment,\n AutomationResults,\n AutomationStepResult,\n} from \"./automation\"\nimport { AutomationStep } from \"./schema\"\n\nexport enum FilterCondition {\n EQUAL = \"EQUAL\",\n NOT_EQUAL = \"NOT_EQUAL\",\n GREATER_THAN = \"GREATER_THAN\",\n LESS_THAN = \"LESS_THAN\",\n}\n\nexport type BaseAutomationOutputs = {\n success?: boolean\n response?: {\n [key: string]: any\n message?: string\n }\n}\nexport type ExternalAppStepOutputs = {\n httpStatus?: number\n response: string\n success: boolean\n}\n\nexport type BashStepInputs = {\n code: string\n}\n\nexport type BashStepOutputs = BaseAutomationOutputs & {\n stdout?: string\n}\n\nexport type CollectStepInputs = {\n collection: string\n}\n\nexport type CollectStepOutputs = BaseAutomationOutputs & {\n value?: any\n}\n\nexport type CreateRowStepInputs = {\n row: Row\n}\n\nexport type CreateRowStepOutputs = BaseAutomationOutputs & {\n row?: Row\n id?: string\n revision?: string\n}\n\nexport type DelayStepInputs = {\n time: number\n}\n\nexport type DelayStepOutputs = BaseAutomationOutputs\n\nexport type DeleteRowStepInputs = {\n tableId: string\n id: string\n revision?: string\n}\n\nexport type DeleteRowStepOutputs = BaseAutomationOutputs & {\n row?: Row\n}\n\nexport type DiscordStepInputs = {\n url: string\n username?: string\n avatar_url?: string\n content: string\n}\n\nexport type ExecuteQueryStepInputs = {\n query: {\n queryId: string\n [key: string]: any\n }\n}\n\nexport type ExecuteQueryStepOutputs = BaseAutomationOutputs & {\n info?: any\n}\n\nexport type APIRequestStepInputs = {\n query: {\n queryId: string\n [key: string]: any\n }\n}\n\nexport type APIRequestStepOutputs = BaseAutomationOutputs & {\n info?: any\n}\n\nexport type ExecuteScriptStepInputs = {\n code: string\n}\n\nexport type ExecuteScriptStepOutputs = BaseAutomationOutputs & {\n value?: string\n}\n\nexport type ExtractStateStepInputs = {\n key: string\n value: string\n}\n\nexport type ExtractStateStepOutputs = BaseAutomationOutputs & {\n value?: string\n}\n\nexport type FilterStepInputs = {\n field: any\n condition: FilterCondition\n value: any\n}\n\nexport type FilterStepOutputs = BaseAutomationOutputs & {\n result: boolean\n refValue?: any\n comparisonValue?: any\n}\n\nexport type LoopStepInputs = {\n option: LoopStepType\n binding: any\n iterations?: number\n failure?: string\n}\n\nexport type LoopStepOutputs = {\n items: AutomationStepResult[]\n success: boolean\n iterations: number\n status?: string\n}\n\nexport type BranchStepInputs = {\n branches: Branch[]\n children?: Record<string, AutomationStep[]>\n}\n\nexport type Branch = {\n id: any\n name: string\n condition: BranchSearchFilters\n conditionUI?: {\n groups?: {\n filters?: {\n field: string\n operator: BasicOperator\n value: any\n }[]\n }[]\n }\n}\n\nexport type BranchSearchFilters = Pick<\n SearchFilters,\n | BasicOperator.EQUAL\n | BasicOperator.NOT_EQUAL\n | LogicalOperator.AND\n | LogicalOperator.OR\n>\n\nexport type MakeIntegrationInputs = {\n url: string\n body: any\n}\n\nexport type n8nStepInputs = {\n url: string\n method?: HttpMethod\n authorization: string\n body: any\n}\n\nexport type OpenAIStepInputs = {\n prompt: string\n model: Model\n}\n\nexport type ClassifyContentStepInputs = {\n inputType: string\n textInput: string\n categoryItems: Array<{\n category: string\n }>\n}\n\nexport type ClassifyContentStepOutputs = {\n category?: string\n success: boolean\n response?: string\n}\n\nexport type PromptLLMStepInputs = {\n prompt: string\n model: Model\n}\n\nexport type PromptLLMStepOutputs = {\n response?: string\n success: boolean\n}\n\nexport type TranslateStepInputs = {\n text: string\n language: string\n}\n\nexport type TranslateStepOutputs = {\n response?: string\n success: boolean\n}\n\nexport type SummariseStepInputs = {\n text: string\n length?: SummariseLength\n}\n\nexport type SummariseStepOutputs = {\n response?: string\n success: boolean\n}\n\nexport type GenerateTextStepInputs = {\n contentType: string\n instructions: string\n}\n\nexport type GenerateTextStepOutputs = {\n success: boolean\n response?: string\n}\nexport type ExtractFileDataStepInputs = {\n file: RowAttachment | string\n source: \"URL\" | \"Attachment\"\n fileType?: string\n schema: Record<string, any>\n}\n\nexport type ExtractFileDataStepOutputs = {\n success: boolean\n data: Record<string, any>\n response?: string\n}\n\nexport type LoopV2StepInputs = {\n option: LoopStepType\n binding: any\n iterations?: number\n failure?: string\n children?: AutomationStep[]\n resultOptions?: {\n maxStoredIterations?: number\n storeFullResults?: boolean\n summarizeOnly?: boolean\n }\n}\n\nexport interface LoopSummary {\n totalProcessed: number\n successCount: number\n failureCount: number\n firstFailure?: { iteration: number; error: string }\n}\n\nexport type LoopV2StepOutputs = {\n success: boolean\n iterations: number\n status?: string\n summary: LoopSummary\n items?: Record<string, AutomationStepResult[]>\n recentItems?: Record<string, AutomationStepResult[]>\n nestedSummaries?: Record<string, LoopSummary[]>\n}\n\nexport enum Model {\n GPT_35_TURBO = \"gpt-3.5-turbo\",\n // will only work with api keys that have access to the GPT4 API\n GPT_4 = \"gpt-4\",\n GPT_4O = \"gpt-4o\",\n GPT_4O_MINI = \"gpt-4o-mini\",\n GPT_5_MINI = \"gpt-5-mini\",\n GPT_5 = \"gpt-5\",\n GPT_5_NANO = \"gpt-5-nano\",\n}\n\nexport enum SummariseLength {\n SHORT = \"short\",\n MEDIUM = \"medium\",\n LONG = \"long\",\n}\n\nexport type OpenAIStepOutputs = Omit<BaseAutomationOutputs, \"response\"> & {\n response?: string | null\n}\n\nexport type QueryRowsStepInputs = {\n tableId: string\n filters?: SearchFilters\n \"filters-def\"?: any\n sortColumn?: string\n sortOrder?: SortOrder\n limit?: number\n onEmptyFilter?: EmptyFilterOption\n}\n\nexport type QueryRowsStepOutputs = BaseAutomationOutputs & {\n rows?: Row[]\n}\n\nexport type SmtpEmailStepInputs = {\n to: string\n from: string\n subject: string\n contents: string\n cc: string\n bcc: string\n addInvite?: boolean\n startTime: Date\n endTime: Date\n summary: string\n location?: string\n url?: string\n attachments?: EmailAttachment[]\n}\n\nexport type SmtpEmailStepOutputs = BaseAutomationOutputs\nexport type ServerLogStepInputs = {\n text: string\n}\n\nexport type ServerLogStepOutputs = BaseAutomationOutputs & {\n message: string\n}\nexport type SlackStepInputs = {\n url: string\n text: string\n}\n\nexport type TriggerAutomationStepInputs = {\n automation: {\n automationId: string\n }\n timeout?: number\n}\n\nexport type TriggerAutomationStepOutputs = BaseAutomationOutputs & {\n value?: AutomationResults[\"steps\"]\n status: AutomationResults[\"status\"]\n}\n\nexport type UpdateRowStepInputs = {\n meta: Record<string, any>\n row: Row\n rowId: string\n}\n\nexport type UpdateRowStepOutputs = BaseAutomationOutputs & {\n row?: Row\n id?: string\n revision?: string\n}\n\nexport type ZapierStepInputs = {\n url: string\n body: any\n}\n\nexport type ZapierStepOutputs = Omit<ExternalAppStepOutputs, \"response\"> & {\n response: string\n}\n\nexport enum RequestType {\n POST = \"POST\",\n GET = \"GET\",\n PUT = \"PUT\",\n DELETE = \"DELETE\",\n PATCH = \"PATCH\",\n}\n\nexport type OutgoingWebhookStepInputs = {\n requestMethod: RequestType\n url: string\n requestBody: string\n headers: string | Record<string, string>\n}\n\nexport type AppActionTriggerOutputs = {\n fields: object\n}\n\nexport type CronTriggerInputs = {\n cron: string\n}\n\nexport type CronTriggerOutputs = {\n timestamp: number\n}\n\nexport type RowDeletedTriggerInputs = {\n tableId: string\n}\n\nexport type RowDeletedTriggerOutputs = {\n row: Row\n}\n\nexport type RowCreatedTriggerInputs = {\n tableId: string\n filters?: SearchFilters\n}\n\nexport type RowCreatedTriggerOutputs = {\n row: Row\n id: string\n revision: string\n}\n\nexport type RowUpdatedTriggerInputs = {\n tableId: string\n filters?: SearchFilters\n}\n\nexport type RowUpdatedTriggerOutputs = {\n row: Row\n id: string\n revision?: string\n oldRow?: Row\n}\n\nexport type WebhookTriggerInputs = {\n schemaUrl: string\n triggerUrl: string\n}\n\nexport type WebhookTriggerOutputs = Record<string, any> & {\n body: Record<string, any>\n}\n\nexport type RowActionTriggerInputs = {\n tableId: string\n rowActionId: string\n}\n\nexport type RowActionTriggerOutputs = {\n row: Row\n id: string\n revision?: string\n table: Table\n}\n", "import { Document } from \"../document\"\nimport { User } from \"../../\"\n\nexport enum AppBackupType {\n BACKUP = \"backup\",\n RESTORE = \"restore\",\n}\n\nexport enum AppBackupStatus {\n STARTED = \"started\",\n PENDING = \"pending\",\n COMPLETE = \"complete\",\n FAILED = \"failed\",\n}\n\nexport enum AppBackupTrigger {\n PUBLISH = \"publish\",\n MANUAL = \"manual\",\n SCHEDULED = \"scheduled\",\n RESTORING = \"restoring\",\n}\n\nexport interface AppBackupContents {\n datasources: string[]\n screens: string[]\n automations: string[]\n}\n\nexport interface AppBackupMetadata {\n appId: string\n trigger?: AppBackupTrigger\n type: AppBackupType\n status: AppBackupStatus\n name?: string\n createdBy?: string | User\n timestamp: string\n finishedAt?: string\n startedAt?: string\n contents?: AppBackupContents\n}\n\nexport interface AppBackup extends Document, AppBackupMetadata {\n _id: string\n filename?: string\n}\n\nexport type AppBackupFetchOpts = {\n trigger?: AppBackupTrigger\n type?: AppBackupType\n limit?: number\n page?: string\n paginate?: boolean\n startDate?: string\n endDate?: string\n}\n\nexport interface AppBackupQueueData {\n appId: string\n docId: string\n docRev: string\n export?: {\n trigger: AppBackupTrigger\n name?: string\n createdBy?: string\n }\n import?: {\n backupId: string\n nameForBackup: string\n createdBy?: string\n }\n}\n\nexport interface DevRevertQueueData {\n appId: string\n userId?: string\n}\n", "import { Document } from \"../document\"\nimport { SourceName } from \"../../sdk\"\nimport { Table } from \"./table\"\n\nexport interface Datasource extends Document {\n type: string\n name?: string\n source: SourceName\n // this is a googlesheets specific property which\n // can be found in the GSheets schema - pertains to SSO creds\n auth?: { type: string }\n // the config is defined by the schema\n config?: Record<string, any>\n plus?: boolean\n isSQL?: boolean\n usesEnvironmentVariables?: boolean\n entities?: Record<string, Table>\n}\n\nexport enum RestAuthType {\n BASIC = \"basic\",\n BEARER = \"bearer\",\n OAUTH2 = \"oauth2\",\n}\n\nexport interface RestBasicAuthConfig {\n username: string\n password: string\n}\n\nexport interface RestBearerAuthConfig {\n token: string\n}\n\nexport interface BasicRestAuthConfig {\n _id: string\n name: string\n type: RestAuthType.BASIC\n config: RestBasicAuthConfig\n}\n\nexport interface BearerRestAuthConfig {\n _id: string\n name: string\n type: RestAuthType.BEARER\n config: RestBearerAuthConfig\n}\n\nexport type RestAuthConfig = BasicRestAuthConfig | BearerRestAuthConfig\n\nexport interface DynamicVariable {\n name: string\n queryId: string\n value: string\n}\n\nexport interface RestConfig {\n url: string\n rejectUnauthorized?: boolean\n downloadImages?: boolean\n defaultHeaders?: {\n [key: string]: any\n }\n legacyHttpParser?: boolean\n authConfigs?: RestAuthConfig[]\n staticVariables?: {\n [key: string]: string\n }\n dynamicVariables?: DynamicVariable[]\n}\n\nexport enum SourceType {\n DATASOURCE = \"datasource\",\n QUERY = \"query\",\n TABLE = \"table\",\n VIEW = \"view\",\n}\n", "export enum DeploymentStatus {\n SUCCESS = \"SUCCESS\",\n PENDING = \"PENDING\",\n FAILURE = \"FAILURE\",\n}\n\nexport interface DeploymentDoc {\n _id: string\n verification: any\n status?: DeploymentStatus\n history?: Record<\n string,\n {\n _id: string\n appId: string\n status?: DeploymentStatus\n updatedAt: number\n }\n >\n err?: any\n appUrl?: string\n}\n", "export enum MetadataType {\n AUTOMATION_TEST_INPUT = \"automationTestInput\",\n AUTOMATION_TEST_HISTORY = \"automationTestHistory\",\n}\n", "import { Document } from \"../document\"\n\nexport enum OAuth2CredentialsMethod {\n HEADER = \"HEADER\",\n BODY = \"BODY\",\n}\n\nexport enum OAuth2GrantType {\n CLIENT_CREDENTIALS = \"client_credentials\",\n}\n\nexport interface OAuth2Config extends Document {\n name: string\n url: string\n clientId: string\n clientSecret: string\n method: OAuth2CredentialsMethod\n grantType: OAuth2GrantType\n scope?: string\n}\n", "import { Document } from \"../document\"\nimport { RestAuthType } from \"./datasource\"\nimport { Row } from \"./row\"\n\nexport interface QuerySchema {\n name?: string\n type: string\n subtype?: string\n}\n\nexport type QueryVerb = \"read\" | \"create\" | \"update\" | \"delete\" | \"patch\"\n\nexport interface Query extends Document {\n datasourceId: string\n name: string\n parameters: QueryParameter[]\n fields: RestQueryFields &\n SQLQueryFields &\n MongoQueryFields &\n GoogleSheetsQueryFields\n transformer: string | null\n schema: Record<string, QuerySchema | string>\n nestedSchemaFields?: Record<string, Record<string, QuerySchema | string>>\n readable: boolean\n queryVerb: QueryVerb\n // flag to state whether the default bindings are empty strings (old behaviour) or null\n nullDefaultSupport?: boolean\n}\n\nexport interface QueryPreview extends Omit<Query, \"_id\"> {\n queryId?: string\n}\n\nexport interface QueryParameter {\n name: string\n default: string\n}\n\nexport interface QueryResponse {\n rows: Row[]\n keys: string[]\n info: any\n extra: any\n pagination: any\n}\n\nexport enum BodyType {\n NONE = \"none\",\n FORM_DATA = \"form\",\n XML = \"xml\",\n ENCODED = \"encoded\",\n JSON = \"json\",\n TEXT = \"text\",\n}\n\nexport interface RestQueryFields {\n path?: string\n queryString?: string\n headers?: { [key: string]: any }\n disabledHeaders?: { [key: string]: any }\n requestBody?: any\n bodyType?: BodyType\n method?: string\n authConfigId?: string\n authConfigType?: RestAuthType\n pagination?: PaginationConfig\n paginationValues?: PaginationValues\n}\nexport interface SQLQueryFields {\n sql?: string\n}\n\nexport interface MongoQueryFields {\n extra?: {\n collection?: string\n actionType:\n | \"findOne\"\n | \"find\"\n | \"updateOne\"\n | \"updateMany\"\n | \"findOneAndUpdate\"\n | \"count\"\n | \"distinct\"\n | \"insertOne\"\n | \"deleteOne\"\n | \"deleteMany\"\n }\n json?: object | string\n}\n\nexport interface GoogleSheetsQueryFields {\n sheet?: string\n rowIndex?: string\n row?: Row\n}\n\nexport interface PaginationConfig {\n type: string\n location: string\n pageParam: string\n sizeParam?: string\n responseParam?: string\n}\n\nexport interface PaginationValues {\n page?: string | number\n limit?: number\n}\n\nexport enum HttpMethod {\n GET = \"GET\",\n POST = \"POST\",\n PATCH = \"PATCH\",\n PUT = \"PUT\",\n HEAD = \"HEAD\",\n DELETE = \"DELETE\",\n}\n", "import { Document } from \"../../document\"\nimport { View, ViewV2 } from \"../view\"\nimport { RenameColumn } from \"../../../sdk\"\nimport { TableSchema } from \"./schema\"\n\nexport const INTERNAL_TABLE_SOURCE_ID = \"bb_internal\"\n\nexport enum TableSourceType {\n EXTERNAL = \"external\",\n INTERNAL = \"internal\",\n}\n\nexport interface Table extends Document {\n type: \"table\"\n sourceType: TableSourceType\n views?: { [key: string]: View | ViewV2 }\n name: string\n originalName?: string\n sourceId: string\n primary?: string[]\n schema: TableSchema\n primaryDisplay?: string\n relatedFormula?: string[]\n constrained?: string[]\n sql?: boolean\n indexes?: string[]\n created?: boolean\n rowHeight?: number\n aiGenerated?: boolean\n}\n\nexport interface TableRequest extends Table {\n _rename?: RenameColumn\n created?: boolean\n}\n", "import { FieldType } from \"../row\"\n\nexport enum RelationshipType {\n ONE_TO_MANY = \"one-to-many\",\n MANY_TO_ONE = \"many-to-one\",\n MANY_TO_MANY = \"many-to-many\",\n}\n\nexport enum AutoReason {\n FOREIGN_KEY = \"foreign_key\",\n}\n\nexport type FieldSubType =\n | AutoFieldSubType\n | AttachmentSubType\n | BBReferenceFieldSubType\n | JsonFieldSubType\n | StringFieldSubType\n\nexport enum AutoFieldSubType {\n CREATED_BY = \"createdBy\",\n CREATED_AT = \"createdAt\",\n UPDATED_BY = \"updatedBy\",\n UPDATED_AT = \"updatedAt\",\n AUTO_ID = \"autoID\",\n}\n\nexport enum JsonFieldSubType {\n ARRAY = \"array\",\n}\n\nexport enum FormulaType {\n STATIC = \"static\",\n DYNAMIC = \"dynamic\",\n AI = \"ai\",\n}\n\nexport enum BBReferenceFieldSubType {\n USER = \"user\",\n /** @deprecated this should not be used anymore, left here in order to support the existing usages */\n USERS = \"users\",\n}\n\nexport enum AttachmentSubType {\n IMAGE = \"image\",\n}\n\nexport enum StringFieldSubType {\n ARRAY = \"array\",\n}\n\nexport type SupportedSqlTypes =\n | FieldType.STRING\n | FieldType.BARCODEQR\n | FieldType.LONGFORM\n | FieldType.OPTIONS\n | FieldType.DATETIME\n | FieldType.NUMBER\n | FieldType.BOOLEAN\n | FieldType.FORMULA\n | FieldType.BIGINT\n | FieldType.BB_REFERENCE\n | FieldType.BB_REFERENCE_SINGLE\n | FieldType.LINK\n | FieldType.ARRAY\n", "// all added by grid/table when defining the\n// column size, position and whether it can be viewed\nimport { FieldType, FormulaResponseType } from \"../row\"\nimport {\n AttachmentSubType,\n AutoFieldSubType,\n AutoReason,\n BBReferenceFieldSubType,\n FormulaType,\n JsonFieldSubType,\n RelationshipType,\n StringFieldSubType,\n} from \"./constants\"\nimport { AIOperationEnum } from \"../../../sdk/ai\"\n\nexport interface UIFieldMetadata {\n order?: number\n width?: number\n visible?: boolean\n icon?: string\n}\n\ninterface BaseRelationshipFieldMetadata\n extends Omit<BaseFieldSchema, \"subtype\"> {\n type: FieldType.LINK\n main?: boolean\n fieldName: string\n tableId: string\n tableRev?: string\n subtype?: AutoFieldSubType.CREATED_BY | AutoFieldSubType.UPDATED_BY\n}\n\n// External tables use junction tables, internal tables don't require them\ntype ManyToManyJunctionTableMetadata =\n | {\n through: string\n throughFrom: string\n throughTo: string\n }\n | {\n through?: never\n throughFrom?: never\n throughTo?: never\n }\n\nexport type ManyToManyRelationshipFieldMetadata =\n BaseRelationshipFieldMetadata & {\n relationshipType: RelationshipType.MANY_TO_MANY\n } & ManyToManyJunctionTableMetadata\n\nexport interface OneToManyRelationshipFieldMetadata\n extends BaseRelationshipFieldMetadata {\n relationshipType: RelationshipType.ONE_TO_MANY\n foreignKey?: string\n}\nexport interface ManyToOneRelationshipFieldMetadata\n extends BaseRelationshipFieldMetadata {\n relationshipType: RelationshipType.MANY_TO_ONE\n foreignKey?: string\n}\nexport type RelationshipFieldMetadata =\n | ManyToManyRelationshipFieldMetadata\n | OneToManyRelationshipFieldMetadata\n | ManyToOneRelationshipFieldMetadata\n\nexport interface AutoColumnFieldMetadata\n extends Omit<BaseFieldSchema, \"subtype\"> {\n type: FieldType.AUTO\n autocolumn: true\n subtype: AutoFieldSubType\n lastID?: number\n // if the column was turned to an auto-column for SQL, explains why (primary, foreign etc)\n autoReason?: AutoReason\n}\n\nexport interface NumberFieldMetadata extends Omit<BaseFieldSchema, \"subtype\"> {\n type: FieldType.NUMBER\n subtype?: AutoFieldSubType.AUTO_ID\n lastID?: number\n autoReason?: AutoReason.FOREIGN_KEY\n // used specifically when Budibase generates external tables, this denotes if a number field\n // is a foreign key used for a many-to-many relationship\n meta?: {\n toTable: string\n toKey: string\n }\n default?: string\n}\n\nexport interface JsonFieldMetadata extends Omit<BaseFieldSchema, \"subtype\"> {\n type: FieldType.JSON\n subtype?: JsonFieldSubType.ARRAY\n default?: string\n}\n\nexport interface DateFieldMetadata extends Omit<BaseFieldSchema, \"subtype\"> {\n type: FieldType.DATETIME\n ignoreTimezones?: boolean\n timeOnly?: boolean\n dateOnly?: boolean\n subtype?: AutoFieldSubType.CREATED_AT | AutoFieldSubType.UPDATED_AT\n default?: string\n}\n\nexport interface LongFormFieldMetadata extends BaseFieldSchema {\n type: FieldType.LONGFORM\n useRichText?: boolean | null\n default?: string\n}\n\nexport interface StringFieldMetadata extends Omit<BaseFieldSchema, \"subtype\"> {\n type: FieldType.STRING\n subtype?: StringFieldSubType.ARRAY\n default?: string\n}\n\nexport interface FormulaFieldMetadata extends BaseFieldSchema {\n type: FieldType.FORMULA\n formula: string\n formulaType?: FormulaType\n responseType?: FormulaResponseType\n}\n\nexport interface AIFieldMetadata extends BaseFieldSchema {\n type: FieldType.AI\n operation: AIOperationEnum\n columns?: string[]\n column?: string\n categories?: string\n prompt?: string\n language?: string\n}\n\nexport interface BBReferenceFieldMetadata\n extends Omit<BaseFieldSchema, \"subtype\"> {\n type: FieldType.BB_REFERENCE\n subtype: BBReferenceFieldSubType\n relationshipType?: RelationshipType\n default?: string[]\n}\nexport interface BBReferenceSingleFieldMetadata\n extends Omit<BaseFieldSchema, \"subtype\"> {\n type: FieldType.BB_REFERENCE_SINGLE\n subtype: Exclude<BBReferenceFieldSubType, BBReferenceFieldSubType.USERS>\n default?: string\n}\n\nexport interface AttachmentFieldMetadata\n extends Omit<BaseFieldSchema, \"subtype\"> {\n type: FieldType.ATTACHMENTS\n subtype?: AttachmentSubType\n}\nexport interface SingleAttachmentFieldMetadata\n extends Omit<BaseFieldSchema, \"subtype\"> {\n type: FieldType.ATTACHMENT_SINGLE\n subtype?: AttachmentSubType\n}\n\nexport interface FieldConstraints {\n type?: string\n email?: boolean\n inclusion?: string[]\n length?: {\n minimum?: string | number | null\n maximum?: string | number | null\n message?: string\n }\n numericality?: {\n greaterThanOrEqualTo?: string | null\n lessThanOrEqualTo?: string | null\n }\n presence?:\n | boolean\n | {\n allowEmpty?: boolean\n }\n datetime?: {\n latest?: string\n earliest?: string\n }\n}\n\nexport interface OptionsFieldMetadata extends BaseFieldSchema {\n type: FieldType.OPTIONS\n constraints: FieldConstraints & {\n inclusion: string[]\n }\n default?: string\n}\n\nexport interface ArrayFieldMetadata extends BaseFieldSchema {\n type: FieldType.ARRAY\n constraints: FieldConstraints & {\n type: JsonFieldSubType.ARRAY\n inclusion: string[]\n }\n default?: string[]\n}\n\nexport interface BooleanFieldMetadata extends BaseFieldSchema {\n type: FieldType.BOOLEAN\n default?: string\n}\n\nexport interface BigIntFieldMetadata extends BaseFieldSchema {\n type: FieldType.BIGINT\n default?: string\n}\n\nexport interface BaseFieldSchema extends UIFieldMetadata {\n type: FieldType\n name: string\n sortable?: boolean\n // only used by external databases, to denote the real type\n externalType?: string\n constraints?: FieldConstraints\n autocolumn?: boolean\n autoReason?: AutoReason.FOREIGN_KEY\n subtype?: never\n // added when enriching nested JSON fields into schema\n nestedJSON?: boolean\n aiGenerated?: boolean\n}\n\ninterface OtherFieldMetadata extends BaseFieldSchema {\n type: Exclude<\n FieldType,\n | FieldType.DATETIME\n | FieldType.LINK\n | FieldType.AUTO\n | FieldType.FORMULA\n | FieldType.AI\n | FieldType.NUMBER\n | FieldType.LONGFORM\n | FieldType.BB_REFERENCE\n | FieldType.BB_REFERENCE_SINGLE\n | FieldType.ATTACHMENTS\n | FieldType.STRING\n | FieldType.ARRAY\n | FieldType.OPTIONS\n | FieldType.BOOLEAN\n | FieldType.BIGINT\n | FieldType.JSON\n >\n}\n\nexport type FieldSchema =\n | OtherFieldMetadata\n | DateFieldMetadata\n | RelationshipFieldMetadata\n | AutoColumnFieldMetadata\n | FormulaFieldMetadata\n | AIFieldMetadata\n | NumberFieldMetadata\n | LongFormFieldMetadata\n | StringFieldMetadata\n | BBReferenceFieldMetadata\n | JsonFieldMetadata\n | AttachmentFieldMetadata\n | SingleAttachmentFieldMetadata\n | BBReferenceSingleFieldMetadata\n | ArrayFieldMetadata\n | OptionsFieldMetadata\n | BooleanFieldMetadata\n | BigIntFieldMetadata\n\nexport interface TableSchema {\n [key: string]: FieldSchema\n}\n\nexport function isRelationshipField(\n field: FieldSchema\n): field is RelationshipFieldMetadata {\n return field.type === FieldType.LINK\n}\n\nexport function isManyToMany(\n field: RelationshipFieldMetadata\n): field is ManyToManyRelationshipFieldMetadata {\n return field.relationshipType === RelationshipType.MANY_TO_MANY\n}\n\nexport function isOneToMany(\n field: RelationshipFieldMetadata\n): field is OneToManyRelationshipFieldMetadata {\n return field.relationshipType === RelationshipType.ONE_TO_MANY\n}\n\nexport function isManyToOne(\n field: RelationshipFieldMetadata\n): field is ManyToOneRelationshipFieldMetadata {\n return field.relationshipType === RelationshipType.MANY_TO_ONE\n}\n", "import { Document } from \"../document\"\nimport { FieldSchema, FormulaType } from \"./table\"\n\nexport const EXTERNAL_ROW_REV = \"rev\"\n\nexport enum FieldType {\n /**\n * a primitive type, stores a string, called Text within Budibase. This is one of the default\n * types of Budibase, if an external type is not fully understood, we will treat it as text.\n */\n STRING = \"string\",\n /**\n * similar to string type, called Long Form Text within Budibase. This is mainly a frontend\n * orientated type which enables a larger text input area. This can also be used\n * in conjunction with the 'useRichText' option to support a markdown editor/viewer.\n */\n LONGFORM = \"longform\",\n /**\n * similar to string type, called Options within Budibase. This works very similarly to\n * the string type within the backend, but is validated to a list of options. This will\n * display a <select> input within the builder/client.\n */\n OPTIONS = \"options\",\n /**\n * a primitive type, stores a number, as a floating point, called Number within Budibase.\n * this type will always represent numbers as reals/floating point - there is no integer only\n * type within Budibase.\n */\n NUMBER = \"number\",\n /**\n * a primitive type, stores a boolean, called Boolean within Budibase. This is often represented\n * as a toggle or checkbox within forms/grids.\n */\n BOOLEAN = \"boolean\",\n /**\n * a JSON type, this type is always an array of strings, called Multi-select within Budibase.\n * This type can be compared to the options type, as it functions similarly, but allows picking\n * multiple options rather than a single option.\n */\n ARRAY = \"array\",\n /**\n * a string type, this is always a string when input/returned from the API, called Date/Time within\n * Budibase. We utilise ISO date strings for representing dates, this type has a range of subtypes\n * to restrict it to date only, time only and ignore timezone capabilities.\n */\n DATETIME = \"datetime\",\n /**\n * a JSON type, an array of metadata about files held in object storage, called Attachment List within\n * Budibase. To utilise this type there is an API for uploading files to Budibase, which returns metadata\n * that can be stored against columns of this type. Currently this is not supported on external databases.\n */\n ATTACHMENTS = \"attachment\",\n /**\n * a JSON type, similar to the attachments type, called Attachment within Budibase. This type functions\n * much the same as the attachment list, but only holds a single attachment metadata as an object.\n * This simplifies the binding experience of using this column type.\n */\n ATTACHMENT_SINGLE = \"attachment_single\",\n /**\n * a complex type, called Relationships within Budibase. This is the most complex type of Budibase,\n * nothing should be stored against rows under link columns; this type simply represents the\n * relationship between tables as part of the table schema. When rows are input to the Budibase API\n * relationships to be made are represented as a list of row IDs to link. When rows are returned\n * from the Budibase API it will contain a list of row IDs and display column values of the related rows.\n */\n LINK = \"link\",\n /**\n * a complex type, called Formulas within Budibase. This type has two variants, static and dynamic, with\n * static only being supported against internal tables. Dynamic formulas calculate a provided HBS/JS binding\n * based on the row context and enrich it when rows are being returned from the API. Static bindings calculate\n * this when rows are being stored, so that the formula output can be searched upon within the DB.\n */\n FORMULA = \"formula\",\n /**\n * a complex type, called Auto Column within Budibase. This type has a few variants, with options such as a\n * date for created at/updated at, an auto ID column with auto-increments as rows are saved and a user\n * relationship type which stores the created by/updated by user details. These subtypes all depend on the\n * date, number of link types respectively. There is one case where these will be executed in the browser,\n * that is part of the initial formula definition, the formula will be live evaluated in the browser.\n */\n AUTO = \"auto\",\n /**\n * A complex type, called an AI column within Budibase. This type is only supported against internal tables\n * and calculates the output based on a chosen operation (summarise text, translation etc) which passes to\n * the configured Budibase Large Language Model to retrieve the output and write it back into the row.\n * AI fields function in a similar fashion to static formulas, and possess many of the same characteristics.\n */\n AI = \"ai\",\n /**\n * a JSON type, called JSON within Budibase. This type allows any arbitrary JSON to be input to this column\n * type, which will be represented as a JSON object in the row. This type depends on a schema being\n * provided to make the JSON searchable/bindable, the JSON cannot be fully dynamic.\n */\n JSON = \"json\",\n /**\n * @deprecated an internal type, this is an old deprecated type which is no longer used - still represented to note it\n * could appear in very old tables.\n */\n INTERNAL = \"internal\",\n /**\n * a string type, called Barcode/QR within Budibase. This type is used to denote to forms to that this column\n * should be filled in using a camera to read a barcode, there is a form component which will be used when this\n * type is found. The column will contain the contents of any barcode scanned.\n */\n BARCODEQR = \"barcodeqr\",\n /**\n * a JSON type, called Signature within Budibase. This type functions much the same as ATTACHMENTS but restricted\n * only to signatures.\n */\n SIGNATURE_SINGLE = \"signature_single\",\n /**\n * a string type, this allows representing very large integers, but they are held/managed within Budibase as\n * strings. When stored in external databases Budibase will attempt to use a real big integer type and depend\n * on the database parsing the string to this type as part of saving.\n */\n BIGINT = \"bigint\",\n /**\n * a JSON type, called Users within Budibase. It will hold an array of strings. This type is used to represent a link to an internal Budibase\n * resource, like a user or group, today only users are supported. This type will be represented as an\n * array of internal resource IDs (e.g. user IDs) within the row - this ID list will be enriched with\n * the full resources when rows are returned from the API. The full resources can be input to the API, or\n * an array of resource IDs, the API will squash these down and validate them before saving the row.\n */\n BB_REFERENCE = \"bb_reference\",\n /**\n * a string type, called User within Budibase. Same logic as `bb_reference`, storing a single id as string instead of an array\n */\n BB_REFERENCE_SINGLE = \"bb_reference_single\",\n}\n\nexport const JsonTypes = [\n FieldType.ATTACHMENT_SINGLE,\n FieldType.ATTACHMENTS,\n FieldType.SIGNATURE_SINGLE,\n // only BB_REFERENCE is JSON, it's an array, BB_REFERENCE_SINGLE is a string type\n FieldType.BB_REFERENCE,\n FieldType.JSON,\n FieldType.ARRAY,\n]\n\nexport type FormulaResponseType =\n | FieldType.STRING\n | FieldType.NUMBER\n | FieldType.BOOLEAN\n | FieldType.DATETIME\n\nexport const NumericTypes = [FieldType.NUMBER, FieldType.BIGINT]\n\nexport function isNumeric(type: FieldType) {\n return NumericTypes.includes(type)\n}\n\nexport function isNumericStaticFormula(schema: FieldSchema) {\n return (\n schema.type === FieldType.FORMULA &&\n schema.formulaType === FormulaType.STATIC &&\n schema.responseType &&\n isNumeric(schema.responseType)\n )\n}\n\nexport const GroupByTypes = [\n FieldType.STRING,\n FieldType.LONGFORM,\n FieldType.OPTIONS,\n FieldType.NUMBER,\n FieldType.BOOLEAN,\n FieldType.DATETIME,\n FieldType.BIGINT,\n FieldType.AI,\n]\n\nexport function canGroupBy(type: FieldType) {\n return GroupByTypes.includes(type)\n}\n\nexport interface RowAttachment {\n size: number\n name: string\n extension: string\n key?: string\n // Populated on read\n url?: string\n}\n\nexport interface Row extends Document {\n type?: string\n tableId?: string\n _viewId?: string\n [key: string]: any\n}\n", "import { Document } from \"../document\"\nimport { Component } from \"./component\"\n\nexport interface ScreenProps extends Component {\n size?: string\n gap?: string\n direction?: string\n vAlign?: string\n hAlign?: string\n}\n\nexport interface ScreenRouting {\n route: string\n roleId: string\n homeScreen?: boolean\n}\n\nexport enum ScreenVariant {\n PDF = \"pdf\",\n}\n\nexport interface Screen extends Document {\n layoutId?: string\n showNavigation?: boolean\n width?: string\n routing: ScreenRouting\n props: ScreenProps\n name?: string\n pluginAdded?: boolean\n onLoad?: EventHandler[]\n variant?: ScreenVariant\n workspaceAppId: string\n}\n\nexport interface ScreenRoutesViewOutput extends Document {\n id: string\n routing: ScreenRouting\n}\n\nexport type ScreenRoutingJson = Record<\n string,\n {\n subpaths: Record<string, any>\n }\n>\n\nexport interface EventHandler {\n parameters: {\n key: string\n type: string\n value: string\n persist: any | null\n }\n \"##eventHandlerType\": string\n id: string\n}\n", "export enum SQLiteType {\n REAL = \"REAL\",\n TEXT = \"VARCHAR\",\n INT = \"INTEGER\",\n BLOB = \"BLOB\",\n NUMERIC = \"NUMERIC\",\n}\n\nexport type SQLiteTable = Record<\n string,\n SQLiteType | { field: string; type: SQLiteType }\n>\n\nexport type SQLiteTables = Record<\n string,\n {\n fields: SQLiteTable\n }\n>\n\nexport interface SQLiteDefinition {\n _id: string\n _rev: string\n language: string\n sql: {\n tables: SQLiteTables\n options: {\n table_name: string\n }\n }\n}\n\nexport interface PreSaveSQLiteDefinition\n extends Omit<SQLiteDefinition, \"_rev\"> {\n _rev?: string\n}\n", "export enum Theme {\n LIGHTEST = \"lightest\",\n LIGHT = \"light\",\n DARK = \"dark\",\n DARKEST = \"darkest\",\n NORD = \"nord\",\n MIDNIGHT = \"midnight\",\n}\n\nexport type ThemeMeta = {\n id: string\n name: string\n base?: Theme\n}\n", "import { LegacyFilter, UISearchFilter, SortOrder, SortType } from \"../../api\"\nimport { UIFieldMetadata } from \"./table\"\nimport { Document } from \"../document\"\nimport { DBView, SearchFilters } from \"../../sdk\"\n\nexport type ViewTemplateOpts = {\n field: string\n tableId: string\n groupBy?: string\n filters: ViewFilter[]\n schema: any\n calculation?: string\n groupByMulti?: boolean\n}\n\nexport interface InMemoryView extends Document {\n view: DBView\n name: string\n tableId: string\n groupBy?: string\n}\n\nexport interface View {\n name?: string\n tableId: string\n field?: string\n filters: ViewFilter[]\n schema: ViewSchema\n calculation?: ViewCalculation\n map?: string\n reduce?: any\n meta?: ViewTemplateOpts\n groupBy?: string\n}\n\nexport interface BasicViewFieldMetadata extends UIFieldMetadata {\n readonly?: boolean\n columns?: Record<string, RelationSchemaField>\n}\n\nexport interface RelationSchemaField extends UIFieldMetadata {\n readonly?: boolean\n}\n\nexport interface NumericCalculationFieldMetadata\n extends BasicViewFieldMetadata {\n calculationType:\n | CalculationType.MIN\n | CalculationType.MAX\n | CalculationType.SUM\n | CalculationType.AVG\n field: string\n}\n\nexport interface CountCalculationFieldMetadata extends BasicViewFieldMetadata {\n calculationType: CalculationType.COUNT\n field: string\n}\n\nexport interface CountDistinctCalculationFieldMetadata\n extends CountCalculationFieldMetadata {\n distinct: true\n}\n\nexport type ViewCalculationFieldMetadata =\n | NumericCalculationFieldMetadata\n | CountCalculationFieldMetadata\n | CountDistinctCalculationFieldMetadata\n\nexport type ViewFieldMetadata =\n | BasicViewFieldMetadata\n | ViewCalculationFieldMetadata\n\nexport enum CalculationType {\n SUM = \"sum\",\n AVG = \"avg\",\n COUNT = \"count\",\n MIN = \"min\",\n MAX = \"max\",\n}\n\nexport enum ViewV2Type {\n CALCULATION = \"calculation\",\n}\n\nexport interface ViewV2 {\n version: 2\n id: string\n name: string\n type?: ViewV2Type\n primaryDisplay?: string\n tableId: string\n query?: LegacyFilter[] | SearchFilters\n // duplicate to store UI information about filters\n queryUI?: UISearchFilter\n sort?: {\n field: string\n order?: SortOrder\n type?: SortType\n }\n schema?: ViewV2Schema\n rowHeight?: number\n}\n\nexport interface PublicAPIView extends Omit<ViewV2, \"query\" | \"queryUI\"> {\n query?: UISearchFilter\n}\n\nexport type ViewV2Schema = Record<string, ViewFieldMetadata>\n\nexport type ViewSchema = ViewCountOrSumSchema | ViewStatisticsSchema\n\nexport interface ViewCountOrSumSchema {\n field: string\n value: string\n}\n\n/**\n e.g:\n \"min\": {\n \"type\": \"number\"\n },\n \"max\": {\n \"type\": \"number\"\n }\n */\nexport interface ViewStatisticsSchema {\n [key: string]: {\n type: string\n }\n}\n\nexport interface ViewFilter {\n value?: any\n condition: string\n key: string\n conjunction?: string\n}\n\nexport enum ViewCalculation {\n SUM = \"sum\",\n COUNT = \"count\",\n STATISTICS = \"stats\",\n}\n", "import { Document } from \"../document\"\nimport { JSONSchema7 } from \"json-schema\"\n\nexport enum WebhookActionType {\n AUTOMATION = \"automation\",\n}\n\nexport interface Webhook extends Document {\n live: boolean\n name: string\n action: {\n type: WebhookActionType\n target: string\n }\n bodySchema?: JSONSchema7\n}\n", "import { Document } from \"../document\"\n\nexport interface Config<T = any> extends Document {\n type: ConfigType\n config: T\n}\n\nexport interface SMTPInnerConfig {\n port: number\n host: string\n from: string\n subject?: string\n secure: boolean\n auth?: {\n user: string\n pass: string\n }\n connectionTimeout?: any\n fallback?: boolean\n}\n\nexport interface SMTPConfig extends Config<SMTPInnerConfig> {}\n\n/**\n * Accessible only via pro.\n */\nexport interface SettingsBrandingConfig {\n faviconUrl?: string\n faviconUrlEtag?: string\n emailBrandingEnabled?: boolean\n testimonialsEnabled?: boolean\n platformTitle?: string\n loginHeading?: string\n loginButton?: string\n metaDescription?: string\n metaImageUrl?: string\n metaTitle?: string\n}\n\nexport interface SettingsInnerConfig {\n platformUrl?: string\n company?: string\n logoUrl?: string // Populated on read\n docsUrl?: string\n logoUrlEtag?: string\n uniqueTenantId?: string\n analyticsEnabled?: boolean\n isSSOEnforced?: boolean\n createdVersion?: string\n}\n\nexport interface SettingsConfig extends Config<SettingsInnerConfig> {}\n\nexport type SSOConfigType = ConfigType.GOOGLE | ConfigType.OIDC\nexport type SSOConfig = GoogleInnerConfig | OIDCInnerConfig\n\nexport interface GoogleInnerConfig {\n clientID: string\n clientSecret: string\n activated: boolean\n /**\n * @deprecated read only\n */\n callbackURL?: string\n}\n\nexport interface GoogleConfig extends Config<GoogleInnerConfig> {}\n\nexport interface OIDCStrategyConfiguration {\n issuer: string\n authorizationURL: string\n tokenURL: string\n userInfoURL: string\n clientID: string\n clientSecret: string\n callbackURL: string\n pkce?: PKCEMethod\n}\n\nexport interface OIDCConfigs {\n configs: OIDCInnerConfig[]\n}\n\nexport interface OIDCLogosInnerConfig {\n [key: string]: string\n}\n\nexport interface OIDCLogosConfig extends Config<OIDCLogosInnerConfig> {}\n\nexport interface OIDCInnerConfig {\n configUrl: string\n clientID: string\n clientSecret: string\n logo: string\n name: string\n uuid: string\n activated: boolean\n scopes: string[]\n pkce?: PKCEMethod\n}\n\nexport interface OIDCConfig extends Config<OIDCConfigs> {}\n\nexport interface OIDCWellKnownConfig {\n issuer: string\n authorization_endpoint: string\n token_endpoint: string\n userinfo_endpoint: string\n}\n\nexport interface SCIMInnerConfig {\n enabled: boolean\n}\n\nexport interface SCIMConfig extends Config<SCIMInnerConfig> {}\n\nexport type AIProvider =\n | \"OpenAI\"\n | \"Anthropic\"\n | \"AzureOpenAI\"\n | \"TogetherAI\"\n | \"Custom\"\n | \"BudibaseAI\"\n\nexport interface ProviderConfig {\n provider: AIProvider\n isDefault: boolean\n name: string\n active: boolean\n baseUrl?: string\n apiKey?: string\n defaultModel?: string\n}\n\nexport interface AIInnerConfig {\n [key: string]: ProviderConfig\n}\n\nexport interface AIConfig extends Config<AIInnerConfig> {}\n\nexport interface RecaptchaInnerConfig {\n siteKey: string\n secretKey: string\n}\n\nexport interface RecaptchaConfig extends Config<RecaptchaInnerConfig> {}\n\nexport const isConfig = (config: Object): config is Config =>\n \"type\" in config && \"config\" in config\n\nexport const isSettingsConfig = (config: Config): config is SettingsConfig =>\n config.type === ConfigType.SETTINGS\n\nexport const isSMTPConfig = (config: Config): config is SMTPConfig =>\n config.type === ConfigType.SMTP\n\nexport const isGoogleConfig = (config: Config): config is GoogleConfig =>\n config.type === ConfigType.GOOGLE\n\nexport const isOIDCConfig = (config: Config): config is OIDCConfig =>\n config.type === ConfigType.OIDC\n\nexport const isSCIMConfig = (config: Config): config is SCIMConfig =>\n config.type === ConfigType.SCIM\n\nexport const isAIConfig = (config: Config): config is AIConfig =>\n config.type === ConfigType.AI\n\nexport const isRecaptchaConfig = (config: Config): config is RecaptchaConfig =>\n config.type === ConfigType.RECAPTCHA\n\nexport enum PKCEMethod {\n S256 = \"S256\",\n PLAIN = \"plain\",\n}\n\nexport enum ConfigType {\n SETTINGS = \"settings\",\n ACCOUNT = \"account\",\n SMTP = \"smtp\",\n GOOGLE = \"google\",\n OIDC = \"oidc\",\n OIDC_LOGOS = \"logos_oidc\",\n SCIM = \"scim\",\n AI = \"ai\",\n RECAPTCHA = \"recaptcha\",\n}\n\nexport type ConfigTypeToConfig<T extends ConfigType> =\n T extends ConfigType.SETTINGS\n ? SettingsConfig\n : T extends ConfigType.SMTP\n ? SMTPConfig\n : T extends ConfigType.GOOGLE\n ? GoogleConfig\n : T extends ConfigType.OIDC\n ? OIDCConfig\n : T extends ConfigType.OIDC_LOGOS\n ? OIDCLogosConfig\n : T extends ConfigType.SCIM\n ? SCIMConfig\n : T extends ConfigType.AI\n ? AIConfig\n : never\n", "import { Document } from \"../document\"\nimport { ContextUser } from \"../../sdk\"\n\n// SSO\n\nexport interface SSOProfileJson {\n email?: string\n picture?: string\n}\n\nexport interface OAuth2 {\n accessToken: string\n refreshToken?: string\n}\n\nexport enum SSOProviderType {\n OIDC = \"oidc\",\n GOOGLE = \"google\",\n}\n\nexport interface UserSSO {\n provider: string // the individual provider e.g. Okta, Auth0, Google\n providerType: SSOProviderType\n oauth2?: OAuth2\n profile?: {\n displayName?: string\n name?: {\n givenName?: string\n familyName?: string\n }\n }\n}\n\nexport type SSOUser = User & UserSSO\n\nexport type OIDCUser = User & {\n provider: string | undefined\n providerType: SSOProviderType | undefined\n oauth2?: OAuth2 | undefined\n profile?:\n | {\n displayName?: string\n name?: {\n givenName?: string\n familyName?: string\n }\n }\n | undefined\n thirdPartyProfile?: object | undefined\n}\n\nexport function isSSOUser(user: User | ContextUser): user is SSOUser {\n return !!(user as SSOUser).providerType\n}\n\n// USER\n\nexport interface UserIdentifier {\n userId: string\n email: string\n}\n\nexport interface UserBuilderInfo {\n builder?: {\n global?: boolean\n apps?: string[]\n creator?: boolean\n }\n}\n\nexport interface UserAdminInfo {\n admin?: {\n global: boolean\n }\n}\n\nexport interface UserRoleInfo {\n roles: UserRoles\n}\n\nexport interface User\n extends Document,\n UserBuilderInfo,\n UserAdminInfo,\n UserRoleInfo {\n tenantId: string\n email: string\n userId?: string\n firstName?: string\n lastName?: string\n forceResetPassword?: boolean\n roles: UserRoles\n password?: string\n status?: UserStatus\n createdAt?: number // override the default createdAt behaviour - users sdk historically set this to Date.now()\n userGroups?: string[]\n freeTrialConfirmedAt?: string\n scimInfo?: { isSync: true } & Record<string, any>\n appFavourites?: string[]\n ssoId?: string\n appSort?: string\n budibaseAccess?: boolean\n accountPortalAccess?: boolean\n onboardedAt?: string // deprecated and no longer saved\n tours?: Record<string, Date> // deprecated and no longer saved\n}\n\nexport type StrippedUser = Pick<User, \"_id\" | \"tenantId\" | \"email\" | \"userId\">\n\nexport interface UserBindings extends Document {\n firstName?: string\n lastName?: string\n email?: string\n status?: string\n roleId?: string | null\n globalId?: string\n userId?: string\n oauth2?: OAuth2\n provider?: string\n providerType?: SSOProviderType\n}\n\nexport enum UserStatus {\n ACTIVE = \"active\",\n INACTIVE = \"inactive\",\n}\n\n// specifies a map of app ID to role ID\nexport type UserRoles = Record<string, string>\n\n// UTILITY TYPES\n\nexport interface BuilderUser extends User {\n builder: {\n global?: boolean\n apps?: string[]\n }\n}\n\nexport interface AdminUser extends User {\n admin: {\n global: boolean\n }\n builder: {\n global: boolean\n }\n}\n\nexport interface AdminOnlyUser extends User {\n admin: {\n global: boolean\n }\n}\n\nexport function isUser(user: object): user is User {\n return !!(user as User).roles\n}\n", "import { Document } from \"../document\"\n\nexport enum PluginType {\n DATASOURCE = \"datasource\",\n COMPONENT = \"component\",\n AUTOMATION = \"automation\",\n}\n\nexport enum PluginSource {\n NPM = \"NPM\",\n GITHUB = \"Github\",\n URL = \"URL\",\n FILE = \"File Upload\",\n}\nexport interface KoaFile {\n path: string | null\n name: string | null\n}\n\nexport interface Plugin extends Document {\n description: string\n name: string\n version: string\n source: PluginSource\n package: { [key: string]: any }\n hash: string\n schema: PluginSchema\n iconFileName?: string\n // Populated on read\n jsUrl?: string\n // Populated on read\n iconUrl?: string\n}\n\nexport const PLUGIN_TYPE_ARR = Object.values(PluginType)\n\nexport interface PluginSchema {\n type: PluginType\n [key: string]: any\n}\n\ninterface Package {\n name: string\n version: string\n description: string\n}\n\nexport interface PluginMetadata {\n schema: PluginSchema\n package: Package\n}\n\nexport interface PluginUpload {\n metadata: PluginMetadata\n directory: string\n}\n", "import { MonthlyQuotaName, StaticQuotaName } from \"../../sdk\"\n\nexport enum BreakdownQuotaName {\n ROW_QUERIES = \"rowQueries\",\n DATASOURCE_QUERIES = \"datasourceQueries\",\n AUTOMATIONS = \"automations\",\n}\n\nexport const APP_QUOTA_NAMES = [\n StaticQuotaName.ROWS,\n MonthlyQuotaName.QUERIES,\n MonthlyQuotaName.AUTOMATIONS,\n]\n\nexport const BREAKDOWN_QUOTA_NAMES = [\n MonthlyQuotaName.QUERIES,\n MonthlyQuotaName.AUTOMATIONS,\n]\n\nexport interface UsageBreakdown {\n parent: MonthlyQuotaName\n values: {\n [key: string]: number\n }\n}\n\nexport type QuotaTriggers = {\n [key: string]: string | undefined\n}\n\nexport interface StaticUsage {\n [StaticQuotaName.APPS]: number\n [StaticQuotaName.PLUGINS]: number\n [StaticQuotaName.USERS]: number\n [StaticQuotaName.CREATORS]: number\n [StaticQuotaName.USER_GROUPS]: number\n [StaticQuotaName.ROWS]: number\n [StaticQuotaName.AI_CUSTOM_CONFIGS]: number\n triggers: {\n [key in StaticQuotaName]?: QuotaTriggers\n }\n}\n\nexport interface MonthlyUsage {\n [MonthlyQuotaName.QUERIES]: number\n [MonthlyQuotaName.AUTOMATIONS]: number\n [MonthlyQuotaName.BUDIBASE_AI_CREDITS]: number\n [MonthlyQuotaName.ACTIONS]: number\n triggers: {\n [key in MonthlyQuotaName]?: QuotaTriggers\n }\n breakdown?: {\n [key in BreakdownQuotaName]?: UsageBreakdown\n }\n}\n\nexport interface BaseQuotaUsage {\n usageQuota: StaticUsage\n monthly: {\n [key: string]: MonthlyUsage\n }\n}\n\nexport interface QuotaUsage extends BaseQuotaUsage {\n _id: string\n _rev?: string\n quotaReset: string\n apps?: {\n [key: string]: BaseQuotaUsage\n }\n}\n\nexport type SetUsageValues = {\n total: number\n app?: number\n breakdown?: number\n triggers?: QuotaTriggers\n}\n\nexport type UsageValues = {\n total: number\n app?: number\n breakdown?: number\n}\n", "import { Document } from \"../document\"\n\nexport enum ScheduleType {\n APP_BACKUP = \"app_backup\",\n}\n\nexport enum ScheduleRepeatPeriod {\n DAILY = \"daily\",\n WEEKLY = \"weekly\",\n MONTHLY = \"monthly\",\n}\n\nexport interface Schedule extends Document {\n type: ScheduleType\n name: string\n startDate: string\n repeat: ScheduleRepeatPeriod\n metadata: ScheduleMetadata\n}\n\nexport type ScheduleMetadata = AppBackupScheduleMetadata\n\nexport const isAppBackupMetadata = (\n type: ScheduleType,\n metadata: ScheduleMetadata\n): metadata is AppBackupScheduleMetadata => {\n return type === ScheduleType.APP_BACKUP\n}\n\nexport interface AppBackupScheduleMetadata {\n apps: string[]\n}\n", "import { Document } from \"../document\"\nimport { Event } from \"../../sdk\"\n\nexport const AuditLogSystemUser = \"SYSTEM\"\nexport const AUDIT_LOG_TYPE = \"auditLog\"\n\nexport type FallbackInfo = {\n appName?: string\n email?: string\n}\n\nexport interface AuditLogDoc extends Document {\n appId?: string\n event: Event\n userId: string\n timestamp: string\n metadata: any\n name: string\n type?: \"auditLog\"\n fallback?: FallbackInfo\n}\n", "export enum PingSource {\n BUILDER = \"builder\",\n APP = \"app\",\n}\n\nexport interface AnalyticsEnabledResponse {\n enabled: boolean\n}\n\nexport interface AnalyticsPingRequest {\n source: PingSource\n timezone: string\n embedded?: boolean\n}\nexport interface AnalyticsPingResponse {\n message: string\n source?: PingSource\n}\n", "export interface APIError {\n message: string\n status: number\n error?: any\n validationErrors?: any\n}\n\nexport enum ErrorCode {\n USAGE_LIMIT_EXCEEDED = \"usage_limit_exceeded\",\n FEATURE_DISABLED = \"feature_disabled\",\n INVALID_API_KEY = \"invalid_api_key\",\n HTTP = \"http\",\n}\n", "import { AutomationJob } from \"../../../sdk/automations\"\nimport {\n Automation,\n AutomationActionStepId,\n AutomationLogPage,\n AutomationResults,\n AutomationStatus,\n AutomationStepDefinition,\n AutomationTriggerDefinition,\n AutomationTriggerStepId,\n DidNotTriggerResponse,\n Row,\n} from \"../../../documents\"\nimport { DocumentDestroyResponse } from \"@budibase/nano\"\n\nexport type GetAutomationTriggerDefinitionsResponse = Record<\n keyof typeof AutomationTriggerStepId,\n AutomationTriggerDefinition\n>\n\nexport type GetAutomationActionDefinitionsResponse = Record<\n keyof typeof AutomationActionStepId,\n AutomationStepDefinition\n>\n\nexport interface GetAutomationStepDefinitionsResponse {\n trigger: GetAutomationTriggerDefinitionsResponse\n action: GetAutomationActionDefinitionsResponse\n}\n\nexport interface DeleteAutomationResponse extends DocumentDestroyResponse {}\n\nexport interface FetchAutomationResponse {\n automations: Automation[]\n}\n\nexport interface FindAutomationResponse extends Automation {}\n\nexport interface UpdateAutomationRequest extends Automation {}\nexport interface UpdateAutomationResponse {\n message: string\n automation: Automation\n}\n\nexport interface CreateAutomationRequest extends Automation {}\nexport interface CreateAutomationResponse {\n message: string\n automation: Automation\n}\n\nexport interface SearchAutomationLogsRequest {\n startDate?: string\n status?: AutomationStatus\n automationId?: string\n page?: string\n}\nexport interface SearchAutomationLogsResponse extends AutomationLogPage {}\n\nexport interface ClearAutomationLogRequest {\n automationId: string\n appId: string\n}\nexport interface ClearAutomationLogResponse {\n message: string\n}\n\nexport interface TriggerAutomationRequest {\n fields?: Record<string, any>\n timestamp?: number\n // time in seconds\n timeout: number\n}\nexport type TriggerAutomationResponse = Record<string, any> | undefined\n\nexport interface TestAutomationRequest {\n id?: string\n revision?: string\n timeout?: number\n fields?: Record<string, any>\n row?: Row\n oldRow?: Row\n}\n\nexport function isDidNotTriggerResponse(\n response: TestAutomationResponse\n): response is DidNotTriggerResponse {\n return !!(\"message\" in response && response.message)\n}\n\nexport function isAutomationResults(\n response: TestAutomationResponse\n): response is AutomationResults {\n return !!(\n \"steps\" in response &&\n response.steps &&\n \"trigger\" in response &&\n response.trigger\n )\n}\n\nexport type TestAutomationResponse =\n | AutomationResults\n | DidNotTriggerResponse\n | AutomationJob\n", "import { DeploymentDoc, DeploymentStatus } from \"../../../documents\"\n\nexport interface PublishAppRequest {\n automationIds?: string[]\n workspaceAppIds?: string[]\n seedProductionTables?: boolean\n}\n\nexport interface PublishAppResponse extends DeploymentDoc {}\n\nexport enum PublishResourceState {\n PUBLISHED = \"published\",\n DISABLED = \"disabled\",\n}\n\nexport type PublishStatusResource = {\n published: boolean\n name: string\n publishedAt?: string\n unpublishedChanges?: boolean\n state: PublishResourceState\n}\n\nexport interface PublishStatusResponse {\n workspaceApps: Record<string, PublishStatusResource>\n automations: Record<string, PublishStatusResource>\n tables: Record<string, PublishStatusResource>\n}\n\nexport interface DeploymentProgressResponse {\n _id: string\n appId: string\n status?: DeploymentStatus\n updatedAt: number\n}\n\nexport type FetchDeploymentResponse = DeploymentProgressResponse[]\n", "export enum SortOrder {\n ASCENDING = \"ascending\",\n DESCENDING = \"descending\",\n}\n\nexport enum SortType {\n STRING = \"string\",\n NUMBER = \"number\",\n}\n\nexport interface BasicPaginationRequest {\n bookmark?: string\n}\n\nexport interface PaginationRequest extends BasicPaginationRequest {\n limit?: number\n sort?: {\n order: SortOrder\n column: string\n type: SortType\n }\n}\n\nexport interface PaginationResponse {\n bookmark: string | number | undefined\n hasNextPage?: boolean\n totalRows?: number\n}\n", "import {\n ArrayOperator,\n BasicOperator,\n EmptyFilterOption,\n InternalSearchFilterOperator,\n LogicalOperator,\n RangeOperator,\n SearchFilterKey,\n} from \"../../../../sdk\"\nimport { Row } from \"../../../../documents\"\nimport {\n PaginationResponse,\n SortOrder,\n SortType,\n} from \"../../../../api/web/pagination\"\nimport { z } from \"zod\"\n\nconst fieldKey = z\n .string()\n .refine(s => s !== InternalSearchFilterOperator.COMPLEX_ID_OPERATOR, {\n message: `Key '${InternalSearchFilterOperator.COMPLEX_ID_OPERATOR}' is not allowed`,\n })\n\nconst stringBasicFilter = z.record(fieldKey, z.string())\nconst basicFilter = z.record(fieldKey, z.any())\nconst arrayFilter = z.record(fieldKey, z.union([z.any().array(), z.string()]))\nconst logicFilter = z.lazy(() =>\n z.object({\n conditions: z.array(z.object(queryFilterValidation)),\n })\n)\n\nconst stringOrNumber = z.union([z.string(), z.number()])\n\nconst queryFilterValidation: Record<SearchFilterKey, z.ZodTypeAny> = {\n [BasicOperator.STRING]: stringBasicFilter.optional(),\n [BasicOperator.FUZZY]: stringBasicFilter.optional(),\n [RangeOperator.RANGE]: z\n .record(\n fieldKey,\n z.union([\n z.object({ high: stringOrNumber, low: stringOrNumber }),\n z.object({ high: stringOrNumber }),\n z.object({ low: stringOrNumber }),\n ])\n )\n .optional(),\n [BasicOperator.EQUAL]: basicFilter.optional(),\n [BasicOperator.NOT_EQUAL]: basicFilter.optional(),\n [BasicOperator.EMPTY]: basicFilter.optional(),\n [BasicOperator.NOT_EMPTY]: basicFilter.optional(),\n [ArrayOperator.ONE_OF]: arrayFilter.optional(),\n [ArrayOperator.CONTAINS]: arrayFilter.optional(),\n [ArrayOperator.NOT_CONTAINS]: arrayFilter.optional(),\n [ArrayOperator.CONTAINS_ANY]: arrayFilter.optional(),\n [LogicalOperator.AND]: logicFilter.optional(),\n [LogicalOperator.OR]: logicFilter.optional(),\n}\n\nconst searchRowRequest = z.object({\n query: z\n .object({\n allOr: z.boolean().optional(),\n onEmptyFilter: z.nativeEnum(EmptyFilterOption).optional(),\n ...queryFilterValidation,\n })\n .optional(),\n paginate: z.boolean().optional(),\n bookmark: z.union([z.string(), z.number()]).nullish(),\n limit: z.number().optional(),\n sort: z.string().nullish(),\n sortOrder: z.nativeEnum(SortOrder).optional(),\n sortType: z.nativeEnum(SortType).nullish(),\n version: z.string().optional(),\n disableEscaping: z.boolean().optional(),\n countRows: z.boolean().optional(),\n})\n\nexport const searchRowRequestValidator = searchRowRequest\n\nexport type SearchRowRequest = z.infer<typeof searchRowRequest>\nexport type SearchViewRowRequest = Pick<\n SearchRowRequest,\n | \"sort\"\n | \"sortOrder\"\n | \"sortType\"\n | \"limit\"\n | \"bookmark\"\n | \"paginate\"\n | \"query\"\n | \"countRows\"\n>\n\nexport interface SearchRowResponse {\n rows: Row[]\n}\n\nexport interface PaginatedSearchRowResponse\n extends SearchRowResponse,\n PaginationResponse {}\n", "export interface ResourceUsageRequest {\n workspaceAppIds?: string[]\n automationIds?: string[]\n}\n\nexport enum UsedByType {\n WORKSPACE = \"workspace\",\n AUTOMATION = \"automation\",\n}\n\nexport enum ResourceType {\n DATASOURCE = \"datasource\",\n TABLE = \"table\",\n ROW_ACTION = \"row_action\",\n QUERY = \"query\",\n AUTOMATION = \"automation\",\n}\n\nexport interface UsedResource {\n id: string\n name?: string\n type: ResourceType\n}\n\nexport interface ResourceUsageResponse {\n resources: UsedResource[]\n}\n", "import { DocumentDestroyResponse } from \"@budibase/nano\"\nimport { WorkspaceFavourite } from \"../../../documents\"\n\nexport enum WorkspaceResource {\n DATASOURCE = \"datasource\",\n QUERY = \"query\",\n TABLE = \"table\",\n AUTOMATION = \"automation\",\n WORKSPACE_APP = \"workspace_app\",\n VIEW = \"view\",\n}\n\nexport interface AddWorkspaceFavouriteRequest {\n resourceType: WorkspaceResource\n resourceId: string\n}\n\nexport interface AddWorkspaceFavouriteResponse {\n _id: string\n _rev: string\n resourceType: WorkspaceResource\n resourceId: string\n}\n\nexport interface WorkspaceFavouriteResponse {\n favourites: WorkspaceFavourite[]\n}\n\nexport interface DeleteWorkspaceFavouriteResponse\n extends DocumentDestroyResponse {}\n", "import { Event } from \"../../../sdk\"\nimport { PaginationResponse, BasicPaginationRequest } from \"../\"\nimport { User, App } from \"../../../\"\n\nexport interface AuditLogSearchParams {\n userIds?: string[]\n appIds?: string[]\n events?: Event[]\n startDate?: string\n endDate?: string\n fullSearch?: string\n bookmark?: string\n}\n\nexport interface DownloadAuditLogsRequest extends AuditLogSearchParams {}\n\nexport interface SearchAuditLogsRequest\n extends BasicPaginationRequest,\n AuditLogSearchParams {}\n\nexport enum AuditLogResourceStatus {\n DELETED = \"deleted\",\n}\n\nexport type DeletedResourceInfo = {\n _id: string\n status: AuditLogResourceStatus\n email?: string\n name?: string\n}\n\nexport interface AuditLogEnriched {\n app?: App | DeletedResourceInfo\n user: User | DeletedResourceInfo\n event: Event\n timestamp: string\n name: string\n metadata: any\n}\n\nexport interface SearchAuditLogsResponse extends PaginationResponse {\n data: AuditLogEnriched[]\n}\n\nexport interface DefinitionsAuditLogsResponse {\n events: Record<string, string>\n}\n", "export enum EventPublishType {\n ENVIRONMENT_VARIABLE_UPGRADE_PANEL_OPENED = \"environment_variable_upgrade_panel_opened\",\n}\n\nexport interface PostEventPublishRequest {\n type: EventPublishType\n}\nexport interface PostEventPublishResponse {\n message: string\n}\n", "import { EmailAttachment, EmailInvite } from \"../../../documents\"\nimport SMTPTransport from \"nodemailer/lib/smtp-transport\"\n\nexport enum EmailTemplatePurpose {\n CORE = \"core\",\n BASE = \"base\",\n PASSWORD_RECOVERY = \"password_recovery\",\n INVITATION = \"invitation\",\n WELCOME = \"welcome\",\n CUSTOM = \"custom\",\n}\n\nexport interface SendEmailRequest {\n email: string\n userId?: string\n purpose: EmailTemplatePurpose\n contents?: string\n from?: string\n subject: string\n cc?: string\n bcc?: string\n automation?: boolean\n invite?: EmailInvite\n attachments?: EmailAttachment[]\n}\nexport interface SendEmailResponse extends SMTPTransport.SentMessageInfo {\n message: string\n}\n", "export enum TemplateType {\n APP = \"app\",\n}\n\nexport interface TemplateMetadata {\n background: string\n icon: string\n category: string\n description: string\n name: string\n url: string\n type: TemplateType\n key: string\n image: string\n new: boolean\n}\n\nexport type FetchTemplateResponse = TemplateMetadata[]\n\nexport interface DownloadTemplateResponse {\n message: string\n}\n", "export enum ServiceType {\n WORKER = \"worker\",\n APPS = \"apps\",\n}\n\nexport enum MaintenanceType {\n SQS_MISSING = \"sqs_missing\",\n}\n", "export const enum EventType {\n ROW_SAVE = \"row:save\",\n ROW_UPDATE = \"row:update\",\n ROW_DELETE = \"row:delete\",\n TABLE_SAVE = \"table:save\",\n TABLE_UPDATED = \"table:updated\",\n TABLE_DELETE = \"table:delete\",\n}\n", "export interface EnrichedBinding {\n value?: string\n valueHTML?: string\n runtimeBinding: string\n readableBinding: string\n type?: null | string\n icon?: string\n category: string\n display?: { name: string; type: string; rank: unknown }\n fieldSchema?: {\n name: string\n tableId: string\n type: string\n subtype?: string\n prefixKeys?: string\n }\n}\n\nexport enum BindingMode {\n Text = \"Text\",\n JavaScript = \"JavaScript\",\n}\n\nexport type CaretPositionFn = () => { start: number; end: number }\n\nexport type InsertAtPositionFn = (_: {\n start: number\n end?: number\n value: string\n cursor?: { anchor: number }\n}) => void\n\nexport interface UIBinding {\n tableId?: string\n fieldSchema?: {\n name: string\n tableId: string\n type: string\n subtype?: string\n prefixKeys?: string\n }\n component?: string\n providerId: string\n readableBinding?: string\n runtimeBinding?: string\n}\n", "import { FieldType } from \"@budibase/types\"\n\nexport * from \"./codeEditor\"\nexport * from \"./errors\"\n\nexport interface CustomComponent {\n Component: any\n schema: {\n type: \"component\"\n metadata: Record<string, any>\n schema: ComponentDefinition\n }\n version: string\n}\n\nexport interface ComponentDefinition {\n component: string\n name: string\n friendlyName?: string\n hasChildren?: boolean\n settings?: ComponentSetting[]\n features?: Record<string, boolean>\n typeSupportPresets?: Record<string, any>\n legalDirectChildren: string[]\n requiredAncestors?: string[]\n illegalChildren: string[]\n icon?: string\n new?: boolean\n size?: {\n width: number\n height: number\n }\n context?: ComponentContext | ComponentContext[]\n actions?: (string | any)[]\n}\n\nexport type DependsOnComponentSetting =\n | string\n | {\n setting: string\n value: string\n }\n\nexport interface ComponentSetting {\n key: string\n type: string\n label?: string\n section?: string\n name?: string\n required?: boolean\n defaultValue?: any\n selectAllFields?: boolean\n resetOn?: string | string[]\n settings?: ComponentSetting[]\n nested?: boolean\n dependsOn?: DependsOnComponentSetting\n sectionDependsOn?: DependsOnComponentSetting\n contextAccess?: {\n global: boolean\n self: boolean\n }\n}\ninterface ComponentAction {\n type: string\n suffix?: string\n}\n\ninterface ComponentStaticContextValue {\n label: string\n key: string\n type: string // technically this is a long list of options but there are too many to enumerate\n}\n\nexport interface ComponentContext {\n type: ComponentContextType\n scope?: ComponentContextScopes\n actions?: ComponentAction[]\n suffix?: string\n values?: ComponentStaticContextValue[]\n}\n\nexport type ComponentContextType = \"action\" | \"static\" | \"schema\" | \"form\"\n\nexport const enum ComponentContextScopes {\n Local = \"local\",\n Global = \"global\",\n}\n\nexport type FilterConfig = {\n active: boolean\n field: string\n label?: string\n _id?: string\n columnType?: FieldType\n}\n", "// type purely to capture structures that the type is unknown, but maybe known later\nexport type UIObject = Record<string, any>\n\nexport const enum DropPosition {\n ABOVE = \"above\",\n BELOW = \"below\",\n INSIDE = \"inside\",\n}\n", "import {\n GetAutomationActionDefinitionsResponse,\n GetAutomationTriggerDefinitionsResponse,\n PublishStatusResource,\n} from \"../../api\"\nimport { Automation } from \"../../documents\"\n\nexport interface BlockPath {\n stepIdx: number\n branchIdx: number\n branchStepId: string\n id: string\n}\n\nexport interface BlockRef {\n id: string\n looped?: string\n pathTo: BlockPath[]\n terminating?: boolean\n}\n\nexport enum BlockDefinitionTypes {\n TRIGGER = \"TRIGGER\",\n CREATABLE_TRIGGER = \"CREATABLE_TRIGGER\",\n ACTION = \"ACTION\",\n}\n\nexport interface BlockDefinitions {\n [BlockDefinitionTypes.TRIGGER]: Partial<GetAutomationTriggerDefinitionsResponse>\n [BlockDefinitionTypes.CREATABLE_TRIGGER]: Partial<GetAutomationTriggerDefinitionsResponse>\n [BlockDefinitionTypes.ACTION]: Partial<GetAutomationActionDefinitionsResponse>\n}\n\nexport interface UIAutomation extends Automation {\n publishStatus: PublishStatusResource\n}\n", "export enum DataEnvironmentMode {\n DEVELOPMENT = \"development\",\n PRODUCTION = \"production\",\n}\n"],
5
5
  "mappings": "ioBAAA,IAAAA,GAAAC,EAAA,CAAAC,GAAAC,KAAA,cACA,IAAIC,GAAa,OAAO,QAAU,UAAY,QAAU,OAAO,SAAW,QAAU,OAEpFD,GAAO,QAAUC,KCHjB,IAAAC,GAAAC,EAAA,CAAAC,GAAAC,KAAA,kBAAIC,GAAa,KAGbC,GAAW,OAAO,MAAQ,UAAY,MAAQ,KAAK,SAAW,QAAU,KAGxEC,GAAOF,IAAcC,IAAY,SAAS,aAAa,EAAE,EAE7DF,GAAO,QAAUG,KCRjB,IAAAC,EAAAC,EAAA,CAAAC,GAAAC,KAAA,kBAAIC,GAAO,KAGPC,GAASD,GAAK,OAElBD,GAAO,QAAUE,KCLjB,IAAAC,GAAAC,EAAA,CAAAC,GAAAC,KAAA,kBAAIC,GAAS,IAGTC,GAAc,OAAO,UAGrBC,GAAiBD,GAAY,eAO7BE,GAAuBF,GAAY,SAGnCG,EAAiBJ,GAASA,GAAO,YAAc,OASnD,SAASK,GAA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pBL,IAAKC,QACVA,EAAA,0CAA4C,4CADlCA,QAAA,ICGL,IAAKC,QACVA,EAAA,KAAO,OACPA,EAAA,KAAO,OACPA,EAAA,kBAAoB,oBACpBA,EAAA,WAAa,aACbA,EAAA,QAAU,UACVA,EAAA,OAAS,SANCA,QAAA,ICHL,IAAKC,QACVA,EAAA,IAAM,MADIA,QAAA,ICAL,IAAKC,QACVA,EAAA,OAAS,SACTA,EAAA,KAAO,OAFGA,QAAA,IAKAC,QACVA,EAAA,YAAc,cADJA,QAAA,ICLL,IAAWC,QAChBA,EAAA,SAAW,WACXA,EAAA,WAAa,aACbA,EAAA,WAAa,aACbA,EAAA,WAAa,aACbA,EAAA,cAAgB,gBAChBA,EAAA,aAAe,eANCA,QAAA,ICkBX,IAAKC,QACVA,EAAA,KAAO,OACPA,EAAA,WAAa,aAFHA,QAAA,ICiEL,IAAWC,QAChBA,EAAA,MAAQ,QACRA,EAAA,OAAS,SAFOA,QAAA,IChFX,IAAWC,QAChBA,EAAA,MAAQ,QACRA,EAAA,MAAQ,QACRA,EAAA,OAAS,SAHOA,QAAA,ICkBX,IAAKC,QACVA,EAAA,QAAU,UACVA,EAAA,kBAAoB,oBACpBA,EAAA,OAAS,SAHCA,QAAA,ICrBL,IAAKC,QACVA,EAAA,YAAc,cACdA,EAAA,WAAa,aAFHA,QAAA",
6
6
  "names": ["require_freeGlobal", "__commonJSMin", "exports", "module", "freeGlobal", "require_root", "__commonJSMin", "exports", "module", "freeGlobal", "freeSelf", "root", "require_Symbol", "__commonJSMin", "exports", "module", "root", "Symbol", "require_getRawTag", "__commonJSMin", "exports", "module", "Symbol", "objectProto", "hasOwnProperty", "nativeObjectToString", "symToStringTag", "getRawTag", "value", "isOwn", "tag", "unmasked", "result", "require_objectToString", "__commonJSMin", "exports", "module", "objectProto", "nativeObjectToString", "objectToString", "value", "require_baseGetTag", "__commonJSMin", "exports", "module", "Symbol", "getRawTag", "objectToString", "nullTag", "undefinedTag", "symToStringTag", "baseGetTag", "value", "require_overArg", "__commonJSMin", "exports", "module", "overArg", "func", "transform", "arg", "require_getPrototype", "__commonJSMin", "exports", "module", "overArg", "getPrototype", "require_isObjectLike", "__commonJSMin", "exports", "module", "isObjectLike", "value", "require_isPlainObject", "__commonJSMin", "exports", "module", "baseGetTag", "getPrototype", "isObjectLike", "objectTag", "funcProto", "objectProto", "funcToString", "hasOwnProperty", "objectCtorString", "isPlainObject", "value", "proto", "Ctor", "src_exports", "__export", "AIOperationEnum", "APP_QUOTA_NAMES", "AUDIT_LOG_TYPE", "AccountSSOProvider", "AccountSSOProviderType", "AnalyticsEvent", "AppBackupStatus", "AppBackupTrigger", "AppBackupType", "AppEnvironment", "ArrayOperator", "AsyncEvents", "AttachmentSubType", "AuditLogResourceStatus", "AuditLogSystemUser", "AuditedEventFriendlyName", "AuthType", "AutoFieldSubType", "AutoReason", "AutomationActionStepId", "AutomationCustomIOType", "AutomationEventType", "AutomationFeature", "AutomationIOType", "AutomationStatus", "AutomationStepIdArray", "AutomationStepStatus", "AutomationStepType", "AutomationStoppedReason", "AutomationTriggerStepId", "BBReferenceFieldSubType", "BREAKDOWN_QUOTA_NAMES", "BasicOperator", "BindingMode", "BlockDefinitionTypes", "BodyType", "BreakdownQuotaName", "BuiltinPermissionID", "CalculationType", "CommandWord", "ComponentContextScopes", "ConfigType", "ConstantQuotaName", "ContentType", "DSPlusOperation", "DataEnvironmentMode", "DatasourceFeature", "DatasourceFieldType", "DeploymentStatus", "DocumentSourceType", "DocumentType", "DocumentTypesToImport", "DropPosition", "EXTERNAL_ROW_REV", "EmailTemplatePurpose", "EmptyFilterOption", "ErrorCode", "Event", "EventPublishType", "EventType", "Feature", "FeatureFlag", "FeatureFlagDefaults", "FieldType", "FilterCondition", "FilterType", "FormulaType", "GroupByTypes", "GroupType", "Hosting", "HttpMethod", "INTERNAL_TABLE_SOURCE_ID", "IdentityType", "ImageContentTypes", "IncludeRelationship", "InitType", "InternalSearchFilterOperator", "InternalTable", "JsonFieldSubType", "JsonTypes", "LockName", "LockType", "LogicalOperator", "LoginMethod", "LoopStepType", "MaintenanceType", "MetadataType", "Model", "MonthlyQuotaName", "NumericTypes", "OAuth2CredentialsMethod", "OAuth2GrantType", "Operation", "OperationFieldTypeEnum", "PASSWORD_REPLACEMENT", "PKCEMethod", "PLUGIN_TYPE_ARR", "PermissionLevel", "PermissionSource", "PermissionType", "PingSource", "PlanModel", "PlanType", "PluginSource", "PluginType", "PrettyContentTypes", "PriceDuration", "PublishResourceState", "QueryType", "QuotaType", "QuotaUsageType", "RangeOperator", "RelationshipType", "RequestType", "ResourceType", "RestAuthType", "RowExportFormat", "RowOperations", "SEPARATOR", "SQLiteType", "SSOProviderType", "ScheduleRepeatPeriod", "ScheduleType", "ScreenVariant", "SearchIndex", "ServiceType", "SortOption", "SortOrder", "SortType", "SourceName", "SourceType", "SqlClient", "StaticQuotaName", "StringFieldSubType", "SummariseLength", "SupportedFileType", "TableSourceType", "TemplateType", "TenantResolutionStrategy", "Theme", "UILogicalOperator", "UNICODE_MAX", "UsedByType", "UserGroupSyncEvents", "UserStatus", "ViewCalculation", "ViewV2Type", "VirtualDocumentType", "WebhookActionType", "WorkspaceResource", "WorkspaceResourceEvents", "canGroupBy", "isAIConfig", "isActionStep", "isAppBackupMetadata", "isAppTrigger", "isArraySearchOperator", "isAutomationResults", "isBasicSearchOperator", "isBranchStep", "isCloudAccount", "isConfig", "isConstantQuota", "isCreatePasswordAccount", "isCronTrigger", "isDidNotTriggerResponse", "isDocument", "isFilterStep", "isGoogleConfig", "isLogicalFilter", "isLogicalSearchOperator", "isLoopStep", "isManyToMany", "isManyToOne", "isMonthlyQuota", "isNumeric", "isNumericStaticFormula", "isOIDCConfig", "isOneToMany", "isPasswordAccount", "isRangeSearchOperator", "isRecaptchaConfig", "isRelationshipField", "isRowActionTrigger", "isRowSaveTrigger", "isRowUpdateTrigger", "isSCIMConfig", "isSMTPConfig", "isSSOAccount", "isSSOUser", "isSelfHostAccount", "isSettingsConfig", "isStaticQuota", "isTrigger", "isUser", "isVerifiableSSOProvider", "isWebhookTrigger", "prefixed", "searchRowRequestValidator", "__toCommonJS", "AIOperationEnum", "OperationFieldTypeEnum", "Hosting", "Event", "UserGroupSyncEvents", "WorkspaceResourceEvents", "AsyncEvents", "AuditedEventFriendlyName", "GroupType", "IdentityType", "PlanType", "PriceDuration", "PlanModel", "QuotaUsageType", "QuotaType", "StaticQuotaName", "MonthlyQuotaName", "ConstantQuotaName", "isStaticQuota", "quotaType", "usageType", "name", "isMonthlyQuota", "isConstantQuota", "Feature", "PASSWORD_REPLACEMENT", "Operation", "RowOperations", "QueryType", "DatasourceFieldType", "SourceName", "IncludeRelationship", "FilterType", "DatasourceFeature", "DSPlusOperation", "import_isPlainObject", "BasicOperator", "ArrayOperator", "RangeOperator", "LogicalOperator", "isLogicalSearchOperator", "value", "isBasicSearchOperator", "isArraySearchOperator", "isRangeSearchOperator", "InternalSearchFilterOperator", "isLogicalFilter", "filter", "isPlainObject", "EmptyFilterOption", "UILogicalOperator", "SqlClient", "LoginMethod", "LockType", "LockName", "SearchIndex", "SortOption", "isDocument", "doc", "TenantResolutionStrategy", "FeatureFlag", "FeatureFlagDefaults", "AppEnvironment", "CommandWord", "InitType", "AnalyticsEvent", "PermissionLevel", "BuiltinPermissionID", "PermissionType", "PermissionSource", "RowExportFormat", "isCreatePasswordAccount", "account", "isPasswordAccount", "isCloudAccount", "isSelfHostAccount", "isSSOAccount", "AccountSSOProviderType", "AccountSSOProvider", "verifiableSSOProviders", "isVerifiableSSOProvider", "provider", "AuthType", "SEPARATOR", "UNICODE_MAX", "prefixed", "type", "DocumentType", "DocumentTypesToImport", "InternalTable", "VirtualDocumentType", "AutomationIOType", "AutomationCustomIOType", "AutomationTriggerStepId", "AutomationStepType", "AutomationActionStepId", "AutomationStepIdArray", "AutomationFeature", "AutomationStepStatus", "AutomationStatus", "AutomationStoppedReason", "AutomationEventType", "LoopStepType", "ContentType", "PrettyContentTypes", "DocumentSourceType", "SupportedFileType", "ImageContentTypes", "isBranchStep", "step", "isTrigger", "isRowUpdateTrigger", "isRowSaveTrigger", "isAppTrigger", "isWebhookTrigger", "isRowActionTrigger", "isFilterStep", "isLoopStep", "isActionStep", "isCronTrigger", "trigger", "FilterCondition", "Model", "SummariseLength", "RequestType", "AppBackupType", "AppBackupStatus", "AppBackupTrigger", "RestAuthType", "SourceType", "DeploymentStatus", "MetadataType", "OAuth2CredentialsMethod", "OAuth2GrantType", "BodyType", "HttpMethod", "INTERNAL_TABLE_SOURCE_ID", "TableSourceType", "RelationshipType", "AutoReason", "AutoFieldSubType", "JsonFieldSubType", "FormulaType", "BBReferenceFieldSubType", "AttachmentSubType", "StringFieldSubType", "isRelationshipField", "field", "isManyToMany", "isOneToMany", "isManyToOne", "EXTERNAL_ROW_REV", "FieldType", "JsonTypes", "NumericTypes", "isNumeric", "type", "isNumericStaticFormula", "schema", "GroupByTypes", "canGroupBy", "ScreenVariant", "SQLiteType", "Theme", "CalculationType", "ViewV2Type", "ViewCalculation", "WebhookActionType", "isConfig", "config", "isSettingsConfig", "isSMTPConfig", "isGoogleConfig", "isOIDCConfig", "isSCIMConfig", "isAIConfig", "isRecaptchaConfig", "PKCEMethod", "ConfigType", "SSOProviderType", "isSSOUser", "user", "UserStatus", "isUser", "PluginType", "PluginSource", "PLUGIN_TYPE_ARR", "BreakdownQuotaName", "APP_QUOTA_NAMES", "BREAKDOWN_QUOTA_NAMES", "ScheduleType", "ScheduleRepeatPeriod", "isAppBackupMetadata", "type", "metadata", "AuditLogSystemUser", "AUDIT_LOG_TYPE", "PingSource", "ErrorCode", "isDidNotTriggerResponse", "response", "isAutomationResults", "PublishResourceState", "SortOrder", "SortType", "import_zod", "fieldKey", "s", "stringBasicFilter", "basicFilter", "arrayFilter", "logicFilter", "queryFilterValidation", "stringOrNumber", "searchRowRequest", "EmptyFilterOption", "SortOrder", "SortType", "searchRowRequestValidator", "UsedByType", "ResourceType", "WorkspaceResource", "AuditLogResourceStatus", "EventPublishType", "EmailTemplatePurpose", "TemplateType", "ServiceType", "MaintenanceType", "EventType", "BindingMode", "ComponentContextScopes", "DropPosition", "BlockDefinitionTypes", "DataEnvironmentMode"]
7
7
  }
@@ -9,6 +9,7 @@ export interface EnrichedBinding {
9
9
  display?: {
10
10
  name: string;
11
11
  type: string;
12
+ rank: unknown;
12
13
  };
13
14
  fieldSchema?: {
14
15
  name: string;
@@ -11,13 +11,18 @@ interface HBSEditorMode {
11
11
  interface HTMLEditorMode {
12
12
  name: "text/html";
13
13
  }
14
- export type EditorMode = JSEditorMode | HBSEditorMode | HTMLEditorMode;
14
+ interface PureHTMLEditorMode {
15
+ name: "html";
16
+ }
17
+ export type EditorMode = JSEditorMode | HBSEditorMode | HTMLEditorMode | PureHTMLEditorMode;
15
18
  type EditorModeMapBase = (JSEditorMode & {
16
19
  key: "JS";
17
20
  }) | (HBSEditorMode & {
18
21
  key: "Handlebars";
19
22
  }) | (HTMLEditorMode & {
20
23
  key: "Text";
24
+ }) | (PureHTMLEditorMode & {
25
+ key: "HTML";
21
26
  });
22
27
  export type EditorModesMap = {
23
28
  [M in EditorModeMapBase as M["key"]]: Omit<M, "key">;
@@ -2,9 +2,14 @@ import { FieldType, SearchFilter } from "@budibase/types";
2
2
  export interface UICondition {
3
3
  column: string;
4
4
  type: FieldType;
5
- referenceValue: any;
5
+ referenceValue: unknown;
6
6
  operator: SearchFilter["operator"];
7
7
  metadataKey: string;
8
8
  metadataValue: string;
9
9
  target: string;
10
+ buttonIndex?: number;
11
+ newValue?: unknown;
12
+ action?: string;
13
+ setting?: string;
14
+ settingValue?: unknown;
10
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@budibase/types",
3
- "version": "3.18.1",
3
+ "version": "3.18.2",
4
4
  "description": "Budibase types",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -25,5 +25,5 @@
25
25
  "dependencies": {
26
26
  "scim-patch": "^0.8.1"
27
27
  },
28
- "gitHead": "cac7191488dabe0144f8f427686875c91cc7a548"
28
+ "gitHead": "43d59f5579dd910575d8aebefb40fae25570c05d"
29
29
  }