2.1.2 • Published 5 years ago

@directsp/client-js v2.1.2

Weekly downloads
-
License
ISC
Repository
-
Last release
5 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

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.0.17

5 years ago

1.0.15

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago