@orchesty/connector-raynet-crm 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.
Files changed (95) hide show
  1. package/dist/package.json +4 -1
  2. package/package.json +4 -1
  3. package/CHANGELOG.md +0 -7
  4. package/coverage/clover.xml +0 -283
  5. package/coverage/coverage-final.json +0 -13
  6. package/coverage/lcov-report/base.css +0 -224
  7. package/coverage/lcov-report/block-navigation.js +0 -87
  8. package/coverage/lcov-report/favicon.png +0 -0
  9. package/coverage/lcov-report/index.html +0 -161
  10. package/coverage/lcov-report/prettify.css +0 -1
  11. package/coverage/lcov-report/prettify.js +0 -2
  12. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  13. package/coverage/lcov-report/sorter.js +0 -210
  14. package/coverage/lcov-report/src/Batch/RaynetCRMGetActivities.ts.html +0 -385
  15. package/coverage/lcov-report/src/Batch/RaynetCRMGetClients.ts.html +0 -679
  16. package/coverage/lcov-report/src/Batch/RaynetCRMGetContactPersons.ts.html +0 -553
  17. package/coverage/lcov-report/src/Batch/RaynetCRMSubscribeWebhook.ts.html +0 -355
  18. package/coverage/lcov-report/src/Batch/RaynetCRMUnregisterWebhook.ts.html +0 -241
  19. package/coverage/lcov-report/src/Batch/index.html +0 -176
  20. package/coverage/lcov-report/src/Connector/RaynetCRMGetVoipByTel.ts.html +0 -856
  21. package/coverage/lcov-report/src/Connector/RaynetCRMUniversalActivityDetail.ts.html +0 -448
  22. package/coverage/lcov-report/src/Connector/RaynetCRMUniversalCreateActivity.ts.html +0 -223
  23. package/coverage/lcov-report/src/Connector/RaynetCRMUniversalDeleteActivity.ts.html +0 -184
  24. package/coverage/lcov-report/src/Connector/RaynetCRMUniversalUpdateActivity.ts.html +0 -205
  25. package/coverage/lcov-report/src/Connector/index.html +0 -176
  26. package/coverage/lcov-report/src/RaynetCRMApplication.ts.html +0 -331
  27. package/coverage/lcov-report/src/index.html +0 -116
  28. package/coverage/lcov-report/test/dataProvider.ts.html +0 -205
  29. package/coverage/lcov-report/test/index.html +0 -116
  30. package/coverage/lcov.info +0 -465
  31. package/jest.config.js +0 -13
  32. package/src/Batch/RaynetCRMGetActivities.ts +0 -100
  33. package/src/Batch/RaynetCRMGetClients.ts +0 -198
  34. package/src/Batch/RaynetCRMGetContactPersons.ts +0 -156
  35. package/src/Batch/RaynetCRMSubscribeWebhook.ts +0 -90
  36. package/src/Batch/RaynetCRMUnregisterWebhook.ts +0 -52
  37. package/src/Batch/__tests__/Data/RaynetCRMGetActivities/from-input.json +0 -8
  38. package/src/Batch/__tests__/Data/RaynetCRMGetActivities/from-mock.json +0 -64
  39. package/src/Batch/__tests__/Data/RaynetCRMGetActivities/from-output.json +0 -11
  40. package/src/Batch/__tests__/Data/RaynetCRMGetActivities/input.json +0 -6
  41. package/src/Batch/__tests__/Data/RaynetCRMGetActivities/mock.json +0 -64
  42. package/src/Batch/__tests__/Data/RaynetCRMGetActivities/output.json +0 -11
  43. package/src/Batch/__tests__/Data/RaynetCRMGetClients/email-input.json +0 -8
  44. package/src/Batch/__tests__/Data/RaynetCRMGetClients/email-mock.json +0 -157
  45. package/src/Batch/__tests__/Data/RaynetCRMGetClients/email-output.json +0 -11
  46. package/src/Batch/__tests__/Data/RaynetCRMGetClients/input.json +0 -6
  47. package/src/Batch/__tests__/Data/RaynetCRMGetClients/mock.json +0 -157
  48. package/src/Batch/__tests__/Data/RaynetCRMGetClients/output.json +0 -11
  49. package/src/Batch/__tests__/Data/RaynetCRMGetContactPersons/email-input.json +0 -8
  50. package/src/Batch/__tests__/Data/RaynetCRMGetContactPersons/email-mock.json +0 -157
  51. package/src/Batch/__tests__/Data/RaynetCRMGetContactPersons/email-output.json +0 -11
  52. package/src/Batch/__tests__/Data/RaynetCRMGetContactPersons/input.json +0 -6
  53. package/src/Batch/__tests__/Data/RaynetCRMGetContactPersons/mock.json +0 -112
  54. package/src/Batch/__tests__/Data/RaynetCRMGetContactPersons/output.json +0 -11
  55. package/src/Batch/__tests__/Data/RaynetCRMSubscribeWebhook/input.json +0 -6
  56. package/src/Batch/__tests__/Data/RaynetCRMSubscribeWebhook/mock.json +0 -10
  57. package/src/Batch/__tests__/Data/RaynetCRMSubscribeWebhook/output.json +0 -6
  58. package/src/Batch/__tests__/Data/RaynetCRMUnregisterWebhook/input.json +0 -6
  59. package/src/Batch/__tests__/Data/RaynetCRMUnregisterWebhook/mock.json +0 -7
  60. package/src/Batch/__tests__/Data/RaynetCRMUnregisterWebhook/output.json +0 -6
  61. package/src/Batch/__tests__/RaynetCRMGetActivities.ts +0 -23
  62. package/src/Batch/__tests__/RaynetCRMGetClients.ts +0 -23
  63. package/src/Batch/__tests__/RaynetCRMGetContactPersons.ts +0 -23
  64. package/src/Batch/__tests__/RaynetCRMSubscribeWebhook.ts +0 -18
  65. package/src/Batch/__tests__/RaynetCRMUnregisterWebhook.ts +0 -42
  66. package/src/Connector/RaynetCRMGetVoipByTel.ts +0 -257
  67. package/src/Connector/RaynetCRMUniversalActivityDetail.ts +0 -121
  68. package/src/Connector/RaynetCRMUniversalCreateActivity.ts +0 -46
  69. package/src/Connector/RaynetCRMUniversalDeleteActivity.ts +0 -33
  70. package/src/Connector/RaynetCRMUniversalUpdateActivity.ts +0 -40
  71. package/src/Connector/__tests__/Data/RaynetCRMGetVoipByTel/input.json +0 -8
  72. package/src/Connector/__tests__/Data/RaynetCRMGetVoipByTel/mock.json +0 -216
  73. package/src/Connector/__tests__/Data/RaynetCRMGetVoipByTel/output.json +0 -217
  74. package/src/Connector/__tests__/Data/RaynetCRMUniversalActivityDetail/input.json +0 -22
  75. package/src/Connector/__tests__/Data/RaynetCRMUniversalActivityDetail/mock.json +0 -84
  76. package/src/Connector/__tests__/Data/RaynetCRMUniversalActivityDetail/output.json +0 -83
  77. package/src/Connector/__tests__/Data/RaynetCRMUniversalCreateActivity/input.json +0 -83
  78. package/src/Connector/__tests__/Data/RaynetCRMUniversalCreateActivity/mock.json +0 -10
  79. package/src/Connector/__tests__/Data/RaynetCRMUniversalCreateActivity/output.json +0 -11
  80. package/src/Connector/__tests__/Data/RaynetCRMUniversalDeleteActivity/input.json +0 -9
  81. package/src/Connector/__tests__/Data/RaynetCRMUniversalDeleteActivity/mock.json +0 -7
  82. package/src/Connector/__tests__/Data/RaynetCRMUniversalDeleteActivity/output.json +0 -8
  83. package/src/Connector/__tests__/Data/RaynetCRMUniversalUpdateActivity/input.json +0 -83
  84. package/src/Connector/__tests__/Data/RaynetCRMUniversalUpdateActivity/mock.json +0 -7
  85. package/src/Connector/__tests__/Data/RaynetCRMUniversalUpdateActivity/output.json +0 -8
  86. package/src/Connector/__tests__/RaynetCRMGetVoipByTel.ts +0 -18
  87. package/src/Connector/__tests__/RaynetCRMUniversalActivityDetail.ts +0 -18
  88. package/src/Connector/__tests__/RaynetCRMUniversalCreateActivity.ts +0 -18
  89. package/src/Connector/__tests__/RaynetCRMUniversalDeleteActivity.ts +0 -18
  90. package/src/Connector/__tests__/RaynetCRMUniversalUpdateActivity.ts +0 -18
  91. package/src/RaynetCRMApplication.ts +0 -82
  92. package/test/dataProvider.ts +0 -40
  93. package/tsconfig.json +0 -8
  94. package/tsconfig.prod.json +0 -13
  95. package/tsconfig.prod.tsbuildinfo +0 -1
@@ -1,11 +0,0 @@
1
- {
2
- "headers": {
3
- "user": "TestUser"
4
- },
5
- "data": [
6
- {
7
- "body": "{\"id\":3,\"titleBefore\":\"Ing.\",\"firstName\":\"Petr\",\"lastName\":\"Chytrý\",\"titleAfter\":\"CSc.\",\"primaryRelationship\":{\"id\":1,\"type\":\"konzultant\",\"company\":{\"id\":1,\"name\":\"RAYNET s.r.o.\"}},\"owner\":{\"id\":2,\"fullName\":\"test test\"},\"contactInfo\":{\"email\":\"podpora@raynet.cz\",\"email2\":\"test@raynet.cz\",\"tel1\":\"+420 553 401 547\",\"tel1Type\":\"mobil\",\"tel2\":null,\"tel2Type\":null,\"www\":null,\"otherContact\":null},\"privateAddress\":{\"city\":\"Ostrava\",\"country\":\"Česká republika\",\"countryCode\":\"CZ\",\"province\":null,\"street\":\"Ocelářská 177\",\"zipCode\":\"703 00\"},\"category\":{\"id\":96,\"value\":\"kat 1\"},\"personClassification1\":{\"id\":97,\"value\":\"kla 1\"},\"personClassification2\":{\"id\":98,\"value\":\"kla 2\"},\"personClassification3\":{\"id\":99,\"value\":\"kla 3\"},\"salutation\":\"pan\",\"birthday\":\"2022-06-10\",\"language\":{\"id\":70,\"value\":\"Český\"},\"maritalStatus\":{\"id\":78,\"value\":\"Svobodný/Svobodná\"},\"gender\":\"FEMALE\",\"companyAddress\":{\"address\":{\"id\":1,\"city\":\"Ostrava-Poruba\",\"country\":\"Česká republika\",\"countryCode\":\"CZ\",\"province\":null,\"street\":\"Francouzská 6167/5\",\"zipCode\":\"708 00\"},\"territory\":null},\"customFields\":null,\"rowInfo.createdAt\":\"2022-06-18 13:19\",\"rowInfo.createdBy\":\"demo@raynet.cz\",\"rowInfo.updatedAt\":\"2022-09-06 09:43\",\"rowInfo.updatedBy\":\"demo@raynet.cz\",\"rowInfo.rowAccess\":null,\"rowInfo.rowState\":null,\"securityLevel\":{\"id\":1,\"name\":\"Sdílená\"},\"notice\":\"poznámka\",\"activeUserAccount\":true,\"keyman\":false,\"tags\":[],\"_version\":19,\"inlineGdpr\":[{\"id\":1,\"validFrom\":\"2022-01-01\",\"validTill\":\"2022-01-01\",\"legalTitle\":\"LEGITIMATE_INTEREST\",\"templateName\":\"Opravněný zájem\",\"gdprTemplate\":1}]}",
8
- "headers": {}
9
- }
10
- ]
11
- }
@@ -1,6 +0,0 @@
1
- {
2
- "headers": {
3
- "user": "TestUser"
4
- },
5
- "data": {}
6
- }
@@ -1,10 +0,0 @@
1
- {
2
- "http": "PUT https://app.raynet.cz/api/v2/webhook",
3
- "code": 201,
4
- "body": {
5
- "success": true,
6
- "data": {
7
- "uuid": "532d339c0a874f68ae8f2cc108c7f7b2"
8
- }
9
- }
10
- }
@@ -1,6 +0,0 @@
1
- {
2
- "headers": {
3
- "user": "TestUser"
4
- },
5
- "data": []
6
- }
@@ -1,6 +0,0 @@
1
- {
2
- "headers": {
3
- "user": "TestUser"
4
- },
5
- "data": {}
6
- }
@@ -1,7 +0,0 @@
1
- {
2
- "http": "DELETE https://app.raynet.cz/api/v2/webhook/1",
3
- "code": 200,
4
- "body": {
5
- "success": true
6
- }
7
- }
@@ -1,6 +0,0 @@
1
- {
2
- "headers": {
3
- "user": "TestUser"
4
- },
5
- "data": []
6
- }
@@ -1,23 +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, mock } from '../../../test/dataProvider';
4
- import { NAME as RAYNET_CRM_GET_ACTIVITIES } from '../RaynetCRMGetActivities';
5
-
6
- let tester: NodeTester;
7
-
8
- describe('Tests for RaynetCRMGetActivities', () => {
9
- beforeAll(() => {
10
- init();
11
- tester = new NodeTester(container, __filename);
12
- });
13
-
14
- it('process - ok', async () => {
15
- mock();
16
- await tester.testBatch(RAYNET_CRM_GET_ACTIVITIES);
17
- });
18
-
19
- it('process - with from', async () => {
20
- mock();
21
- await tester.testBatch(RAYNET_CRM_GET_ACTIVITIES, 'from');
22
- });
23
- });
@@ -1,23 +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, mock } from '../../../test/dataProvider';
4
- import { NAME as RAYNET_CRM_GET_CLIENTS } from '../RaynetCRMGetClients';
5
-
6
- let tester: NodeTester;
7
-
8
- describe('Tests for RaynetCRMGetClients', () => {
9
- beforeAll(() => {
10
- init();
11
- tester = new NodeTester(container, __filename);
12
- });
13
-
14
- it('process - ok', async () => {
15
- mock();
16
- await tester.testBatch(RAYNET_CRM_GET_CLIENTS);
17
- });
18
-
19
- it('process - with email', async () => {
20
- mock();
21
- await tester.testBatch(RAYNET_CRM_GET_CLIENTS, 'email');
22
- });
23
- });
@@ -1,23 +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, mock } from '../../../test/dataProvider';
4
- import { NAME as RAYNET_CRM_GET_CONTACT_PERSONS } from '../RaynetCRMGetContactPersons';
5
-
6
- let tester: NodeTester;
7
-
8
- describe('Tests for RaynetCRMGetContactPersons', () => {
9
- beforeAll(() => {
10
- init();
11
- tester = new NodeTester(container, __filename);
12
- });
13
-
14
- it('process - ok', async () => {
15
- mock();
16
- await tester.testBatch(RAYNET_CRM_GET_CONTACT_PERSONS);
17
- });
18
-
19
- it('process - with email', async () => {
20
- mock();
21
- await tester.testBatch(RAYNET_CRM_GET_CONTACT_PERSONS, 'email');
22
- });
23
- });
@@ -1,18 +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, mock } from '../../../test/dataProvider';
4
- import { NAME as RAYNET_CRM_SUBSCRIBE_WEBHOOK } from '../RaynetCRMSubscribeWebhook';
5
-
6
- let tester: NodeTester;
7
-
8
- describe('Tests for RaynetCRMSubscribeWebhook', () => {
9
- beforeAll(() => {
10
- tester = new NodeTester(container, __filename);
11
- });
12
-
13
- it('process - ok', async () => {
14
- init();
15
- mock();
16
- await tester.testBatch(RAYNET_CRM_SUBSCRIBE_WEBHOOK);
17
- });
18
- });
@@ -1,42 +0,0 @@
1
- import { DEFAULT_USER } from '@orchesty/nodejs-connectors/test/DataProvider';
2
- import { container } from '@orchesty/nodejs-connectors/test/TestAbstract';
3
- import { orchestyOptions } from '@orchesty/nodejs-sdk/dist/lib/Config/Config';
4
- import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
5
- import { mockOnce } from '@orchesty/nodejs-sdk/dist/test/MockServer';
6
- import NodeTester from '@orchesty/nodejs-sdk/dist/test/Testers/NodeTester';
7
- import { init, mock } from '../../../test/dataProvider';
8
- import { NAME as RAYNET_CRM_UNREGISTER_WEBHOOK } from '../RaynetCRMUnregisterWebhook';
9
-
10
- let tester: NodeTester;
11
-
12
- describe('Tests for RaynetCRMUnregisterWebhook', () => {
13
- beforeAll(() => {
14
- tester = new NodeTester(container, __filename);
15
- });
16
-
17
- it('process - ok', async () => {
18
- init();
19
- mock();
20
- mockOnce([
21
- {
22
- request: {
23
- url: new RegExp(`${orchestyOptions.workerApi}\\/document\\/Webhook.*`),
24
- method: HttpMethods.GET,
25
- },
26
- response: {
27
- body: [{
28
- name: 'record.created',
29
- user: DEFAULT_USER,
30
- token: 'testToken',
31
- node: 'testNode',
32
- topology: 'testTopology',
33
- application: 'raynet',
34
- webhookId: '1',
35
- unsubscribeFailed: false,
36
- }],
37
- },
38
- },
39
- ]);
40
- await tester.testBatch(RAYNET_CRM_UNREGISTER_WEBHOOK);
41
- });
42
- });
@@ -1,257 +0,0 @@
1
- import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
2
- import ResponseDto from '@orchesty/nodejs-sdk/dist/lib/Transport/Curl/ResponseDto';
3
- import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
4
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
5
-
6
- export const NAME = 'raynet-crm-get-voip-by-tel';
7
-
8
- export default class RaynetCRMGetVoipByTel extends AConnector {
9
-
10
- public getName(): string {
11
- return NAME;
12
- }
13
-
14
- public async processAction(dto: ProcessDto<IInput>): Promise<ProcessDto<IOutput>> {
15
- const tel = this.getData(dto);
16
-
17
- const req = await this.getApplication().getRequestDto(
18
- dto,
19
- await this.getApplicationInstallFromProcess(dto),
20
- HttpMethods.GET,
21
- `voip/searchByTel?query=${tel}`,
22
- );
23
- const resp = await this.getSender().send<IResponse>(req, [201]);
24
-
25
- return this.processResult(dto, resp);
26
- }
27
-
28
- protected getData(dto: ProcessDto<IInput>): string {
29
- return dto.getJsonData().tel;
30
- }
31
-
32
- protected processResult(dto: ProcessDto, resp: ResponseDto<IResponse>): ProcessDto<IOutput> {
33
- return dto.setNewJsonData(resp.getJsonBody()) as unknown as ProcessDto<IOutput>;
34
- }
35
-
36
- }
37
-
38
- export interface IInput {
39
- tel: string;
40
- }
41
-
42
- export interface IResponse {
43
- success: boolean;
44
- data: IOutput;
45
- }
46
-
47
- export interface IOutput {
48
- person: IContact[];
49
- company: IContact[];
50
- lead: IContact[];
51
- }
52
-
53
- /* eslint-disable @typescript-eslint/naming-convention */
54
- export interface IContact {
55
- id: number;
56
- _permission: number;
57
- _version: number;
58
- name: string;
59
- state: string;
60
- role: string;
61
- owner: {
62
- id: number;
63
- _permission: number;
64
- _version: number;
65
- gender?: unknown;
66
- fullName: string;
67
- fullNameWithoutTitles: string;
68
- firstName: string;
69
- lastName: string;
70
- titleBefore?: unknown;
71
- notice?: unknown;
72
- titleAfter?: unknown;
73
- photo?: unknown;
74
- category?: unknown;
75
- salutation?: unknown;
76
- personClassification1?: unknown;
77
- personClassification2?: unknown;
78
- personClassification3?: unknown;
79
- customFields?: unknown;
80
- 'contactInfo.tel1': string;
81
- 'contactInfo.tel1Type'?: unknown;
82
- 'contactInfo.tel2'?: unknown;
83
- 'contactInfo.tel2Type'?: unknown;
84
- 'contactInfo.email': string;
85
- 'contactInfo.email2'?: unknown;
86
- 'contactInfo.www'?: unknown;
87
- 'privateAddress.countryCode'?: unknown;
88
- activeUserAccount: boolean;
89
- extIds?: unknown;
90
- securityLevel: {
91
- id: number;
92
- _permission: number;
93
- name: string;
94
- locked: boolean;
95
- extIds?: unknown;
96
- };
97
- };
98
- rating: string;
99
- regNumber: string;
100
- taxNumber: string;
101
- paymentTerm: {
102
- id: number;
103
- _permission: number;
104
- code01: string;
105
- code02?: unknown;
106
- numValue01: number;
107
- numValue02: number;
108
- strValue01?: unknown;
109
- strValue02?: unknown;
110
- rowAccess?: unknown;
111
- extIds?: unknown;
112
- };
113
- logo: {
114
- id: number;
115
- _permission: number;
116
- _version: number;
117
- contentType: string;
118
- fileName: string;
119
- iconSmallSize: number;
120
- iconSmallUuid?: unknown;
121
- size: number;
122
- preview: boolean;
123
- uuid: string;
124
- iconMediumUuid: string;
125
- iconMediumSize: number;
126
- iconLargeUuid?: unknown;
127
- iconLargeSize: number;
128
- };
129
- birthday: string;
130
- birthdayMonthDay: string;
131
- primaryAddress: {
132
- id: number;
133
- _permission: number;
134
- _version: number;
135
- 'address.name': string;
136
- 'address.street': string;
137
- 'address.province'?: unknown;
138
- 'address.zipCode': string;
139
- 'address.city': string;
140
- 'address.countryCode': string;
141
- 'address.countryName': string;
142
- 'address.lat': number;
143
- 'address.lng': number;
144
- territory?: unknown;
145
- 'contactInfo.tel1': string;
146
- 'contactInfo.tel1Normalized': string;
147
- 'contactInfo.tel1Type'?: unknown;
148
- 'contactInfo.tel2'?: unknown;
149
- 'contactInfo.tel2Normalized'?: unknown;
150
- 'contactInfo.tel2Type'?: unknown;
151
- 'contactInfo.email': string;
152
- 'contactInfo.email2'?: unknown;
153
- 'contactInfo.www': string;
154
- 'contactInfo.fax'?: unknown;
155
- 'contactInfo.doNotSendMM': boolean;
156
- 'contactInfo.otherContact'?: unknown;
157
- primary: boolean;
158
- extIds?: unknown;
159
- contactAddress: boolean;
160
- };
161
- contactAddress: {
162
- id: number;
163
- _permission: number;
164
- _version: number;
165
- 'address.name': string;
166
- 'address.street': string;
167
- 'address.province'?: unknown;
168
- 'address.zipCode': string;
169
- 'address.city': string;
170
- 'address.countryCode': string;
171
- 'address.countryName': string;
172
- 'address.lat': number;
173
- 'address.lng': number;
174
- territory?: unknown;
175
- 'contactInfo.tel1': string;
176
- 'contactInfo.tel1Normalized': string;
177
- 'contactInfo.tel1Type'?: unknown;
178
- 'contactInfo.tel2'?: unknown;
179
- 'contactInfo.tel2Normalized'?: unknown;
180
- 'contactInfo.tel2Type'?: unknown;
181
- 'contactInfo.email': string;
182
- 'contactInfo.email2'?: unknown;
183
- 'contactInfo.www': string;
184
- 'contactInfo.fax'?: unknown;
185
- 'contactInfo.doNotSendMM': boolean;
186
- 'contactInfo.otherContact'?: unknown;
187
- primary: boolean;
188
- extIds?: unknown;
189
- contactAddress: boolean;
190
- };
191
- 'rowInfo.createdAt': string;
192
- 'rowInfo.createdBy': string;
193
- 'rowInfo.lastModifiedAt': string;
194
- 'rowInfo.lastModifiedBy': string;
195
- securityLevel: {
196
- id: number;
197
- _permission: number;
198
- name: string;
199
- locked: boolean;
200
- extIds?: unknown;
201
- };
202
- validFrom: string;
203
- person: boolean;
204
- 'socialNetworkContact.facebook': string;
205
- 'currentBusinessValue.businessValue': number;
206
- 'currentBusinessValue.openBusinessValue': number;
207
- legalForm: {
208
- id: number;
209
- _permission: number;
210
- code01: string;
211
- strValue01?: unknown;
212
- rowAccess?: unknown;
213
- };
214
- category?: unknown;
215
- economyActivity?: unknown;
216
- turnover?: unknown;
217
- notice?: unknown;
218
- contactSource?: unknown;
219
- employeesNumber?: unknown;
220
- taxNumber2?: unknown;
221
- bankAccount?: unknown;
222
- taxPayer?: unknown;
223
- databox?: unknown;
224
- court?: unknown;
225
- originLead?: unknown;
226
- companyClassification1?: unknown;
227
- companyClassification2?: unknown;
228
- companyClassification3?: unknown;
229
- prevActivity?: unknown;
230
- nextActivity?: unknown;
231
- lastWonBc?: unknown;
232
- 'rowInfo.rowAccess'?: unknown;
233
- 'rowInfo.rowState'?: unknown;
234
- 'rowInfo.updatedAt'?: unknown;
235
- 'rowInfo.updatedBy'?: unknown;
236
- tags?: unknown;
237
- validTill?: unknown;
238
- customFields?: unknown;
239
- 'socialNetworkContact.googleplus'?: unknown;
240
- 'socialNetworkContact.twitter'?: unknown;
241
- 'socialNetworkContact.linkedin'?: unknown;
242
- 'socialNetworkContact.pinterest'?: unknown;
243
- 'socialNetworkContact.instagram'?: unknown;
244
- 'socialNetworkContact.skype'?: unknown;
245
- 'socialNetworkContact.youtube'?: unknown;
246
- firstName?: unknown;
247
- lastName?: unknown;
248
- salutation?: unknown;
249
- titleAfter?: unknown;
250
- titleBefore?: unknown;
251
- fullName?: unknown;
252
- inlineGdpr?: unknown;
253
- inlineSign?: unknown;
254
- extIds?: unknown;
255
- noticeJson?: unknown;
256
- }
257
- /* eslint-enable @typescript-eslint/naming-convention */
@@ -1,121 +0,0 @@
1
- import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
2
- import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
3
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
4
-
5
- export const NAME = 'raynet-crm-universal-activity-detail';
6
-
7
- export function getEntityType(entityName: string): string {
8
- let name = entityName.toLocaleLowerCase();
9
- if (name === 'phonecall') {
10
- name = 'phoneCall';
11
- }
12
-
13
- return name;
14
- }
15
-
16
- export default class RaynetCRMUniversalActivityDetail extends AConnector {
17
-
18
- public getName(): string {
19
- return NAME;
20
- }
21
-
22
- public async processAction(dto: ProcessDto<IInput>): Promise<ProcessDto<IActivityData>> {
23
- const data = dto.getJsonData();
24
- const { entityName, entityId } = data.data;
25
- const entityType = getEntityType(entityName);
26
-
27
- const req = await this.getApplication().getRequestDto(
28
- dto,
29
- await this.getApplicationInstallFromProcess(dto),
30
- HttpMethods.GET,
31
- `${entityType}/${entityId}?dateFormat=ISO8601`,
32
- );
33
- const resp = await this.getSender().send<IResponse>(req, [200]);
34
-
35
- return dto.setNewJsonData({ ...resp.getJsonBody().data, _entityName: entityName });
36
- }
37
-
38
- }
39
-
40
- export interface IInput {
41
- eventId: string;
42
- createdAt: string;
43
- type: string;
44
- author: string;
45
- source: {
46
- name: string;
47
- description: string;
48
- };
49
- data: {
50
- entityName: string;
51
- entityId: number;
52
- extIds: string[];
53
- };
54
- }
55
-
56
- /* eslint-disable @typescript-eslint/naming-convention */
57
- export interface IResponse {
58
- success: string;
59
- data: IActivityData;
60
- }
61
-
62
- export interface IActivityData {
63
- id: number;
64
- title: string;
65
- completed: string;
66
- campaignName: string;
67
- source: string;
68
- externalOverviewUrl: string;
69
- externalThumbnailUrl: string;
70
- _version: number;
71
- stats: {
72
- sent: string;
73
- clicked: string;
74
- opened: string;
75
- unsubscribed: string;
76
- };
77
- category: {
78
- id: number;
79
- value: string;
80
- };
81
- priority: string;
82
- status: string;
83
- personal: boolean;
84
- owner: number;
85
- resolver: number;
86
- company: {
87
- id: number;
88
- name: string;
89
- };
90
- scheduledFrom: string;
91
- scheduledTill: string;
92
- description: string;
93
- solution: string;
94
- tags: undefined[];
95
- 'rowInfo.createdAt': string;
96
- 'rowInfo.createdBy': string;
97
- 'rowInfo.updatedAt': string;
98
- 'rowInfo.updatedBy': string;
99
- securityLevel: {
100
- id: number;
101
- name: string;
102
- };
103
- customFields: unknown;
104
- participants: {
105
- id: number;
106
- owner: boolean;
107
- name: string;
108
- person: number;
109
- company: number;
110
- }[];
111
- recurrence: {
112
- id: number;
113
- count: number;
114
- interval: string;
115
- recurrenceDay: number;
116
- startDate: string;
117
- };
118
- deadline: string;
119
- meetingPlace: string;
120
- }
121
- /* eslint-enable @typescript-eslint/naming-convention */
@@ -1,46 +0,0 @@
1
- import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
2
- import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
3
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
4
- import { getEntityType, IActivityData } from './RaynetCRMUniversalActivityDetail';
5
-
6
- export const NAME = 'raynet-crm-universal-create-activity';
7
-
8
- export default class RaynetCRMUniversalCreateActivity extends AConnector {
9
-
10
- public getName(): string {
11
- return NAME;
12
- }
13
-
14
- public async processAction(dto: ProcessDto<IInput>): Promise<ProcessDto<IResponse>> {
15
- const { entityName, ...data } = dto.getJsonData();
16
-
17
- if (entityName.toLowerCase() === 'task' && data.participants?.length) {
18
- data.resolver = data.participants[0].id;
19
- }
20
-
21
- const req = await this.getApplication().getRequestDto(
22
- dto,
23
- await this.getApplicationInstallFromProcess(dto),
24
- HttpMethods.PUT,
25
- getEntityType(entityName),
26
- data,
27
- );
28
- const resp = await this.getSender().send<IResponse>(req, [201]);
29
-
30
- return dto.setNewJsonData(resp.getJsonBody());
31
- }
32
-
33
- }
34
-
35
- export type IActivityOptionalData = Partial<IActivityData>;
36
-
37
- export interface IInput extends IActivityOptionalData {
38
- entityName: string;
39
- }
40
-
41
- export interface IResponse {
42
- success: boolean;
43
- data: {
44
- id: number;
45
- };
46
- }
@@ -1,33 +0,0 @@
1
- import AConnector from '@orchesty/nodejs-sdk/dist/lib/Connector/AConnector';
2
- import { HttpMethods } from '@orchesty/nodejs-sdk/dist/lib/Transport/HttpMethods';
3
- import ProcessDto from '@orchesty/nodejs-sdk/dist/lib/Utils/ProcessDto';
4
- import { getEntityType } from './RaynetCRMUniversalActivityDetail';
5
- import { IResponse } from './RaynetCRMUniversalUpdateActivity';
6
-
7
- export const NAME = 'raynet-crm-universal-delete-activity';
8
-
9
- export default class RaynetCRMUniversalDeleteActivity extends AConnector {
10
-
11
- public getName(): string {
12
- return NAME;
13
- }
14
-
15
- public async processAction(dto: ProcessDto<IInput>): Promise<ProcessDto<IResponse>> {
16
- const { entityName, id } = dto.getJsonData();
17
- const req = await this.getApplication().getRequestDto(
18
- dto,
19
- await this.getApplicationInstallFromProcess(dto),
20
- HttpMethods.DELETE,
21
- `${getEntityType(entityName)}/${id}`,
22
- );
23
- const resp = await this.getSender().send<IResponse>(req, [200]);
24
-
25
- return dto.setNewJsonData(resp.getJsonBody());
26
- }
27
-
28
- }
29
-
30
- export interface IInput {
31
- entityName: string;
32
- id: number;
33
- }