1.2.0 • Published 3 years ago

mdl-ws-core-ts v1.2.0

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

mdl-ws-core-ts

Package to format service requests in Moodle WS format(https://docs.moodle.org/dev/Creating_a_web_service_client)

Installation

This is a Node.js module available through the npm registry.

Before installing, download and install Node.js.

If this is a brand new project, make sure to create a package.json first with the npm init command.

Installation is done using the npm install command:

$ npm install mdl-ws-core-ts

Debug errors Information

To activate debug options.

Go to moodle -> site administration -> developer -> debugging

In debugging messages select developer options.

Examples

General use

import {core} from "mdl-ws-core-ts";

const response = await core({
  URLRequest: {
    rootURL: 'http://localhost/moodle',
    token: 'aeb315e6dd3affc18352fe46124cdd48',
    wSFunction: 'core_course_get_courses',
  },
  content: {
    courses: [
        {
            fullname: 'Example01',
            shortname: 'Example1',
            categoryid: 1
        },
        {
            fullname: 'Example02',
            shortname: 'Example2',
            categoryid: 1
        }
    ]
  },
});

Use with other request methods

import core from "moodle-ws-core-ts";

const response = await core({
  URLRequest: {
    rootURL: 'http://localhost/moodle',
    token: 'aeb315e6dd3affc18352fe46124cdd48',
    wSFunction: 'core_course_get_courses',
  },
  content: {
    courses: [
        {
            fullname: 'Example01',
            shortname: 'Example1',
            categoryid: 1
        },
        {
            fullname: 'Example02',
            shortname: 'Example2',
            categoryid: 1
        }
    ]
  },
  method: 'POST'
});
1.2.0

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago