forked from ralabs-team/runn-api-client
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.js
More file actions
24 lines (17 loc) · 782 Bytes
/
example.js
File metadata and controls
24 lines (17 loc) · 782 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const RunnApiClient = require('runn-api-client');
const RUNN_API_KEY = 'TEST_test_...';
(async () => {
const runnApi = new RunnApiClient(RUNN_API_KEY, { logLevel: 'debug', isDryRun: false });
// fetch all clients
const clients = await runnApi.clients.fetchAll();
console.log('clients', clients.length); // eslint-disable-line no-console
// fetch all allocations
const assignments = await runnApi.assignments.fetchAll();
console.log('assignments', assignments.length); // eslint-disable-line no-console
// fetch all people
const people = await runnApi.people.fetchAll();
console.log('people', people.length); // eslint-disable-line no-console
runnApi.projects.fetchAll()
// create new client
// await runnApi.clients.create('Test Client', []);
})();