open-index/open-npm huggingface dataset:
npm package: @marcelbraun/enapso-api
Description: Enapso REST API
Author: Alexander Schulze
Latest version: 1.0.0

# enapso-api
Enapso REST API

# Create

```json
{
	"meta": {
		"schema": "Test",
		"cls": "Test"
	},
	"records": [
		{
			"rid": 1,
            "text": "This is a new record!"
		}
	]
}
````

In case of success:
{
    "status": 200,
    "op": "create",
    "count": 1,
    "message": "ok",
    "success": true
}

## Sencha Settings



# Read

To read individuals from the api, your application needs to pass the ```schema``` and the ```class```.
Th read the data in pages, you optionally can pass an ```offset``` and a ```limit``` parameter.

```json
{
	"meta": {
		"schema": "Test",
		"cls": "Test",
		"offset": 0,
		"limit": 2
	}
}
```


# Update


# Delete



## Sencha Settings

### Proxy 
paramsAsJson: true
idParam: _id
startParam: offset (instead of skip)

actionMethods:
{
    "create": "POST",
    "read": "POST",
    "update": "POST",
    "destroy": "POST"
}
headers:
{
    "Content-Type": "application/json"
}
api:
{
	read: 'http://localhost:3000/read',
	update: 'http://localhost:300/update',
	create: 'http://localhost:300/create',
	destroy: 'http://localhost:3000/delete'
}
extraParams:
{
    "meta": {
        "schema": "Test",
        "cls": "Test"
    }
}

### Reader

rootProperty: 'records'


### Writer

rootProperty: 'records'
npm package: @marcelbraun/enapso-args
Description: Enapso Smart Arguments Processor
Author: Alexander Schulze
Latest version: 1.0.1

# Enapso Smart Arguments Processor

You can either pass a single object as arguments or the arguments in the defined order.


## Why to use the Enapso Smart Arguments Processor?

You avoid unexpected results due to wrong or missing arguments or due to wrong argument order.
You can specify defaults for missing arguments and valdiate your arguments against a given schema.


## Installation
```
npm i @marcelbraun/enapso-args --save
```

## Usage

## Initialization
```javascript
const
    { EnapsoArguments } = require('@marcelbraun/enapso-args')
    ;

global.enargs = new EnapsoArguments();
global.enGetArgs = enargs.getArgs;
```

## Arg Validation Schema
```javascript
const
    schemaSingleStringArg = {
        args: [
            {
                "identifier": "text",
                "type": "string",
                "required": false,
                "default": "default value",
                "minLength": 0,
                "maxLength": 20
            }
        ]
    };
```
## Argument Validation
```javascript

function demoSingleStringArg(/*text*/) {
    let args = enGetArgs(arguments, schemaSingleStringArg, logValidationViolation);
    console.log('demoSingleStringArg: ' + args.text);
}

function demo() {
    demoSingleStringArg("Test");
    demoSingleStringArg(1);
    demoSingleStringArg(true);
    demoSingleStringArg();
}
```
## Output
```
demoSingleStringArg: Test
Error: Argument 'text' must be of type 'string' but is of type 'number'. Value: 1
demoSingleStringArg: 1
Error: Argument 'text' must be of type 'string' but is of type 'boolean'. Value: true
demoSingleStringArg: true
demoSingleStringArg: default value
```