2.1.1 • Published 6 years ago

noinfopath-rest-client v2.1.1

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

NoInfoPath RESTAPI Client

Overview

This module allows for easy configuration and execution of CRUD (Create, Read, Update and Delete) functions against an ODATA V4 compliant RESTAPI. It support communicating with multiple REST servers via a simple JSON configuration schema. All communications between the client and the servers are via standard JWT bearer tokens.

References

Installation

npm install noinfopath-rest-client --save

Usage

var platform = "debug",
	config = require("../config")[platform],
	restClient = require("../rest-client")(config),
	assert = require("assert"),
	sopSamples = require("./fixtures/sop-request.js"),
	okResponse;

describe("Testing restClient", function(){
	it("Read called with no parameters should return at least one record.", function(done){
		restClient.sop.requests.read()
			.then(function(resp){
				assert(resp.length > 0);
				done();
			})
			.catch(function(err){
				done(err);
			});

	});

});

Configuration

{
	"debug": {
		"namespaces": {
			"foo": {
				"schema": {
					"bar": {
						"entityName": "bar",
						"primaryKey": "id"
					}
				},
				"rest": {
					"protocol": "https://",
					"host": "restapi.my-company.com",
					"port": 443,
					"apiPrefix": "/foo/"
				}
			}
		}
	}
}
2.1.1

6 years ago

2.1.0

6 years ago

1.0.29

7 years ago

1.0.26

7 years ago

1.0.25

7 years ago

1.0.24

7 years ago

1.0.23

7 years ago

1.0.22

7 years ago

1.0.21

7 years ago

1.0.20

7 years ago

1.0.19

7 years ago

1.0.18

7 years ago

1.0.17

7 years ago

1.0.16

7 years ago

1.0.15

7 years ago

1.0.14

7 years ago

1.0.13

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago