-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Typescript + other nice things
- Loading branch information
Showing
58 changed files
with
4,336 additions
and
1,609 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,23 @@ | ||
const Domo = require('../src'); | ||
const { DomoClient } = require('../dist'); | ||
const { API_SCOPE } = require('../dist/common/Constants'); | ||
|
||
const clientId = process.env.DOMO_CLIENT_ID; | ||
const clientSecret = process.env.DOMO_CLIENT_SECRET; | ||
|
||
const datasetId = 'e10348d6-b0ab-4471-9195-4f862ac3c56c'; | ||
const scopes = [API_SCOPE.DATA]; | ||
const host = 'api.domo.com'; | ||
|
||
const domo = new Domo(clientId, clientSecret, host); | ||
const domo = new DomoClient(clientId, clientSecret, scopes, host); | ||
|
||
const limit = 5; | ||
const offset = 0; | ||
const sort = 'name'; | ||
|
||
domo.datasets.list('name', 5, 0) | ||
.then(res => { console.log('\nDatasetList', res.length); }) | ||
.catch(err => { console.error(err); }); | ||
domo.datasets.list(limit, offset, sort) | ||
.then(res => { console.log(`\nDatasetList: ${res.length}`); }) | ||
.catch(console.error); | ||
|
||
domo.datasets.get(datasetId) | ||
.then(res => { console.log('\nDataset', res); }) | ||
.catch(err => { console.error(err); }); | ||
.then(res => { console.log(`\nDataset: ${res.id} - ${res.name}`); }) | ||
.catch(console.error); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
const Domo = require('../src'); | ||
|
||
const { DomoClient } = require('../dist'); | ||
const { API_SCOPE } = require('../dist/common/Constants'); | ||
const clientId = process.env.DOMO_CLIENT_ID; | ||
const clientSecret = process.env.DOMO_CLIENT_SECRET; | ||
const host = 'api.domo.com'; | ||
const scopes = [API_SCOPE.USER]; | ||
|
||
const domo = new Domo(clientId, clientSecret, host); | ||
const domo = new DomoClient(clientId, clientSecret, scopes, host); | ||
|
||
domo.groups.list(3, 0) | ||
.then(res => { console.log('\nGroup List', res); }) | ||
.catch(err => { console.error(err); }); | ||
.catch(console.error); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
const { DomoClient } = require('../dist'); | ||
const { API_SCOPE } = require('../dist/common/Constants'); | ||
|
||
const clientId = process.env.DOMO_CLIENT_ID; | ||
const clientSecret = process.env.DOMO_CLIENT_SECRET; | ||
|
||
const datasetId = 'e10348d6-b0ab-4471-9195-4f862ac3c56c'; | ||
const scopes = [API_SCOPE.DATA]; | ||
const host = 'api.domo.com'; | ||
|
||
const domo = new DomoClient(clientId, clientSecret, scopes, host); | ||
|
||
domo.policies.list(datasetId) | ||
.then(res => { console.log(`\nPolicies: ${res.length}`); }) | ||
.catch(console.error); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
const Domo = require('../src'); | ||
const { DomoClient } = require('../dist'); | ||
const { API_SCOPE } = require('../dist/common/Constants'); | ||
|
||
const clientId = process.env.DOMO_CLIENT_ID; | ||
const clientSecret = process.env.DOMO_CLIENT_SECRET; | ||
const userId = '715147833'; | ||
const host = 'api.domo.com'; | ||
const scopes = [API_SCOPE.USER]; | ||
|
||
const domo = new Domo(clientId, clientSecret, host); | ||
const domo = new DomoClient(clientId, clientSecret, scopes, host); | ||
|
||
domo.users.get(userId) | ||
.then(res => { console.log('\nUser', res); }) | ||
.catch(err => { console.error(err); }); | ||
.then(res => { console.log('\nUser', res.email); }) | ||
.catch(console.error); | ||
|
||
domo.users.list(3, 0) | ||
.then(res => { console.log('\nUser List', res); }) | ||
.catch(err => { console.error(err); }); | ||
.then(res => { console.log('\nUser List', res.length); }) | ||
.catch(console.error); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
test/**/*.spec.ts | ||
--require ts-node/register | ||
--compilers ts:ts-node/register | ||
--reporter list | ||
--watch-extensions ts | ||
--recursive | ||
--colors |
Oops, something went wrong.