Skip to content

Commit cb4f168

Browse files
author
Sassoun Derderian
committed
get rid of ApiFactory
1 parent da6e4b7 commit cb4f168

82 files changed

Lines changed: 1802 additions & 1489 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,5 @@ node_modules
1010
# coverage reporter output
1111
coverage
1212

13-
# generated API docs
14-
docs
15-
1613
# dist
1714
dist

examples/browser/login.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
<!--<script src="/dist/workfront.min.js"></script>-->
2424
<script src="/dist/workfront.js"></script>
2525
<script>
26-
console.log(window.Workfront)
2726
function doLogin() {
2827
var url = document.getElementById('url').value;
2928
var username = document.getElementById('username').value;

examples/node/always-use-get.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@
1818
* Creates a project using a get request
1919
*/
2020
'use strict';
21-
var ApiFactory = require('./../../').ApiFactory;
22-
var ApiConstants = require('./../../').ApiConstants;
21+
var Workfront = require('./../../');
2322
var util = require('util');
2423

25-
var instance = ApiFactory.getInstance({
24+
var instance = new Workfront.Api({
2625
url: 'http://localhost:8080',
2726
version: 'internal',
2827
alwaysUseGet: true

examples/node/call-acknowledge-action.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@
1717
/**
1818
* Logs in, loads list of user notes, then calls acknowledge action for the one
1919
*/
20-
21-
var ApiFactory = require('./../../').ApiFactory;
22-
var ApiConstants = require('./../../').ApiConstants;
20+
'use strict';
21+
var Workfront = require('./../../');
22+
var ApiConstants = require('workfront-api-constants');
2323
var util = require('util');
2424

25-
var instance = ApiFactory.getInstance({
25+
var instance = new Workfront.Api({
2626
url: 'http://localhost:8080',
2727
version: 'internal'
2828
});

examples/node/call-assignUserToken-action-for-given-user.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,14 @@
1818
* Logs in, loads list of active users, then calls assignUserToken action for the first user
1919
*/
2020

21-
var ApiFactory = require('./../../').ApiFactory;
22-
var ApiConstants = require('./../../').ApiConstants;
21+
'use strict';
22+
var Workfront = require('./../../');
23+
var ApiConstants = require('workfront-api-constants');
2324
var util = require('util');
2425

25-
var instance = ApiFactory.getInstance({
26-
url: 'http://localhost:8080',
27-
version: '4.0'
26+
var instance = new Workfront.Api({
27+
url: 'http://localhost:8080',
28+
version: '4.0'
2829
});
2930

3031
console.log('Logs in, loads list of active users, then calls assignUserToken action for the first user\n');

examples/node/create-and-remove-template.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,16 @@
1818
* Logs in, then creates a new template with name "API Template", then removes it
1919
*/
2020

21-
var ApiFactory = require('./../../').ApiFactory;
21+
'use strict';
22+
var Workfront = require('./../../');
2223
var util = require('util');
2324

24-
var instance = ApiFactory.getInstance({
25-
url: 'http://localhost:8080',
26-
version: '4.0'
25+
var instance = new Workfront.Api({
26+
url: 'http://localhost:8080',
27+
version: '4.0'
2728
});
2829

30+
2931
console.log('Logs in, then creates a new template with name "API Template", then removes it\n');
3032
util.log('Logging in ...');
3133
instance.login('new@user.attask', 'user').then(

examples/node/create-edit-delete-group-pc.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,16 @@
1919
* This examples is similar to create-edit-delete-group.js, but this one makes use of promise chaining (pc).
2020
*/
2121

22-
var ApiFactory = require('./../../').ApiFactory;
22+
'use strict';
23+
var Workfront = require('./../../');
2324
var util = require('util');
2425

25-
var instance = ApiFactory.getInstance({
26-
url: 'http://localhost:8080',
27-
version: '4.0'
26+
var instance = new Workfront.Api({
27+
url: 'http://localhost:8080',
28+
version: '4.0'
2829
});
2930

31+
3032
var login = function() {
3133
util.log('Logging in ...');
3234
return instance.login('new@user.attask', 'user');

examples/node/create-edit-delete-group.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,16 @@
1818
* Logs in, then creates a group "Api Group", edits the name to read "Api Group 2", then deletes it
1919
*/
2020

21-
var ApiFactory = require('./../../').ApiFactory;
21+
'use strict';
22+
var Workfront = require('./../../');
2223
var util = require('util');
2324

24-
var instance = ApiFactory.getInstance({
25-
url: 'http://localhost:8080',
26-
version: '4.0'
25+
var instance = new Workfront.Api({
26+
url: 'http://localhost:8080',
27+
version: '4.0'
2728
});
2829

30+
2931
console.log('Logs in, then creates a group "Api Group", edits the name to read "Api Group 2", then deletes it\n');
3032
util.log('Logging in ...');
3133
instance.login('new@user.attask', 'user').then(

examples/node/create-new-project-and-share.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,16 @@
1818
* Logs in, then creates a new project with name "API Project"
1919
*/
2020

21-
var ApiFactory = require('./../../').ApiFactory;
21+
'use strict';
22+
var Workfront = require('./../../');
2223
var util = require('util');
2324

24-
var instance = ApiFactory.getInstance({
25-
url: 'http://localhost:8080',
26-
version: '4.0'
25+
var instance = new Workfront.Api({
26+
url: 'http://localhost:8080',
27+
version: '4.0'
2728
});
2829

30+
2931
console.log('Logs in, then creates a new project with name "API Project Shared" and then shares it\n');
3032
util.log('Logging in ...');
3133
instance.login('new@user.attask', 'user').then(

examples/node/create-new-project.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,16 @@
1818
* Logs in, then creates a new project with name "API Project"
1919
*/
2020

21-
var ApiFactory = require('./../../').ApiFactory;
21+
'use strict';
22+
var Workfront = require('./../../');
2223
var util = require('util');
2324

24-
var instance = ApiFactory.getInstance({
25-
url: 'http://localhost:8080',
26-
version: '4.0'
25+
var instance = new Workfront.Api({
26+
url: 'http://localhost:8080',
27+
version: '4.0'
2728
});
2829

30+
2931
console.log('Logs in, then creates a new project with name "API Project"\n');
3032
util.log('Logging in ...');
3133
instance.login('new@user.attask', 'user').then(

0 commit comments

Comments
 (0)