An extension to get randomized results from directus.

Overview

Directus Extension Randomized Results

As the name suggests this extension will enable Randomized results mirroring the Directus /items/:collection endpoint.

Tested with Directus 9.16.1

Installation

  • Download or fork the repository
  • Install the requirements
    npm install
  • Build the extension
    npm run build
  • Move the result to your extension folder
    mv dist extensions/hooks/directus-websocket-subscribe
  • Restart your Directus instance

Usages

Mirrors the REST version of this core endpoint supporting the same parameters https://docs.directus.io/reference/items.html#get-items

GET /randomized/test_collection

[
   { "id": 6, "status": "draft", "value": "369" },
   { "id": 2, "status": "published", "value": "456" },
   { "id": 4, "status": "published", "value": "147" },
   { "id": 3, "status": "published", "value": "789" },
   { "id": 5, "status": "draft", "value": "258" },
   { "id": 1, "status": "published", "value": "123" }
]
[
    {"id": 3, "status": "published", "value": "789"},
    {"id": 4, "status": "published", "value": "147"},
    {"id": 1, "status": "published", "value": "123"},
    {"id": 2, "status": "published", "value": "456"},
    {"id": 5, "status": "draft", "value": "258"},
    {"id": 6, "status": "draft", "value": "369"}
]

GET /randomized/test_collection?limit=2

[
    {"id": 4, "status": "published", "value": "147"},
    {"id": 5, "status": "draft", "value": "258"}
]
[
    {"id": 2, "status": "published", "value": "456"},
    {"id": 4, "status": "published", "value": "147"}
]

GET /randomized/test_collection?limit=2&filter[status][_eq]=published&fields=value,status

[
    {"value": "456", "status": "published"},
    {"value": "147", "status": "published"}
]
[
    {"value": "789", "status": "published"},
    {"value": "147", "status": "published"}
]
You might also like...

Elections in Russia, Saint Petersburg, 2021: results, turnout, and commission data. With image charts and brief introduction to election fraud methods used.

Elections in Russia, Saint Petersburg, 2021: results, turnout, and commission data. With image charts and brief introduction to election fraud methods used.

2021 Elections in Saint Petersburg, Russia 🇷🇺 Переключиться на русский 📈 Jump to charts 🤖 Telegram bot In Russia, Saint Petersburg from 17th to 19

Dec 26, 2022

A landing page, as well as a results page, that utliize both Yelp API and Google Maps API.

A landing page, as well as a results page, that utliize both Yelp API and Google Maps API.

Economic Eats Group Project #1 Maintained By: Austin Donovan John Hysong John Guzzetta Jahnathan Exantus Description This project contains a landing p

Aug 4, 2022

Show a helpful summary of test results in GitHub Actions CI/CD workflow runs

Test Summary Produce an easy-to-read summary of your project's test data as part of your GitHub Actions CI/CD workflow. This helps you understand at-a

Jan 2, 2023

📈 AI powered web scraper that let's you scrape anything you want from the web including google search results

AI powered web scraper that let's you scrape anything you want from the web including google web search results from your terminal. And at the same ti

Dec 27, 2022

Perform queries on the current graph and batch process on the results.

Perform queries on the current graph and batch process on the results.

logseq-plugin-batch-op 对当前库进行查询并对查询结果进行批量操作。 Perform queries on the current graph and batch process on the results. 使用展示 (Usage) 批量删除 (Batch Delete) 批

Dec 1, 2022

A self-hosted Thumbnail generator/finder which creates thumbnails based on folder names and google search results.

A self-hosted Thumbnail generator/finder which creates thumbnails based on folder names and google search results.

Thumba A self hosted Thumbnail generator/finder which creates thumbnails based on folder names and google search results. Description This project use

Dec 15, 2022

Build Schema.org graphs for JavaScript Runtimes (Browser, Node, etc). Improve your sites SEO with quick and easy Rich Results.

schema-org-graph-js The quickest and easiest way to build Schema.org graphs for JavaScript Runtimes (Browser, Node, etc). Status: 🔨 In Development Pl

Dec 21, 2022

🎲 An exact-results dice-rolling library, for answering dice-related stat questions.

Roll.js 🎲 An exact-results dice-rolling library, for answering dice-related stat questions. I'm an avid D&D player, as is my brother, and we both lik

Dec 28, 2022

Text Engraving & Extrusion demo based on Three.js is implemented with Typescript and webpack5. Used THREE-CSGMesh as the core tech to achieve engraving and extrusion results

Text Engraving & Extrusion demo based on Three.js is implemented with Typescript and webpack5. Used THREE-CSGMesh as the core tech to achieve engraving and extrusion results

Text Engraving & Extrusion Text Engraving & Extrusion demo is implemented using Three.js, with Typescript and webpack5. Used THREE-CSGMesh as the core

Oct 12, 2022
Comments
  • "register is not a function"

    Trying to get this to work but when I start up Directus I get an error saying "register is not a function"

    • I'm running Directus 9.16.1 (the version mentioned in the readme) through docker.
    • Cloned the repo, npm install, npm run build, moved the file according to the readme
    opened by Thundernerd 1
Owner
Brainslug
Brainslug
Mixed Messages is a simple Node.js application, that will print a randomized fake fact to the terminal each time it is ran.

Mixed Messages - Fake Fact Generator Mixed Messages is a simple Node.js application, That will print a randomized fake fact to the terminal each time

Parietic 2 Jan 10, 2022
Directus Hook Extension: Version Control Changelog

A Directus hook extension to push user written change summaries (from a singleton collection text field) to a changelog in a VCS server

BIX Digital Lab 11 Nov 27, 2022
🔎 (Draft!) VSCode extension to show the search results in a tree view

vscode-search-tree ?? (Draft!) VSCode extension to show the search results in a tree view The work on this extension is on-pause for now since VSCode

Oleksii Trekhleb 16 Sep 7, 2022
Directus dataprovider package for refine.

refine-directus Directus dataprovider package for refine. About refine offers lots of out-of-the box functionality for rapid development, without comp

Vivek Palanisamy 15 Dec 27, 2022
The official Directus SDK for use in JavaScript!

Directus JS SDK Installation npm install @directus/sdk Basic Usage import { Directus } from '@directus/sdk'; const directus = new Directus('http://d

Directus 36 Dec 29, 2022
Custom endpoint to backup the PG database and upload the `.dump` to Directus.

Directus Backup Endpoint Custom Directus endpoint to backup Postgres database using pg_dump and upload the .dump file into Directus files. Usage Clone

Guilherme Oliveira 7 Dec 21, 2022
Custom operation to backup the PG database and upload the .dump to Directus.

Directus Backup Operation Custom Directus operation to backup Postgres database using pg_dump and upload the .dump file into Directus storage. Prerequ

Guilherme Oliveira 7 Dec 21, 2022
This repository contains a basic example on how to set up and run test automation jobs with CircleCI and report results to Testmo.

CircleCI test automation example This repository contains a basic example on how to set up and run test automation jobs with CircleCI and report resul

Testmo 2 Dec 23, 2021
Example-browserstack-reporting - This repository contains an example of running Selenium tests and reporting BrowserStack test results, including full CI pipeline integration.

BrowserStack reporting and Selenium test result example This repository contains an example of running Selenium tests and reporting BrowserStack test

Testmo 1 Jan 1, 2022
Send slack notification with BQ results

bq2slack-github-action Send slack notification with BQ results. How to use Sample github actions workflow yaml name: Run SQL against BQ and notify sla

Data-i Consulting 4 Dec 16, 2022