### API Request to Start a Backup Job Source: https://gitlab.com/raclettejs/core-dev/-/blob/main/@docs/compiled-docs/docs/official-plugins/cli-connector.md This is an example of a POST request to the /run/:cmd endpoint to initiate a long-running backup process. ```json POST /plugin/raclette/plugin-cli-connector/run/backup-database { "args": ["full", "production"] } ``` -------------------------------- ### Create Example Service Source: https://gitlab.com/raclettejs/core-dev/-/blob/main/@docs/compiled-docs/docs/examples/cooking-steps/backend/snippets/wrappers/backendIndexDatatypeWrapper.md Creates an example service instance using the initialized models. ```typescript const exampleService = createExampleService(models.example) ``` -------------------------------- ### Example AI Prompt for Plugin Development Source: https://gitlab.com/raclettejs/core-dev/-/blob/main/@docs/compiled-docs/docs/coding-with-ai/introduction.md This prompt guides an AI to act as an expert Vue3 and racletteJS developer, utilizing a plugin boilerplate and Context7 documentation to build a new plugin. It specifies file structure, API call placement, and i18n key location. ```text You are an expert vue3 and racletteJS developer with modern es6 approaches and vue3 best practices in mind: I want to build a racletteJS plugin that [describes your feature]. I'm using the plugin boilerplate from https://gitlab.com/raclettejs/core-dev/-/tree/main/@raclettejs/playground/plugins/raclette__boilerplate?ref_type=heads Please reference the racletteJS documentation at https://context7.com/gitlab_raclettejs/docs Plese rewrite the backend files to fit the naming, model and schema structure discussed earlier. Locate all i18n keys in the index.ts of the frontend directory. Make sure that all $store and $data pluginApi calls stay in the *Widget.vue file. Provide all necessary contents to the respective child components. ``` -------------------------------- ### Refresh Lockfile and Install Dependencies Source: https://gitlab.com/raclettejs/core-dev/-/blob/main/@docs/compiled-docs/docs/introduction/core-monorepo-for-maintainers.md Use this command to refresh the lockfile and perform nested installs, similar to `:install`. ```bash yarn :install:refresh-lockfile ``` -------------------------------- ### Create Example Payload Source: https://gitlab.com/raclettejs/core-dev/-/blob/main/@docs/compiled-docs/docs/examples/cooking-steps/backend/plugin/helpers/pluginHelper.md Asynchronously creates a payload for 'example' type using the fastify instance. Requires plugin instance, an array of example items, and frontend request data. ```typescript import { FrontendPayloadRequestData, PluginFastifyInstance, } from "@raclettejs/core" import { example } from "../example.schema" export const createexamplePayload = async ( fastify: PluginFastifyInstance, items: example[], requestData: FrontendPayloadRequestData, ) => { const res = await fastify.createPayload("example", items, requestData) return res } ``` -------------------------------- ### Install Core Monorepo Dependencies Source: https://gitlab.com/raclettejs/core-dev/-/blob/main/@docs/compiled-docs/docs/introduction/core-monorepo-for-maintainers.md Run these commands sequentially to install all necessary dependencies for the monorepo. `yarn install` is required before `yarn :install`. ```bash yarn install yarn :install yarn :build # optional for day-to-day dev; required before releases / :release:prepare ``` -------------------------------- ### Complete raclette.plugin.ts Example Source: https://gitlab.com/raclettejs/core-dev/-/blob/main/@docs/compiled-docs/docs/plugin-development/metadata.md A comprehensive example demonstrating the structure and usage of all metadata fields, options, and lifecycle hooks within a `raclette.plugin.ts` file. ```javascript export default { name: "advanced-canvas", author: "Canvas Team", version: "1.2.0", description: "Advanced canvas plugin with collaborative features and real-time synchronization", repository: "https://github.com/canvas-team/advanced-canvas", license: "MIT", // Plugin dependencies dependencies: ["websocket-manager", "user-authentication"], // Plugin configuration options: { maxCanvasSize: { width: 5000, height: 5000 }, enableRealTimeSync: true, defaultZoomLevel: 1.0, supportedFormats: ["png", "jpg", "svg"], collaboration: { maxUsers: 50, cursorsVisible: true, enableChat: true, }, }, // Lifecycle hooks hooks: { beforeMount: async (app) => { console.log("Setting up canvas environment...") // Initialize canvas utilities await initializeCanvasUtils() // Setup global styles injectCanvasStyles() }, mounted: async (app) => { console.log("Canvas plugin mounted successfully") // Register global canvas components app.component("GlobalCanvas", CanvasComponent) // Start background services startCanvasServices() }, beforeUnmount: async (app) => { console.log("Cleaning up canvas resources...") // Stop background services stopCanvasServices() // Clear canvas cache clearCanvasCache() }, }, } ``` -------------------------------- ### Start Local Development Environment Source: https://gitlab.com/raclettejs/core-dev/-/blob/main/@docs/compiled-docs/docs/introduction/cli-commands.md Starts the local development environment using Docker Compose. Use the --filter option to specify services. ```bash yarn dev --filter frontend ``` -------------------------------- ### $data.example.getAll Source: https://gitlab.com/raclettejs/core-dev/-/blob/main/@docs/compiled-docs/docs/guides/howto/FAQ/dataApi.md Fetches all items from the example model with optional parameters and execution options. ```APIDOC ## GET $data.example.getAll ### Description Fetches all items from the example model. This method is part of the Data Access & Mutation API and integrates with the backend, store, and caching layer. ### Method GET ### Endpoint $data.example.getAll ### Parameters #### Query Parameters - **params** (object) - Optional - The object you want to send to the backend. - **id** (boolean) - Optional - If set, this will be used instead of the query instance nanoId. - **options** (object) - Optional - Configuration for the request. - **immediate** (boolean) - If true, the action will be executed right away, defaults to false. - **cb** (function) - A function which will get called after the action is resolved. Receives the result object. - **notify** (boolean) - If false, will not write into the notification queue and snackbar, defaults to true. - **responseType** (string) - Only used if you want to explicitly receive an HTTP stream. Set to 'stream' in that case, defaults to 'json'. - **mode** (string) - If responseType is stream, you can set mode 'cors' here. - **useCache** (boolean) - If false, will bypass the global query cache. Defaults to true. - **useStore** (boolean) - If false, will not write the data to the redux store. Defaults to true. ### Request Example ```json { "params": {}, "id": false, "options": { "immediate": false, "cb": (result) => {}, "notify": true, "responseType": "json", "mode": "none", "useCache": true, "useStore": true }, "config": {} } ``` ### Response #### Success Response (200) - **data** - The result object. - **dataArr** - The resultArray. - **response** - The response from the server. - **query** - The query object (only in reading queries). - **execute** - An awaitable function to trigger the action call. The response and result returned from this function are not reactive! Use dataArr or data. - **isLoading** - A boolean indicator for the loading/fetch state. - **error** - Contains the error object if errors are caught. #### Response Example ```json { "data": {}, "dataArr": [], "response": {}, "query": {}, "isLoading": false, "error": null } ``` ``` -------------------------------- ### Register Example Schemas Source: https://gitlab.com/raclettejs/core-dev/-/blob/main/@docs/compiled-docs/docs/examples/cooking-steps/backend/snippets/wrappers/backendIndexMinimalWrapper.md Registers example schemas for the Fastify instance. ```typescript registerExampleSchemas(fastify) ``` -------------------------------- ### Real-world Example with $data, $socket, and $eventbus Source: https://gitlab.com/raclettejs/core-dev/-/blob/main/@docs/compiled-docs/docs/guides/howto/FAQ/dataApi.md A comprehensive example showcasing the integration of $data for initial fetch and mutations, $socket for real-time event handling, and $eventbus for UI notifications. It includes auto-fetching, refetching after mutations, and displaying snackbar messages. ```typescript const { $data, $socket, $eventbus } = usePluginApi() const { data, execute } = $data.todo.getAll({ params: { isDeleted: false }, options: { immediate: true }, }) const { execute: createTodo } = $data.todo.create({ options: { cb: () => execute() }, }) $socket.on("todoDeleted", () => { $eventbus.global.emit("ui/addToSnackbar", { message: "Todo deleted", color: "yellow", }) execute() }) ``` -------------------------------- ### Install CLI Connector Plugin Source: https://gitlab.com/raclettejs/core-dev/-/blob/main/@docs/compiled-docs/docs/official-plugins/cli-connector.md Install the CLI Connector plugin using yarn. This is the first step to integrating command-line tools. ```bash yarn add @raclettejs/plugin-cli-connector ``` -------------------------------- ### Register Example Service Source: https://gitlab.com/raclettejs/core-dev/-/blob/main/@docs/compiled-docs/docs/examples/cooking-steps/backend/snippets/wrappers/backendIndexDatatypeWrapper.md Registers the created example service onto the Fastify instance's custom properties. ```typescript fastify.custom.exampleService = exampleService ``` -------------------------------- ### Accessing Plugin API in Vue `setup()` Source: https://gitlab.com/raclettejs/core-dev/-/blob/main/@docs/compiled-docs/docs/plugin-development/frontend/how-to/use-plugin-api.md Call `usePluginApi()` inside your Vue component's `setup()` function to get access to the plugin's runtime API. This is the standard method for interacting with your plugin's core functionalities. ```typescript const { $data, $store, $i18n, $socket, $log, $user } = usePluginApi() ``` -------------------------------- ### Troubleshooting Workbench Container Startup Source: https://gitlab.com/raclettejs/core-dev/-/blob/main/README.md If workbench containers do not start properly due to timing or network issues, run yarn :down followed by yarn :dev again. This issue is typically resolved after the initial build and image setup. ```sh yarn :down yarn :dev ``` -------------------------------- ### getAll Example Source: https://gitlab.com/raclettejs/core-dev/-/blob/main/@docs/compiled-docs/docs/examples/cooking-steps/frontend/api/data.md Demonstrates how to use the `getAll` method from the `$data.example` API to fetch data. It includes details on parameters, options, and returned values. ```APIDOC ## getAll ### Description Fetches data using the `getAll` method. This method can be configured with various options to control its behavior, such as immediate execution, callback functions, caching, and response types. ### Method `$data.example.getAll(config)` ### Parameters #### Params - **params** (object) - Required - The object you want to send to the backend. - **id** (boolean) - Optional - If set, this will be used instead of the query instance nanoId. - **options** (object) - Optional - Configuration options for the data fetch. - **immediate** (boolean) - Optional - If true, the action will be executed right away, defaults to false. - **cb** (function) - Optional - A function which will get called after the action is resolved. Receives the result object. - **useStore** (boolean) - Optional - If false, will not write the data to the redux store. Defaults to true. - **useCache** (boolean) - Optional - If false, will bypass the global query cache. Defaults to true. - **notify** (boolean) - Optional - If false, will not write into the notification queue and snackbar. Defaults to true. - **responseType** (string) - Optional - Set to 'stream' if you want to explicitly receive an HTTP stream, defaults to 'json'. - **mode** (string) - Optional - If responseType is 'stream', you can set mode to 'cors'. - **config** (object) - Optional - Additional configuration object. ### Returns - **data** - The result object. - **dataArr** - The result array. - **response** - The response from the server. - **query** - The query object (only in reading queries). - **execute** - An awaitable function to trigger the action call. The response and result returned from this function are not reactive! Use dataArr or data. - **isLoading** - A boolean indicator for the loading/fetch state. - **error** - Contains the error object if errors are caught. ### Request Example ```typescript const { $data } = usePluginApi() const {data, dataArr, response, query, execute, isLoading, error } = $data.example.getAll({ params: { key: "value" }, id: false, options: { immediate: false, cb: (result) => { console.log(result) }, notify: true, responseType: "json", mode: "cors", useCache: true, useStore: true, }, config: {} }) ``` ### Response Example ```json { "data": {}, "dataArr": [], "response": {}, "query": {}, "isLoading": false, "error": null } ``` ``` -------------------------------- ### DataExporter Quick Start Source: https://gitlab.com/raclettejs/core-dev/-/blob/main/@docs/compiled-docs/docs/guides/howto/FAQ/exporterUsage.md Basic setup for the DataExporter component within a Vue template. Ensure 'item-value' is correctly set to a unique key for proper row mapping. ```vue