@devrev/ts-adaas 0.0.1 → 0.0.2

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 (38) hide show
  1. package/README.md +16 -4
  2. package/dist/src/adapter/index.d.ts +35 -30
  3. package/dist/src/adapter/index.js +93 -56
  4. package/dist/src/common/constants.d.ts +2 -0
  5. package/dist/src/common/constants.js +10 -0
  6. package/dist/src/{adapter → common}/helpers.d.ts +4 -1
  7. package/dist/src/{adapter → common}/helpers.js +16 -4
  8. package/dist/src/demo-extractor/index.d.ts +8 -1
  9. package/dist/src/demo-extractor/index.js +64 -56
  10. package/dist/src/demo-extractor/initial_domain_mapping.json +107 -0
  11. package/dist/src/http/client.d.ts +1 -1
  12. package/dist/src/http/client.js +2 -2
  13. package/dist/src/http/index.d.ts +0 -1
  14. package/dist/src/http/index.js +0 -1
  15. package/dist/src/index.d.ts +1 -0
  16. package/dist/src/index.js +1 -0
  17. package/dist/src/logging/index.d.ts +5 -18
  18. package/dist/src/logging/index.js +20 -41
  19. package/dist/src/state/index.d.ts +23 -0
  20. package/dist/src/state/index.js +111 -0
  21. package/dist/src/types/extraction.d.ts +16 -5
  22. package/dist/src/uploader/index.d.ts +4 -2
  23. package/dist/src/uploader/index.js +61 -4
  24. package/dist/tests/adapter.helpers.test.js +60 -0
  25. package/dist/tests/adapter.test.js +106 -57
  26. package/dist/tests/demo-extractor.test.js +44 -81
  27. package/dist/tests/state.test.js +100 -0
  28. package/dist/tests/uploader.test.js +29 -0
  29. package/package.json +1 -1
  30. package/dist/src/adapter/index.test.js +0 -105
  31. package/dist/src/demo-extractor/recipe.json +0 -37
  32. package/dist/tests/helpers.test.js +0 -38
  33. package/dist/tests/test-helpers.d.ts +0 -2
  34. package/dist/tests/test-helpers.js +0 -33
  35. package/dist/tests/types.test.js +0 -71
  36. /package/dist/{src/adapter/index.test.d.ts → tests/adapter.helpers.test.d.ts} +0 -0
  37. /package/dist/tests/{helpers.test.d.ts → state.test.d.ts} +0 -0
  38. /package/dist/tests/{types.test.d.ts → uploader.test.d.ts} +0 -0
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createAirdropEvent = void 0;
4
- function createAirdropEvent(event_type, overrides) {
5
- return Object.assign({ execution_metadata: {
6
- devrev_endpoint: 'devrev_endpoint',
7
- }, context: {
8
- secrets: {
9
- service_account_token: 'service_account_token',
10
- },
11
- }, payload: {
12
- connection_data: {
13
- org_id: 'org_id',
14
- org_name: 'org_name',
15
- key: 'key',
16
- key_type: 'key_type',
17
- },
18
- event_context: {
19
- mode: 'mode',
20
- callback_url: 'callback_url',
21
- dev_org_id: 'dev_org_id',
22
- dev_user_id: 'dev_user_id',
23
- external_system_id: 'external_system_id',
24
- uuid: 'uuid',
25
- sync_run_id: 'sync_run_id',
26
- },
27
- event_type,
28
- }, input_data: {
29
- global_values: {},
30
- event_sources: {},
31
- } }, overrides);
32
- }
33
- exports.createAirdropEvent = createAirdropEvent;
@@ -1,71 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- describe('Airdrop event types', () => {
4
- describe('ExternalSyncUnit', () => {
5
- test('should have the required properties', () => {
6
- const externalSyncUnit = {
7
- id: '123',
8
- name: 'test-unit-name',
9
- description: 'test-unit-description',
10
- item_count: 0,
11
- };
12
- expect(externalSyncUnit).toHaveProperty('id');
13
- expect(externalSyncUnit).toHaveProperty('name');
14
- expect(externalSyncUnit).toHaveProperty('description');
15
- expect(externalSyncUnit).toHaveProperty('item_count');
16
- });
17
- });
18
- describe('EventContextIn', () => {
19
- test('should have the required properties', () => {
20
- const eventContext = {
21
- mode: 'INITIAL',
22
- callback_url: 'https://test.com',
23
- dev_org_id: 'DEV-123',
24
- dev_user_id: 'DEVU-123',
25
- external_system_id: '123',
26
- sync_run_id: '123',
27
- uuid: '123',
28
- };
29
- expect(eventContext).toHaveProperty('mode');
30
- expect(eventContext).toHaveProperty('callback_url');
31
- expect(eventContext).toHaveProperty('dev_org_id');
32
- expect(eventContext).toHaveProperty('dev_user_id');
33
- expect(eventContext).toHaveProperty('external_system_id');
34
- expect(eventContext).toHaveProperty('uuid');
35
- });
36
- });
37
- describe('ConnectionData', () => {
38
- test('should have the required properties', () => {
39
- const connectionData = {
40
- org_id: '123',
41
- org_name: 'test-org-name',
42
- key: 'test-key',
43
- key_type: 'test-key-type',
44
- };
45
- expect(connectionData).toHaveProperty('org_id');
46
- expect(connectionData).toHaveProperty('org_name');
47
- expect(connectionData).toHaveProperty('key');
48
- expect(connectionData).toHaveProperty('key_type');
49
- });
50
- });
51
- describe('ErrorRecord', () => {
52
- test('should have the required properties', () => {
53
- const errorRecord = {
54
- message: 'test-message',
55
- };
56
- expect(errorRecord).toHaveProperty('message');
57
- });
58
- });
59
- describe('Artifact', () => {
60
- test('should have the required properties', () => {
61
- const artifact = {
62
- item_count: 0,
63
- id: '123',
64
- item_type: 'test-item-type',
65
- };
66
- expect(artifact).toHaveProperty('item_type');
67
- expect(artifact).toHaveProperty('id');
68
- expect(artifact).toHaveProperty('item_count');
69
- });
70
- });
71
- });