Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions backend/directus-config/development/collections/flows.json
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,47 @@
"operation": "43de95f1-d63b-4231-80c3-b399c45470f6",
"_syncId": "d7e74f35-a19a-4a0b-9ae8-59af2fa0f081"
},
{
"name": "Reverse Geocoder: Trigger Populare Items",
"icon": "home_pin",
"color": null,
"description": "Set multiple items addresses at once",
"status": "active",
"trigger": "manual",
"accountability": "all",
"options": {
"collections": [
"items"
],
"requireConfirmation": true,
"async": true,
"location": "collection",
"confirmationDescription": "Be aware that you can run into request limits on the external reverse geocoder"
},
"operation": "c7317e38-c026-4dc0-8b73-42340e205c33",
"_syncId": "d8b14c06-fb08-4a27-8a4b-75e6a4cd7216"
},
{
"name": "Reverse Geocoder: On Create and Update",
"icon": "home_pin",
"color": null,
"description": "Requests the items address on update / create",
"status": "active",
"trigger": "event",
"accountability": "all",
"options": {
"type": "action",
"scope": [
"items.create",
"items.update"
],
"collections": [
"items"
]
},
"operation": "717fbd27-7c73-42a9-9408-532d5cd5248d",
"_syncId": "e28759ce-3995-4943-bbfc-f1ed08d42497"
},
{
"name": "Slug Generation",
"icon": "bolt",
Expand All @@ -288,5 +329,19 @@
},
"operation": "55857562-e0ab-49a5-a292-18f6c1cb075e",
"_syncId": "f2beb617-9c21-48b2-a8ec-c04197d1b7d1"
},
{
"name": "Reverse Geocoder: Single Item Address",
"icon": "home_pin",
"color": null,
"description": "Single item address request",
"status": "active",
"trigger": "operation",
"accountability": "all",
"options": {
"return": "$last"
},
"operation": "fa077e33-be44-48d4-b3a4-9f61c99c002c",
"_syncId": "fbf2ab06-eab8-4dc4-8e25-101f6a4edba6"
}
]
169 changes: 169 additions & 0 deletions backend/directus-config/development/collections/operations.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,28 @@
"flow": "a78d01a4-13b3-46a4-8938-9606bf26e329",
"_syncId": "b7241999-bfef-4086-bce1-b77d73323efb"
},
{
"name": "Condition",
"key": "condition_8xh1o",
"type": "condition",
"position_x": 19,
"position_y": 1,
"options": {
"filter": {
"$trigger": {
"payload": {
"position": {
"_nempty": true
}
}
}
}
},
"resolve": "0d18abcf-70f9-4545-b583-e18e5ec533fa",
"reject": null,
"flow": "e28759ce-3995-4943-bbfc-f1ed08d42497",
"_syncId": "717fbd27-7c73-42a9-9408-532d5cd5248d"
},
{
"name": "Condition",
"key": "condition_d2q1f",
Expand Down Expand Up @@ -227,6 +249,34 @@
"flow": "cc80ec73-ecf5-4789-bee5-1127fb1a6ed4",
"_syncId": "06716525-6d29-46e2-bb01-0764bccd74e9"
},
{
"name": "Run Script",
"key": "exec_bouoe",
"type": "exec",
"position_x": 37,
"position_y": 1,
"options": {
"code": "module.exports = async function(data) {\n\treturn data['$last'].map((item) => {\n \treturn {\n \"position\" : item.position,\n \"id\" : item.id,\n };\n });\n}"
},
"resolve": "fdca64f4-41e2-4940-a813-0f7698f1580b",
"reject": null,
"flow": "d8b14c06-fb08-4a27-8a4b-75e6a4cd7216",
"_syncId": "d3c50715-47c3-4763-832f-caf92d29331f"
},
{
"name": "Run Script",
"key": "exec_kuwlb",
"type": "exec",
"position_x": 37,
"position_y": 1,
"options": {
"code": "module.exports = function(data) {\nif (data.$last.data.features[0].properties.type === \"city\") {\n return {\n \"address\" : data.$last.data.features[0].properties.name || null\n }\n} else {\n return {\n \"address\": data.$last.data.features[0].properties.city ?? data.$last.data.features[0].properties.town ?? data.$last.data.features[0].properties.village\n }\n}\n}"
},
"resolve": "daa7b615-11f3-4cd9-8713-494fded63757",
"reject": null,
"flow": "fbf2ab06-eab8-4dc4-8e25-101f6a4edba6",
"_syncId": "dcf26e93-3b5c-44c3-b2fb-00c45d9a1fd6"
},
{
"name": "Run Script",
"key": "exec_p2t3z",
Expand Down Expand Up @@ -255,6 +305,36 @@
"flow": "7b978be2-605f-4061-b5b3-46f151b1b80a",
"_syncId": "67847550-3c95-4ee4-af02-32ebb69747d6"
},
{
"name": "Get Address String",
"key": "get_address_string",
"type": "request",
"position_x": 37,
"position_y": 1,
"options": {
"method": "GET",
"url": "https://photon.komoot.io/reverse?lat={{$trigger.payload.position.coordinates[1]}}&lon={{$trigger.payload.position.coordinates[0]}}&lang=de&limit=1"
},
"resolve": "7e6101d2-3d8c-49e2-894e-3121c9eff06b",
"reject": null,
"flow": "e28759ce-3995-4943-bbfc-f1ed08d42497",
"_syncId": "0d18abcf-70f9-4545-b583-e18e5ec533fa"
},
{
"name": "Get Address String",
"key": "get_address_string",
"type": "request",
"position_x": 19,
"position_y": 1,
"options": {
"method": "GET",
"url": "https://photon.komoot.io/reverse?lat={{$trigger.position.coordinates[1]}}&lon={{$trigger.position.coordinates[0]}}&lang=de&limit=1"
},
"resolve": "dcf26e93-3b5c-44c3-b2fb-00c45d9a1fd6",
"reject": null,
"flow": "fbf2ab06-eab8-4dc4-8e25-101f6a4edba6",
"_syncId": "fa077e33-be44-48d4-b3a4-9f61c99c002c"
},
{
"name": "get Creator",
"key": "get_creator",
Expand Down Expand Up @@ -733,6 +813,35 @@
"flow": "a78d01a4-13b3-46a4-8938-9606bf26e329",
"_syncId": "9838d2ca-3698-4d29-8429-038dfcaf7fab"
},
{
"name": "Read Data",
"key": "item_read_ceep3",
"type": "item-read",
"position_x": 19,
"position_y": 1,
"options": {
"permissions": "$trigger",
"emitEvents": false,
"collection": "items",
"query": {
"limit": -1,
"fields": [
"id",
"position"
],
"filter": {
"id": {
"_in": "{{$trigger.body.keys}}"
}
}
},
"key": []
},
"resolve": "d3c50715-47c3-4763-832f-caf92d29331f",
"reject": null,
"flow": "d8b14c06-fb08-4a27-8a4b-75e6a4cd7216",
"_syncId": "c7317e38-c026-4dc0-8b73-42340e205c33"
},
{
"name": "Read Data",
"key": "item_read_evgvk",
Expand Down Expand Up @@ -1054,6 +1163,28 @@
"flow": "7b978be2-605f-4061-b5b3-46f151b1b80a",
"_syncId": "017875a5-3736-478a-9bcc-ed473117c74d"
},
{
"name": "Update Data",
"key": "item_update_96g9y",
"type": "item-update",
"position_x": 56,
"position_y": 1,
"options": {
"permissions": "$trigger",
"emitEvents": false,
"collection": "items",
"payload": {
"address": "{{$last.address}}"
},
"key": [
"{{$trigger.id}}"
]
},
"resolve": null,
"reject": null,
"flow": "fbf2ab06-eab8-4dc4-8e25-101f6a4edba6",
"_syncId": "daa7b615-11f3-4cd9-8713-494fded63757"
},
{
"name": "Update Data",
"key": "item_update_chszs",
Expand Down Expand Up @@ -1125,6 +1256,28 @@
"flow": "cb772a2c-150c-4cca-bc2c-1f8498a5cd92",
"_syncId": "b22755ba-4ec5-4e04-a3fe-a390a9bc75ab"
},
{
"name": "Update Data",
"key": "item_update_h2lfe",
"type": "item-update",
"position_x": 55,
"position_y": 1,
"options": {
"permissions": "$full",
"emitEvents": false,
"collection": "items",
"key": [
"{{$trigger.payload.id}}"
],
"payload": {
"address": "{{$last.data.features[0].properties.city}}"
}
},
"resolve": null,
"reject": null,
"flow": "e28759ce-3995-4943-bbfc-f1ed08d42497",
"_syncId": "7e6101d2-3d8c-49e2-894e-3121c9eff06b"
},
{
"name": "Update Nomads Home",
"key": "item_update_o6cn8",
Expand Down Expand Up @@ -1599,6 +1752,22 @@
"flow": "9a1d1084-438f-471e-aac5-47e0749375e7",
"_syncId": "95d762f9-4695-4168-aa65-5bd065b40742"
},
{
"name": "Trigger Flow",
"key": "trigger_uromw",
"type": "trigger",
"position_x": 55,
"position_y": 1,
"options": {
"iterationMode": "parallel",
"flow": "fbf2ab06-eab8-4dc4-8e25-101f6a4edba6",
"payload": "{{ $last }}"
},
"resolve": null,
"reject": null,
"flow": "d8b14c06-fb08-4a27-8a4b-75e6a4cd7216",
"_syncId": "fdca64f4-41e2-4940-a813-0f7698f1580b"
},
{
"name": "Updated?",
"key": "updated",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"collection": "items",
"field": "address",
"type": "string",
"meta": {
"collection": "items",
"conditions": null,
"display": null,
"display_options": null,
"field": "address",
"group": null,
"hidden": false,
"interface": "input",
"note": null,
"options": null,
"readonly": false,
"required": false,
"sort": 34,
"special": null,
"translations": null,
"validation": null,
"validation_message": null,
"width": "full"
},
"schema": {
"name": "address",
"table": "items",
"data_type": "character varying",
"default_value": null,
"max_length": 255,
"numeric_precision": null,
"numeric_scale": null,
"is_nullable": true,
"is_unique": false,
"is_indexed": false,
"is_primary_key": false,
"is_generated": false,
"generation_expression": null,
"has_auto_increment": false,
"foreign_key_table": null,
"foreign_key_column": null
}
}
Loading