|
11 | 11 | - Please note that EventContextIn and EventContextOut interfaces are deprecated. |
12 | 12 |
|
13 | 13 | - The External Domain Metadata is a JSON object that describes the logical domain model of an external system. It defines the types of external record types, the relationships between those record types, and the metadata associated with each field, including the field’s data type, human-readable name, and other descriptive attributes. |
| 14 | + - Note: Resource "attachments" should not be included in The External Domain Metadata JSON object even if the external system supports attachments. This is handled automatically by The Airdrop SDK Library. |
14 | 15 |
|
15 | 16 | - The Initial Domain Mapping is a JSON object that defines how the logical domain model described by The External Domain Metadata maps to the target domain model in DevRev. It specifies the correspondence between each external record type and DevRev leaf type, as well as the mapping of individual fields, including transformation logic, value conversions, and any fixed or default values. |
| 17 | + - Note: Resource "attachments" should not be included in The Initial Domain Mapping JSON object even if the external system supports attachments. This is handled automatically by The Airdrop SDK Library. |
16 | 18 |
|
17 | 19 | - The External Sync Unit Item Count is a numeric field representing the total number of items (such as cards) contained within a given external sync unit. It is accessible as "item_count" field of the external sync unit. |
18 | 20 |
|
|
27 | 29 |
|
28 | 30 | - The Snap-In will run on Node.js as the runtime environment. |
29 | 31 |
|
30 | | -- The Snap-In should use The Airdrop SDK Library version "1.8.0" for handling data extraction and loading, pushing data, event-driven actions, state management, and artifact handling. |
| 32 | +- The Snap-In should use The Airdrop SDK Library version "1.9.0" for handling data extraction and loading, pushing data, event-driven actions, state management, and artifact handling. |
31 | 33 |
|
32 | 34 | - Use snake_case for JSON keys. |
33 | 35 |
|
|
57 | 59 | - The Conformance Tests should use the The Test Snap-In Server - do not use mock server. |
58 | 60 |
|
59 | 61 | - The Conformance Tests should spin a server at http://localhost:8002 for testing callbacks (The Callback Server). |
| 62 | + - The Conformance Tests *MUST NOT* send the event directly to The Callback Server. |
60 | 63 |
|
61 | 64 | - The DevRev Server runs at http://localhost:8003, so it must not be mocked. |
62 | 65 |
|
63 | 66 | - The Worker Data Server is part of The DevRev Server and is accessible at http://localhost:8003/external-worker, so it must not be mocked. |
64 | 67 |
|
| 68 | +- The API server is running at http://localhost:8004, so it must not be mocked. |
| 69 | + |
65 | 70 | - The `jest.setup.js` file is managed externally and cannot be modified within The Conformance Tests. |
66 | 71 |
|
67 | 72 | - All test files from The Conformance Tests must use the `.test.ts` suffix to be discoverable by Jest's default test pattern matching. |
68 | 73 |
|
69 | 74 | - The Conformance Tests should send a single event to the Snap-In Server in the request body without wrapping it in an array. |
| 75 | + - It is safe to assume that event payload will never be undefined, null, or empty. |
| 76 | + |
| 77 | +- If generating The Acceptance Test that references a JSON file (The Attached JSON Of The Acceptance Test) in the resource, you should: |
| 78 | + - Store The Attached JSON Of The Acceptance Test in a separate JSON file. |
| 79 | + - Make sure to replace placeholders of the credentials (in `event["payload"]["connection_data"]["key"]` and `event["payload"]["connection_data"]["org_id"]`) in The Attached JSON Of The Acceptance Test with the actual values (credentials from The API). |
70 | 80 |
|
| 81 | +- The Conformance Tests should encourage code reuse. Most notably, you should avoid duplication of the following: |
| 82 | + - Setting up The Callback Server, |
| 83 | + - Reading environment variables, |
| 84 | + - Defining the test event payload sent to The Snap-In Server. |
71 | 85 |
|
72 | 86 | # The TypeScript Node.js application boilerplate |
73 | 87 |
|
74 | 88 | ***Non-Functional Requirements:*** |
75 | 89 |
|
76 | 90 | - Logic of pushing data to The DevRev Servers must be implemented in the worker thread and invoked with the "spawn" method from The Airdrop SDK Library. |
77 | 91 |
|
| 92 | +- The Worker Thread must be implemented in TypeScript and *The Worker Thread MUST BE* referenced with a .ts (TypeScript) extension, not .js (JavaScript). |
| 93 | + |
78 | 94 | - The Function being implemented *MUST not* be called "extraction" or "loading". |
79 | 95 |
|
80 | 96 | ***Functional Requirements:*** |
81 | 97 |
|
82 | 98 | - Implement The Function that only checks if The Function can be invoked. |
83 | 99 |
|
84 | | -- Implement The Function called "test_external_sync_units" that provides a test of the 'external sync units' part of the extraction workflow as described in the resource [external-sync-units-extraction.mdx](docs/external-sync-units-extraction.mdx). Only check if the extraction can be triggered and that it successfully completes. Disregard all other details. |
| 100 | +- Implement The Function called "test_external_sync_units" (The External Sync Units Test Function) that provides a test of the 'external sync units' part of the extraction workflow as described in the resource [external-sync-units-extraction.mdx](docs/external-sync-units-extraction.mdx). |
| 101 | + - If "event_type" equals "EXTRACTION_EXTERNAL_SYNC_UNITS_START", The External Sync Units Test Function should: |
| 102 | + - Only emit event "EXTRACTION_EXTERNAL_SYNC_UNITS_DONE". |
85 | 103 |
|
86 | 104 | ***Acceptance Tests:*** |
87 | 105 |
|
88 | 106 | - Test The Function using the resource [external_sync_unit_check.json](test_data/external_sync_unit_check.json). Test is successful if The Callback Server receives from DevRev an event with "event_type" that equals "EXTRACTION_EXTERNAL_SYNC_UNITS_DONE". The test must not send the event directly to The Callback Server. |
89 | 107 |
|
90 | 108 | - Implement The Function called "data_extraction_check" (The Data Extraction Check Function) that provides a test of the 'data extraction' part of the extraction workflow as described in the resource [data-extraction.md](docs/data-extraction.md). The Data Extraction Check Function should: |
91 | | - - Initialize a single repo "users" |
92 | | - - normalize the users data using The Normalization Function |
93 | | - - push the normalized users data to The DevRev Servers |
94 | | - - Note: The Data Extraction Check Function should be simplified and should disregard all other details. |
| 109 | + - if "event_type" equals "EXTRACTION_DATA_START" or "EXTRACTION_ATTACHMENTS_CONTINUE", The Data Extraction Check Function should: |
| 110 | + - Initialize a single repo "users" |
| 111 | + - normalize the users data using The Normalization Function |
| 112 | + - push the normalized users data to The DevRev Servers |
| 113 | + - Emit event "EXTRACTION_DATA_DONE". |
| 114 | + - Note: The Data Extraction Check Function should be simplified and should disregard all other details. |
95 | 115 |
|
96 | 116 | ***Acceptance Tests:*** |
97 | 117 |
|
|
0 commit comments