npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@workatease/refine-directus

v1.0.12

Published

Refine Directus REST data provider. This is a wrapper around the Directus SDK to use in refine.

Downloads

9

Readme

codecov build npm version

Directus dataprovider package for refine.

About

refine offers lots of out-of-the box functionality for rapid development, without compromising extreme customizability. Use-cases include, but are not limited to admin panels, B2B applications and dashboards.

A big thanks to Directus for providing the API and js SDK and to @tspvivek for the initial implementation of the package.

Documentation

For more detailed information and usage, refer to the refine data provider documentation. see below notes for more information.

Install

npm install @workatease/refine-directus

Version compatible with refine-core

| refine-core version | refine-directus version | | ------------------- | ----------------------- | | 3.84.0 or before | 1.0.11 | | 3.85.0 after | 1.0.12 |

Example

Use below login details in example username: [email protected] password: 123456 url: https://refine.dev/docs/examples/data-provider/directus/

Notes

To enable perform archive instead of delete with DeleteButton pass metaData={softDelete:true,field:value} in DeleteButton if no field is passed then default status field will be used and set to archived example:

<DeleteButton
    hideText
    size="small"
    recordItemId={record.id}
    metaData={{ softDelete: true }}
/>

<DeleteButton
    hideText
    size="small"
    recordItemId={record.id}
    metaData={{ softDelete: true, isDeleted: "true" }}
/>

usage

App.tsx

 import { Directus, authProvider,dataProvider } from '@workatease/refine-directus';
 function App() {
 const directus = new Directus<MyCollections>("https://url");

 return (
  <Refine 
   routerProvider={routerProvider}
   dataProvider={dataProvider(directus)}
   authProvider={authProvider(directus)}  // optional - can use your own auth provider
   ...
 />
 );
 }

Tests

All Tests are run against the latest version of Directus Cloud.

difference From the actual Library

  • Removing hardcoded filter from the data provider for flexibility if status field is not present in the table status: { _neq: 'archived' }
  • or Query support added to the data provider
  • soft delete parameter changed and added support to add custom field for soft delete

TODO

  • ~~make changes packages JSON file package name change~~
  • ~~update directus sdk to latest version~~
  • ~~add auth provider~~
  • add upload utils without react dependency
  • add live provider with help of extension in directus 9 link
  • update examples files
  • ~~automate integration with directus server~~

Change Log

1.0.12

  • update library version
    • "@directus/sdk": "^10.3.1"
    • "@pankod/refine-core": "3.90.6"
  • Auth provider to redirect with the default redirect url

1.0.11

  • Added rnd value to the url to avoid caching issue in Auth provider

1.0.10

  • Added rnd value to the url to avoid caching issue

1.0.9

  • update library version
    • "@directus/sdk": "^10.1.4"
    • "@pankod/refine-core": "3.69.0"
  • now support filter startwith, endswith, nstartswith, nendswith

1.0.8

  • Data provider will support soft delete with metaData={softDelete:true,field:value} in DeleteButton
  • Default AuthProvider added to the package