2.1.2 • Published 4 years ago

@directsp/client-js v2.1.2

Weekly downloads
-
License
ISC
Repository
-
Last release
4 years ago

DirectSpClientJs

DirectSp client for JavaScript

Usage

  1. Install by NPM
npm i @directsp/client-js
  1. Create and intialize object
import { directSp } from "../node_modules/@directsp/client-js";

// Creating a global DirectSpClient object
window.dspClient = new directSp.DirectSpClient({
  resourceApiUri: "http:/your_directsp_host_url/api",
  isLogEnabled: true,
  isUseAppErrorHandler: true
});

// Initializing the object
dspClient.init();

// Handle authentication if any
// update this property as soon as your authorization provider gives you a new token
dspClient.authHeader = "a bearer authorization token such as google user token";

3. Invoke procedures

```javascript
// without options
dspClient.invoke("MyMethod", { param1: "value1", param2: "value2" })
  .then(data => {
    console.log(data);
    console.log(data.returnValue);
    console.log(data.outParam1);
    console.log(data.outParam2);
    console.log(data.recordset);
  });

// with options
dspClient.invoke("MyMethod", { param1: "value1", param2: "value2" }, { recordIndex: 0, recordCount: 10 })
  .then(data => {
    console.log(data);
  });

Authentication

You can bypass authentication system by setting auth to null

Runtime API Help

in your browser console just run

dspClient.help()
2.1.2

4 years ago

2.0.1

4 years ago

2.0.0

4 years ago

1.0.17

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago