Merge branch 'master' into execute-script-v2
This commit is contained in:
commit
10263c9857
|
@ -424,7 +424,7 @@ export async function retrieveDirectory(bucketName: string, path: string) {
|
||||||
stream.pipe(writeStream)
|
stream.pipe(writeStream)
|
||||||
writePromises.push(
|
writePromises.push(
|
||||||
new Promise((resolve, reject) => {
|
new Promise((resolve, reject) => {
|
||||||
stream.on("finish", resolve)
|
writeStream.on("finish", resolve)
|
||||||
stream.on("error", reject)
|
stream.on("error", reject)
|
||||||
writeStream.on("error", reject)
|
writeStream.on("error", reject)
|
||||||
})
|
})
|
||||||
|
|
|
@ -21,20 +21,7 @@ const baseConfig: Config.InitialProjectOptions = {
|
||||||
transform: {
|
transform: {
|
||||||
"^.+\\.ts?$": "@swc/jest",
|
"^.+\\.ts?$": "@swc/jest",
|
||||||
"^.+\\.js?$": "@swc/jest",
|
"^.+\\.js?$": "@swc/jest",
|
||||||
"^.+\\.svelte$": [
|
"^.+\\.svelte?$": "<rootDir>/scripts/svelteTransformer.js",
|
||||||
"jest-chain-transform", // https://github.com/svelteness/svelte-jester/issues/166
|
|
||||||
{
|
|
||||||
transformers: [
|
|
||||||
[
|
|
||||||
"svelte-jester",
|
|
||||||
{
|
|
||||||
preprocess: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
"@swc/jest",
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
transformIgnorePatterns: ["/node_modules/(?!svelte/).*"],
|
transformIgnorePatterns: ["/node_modules/(?!svelte/).*"],
|
||||||
moduleNameMapper: {
|
moduleNameMapper: {
|
||||||
|
|
|
@ -139,7 +139,6 @@
|
||||||
"@babel/core": "^7.22.5",
|
"@babel/core": "^7.22.5",
|
||||||
"@babel/preset-env": "7.16.11",
|
"@babel/preset-env": "7.16.11",
|
||||||
"@jest/types": "^29.6.3",
|
"@jest/types": "^29.6.3",
|
||||||
"@sveltejs/vite-plugin-svelte": "1.4.0",
|
|
||||||
"@swc/core": "1.3.71",
|
"@swc/core": "1.3.71",
|
||||||
"@swc/jest": "0.2.27",
|
"@swc/jest": "0.2.27",
|
||||||
"@types/archiver": "6.0.2",
|
"@types/archiver": "6.0.2",
|
||||||
|
@ -165,7 +164,6 @@
|
||||||
"docker-compose": "0.23.17",
|
"docker-compose": "0.23.17",
|
||||||
"ioredis-mock": "8.9.0",
|
"ioredis-mock": "8.9.0",
|
||||||
"jest": "29.7.0",
|
"jest": "29.7.0",
|
||||||
"jest-chain-transform": "^0.0.8",
|
|
||||||
"jest-extended": "^4.0.2",
|
"jest-extended": "^4.0.2",
|
||||||
"jest-openapi": "0.14.2",
|
"jest-openapi": "0.14.2",
|
||||||
"nock": "13.5.4",
|
"nock": "13.5.4",
|
||||||
|
|
|
@ -46,6 +46,7 @@ async function init() {
|
||||||
HTTP_LOGGING: "0",
|
HTTP_LOGGING: "0",
|
||||||
VERSION: "0.0.0+local",
|
VERSION: "0.0.0+local",
|
||||||
PASSWORD_MIN_LENGTH: "1",
|
PASSWORD_MIN_LENGTH: "1",
|
||||||
|
OPENAI_API_KEY: "sk-abcdefghijklmnopqrstuvwxyz1234567890abcd",
|
||||||
}
|
}
|
||||||
|
|
||||||
config = { ...config, ...existingConfig }
|
config = { ...config, ...existingConfig }
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
const { compile } = require("svelte/compiler")
|
||||||
|
const { transformSync } = require("@babel/core")
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
process(sourceText) {
|
||||||
|
const { js } = compile(sourceText, { css: "injected", generate: "ssr" })
|
||||||
|
const { code } = transformSync(js.code, { babelrc: true })
|
||||||
|
|
||||||
|
return { code: code }
|
||||||
|
},
|
||||||
|
}
|
|
@ -1,8 +1,9 @@
|
||||||
<script lang="ts">
|
<script>
|
||||||
import ClientAppSkeleton from "@budibase/frontend-core/src/components/ClientAppSkeleton.svelte"
|
import ClientAppSkeleton from "@budibase/frontend-core/src/components/ClientAppSkeleton.svelte"
|
||||||
import type { BudibaseAppProps } from "@budibase/types"
|
|
||||||
|
|
||||||
export let props: BudibaseAppProps
|
/** @type {BudibaseAppProps} this receives all the props in one structure, following
|
||||||
|
* the type from @budibase/types */
|
||||||
|
export let props
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:head>
|
<svelte:head>
|
||||||
|
|
|
@ -1,100 +0,0 @@
|
||||||
jest.mock("../../threads/automation")
|
|
||||||
jest.mock("../../utilities/redis", () => ({
|
|
||||||
init: jest.fn(),
|
|
||||||
checkTestFlag: () => {
|
|
||||||
return false
|
|
||||||
},
|
|
||||||
shutdown: jest.fn(),
|
|
||||||
}))
|
|
||||||
|
|
||||||
jest.spyOn(global.console, "error")
|
|
||||||
|
|
||||||
import "../../environment"
|
|
||||||
import * as automation from "../index"
|
|
||||||
import * as thread from "../../threads/automation"
|
|
||||||
import * as triggers from "../triggers"
|
|
||||||
import { basicAutomation } from "../../tests/utilities/structures"
|
|
||||||
import { wait } from "../../utilities"
|
|
||||||
import { makePartial } from "../../tests/utilities"
|
|
||||||
import { cleanInputValues } from "../automationUtils"
|
|
||||||
import { Automation } from "@budibase/types"
|
|
||||||
import TestConfiguration from "../../tests/utilities/TestConfiguration"
|
|
||||||
|
|
||||||
describe("Run through some parts of the automations system", () => {
|
|
||||||
const config = new TestConfiguration()
|
|
||||||
|
|
||||||
beforeAll(async () => {
|
|
||||||
await automation.init()
|
|
||||||
await config.init()
|
|
||||||
})
|
|
||||||
|
|
||||||
afterAll(async () => {
|
|
||||||
await automation.shutdown()
|
|
||||||
config.end()
|
|
||||||
})
|
|
||||||
|
|
||||||
it("should be able to init in builder", async () => {
|
|
||||||
const automation: Automation = {
|
|
||||||
...basicAutomation(),
|
|
||||||
appId: config.appId!,
|
|
||||||
}
|
|
||||||
const fields: any = { a: 1, appId: config.appId }
|
|
||||||
await triggers.externalTrigger(automation, fields)
|
|
||||||
await wait(100)
|
|
||||||
expect(thread.execute).toHaveBeenCalled()
|
|
||||||
})
|
|
||||||
|
|
||||||
it("should check coercion", async () => {
|
|
||||||
const table = await config.createTable()
|
|
||||||
const automation: any = basicAutomation()
|
|
||||||
automation.definition.trigger.inputs.tableId = table._id
|
|
||||||
automation.definition.trigger.stepId = "APP"
|
|
||||||
automation.definition.trigger.inputs.fields = { a: "number" }
|
|
||||||
const fields: any = {
|
|
||||||
appId: config.getAppId(),
|
|
||||||
fields: {
|
|
||||||
a: "1",
|
|
||||||
},
|
|
||||||
}
|
|
||||||
await triggers.externalTrigger(automation, fields)
|
|
||||||
await wait(100)
|
|
||||||
expect(thread.execute).toHaveBeenCalledWith(
|
|
||||||
makePartial({
|
|
||||||
data: {
|
|
||||||
event: {
|
|
||||||
fields: {
|
|
||||||
a: 1,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
expect.any(Function)
|
|
||||||
)
|
|
||||||
})
|
|
||||||
|
|
||||||
it("should be able to clean inputs with the utilities", () => {
|
|
||||||
// can't clean without a schema
|
|
||||||
let output = cleanInputValues({ a: "1" })
|
|
||||||
expect(output.a).toBe("1")
|
|
||||||
output = cleanInputValues(
|
|
||||||
{ a: "1", b: "true", c: "false", d: 1, e: "help" },
|
|
||||||
{
|
|
||||||
properties: {
|
|
||||||
a: {
|
|
||||||
type: "number",
|
|
||||||
},
|
|
||||||
b: {
|
|
||||||
type: "boolean",
|
|
||||||
},
|
|
||||||
c: {
|
|
||||||
type: "boolean",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
)
|
|
||||||
expect(output.a).toBe(1)
|
|
||||||
expect(output.b).toBe(true)
|
|
||||||
expect(output.c).toBe(false)
|
|
||||||
expect(output.d).toBe(1)
|
|
||||||
})
|
|
||||||
})
|
|
|
@ -119,5 +119,31 @@ describe("automationUtils", () => {
|
||||||
schema,
|
schema,
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it("should be able to clean inputs with the utilities", () => {
|
||||||
|
// can't clean without a schema
|
||||||
|
let output = cleanInputValues({ a: "1" })
|
||||||
|
expect(output.a).toBe("1")
|
||||||
|
output = cleanInputValues(
|
||||||
|
{ a: "1", b: "true", c: "false", d: 1, e: "help" },
|
||||||
|
{
|
||||||
|
properties: {
|
||||||
|
a: {
|
||||||
|
type: "number",
|
||||||
|
},
|
||||||
|
b: {
|
||||||
|
type: "boolean",
|
||||||
|
},
|
||||||
|
c: {
|
||||||
|
type: "boolean",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
)
|
||||||
|
expect(output.a).toBe(1)
|
||||||
|
expect(output.b).toBe(true)
|
||||||
|
expect(output.c).toBe(false)
|
||||||
|
expect(output.d).toBe(1)
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
|
@ -1,17 +1,13 @@
|
||||||
import * as automation from "../../index"
|
import * as automation from "../../index"
|
||||||
import * as triggers from "../../triggers"
|
import { basicTable } from "../../../tests/utilities/structures"
|
||||||
import { basicTable, loopAutomation } from "../../../tests/utilities/structures"
|
|
||||||
import { context } from "@budibase/backend-core"
|
|
||||||
import {
|
import {
|
||||||
Table,
|
Table,
|
||||||
LoopStepType,
|
LoopStepType,
|
||||||
AutomationResults,
|
|
||||||
ServerLogStepOutputs,
|
ServerLogStepOutputs,
|
||||||
CreateRowStepOutputs,
|
CreateRowStepOutputs,
|
||||||
FieldType,
|
FieldType,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
import * as loopUtils from "../../loopUtils"
|
import * as loopUtils from "../../loopUtils"
|
||||||
import { LoopInput } from "../../../definitions/automations"
|
|
||||||
import { createAutomationBuilder } from "../utilities/AutomationTestBuilder"
|
import { createAutomationBuilder } from "../utilities/AutomationTestBuilder"
|
||||||
import TestConfiguration from "../../../tests/utilities/TestConfiguration"
|
import TestConfiguration from "../../../tests/utilities/TestConfiguration"
|
||||||
|
|
||||||
|
@ -34,41 +30,46 @@ describe("Attempt to run a basic loop automation", () => {
|
||||||
config.end()
|
config.end()
|
||||||
})
|
})
|
||||||
|
|
||||||
async function runLoop(loopOpts?: LoopInput): Promise<AutomationResults> {
|
|
||||||
const appId = config.getAppId()
|
|
||||||
return await context.doInAppContext(appId, async () => {
|
|
||||||
const params = { fields: { appId } }
|
|
||||||
const result = await triggers.externalTrigger(
|
|
||||||
loopAutomation(table._id!, loopOpts),
|
|
||||||
params,
|
|
||||||
{ getResponses: true }
|
|
||||||
)
|
|
||||||
if ("outputs" in result && !result.outputs.success) {
|
|
||||||
throw new Error("Unable to proceed - failed to return anything.")
|
|
||||||
}
|
|
||||||
return result as AutomationResults
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
it("attempt to run a basic loop", async () => {
|
it("attempt to run a basic loop", async () => {
|
||||||
const resp = await runLoop()
|
const result = await createAutomationBuilder(config)
|
||||||
expect(resp.steps[2].outputs.iterations).toBe(1)
|
.onAppAction()
|
||||||
|
.queryRows({
|
||||||
|
tableId: table._id!,
|
||||||
|
})
|
||||||
|
.loop({
|
||||||
|
option: LoopStepType.ARRAY,
|
||||||
|
binding: "{{ steps.1.rows }}",
|
||||||
|
})
|
||||||
|
.serverLog({ text: "log statement" })
|
||||||
|
.test({ fields: {} })
|
||||||
|
|
||||||
|
expect(result.steps[1].outputs.iterations).toBe(1)
|
||||||
})
|
})
|
||||||
|
|
||||||
it("test a loop with a string", async () => {
|
it("test a loop with a string", async () => {
|
||||||
const resp = await runLoop({
|
const result = await createAutomationBuilder(config)
|
||||||
|
.onAppAction()
|
||||||
|
.loop({
|
||||||
option: LoopStepType.STRING,
|
option: LoopStepType.STRING,
|
||||||
binding: "a,b,c",
|
binding: "a,b,c",
|
||||||
})
|
})
|
||||||
expect(resp.steps[2].outputs.iterations).toBe(3)
|
.serverLog({ text: "log statement" })
|
||||||
|
.test({ fields: {} })
|
||||||
|
|
||||||
|
expect(result.steps[0].outputs.iterations).toBe(3)
|
||||||
})
|
})
|
||||||
|
|
||||||
it("test a loop with a binding that returns an integer", async () => {
|
it("test a loop with a binding that returns an integer", async () => {
|
||||||
const resp = await runLoop({
|
const result = await createAutomationBuilder(config)
|
||||||
|
.onAppAction()
|
||||||
|
.loop({
|
||||||
option: LoopStepType.ARRAY,
|
option: LoopStepType.ARRAY,
|
||||||
binding: "{{ 1 }}",
|
binding: "{{ 1 }}",
|
||||||
})
|
})
|
||||||
expect(resp.steps[2].outputs.iterations).toBe(1)
|
.serverLog({ text: "log statement" })
|
||||||
|
.test({ fields: {} })
|
||||||
|
|
||||||
|
expect(result.steps[0].outputs.iterations).toBe(1)
|
||||||
})
|
})
|
||||||
|
|
||||||
it("should run an automation with a trigger, loop, and create row step", async () => {
|
it("should run an automation with a trigger, loop, and create row step", async () => {
|
||||||
|
|
|
@ -42,4 +42,33 @@ describe("app action trigger", () => {
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it("should correct coerce values based on the schema", async () => {
|
||||||
|
const { automation } = await createAutomationBuilder(config)
|
||||||
|
.onAppAction({
|
||||||
|
fields: { text: "string", number: "number", boolean: "boolean" },
|
||||||
|
})
|
||||||
|
.serverLog({
|
||||||
|
text: "{{ fields.text }} {{ fields.number }} {{ fields.boolean }}",
|
||||||
|
})
|
||||||
|
.save()
|
||||||
|
|
||||||
|
await config.api.application.publish()
|
||||||
|
|
||||||
|
const jobs = await captureAutomationResults(automation, async () => {
|
||||||
|
await config.withProdApp(async () => {
|
||||||
|
await config.api.automation.trigger(automation._id!, {
|
||||||
|
fields: { text: "1", number: "2", boolean: "true" },
|
||||||
|
timeout: 1000,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
expect(jobs).toHaveLength(1)
|
||||||
|
expect(jobs[0].data.event.fields).toEqual({
|
||||||
|
text: "1",
|
||||||
|
number: 2,
|
||||||
|
boolean: true,
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
|
@ -146,13 +146,13 @@ class StepBuilder<
|
||||||
TStep extends AutomationTriggerStepId
|
TStep extends AutomationTriggerStepId
|
||||||
> extends BranchStepBuilder<TStep> {
|
> extends BranchStepBuilder<TStep> {
|
||||||
private readonly config: TestConfiguration
|
private readonly config: TestConfiguration
|
||||||
private readonly trigger: AutomationTrigger
|
private readonly _trigger: AutomationTrigger
|
||||||
private _name: string | undefined = undefined
|
private _name: string | undefined = undefined
|
||||||
|
|
||||||
constructor(config: TestConfiguration, trigger: AutomationTrigger) {
|
constructor(config: TestConfiguration, trigger: AutomationTrigger) {
|
||||||
super()
|
super()
|
||||||
this.config = config
|
this.config = config
|
||||||
this.trigger = trigger
|
this._trigger = trigger
|
||||||
}
|
}
|
||||||
|
|
||||||
name(n: string): this {
|
name(n: string): this {
|
||||||
|
@ -166,7 +166,7 @@ class StepBuilder<
|
||||||
name,
|
name,
|
||||||
definition: {
|
definition: {
|
||||||
steps: this.steps,
|
steps: this.steps,
|
||||||
trigger: this.trigger,
|
trigger: this._trigger,
|
||||||
stepNames: this.stepNames,
|
stepNames: this.stepNames,
|
||||||
},
|
},
|
||||||
type: "automation",
|
type: "automation",
|
||||||
|
@ -183,6 +183,13 @@ class StepBuilder<
|
||||||
const runner = await this.save()
|
const runner = await this.save()
|
||||||
return await runner.test(triggerOutput)
|
return await runner.test(triggerOutput)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async trigger(
|
||||||
|
request: TriggerAutomationRequest
|
||||||
|
): Promise<TriggerAutomationResponse> {
|
||||||
|
const runner = await this.save()
|
||||||
|
return await runner.trigger(request)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class AutomationRunner<TStep extends AutomationTriggerStepId> {
|
class AutomationRunner<TStep extends AutomationTriggerStepId> {
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
const { vitePreprocess } = require("@sveltejs/vite-plugin-svelte")
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
preprocess: vitePreprocess(),
|
|
||||||
}
|
|
|
@ -33,6 +33,7 @@
|
||||||
"@rollup/plugin-json": "^4.1.0",
|
"@rollup/plugin-json": "^4.1.0",
|
||||||
"@rollup/plugin-node-resolve": "^15.2.3",
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
||||||
"@rollup/plugin-typescript": "8.3.0",
|
"@rollup/plugin-typescript": "8.3.0",
|
||||||
|
"@types/doctrine": "^0.0.9",
|
||||||
"doctrine": "^3.0.0",
|
"doctrine": "^3.0.0",
|
||||||
"jest": "29.7.0",
|
"jest": "29.7.0",
|
||||||
"marked": "^4.0.10",
|
"marked": "^4.0.10",
|
||||||
|
|
|
@ -7,18 +7,30 @@ import { marked } from "marked"
|
||||||
import { join, dirname } from "path"
|
import { join, dirname } from "path"
|
||||||
|
|
||||||
const helpers = require("@budibase/handlebars-helpers")
|
const helpers = require("@budibase/handlebars-helpers")
|
||||||
const doctrine = require("doctrine")
|
import doctrine, { Annotation } from "doctrine"
|
||||||
|
|
||||||
type HelperInfo = {
|
type BudibaseAnnotation = Annotation & {
|
||||||
|
example?: string
|
||||||
acceptsInline?: boolean
|
acceptsInline?: boolean
|
||||||
acceptsBlock?: boolean
|
acceptsBlock?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
type Helper = {
|
||||||
|
args: string[]
|
||||||
|
numArgs: number
|
||||||
example?: string
|
example?: string
|
||||||
description: string
|
description: string
|
||||||
tags?: any[]
|
requiresBlock?: boolean
|
||||||
|
}
|
||||||
|
|
||||||
|
type Manifest = {
|
||||||
|
[category: string]: {
|
||||||
|
[helper: string]: Helper
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const FILENAME = join(__dirname, "..", "src", "manifest.json")
|
const FILENAME = join(__dirname, "..", "src", "manifest.json")
|
||||||
const outputJSON: any = {}
|
const outputJSON: Manifest = {}
|
||||||
const ADDED_HELPERS = {
|
const ADDED_HELPERS = {
|
||||||
date: {
|
date: {
|
||||||
date: {
|
date: {
|
||||||
|
@ -38,11 +50,10 @@ const ADDED_HELPERS = {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
function fixSpecialCases(name: string, obj: any) {
|
function fixSpecialCases(name: string, obj: Helper) {
|
||||||
const args = obj.args
|
|
||||||
if (name === "ifNth") {
|
if (name === "ifNth") {
|
||||||
args[0] = "a"
|
obj.args = ["a", "b", "options"]
|
||||||
args[1] = "b"
|
obj.numArgs = 3
|
||||||
}
|
}
|
||||||
if (name === "eachIndex") {
|
if (name === "eachIndex") {
|
||||||
obj.description = "Iterates the array, listing an item and the index of it."
|
obj.description = "Iterates the array, listing an item and the index of it."
|
||||||
|
@ -66,10 +77,10 @@ function lookForward(lines: string[], funcLines: string[], idx: number) {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCommentInfo(file: string, func: string): HelperInfo {
|
function getCommentInfo(file: string, func: string): BudibaseAnnotation {
|
||||||
const lines = file.split("\n")
|
const lines = file.split("\n")
|
||||||
const funcLines = func.split("\n")
|
const funcLines = func.split("\n")
|
||||||
let comment = null
|
let comment: string | null = null
|
||||||
for (let idx = 0; idx < lines.length; ++idx) {
|
for (let idx = 0; idx < lines.length; ++idx) {
|
||||||
// from here work back until we have the comment
|
// from here work back until we have the comment
|
||||||
if (lookForward(lines, funcLines, idx)) {
|
if (lookForward(lines, funcLines, idx)) {
|
||||||
|
@ -91,15 +102,9 @@ function getCommentInfo(file: string, func: string): HelperInfo {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (comment == null) {
|
if (comment == null) {
|
||||||
return { description: "" }
|
return { description: "", tags: [] }
|
||||||
}
|
}
|
||||||
const docs: {
|
const docs: BudibaseAnnotation = doctrine.parse(comment, { unwrap: true })
|
||||||
acceptsInline?: boolean
|
|
||||||
acceptsBlock?: boolean
|
|
||||||
example: string
|
|
||||||
description: string
|
|
||||||
tags: any[]
|
|
||||||
} = doctrine.parse(comment, { unwrap: true })
|
|
||||||
// some hacky fixes
|
// some hacky fixes
|
||||||
docs.description = docs.description.replace(/\n/g, " ")
|
docs.description = docs.description.replace(/\n/g, " ")
|
||||||
docs.description = docs.description.replace(/[ ]{2,}/g, " ")
|
docs.description = docs.description.replace(/[ ]{2,}/g, " ")
|
||||||
|
@ -135,7 +140,7 @@ function run() {
|
||||||
)}/lib/${collection}.js`,
|
)}/lib/${collection}.js`,
|
||||||
"utf8"
|
"utf8"
|
||||||
)
|
)
|
||||||
const collectionInfo: any = {}
|
const collectionInfo: { [name: string]: Helper } = {}
|
||||||
// collect information about helper
|
// collect information about helper
|
||||||
let hbsHelperInfo = helpers[collection]()
|
let hbsHelperInfo = helpers[collection]()
|
||||||
for (let entry of Object.entries(hbsHelperInfo)) {
|
for (let entry of Object.entries(hbsHelperInfo)) {
|
||||||
|
@ -154,11 +159,8 @@ function run() {
|
||||||
const jsDocInfo = getCommentInfo(collectionFile, fnc)
|
const jsDocInfo = getCommentInfo(collectionFile, fnc)
|
||||||
let args = jsDocInfo.tags
|
let args = jsDocInfo.tags
|
||||||
.filter(tag => tag.title === "param")
|
.filter(tag => tag.title === "param")
|
||||||
.map(
|
.filter(tag => tag.description)
|
||||||
tag =>
|
.map(tag => tag.description!.replace(/`/g, "").split(" ")[0].trim())
|
||||||
tag.description &&
|
|
||||||
tag.description.replace(/`/g, "").split(" ")[0].trim()
|
|
||||||
)
|
|
||||||
collectionInfo[name] = fixSpecialCases(name, {
|
collectionInfo[name] = fixSpecialCases(name, {
|
||||||
args,
|
args,
|
||||||
numArgs: args.length,
|
numArgs: args.length,
|
||||||
|
|
|
@ -15,6 +15,7 @@ export interface AutomationDataEvent {
|
||||||
oldRow?: Row
|
oldRow?: Row
|
||||||
user?: UserBindings
|
user?: UserBindings
|
||||||
timestamp?: number
|
timestamp?: number
|
||||||
|
fields?: Record<string, any>
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface AutomationData {
|
export interface AutomationData {
|
||||||
|
|
10
yarn.lock
10
yarn.lock
|
@ -6456,6 +6456,11 @@
|
||||||
"@types/node" "*"
|
"@types/node" "*"
|
||||||
"@types/ssh2" "*"
|
"@types/ssh2" "*"
|
||||||
|
|
||||||
|
"@types/doctrine@^0.0.9":
|
||||||
|
version "0.0.9"
|
||||||
|
resolved "https://registry.yarnpkg.com/@types/doctrine/-/doctrine-0.0.9.tgz#d86a5f452a15e3e3113b99e39616a9baa0f9863f"
|
||||||
|
integrity sha512-eOIHzCUSH7SMfonMG1LsC2f8vxBFtho6NGBznK41R84YzPuvSBzrhEps33IsQiOW9+VL6NQ9DbjQJznk/S4uRA==
|
||||||
|
|
||||||
"@types/estree@*", "@types/estree@1.0.5", "@types/estree@^1.0.0", "@types/estree@^1.0.1":
|
"@types/estree@*", "@types/estree@1.0.5", "@types/estree@^1.0.0", "@types/estree@^1.0.1":
|
||||||
version "1.0.5"
|
version "1.0.5"
|
||||||
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4"
|
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4"
|
||||||
|
@ -13739,11 +13744,6 @@ jake@^10.8.5:
|
||||||
filelist "^1.0.1"
|
filelist "^1.0.1"
|
||||||
minimatch "^3.0.4"
|
minimatch "^3.0.4"
|
||||||
|
|
||||||
jest-chain-transform@^0.0.8:
|
|
||||||
version "0.0.8"
|
|
||||||
resolved "https://registry.yarnpkg.com/jest-chain-transform/-/jest-chain-transform-0.0.8.tgz#cbb4d3aef8d02678b1852968a9b0c861f75eef5a"
|
|
||||||
integrity sha512-AELTTzYJ34WrmQKAbxUGT+xqnAHu0/XJZhahYNGvBVUhnAayjm1QmT45DQjwEbQPQp7gn6CXzu6rZA03riwBuw==
|
|
||||||
|
|
||||||
jest-changed-files@^29.7.0:
|
jest-changed-files@^29.7.0:
|
||||||
version "29.7.0"
|
version "29.7.0"
|
||||||
resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.7.0.tgz#1c06d07e77c78e1585d020424dedc10d6e17ac3a"
|
resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.7.0.tgz#1c06d07e77c78e1585d020424dedc10d6e17ac3a"
|
||||||
|
|
Loading…
Reference in New Issue