diff --git a/docs/code_editor/add_variables_resources.mdx b/docs/code_editor/add_variables_resources.mdx index fc238b134..c14f5e27e 100644 --- a/docs/code_editor/add_variables_resources.mdx +++ b/docs/code_editor/add_variables_resources.mdx @@ -1,4 +1,6 @@ import DocCard from '@site/src/components/DocCard'; +import Tabs from '@theme/Tabs'; +import TabItem from '@theme/TabItem'; # Add Resources and Variables to Code @@ -31,39 +33,56 @@ There are 2 main ways resources are used within scripts: ### Passing resources as parameters to scripts (prefered) -Provided you have the right permissions and the resource type exists in the workspace, you can access resources from scripts, flows and apps using the Windmill client. For example, to access the `u/user/my_postgresql` resource of the `posgtgresql` Resource Type we would create a script. +Provided you have the right permissions and the resource type exists in the workspace, you can access resource types from scripts, flows and apps using the Windmill client or [TypedDict](https://mypy.readthedocs.io/en/stable/typed_dict.html) in Python. -Typescript: +From the code editor's toolbar, click on the `+ Type` button and pick the right resource type. For example, to access the `u/user/my_postgresql` resource of the `posgtgresql` Resource Type we would create a script: + + + ```typescript type Postgresql = object; // OR one can fully type it type Postgresql = { - host: string; - port: number; - user: string; - dbname: string; - sslmode: string; - password: string; -}; + host: string, + port: number, + user: string, + dbname: string, + sslmode: string, + password: string, + root_certificate_pem: string +} export async function main(postgres: Postgresql) { // Use Resource... } ``` -Python: + + ```python -postgresql = dict - -def main(postgres: postgresql): - # Use Resource... +from typing import TypedDict + +class postgresql(TypedDict): + host: str + port: int + user: str + dbname: str + sslmode: str + password: str + root_certificate_pem: str + +def main(selected_postgres: postgresql): + # Use Resource... ``` + + + And then select the Resource in the arguments section on the right: -![Select resource](../core_concepts/3_resources_and_types/select_resource.png.webp) +![Select resource](../core_concepts/3_resources_and_types/select_resource.png) :::tip diff --git a/docs/core_concepts/3_resources_and_types/index.mdx b/docs/core_concepts/3_resources_and_types/index.mdx index 0a8e6ca9e..2e57ce509 100644 --- a/docs/core_concepts/3_resources_and_types/index.mdx +++ b/docs/core_concepts/3_resources_and_types/index.mdx @@ -144,6 +144,8 @@ The convenience functions do this are: ## Using Resources +All details on the [Add Resources and Variables to Code Editor](../../code_editor/add_variables_resources.mdx) page: +
-There are 2 main ways resources are used within scripts: - -### Passing resources as parameters to scripts (prefered) - -Provided you have the right permissions and the resource type exists in the workspace, you can access resources from scripts, flows and apps using the Windmill client. For example, to access the `u/user/my_postgresql` resource of the `posgtgresql` Resource Type we would create a script. - -Typescript: - -```typescript -type Postgresql = object; -// OR one can fully type it -type Postgresql = { - host: string; - port: number; - user: string; - dbname: string; - sslmode: string; - password: string; -}; - -export async function main(postgres: Postgresql) { - // Use Resource... -} -``` - -Python: - -```python -postgresql = dict - -def main(postgres: postgresql): - # Use Resource... -``` - -And then select the Resource in the arguments section on the right: - -![Select resource](./select_resource.png.webp) - -:::tip - -You can also edit the Resource or even create a new one right from the Code -editor. - -::: - ### Fetching them from within a script by using the wmill client in the respective language By clicking on `+ Resource`, you'll get to pick a resource from your workspace and be able to fetch it from within the script. diff --git a/docs/core_concepts/3_resources_and_types/select_resource.png b/docs/core_concepts/3_resources_and_types/select_resource.png index 6c11e3bcf..2e22feff3 100644 Binary files a/docs/core_concepts/3_resources_and_types/select_resource.png and b/docs/core_concepts/3_resources_and_types/select_resource.png differ diff --git a/docs/core_concepts/3_resources_and_types/select_resource.png.avif b/docs/core_concepts/3_resources_and_types/select_resource.png.avif deleted file mode 100644 index 20daf30f2..000000000 Binary files a/docs/core_concepts/3_resources_and_types/select_resource.png.avif and /dev/null differ diff --git a/docs/core_concepts/3_resources_and_types/select_resource.png.webp b/docs/core_concepts/3_resources_and_types/select_resource.png.webp deleted file mode 100644 index 196380c87..000000000 Binary files a/docs/core_concepts/3_resources_and_types/select_resource.png.webp and /dev/null differ diff --git a/package.json b/package.json index baadfbe4c..e436ac572 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "events": "^3.3.0", "file-loader": "^6.2.0", "framer-motion": "^8.5.3", - "lucide-react": "^0.134.0", + "lucide-react": "^0.284.0", "postcss": "^8.4.21", "prism-react-renderer": "^1.3.5", "raw-loader": "^4.0.2", diff --git a/src/landing/FlowSection.tsx b/src/landing/FlowSection.tsx index 430810caf..a10d6e704 100644 --- a/src/landing/FlowSection.tsx +++ b/src/landing/FlowSection.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { - List, + Workflow, Bug, Play, CalendarClock, @@ -12,15 +12,15 @@ import { Webhook, OctagonIcon, CheckCircle2, - ServerCrashIcon, TimerOffIcon, - ToyBrickIcon, + Unplug, Database, InfinityIcon, Voicemail, BedIcon, Calendar, - Bot + Bot, + LucideWebhook } from 'lucide-react'; import { GitBranch, Repeat, Verified } from 'lucide-react'; @@ -32,13 +32,13 @@ import { BoltIcon } from '@heroicons/react/20/solid'; const tabs = [ { label: 'Flow editor', - icon: List, + icon: Workflow, id: 'flow-editor', data: [ { title: 'Sequence', description: 'Build complex Flows from atomic scripts.', - icon: List, + icon: Workflow, caption:
Sequence scripts from your workspace, the Hub or write them directly.
, video: { videoSrc: '/videos/flow-sequence.mp4', @@ -103,7 +103,7 @@ const tabs = [ title: 'Resume Workflows with secret webhooks', description: 'Automatically resume workflows with secret webhooks. This is useful for resuming workflows after an approval step.', - icon: Verified, + icon: LucideWebhook, caption: 'Resume Workflows with secret webhooks.', imageSrc: '/images/page_arguments.png.webp', altText: 'Resume with webhooks' @@ -123,7 +123,7 @@ const tabs = [ }, { label: 'Error Handling', - icon: ServerCrashIcon, + icon: Bug, id: 'error-handling', data: [ { @@ -174,14 +174,14 @@ const tabs = [ }, { label: 'Integrations', - icon: ToyBrickIcon, + icon: Unplug, id: 'retries', data: [ { title: 'Connect third-party services', description: 'Connect data providers & external APIs together.', - icon: ToyBrickIcon, + icon: Unplug, caption:
Connect data providers & external APIs together.
, video: { videoSrc: '/videos/flow_integrations.mp4', diff --git a/src/landing/Footer.jsx b/src/landing/Footer.jsx index 79ef238af..a9a816541 100644 --- a/src/landing/Footer.jsx +++ b/src/landing/Footer.jsx @@ -130,13 +130,13 @@ export default function Footer() {

-

+

© 2023 Windmill Labs, Inc. All rights reserved.
1111B S Governors Ave, Dover, DE 19904, USA

SOC Compliance badge -

+

Windmill Labs is SOC 2 Type II compliant

diff --git a/src/landing/HeroAI.jsx b/src/landing/HeroAI.jsx index 8719d2ae0..15055e0d2 100644 --- a/src/landing/HeroAI.jsx +++ b/src/landing/HeroAI.jsx @@ -11,23 +11,20 @@ export default function HeroAI() {
-
- Windmill AI -
-

+

Build internal tools with Windmill AI

-

+

Windmill is a low-code platform for building endpoints, flows, and apps from simple scripts. The presence of code at the heart of Windmill offers unlimited possibilities so as not to rely solely on pre-built integrations.

-

- With the integration of AI models within Windmill, your willpower alone can create the +

+ With the integration of AI models within Windmill, your willpower alongside a few prompts can create the internal tools you want in just a few seconds.

-

+

The AI generates code that matches Windmill's specifications, especially the interaction with external APIs.

@@ -37,7 +34,7 @@ export default function HeroAI() { href="https://app.windmill.dev/user/login" onClick={() => window.plausible('try-cloud')} data-analytics='"try-cloud"' - className="rounded-md transition-all bg-blue-500 px-4 py-2 text-base font-semibold leading-7 text-white hover:bg-blue-800 hover:!text-white focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-600 !no-underline" + className="rounded-md transition-all px-4 py-2 text-base font-semibold leading-7 text-purple-600 hover:!text-purple-900 dark:text-purple-400 hover:!text-purple-600 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-blue-600 !no-underline" rel="nofollow" > Try Windmill Cloud @@ -53,7 +50,7 @@ export default function HeroAI() {
-
diff --git a/src/landing/LandingHeader.jsx b/src/landing/LandingHeader.jsx index efda36da0..19dcc63bf 100644 --- a/src/landing/LandingHeader.jsx +++ b/src/landing/LandingHeader.jsx @@ -11,7 +11,7 @@ import ThemeToggleButton from './ThemeToggleButton'; const resources = [ { name: 'Team', - description: 'Find out who we are and why we do what we do.', + description: 'The team behind Windmill.', href: '/team' }, diff --git a/src/landing/ScriptSection.tsx b/src/landing/ScriptSection.tsx index 514d986f9..1fa15e177 100644 --- a/src/landing/ScriptSection.tsx +++ b/src/landing/ScriptSection.tsx @@ -22,7 +22,7 @@ import { Box, Gitlab } from 'lucide-react'; -import { SiGnubash, SiGo, SiPython, SiDeno, SiVisualstudiocode, SiGraphql } from 'react-icons/si/index'; +import { SiGnubash, SiGo, SiPython, SiTypescript, SiVisualstudiocode, SiGraphql } from 'react-icons/si/index'; import { useDeveloperMode } from '../pages'; import Section from './Section'; @@ -83,7 +83,7 @@ const tabs = [ { title: 'Typescript', description: '', - icon: SiDeno, + icon: SiTypescript, caption:
Deno as the TypeScript runtime.
, svg: '/images/typescript-code.svg', altText: 'Write scripts in Typescript' diff --git a/src/landing/tabs/TabContent.tsx b/src/landing/tabs/TabContent.tsx index 10c32728c..e2b865b67 100644 --- a/src/landing/tabs/TabContent.tsx +++ b/src/landing/tabs/TabContent.tsx @@ -28,14 +28,25 @@ export default function TabContent({ data, color }) { function renderAsset(data) { if (data[selectedIndex].video) { - return ( -