@orchesty/connector-nutshell 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/package.json +4 -1
- package/package.json +4 -1
- package/CHANGELOG.md +0 -7
- package/coverage/clover.xml +0 -129
- package/coverage/coverage-final.json +0 -7
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -146
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -210
- package/coverage/lcov-report/src/Connector/NutshellGetAccountConnector.ts.html +0 -532
- package/coverage/lcov-report/src/Connector/NutshellNewAccountConnector.ts.html +0 -754
- package/coverage/lcov-report/src/Connector/NutshellNewLeadConnector.ts.html +0 -802
- package/coverage/lcov-report/src/Connector/NutshellNewTaskConnector.ts.html +0 -406
- package/coverage/lcov-report/src/Connector/index.html +0 -161
- package/coverage/lcov-report/src/NutshellApplication.ts.html +0 -304
- package/coverage/lcov-report/src/index.html +0 -116
- package/coverage/lcov-report/test/dataProvider.ts.html +0 -235
- package/coverage/lcov-report/test/index.html +0 -116
- package/coverage/lcov.info +0 -184
- package/jest.config.js +0 -13
- package/src/Connector/NutshellGetAccountConnector.ts +0 -149
- package/src/Connector/NutshellNewAccountConnector.ts +0 -223
- package/src/Connector/NutshellNewLeadConnector.ts +0 -239
- package/src/Connector/NutshellNewTaskConnector.ts +0 -107
- package/src/Connector/__tests__/Data/NutshellGetAccountConnector/input.json +0 -8
- package/src/Connector/__tests__/Data/NutshellGetAccountConnector/mock.json +0 -37
- package/src/Connector/__tests__/Data/NutshellGetAccountConnector/output.json +0 -34
- package/src/Connector/__tests__/Data/NutshellNewAccountConnector/input.json +0 -10
- package/src/Connector/__tests__/Data/NutshellNewAccountConnector/mock.json +0 -34
- package/src/Connector/__tests__/Data/NutshellNewAccountConnector/output.json +0 -30
- package/src/Connector/__tests__/Data/NutshellNewLeadConnector/input.json +0 -10
- package/src/Connector/__tests__/Data/NutshellNewLeadConnector/mock.json +0 -77
- package/src/Connector/__tests__/Data/NutshellNewLeadConnector/output.json +0 -74
- package/src/Connector/__tests__/Data/NutshellNewTaskConnector/input.json +0 -11
- package/src/Connector/__tests__/Data/NutshellNewTaskConnector/mock.json +0 -22
- package/src/Connector/__tests__/Data/NutshellNewTaskConnector/output.json +0 -19
- package/src/Connector/__tests__/NutshellGetAccountConnector.ts +0 -17
- package/src/Connector/__tests__/NutshellNewAccountConnector.ts +0 -17
- package/src/Connector/__tests__/NutshellNewLeadConnector.ts +0 -17
- package/src/Connector/__tests__/NutshellNewTaskConnector.ts +0 -17
- package/src/NutshellApplication.ts +0 -73
- package/test/dataProvider.ts +0 -50
- package/tsconfig.json +0 -8
- package/tsconfig.prod.json +0 -13
- package/tsconfig.prod.tsbuildinfo +0 -1
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"http": "POST https://app.nutshell.com/api/v1/json",
|
|
3
|
-
"code": 200,
|
|
4
|
-
"body": {
|
|
5
|
-
"result": {
|
|
6
|
-
"id": 116,
|
|
7
|
-
"entityType": "Accounts",
|
|
8
|
-
"rev": "0",
|
|
9
|
-
"modifiedTime": "2022-08-10T15:49:23+0000",
|
|
10
|
-
"createdTime": "2022-08-10T15:49:23+0000",
|
|
11
|
-
"name": "New Account Name",
|
|
12
|
-
"htmlUrl": "https:\/\/app.nutshell.com\/company\/116-new-account-name",
|
|
13
|
-
"htmlUrlPath": "\/company\/116-new-account-name",
|
|
14
|
-
"avatarUrl": "https:\/\/app.nutshell.com\/avatar\/accounts\/116\/346392\/K1K9OUzMRMiFaepwtAneseVXZs-THejW7xPt9zhTSDM.2\/1660146563",
|
|
15
|
-
"accountType": {
|
|
16
|
-
"id": 1,
|
|
17
|
-
"name": "Standard Account"
|
|
18
|
-
},
|
|
19
|
-
"industry": null,
|
|
20
|
-
"creator": null,
|
|
21
|
-
"owner": null,
|
|
22
|
-
"tags": [
|
|
23
|
-
],
|
|
24
|
-
"lastContactedDate": null,
|
|
25
|
-
"contacts": [
|
|
26
|
-
],
|
|
27
|
-
"description": null,
|
|
28
|
-
"legacyId": null,
|
|
29
|
-
"notes": [
|
|
30
|
-
],
|
|
31
|
-
"leads": [
|
|
32
|
-
]
|
|
33
|
-
},
|
|
34
|
-
"id": "apeye",
|
|
35
|
-
"jsonrpc": "2.0"
|
|
36
|
-
}
|
|
37
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"headers": {
|
|
3
|
-
"user": "TestUser"
|
|
4
|
-
},
|
|
5
|
-
"data": {
|
|
6
|
-
"id": 116,
|
|
7
|
-
"entityType": "Accounts",
|
|
8
|
-
"rev": "0",
|
|
9
|
-
"modifiedTime": "2022-08-10T15:49:23+0000",
|
|
10
|
-
"createdTime": "2022-08-10T15:49:23+0000",
|
|
11
|
-
"name": "New Account Name",
|
|
12
|
-
"htmlUrl": "https:\/\/app.nutshell.com\/company\/116-new-account-name",
|
|
13
|
-
"htmlUrlPath": "\/company\/116-new-account-name",
|
|
14
|
-
"avatarUrl": "https:\/\/app.nutshell.com\/avatar\/accounts\/116\/346392\/K1K9OUzMRMiFaepwtAneseVXZs-THejW7xPt9zhTSDM.2\/1660146563",
|
|
15
|
-
"accountType": {
|
|
16
|
-
"id": 1,
|
|
17
|
-
"name": "Standard Account"
|
|
18
|
-
},
|
|
19
|
-
"industry": null,
|
|
20
|
-
"creator": null,
|
|
21
|
-
"owner": null,
|
|
22
|
-
"tags": [
|
|
23
|
-
],
|
|
24
|
-
"lastContactedDate": null,
|
|
25
|
-
"contacts": [
|
|
26
|
-
],
|
|
27
|
-
"description": null,
|
|
28
|
-
"legacyId": null,
|
|
29
|
-
"notes": [
|
|
30
|
-
],
|
|
31
|
-
"leads": [
|
|
32
|
-
]
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"http": "POST https://app.nutshell.com/api/v1/json",
|
|
3
|
-
"code": 200,
|
|
4
|
-
"body": {
|
|
5
|
-
"result": {
|
|
6
|
-
"accountType": {
|
|
7
|
-
"id": 1,
|
|
8
|
-
"name": "Standard Account"
|
|
9
|
-
},
|
|
10
|
-
"avatarUrl": "https://app.nutshell.com/avatar/accounts/116/346392/K1K9OUzMRMiFaepwtAneseVXZs-THejW7xPt9zhTSDM.2/1660146563",
|
|
11
|
-
"contacts": [],
|
|
12
|
-
"createdTime": "2022-08-10T15:49:23+0000",
|
|
13
|
-
"creator": null,
|
|
14
|
-
"description": null,
|
|
15
|
-
"entityType": "Accounts",
|
|
16
|
-
"htmlUrl": "https://app.nutshell.com/company/116-new-account-name",
|
|
17
|
-
"htmlUrlPath": "/company/116-new-account-name",
|
|
18
|
-
"id": 116,
|
|
19
|
-
"industry": null,
|
|
20
|
-
"lastContactedDate": null,
|
|
21
|
-
"leads": [],
|
|
22
|
-
"legacyId": null,
|
|
23
|
-
"modifiedTime": "2022-08-10T15:49:23+0000",
|
|
24
|
-
"name": "New Account Name",
|
|
25
|
-
"notes": [],
|
|
26
|
-
"owner": null,
|
|
27
|
-
"rev": "0",
|
|
28
|
-
"tags": []
|
|
29
|
-
},
|
|
30
|
-
"id": "apeye",
|
|
31
|
-
"jsonrpc": "2.0"
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"headers": {
|
|
3
|
-
"user": "TestUser"
|
|
4
|
-
},
|
|
5
|
-
"data": {
|
|
6
|
-
"accountType": {
|
|
7
|
-
"id": 1,
|
|
8
|
-
"name": "Standard Account"
|
|
9
|
-
},
|
|
10
|
-
"avatarUrl": "https://app.nutshell.com/avatar/accounts/116/346392/K1K9OUzMRMiFaepwtAneseVXZs-THejW7xPt9zhTSDM.2/1660146563",
|
|
11
|
-
"contacts": [],
|
|
12
|
-
"createdTime": "2022-08-10T15:49:23+0000",
|
|
13
|
-
"creator": null,
|
|
14
|
-
"description": null,
|
|
15
|
-
"entityType": "Accounts",
|
|
16
|
-
"htmlUrl": "https://app.nutshell.com/company/116-new-account-name",
|
|
17
|
-
"htmlUrlPath": "/company/116-new-account-name",
|
|
18
|
-
"id": 116,
|
|
19
|
-
"industry": null,
|
|
20
|
-
"lastContactedDate": null,
|
|
21
|
-
"leads": [],
|
|
22
|
-
"legacyId": null,
|
|
23
|
-
"modifiedTime": "2022-08-10T15:49:23+0000",
|
|
24
|
-
"name": "New Account Name",
|
|
25
|
-
"notes": [],
|
|
26
|
-
"owner": null,
|
|
27
|
-
"rev": "0",
|
|
28
|
-
"tags": []
|
|
29
|
-
}
|
|
30
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"http": "POST https://app.nutshell.com/api/v1/json",
|
|
3
|
-
"code": 200,
|
|
4
|
-
"body": {
|
|
5
|
-
"result": {
|
|
6
|
-
"id": 1004,
|
|
7
|
-
"entityType": "Leads",
|
|
8
|
-
"rev": "1",
|
|
9
|
-
"modifiedTime": "2022-08-10T16:18:05+0000",
|
|
10
|
-
"createdTime": "2022-08-10T16:18:05+0000",
|
|
11
|
-
"name": "Lead\u20131001",
|
|
12
|
-
"description": "A great new lead",
|
|
13
|
-
"htmlUrl": "https:\/\/app.nutshell.com\/lead\/1001",
|
|
14
|
-
"htmlUrlPath": "\/lead\/1001",
|
|
15
|
-
"avatarUrl": "https:\/\/app.nutshell.com\/avatar\/leads\/v1\/0\/1\/3\/0",
|
|
16
|
-
"creator": null,
|
|
17
|
-
"primaryAccount": null,
|
|
18
|
-
"milestone": {
|
|
19
|
-
"stub": true,
|
|
20
|
-
"id": 101,
|
|
21
|
-
"rev": "0",
|
|
22
|
-
"entityType": "Milestones",
|
|
23
|
-
"name": "Qualify"
|
|
24
|
-
},
|
|
25
|
-
"stageset": {
|
|
26
|
-
"stub": true,
|
|
27
|
-
"id": 1,
|
|
28
|
-
"entityType": "Stagesets",
|
|
29
|
-
"name": "Default Pipeline"
|
|
30
|
-
},
|
|
31
|
-
"activitiesCount": {
|
|
32
|
-
"0": 0,
|
|
33
|
-
"1": 0,
|
|
34
|
-
"2": 0,
|
|
35
|
-
"-1": 0
|
|
36
|
-
},
|
|
37
|
-
"status": 0,
|
|
38
|
-
"confidence": 25,
|
|
39
|
-
"completion": 0,
|
|
40
|
-
"urgency": "0",
|
|
41
|
-
"isOverdue": false,
|
|
42
|
-
"lastContactedDate": null,
|
|
43
|
-
"market": {
|
|
44
|
-
"stub": true,
|
|
45
|
-
"id": 1,
|
|
46
|
-
"rev": "0",
|
|
47
|
-
"entityType": "Markets",
|
|
48
|
-
"name": "U.S."
|
|
49
|
-
},
|
|
50
|
-
"assignee": null,
|
|
51
|
-
"sources": [],
|
|
52
|
-
"competitors": [],
|
|
53
|
-
"products": [],
|
|
54
|
-
"contacts": [],
|
|
55
|
-
"accounts": [],
|
|
56
|
-
"tags": [],
|
|
57
|
-
"priority": 0,
|
|
58
|
-
"processes": [
|
|
59
|
-
{
|
|
60
|
-
"stub": true,
|
|
61
|
-
"id": 8,
|
|
62
|
-
"rev": "0",
|
|
63
|
-
"entityType": "Processes",
|
|
64
|
-
"name": "Default Pipeline",
|
|
65
|
-
"type": "0",
|
|
66
|
-
"startedTime": "2022-08-10T16:18:05+0000",
|
|
67
|
-
"closedTime": null,
|
|
68
|
-
"currentMilestoneId": "101",
|
|
69
|
-
"processTemplateId": "1"
|
|
70
|
-
}
|
|
71
|
-
],
|
|
72
|
-
"notes": []
|
|
73
|
-
},
|
|
74
|
-
"id": "7a21312a",
|
|
75
|
-
"jsonrpc": "2.0"
|
|
76
|
-
}
|
|
77
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"headers": {
|
|
3
|
-
"user": "TestUser"
|
|
4
|
-
},
|
|
5
|
-
"data": {
|
|
6
|
-
"accounts": [],
|
|
7
|
-
"activitiesCount": {
|
|
8
|
-
"0": 0,
|
|
9
|
-
"1": 0,
|
|
10
|
-
"2": 0,
|
|
11
|
-
"-1": 0
|
|
12
|
-
},
|
|
13
|
-
"assignee": null,
|
|
14
|
-
"avatarUrl": "https://app.nutshell.com/avatar/leads/v1/0/1/3/0",
|
|
15
|
-
"competitors": [],
|
|
16
|
-
"completion": 0,
|
|
17
|
-
"confidence": 25,
|
|
18
|
-
"contacts": [],
|
|
19
|
-
"createdTime": "2022-08-10T16:18:05+0000",
|
|
20
|
-
"creator": null,
|
|
21
|
-
"description": "A great new lead",
|
|
22
|
-
"entityType": "Leads",
|
|
23
|
-
"htmlUrl": "https://app.nutshell.com/lead/1001",
|
|
24
|
-
"htmlUrlPath": "/lead/1001",
|
|
25
|
-
"id": 1004,
|
|
26
|
-
"isOverdue": false,
|
|
27
|
-
"lastContactedDate": null,
|
|
28
|
-
"market": {
|
|
29
|
-
"entityType": "Markets",
|
|
30
|
-
"id": 1,
|
|
31
|
-
"name": "U.S.",
|
|
32
|
-
"rev": "0",
|
|
33
|
-
"stub": true
|
|
34
|
-
},
|
|
35
|
-
"milestone": {
|
|
36
|
-
"entityType": "Milestones",
|
|
37
|
-
"id": 101,
|
|
38
|
-
"name": "Qualify",
|
|
39
|
-
"rev": "0",
|
|
40
|
-
"stub": true
|
|
41
|
-
},
|
|
42
|
-
"modifiedTime": "2022-08-10T16:18:05+0000",
|
|
43
|
-
"name": "Lead–1001",
|
|
44
|
-
"notes": [],
|
|
45
|
-
"primaryAccount": null,
|
|
46
|
-
"priority": 0,
|
|
47
|
-
"processes": [
|
|
48
|
-
{
|
|
49
|
-
"closedTime": null,
|
|
50
|
-
"currentMilestoneId": "101",
|
|
51
|
-
"entityType": "Processes",
|
|
52
|
-
"id": 8,
|
|
53
|
-
"name": "Default Pipeline",
|
|
54
|
-
"processTemplateId": "1",
|
|
55
|
-
"rev": "0",
|
|
56
|
-
"startedTime": "2022-08-10T16:18:05+0000",
|
|
57
|
-
"stub": true,
|
|
58
|
-
"type": "0"
|
|
59
|
-
}
|
|
60
|
-
],
|
|
61
|
-
"products": [],
|
|
62
|
-
"rev": "1",
|
|
63
|
-
"sources": [],
|
|
64
|
-
"stageset": {
|
|
65
|
-
"entityType": "Stagesets",
|
|
66
|
-
"id": 1,
|
|
67
|
-
"name": "Default Pipeline",
|
|
68
|
-
"stub": true
|
|
69
|
-
},
|
|
70
|
-
"status": 0,
|
|
71
|
-
"tags": [],
|
|
72
|
-
"urgency": "0"
|
|
73
|
-
}
|
|
74
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"http": "POST https://app.nutshell.com/api/v1/json",
|
|
3
|
-
"code": 200,
|
|
4
|
-
"body": {
|
|
5
|
-
"id": "c172cb2d",
|
|
6
|
-
"jsonrpc": "2.0",
|
|
7
|
-
"result": {
|
|
8
|
-
"assignee": null,
|
|
9
|
-
"completedTime": null,
|
|
10
|
-
"completedUser": null,
|
|
11
|
-
"createdTime": "2022-08-11T07:06:54+0000",
|
|
12
|
-
"creator": null,
|
|
13
|
-
"description": null,
|
|
14
|
-
"dueTime": "2022-08-12T15:00:00+0000",
|
|
15
|
-
"entity": null,
|
|
16
|
-
"entityType": "Tasks",
|
|
17
|
-
"id": 12,
|
|
18
|
-
"rev": "0",
|
|
19
|
-
"title": "Send product sheet"
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"headers": {
|
|
3
|
-
"user": "TestUser"
|
|
4
|
-
},
|
|
5
|
-
"data": {
|
|
6
|
-
"assignee": null,
|
|
7
|
-
"completedTime": null,
|
|
8
|
-
"completedUser": null,
|
|
9
|
-
"createdTime": "2022-08-11T07:06:54+0000",
|
|
10
|
-
"creator": null,
|
|
11
|
-
"description": null,
|
|
12
|
-
"dueTime": "2022-08-12T15:00:00+0000",
|
|
13
|
-
"entity": null,
|
|
14
|
-
"entityType": "Tasks",
|
|
15
|
-
"id": 12,
|
|
16
|
-
"rev": "0",
|
|
17
|
-
"title": "Send product sheet"
|
|
18
|
-
}
|
|
19
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { container } from '@orchesty/nodejs-connectors/test/TestAbstract';
|
|
2
|
-
import NodeTester from '@orchesty/nodejs-sdk/dist/test/Testers/NodeTester';
|
|
3
|
-
import init from '../../../test/dataProvider';
|
|
4
|
-
import { NAME as NUTSHELL_GET_ACCOUNT_CONNECTOR } from '../NutshellGetAccountConnector';
|
|
5
|
-
|
|
6
|
-
let tester: NodeTester;
|
|
7
|
-
|
|
8
|
-
describe('Tests for NutshellGetAccountConnector', () => {
|
|
9
|
-
beforeEach(() => {
|
|
10
|
-
tester = new NodeTester(container, __filename);
|
|
11
|
-
init();
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
it('process - ok', async () => {
|
|
15
|
-
await tester.testConnector(NUTSHELL_GET_ACCOUNT_CONNECTOR);
|
|
16
|
-
});
|
|
17
|
-
});
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { container } from '@orchesty/nodejs-connectors/test/TestAbstract';
|
|
2
|
-
import NodeTester from '@orchesty/nodejs-sdk/dist/test/Testers/NodeTester';
|
|
3
|
-
import init from '../../../test/dataProvider';
|
|
4
|
-
import { NAME as NUTSHELL_NEW_ACCOUNT_CONNECTOR } from '../NutshellNewAccountConnector';
|
|
5
|
-
|
|
6
|
-
let tester: NodeTester;
|
|
7
|
-
|
|
8
|
-
describe('Tests for NutshellNewAccountConnector', () => {
|
|
9
|
-
beforeEach(() => {
|
|
10
|
-
tester = new NodeTester(container, __filename);
|
|
11
|
-
init();
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
it('process - ok', async () => {
|
|
15
|
-
await tester.testConnector(NUTSHELL_NEW_ACCOUNT_CONNECTOR);
|
|
16
|
-
});
|
|
17
|
-
});
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { container } from '@orchesty/nodejs-connectors/test/TestAbstract';
|
|
2
|
-
import NodeTester from '@orchesty/nodejs-sdk/dist/test/Testers/NodeTester';
|
|
3
|
-
import init from '../../../test/dataProvider';
|
|
4
|
-
import { NAME as NUTSHELL_NEW_LEAD_CONNECTOR } from '../NutshellNewLeadConnector';
|
|
5
|
-
|
|
6
|
-
let tester: NodeTester;
|
|
7
|
-
|
|
8
|
-
describe('Tests for NutshellNewLeadConnector', () => {
|
|
9
|
-
beforeEach(() => {
|
|
10
|
-
tester = new NodeTester(container, __filename);
|
|
11
|
-
init();
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
it('process - ok', async () => {
|
|
15
|
-
await tester.testConnector(NUTSHELL_NEW_LEAD_CONNECTOR);
|
|
16
|
-
});
|
|
17
|
-
});
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { container } from '@orchesty/nodejs-connectors/test/TestAbstract';
|
|
2
|
-
import NodeTester from '@orchesty/nodejs-sdk/dist/test/Testers/NodeTester';
|
|
3
|
-
import init from '../../../test/dataProvider';
|
|
4
|
-
import { NAME as NUTSHELL_NEW_TASK_CONNECTOR } from '../NutshellNewTaskConnector';
|
|
5
|
-
|
|
6
|
-
let tester: NodeTester;
|
|
7
|
-
|
|
8
|
-
describe('Tests for NutshellNewTaskConnector', () => {
|
|
9
|
-
beforeEach(() => {
|
|
10
|
-
tester = new NodeTester(container, __filename);
|
|
11
|
-
init();
|
|
12
|
-
});
|
|
13
|
-
|
|
14
|
-
it('process - ok', async () => {
|
|
15
|
-
await tester.testConnector(NUTSHELL_NEW_TASK_CONNECTOR);
|
|
16
|
-
});
|
|
17
|
-
});
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import CoreFormsEnum, { getFormName } from '@orchesty/nodejs-sdk/dist/lib/Application/Base/CoreFormsEnum';
|
|
2
|
-
import { ApplicationInstall } from '@orchesty/nodejs-sdk/dist/lib/Application/Database/ApplicationInstall';
|
|
3
|
-
import Field from '@orchesty/nodejs-sdk/dist/lib/Application/Model/Form/Field';
|
|
4
|
-
import FieldType from '@orchesty/nodejs-sdk/dist/lib/Application/Model/Form/FieldType';
|
|
5
|
-
import Form from '@orchesty/nodejs-sdk/dist/lib/Application/Model/Form/Form';
|
|
6
|
-
import FormStack from '@orchesty/nodejs-sdk/dist/lib/Application/Model/Form/FormStack';
|
|
7
|
-
import {
|
|
8
|
-
ABasicApplication,
|
|
9
|
-
PASSWORD,
|
|
10
|
-
USER,
|
|
11
|
-
} from '@orchesty/nodejs-sdk/dist/lib/Authorization/Type/Basic/ABasicApplication';
|
|
12
|
-
import RequestDto from '@orchesty/nodejs-sdk/dist/lib/Transport/Curl/RequestDto';
|
|
13
|
-
import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
|
|
14
|
-
import AProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/AProcessDto';
|
|
15
|
-
import { encode } from '@orchesty/nodejs-sdk/dist/lib/Utils/Base64';
|
|
16
|
-
import { CommonHeaders, JSON_TYPE } from '@orchesty/nodejs-sdk/dist/lib/Utils/Headers';
|
|
17
|
-
|
|
18
|
-
export const NAME = 'nutshell';
|
|
19
|
-
|
|
20
|
-
export default class NutshellApplication extends ABasicApplication {
|
|
21
|
-
|
|
22
|
-
public getDescription(): string {
|
|
23
|
-
return 'Affordable, easy-to-use CRM that helps small-business sales teams win more deals';
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
public getName(): string {
|
|
27
|
-
return NAME;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
public getPublicName(): string {
|
|
31
|
-
return 'Nutshell';
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
public getLogo(): string {
|
|
35
|
-
return 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI1LjAuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IlZyc3R2YV8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCIKCSB2aWV3Qm94PSIwIDAgMTAwIDEwMCIgc3R5bGU9ImVuYWJsZS1iYWNrZ3JvdW5kOm5ldyAwIDAgMTAwIDEwMDsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtmaWxsOiNGRTU4MDA7fQoJLnN0MXtmaWxsOiNGRkZGRkY7fQo8L3N0eWxlPgo8Zz4KCTxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik0wLjEsMC4xaDk5Ljd2OTkuN0gwLjFWMC4xeiIvPgoJPHBhdGggY2xhc3M9InN0MSIgZD0iTTU1LjUsMjkuMmMtMS4xLDAtMi0xLTEuOS0yLjFjMC0wLjEsMC0wLjIsMC0wLjNsMS40LTcuM2MwLTAuMSwwLTAuMiwwLTAuM2MwLTEuNS0yLjItMS43LTUtMS43cy01LDAuMi01LDEuNwoJCWMwLDAuMSwwLDAuMiwwLDAuM2wxLjQsNy4zYzAuMiwxLjEtMC41LDIuMi0xLjYsMi40Yy0wLjEsMC0wLjIsMC0wLjMsMGMtMTMuNCwwLjUtMjIuOSw0LjktMjIuOSwxMi45djMuMWMwLDAuOCwwLjcsMS41LDEuNSwxLjUKCQljMCwwLDAsMCwwLDBoMjQuNGMxLDAsMS41LDAuNywxLjUsMS41YzAsMC43LTAuNSwxLjMtMS4yLDEuNEwyOS43LDUzYy0wLjcsMC4xLTEuMiwwLjctMS4yLDEuNHY2LjJjMCwxMS45LDkuMywyMS45LDIxLjUsMjEuOQoJCWMxMS45LDAsMjEuNS05LjcsMjEuNS0yMS41di0xM2MwLTAuOCwwLjctMS40LDEuNC0xLjRjMCwwLDAsMCwwLDBoMy45YzAuOCwwLDEuNS0wLjcsMS41LTEuNWMwLDAsMCwwLDAsMHYtMy4xCgkJQzc4LjQsMzQsNjguOSwzMCw1NS41LDI5LjJMNTUuNSwyOS4yeiIvPgo8L2c+Cjwvc3ZnPgo=';
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
public getRequestDto(
|
|
39
|
-
dto: AProcessDto,
|
|
40
|
-
applicationInstall: ApplicationInstall,
|
|
41
|
-
method: HttpMethods,
|
|
42
|
-
url?: string,
|
|
43
|
-
data?: unknown,
|
|
44
|
-
): Promise<RequestDto> | RequestDto {
|
|
45
|
-
const request = new RequestDto('https://app.nutshell.com/api/v1/json', method, dto);
|
|
46
|
-
request.setHeaders({
|
|
47
|
-
[CommonHeaders.CONTENT_TYPE]: JSON_TYPE,
|
|
48
|
-
[CommonHeaders.ACCEPT]: JSON_TYPE,
|
|
49
|
-
[CommonHeaders.AUTHORIZATION]: `Basic ${this.getToken(applicationInstall)}`,
|
|
50
|
-
});
|
|
51
|
-
if (data) {
|
|
52
|
-
request.setJsonBody(data);
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return request;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
public getFormStack(): FormStack {
|
|
59
|
-
const form = new Form(CoreFormsEnum.AUTHORIZATION_FORM, getFormName(CoreFormsEnum.AUTHORIZATION_FORM))
|
|
60
|
-
.addField(new Field(FieldType.TEXT, USER, 'Username', undefined, true))
|
|
61
|
-
.addField(new Field(FieldType.TEXT, PASSWORD, 'API Key', undefined, true));
|
|
62
|
-
|
|
63
|
-
return new FormStack().addForm(form);
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
private getToken(applicationInstall: ApplicationInstall): string {
|
|
67
|
-
return encode(
|
|
68
|
-
|
|
69
|
-
`${applicationInstall.getSettings()[CoreFormsEnum.AUTHORIZATION_FORM][USER]}:${applicationInstall.getSettings()[CoreFormsEnum.AUTHORIZATION_FORM][PASSWORD]}`,
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
}
|
package/test/dataProvider.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { appInstall, DEFAULT_PASSWORD, DEFAULT_USER } from '@orchesty/nodejs-connectors/test/DataProvider';
|
|
2
|
-
import { container, db, sender } from '@orchesty/nodejs-connectors/test/TestAbstract';
|
|
3
|
-
import CoreFormsEnum from '@orchesty/nodejs-sdk/dist/lib/Application/Base/CoreFormsEnum';
|
|
4
|
-
import { PASSWORD, USER } from '@orchesty/nodejs-sdk/dist/lib/Authorization/Type/Basic/ABasicApplication';
|
|
5
|
-
import NutshellGetAccountConnector from '../src/Connector/NutshellGetAccountConnector';
|
|
6
|
-
import NutshellNewAccountConnector from '../src/Connector/NutshellNewAccountConnector';
|
|
7
|
-
import NutshellNewLeadConnector from '../src/Connector/NutshellNewLeadConnector';
|
|
8
|
-
import NutshellNewTaskConnector from '../src/Connector/NutshellNewTaskConnector';
|
|
9
|
-
import NutshellApplication, { NAME as NUTSHELL_APP } from '../src/NutshellApplication';
|
|
10
|
-
|
|
11
|
-
export default function init(): void {
|
|
12
|
-
appInstall(NUTSHELL_APP, DEFAULT_USER, {
|
|
13
|
-
[CoreFormsEnum.AUTHORIZATION_FORM]: {
|
|
14
|
-
[USER]: DEFAULT_USER,
|
|
15
|
-
[PASSWORD]: DEFAULT_PASSWORD,
|
|
16
|
-
},
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
const app = new NutshellApplication();
|
|
20
|
-
container.setApplication(app);
|
|
21
|
-
|
|
22
|
-
const getAccount = new NutshellGetAccountConnector();
|
|
23
|
-
const newAccount = new NutshellNewAccountConnector();
|
|
24
|
-
const newLead = new NutshellNewLeadConnector();
|
|
25
|
-
const newTask = new NutshellNewTaskConnector();
|
|
26
|
-
|
|
27
|
-
getAccount
|
|
28
|
-
.setSender(sender)
|
|
29
|
-
.setDb(db)
|
|
30
|
-
.setApplication(app);
|
|
31
|
-
container.setConnector(getAccount);
|
|
32
|
-
|
|
33
|
-
newAccount
|
|
34
|
-
.setSender(sender)
|
|
35
|
-
.setDb(db)
|
|
36
|
-
.setApplication(app);
|
|
37
|
-
container.setConnector(newAccount);
|
|
38
|
-
|
|
39
|
-
newLead
|
|
40
|
-
.setSender(sender)
|
|
41
|
-
.setDb(db)
|
|
42
|
-
.setApplication(app);
|
|
43
|
-
container.setConnector(newLead);
|
|
44
|
-
|
|
45
|
-
newTask
|
|
46
|
-
.setSender(sender)
|
|
47
|
-
.setDb(db)
|
|
48
|
-
.setApplication(app);
|
|
49
|
-
container.setConnector(newTask);
|
|
50
|
-
}
|
package/tsconfig.json
DELETED