diff --git a/CHANGELOG.md b/CHANGELOG.md index 9020fd16c..6e12e753c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## v1.0.0-116 + + +### 🚀 Enhancements + +- Add other date formula ([612819b](https://github.com/undb-io/undb/commit/612819b)) + +### ❤️ Contributors + +- Nichenqin ([@nichenqin](http://github.com/nichenqin)) + ## v1.0.0-115 diff --git a/README.md b/README.md index 76ed2089f..8f5ae74ea 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,8 @@ UNDB is a no-code platform that can also serve as a Backend as a Service (BaaS). - 🗄️ Based on SQLite, a lightweight database - 🔐 Private and local first - 📦 Can be packaged into a binary file using Bun +- 📊 Support formula field like Excel/Airtable +- 🌐 OpenAPI RESTful API support - 🪜 Progressive deployment, from local in single file to cloud complicated stacks. - 🐳 Supports Docker deployment - 🛠️ Provides a UI for table management @@ -49,6 +51,7 @@ UNDB is a no-code platform that can also serve as a Backend as a Service (BaaS). ![kanban](./docs/images/kanban.jpeg) ![gallery](./docs/images/gallery.jpeg) ![form](./docs/images/form.jpeg) +![calendar](./docs/images/calendar.jpeg) ![openapi](./docs/images/openapi.jpeg) ## Quick start diff --git a/apps/backend/package.json b/apps/backend/package.json index 2317232e4..4e1eea2bc 100644 --- a/apps/backend/package.json +++ b/apps/backend/package.json @@ -8,12 +8,12 @@ "build:docker": "bun build --compile src/index.ts --target=bun --packages=external --sourcemap --outfile undb" }, "dependencies": { - "@aws-sdk/client-s3": "^3.674.0", - "@aws-sdk/s3-request-presigner": "^3.674.0", + "@aws-sdk/client-s3": "^3.686.0", + "@aws-sdk/s3-request-presigner": "^3.686.0", "@elysiajs/cors": "1.1.0", "@elysiajs/cron": "1.1.0", "@elysiajs/html": "1.1.0", - "@elysiajs/opentelemetry": "^1.1.6", + "@elysiajs/opentelemetry": "^1.1.7", "@elysiajs/static": "1.1.0", "@elysiajs/stream": "1.1.0", "@elysiajs/swagger": "^1.1.5", @@ -25,11 +25,11 @@ "@undb/authz": "workspace:*", "@undb/base": "workspace:*", "@undb/command-handlers": "workspace:*", - "@undb/event-handlers": "workspace:*", "@undb/context": "workspace:*", "@undb/cqrs": "workspace:*", "@undb/dashboard": "workspace:*", "@undb/di": "workspace:*", + "@undb/event-handlers": "workspace:*", "@undb/graphql": "workspace:*", "@undb/logger": "workspace:*", "@undb/openapi": "workspace:*", @@ -42,16 +42,16 @@ "@undb/trpc": "workspace:*", "@undb/webhook": "workspace:*", "arctic": "^1.9.2", - "bun": "^1.1.31", - "core-js": "^3.38.1", + "bun": "^1.1.34", + "core-js": "^3.39.0", "elysia": "1.1.7", - "got": "^14.4.3", + "got": "^14.4.4", "handlebars": "^4.7.8", - "lucia": "^3.2.1", + "lucia": "^3.2.2", "mailgun-nodemailer-transport": "^3.0.2", - "minio": "^8.0.1", - "nanoid": "^5.0.7", - "nodemailer": "^6.9.15", + "minio": "^8.0.2", + "nanoid": "^5.0.8", + "nodemailer": "^6.9.16", "oslo": "^1.2.1", "radash": "^12.1.0", "reflect-metadata": "^0.2.2", diff --git a/apps/desktop/package.json b/apps/desktop/package.json index 6a790af39..1da2ad772 100644 --- a/apps/desktop/package.json +++ b/apps/desktop/package.json @@ -10,11 +10,11 @@ "tauri": "tauri" }, "dependencies": { - "@tauri-apps/api": "^2.0.2" + "@tauri-apps/api": "^2.0.3" }, "devDependencies": { "@tauri-apps/cli": "^1.6.3", "typescript": "^5.6.3", - "vite": "^5.4.9" + "vite": "^5.4.10" } } diff --git a/apps/frontend/package.json b/apps/frontend/package.json index b0f0dd223..146961d72 100644 --- a/apps/frontend/package.json +++ b/apps/frontend/package.json @@ -19,17 +19,17 @@ "@neoconfetti/svelte": "^2.2.1", "@svelte-put/copy": "^3.0.2", "@svelte-put/shortcut": "^3.1.1", - "@sveltejs/adapter-static": "^3.0.5", - "@sveltejs/kit": "^2.7.1", + "@sveltejs/adapter-static": "^3.0.6", + "@sveltejs/kit": "^2.8.0", "@sveltejs/vite-plugin-svelte": "^3.1.2", "@tailwindcss/typography": "^0.5.15", - "@tanstack/eslint-plugin-query": "^5.59.7", + "@tanstack/eslint-plugin-query": "^5.59.20", "@types/eslint": "^8.56.12", "@types/lodash.unzip": "^3.4.9", - "@types/papaparse": "^5.3.14", + "@types/papaparse": "^5.3.15", "@types/sortablejs": "latest", - "@typescript-eslint/eslint-plugin": "^8.10.0", - "@typescript-eslint/parser": "^8.10.0", + "@typescript-eslint/eslint-plugin": "^8.13.0", + "@typescript-eslint/parser": "^8.13.0", "@undb/commands": "workspace:*", "@undb/domain": "workspace:*", "@undb/formula": "workspace:*", @@ -44,10 +44,10 @@ "array-move": "^4.0.0", "autoprefixer": "^10.4.20", "date-fns": "^4.1.0", - "eslint": "^9.12.0", + "eslint": "^9.14.0", "eslint-config-prettier": "^9.1.0", - "eslint-plugin-svelte": "^2.45.1", - "houdini": "^1.2.64", + "eslint-plugin-svelte": "^2.46.0", + "houdini": "^1.3.0", "houdini-svelte": "^1.2.64", "lodash.unzip": "^3.4.0", "papaparse": "^5.4.1", @@ -62,21 +62,20 @@ "sortablejs": "^1.15.3", "svelte": "^4.2.19", "svelte-check": "^4.0.5", - "svelte-dnd-action": "^0.9.51", - "svelte-headless-table": "^0.18.2", + "svelte-headless-table": "^0.18.3", "svelte-inview": "^4.0.4", - "svelte-jsoneditor": "^1.0.8", + "svelte-jsoneditor": "^1.1.2", "svelte-persisted-store": "^0.11.0", "sveltekit-search-params": "^3.0.0", "svelvet": "^10.0.2", "tailwindcss": "^3.4.14", "timeago.js": "^4.0.2", - "tslib": "^2.8.0", + "tslib": "^2.8.1", "type-fest": "^4.26.1", "typescript": "^5.6.3", - "vite": "^5.4.9", + "vite": "^5.4.10", "vite-plugin-node-polyfills": "^0.22.0", - "vitest": "^2.1.3", + "vitest": "^2.1.4", "xlsx": "^0.18.5" }, "type": "module", @@ -85,32 +84,32 @@ "@codemirror/commands": "^6.7.1", "@codemirror/language": "^6.10.3", "@codemirror/state": "^6.4.1", - "@codemirror/view": "^6.34.1", + "@codemirror/view": "^6.34.2", "@floating-ui/dom": "^1.6.12", "@formkit/auto-animate": "^0.8.2", "@internationalized/date": "^3.5.6", "@svelte-put/clickoutside": "^3.0.2", - "@tanstack/svelte-query": "^5.59.13", - "@tanstack/svelte-virtual": "^3.10.8", - "@tiptap/core": "^2.8.0", - "@tiptap/pm": "^2.8.0", - "@tiptap/starter-kit": "^2.8.0", + "@tanstack/svelte-query": "^5.59.20", + "@tanstack/svelte-virtual": "^3.10.9", + "@tiptap/core": "^2.9.1", + "@tiptap/pm": "^2.9.1", + "@tiptap/starter-kit": "^2.9.1", "@trpc/client": "^10.45.2", "@undb/zod": "workspace:*", "bits-ui": "^0.21.16", "clsx": "^2.1.1", "cmdk-sv": "^0.0.18", - "embla-carousel-svelte": "^8.3.0", + "embla-carousel-svelte": "^8.3.1", "formsnap": "^1.0.1", "fuse.js": "^7.0.0", "lucide-svelte": "^0.453.0", "mode-watcher": "^0.4.1", "paneforge": "^0.0.6", "svelte-grid": "^5.1.2", - "svelte-qrcode": "^1.0.0", + "svelte-qrcode": "^1.0.1", "svelte-radix": "^1.1.1", "svelte-sonner": "^0.3.28", - "sveltekit-superforms": "^2.19.1", + "sveltekit-superforms": "^2.20.0", "tailwind-merge": "^2.5.4", "tailwind-variants": "^0.2.1", "trpc-svelte-query-adapter": "^2.3.14", diff --git a/bun.lockb b/bun.lockb index 24fa0b7b7..29461b1d7 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/docs/images/calendar.jpeg b/docs/images/calendar.jpeg new file mode 100644 index 000000000..023aaff5e Binary files /dev/null and b/docs/images/calendar.jpeg differ diff --git a/package.json b/package.json index 17490152c..6c83c7ae3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "undb", - "version": "1.0.0-115", + "version": "1.0.0-116", "private": true, "scripts": { "build": "NODE_ENV=production bun --bun turbo build", @@ -23,9 +23,9 @@ "drizzle-kit": "^0.26.2", "husky": "^9.1.6", "lint-staged": "^15.2.10", - "npm-run-all2": "^6.2.4", + "npm-run-all2": "^7.0.1", "prettier": "^3.3.3", - "turbo": "^2.1.3" + "turbo": "^2.2.3" }, "lint-staged": { "**/*": "bunx --bun prettier --write --ignore-unknown" @@ -33,7 +33,7 @@ "engines": { "node": ">=18" }, - "packageManager": "bun@1.1.31", + "packageManager": "bun@1.1.34", "workspaces": [ "apps/*", "packages/*" diff --git a/packages/domain/package.json b/packages/domain/package.json index a1b4ef7a5..d5c5b1947 100644 --- a/packages/domain/package.json +++ b/packages/domain/package.json @@ -14,7 +14,7 @@ "array-move": "^4.0.0", "date-fns": "^4.1.0", "dequal": "^2.0.3", - "nanoid": "^5.0.7", + "nanoid": "^5.0.8", "oxide.ts": "^1.1.0", "uuid": "^10.0.0" } diff --git a/packages/formula/src/formula.constants.ts b/packages/formula/src/formula.constants.ts index e8b9e4df1..5402f8c56 100644 --- a/packages/formula/src/formula.constants.ts +++ b/packages/formula/src/formula.constants.ts @@ -33,6 +33,18 @@ export const FORMULA_FUNCTIONS: FormulaFunction[] = [ "SEARCH", "SUBSTR", + // 日期时间 + "DATE_ADD", + "DATE_SUBTRACT", + "DATE_DIFF", + "YEAR", + "MONTH", + "DAY", + "HOUR", + "MINUTE", + "SECOND", + "WEEKDAY", + // 逻辑运算 "AND", "OR", diff --git a/packages/formula/src/formula/formula.registry.ts b/packages/formula/src/formula/formula.registry.ts index 7c778b819..e766ac8bb 100644 --- a/packages/formula/src/formula/formula.registry.ts +++ b/packages/formula/src/formula/formula.registry.ts @@ -325,3 +325,70 @@ globalFormulaRegistry.register( ["XOR({{field1}}, false)", undefined], ], ) + +globalFormulaRegistry.register("DATE_ADD", [["date", "number", "string"]], "date", "Adds a number of date to date", [ + ["DATE_ADD('2024-01-01', 1, 'day')", "2024-01-02"], + ["DATE_ADD('2024-01-01', 1, 'month')", "2024-02-01"], + ["DATE_ADD('2024-01-01', 1, 'year')", "2025-01-01"], + ["DATE_ADD('2024-01-01', 1, 'hour')", "2024-01-01 01:00:00"], + ["DATE_ADD('2024-01-01', 1, 'minute')", "2024-01-01 00:01:00"], + ["DATE_ADD('2024-01-01', 1, 'second')", "2024-01-01 00:00:01"], + ["DATE_ADD({{field1}}, 1, 'day')", undefined], +]) +globalFormulaRegistry.register( + "DATE_SUBTRACT", + [["date", "number", "string"]], + "date", + "Subtracts a number of date from date", + [ + ["DATE_SUBTRACT('2024-01-01', 1, 'day')", "2023-12-31"], + ["DATE_SUBTRACT('2024-01-01', 1, 'month')", "2023-12-01"], + ["DATE_SUBTRACT('2024-01-01', 1, 'year')", "2023-01-01"], + ["DATE_SUBTRACT('2024-01-01', 1, 'hour')", "2023-12-31 23:00:00"], + ["DATE_SUBTRACT('2024-01-01', 1, 'minute')", "2023-12-31 23:59:00"], + ["DATE_SUBTRACT('2024-01-01', 1, 'second')", "2023-12-31 23:59:59"], + ["DATE_SUBTRACT({{field1}}, 1, 'day')", undefined], + ], +) + +globalFormulaRegistry.register( + "DATE_DIFF", + [["date", "date", "string"]], + "number", + "Returns the difference between two dates in the specified unit.", + [ + ["DATE_DIFF('2024-01-01', '2024-01-02', 'day')", 1], + ["DATE_DIFF('2024-01-01', '2024-01-02', 'month')", 0], + ["DATE_DIFF('2024-01-01', '2024-01-02', 'year')", 0], + ["DATE_DIFF({{field1}}, {{field2}}, 'day')", undefined], + ], +) + +globalFormulaRegistry.register("YEAR", [["date"]], "number", "Returns the year of a date.", [ + ["YEAR('2024-01-01')", 2024], + ["YEAR({{field1}})", undefined], +]) +globalFormulaRegistry.register("MONTH", [["date"]], "number", "Returns the month of a date.", [ + ["MONTH('2024-01-01')", 1], + ["MONTH({{field1}})", undefined], +]) +globalFormulaRegistry.register("DAY", [["date"]], "number", "Returns the day of a date.", [ + ["DAY('2024-01-01')", 1], + ["DAY({{field1}})", undefined], +]) +globalFormulaRegistry.register("HOUR", [["date"]], "number", "Returns the hour of a date.", [ + ["HOUR('2024-01-01 01:00:00')", 1], + ["HOUR({{field1}})", undefined], +]) +globalFormulaRegistry.register("MINUTE", [["date"]], "number", "Returns the minute of a date.", [ + ["MINUTE('2024-01-01 01:00:00')", 0], + ["MINUTE({{field1}})", undefined], +]) +globalFormulaRegistry.register("SECOND", [["date"]], "number", "Returns the second of a date.", [ + ["SECOND('2024-01-01 01:00:00')", 0], + ["SECOND({{field1}})", undefined], +]) +globalFormulaRegistry.register("WEEKDAY", [["date"]], "number", "Returns the weekday of a date.", [ + ["WEEKDAY('2024-01-01')", 2], + ["WEEKDAY({{field1}})", undefined], +]) diff --git a/packages/formula/src/formula/formula.type.ts b/packages/formula/src/formula/formula.type.ts index 032c5f9c0..e79fd8c5f 100644 --- a/packages/formula/src/formula/formula.type.ts +++ b/packages/formula/src/formula/formula.type.ts @@ -32,16 +32,19 @@ export type FormulaFunction = | "SEARCH" | "SUBSTR" - // // 日期时间 + // 日期时间 + | "DATE_ADD" + | "DATE_SUBTRACT" + | "DATE_DIFF" + | "YEAR" + | "MONTH" + | "DAY" // | "NOW" // | "TODAY" - // | "YEAR" - // | "MONTH" - // | "DAY" - // | "HOUR" - // | "MINUTE" - // | "SECOND" - // | "WEEKDAY" + | "HOUR" + | "MINUTE" + | "SECOND" + | "WEEKDAY" // | "DATE" // 逻辑运算 diff --git a/packages/graphql/package.json b/packages/graphql/package.json index ec3318e37..abef99004 100644 --- a/packages/graphql/package.json +++ b/packages/graphql/package.json @@ -21,6 +21,6 @@ "@envelop/opentelemetry": "^6.3.1", "@opentelemetry/api": "^1.9.0", "graphql": "16.8.1", - "graphql-yoga": "^5.7.0" + "graphql-yoga": "^5.8.0" } } diff --git a/packages/persistence/package.json b/packages/persistence/package.json index e099fc7b3..ea3c9ec1b 100644 --- a/packages/persistence/package.json +++ b/packages/persistence/package.json @@ -14,10 +14,10 @@ "@libsql/client": "^0.14.0", "@libsql/kysely-libsql": "^0.4.1", "@undb/audit": "workspace:*", - "@undb/cqrs": "workspace:*", "@undb/authz": "workspace:*", "@undb/base": "workspace:*", "@undb/context": "workspace:*", + "@undb/cqrs": "workspace:*", "@undb/di": "workspace:*", "@undb/domain": "workspace:*", "@undb/formula": "workspace:*", @@ -28,8 +28,8 @@ "@undb/user": "workspace:*", "@undb/webhook": "workspace:*", "date-fns": "^4.1.0", - "drizzle-orm": "^0.35.1", - "es-toolkit": "^1.25.2", + "drizzle-orm": "^0.36.1", + "es-toolkit": "^1.26.1", "kysely": "^0.27.4", "kysely-bun-sqlite": "^0.3.2", "radash": "^12.1.0", diff --git a/packages/persistence/src/underlying/underlying-formula.visitor.ts b/packages/persistence/src/underlying/underlying-formula.visitor.ts index c024795e3..a10fb9834 100644 --- a/packages/persistence/src/underlying/underlying-formula.visitor.ts +++ b/packages/persistence/src/underlying/underlying-formula.visitor.ts @@ -198,12 +198,99 @@ export class UnderlyingFormulaVisitor extends FormulaParserVisitor { return `((${result} OR ${arg}) AND NOT (${result} AND ${arg}))` }) }) + .with("DATE_ADD", () => { + const args = this.arguments(ctx) + // args[0] 是日期时间戳 + // args[1] 是要增加的数值 + // args[2] 是单位 ('year', 'month', 'day', 'hour', 'minute', 'second') + return `datetime(${args[0]}/1000, 'unixepoch', '+' || ${args[1]} || ' ' || ${args[2]})` + }) + .with("DATE_SUBTRACT", () => { + const args = this.arguments(ctx) + return `datetime(${args[0]}/1000, 'unixepoch', '-' || ${args[1]} || ' ' || ${args[2]})` + }) + .with("DATE_DIFF", () => { + const args = this.arguments(ctx) + // args[0] 是开始日期 + // args[1] 是结束日期 + // args[2] 是单位 ('year', 'month', 'day') + return `CAST( + CASE ${args[2]} + WHEN 'day' THEN JULIANDAY(${args[1]}/1000, 'unixepoch') - JULIANDAY(${args[0]}/1000, 'unixepoch') + WHEN 'month' THEN ( + (CAST(strftime('%Y', ${args[1]}/1000, 'unixepoch') AS INTEGER) - CAST(strftime('%Y', ${args[0]}/1000, 'unixepoch') AS INTEGER)) * 12 + + (CAST(strftime('%m', ${args[1]}/1000, 'unixepoch') AS INTEGER) - CAST(strftime('%m', ${args[0]}/1000, 'unixepoch') AS INTEGER)) + ) + WHEN 'year' THEN ( + CAST(strftime('%Y', ${args[1]}/1000, 'unixepoch') AS INTEGER) - CAST(strftime('%Y', ${args[0]}/1000, 'unixepoch') AS INTEGER) + ) + END AS INTEGER + )` + }) + .with("YEAR", () => { + const args = this.arguments(ctx) + return `CAST(strftime('%Y', ${args[0]}/1000, 'unixepoch') AS INTEGER)` + }) + .with("MONTH", () => { + const args = this.arguments(ctx) + return `CAST(strftime('%m', ${args[0]}/1000, 'unixepoch') AS INTEGER)` + }) + .with("DAY", () => { + const args = this.arguments(ctx) + return `CAST(strftime('%d', ${args[0]}/1000, 'unixepoch') AS INTEGER)` + }) + .with("HOUR", () => { + const args = this.arguments(ctx) + return `CAST(strftime('%H', ${args[0]}/1000, 'unixepoch') AS INTEGER)` + }) + .with("MINUTE", () => { + const args = this.arguments(ctx) + return `CAST(strftime('%M', ${args[0]}/1000, 'unixepoch') AS INTEGER)` + }) + .with("SECOND", () => { + const args = this.arguments(ctx) + return `CAST(strftime('%S', ${args[0]}/1000, 'unixepoch') AS INTEGER)` + }) + .with("WEEKDAY", () => { + const args = this.arguments(ctx) + return `CAST(strftime('%w', ${args[0]}/1000, 'unixepoch') AS INTEGER)` + }) .with("RECORD_ID", () => { return ID_TYPE }) .with("AUTO_INCREMENT", () => { return `[${AUTO_INCREMENT_TYPE}]` }) + .with("CEILING", () => { + const args = this.arguments(ctx) + return `CAST(ROUND(${args[0]} + 0.499999999999999) AS INTEGER)` + }) + .with("FLOOR", () => { + const args = this.arguments(ctx) + return `CAST(ROUND(${args[0]} - 0.499999999999999) AS INTEGER)` + }) + .with("ROUND", () => { + const args = this.arguments(ctx) + return `CAST(ROUND(${args[0]}) AS INTEGER)` + }) + .with("ABS", () => { + const args = this.arguments(ctx) + return `ABS(${args[0]})` + }) + .with("SQRT", () => { + const args = this.arguments(ctx) + // 使用幂运算来实现平方根: x^0.5 = √x + return `POWER(${args[0]}, 0.5)` + }) + .with("POWER", () => { + const args = this.arguments(ctx) + // 使用 exp 和 ln 实现幂运算: a^b = e^(b*ln(a)) + return `POWER(${args[0]}, ${args[1]})` + }) + .with("MOD", () => { + const args = this.arguments(ctx) + return `(${args[0]} % ${args[1]})` + }) .otherwise(() => { const args = ctx.argumentList() ? this.visit(ctx.argumentList()!) : "" return `${functionName}(${args})` diff --git a/packages/realtime/package.json b/packages/realtime/package.json index 34a70c41a..1858ce826 100644 --- a/packages/realtime/package.json +++ b/packages/realtime/package.json @@ -7,7 +7,7 @@ "@undb/di": "workspace:*", "@undb/persistence": "workspace:*", "@undb/table": "workspace:*", - "drizzle-orm": "^0.35.1", + "drizzle-orm": "^0.36.1", "ts-pattern": "^5.5.0" }, "devDependencies": { diff --git a/packages/template/package.json b/packages/template/package.json index 1a1bf3e44..e0dd8dfd9 100644 --- a/packages/template/package.json +++ b/packages/template/package.json @@ -11,7 +11,7 @@ "@undb/logger": "workspace:*", "@undb/table": "workspace:*", "@undb/zod": "workspace:*", - "zod-to-json-schema": "^3.23.3" + "zod-to-json-schema": "^3.23.5" }, "devDependencies": { "@types/bun": "latest" diff --git a/packages/template/src/templates/test.base.json b/packages/template/src/templates/test.base.json index 765c6a3c2..3f714162d 100644 --- a/packages/template/src/templates/test.base.json +++ b/packages/template/src/templates/test.base.json @@ -217,20 +217,6 @@ "fn": "MOD({{count3}}, {{count2}})" } }, - "Power": { - "id": "power", - "type": "formula", - "option": { - "fn": "POWER({{count3}}, {{count2}})" - } - }, - "Sqrt": { - "id": "sqrt", - "type": "formula", - "option": { - "fn": "SQRT({{count3}})" - } - }, "Abs": { "id": "abs", "type": "formula", @@ -471,6 +457,186 @@ "String2": "llo" } ] + }, + "Formula2": { + "schema": { + "Date1": { + "id": "date1", + "type": "date" + }, + "Date2": { + "id": "date2", + "type": "date" + }, + "DateAdd1": { + "id": "dateAdd1", + "type": "formula", + "option": { + "fn": "DATE_ADD({{date1}}, 1, 'day')" + } + }, + "DateAdd2": { + "id": "dateAdd2", + "type": "formula", + "option": { + "fn": "DATE_ADD({{date1}}, 1, 'month')" + } + }, + "DateAdd3": { + "id": "dateAdd3", + "type": "formula", + "option": { + "fn": "DATE_ADD({{date1}}, 1, 'year')" + } + }, + "DateAdd4": { + "id": "dateAdd4", + "type": "formula", + "option": { + "fn": "DATE_ADD({{date1}}, 1, 'hour')" + } + }, + "DateAdd5": { + "id": "dateAdd5", + "type": "formula", + "option": { + "fn": "DATE_ADD({{date1}}, 1, 'minute')" + } + }, + "DateAdd6": { + "id": "dateAdd6", + "type": "formula", + "option": { + "fn": "DATE_ADD({{date1}}, 1, 'second')" + } + }, + "DateSubtract1": { + "id": "dateSubtract1", + "type": "formula", + "option": { + "fn": "DATE_SUBTRACT({{date1}}, 1, 'day')" + } + }, + "DateSubtract2": { + "id": "dateSubtract2", + "type": "formula", + "option": { + "fn": "DATE_SUBTRACT({{date1}}, 1, 'month')" + } + }, + "DateSubtract3": { + "id": "dateSubtract3", + "type": "formula", + "option": { + "fn": "DATE_SUBTRACT({{date1}}, 1, 'year')" + } + }, + "DateSubtract4": { + "id": "dateSubtract4", + "type": "formula", + "option": { + "fn": "DATE_SUBTRACT({{date1}}, 1, 'hour')" + } + }, + "DateSubtract5": { + "id": "dateSubtract5", + "type": "formula", + "option": { + "fn": "DATE_SUBTRACT({{date1}}, 1, 'minute')" + } + }, + "DateSubtract6": { + "id": "dateSubtract6", + "type": "formula", + "option": { + "fn": "DATE_SUBTRACT({{date1}}, 1, 'second')" + } + }, + "DateDiff1": { + "id": "dateDiff1", + "type": "formula", + "option": { + "fn": "DATE_DIFF({{date1}}, {{date2}}, 'day')" + } + }, + "DateDiff2": { + "id": "dateDiff2", + "type": "formula", + "option": { + "fn": "DATE_DIFF({{date1}}, {{date2}}, 'month')" + } + }, + "DateDiff3": { + "id": "dateDiff3", + "type": "formula", + "option": { + "fn": "DATE_DIFF({{date1}}, {{date2}}, 'year')" + } + }, + "Year": { + "id": "year", + "type": "formula", + "option": { + "fn": "YEAR({{date1}})" + } + }, + "Month": { + "id": "month", + "type": "formula", + "option": { + "fn": "MONTH({{date1}})" + } + }, + "Day": { + "id": "day", + "type": "formula", + "option": { + "fn": "DAY({{date1}})" + } + }, + "Hour": { + "id": "hour", + "type": "formula", + "option": { + "fn": "HOUR({{date1}})" + } + }, + "Minute": { + "id": "minute", + "type": "formula", + "option": { + "fn": "MINUTE({{date1}})" + } + }, + "Second": { + "id": "second", + "type": "formula", + "option": { + "fn": "SECOND({{date1}})" + } + }, + "Weekday": { + "id": "weekday", + "type": "formula", + "option": { + "fn": "WEEKDAY({{date1}})" + } + } + }, + "records": [ + { + "Date1": "2024-01-01", + "Date2": "2024-01-02" + }, + { + "Date1": "2024-01-01", + "Date2": "2024-02-01" + }, + { + "Date1": "2024-01-01", + "Date2": "2025-01-01" + } + ] } } } diff --git a/packages/zod/package.json b/packages/zod/package.json index 0bf4178e7..77394f3a0 100644 --- a/packages/zod/package.json +++ b/packages/zod/package.json @@ -10,7 +10,7 @@ "typescript": "^5.0.0" }, "dependencies": { - "i18next": "^23.16.0", + "i18next": "^23.16.4", "zod": "^3.23.8", "zod-i18n-map": "^2.27.0", "zod-validation-error": "^3.4.0"