Skip to content

mia-platform/js-crud-service-client

Repository files navigation

JS CRUD Service client

![license][license-svg] [![javascript style guide][standard-mia-svg]][standard-mia]

The official CRUD Service JavaScript client.

Installation

npm i @mia-platform/js-crud-service-client
yarn add @mia-platform/js-crud-service-client

How to use

import CrudClient from '@mia-platform/js-crud-service-client'

const crudClient = new CrudClient<ResourceType>('/prefix', 'resource-name')

const resourceList = await crudClient.getList(context, filter)

Features

This package allows you to easily integrate with a CRUD Service. It provides the following APIs:

  • get a list of resources optionally filtered
  • export all data from the CRUD resource
  • count the number of resources
  • get a single resource by ID
  • create a resource
  • create multiple resources at once
  • upsert a single resource
  • update a single resource by ID
  • update multiple resources at once
  • soft delete (trash) a single resource by ID
  • hard delete a single resource by ID
  • delete multiple resources at once

Requirements

Node.js >= 18