Skip to content

Commit fc3cfe7

Browse files
authored
Updated plain source for Trello (#8)
This PR includes a couple of changes regarding Trello plain source, including adding pagination and rate-limiting. **Important**: PR #9 contains the source code (TypeScript) that was generated from specification files from this branch. Related issue: https://app.devrev.ai/devrev/works/ISS-180117
1 parent ac3fd62 commit fc3cfe7

12 files changed

+460
-1282
lines changed

config.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,3 @@ template-dir: ../airdrop-shared
33
unittests-script: ../airdrop-shared/run_unittests_jest.sh
44
conformance-tests-script: ../airdrop-shared/run_devrev_snapin_conformance_tests.sh
55
verbose: true # verbose flag, defaults to false if not set
6-
debug: true # debug flag, defaults to false if not set

devrev-trello-snapin.plain

Lines changed: 122 additions & 112 deletions
Large diffs are not rendered by default.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
- The record type 'cards' (Name: Cards) should have the following fields:
2+
- name (display name: "Name", is required, type: text)
3+
- url (display name: "URL", is required, type: text)
4+
- description (display name: "Description", is required, type: rich text)
5+
- id_members (display name: "ID Members", is required, type: reference)
6+
- Field id_members refers to the record type "#record:users".
7+
- Type of field id_members is an array with max_length 50.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- The record type 'users' (Name: Users) should have two fields:
2+
- full_name (display name: "Full Name", is required, type: text)
3+
- username (display name: "Username", is required, type: text)
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
- The record_type_mappings "cards" should have the following properties:
2+
- Default mapping should map each external card to a "issue" object.
3+
- There should be a single "possible_record_type_mappings" element, specifying:
4+
- The mapping is one-way (reverse is false, forward is true)
5+
- There should be no custom fields in the mapping.
6+
- The following The Stock Field Mapping Fields should be mapped using The External Transformation Method:
7+
- field "name" should be mapped to "title"
8+
- field "url" should be mapped to "item_url_field"
9+
- field "description" should be mapped to "body" (rich text)
10+
- field "id_members" should be mapped to "owned_by_ids" (use directly)
11+
- The following The Stock Field Mapping Fields should be mapped using The Fixed Transformation Method:
12+
- field "priority" should contain fixed value "P2"
13+
- field "stage" should contain fixed value "triage"
14+
- The following The Stock Field Mapping Fields should be mapped using The DevRev Record Transformation Method:
15+
- field "applies_to_part_id" should refer to the "product" object type
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
- The record_type_mappings "users" should have the following properties:
2+
- Default mapping should map each external user to a "devu" user object.
3+
- There should be a single "possible_record_type_mappings" element, specifying:
4+
- The mapping is one-way (reverse is false, forward is true).
5+
- There should be no custom fields in the mapping.
6+
- The following The Stock Field Mapping Fields should be mapped using The External Transformation Method:
7+
- field "full_name" should be mapped to "full_name".
8+
- field "username" should be mapped to "display_name".
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
[
2+
{
3+
"payload": {
4+
"connection_data": {
5+
"key": "key=<TRELLO_API_KEY>&token=<TRELLO_TOKEN>",
6+
"key_type": "",
7+
"org_id": "<TRELLO_ORGANIZATION_ID>",
8+
"org_name": "Trello Workspace"
9+
},
10+
"event_context": {
11+
"callback_url": "http://localhost:8002/callback",
12+
"dev_oid": "DEV-36shCCBEAA",
13+
"dev_org": "DEV-36shCCBEAA",
14+
"dev_org_id": "DEV-36shCCBEAA",
15+
"dev_uid": "DEVU-6",
16+
"dev_user": "DEVU-6",
17+
"dev_user_id": "DEVU-6",
18+
"event_type_adaas": "",
19+
"external_sync_unit": "688725dad59c015ce052eecf",
20+
"external_sync_unit_id": "688725dad59c015ce052eecf",
21+
"external_sync_unit_name": "cards-pagination-test-2025-07-28-092514",
22+
"external_system": "6752eb95c833e6b206fcf388",
23+
"external_system_id": "6752eb95c833e6b206fcf388",
24+
"external_system_name": "Trello",
25+
"external_system_type": "ADaaS",
26+
"import_slug": "trello-snapin-devrev",
27+
"initial_sync_scope": "full-history",
28+
"mode": "INITIAL",
29+
"request_id": "cc5e2ceb-4138-4acb-ab40-0b09460de9a8",
30+
"request_id_adaas": "cc5e2ceb-4138-4acb-ab40-0b09460de9a8",
31+
"run_id": "559c7b97-95f6-4685-9e9b-f656f843c54a",
32+
"sequence_version": "10",
33+
"snap_in_slug": "trello-snapin-devrev",
34+
"snap_in_version_id": "don:integration:dvrv-eu-1:devo/36shCCBEAA:snap_in_package/98ba5f27-a301-461f-88f4-2ea4d2e66c7f:snap_in_version/4bd4a849-5816-438a-a100-28f21ec6a4f0",
35+
"sync_run": "559c7b97-95f6-4685-9e9b-f656f843c54a",
36+
"sync_run_id": "559c7b97-95f6-4685-9e9b-f656f843c54a",
37+
"sync_tier": "sync_tier_2",
38+
"sync_unit": "don:integration:dvrv-eu-1:devo/36shCCBEAA:external_system_type/ADAAS:external_system/6752eb95c833e6b206fcf388:sync_unit/2283e9cd-b48c-4b51-8bdf-3674a8a0093b",
39+
"sync_unit_id": "2283e9cd-b48c-4b51-8bdf-3674a8a0093b",
40+
"uuid": "cc5e2ceb-4138-4acb-ab40-0b09460de9a8",
41+
"worker_data_url": "http://localhost:8003/external-worker"
42+
},
43+
"event_type": "EXTRACTION_DATA_CONTINUE"
44+
},
45+
"context": {
46+
"dev_oid": "don:identity:dvrv-eu-1:devo/36shCCBEAA",
47+
"automation_id": "",
48+
"source_id": "",
49+
"snap_in_id": "don:integration:dvrv-eu-1:devo/36shCCBEAA:snap_in/99f936cf-3ff9-430c-b784-20b32a58d311",
50+
"snap_in_version_id": "don:integration:dvrv-eu-1:devo/36shCCBEAA:snap_in_package/98ba5f27-a301-461f-88f4-2ea4d2e66c7f:snap_in_version/4bd4a849-5816-438a-a100-28f21ec6a4f0",
51+
"service_account_id": "don:identity:dvrv-eu-1:devo/36shCCBEAA:svcacc/74",
52+
"secrets": {
53+
"service_account_token": "test-service-account-token"
54+
},
55+
"user_id": "don:identity:dvrv-eu-1:devo/36shCCBEAA:devu/6",
56+
"event_id": "",
57+
"execution_id": "12152594289140703804"
58+
},
59+
"execution_metadata": {
60+
"request_id": "cc5e2ceb-4138-4acb-ab40-0b09460de9a8",
61+
"function_name": "extraction",
62+
"event_type": "EXTRACTION_DATA_CONTINUE",
63+
"devrev_endpoint": "http://localhost:8003"
64+
},
65+
"input_data": {
66+
"global_values": {},
67+
"event_sources": {},
68+
"keyrings": null,
69+
"resources": {
70+
"keyrings": {},
71+
"tags": {}
72+
}
73+
}
74+
}
75+
]

test_data/data_extraction_test.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
"dev_user": "DEVU-1",
1717
"dev_user_id": "DEVU-1",
1818
"event_type_adaas": "",
19-
"external_sync_unit": "6752eb962a64828e59a35396",
20-
"external_sync_unit_id": "6752eb962a64828e59a35396",
19+
"external_sync_unit": "688725dad59c015ce052eecf",
20+
"external_sync_unit_id": "688725dad59c015ce052eecf",
2121
"external_sync_unit_name": "SaaS connectors",
2222
"external_system": "6752eb95c833e6b206fcf388",
2323
"external_system_id": "6752eb95c833e6b206fcf388",
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"payload": {
3+
"connection_data": {
4+
"key": "key=<TRELLO_API_KEY>&token=<TRELLO_TOKEN>",
5+
"org_id": "<TRELLO_ORGANIZATION_ID>"
6+
},
7+
"event_context": {
8+
"callback_url": "http://localhost:8002/callback",
9+
"external_sync_unit_id": "6752eb95c833e6b206fcf388"
10+
}
11+
},
12+
"context": {
13+
"dev_oid": "test-org-id",
14+
"source_id": "test-source-id",
15+
"snap_in_id": "test-snap-in-id",
16+
"snap_in_version_id": "test-snap-in-version-id",
17+
"service_account_id": "test-service-account-id",
18+
"secrets": {
19+
"service_account_token": "test-token"
20+
}
21+
},
22+
"execution_metadata": {
23+
"request_id": "63c6f1c6-eabe-452f-a694-7f23a8f5c3cc",
24+
"function_name": "get_external_domain_metadata",
25+
"event_type": "test-event",
26+
"devrev_endpoint": "http://localhost:8003"
27+
},
28+
"input_data": {
29+
"global_values": {},
30+
"event_sources": {}
31+
}
32+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
[
2+
{
3+
"payload": {
4+
"connection_data": {
5+
"key": "key=<TRELLO_API_KEY>&token=<TRELLO_TOKEN>",
6+
"key_type": "",
7+
"org_id": "<TRELLO_ORGANIZATION_ID>",
8+
"org_name": "Trello Workspace"
9+
},
10+
"event_context": {
11+
"callback_url": "http://localhost:8002/callback",
12+
"dev_oid": "DEV-36shCCBEAA",
13+
"dev_org": "DEV-36shCCBEAA",
14+
"dev_org_id": "DEV-36shCCBEAA",
15+
"dev_uid": "DEVU-6",
16+
"dev_user": "DEVU-6",
17+
"dev_user_id": "DEVU-6",
18+
"event_type_adaas": "",
19+
"external_system": "6752eb95c833e6b206fcf388",
20+
"external_system_id": "6752eb95c833e6b206fcf388",
21+
"external_system_name": "Trello",
22+
"external_system_type": "ADaaS",
23+
"import_slug": "trello-snapin-devrev",
24+
"mode": "INITIAL",
25+
"request_id": "ca084b0e-971a-458d-9f87-b18d8820a380",
26+
"request_id_adaas": "ca084b0e-971a-458d-9f87-b18d8820a380",
27+
"run_id": "1d546af5-4c74-4a70-ae7d-d64370af7dfc",
28+
"sequence_version": "2",
29+
"snap_in_slug": "trello-snapin-devrev",
30+
"snap_in_version_id": "don:integration:dvrv-eu-1:devo/36shCCBEAA:snap_in_package/6968c88b-f972-4be2-9afa-3f4b9d70dc07:snap_in_version/7883da3e-0cb5-44d4-aa87-fe50b4d88337",
31+
"sync_run": "1d546af5-4c74-4a70-ae7d-d64370af7dfc",
32+
"sync_run_id": "1d546af5-4c74-4a70-ae7d-d64370af7dfc",
33+
"sync_tier": "",
34+
"uuid": "ca084b0e-971a-458d-9f87-b18d8820a380",
35+
"worker_data_url": "http://localhost:8003/external-worker"
36+
},
37+
"event_type": "EXTRACTION_EXTERNAL_SYNC_UNITS_START"
38+
},
39+
"context": {
40+
"dev_oid": "don:identity:dvrv-eu-1:devo/36shCCBEAA",
41+
"automation_id": "",
42+
"source_id": "",
43+
"snap_in_id": "don:integration:dvrv-eu-1:devo/36shCCBEAA:snap_in/18685abb-ca65-497e-bae1-91a638085bdf",
44+
"snap_in_version_id": "don:integration:dvrv-eu-1:devo/36shCCBEAA:snap_in_package/6968c88b-f972-4be2-9afa-3f4b9d70dc07:snap_in_version/7883da3e-0cb5-44d4-aa87-fe50b4d88337",
45+
"service_account_id": "don:identity:dvrv-eu-1:devo/36shCCBEAA:svcacc/76",
46+
"secrets": {
47+
"service_account_token": "test-service-account-token"
48+
},
49+
"user_id": "don:identity:dvrv-eu-1:devo/36shCCBEAA:devu/6",
50+
"event_id": "",
51+
"execution_id": "12440238152945803886"
52+
},
53+
"execution_metadata": {
54+
"request_id": "ca084b0e-971a-458d-9f87-b18d8820a380",
55+
"function_name": "extraction",
56+
"event_type": "EXTRACTION_EXTERNAL_SYNC_UNITS_START",
57+
"devrev_endpoint": "http://localhost:8003"
58+
},
59+
"input_data": {
60+
"global_values": {},
61+
"event_sources": {},
62+
"keyrings": null,
63+
"resources": {
64+
"keyrings": {},
65+
"tags": {}
66+
}
67+
}
68+
}
69+
]

0 commit comments

Comments
 (0)