Val Town Code SearchReturn to Val Town

API Access

You can access search results via JSON API by adding format=json to your query:

https://codesearch.val.run/?q=image&page=562&format=json

For typeahead suggestions, use the /typeahead endpoint:

https://codesearch.val.run/typeahead?q=image

Returns an array of strings in format "username" or "username/projectName"

Found 6024 results for "image"(724ms)

openapi_schemamain.tsx2 matches

@pomdtrUpdated 12 months ago
698 bio: string | null;
699 /** @description The url for the user's profile picture */
700 profileImageUrl: string | null;
701 }) & components["schemas"]["Author"], "bio" | "profileImageUrl">;
702 BaseVal: {
703 /** Format: uuid */

umbrellaReminderREADME.md1 match

@michaelmangUpdated 12 months ago
1# ☔️ Umbrella reminder if there's rain today
2
3![Screenshot 2023-09-14 at 12.31.32.png](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/d82916ca-f8d9-4b49-88c6-420ab67a7700/public)
4
5## Setup

jsoninvoice_homepagemain.tsx2 matches

@pomdtrUpdated 12 months ago
82 </div>
83 <div class="flex justify-center mt-24">
84 <image
85 class="rounded-lg border w-3/4"
86 src="https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/a35e64a5-e0e7-48f1-31b9-f1b77edb4900/public"
87 />
88 </div>

isthegtrainfuckedmain.tsx1 match

@stevekrouseUpdated 12 months ago
34 />
35 <meta
36 property="og:image"
37 content={fucked
38 ? "https://pbt-gtrainog.web.val.run/?status=notOk"

getColormain.tsx5 matches

@stevekrouseUpdated 1 year ago
14export async function getColor(src: string = EXAMPLE_URL): Promise<string> {
15 const { default: Jimp } = await import("npm:jimp");
16 const image = await Jimp.read(src);
17 const store = {};
18 const total_pixels = image.bitmap.width * image.bitmap.height;
19 const coverage = total_pixels * PERCENT_COVERAGE / 100;
20 const data = image.bitmap.data;
21 const max_pixel_index = total_pixels - 1;
22
34 <html>
35 <head>
36 <title>Dominant Color from Image</title>
37 <meta name="viewport" content="width=device-width, initial-scale=1.0" />
38 <script src="https://cdn.tailwindcss.com" />
41 <div class="flex flex-col p-10 space-y-10">
42 <a href="/">
43 <h1 class="text-5xl font-extrabold hover:underline">Dominant Color from Image</h1>
44 </a>
45 <div class="flex flex-col flex-grow justify-center items-center w-full">

showbotREADME.md1 match

@mvaodhanUpdated 1 year ago
1# Forward Render Error Emails to Val Town's Engineering Discord Channel
2
3![shapes at 24-02-08 12.23.08.png](https://imagedelivery.net/iHX6Ovru0O7AjmyT5yZRoA/b45a989d-bb5d-4d0f-a170-2d4b1f60e400/public)
4
5Render sends emails when deploys fail but I want those notifications to come in our team Discord channel, and tag our team. Render doesn't have webhooks for this, so I set up a Gmail filter and forward to this email handler val, which in turn forwards the content to our engineering Discord channel.

getColorREADME.md1 match

@stevekrouseUpdated 1 year ago
1Get common or "dominant" color from an image given a source URL
2
3Migrated from folder: Archive/getColor

vtOpenAPImain.tsx1 match

@stevekrouseUpdated 1 year ago
1// set at Thu May 02 2024 18:00:24 GMT+0000 (Coordinated Universal Time)
2export let vtOpenAPI = "openapi: 3.1.0\ninfo:\n title: Val Town API\n description: |\n The Val Town API provides services to evaluate JavaScript and TypeScript expressions, run vals as APIs, either as functions or Express handlers.\n\n Learn more at [https://docs.val.town](https://docs.val.town)\n version: 1.7.0\nservers:\n - url: https://api.val.town\n description: Val Town API v1\n\ncomponents:\n securitySchemes:\n bearerAuth:\n type: http\n scheme: bearer\n bearerFormat: API Key\n schemas:\n JSON:\n oneOf:\n - type: string\n - type: number\n - type: object\n - type: array\n items: {}\n - type: boolean\n description: \"Can be anything: string, number, array, object, etc., including `null`\"\n Relationship:\n type: string\n enum: [\"received\", \"given\", \"any\"]\n Privacy:\n type: string\n enum: [\"public\", \"unlisted\", \"private\"]\n Author:\n type: object\n properties:\n id:\n description: The user's id\n type: string\n format: uuid\n username:\n description: The user's username\n type: string\n User:\n type: object\n allOf:\n - $ref: \"#/components/schemas/Author\"\n properties:\n bio:\n description: The user's bio\n type:\n - string\n - \"null\"\n profileImageUrl:\n description: The url for the user's profile picture\n type:\n - string\n - \"null\"\n BaseVal:\n type: object\n properties:\n id:\n type: string\n format: uuid\n author:\n $ref: \"#/components/schemas/Author\"\n name:\n type: string\n code:\n type: string\n public:\n type: boolean\n deprecated: true\n privacy:\n $ref: \"#/components/schemas/Privacy\"\n version:\n type: integer\n format: int32\n runEndAt:\n type:\n - string\n - \"null\"\n format: date-time\n deprecated: true\n runStartAt:\n type:\n - string\n - \"null\"\n format: date-time\n deprecated: true\n FullVal:\n type: object\n allOf:\n - $ref: \"#/components/schemas/BaseVal\"\n properties:\n logs:\n type: array\n items: {}\n output:\n type: object\n exported:\n type: object\n error:\n type: object\n readme:\n type: string\n likeCount:\n type: number\n referenceCount:\n type: number\n ValFields:\n type: object\n properties:\n name:\n type: string\n privacy:\n $ref: \"#/components/schemas/Privacy\"\n readme:\n type:\n - string\n - \"null\"\n ValInput:\n type: object\n allOf:\n - $ref: \"#/components/schemas/ValFields\"\n properties:\n code:\n type: string\n PaginatedList:\n type: object\n properties:\n data:\n type: array\n links:\n type: object\n properties:\n self:\n description: The URL of the current page of results\n type: string\n format: uri\n next:\n description: The URL of the next page of results\n type: string\n format: uri\n prev:\n description: The URL of the previous page of results\n type: string\n format: uri\n ValList:\n type: object\n allOf:\n - $ref: \"#/components/schemas/PaginatedList\"\n properties:\n data:\n type: array\n items:\n $ref: \"#/components/schemas/BaseVal\"\n BaseValRef:\n type: object\n properties:\n id:\n description: The id of the val\n type: string\n name:\n description: The name of the val\n type: string\n author:\n $ref: \"#/components/schemas/Author\"\n author_id:\n description: The id of the val's author\n type: string\n deprecated: true\n username:\n description: The username of the val's author\n type: string\n deprecated: true\n ValRef:\n type: object\n allOf:\n - $ref: \"#/components/schemas/BaseValRef\"\n properties:\n public:\n type: boolean\n deprecated: true\n privacy:\n $ref: \"#/components/schemas/Privacy\"\n version:\n type: integer\n format: int32\n BaseRun:\n type: object\n properties:\n id:\n type: string\n format: uuid\n error: {}\n parentId:\n type: string\n format: uuid\n runEndAt:\n type:\n - string\n - \"null\"\n format: date-time\n deprecated: true\n runStartAt:\n type:\n - string\n - \"null\"\n format: date-time\n deprecated: true\n val:\n $ref: \"#/components/schemas/ValRef\"\n FullRun:\n type: object\n allOf:\n - $ref: \"#/components/schemas/BaseRun\"\n properties:\n emails:\n type: array\n items: {}\n logs:\n type: array\n items: {}\n returnValue: {}\n args:\n type: array\n items: {}\n RunList:\n type: object\n allOf:\n - $ref: \"#/components/schemas/PaginatedList\"\n properties:\n data:\n type: array\n items:\n $ref: \"#/components/schemas/BaseRun\"\n Comment:\n type: object\n properties:\n id:\n type: string\n format: uuid\n author:\n $ref: \"#/components/schemas/Author\"\n comment:\n description: The contents of the comment\n type: string\n createdAt:\n type: string\n format: date-time\n val:\n $ref: \"#/components/schemas/ValRef\"\n Reference:\n type: object\n properties:\n referencedAt:\n type: string\n format: date-time\n reference:\n $ref: \"#/components/schemas/BaseValRef\"\n dependsOn:\n $ref: \"#/components/schemas/BaseValRef\"\n CommentList:\n type: object\n allOf:\n - $ref: \"#/components/schemas/PaginatedList\"\n properties:\n data:\n type: array\n items:\n $ref: \"#/components/schemas/Comment\"\n ReferenceList:\n type: object\n allOf:\n - $ref: \"#/components/schemas/PaginatedList\"\n properties:\n data:\n type: array\n items:\n $ref: \"#/components/schemas/Reference\"\n parameters:\n expression:\n in: path\n name: expression\n required: true\n description: |\n The JavaScript or TypeScript expression to be evaluated.\n This should be a single expression, like a single function\n call, assignment operation, or calculation. If you need\n to execute multiple expressions, wrap them in a function.\n schema:\n type: string\n examples:\n simpleAddition:\n value: \"1+1\"\n summary: Simple addition\n functionCall:\n value: \"@stevekrouse.addOne(@stevekrouse.example1)\"\n summary: Calling a user's val function\n user_id:\n name: user_id\n in: path\n required: true\n description: id of the user\n schema:\n type: string\n format: uuid\n examples:\n stevekrouse:\n value: \"a0bf3b31-15a5-4d5c-880e-4b1e22c9bc18\"\n username:\n name: username\n in: path\n required: true\n description: |\n The username of the val owner, *not* including the `@` symbol.\n schema:\n type: string\n examples:\n stevekrouse:\n value: stevekrouse\n summary: Steve Krouse's username\n val_id:\n name: val_id\n in: path\n required: true\n description: id of the val\n schema:\n type: string\n format: uuid\n examples:\n hello:\n value: \"eb4a2ace-b6c8-4393-85e0-4813b3f04e12\"\n val_name:\n name: val_name\n in: path\n required: true\n description: The name of the val.\n schema:\n type: string\n examples:\n id:\n value: id\n summary: \"id\"\n description: |\n This val is a function that returns its arguments. It is useful for testing how the API handles the arguments passed to it.\n\n View the val at [https://val.town/v/stevekrouse.id](https://val.town/v/stevekrouse.id)\n version:\n name: version\n in: path\n required: true\n description: val version\n schema:\n type: number\n run_id:\n name: run_id\n in: path\n required: true\n description: id of the log\n schema:\n type: string\n format: uuid\n examples:\n hello:\n value: \"cd0653ac-aede-4d0d-8c8e-21c7ef763eb2\"\n offset:\n name: offset\n in: query\n description: Pagination offset\n schema:\n type: integer\n default: 0\n minimum: 0\n limit:\n name: limit\n in: query\n description: Pagination limit\n schema:\n type: integer\n default: 20\n minimum: 1\n maximum: 100\n comments_since:\n name: since\n in: query\n description: Return comments where `createdAt > since` (non-inclusive)\n schema:\n type: string\n examples:\n isostring:\n $ref: \"#/components/examples/isostring\"\n comments_until:\n name: until\n in: query\n description: Return comments where `createdAt <= until` (inclusive)\n schema:\n type: string\n examples:\n isostring:\n $ref: \"#/components/examples/isostring\"\n references_since:\n name: since\n in: query\n description: Return references where `referencedAt > since` (non-inclusive)\n schema:\n type: string\n examples:\n isostring:\n $ref: \"#/components/examples/isostring\"\n references_until:\n name: until\n in: query\n description: Return references where `referencedAt <= until` (inclusive)\n schema:\n type: string\n examples:\n isostring:\n $ref: \"#/components/examples/isostring\"\n relationship:\n name: relationship\n in: query\n schema:\n $ref: \"#/components/schemas/Relationship\"\n examples:\n user_stevekrouse:\n value:\n {\n \"id\": \"a0bf3b31-15a5-4d5c-880e-4b1e22c9bc18\",\n \"username\": \"@stevekrouse\",\n \"bio\": \"mayor of val town\\nhttps://stevekrouse.com\",\n \"profileImageUrl\": \"https://images.clerk.dev/uploaded/img_2PqHa2Gsy93xQrjh2w78Xu0cChW.jpeg\",\n }\n val_hello:\n value:\n {\n \"id\": \"eb4a2ace-b6c8-4393-85e0-4813b3f04e12\",\n \"author\":\n {\n \"id\": \"a0bf3b31-15a5-4d5c-880e-4b1e22c9bc18\",\n \"username\": \"@stevekrouse\",\n },\n \"name\": \"hello\",\n \"code\": 'export let hello = \"Hello World\";',\n \"public\": false,\n \"privacy\": \"private\",\n \"version\": 0,\n \"runStartAt\": null,\n \"runEndAt\": null,\n \"logs\": [],\n \"output\": { \"json\": \"Hello World\" },\n \"exported\": { \"json\": { \"hello\": \"Hello World\" } },\n \"error\": null,\n \"readme\": \"# Hello\",\n \"likeCount\": 0,\n \"referenceCount\": 0,\n }\n val_hello_v1:\n value:\n {\n \"id\": \"eb4a2ace-b6c8-4393-85e0-4813b3f04e12\",\n \"author\":\n {\n \"id\": \"a0bf3b31-15a5-4d5c-880e-4b1e22c9bc18\",\n \"username\": \"@stevekrouse\",\n },\n \"name\": \"hello\",\n \"code\": 'export let hello = \"Hello World 2\";',\n \"public\": false,\n \"privacy\": \"private\",\n \"version\": 1,\n \"runStartAt\": null,\n \"runEndAt\": null,\n \"logs\": [],\n \"output\": { \"json\": \"Hello World 2\" },\n \"exported\": { \"json\": { \"hello\": \"Hello World 2\" } },\n \"error\": null,\n \"readme\": \"# Hello\",\n \"likeCount\": 0,\n \"referenceCount\": 0,\n }\n isostring:\n value: \"2023-07-26T03:28:00.000Z\"\n summary: ISO String\n responses:\n ExpressionResult:\n description: The returned result of executing the passed expression successfully. The result can be of any JSON type. It will not include any logs that were generated during execution.\n content:\n application/json:\n schema:\n oneOf:\n - type: string\n - type: number\n - type: object\n - type: array\n items: {}\n - type: boolean\n examples:\n simpleAddition:\n value: 2\n summary: Simple addition result\n functionCall:\n value: 42\n summary: Calling a function result\n\nsecurity:\n - bearerAuth: []\n - {}\n\npaths:\n /v1/me:\n get:\n summary: Get profile information for the current user\n tags: [Me]\n responses:\n \"200\":\n description: OK\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/User\"\n examples:\n stevekrouse:\n $ref: \"#/components/examples/user_stevekrouse\"\n \"401\":\n description: Unauthorized\n\n /v1/me/likes:\n get:\n summary: Get vals liked by the current user\n tags: [Me]\n parameters:\n - $ref: \"#/components/parameters/offset\"\n - $ref: \"#/components/parameters/limit\"\n responses:\n \"200\":\n description: OK\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/ValList\"\n \"401\":\n description: Unauthorized\n\n /v1/me/comments:\n get:\n summary: Get comments related to current user, either given or received\n tags: [Me]\n parameters:\n - $ref: \"#/components/parameters/offset\"\n - $ref: \"#/components/parameters/limit\"\n - $ref: \"#/components/parameters/comments_since\"\n - $ref: \"#/components/parameters/comments_until\"\n - $ref: \"#/components/parameters/relationship\"\n responses:\n \"200\":\n description: OK\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/CommentList\"\n \"401\":\n description: Unauthorized\n\n /v1/me/references:\n get:\n summary: Returns vals that depend on any of the user's vals\n tags: [Me]\n parameters:\n - $ref: \"#/components/parameters/offset\"\n - $ref: \"#/components/parameters/limit\"\n - $ref: \"#/components/parameters/references_since\"\n - $ref: \"#/components/parameters/references_until\"\n responses:\n \"200\":\n description: OK\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/ReferenceList\"\n \"401\":\n description: Unauthorized\n\n /v1/vals:\n post:\n summary: Create a new val\n tags: [Vals]\n requestBody:\n description: Code of the new val to be run.\n required: true\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/ValInput\"\n examples:\n increment:\n value: { \"code\": 'let hello = \"Hello World\";' }\n text/plain:\n schema:\n type: string\n examples:\n increment:\n value: 'let hello = \"Hello World\";'\n text/javascript:\n schema:\n type: string\n examples:\n increment:\n value: 'let hello = \"Hello World\";'\n application/javascript:\n schema:\n type: string\n examples:\n increment:\n value: 'let hello = \"Hello World\";'\n responses:\n \"200\":\n description: OK\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/FullVal\"\n examples:\n hello:\n $ref: \"#/components/examples/val_hello\"\n \"401\":\n description: Unauthorized\n put:\n summary: Create or update a val by name and code.\n tags: [Vals]\n requestBody:\n description: The JSON to set the val to\n required: true\n content:\n application/json:\n schema:\n type: object\n properties:\n name:\n type: string\n description: Name of the val\n code:\n type: string\n description: Code to run for the val\n required:\n - name\n - code\n responses:\n \"200\":\n description: OK\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/BaseVal\"\n \"401\":\n description: Unauthorized\n \"400\":\n description: Error\n\n /v1/vals/{val_id}:\n get:\n summary: Get val by id\n tags: [Vals]\n parameters:\n - $ref: \"#/components/parameters/val_id\"\n responses:\n \"200\":\n description: OK\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/FullVal\"\n examples:\n hello:\n $ref: \"#/components/examples/val_hello\"\n \"404\":\n description: Val not found\n put:\n summary: Update a val's name or privacy\n tags: [Vals]\n parameters:\n - $ref: \"#/components/parameters/val_id\"\n requestBody:\n description: Fields to be updated.\n required: true\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/ValFields\"\n examples:\n name_and_privacy:\n value: { \"name\": \"hello\", \"privacy\": \"unlisted\" }\n responses:\n \"204\":\n description: No Content\n \"401\":\n description: Unauthorized\n delete:\n summary: Delete a val\n tags: [Vals]\n parameters:\n - $ref: \"#/components/parameters/val_id\"\n responses:\n \"204\":\n description: No Content\n\n /v1/vals/{val_id}/versions:\n get:\n summary: List versions of a val\n tags: [Vals]\n parameters:\n - $ref: \"#/components/parameters/val_id\"\n - $ref: \"#/components/parameters/offset\"\n - $ref: \"#/components/parameters/limit\"\n responses:\n \"200\":\n description: OK\n content:\n application/json:\n schema:\n type: object\n allOf:\n - $ref: \"#/components/schemas/PaginatedList\"\n properties:\n data:\n type: array\n items:\n type: object\n properties:\n val_id:\n type: string\n format: uuid\n description: Unique identifier for the val.\n version:\n type: number\n description: Version number of the val.\n runStartAt:\n type:\n - string\n - \"null\"\n format: date-time\n deprecated: true\n runEndAt:\n type:\n - string\n - \"null\"\n format: date-time\n deprecated: true\n \"404\":\n description: Val not found\n post:\n summary: Create a new version of a val\n tags: [Vals]\n parameters:\n - $ref: \"#/components/parameters/val_id\"\n requestBody:\n description: Code of the new version to be run.\n required: true\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/ValInput\"\n examples:\n increment:\n value: { \"code\": 'let hello = \"Hello World 2\";' }\n text/plain:\n schema:\n type: string\n examples:\n increment:\n value: 'let hello = \"Hello World 2\";'\n text/javascript:\n schema:\n type: string\n examples:\n increment:\n value: 'let hello = \"Hello World 2\";'\n application/javascript:\n schema:\n type: string\n examples:\n increment:\n value: 'let hello = \"Hello World 2\";'\n responses:\n \"201\":\n description: Created\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/FullVal\"\n examples:\n hello:\n $ref: \"#/components/examples/val_hello_v1\"\n \"404\":\n description: Val not found\n\n /v1/vals/{val_id}/versions/{version}:\n get:\n summary: Get a specific version of a val\n tags: [Vals]\n parameters:\n - $ref: \"#/components/parameters/val_id\"\n - $ref: \"#/components/parameters/version\"\n responses:\n \"200\":\n description: OK\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/FullVal\"\n examples:\n hello:\n $ref: \"#/components/examples/val_hello\"\n \"404\":\n description: Val or version not found\n delete:\n summary: Delete a val version\n tags: [Vals]\n parameters:\n - $ref: \"#/components/parameters/val_id\"\n - $ref: \"#/components/parameters/version\"\n responses:\n \"204\":\n description: No Content\n\n /v1/users/{user_id}/vals:\n get:\n summary: List a user's vals\n tags: [Users]\n parameters:\n - $ref: \"#/components/parameters/user_id\"\n - $ref: \"#/components/parameters/offset\"\n - $ref: \"#/components/parameters/limit\"\n responses:\n \"200\":\n description: OK\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/ValList\"\n\n /v1/alias/{username}:\n get:\n summary: Get a user profile information by their username\n tags: [Alias]\n parameters:\n - $ref: \"#/components/parameters/username\"\n responses:\n \"200\":\n description: OK\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/User\"\n examples:\n stevekrouse:\n $ref: \"#/components/examples/user_stevekrouse\"\n \"404\":\n description: Not found\n\n /v1/alias/{username}/{val_name}:\n get:\n summary: Get a val by the author's username and val name\n tags: [Alias]\n parameters:\n - $ref: \"#/components/parameters/username\"\n - $ref: \"#/components/parameters/val_name\"\n responses:\n \"200\":\n description: OK\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/FullVal\"\n \"404\":\n description: Not found\n\n /v1/search/vals:\n get:\n summary: Search for vals across the platform\n tags: [Search]\n parameters:\n - name: query\n in: query\n description: Search query\n required: true\n schema:\n type: string\n minLength: 1\n maxLength: 512\n - $ref: \"#/components/parameters/offset\"\n - $ref: \"#/components/parameters/limit\"\n responses:\n \"200\":\n description: OK\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/ValList\"\n\n /v1/eval/{expression}:\n get:\n summary: Evaluate a JavaScript or TypeScript expression\n tags: [\"Eval\"]\n description: |\n Evaluates the JavaScript or TypeScript `{expression}` and responds with the returned result. \n\n ### Unauthenticated\n Unauthenticated use will have read-only access to public vals. \n\n ### Authenticated\n Authenticated use will have read access to the authenticated user's private vals and secrets, write access to the authenticated user's vals, and the ability to send the authenticated user emails via `console.email`.\n\n Vals generated via this API will *not* appear in the authenticated user's workspace.\n parameters:\n - $ref: \"#/components/parameters/expression\"\n responses:\n \"200\":\n $ref: \"#/components/responses/ExpressionResult\"\n \"400\":\n description: Bad request or Error thrown executing user code\n \"404\":\n description: Not found\n \"500\":\n description: Internal server error\n\n /v1/eval:\n post:\n summary: Evaluate a JavaScript or TypeScript expression\n tags: [\"Eval\"]\n description: |\n Evaluates the JavaScript or TypeScript `{expression}` and responds with the returned result. \n\n ### Unauthenticated\n Unauthenticated use will have read-only access to public vals. \n\n ### Authenticated\n Authenticated use will have read access to the authenticated user's private vals and secrets, write access to the authenticated user's vals, and the ability to send the authenticated user emails via `console.email`.\n\n Vals generated via this API will *not* appear in the authenticated user's workspace.\n requestBody:\n description: When used as a POST endpoint, the request body\n must contain the code to be run.\n required: true\n content:\n application/json:\n schema:\n type: object\n required: [\"code\"]\n properties:\n code:\n type: string\n args:\n type: array\n items:\n $ref: \"#/components/schemas/JSON\"\n examples:\n \"Add two numbers\":\n value: { \"code\": \"(a, b) => a + b\", \"args\": [1, 42] }\n responses:\n \"200\":\n $ref: \"#/components/responses/ExpressionResult\"\n \"400\":\n description: Bad request or Error thrown executing user code\n \"404\":\n description: Not found\n \"500\":\n description: Internal server error\n\n /v1/run/{username}.{val_name}:\n get:\n deprecated: true\n summary: Run a val as an API\n tags: [\"Run\"]\n description: This endpoint runs the specified user's val and returns the output.\n parameters:\n - $ref: \"#/components/parameters/username\"\n - $ref: \"#/components/parameters/val_name\"\n - in: query\n name: args\n schema:\n type: string\n description: The args query parameter can provide arguments to the given val. The parameter needs to be a JSON-encoded array, in which each item in the array is passed to the val as a function parameter.\n examples:\n name:\n value: '[\"Steve\"]'\n summary: Calling a function with a single string argument\n empty:\n value: \"\"\n responses:\n \"200\":\n $ref: \"#/components/responses/ExpressionResult\"\n \"400\":\n description: Bad request or Error thrown executing user code\n \"404\":\n description: Not found\n \"500\":\n description: Internal server error\n post:\n deprecated: true\n summary: Run a val as an API\n tags: [\"Run\"]\n parameters:\n - $ref: \"#/components/parameters/username\"\n - $ref: \"#/components/parameters/val_name\"\n requestBody:\n required: false\n description: Provide arguments to the given val function by including a post body with your request.\n content:\n application/json:\n schema:\n type: object\n additionalProperties: false\n properties:\n args:\n type: array\n items:\n $ref: \"#/components/schemas/JSON\"\n responses:\n \"200\":\n $ref: \"#/components/responses/ExpressionResult\"\n \"400\":\n description: Bad request or Error thrown executing user code\n \"404\":\n description: Not found\n \"500\":\n description: Internal server error\n\n \"/\":\n servers:\n - url: https://{username}-{val_name}.express.val.run\n description: Val Town API v1\n variables:\n username:\n default: stevekrouse\n val:\n default: expressHTMLExample\n get:\n summary: Run a val as an API (as an Express handler)\n tags: [\"Express\"]\n description: |\n Runs `@{username}.{val_name}` as an Express handler. \n\n `@{username}.{val_name}` must be a function. It is passed the Express [`req`](https://expressjs.com/en/4x/api.html#req) and [`res`](https://expressjs.com/en/4x/api.html#res) objects as its arguments. You can use `req` to pull out request data, and `res` to respond with any valid Express response. Learn more at the [Express docs](https://expressjs.com/en/4x/api.html).\n\n Unlike the other two APIs, the Express API is specified via subdomain and runs at `https://{username}-{val_name}.express.val.run`.\n\n ### Unauthenticated\n Unauthenticated use will only be able to call public vals as Express handlers.\n\n The val will be executed with `{username}`'s permissions (\"API Mode\"), so it will be able to read and write to `{username}`'s public and private vals, secrets, and use `console.email`.\n\n ### Authenticated\n Authenticated use is able to call private vals as Express handlers.\n responses:\n \"200\":\n description: Function executed successfully\n content:\n \"*/*\":\n schema:\n type: string\n description: The result of the executed function, in any media type\n \"400\":\n description: Bad request or Error thrown executing user code\n \"404\":\n description: Not found\n \"500\":\n description: Internal server error\n post:\n summary: Run a val as an API (as an Express handler)\n tags: [\"Express\"]\n description: |\n Runs `@{username}.{val_name}` as an Express handler. \n\n `@{username}.{val_name}` must be a function. It is passed the Express [`req`](https://expressjs.com/en/4x/api.html#req) and [`res`](https://expressjs.com/en/4x/api.html#res) objects as its arguments. You can use `req` to pull out request data, and `res` to respond with any valid Express response. Learn more at the [Express docs](https://expressjs.com/en/4x/api.html).\n\n ### Unauthenticated\n Unauthenticated use will only be able to call public vals as Express handlers.\n\n The val will be executed with `{username}`'s permissions (\"API Mode\"), so it will be able to read and write to `{username}`'s public and private vals, secrets, and use `console.email`.\n\n ### Authenticated\n Authenticated use is able to call private vals as Express handlers.\n requestBody:\n description: |\n The request body will be accessible to the val Express handler under the first argument, commonly called `req`, as `req.body`.\n required: false\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/JSON\"\n examples:\n name:\n value: '{\"name\": \"Steve\"}'\n summary: JSON object as the request body\n responses:\n \"200\":\n description: Function executed successfully\n content:\n \"*/*\":\n schema:\n type: string\n description: The result of the executed function, in any media type\n \"400\":\n description: Bad request or Error thrown executing user code\n \"404\":\n description: Not found\n \"500\":\n description: Internal server error\n";

vtOpenAPI_migratedmain.tsx1 match

@stevekrouseUpdated 1 year ago
1// set at Thu May 02 2024 18:00:24 GMT+0000 (Coordinated Universal Time)
2export let vtOpenAPI = "openapi: 3.1.0\ninfo:\n title: Val Town API\n description: |\n The Val Town API provides services to evaluate JavaScript and TypeScript expressions, run vals as APIs, either as functions or Express handlers.\n\n Learn more at [https://docs.val.town](https://docs.val.town)\n version: 1.7.0\nservers:\n - url: https://api.val.town\n description: Val Town API v1\n\ncomponents:\n securitySchemes:\n bearerAuth:\n type: http\n scheme: bearer\n bearerFormat: API Key\n schemas:\n JSON:\n oneOf:\n - type: string\n - type: number\n - type: object\n - type: array\n items: {}\n - type: boolean\n description: \"Can be anything: string, number, array, object, etc., including `null`\"\n Relationship:\n type: string\n enum: [\"received\", \"given\", \"any\"]\n Privacy:\n type: string\n enum: [\"public\", \"unlisted\", \"private\"]\n Author:\n type: object\n properties:\n id:\n description: The user's id\n type: string\n format: uuid\n username:\n description: The user's username\n type: string\n User:\n type: object\n allOf:\n - $ref: \"#/components/schemas/Author\"\n properties:\n bio:\n description: The user's bio\n type:\n - string\n - \"null\"\n profileImageUrl:\n description: The url for the user's profile picture\n type:\n - string\n - \"null\"\n BaseVal:\n type: object\n properties:\n id:\n type: string\n format: uuid\n author:\n $ref: \"#/components/schemas/Author\"\n name:\n type: string\n code:\n type: string\n public:\n type: boolean\n deprecated: true\n privacy:\n $ref: \"#/components/schemas/Privacy\"\n version:\n type: integer\n format: int32\n runEndAt:\n type:\n - string\n - \"null\"\n format: date-time\n deprecated: true\n runStartAt:\n type:\n - string\n - \"null\"\n format: date-time\n deprecated: true\n FullVal:\n type: object\n allOf:\n - $ref: \"#/components/schemas/BaseVal\"\n properties:\n logs:\n type: array\n items: {}\n output:\n type: object\n exported:\n type: object\n error:\n type: object\n readme:\n type: string\n likeCount:\n type: number\n referenceCount:\n type: number\n ValFields:\n type: object\n properties:\n name:\n type: string\n privacy:\n $ref: \"#/components/schemas/Privacy\"\n readme:\n type:\n - string\n - \"null\"\n ValInput:\n type: object\n allOf:\n - $ref: \"#/components/schemas/ValFields\"\n properties:\n code:\n type: string\n PaginatedList:\n type: object\n properties:\n data:\n type: array\n links:\n type: object\n properties:\n self:\n description: The URL of the current page of results\n type: string\n format: uri\n next:\n description: The URL of the next page of results\n type: string\n format: uri\n prev:\n description: The URL of the previous page of results\n type: string\n format: uri\n ValList:\n type: object\n allOf:\n - $ref: \"#/components/schemas/PaginatedList\"\n properties:\n data:\n type: array\n items:\n $ref: \"#/components/schemas/BaseVal\"\n BaseValRef:\n type: object\n properties:\n id:\n description: The id of the val\n type: string\n name:\n description: The name of the val\n type: string\n author:\n $ref: \"#/components/schemas/Author\"\n author_id:\n description: The id of the val's author\n type: string\n deprecated: true\n username:\n description: The username of the val's author\n type: string\n deprecated: true\n ValRef:\n type: object\n allOf:\n - $ref: \"#/components/schemas/BaseValRef\"\n properties:\n public:\n type: boolean\n deprecated: true\n privacy:\n $ref: \"#/components/schemas/Privacy\"\n version:\n type: integer\n format: int32\n BaseRun:\n type: object\n properties:\n id:\n type: string\n format: uuid\n error: {}\n parentId:\n type: string\n format: uuid\n runEndAt:\n type:\n - string\n - \"null\"\n format: date-time\n deprecated: true\n runStartAt:\n type:\n - string\n - \"null\"\n format: date-time\n deprecated: true\n val:\n $ref: \"#/components/schemas/ValRef\"\n FullRun:\n type: object\n allOf:\n - $ref: \"#/components/schemas/BaseRun\"\n properties:\n emails:\n type: array\n items: {}\n logs:\n type: array\n items: {}\n returnValue: {}\n args:\n type: array\n items: {}\n RunList:\n type: object\n allOf:\n - $ref: \"#/components/schemas/PaginatedList\"\n properties:\n data:\n type: array\n items:\n $ref: \"#/components/schemas/BaseRun\"\n Comment:\n type: object\n properties:\n id:\n type: string\n format: uuid\n author:\n $ref: \"#/components/schemas/Author\"\n comment:\n description: The contents of the comment\n type: string\n createdAt:\n type: string\n format: date-time\n val:\n $ref: \"#/components/schemas/ValRef\"\n Reference:\n type: object\n properties:\n referencedAt:\n type: string\n format: date-time\n reference:\n $ref: \"#/components/schemas/BaseValRef\"\n dependsOn:\n $ref: \"#/components/schemas/BaseValRef\"\n CommentList:\n type: object\n allOf:\n - $ref: \"#/components/schemas/PaginatedList\"\n properties:\n data:\n type: array\n items:\n $ref: \"#/components/schemas/Comment\"\n ReferenceList:\n type: object\n allOf:\n - $ref: \"#/components/schemas/PaginatedList\"\n properties:\n data:\n type: array\n items:\n $ref: \"#/components/schemas/Reference\"\n parameters:\n expression:\n in: path\n name: expression\n required: true\n description: |\n The JavaScript or TypeScript expression to be evaluated.\n This should be a single expression, like a single function\n call, assignment operation, or calculation. If you need\n to execute multiple expressions, wrap them in a function.\n schema:\n type: string\n examples:\n simpleAddition:\n value: \"1+1\"\n summary: Simple addition\n functionCall:\n value: \"@stevekrouse.addOne(@stevekrouse.example1)\"\n summary: Calling a user's val function\n user_id:\n name: user_id\n in: path\n required: true\n description: id of the user\n schema:\n type: string\n format: uuid\n examples:\n stevekrouse:\n value: \"a0bf3b31-15a5-4d5c-880e-4b1e22c9bc18\"\n username:\n name: username\n in: path\n required: true\n description: |\n The username of the val owner, *not* including the `@` symbol.\n schema:\n type: string\n examples:\n stevekrouse:\n value: stevekrouse\n summary: Steve Krouse's username\n val_id:\n name: val_id\n in: path\n required: true\n description: id of the val\n schema:\n type: string\n format: uuid\n examples:\n hello:\n value: \"eb4a2ace-b6c8-4393-85e0-4813b3f04e12\"\n val_name:\n name: val_name\n in: path\n required: true\n description: The name of the val.\n schema:\n type: string\n examples:\n id:\n value: id\n summary: \"id\"\n description: |\n This val is a function that returns its arguments. It is useful for testing how the API handles the arguments passed to it.\n\n View the val at [https://val.town/v/stevekrouse.id](https://val.town/v/stevekrouse.id)\n version:\n name: version\n in: path\n required: true\n description: val version\n schema:\n type: number\n run_id:\n name: run_id\n in: path\n required: true\n description: id of the log\n schema:\n type: string\n format: uuid\n examples:\n hello:\n value: \"cd0653ac-aede-4d0d-8c8e-21c7ef763eb2\"\n offset:\n name: offset\n in: query\n description: Pagination offset\n schema:\n type: integer\n default: 0\n minimum: 0\n limit:\n name: limit\n in: query\n description: Pagination limit\n schema:\n type: integer\n default: 20\n minimum: 1\n maximum: 100\n comments_since:\n name: since\n in: query\n description: Return comments where `createdAt > since` (non-inclusive)\n schema:\n type: string\n examples:\n isostring:\n $ref: \"#/components/examples/isostring\"\n comments_until:\n name: until\n in: query\n description: Return comments where `createdAt <= until` (inclusive)\n schema:\n type: string\n examples:\n isostring:\n $ref: \"#/components/examples/isostring\"\n references_since:\n name: since\n in: query\n description: Return references where `referencedAt > since` (non-inclusive)\n schema:\n type: string\n examples:\n isostring:\n $ref: \"#/components/examples/isostring\"\n references_until:\n name: until\n in: query\n description: Return references where `referencedAt <= until` (inclusive)\n schema:\n type: string\n examples:\n isostring:\n $ref: \"#/components/examples/isostring\"\n relationship:\n name: relationship\n in: query\n schema:\n $ref: \"#/components/schemas/Relationship\"\n examples:\n user_stevekrouse:\n value:\n {\n \"id\": \"a0bf3b31-15a5-4d5c-880e-4b1e22c9bc18\",\n \"username\": \"@stevekrouse\",\n \"bio\": \"mayor of val town\\nhttps://stevekrouse.com\",\n \"profileImageUrl\": \"https://images.clerk.dev/uploaded/img_2PqHa2Gsy93xQrjh2w78Xu0cChW.jpeg\",\n }\n val_hello:\n value:\n {\n \"id\": \"eb4a2ace-b6c8-4393-85e0-4813b3f04e12\",\n \"author\":\n {\n \"id\": \"a0bf3b31-15a5-4d5c-880e-4b1e22c9bc18\",\n \"username\": \"@stevekrouse\",\n },\n \"name\": \"hello\",\n \"code\": 'export let hello = \"Hello World\";',\n \"public\": false,\n \"privacy\": \"private\",\n \"version\": 0,\n \"runStartAt\": null,\n \"runEndAt\": null,\n \"logs\": [],\n \"output\": { \"json\": \"Hello World\" },\n \"exported\": { \"json\": { \"hello\": \"Hello World\" } },\n \"error\": null,\n \"readme\": \"# Hello\",\n \"likeCount\": 0,\n \"referenceCount\": 0,\n }\n val_hello_v1:\n value:\n {\n \"id\": \"eb4a2ace-b6c8-4393-85e0-4813b3f04e12\",\n \"author\":\n {\n \"id\": \"a0bf3b31-15a5-4d5c-880e-4b1e22c9bc18\",\n \"username\": \"@stevekrouse\",\n },\n \"name\": \"hello\",\n \"code\": 'export let hello = \"Hello World 2\";',\n \"public\": false,\n \"privacy\": \"private\",\n \"version\": 1,\n \"runStartAt\": null,\n \"runEndAt\": null,\n \"logs\": [],\n \"output\": { \"json\": \"Hello World 2\" },\n \"exported\": { \"json\": { \"hello\": \"Hello World 2\" } },\n \"error\": null,\n \"readme\": \"# Hello\",\n \"likeCount\": 0,\n \"referenceCount\": 0,\n }\n isostring:\n value: \"2023-07-26T03:28:00.000Z\"\n summary: ISO String\n responses:\n ExpressionResult:\n description: The returned result of executing the passed expression successfully. The result can be of any JSON type. It will not include any logs that were generated during execution.\n content:\n application/json:\n schema:\n oneOf:\n - type: string\n - type: number\n - type: object\n - type: array\n items: {}\n - type: boolean\n examples:\n simpleAddition:\n value: 2\n summary: Simple addition result\n functionCall:\n value: 42\n summary: Calling a function result\n\nsecurity:\n - bearerAuth: []\n - {}\n\npaths:\n /v1/me:\n get:\n summary: Get profile information for the current user\n tags: [Me]\n responses:\n \"200\":\n description: OK\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/User\"\n examples:\n stevekrouse:\n $ref: \"#/components/examples/user_stevekrouse\"\n \"401\":\n description: Unauthorized\n\n /v1/me/likes:\n get:\n summary: Get vals liked by the current user\n tags: [Me]\n parameters:\n - $ref: \"#/components/parameters/offset\"\n - $ref: \"#/components/parameters/limit\"\n responses:\n \"200\":\n description: OK\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/ValList\"\n \"401\":\n description: Unauthorized\n\n /v1/me/comments:\n get:\n summary: Get comments related to current user, either given or received\n tags: [Me]\n parameters:\n - $ref: \"#/components/parameters/offset\"\n - $ref: \"#/components/parameters/limit\"\n - $ref: \"#/components/parameters/comments_since\"\n - $ref: \"#/components/parameters/comments_until\"\n - $ref: \"#/components/parameters/relationship\"\n responses:\n \"200\":\n description: OK\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/CommentList\"\n \"401\":\n description: Unauthorized\n\n /v1/me/references:\n get:\n summary: Returns vals that depend on any of the user's vals\n tags: [Me]\n parameters:\n - $ref: \"#/components/parameters/offset\"\n - $ref: \"#/components/parameters/limit\"\n - $ref: \"#/components/parameters/references_since\"\n - $ref: \"#/components/parameters/references_until\"\n responses:\n \"200\":\n description: OK\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/ReferenceList\"\n \"401\":\n description: Unauthorized\n\n /v1/vals:\n post:\n summary: Create a new val\n tags: [Vals]\n requestBody:\n description: Code of the new val to be run.\n required: true\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/ValInput\"\n examples:\n increment:\n value: { \"code\": 'let hello = \"Hello World\";' }\n text/plain:\n schema:\n type: string\n examples:\n increment:\n value: 'let hello = \"Hello World\";'\n text/javascript:\n schema:\n type: string\n examples:\n increment:\n value: 'let hello = \"Hello World\";'\n application/javascript:\n schema:\n type: string\n examples:\n increment:\n value: 'let hello = \"Hello World\";'\n responses:\n \"200\":\n description: OK\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/FullVal\"\n examples:\n hello:\n $ref: \"#/components/examples/val_hello\"\n \"401\":\n description: Unauthorized\n put:\n summary: Create or update a val by name and code.\n tags: [Vals]\n requestBody:\n description: The JSON to set the val to\n required: true\n content:\n application/json:\n schema:\n type: object\n properties:\n name:\n type: string\n description: Name of the val\n code:\n type: string\n description: Code to run for the val\n required:\n - name\n - code\n responses:\n \"200\":\n description: OK\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/BaseVal\"\n \"401\":\n description: Unauthorized\n \"400\":\n description: Error\n\n /v1/vals/{val_id}:\n get:\n summary: Get val by id\n tags: [Vals]\n parameters:\n - $ref: \"#/components/parameters/val_id\"\n responses:\n \"200\":\n description: OK\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/FullVal\"\n examples:\n hello:\n $ref: \"#/components/examples/val_hello\"\n \"404\":\n description: Val not found\n put:\n summary: Update a val's name or privacy\n tags: [Vals]\n parameters:\n - $ref: \"#/components/parameters/val_id\"\n requestBody:\n description: Fields to be updated.\n required: true\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/ValFields\"\n examples:\n name_and_privacy:\n value: { \"name\": \"hello\", \"privacy\": \"unlisted\" }\n responses:\n \"204\":\n description: No Content\n \"401\":\n description: Unauthorized\n delete:\n summary: Delete a val\n tags: [Vals]\n parameters:\n - $ref: \"#/components/parameters/val_id\"\n responses:\n \"204\":\n description: No Content\n\n /v1/vals/{val_id}/versions:\n get:\n summary: List versions of a val\n tags: [Vals]\n parameters:\n - $ref: \"#/components/parameters/val_id\"\n - $ref: \"#/components/parameters/offset\"\n - $ref: \"#/components/parameters/limit\"\n responses:\n \"200\":\n description: OK\n content:\n application/json:\n schema:\n type: object\n allOf:\n - $ref: \"#/components/schemas/PaginatedList\"\n properties:\n data:\n type: array\n items:\n type: object\n properties:\n val_id:\n type: string\n format: uuid\n description: Unique identifier for the val.\n version:\n type: number\n description: Version number of the val.\n runStartAt:\n type:\n - string\n - \"null\"\n format: date-time\n deprecated: true\n runEndAt:\n type:\n - string\n - \"null\"\n format: date-time\n deprecated: true\n \"404\":\n description: Val not found\n post:\n summary: Create a new version of a val\n tags: [Vals]\n parameters:\n - $ref: \"#/components/parameters/val_id\"\n requestBody:\n description: Code of the new version to be run.\n required: true\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/ValInput\"\n examples:\n increment:\n value: { \"code\": 'let hello = \"Hello World 2\";' }\n text/plain:\n schema:\n type: string\n examples:\n increment:\n value: 'let hello = \"Hello World 2\";'\n text/javascript:\n schema:\n type: string\n examples:\n increment:\n value: 'let hello = \"Hello World 2\";'\n application/javascript:\n schema:\n type: string\n examples:\n increment:\n value: 'let hello = \"Hello World 2\";'\n responses:\n \"201\":\n description: Created\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/FullVal\"\n examples:\n hello:\n $ref: \"#/components/examples/val_hello_v1\"\n \"404\":\n description: Val not found\n\n /v1/vals/{val_id}/versions/{version}:\n get:\n summary: Get a specific version of a val\n tags: [Vals]\n parameters:\n - $ref: \"#/components/parameters/val_id\"\n - $ref: \"#/components/parameters/version\"\n responses:\n \"200\":\n description: OK\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/FullVal\"\n examples:\n hello:\n $ref: \"#/components/examples/val_hello\"\n \"404\":\n description: Val or version not found\n delete:\n summary: Delete a val version\n tags: [Vals]\n parameters:\n - $ref: \"#/components/parameters/val_id\"\n - $ref: \"#/components/parameters/version\"\n responses:\n \"204\":\n description: No Content\n\n /v1/users/{user_id}/vals:\n get:\n summary: List a user's vals\n tags: [Users]\n parameters:\n - $ref: \"#/components/parameters/user_id\"\n - $ref: \"#/components/parameters/offset\"\n - $ref: \"#/components/parameters/limit\"\n responses:\n \"200\":\n description: OK\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/ValList\"\n\n /v1/alias/{username}:\n get:\n summary: Get a user profile information by their username\n tags: [Alias]\n parameters:\n - $ref: \"#/components/parameters/username\"\n responses:\n \"200\":\n description: OK\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/User\"\n examples:\n stevekrouse:\n $ref: \"#/components/examples/user_stevekrouse\"\n \"404\":\n description: Not found\n\n /v1/alias/{username}/{val_name}:\n get:\n summary: Get a val by the author's username and val name\n tags: [Alias]\n parameters:\n - $ref: \"#/components/parameters/username\"\n - $ref: \"#/components/parameters/val_name\"\n responses:\n \"200\":\n description: OK\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/FullVal\"\n \"404\":\n description: Not found\n\n /v1/search/vals:\n get:\n summary: Search for vals across the platform\n tags: [Search]\n parameters:\n - name: query\n in: query\n description: Search query\n required: true\n schema:\n type: string\n minLength: 1\n maxLength: 512\n - $ref: \"#/components/parameters/offset\"\n - $ref: \"#/components/parameters/limit\"\n responses:\n \"200\":\n description: OK\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/ValList\"\n\n /v1/eval/{expression}:\n get:\n summary: Evaluate a JavaScript or TypeScript expression\n tags: [\"Eval\"]\n description: |\n Evaluates the JavaScript or TypeScript `{expression}` and responds with the returned result. \n\n ### Unauthenticated\n Unauthenticated use will have read-only access to public vals. \n\n ### Authenticated\n Authenticated use will have read access to the authenticated user's private vals and secrets, write access to the authenticated user's vals, and the ability to send the authenticated user emails via `console.email`.\n\n Vals generated via this API will *not* appear in the authenticated user's workspace.\n parameters:\n - $ref: \"#/components/parameters/expression\"\n responses:\n \"200\":\n $ref: \"#/components/responses/ExpressionResult\"\n \"400\":\n description: Bad request or Error thrown executing user code\n \"404\":\n description: Not found\n \"500\":\n description: Internal server error\n\n /v1/eval:\n post:\n summary: Evaluate a JavaScript or TypeScript expression\n tags: [\"Eval\"]\n description: |\n Evaluates the JavaScript or TypeScript `{expression}` and responds with the returned result. \n\n ### Unauthenticated\n Unauthenticated use will have read-only access to public vals. \n\n ### Authenticated\n Authenticated use will have read access to the authenticated user's private vals and secrets, write access to the authenticated user's vals, and the ability to send the authenticated user emails via `console.email`.\n\n Vals generated via this API will *not* appear in the authenticated user's workspace.\n requestBody:\n description: When used as a POST endpoint, the request body\n must contain the code to be run.\n required: true\n content:\n application/json:\n schema:\n type: object\n required: [\"code\"]\n properties:\n code:\n type: string\n args:\n type: array\n items:\n $ref: \"#/components/schemas/JSON\"\n examples:\n \"Add two numbers\":\n value: { \"code\": \"(a, b) => a + b\", \"args\": [1, 42] }\n responses:\n \"200\":\n $ref: \"#/components/responses/ExpressionResult\"\n \"400\":\n description: Bad request or Error thrown executing user code\n \"404\":\n description: Not found\n \"500\":\n description: Internal server error\n\n /v1/run/{username}.{val_name}:\n get:\n deprecated: true\n summary: Run a val as an API\n tags: [\"Run\"]\n description: This endpoint runs the specified user's val and returns the output.\n parameters:\n - $ref: \"#/components/parameters/username\"\n - $ref: \"#/components/parameters/val_name\"\n - in: query\n name: args\n schema:\n type: string\n description: The args query parameter can provide arguments to the given val. The parameter needs to be a JSON-encoded array, in which each item in the array is passed to the val as a function parameter.\n examples:\n name:\n value: '[\"Steve\"]'\n summary: Calling a function with a single string argument\n empty:\n value: \"\"\n responses:\n \"200\":\n $ref: \"#/components/responses/ExpressionResult\"\n \"400\":\n description: Bad request or Error thrown executing user code\n \"404\":\n description: Not found\n \"500\":\n description: Internal server error\n post:\n deprecated: true\n summary: Run a val as an API\n tags: [\"Run\"]\n parameters:\n - $ref: \"#/components/parameters/username\"\n - $ref: \"#/components/parameters/val_name\"\n requestBody:\n required: false\n description: Provide arguments to the given val function by including a post body with your request.\n content:\n application/json:\n schema:\n type: object\n additionalProperties: false\n properties:\n args:\n type: array\n items:\n $ref: \"#/components/schemas/JSON\"\n responses:\n \"200\":\n $ref: \"#/components/responses/ExpressionResult\"\n \"400\":\n description: Bad request or Error thrown executing user code\n \"404\":\n description: Not found\n \"500\":\n description: Internal server error\n\n \"/\":\n servers:\n - url: https://{username}-{val_name}.express.val.run\n description: Val Town API v1\n variables:\n username:\n default: stevekrouse\n val:\n default: expressHTMLExample\n get:\n summary: Run a val as an API (as an Express handler)\n tags: [\"Express\"]\n description: |\n Runs `@{username}.{val_name}` as an Express handler. \n\n `@{username}.{val_name}` must be a function. It is passed the Express [`req`](https://expressjs.com/en/4x/api.html#req) and [`res`](https://expressjs.com/en/4x/api.html#res) objects as its arguments. You can use `req` to pull out request data, and `res` to respond with any valid Express response. Learn more at the [Express docs](https://expressjs.com/en/4x/api.html).\n\n Unlike the other two APIs, the Express API is specified via subdomain and runs at `https://{username}-{val_name}.express.val.run`.\n\n ### Unauthenticated\n Unauthenticated use will only be able to call public vals as Express handlers.\n\n The val will be executed with `{username}`'s permissions (\"API Mode\"), so it will be able to read and write to `{username}`'s public and private vals, secrets, and use `console.email`.\n\n ### Authenticated\n Authenticated use is able to call private vals as Express handlers.\n responses:\n \"200\":\n description: Function executed successfully\n content:\n \"*/*\":\n schema:\n type: string\n description: The result of the executed function, in any media type\n \"400\":\n description: Bad request or Error thrown executing user code\n \"404\":\n description: Not found\n \"500\":\n description: Internal server error\n post:\n summary: Run a val as an API (as an Express handler)\n tags: [\"Express\"]\n description: |\n Runs `@{username}.{val_name}` as an Express handler. \n\n `@{username}.{val_name}` must be a function. It is passed the Express [`req`](https://expressjs.com/en/4x/api.html#req) and [`res`](https://expressjs.com/en/4x/api.html#res) objects as its arguments. You can use `req` to pull out request data, and `res` to respond with any valid Express response. Learn more at the [Express docs](https://expressjs.com/en/4x/api.html).\n\n ### Unauthenticated\n Unauthenticated use will only be able to call public vals as Express handlers.\n\n The val will be executed with `{username}`'s permissions (\"API Mode\"), so it will be able to read and write to `{username}`'s public and private vals, secrets, and use `console.email`.\n\n ### Authenticated\n Authenticated use is able to call private vals as Express handlers.\n requestBody:\n description: |\n The request body will be accessible to the val Express handler under the first argument, commonly called `req`, as `req.body`.\n required: false\n content:\n application/json:\n schema:\n $ref: \"#/components/schemas/JSON\"\n examples:\n name:\n value: '{\"name\": \"Steve\"}'\n summary: JSON object as the request body\n responses:\n \"200\":\n description: Function executed successfully\n content:\n \"*/*\":\n schema:\n type: string\n description: The result of the executed function, in any media type\n \"400\":\n description: Bad request or Error thrown executing user code\n \"404\":\n description: Not found\n \"500\":\n description: Internal server error\n";

Setupmain.tsx1 match

@iamseeleyUpdated 1 year ago
9 name TEXT,
10 bio TEXT,
11 profile_image BLOB
12 )
13`);

brainrot_image_gen1 file match

@dcm31Updated 6 days ago
Generate images for Italian Brainrot characters using FAL AI

modifyImage2 file matches

@stevekrouseUpdated 1 week ago
Atiq
"Focal Lens with Atig Wazir" "Welcome to my photography journey! I'm Atiq Wazir, a passionate photographer capturing life's beauty one frame at a time. Explore my gallery for stunning images, behind-the-scenes stories, and tips & tricks to enhance your own