From 5d3f918b600cfbb525f70a72a0ac616615d9d699 Mon Sep 17 00:00:00 2001 From: gh-actions Date: Thu, 13 Feb 2025 13:47:20 +0000 Subject: [PATCH] Deploy website - based on 557f81b81ad2699fc39115d3a07314c331def934 --- 404.html | 4 ++-- adaptors.html | 4 ++-- adaptors/asana.html | 4 ++-- adaptors/cht.html | 4 ++-- adaptors/ckan.html | 4 ++-- adaptors/collections.html | 4 ++-- adaptors/commcare.html | 4 ++-- adaptors/common.html | 4 ++-- adaptors/dhis2.html | 4 ++-- adaptors/fhir-fr.html | 4 ++-- adaptors/fhir-ndr-et.html | 4 ++-- adaptors/fhir.html | 4 ++-- adaptors/godata.html | 4 ++-- adaptors/googlesheets.html | 4 ++-- adaptors/http.html | 4 ++-- adaptors/kobotoolbox.html | 6 +++--- adaptors/library.html | 4 ++-- .../jobs/auto/0-Get-TEI-data-2021-06-02.html | 4 ++-- .../01-send-mailgun-email-2018-12-04.html | 4 ++-- .../01a-Create-Registrants-2019-11-19.html | 4 ++-- ...1b-Query-new-person-record-2019-12-13.html | 4 ++-- ...ate-person_position-record-2019-12-13.html | 4 ++-- ...Query-DB-for-people-to-pay-2019-12-11.html | 4 ++-- .../02b-Initiate-Payments-2019-11-19.html | 4 ++-- .../03-Update-Payment-Status-2019-11-19.html | 4 ++-- .../04a-Query-for-job-changes-2019-12-12.html | 4 ++-- .../auto/04b-Update-ODK-form-2019-12-03.html | 4 ++-- ...Submit-employee-evaluation-2019-12-03.html | 4 ++-- ...5a-Query-for-new-employees-2019-12-19.html | 4 ++-- .../05b-Update-ODK-eval-form-2019-12-19.html | 4 ++-- .../1-Create-Payment-in-SF-2018-09-03.html | 4 ++-- ...ommCare-Forms-Bulk-Extract-2021-04-08.html | 4 ++-- .../1-Get-data-from-SLUHIS-2023-03-08.html | 4 ++-- ...Balance-Update-to-Customer-2018-12-14.html | 4 ++-- .../Add-DHIS2-Data-Value-Sets-2016-03-28.html | 4 ++-- .../jobs/auto/Asana-test-2024-07-29.html | 4 ++-- .../Attendance-Non-Skillz-2021-06-14.html | 4 ++-- .../auto/CHW-case-to-DHIS2-2023-04-27.html | 4 ++-- ...atch-Error-in-HTTP-Request-2016-08-26.html | 4 ++-- .../Coach-Session-Register-2021-05-03.html | 4 ++-- adaptors/library/jobs/auto/CommCare-FHIR.html | 4 ++-- .../CommCare-to-Azure-Sql-2020-01-27.html | 4 ++-- .../auto/Create-Intervention-2021-04-08.html | 4 ++-- .../Create-Patient-in-OpenMRS-2019-10-24.html | 4 ++-- .../Create-Person-in-OpenMRS-2016-02-12.html | 4 ++-- .../auto/Create-Person-in-SF-2019-02-25.html | 4 ++-- .../Create-SMS-Linked-to-Contact-in-SF.html | 4 ++-- .../auto/Create-TEI-dhis2-2021-03-22.html | 4 ++-- .../jobs/auto/Create-contact-2021-03-01.html | 4 ++-- .../jobs/auto/DHIS2-DataValues-API.html | 4 ++-- .../jobs/auto/DHIS2-Events-2016-01-27.html | 4 ++-- .../library/jobs/auto/DHIS2-Events-API.html | 4 ++-- .../auto/Extract-Vitas-Data-2021-05-11.html | 4 ++-- ...ailed-Payment-Notification-2021-04-23.html | 4 ++-- .../jobs/auto/Fetch-Claims-2023-07-17.html | 4 ++-- ...ommCare-Forms-Bulk-Extract-2022-05-16.html | 4 ++-- .../Get-cases-from-Primero-2021-09-23.html | 4 ++-- ...HIV-Testing-Event-Snapshot-2021-05-03.html | 4 ++-- ...V-Testing-Event-Statistics-2021-05-03.html | 4 ++-- .../jobs/auto/Kobo-to-sheets-2023-10-13.html | 4 ++-- .../jobs/auto/Load-to-DB-2022-05-16.html | 4 ++-- .../jobs/auto/Load-to-DHIS2-2023-07-17.html | 4 ++-- ...ria-Testing-Event-Snapshot-2021-05-03.html | 4 ++-- ...a-Testing-Event-Statistics-2021-05-03.html | 4 ++-- ...ds-Moving-In-And-Out-Of-Repeat-Blocks.html | 4 ++-- .../jobs/auto/Outcome-Survey-2024-07-16.html | 4 ++-- .../library/jobs/auto/PHQ9-2021-05-03.html | 4 ++-- .../library/jobs/auto/Pay-CHW-2021-04-23.html | 4 ++-- ...istribution-Referral-in-SF-2020-06-19.html | 4 ++-- ...Update-HH-Name-in-CommCare-2021-09-27.html | 4 ++-- ...hold-Household-Visit-in-SF-2022-06-28.html | 4 ++-- .../Q3-2022-Upsert-Person-2022-04-21.html | 4 ++-- ...3-2022-Upsert-Person-Visit-2022-06-28.html | 4 ++-- ...-Supervision-Accompaniment-2022-08-22.html | 4 ++-- ...psert-Supervision-Feedback-2022-08-19.html | 4 ++-- ...ision-Household-Spot-Check-2022-08-24.html | 4 ++-- ...ster-Participant-V2-Skillz-2021-06-02.html | 4 ++-- .../auto/Register-Patient-2021-03-02.html | 4 ++-- .../auto/Request-Vitas-Sync-2021-05-11.html | 4 ++-- ...d-Vulnerability-Assessment-2021-05-27.html | 4 ++-- ...erence-Self-Reporting-Tool-2021-04-30.html | 4 ++-- ...ggregate-Service-Referrals-2021-04-30.html | 4 ++-- ...ttendance-Skillz-Plus-Club-2021-05-24.html | 4 ++-- ...rt-Coach-Support-Visit-CSV-2021-04-28.html | 4 ++-- ...-Confirm-Services-Received-2021-06-14.html | 4 ++-- ...Upsert-Home-Visit-Log-Form-2021-05-03.html | 4 ++-- .../Upsert-Intervention-Notes-2021-04-28.html | 4 ++-- .../Upsert-Post-Challenges-2021-04-30.html | 4 ++-- .../Upsert-Pre-Challenges-2021-04-30.html | 4 ++-- .../Upsert-Register-Event-2021-04-30.html | 4 ++-- ...psert-Register-Participant-2021-04-28.html | 6 +++--- ...egister-Participant-Skillz-2021-08-30.html | 4 ++-- ...-Register-Skills-plus-Club-2021-04-30.html | 4 ++-- ...ssessment-Service-Referral-2021-05-25.html | 4 ++-- .../Upsert-Service-Referral-2-2021-06-14.html | 4 ++-- .../Upsert-Service-Referral-2021-04-30.html | 4 ++-- ...-Service-Referral-Followup-2021-04-30.html | 4 ++-- .../Upsert-Team-or-Group-Name-2021-04-28.html | 4 ++-- .../Upsert-User-in-Salesforce-2021-04-16.html | 4 ++-- .../auto/Upsert-to-mBrana-2021-05-11.html | 4 ++-- .../WF1-1-Bulk-get-HH-cases-2023-05-19.html | 4 ++-- ...k-upsert-HHs-and-HH-Visits-2023-05-19.html | 4 ++-- ...F2-1-Bulk-get-Person-cases-2023-05-19.html | 4 ++-- .../WF2-2-Bulk-upsert-Persons-2023-05-19.html | 4 ++-- ...ulk-get-Person-Visit-cases-2023-05-19.html | 4 ++-- ...-Bulk-upsert-Person-Visits-2023-05-19.html | 4 ++-- ...epeat-Failed-Person-Visits-2023-05-31.html | 4 ++-- ...-1-Bulk-get-Referral-Cases-2023-05-19.html | 4 ++-- ...WF4-2-Bulk-upsert-Services-2023-05-19.html | 4 ++-- .../jobs/auto/aleksa-cron-2022-04-29.html | 4 ++-- .../auto/alter-state-before-operations.html | 4 ++-- .../jobs/auto/async-and-array-dot-map.html | 4 ++-- .../library/jobs/auto/async-findValue.html | 4 ++-- ...ate-parent-and-children-in-salesforce.html | 4 ++-- .../jobs/auto/commcare-asri-bulk-upload.html | 4 ++-- .../auto/commcare-reports-api-2016-08-29.html | 4 ++-- .../auto/complex-http-request-chains.html | 4 ++-- .../jobs/auto/complex-state-control.html | 4 ++-- .../concatenate-many-fields-with-nulls.html | 4 ++-- .../library/jobs/auto/create-if-proposal.html | 4 ++-- adaptors/library/jobs/auto/getKoboData.html | 4 ++-- .../auto/google-oauth-test-2024-12-20.html | 4 ++-- .../jobs/auto/no-return-2023-01-06.html | 4 ++-- .../auto/promise-all-nested-requests.html | 4 ++-- .../jobs/auto/send-mail-in-mailgun.html | 4 ++-- .../send-sms-from-salesforce-workflow.html | 4 ++-- .../jobs/auto/synchronous-http-request.html | 4 ++-- adaptors/library/jobs/auto/timeout.html | 4 ++-- ...ems-in-array-with-value-outside-array.html | 4 ++-- adaptors/library/triggers/xmlns.html | 4 ++-- adaptors/magpi.html | 4 ++-- adaptors/mailchimp.html | 4 ++-- adaptors/mojatax.html | 4 ++-- adaptors/mongodb.html | 4 ++-- adaptors/moodle.html | 4 ++-- adaptors/msgraph.html | 4 ++-- adaptors/mssql.html | 4 ++-- adaptors/mysql.html | 4 ++-- adaptors/ocl.html | 4 ++-- adaptors/odk.html | 4 ++-- adaptors/ona.html | 4 ++-- adaptors/openmrs.html | 4 ++-- adaptors/packages/asana-changelog.html | 4 ++-- .../packages/asana-configuration-schema.html | 4 ++-- adaptors/packages/asana-docs.html | 4 ++-- adaptors/packages/asana-readme.html | 4 ++-- .../packages/azure-storage-changelog.html | 4 ++-- .../azure-storage-configuration-schema.html | 4 ++-- adaptors/packages/azure-storage-docs.html | 4 ++-- adaptors/packages/azure-storage-readme.html | 4 ++-- adaptors/packages/beyonic-changelog.html | 4 ++-- .../beyonic-configuration-schema.html | 4 ++-- adaptors/packages/beyonic-docs.html | 4 ++-- adaptors/packages/beyonic-readme.html | 4 ++-- adaptors/packages/bigquery-changelog.html | 4 ++-- .../bigquery-configuration-schema.html | 4 ++-- adaptors/packages/bigquery-docs.html | 4 ++-- adaptors/packages/bigquery-readme.html | 4 ++-- adaptors/packages/cartodb-changelog.html | 4 ++-- .../cartodb-configuration-schema.html | 4 ++-- adaptors/packages/cartodb-docs.html | 4 ++-- adaptors/packages/cartodb-readme.html | 4 ++-- adaptors/packages/cht-changelog.html | 4 ++-- .../packages/cht-configuration-schema.html | 4 ++-- adaptors/packages/cht-docs.html | 4 ++-- adaptors/packages/cht-readme.html | 4 ++-- adaptors/packages/collections-changelog.html | 4 ++-- .../collections-configuration-schema.html | 4 ++-- adaptors/packages/collections-docs.html | 4 ++-- adaptors/packages/collections-readme.html | 4 ++-- adaptors/packages/commcare-changelog.html | 4 ++-- .../commcare-configuration-schema.html | 4 ++-- adaptors/packages/commcare-docs.html | 4 ++-- adaptors/packages/commcare-readme.html | 4 ++-- adaptors/packages/common-changelog.html | 4 ++-- .../packages/common-configuration-schema.html | 4 ++-- adaptors/packages/common-docs.html | 4 ++-- adaptors/packages/common-readme.html | 4 ++-- adaptors/packages/dhis2-changelog.html | 4 ++-- .../packages/dhis2-configuration-schema.html | 4 ++-- adaptors/packages/dhis2-docs.html | 4 ++-- adaptors/packages/dhis2-readme.html | 4 ++-- adaptors/packages/dynamics-changelog.html | 4 ++-- .../dynamics-configuration-schema.html | 4 ++-- adaptors/packages/dynamics-docs.html | 4 ++-- adaptors/packages/dynamics-readme.html | 4 ++-- adaptors/packages/facebook-changelog.html | 4 ++-- .../facebook-configuration-schema.html | 4 ++-- adaptors/packages/facebook-docs.html | 4 ++-- adaptors/packages/facebook-readme.html | 4 ++-- adaptors/packages/fhir-changelog.html | 4 ++-- .../packages/fhir-configuration-schema.html | 4 ++-- adaptors/packages/fhir-docs.html | 4 ++-- adaptors/packages/fhir-fr-changelog.html | 4 ++-- .../fhir-fr-configuration-schema.html | 4 ++-- adaptors/packages/fhir-fr-docs.html | 4 ++-- adaptors/packages/fhir-fr-readme.html | 4 ++-- adaptors/packages/fhir-ndr-et-changelog.html | 4 ++-- .../fhir-ndr-et-configuration-schema.html | 4 ++-- adaptors/packages/fhir-ndr-et-docs.html | 4 ++-- adaptors/packages/fhir-ndr-et-readme.html | 4 ++-- adaptors/packages/fhir-readme.html | 4 ++-- adaptors/packages/ghana-bdr-changelog.html | 4 ++-- .../ghana-bdr-configuration-schema.html | 4 ++-- adaptors/packages/ghana-bdr-docs.html | 4 ++-- adaptors/packages/ghana-bdr-readme.html | 4 ++-- adaptors/packages/ghana-nia-changelog.html | 4 ++-- .../ghana-nia-configuration-schema.html | 4 ++-- adaptors/packages/ghana-nia-docs.html | 4 ++-- adaptors/packages/ghana-nia-readme.html | 4 ++-- adaptors/packages/gmail-changelog.html | 4 ++-- .../packages/gmail-configuration-schema.html | 4 ++-- adaptors/packages/gmail-docs.html | 4 ++-- adaptors/packages/gmail-readme.html | 4 ++-- adaptors/packages/godata-changelog.html | 4 ++-- .../packages/godata-configuration-schema.html | 4 ++-- adaptors/packages/godata-docs.html | 4 ++-- adaptors/packages/godata-readme.html | 4 ++-- .../packages/googlehealthcare-changelog.html | 4 ++-- ...googlehealthcare-configuration-schema.html | 4 ++-- adaptors/packages/googlehealthcare-docs.html | 4 ++-- .../packages/googlehealthcare-readme.html | 4 ++-- adaptors/packages/googlesheets-changelog.html | 4 ++-- .../googlesheets-configuration-schema.html | 4 ++-- adaptors/packages/googlesheets-docs.html | 4 ++-- adaptors/packages/googlesheets-readme.html | 4 ++-- adaptors/packages/hive-changelog.html | 4 ++-- .../packages/hive-configuration-schema.html | 4 ++-- adaptors/packages/hive-docs.html | 4 ++-- adaptors/packages/hive-readme.html | 4 ++-- adaptors/packages/http-changelog.html | 4 ++-- .../packages/http-configuration-schema.html | 4 ++-- adaptors/packages/http-docs.html | 4 ++-- adaptors/packages/http-readme.html | 4 ++-- adaptors/packages/hubtel-changelog.html | 4 ++-- .../packages/hubtel-configuration-schema.html | 4 ++-- adaptors/packages/hubtel-docs.html | 4 ++-- adaptors/packages/hubtel-readme.html | 4 ++-- adaptors/packages/intuit-changelog.html | 4 ++-- .../packages/intuit-configuration-schema.html | 4 ++-- adaptors/packages/intuit-docs.html | 4 ++-- adaptors/packages/intuit-readme.html | 4 ++-- adaptors/packages/khanacademy-changelog.html | 4 ++-- .../khanacademy-configuration-schema.html | 4 ++-- adaptors/packages/khanacademy-docs.html | 4 ++-- adaptors/packages/khanacademy-readme.html | 4 ++-- adaptors/packages/kobotoolbox-changelog.html | 19 ++++++++++++------- .../kobotoolbox-configuration-schema.html | 8 ++++---- adaptors/packages/kobotoolbox-docs.html | 8 ++++---- adaptors/packages/kobotoolbox-readme.html | 4 ++-- adaptors/packages/magpi-changelog.html | 4 ++-- .../packages/magpi-configuration-schema.html | 4 ++-- adaptors/packages/magpi-docs.html | 4 ++-- adaptors/packages/magpi-readme.html | 4 ++-- adaptors/packages/mailchimp-changelog.html | 4 ++-- .../mailchimp-configuration-schema.html | 4 ++-- adaptors/packages/mailchimp-docs.html | 4 ++-- adaptors/packages/mailchimp-readme.html | 4 ++-- adaptors/packages/mailgun-changelog.html | 4 ++-- .../mailgun-configuration-schema.html | 4 ++-- adaptors/packages/mailgun-docs.html | 4 ++-- adaptors/packages/mailgun-readme.html | 4 ++-- adaptors/packages/maximo-changelog.html | 4 ++-- .../packages/maximo-configuration-schema.html | 4 ++-- adaptors/packages/maximo-docs.html | 4 ++-- adaptors/packages/maximo-readme.html | 4 ++-- adaptors/packages/medicmobile-changelog.html | 4 ++-- .../medicmobile-configuration-schema.html | 4 ++-- adaptors/packages/medicmobile-docs.html | 4 ++-- adaptors/packages/medicmobile-readme.html | 4 ++-- adaptors/packages/mogli-changelog.html | 4 ++-- .../packages/mogli-configuration-schema.html | 4 ++-- adaptors/packages/mogli-docs.html | 4 ++-- adaptors/packages/mogli-readme.html | 4 ++-- adaptors/packages/mojatax-changelog.html | 4 ++-- .../mojatax-configuration-schema.html | 4 ++-- adaptors/packages/mojatax-docs.html | 4 ++-- adaptors/packages/mojatax-readme.html | 4 ++-- adaptors/packages/mongodb-changelog.html | 4 ++-- .../mongodb-configuration-schema.html | 4 ++-- adaptors/packages/mongodb-docs.html | 4 ++-- adaptors/packages/mongodb-readme.html | 4 ++-- adaptors/packages/msgraph-changelog.html | 4 ++-- .../msgraph-configuration-schema.html | 4 ++-- adaptors/packages/msgraph-docs.html | 4 ++-- adaptors/packages/msgraph-readme.html | 4 ++-- adaptors/packages/mssql-changelog.html | 4 ++-- .../packages/mssql-configuration-schema.html | 4 ++-- adaptors/packages/mssql-docs.html | 4 ++-- adaptors/packages/mssql-readme.html | 4 ++-- adaptors/packages/mysql-changelog.html | 4 ++-- .../packages/mysql-configuration-schema.html | 4 ++-- adaptors/packages/mysql-docs.html | 4 ++-- adaptors/packages/mysql-readme.html | 4 ++-- adaptors/packages/nexmo-changelog.html | 4 ++-- .../packages/nexmo-configuration-schema.html | 4 ++-- adaptors/packages/nexmo-docs.html | 4 ++-- adaptors/packages/nexmo-readme.html | 4 ++-- adaptors/packages/ocl-changelog.html | 4 ++-- .../packages/ocl-configuration-schema.html | 4 ++-- adaptors/packages/ocl-docs.html | 4 ++-- adaptors/packages/ocl-readme.html | 4 ++-- adaptors/packages/odk-changelog.html | 4 ++-- .../packages/odk-configuration-schema.html | 4 ++-- adaptors/packages/odk-docs.html | 4 ++-- adaptors/packages/odk-readme.html | 4 ++-- adaptors/packages/openfn-changelog.html | 4 ++-- .../packages/openfn-configuration-schema.html | 4 ++-- adaptors/packages/openfn-docs.html | 4 ++-- adaptors/packages/openfn-readme.html | 4 ++-- adaptors/packages/openhim-changelog.html | 4 ++-- .../openhim-configuration-schema.html | 4 ++-- adaptors/packages/openhim-docs.html | 4 ++-- adaptors/packages/openhim-readme.html | 4 ++-- adaptors/packages/openimis-changelog.html | 4 ++-- .../openimis-configuration-schema.html | 4 ++-- adaptors/packages/openimis-docs.html | 4 ++-- adaptors/packages/openimis-readme.html | 4 ++-- adaptors/packages/openlmis-changelog.html | 4 ++-- .../openlmis-configuration-schema.html | 4 ++-- adaptors/packages/openlmis-docs.html | 4 ++-- adaptors/packages/openlmis-readme.html | 4 ++-- adaptors/packages/openmrs-changelog.html | 4 ++-- .../openmrs-configuration-schema.html | 4 ++-- adaptors/packages/openmrs-docs.html | 4 ++-- adaptors/packages/openmrs-readme.html | 4 ++-- adaptors/packages/openspp-changelog.html | 4 ++-- .../openspp-configuration-schema.html | 4 ++-- adaptors/packages/openspp-docs.html | 4 ++-- adaptors/packages/openspp-readme.html | 4 ++-- adaptors/packages/postgresql-changelog.html | 4 ++-- .../postgresql-configuration-schema.html | 4 ++-- adaptors/packages/postgresql-docs.html | 4 ++-- adaptors/packages/postgresql-readme.html | 4 ++-- adaptors/packages/primero-changelog.html | 4 ++-- .../primero-configuration-schema.html | 4 ++-- adaptors/packages/primero-docs.html | 4 ++-- adaptors/packages/primero-readme.html | 4 ++-- adaptors/packages/progres-changelog.html | 4 ++-- .../progres-configuration-schema.html | 4 ++-- adaptors/packages/progres-docs.html | 4 ++-- adaptors/packages/progres-readme.html | 4 ++-- adaptors/packages/rapidpro-changelog.html | 4 ++-- .../rapidpro-configuration-schema.html | 4 ++-- adaptors/packages/rapidpro-docs.html | 4 ++-- adaptors/packages/rapidpro-readme.html | 4 ++-- adaptors/packages/redis-changelog.html | 4 ++-- .../packages/redis-configuration-schema.html | 4 ++-- adaptors/packages/redis-docs.html | 4 ++-- adaptors/packages/redis-readme.html | 4 ++-- adaptors/packages/resourcemap-changelog.html | 4 ++-- .../resourcemap-configuration-schema.html | 4 ++-- adaptors/packages/resourcemap-docs.html | 4 ++-- adaptors/packages/resourcemap-readme.html | 4 ++-- adaptors/packages/salesforce-changelog.html | 4 ++-- .../salesforce-configuration-schema.html | 4 ++-- adaptors/packages/salesforce-docs.html | 4 ++-- adaptors/packages/salesforce-readme.html | 4 ++-- adaptors/packages/satusehat-changelog.html | 4 ++-- .../satusehat-configuration-schema.html | 4 ++-- adaptors/packages/satusehat-docs.html | 4 ++-- adaptors/packages/satusehat-readme.html | 4 ++-- adaptors/packages/sftp-changelog.html | 4 ++-- .../packages/sftp-configuration-schema.html | 4 ++-- adaptors/packages/sftp-docs.html | 4 ++-- adaptors/packages/sftp-readme.html | 4 ++-- adaptors/packages/surveycto-changelog.html | 4 ++-- .../surveycto-configuration-schema.html | 4 ++-- adaptors/packages/surveycto-docs.html | 4 ++-- adaptors/packages/surveycto-readme.html | 4 ++-- adaptors/packages/telerivet-changelog.html | 4 ++-- .../telerivet-configuration-schema.html | 4 ++-- adaptors/packages/telerivet-docs.html | 4 ++-- adaptors/packages/telerivet-readme.html | 4 ++-- adaptors/packages/testing-changelog.html | 4 ++-- .../testing-configuration-schema.html | 4 ++-- adaptors/packages/testing-docs.html | 4 ++-- adaptors/packages/testing-readme.html | 4 ++-- adaptors/packages/twilio-changelog.html | 4 ++-- .../packages/twilio-configuration-schema.html | 4 ++-- adaptors/packages/twilio-docs.html | 6 +++--- adaptors/packages/twilio-readme.html | 4 ++-- adaptors/packages/vtiger-changelog.html | 4 ++-- .../packages/vtiger-configuration-schema.html | 4 ++-- adaptors/packages/vtiger-docs.html | 4 ++-- adaptors/packages/vtiger-readme.html | 4 ++-- adaptors/packages/wigal-sms-changelog.html | 4 ++-- .../wigal-sms-configuration-schema.html | 4 ++-- adaptors/packages/wigal-sms-docs.html | 4 ++-- adaptors/packages/wigal-sms-readme.html | 4 ++-- adaptors/packages/zoho-changelog.html | 4 ++-- .../packages/zoho-configuration-schema.html | 4 ++-- adaptors/packages/zoho-docs.html | 4 ++-- adaptors/packages/zoho-readme.html | 4 ++-- adaptors/postgresql.html | 4 ++-- adaptors/powerbi.html | 4 ++-- adaptors/primero.html | 4 ++-- adaptors/rapidpro.html | 4 ++-- adaptors/salesforce.html | 4 ++-- adaptors/satusehat.html | 4 ++-- adaptors/sftp.html | 4 ++-- adaptors/surveycto.html | 4 ++-- adaptors/tableau.html | 4 ++-- articles.html | 4 ++-- .../06/16/how-information-is-organized.html | 4 ++-- .../2020/06/24/three-questions-to-ask.html | 4 ++-- .../2020/07/02/allow-yourself-to-fail.html | 4 ++-- .../07/14/cron-is-better-than-a-timer.html | 4 ++-- articles/2020/12/09/upsert-in-dhis2.html | 4 ++-- .../02/03/hosted-or-local-deployment.html | 4 ++-- articles/2021/02/17/syncing-options.html | 4 ++-- articles/2021/05/24/commcare-events.html | 4 ++-- .../07/05/wrapping-my-head-around-jobs.html | 4 ++-- ...multistage-docker-builds-using-buildx.html | 4 ++-- .../2021/10/15/webpack-to-esbuild-part1.html | 4 ++-- .../22/testing-react-app-with-jest-hound.html | 4 ++-- ...ript-helped-me-better-understand-jobs.html | 4 ++-- articles/2022/06/07/workflow-automation.html | 4 ++-- articles/2022/09/19/auth-security.html | 4 ++-- articles/archive.html | 4 ++-- articles/page/2.html | 4 ++-- articles/tags.html | 4 ++-- articles/tags/annoucement.html | 4 ++-- articles/tags/authentication.html | 4 ++-- articles/tags/authorization.html | 4 ++-- articles/tags/automation.html | 4 ++-- articles/tags/browser-testing.html | 4 ++-- articles/tags/build.html | 4 ++-- articles/tags/ci-cd.html | 4 ++-- articles/tags/docker.html | 4 ++-- articles/tags/elixir.html | 4 ++-- articles/tags/how-to.html | 4 ++-- articles/tags/javascript.html | 4 ++-- articles/tags/jobs.html | 4 ++-- articles/tags/js.html | 4 ++-- articles/tags/learning.html | 4 ++-- articles/tags/phoenix.html | 4 ++-- articles/tags/react.html | 4 ++-- articles/tags/security.html | 4 ++-- articles/tags/solution.html | 4 ++-- articles/tags/testing.html | 4 ++-- articles/tags/tips.html | 4 ++-- articles/tags/tips/page/2.html | 4 ++-- articles/tags/webpack.html | 4 ++-- ...4ef00.6430cd01.js => 4224ef00.f1e27166.js} | 2 +- assets/js/4aaa0f44.5936c877.js | 1 + assets/js/4aaa0f44.71c1f881.js | 1 - assets/js/5f87d652.0818bc2b.js | 1 + assets/js/5f87d652.a6804168.js | 1 - ...00565.54c248d2.js => 60a00565.cef97319.js} | 2 +- assets/js/60f1bcf9.2f872ef7.js | 1 + assets/js/60f1bcf9.479ee02a.js | 1 - ...28a98.f23efe47.js => cb128a98.bd1bfccf.js} | 2 +- ...26739.7e516213.js => cc826739.cd753fb9.js} | 2 +- ...n.20cc3d5a.js => runtime~main.21fc3b25.js} | 2 +- documentation.html | 4 ++-- documentation/api-tokens.html | 4 ++-- .../build-compliant-apps.html | 4 ++-- documentation/build-with-api.html | 4 ++-- documentation/build/ai-assistant.html | 4 ++-- documentation/build/collections.html | 4 ++-- documentation/build/credentials.html | 4 ++-- documentation/build/editing-locally.html | 4 ++-- documentation/build/limits.html | 4 ++-- documentation/build/paths.html | 4 ++-- documentation/build/steps.html | 4 ++-- .../build/steps/step-design-intro.html | 4 ++-- documentation/build/steps/step-editor.html | 4 ++-- documentation/build/triggers.html | 4 ++-- documentation/build/troubleshooting.html | 4 ++-- documentation/build/workflows-api.html | 4 ++-- documentation/build/workflows.html | 4 ++-- .../build/working-with-branches.html | 4 ++-- documentation/cli-challenges.html | 4 ++-- documentation/cli-usage.html | 4 ++-- documentation/cli-walkthrough.html | 4 ++-- documentation/cli.html | 4 ++-- documentation/collaboration.html | 4 ++-- documentation/collections-cli.html | 4 ++-- documentation/contribute/openfn-roadmap.html | 4 ++-- documentation/contribute/writing-code.html | 4 ++-- documentation/contribute/writing-docs.html | 4 ++-- documentation/converting-triggers.html | 4 ++-- documentation/deploy/options.html | 4 ++-- .../deploy/portability-versions.html | 4 ++-- documentation/deploy/portability.html | 4 ++-- documentation/deploy/requirements.html | 4 ++-- documentation/design/api-discovery.html | 4 ++-- documentation/design/design-overview.html | 4 ++-- documentation/design/design-workflow.html | 4 ++-- documentation/design/discovery.html | 4 ++-- documentation/design/mapping-specs.html | 4 ++-- documentation/design/overview.html | 4 ++-- documentation/design/workflow-specs.html | 4 ++-- documentation/get-help/support.html | 4 ++-- documentation/get-started/glossary.html | 4 ++-- .../get-started/implementation-checklist.html | 4 ++-- .../get-started/security-compliance.html | 4 ++-- documentation/get-started/security.html | 4 ++-- documentation/get-started/standards.html | 4 ++-- documentation/get-started/terminology.html | 4 ++-- documentation/get-started/try-out.html | 4 ++-- documentation/hosted/overview.html | 4 ++-- documentation/jobs/javascript.html | 4 ++-- documentation/jobs/job-examples.html | 4 ++-- documentation/jobs/job-snippets.html | 4 ++-- documentation/jobs/job-writing-guide.html | 4 ++-- documentation/jobs/state.html | 4 ++-- documentation/keyboard-shortcuts.html | 4 ++-- documentation/kobo-to-dhis2.html | 4 ++-- documentation/legacy.html | 4 ++-- documentation/legacy/about-lightning.html | 4 ++-- documentation/legacy/about.html | 4 ++-- documentation/legacy/build/credentials.html | 4 ++-- documentation/legacy/build/example-build.html | 4 ++-- documentation/legacy/build/inbox.html | 4 ++-- documentation/legacy/build/jobs.html | 4 ++-- .../legacy/build/lightning-quick-start.html | 4 ++-- documentation/legacy/build/triggers.html | 4 ++-- .../legacy/build/troubleshooting.html | 4 ++-- documentation/legacy/cli.html | 4 ++-- documentation/legacy/core.html | 4 ++-- documentation/legacy/deploy/options.html | 4 ++-- documentation/legacy/deploy/requirements.html | 4 ++-- .../legacy/design/design-quickstart.html | 4 ++-- .../legacy/design/when-to-integrate.html | 4 ++-- documentation/legacy/devtools/home.html | 4 ++-- documentation/legacy/faqs.html | 4 ++-- documentation/legacy/for-devs.html | 4 ++-- .../commcare-project-walkthrough.html | 4 ++-- .../legacy/getting-started/glossary.html | 4 ++-- .../implementation-checklist.html | 4 ++-- .../integrating-using-openfn.html | 4 ++-- .../getting-started/integration-toolkit.html | 4 ++-- .../legacy/getting-started/security.html | 4 ++-- .../so-you-want-to-integrate.html | 8 ++++---- .../legacy/getting-started/terminology.html | 4 ++-- documentation/legacy/gsoc.html | 4 ++-- documentation/legacy/instant-openhie.html | 4 ++-- documentation/legacy/jobs/each.html | 4 ++-- .../legacy/jobs/editing_locally.html | 4 ++-- documentation/legacy/jobs/errors.html | 4 ++-- .../legacy/jobs/job-design-intro.html | 4 ++-- documentation/legacy/jobs/job-studio.html | 4 ++-- documentation/legacy/jobs/limits.html | 4 ++-- .../legacy/jobs/multiple-operations.html | 4 ++-- documentation/legacy/jobs/operations.html | 4 ++-- documentation/legacy/jobs/state.html | 4 ++-- documentation/legacy/jobs/understanding.html | 4 ++-- .../legacy/jobs/working_with_branches.html | 4 ++-- .../legacy/manage/platform-mgmt.html | 4 ++-- .../troubleshooting-tips-on-platform.html | 4 ++-- documentation/legacy/microservice/home.html | 4 ++-- documentation/legacy/openfn-roadmap.html | 4 ++-- .../legacy/portability-versions.html | 4 ++-- documentation/legacy/portability.html | 4 ++-- documentation/legacy/release-notes.html | 4 ++-- documentation/legacy/roadmap.html | 4 ++-- documentation/legacy/source-apps.html | 4 ++-- .../standards/digital-public-goods.html | 4 ++-- .../legacy/standards/global-goods.html | 4 ++-- documentation/legacy/standards/openhie.html | 4 ++-- documentation/legacy/style-guide.html | 4 ++-- documentation/legacy/writing-code.html | 4 ++-- documentation/legacy/writing-docs.html | 4 ++-- documentation/link-to-GitHub.html | 4 ++-- .../manage-projects/io-data-storage.html | 4 ++-- .../manage-projects/manage-credentials.html | 4 ++-- .../manage-projects/platform-mgmt.html | 4 ++-- .../manage-projects/retention-periods.html | 4 ++-- .../user-roles-permissions.html | 4 ++-- documentation/migration-steps.html | 4 ++-- .../migration/automated-migration.html | 4 ++-- .../monitor-history/activity-history.html | 4 ++-- .../monitor-history/inspect-runs.html | 4 ++-- .../monitor-history/rerunning-workflow.html | 4 ++-- .../monitor-history/status-codes.html | 4 ++-- .../monitor-history/troubleshooting.html | 4 ++-- documentation/monitoring-workflows.html | 4 ++-- documentation/notifications.html | 4 ++-- documentation/oauth.html | 4 ++-- documentation/release-notes.html | 4 ++-- documentation/security-for-devs.html | 4 ++-- documentation/staging-prod.html | 4 ++-- documentation/style-guide.html | 4 ++-- documentation/tutorials/commcare-to-db.html | 4 ++-- .../tutorials/http-to-googlesheets.html | 4 ++-- documentation/tutorials/tutorial.html | 4 ++-- documentation/user-credentials.html | 4 ++-- documentation/user-profile.html | 4 ++-- documentation/webhook-security.html | 4 ++-- documentation/workflow-snapshots.html | 4 ++-- index.html | 4 ++-- search.html | 4 ++-- 594 files changed, 1193 insertions(+), 1188 deletions(-) rename assets/js/{4224ef00.6430cd01.js => 4224ef00.f1e27166.js} (99%) create mode 100644 assets/js/4aaa0f44.5936c877.js delete mode 100644 assets/js/4aaa0f44.71c1f881.js create mode 100644 assets/js/5f87d652.0818bc2b.js delete mode 100644 assets/js/5f87d652.a6804168.js rename assets/js/{60a00565.54c248d2.js => 60a00565.cef97319.js} (99%) create mode 100644 assets/js/60f1bcf9.2f872ef7.js delete mode 100644 assets/js/60f1bcf9.479ee02a.js rename assets/js/{cb128a98.f23efe47.js => cb128a98.bd1bfccf.js} (82%) rename assets/js/{cc826739.7e516213.js => cc826739.cd753fb9.js} (81%) rename assets/js/{runtime~main.20cc3d5a.js => runtime~main.21fc3b25.js} (98%) diff --git a/404.html b/404.html index 3ecdcf2992df..c8961efac53d 100644 --- a/404.html +++ b/404.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
Skip to main content

Page Not Found

We could not find what you were looking for.

Please contact the owner of the site that linked you to the original URL and let them know their link is broken.

- + \ No newline at end of file diff --git a/adaptors.html b/adaptors.html index 9b6ea2232581..e6bcfbefb20c 100644 --- a/adaptors.html +++ b/adaptors.html @@ -17,7 +17,7 @@ - + @@ -51,7 +51,7 @@ existing adaptors can be found on this linked repository: https://github.com/OpenFn/adaptors

Questions or Adaptor Requests?

Head to community.openfn.org to collaborate with others or to provide adaptors feedback.

- + \ No newline at end of file diff --git a/adaptors/asana.html b/adaptors/asana.html index f1d272d94c0f..7715fea8d3f8 100644 --- a/adaptors/asana.html +++ b/adaptors/asana.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
Skip to main content

Asana Adaptor

About Asana

Asana is a web-based project management tool that helps teams organize, plan, collaborate, and execute tasks.

Integration Options

Asana supports 2 primary integration options:

  1. Rest API: Asana has an available REST API that enable external services like OpenFn to pull data from Asana, or push data from external apps to Asana. This option is suited for scheduled, bulk syncs or workflows that must update data in Asana with external information. See functions for more on how to use this adaptor to work with the API.

  2. Webhook: Asana also has a Webhook or Data Forwarding to push data from Asana to external systems. This option is suited for real-time, event-based data integration. Check out the Asana devloper documentation to learn how to set up a webhook to push data to OpenFn.

Authentication

See Asana docs for the latest on supported authentication methods.

When integrating with Asana via OpenFn, there is one primary authentication method supported: Personal Access Token (PAT). You can generate a personal access token from the Asana developer console.

See this adaptor's Configuration docs for more on the required authentication parameters.

See platform docs on managing credentials for how to configure a credential in OpenFn. If working locally or if using a Raw JSON credential type, then your configuration will look something like this:

{
"apiVersion": "1.0",
"token": "sample-tokenyWSJdXBACMLLWMNGgADFA"
}
  1. API documentation

Implementation Examples

  1. The Wildlife Conservation Society (WCS) - KoboToolBox -> GoogleSheets -> Asana sync: https://openfn.github.io/ConSoSci/asana/
- + \ No newline at end of file diff --git a/adaptors/cht.html b/adaptors/cht.html index 71b93fadda8d..115c39a7b495 100644 --- a/adaptors/cht.html +++ b/adaptors/cht.html @@ -17,7 +17,7 @@ - + @@ -61,7 +61,7 @@ docs on the authentication parameters required. If working locally or if using a Raw JSON credential type, then your configuration will look something like this:

{
"baseUrl": "https://demo-cht.dev.medicmobile.org",
"username": "apiuser",
"password": "secret123"
}
- + \ No newline at end of file diff --git a/adaptors/ckan.html b/adaptors/ckan.html index 4bc2ee3b41c6..f558ec3e96c7 100644 --- a/adaptors/ckan.html +++ b/adaptors/ckan.html @@ -17,7 +17,7 @@ - + @@ -88,7 +88,7 @@ to access the web API.

Implementation Examples

CKAN has been implemented in catalog.data.gov, open.canada.ca/data, and data.humdata.org.

- + \ No newline at end of file diff --git a/adaptors/collections.html b/adaptors/collections.html index 6a83496a34e3..d171d9ac88fe 100644 --- a/adaptors/collections.html +++ b/adaptors/collections.html @@ -17,7 +17,7 @@ - + @@ -86,7 +86,7 @@ used from the CLI too.

You can get a Personal Access Token from any v2 deployment.

Remember that a Collection must be created from the Admin page before it can be used!

For a single job

You can pass multiple adaptors from the CLI:

openfn job.js -a collections -a http -s state.json

You'll need to set configuration on the state.json:

{
"configuration": {
"collections_endpoint": "http://localhost:4000/collections",
"collections_token": "...paste your Personal Access Token..."
}
}

For a workflow

If you're using workflow.json, set the token and endpoint on workflow.credentials:

{
"workflow": {
"steps": [ ... ],
"credentials": {
"collections_endpoint": "http://localhost:4000/collections",
"collections_token": "...paste your Personal Access Token..."
}
}
}

And make sure that any steps which use collections have multiple adaptors set:

{
"workflow": {
"steps": [
{
"expression": "...",
"adaptors": ["@openfn/language-http", "@openfn/language-collections"]
}
]
}
}
- + \ No newline at end of file diff --git a/adaptors/commcare.html b/adaptors/commcare.html index cb811086f151..aa9bad3a116d 100644 --- a/adaptors/commcare.html +++ b/adaptors/commcare.html @@ -17,7 +17,7 @@ - + @@ -102,7 +102,7 @@ CommCare: case_id & form id.
  • You can search for a particular case or form submission in CommCare by using the Find Data by ID feature here.
  • See docs for more on generating custom unique IDs.
  • Embedding External IDs and Hidden Values in Forms

    If integrating with CommCare forms, you may need to make sure that any unique identifiers or external IDs you want to reference in your integration are configured in your forms. You may consider using hidden values to capture external IDs in form data, without affecting the end user experience.

    About Forms, case and data management

    CommCare API Docs

    CommCare has different APIs for reading vs. modifying data. Some helpful links:

    Implementation Examples

    - + \ No newline at end of file diff --git a/adaptors/common.html b/adaptors/common.html index 3a7ab7fdf27e..77d93160664f 100644 --- a/adaptors/common.html +++ b/adaptors/common.html @@ -17,7 +17,7 @@ - + @@ -27,7 +27,7 @@
    Skip to main content

    Common Adaptor

    About OpenFn "Common" Language

    Use this adaptor to write JavaScript, or to leverage common expressions and helper functions for OpenFn.

    This adaptor is typically used for transforming data in OpenFn workflows that automate "ETL" (extract, transform, load) processes. See below examples.

    //use fn() to write your own functions
    fn(state => {
    // write javascript...
    // ...to do some things to state
    console.log(state.data); //or to debug
    return state;
    });
    //use each() to create 1 account for each form
    each(
    $.forms,
    create('Account', {
    Kobo_ID__c: $.data.id,
    Name: $.data.customer_name,
    Phone: $.data.customer_phone,
    })
    );
    - + \ No newline at end of file diff --git a/adaptors/dhis2.html b/adaptors/dhis2.html index 7b9d287cf4de..9031605236db 100644 --- a/adaptors/dhis2.html +++ b/adaptors/dhis2.html @@ -17,7 +17,7 @@ - + @@ -78,7 +78,7 @@ https://docs.dhis2.org/en/develop/using-the-api/dhis-core-version-235/web-api.html

  • Metadata integration via DHIS2 Web API. OpenFn implementations can leverage the DHIS2 adaptor.

  • Integration Examples

    1. DHIS2 Demo Implementations: https://github.com/OpenFn/dhis2-demo
    2. Lesotho Integration connecting two DHIS2 instances: https://github.com/OpenFn/lesotho-dhis2
    - + \ No newline at end of file diff --git a/adaptors/fhir-fr.html b/adaptors/fhir-fr.html index 56eab085753e..b7e156ca1c6a 100644 --- a/adaptors/fhir-fr.html +++ b/adaptors/fhir-fr.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    FHIR-FR IG Adaptor

    Custom FHIR Adaptor: fhir-fr

    Note❗: This is a custom adaptor generated from this France FHIR Implementation Guide: https://hl7.fr/ig/fhir/core/2.0.0/index.html

    Custom FHIR adaptors generate a suite of helper functions specific to their source Implementation Guides.

    See the generic fhir adaptor and our docs on standards for more general guidance on OpenFn + FHIR.

    Build your own FHIR Adaptor

    See the Adaptors Wiki to build your own adaptor for your implementation guide by trying out our fhir-adaptor-generator (which is a new tool still in testing).

    Please share any questions or feedback on community.openfn.org.

    - + \ No newline at end of file diff --git a/adaptors/fhir-ndr-et.html b/adaptors/fhir-ndr-et.html index 57b742329e0d..76069d777b89 100644 --- a/adaptors/fhir-ndr-et.html +++ b/adaptors/fhir-ndr-et.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    FHIR-NDR-ET IG Adaptor

    Custom FHIR Adaptor: fhir-ndr-et

    Note❗: This is a custom adaptor generated from this Implementation Guide Ethiopia FHIR Implementation Guide - HIV Treatment & Care Services authored by Jembi Health Systems: https://build.fhir.org/ig/jembi/ethiopia-hiv/branches/master/index.html

    Custom FHIR adaptors generate a suite of helper functions specific to their source Implementation Guides.

    See the generic fhir adaptor and our docs on standards for more general guidance on OpenFn + FHIR.

    Build your own FHIR Adaptor

    See the Adaptors Wiki to build your own adaptor for your implementation guide by trying out our fhir-adaptor-generator (which is a new tool still in testing).

    Please share any questions or feedback on community.openfn.org.

    - + \ No newline at end of file diff --git a/adaptors/fhir.html b/adaptors/fhir.html index 30f83013875b..25ecbd2a10d9 100644 --- a/adaptors/fhir.html +++ b/adaptors/fhir.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    FHIR Adaptor

    About FHIR

    FHIR stands for Fast Healthcare Interoperability Resources. It is a standard for representing and exchanging healthcare data electronically.

    About this adaptor and features coming soon!

    This adaptor is very basic and generic, used mostly to integrate demo FHIR servers. It's a work-in-progress, so share questions and feedback on community.openfn.org.

    FHIR version-specific adaptors (e.g., fhir-r4) with enhanced functionality are coming soon to fast-track integration setup with more helper functions, templates, and docs than this simple adaptor. See the Adaptors Wiki for how to build an adaptor specific to your FHIR Implementation Guide.

    Integration Options

    1. Rest API: The FHIR specification includes a REST API that enables external services like OpenFn to pull data from the FHIR server, or push data from external apps to FHIR servers. This option is suited for scheduled, bulk syncs or workflows that must update data with external information. See functions for more on how to use this adaptor to work with the API.

    2. Webhook: The FHIR specification does not inherently define a webhook or data-forwarding mechanism. However, many FHIR implementations and platforms offer extensions or configurations that support similar functionality. This option is suited for real-time, event-based data integration. Check out the FHIR Subscription resource documentation to learn more about one way this might be implemented.

    Authentication

    The FHIR standard does not directly prescribe authentication and authorization methods. Instead, it provides security guidelines and leaves the choice of implementation to the developers of FHIR servers and clients. See the FHIR docs for the latest security-related recommendations. Depending on the FHIR systems being integrated via OpenFn, you might employ a Basic Auth, API key, or OAuth authentication scheme.

    See this adaptor's Configuration docs for more on the required authentication parameters.

    See platform docs on managing credentials for how to configure a credential in OpenFn. If working locally or if using a Raw JSON credential type, then your configuration will look something like this to define your target endpoint and FHIR version:

    {
    "baseUrl": "https://hapi.fhir.org", //fhir endpoint
    "apiPath": "baseR4" //fhir version
    }
    1. API documentation
    2. Digital Square on FHIR
    3. Basic guide to interacting with FHIR Server
    4. Creating your first FHIR resource
    5. Google's Open Health Stack tooling for working with FHIR

    Have resources or links to share? Submit a PR to edit this page or post on community.openfn.org.

    - + \ No newline at end of file diff --git a/adaptors/godata.html b/adaptors/godata.html index 7ba608e9bdd4..01bf04ba1bf3 100644 --- a/adaptors/godata.html +++ b/adaptors/godata.html @@ -17,7 +17,7 @@ - + @@ -33,7 +33,7 @@ language-http can be used to make HTTP requests to the Go.Data API and can perform any operations not supported by language-godata.

    Implementation Examples

    See Go.Data docs site: https://worldhealthorganization.github.io/godata/integration-scripts/

    - + \ No newline at end of file diff --git a/adaptors/googlesheets.html b/adaptors/googlesheets.html index e1cf58bc619f..5e2653eba945 100644 --- a/adaptors/googlesheets.html +++ b/adaptors/googlesheets.html @@ -17,7 +17,7 @@ - + @@ -65,7 +65,7 @@ in this tutorial that shows us how to get data via a REST API and push it to Google Sheet.

    Helpful Resources

    - + \ No newline at end of file diff --git a/adaptors/http.html b/adaptors/http.html index f4b51761bb74..2a866b5c59cb 100644 --- a/adaptors/http.html +++ b/adaptors/http.html @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@
    Skip to main content

    HTTP Adaptor

    About the HTTP "universal" adaptor

    Communicate with web apps using HTTP (HyperText Transfer Protocol). This adaptor enables out-of-box integration with any REST API!

    Integration Options

    Use this adaptor to communicate with any REST API or any other app that can communicate via HTTP.

    Note that OpenFn also supports Webhooks, but that is a workflow trigger type (see docs), not an adaptor.

    Authentication

    HTTP itself does not enforce authentication, but many applications that use HTTP implement security mechanisms to control access. Common methods that can be used when integrating with OpenFn include Basic Authentication, API Keys and OAuth. See this adaptor's Configuration docs for more on the required authentication parameters.

    See platform docs on managing credentials for how to configure a credential in OpenFn. If working locally or if using a Raw JSON credential type, then your configuration will look something like this:

    {
    "username": "test@openfn.org",
    "password": "@some(!)Password",
    "access_token": "00QCjAl4MlV-WPX",
    "baseUrl": "https://instance_name.surveycto.com"
    }

    Implementation Examples

    1. UNICEF Primero - UNHCR Progres Interoperability: https://github.com/OpenFn/primero-progres
    2. UNICEF Thailand Primero Interoperability: https://openfn.github.io/primero-thailand/
    - + \ No newline at end of file diff --git a/adaptors/kobotoolbox.html b/adaptors/kobotoolbox.html index dcee8a5ce737..3ff0da71db3a 100644 --- a/adaptors/kobotoolbox.html +++ b/adaptors/kobotoolbox.html @@ -17,7 +17,7 @@ - + @@ -85,8 +85,8 @@ Toolbox.

    If language-kobotoolbox does not provide functions to support your integration requirements, language-http may also be implemented to send GET/POST/PUT requests to the Kobo APIs.

    Integration Examples

    See the ConSoSci GitHub repo for several example Kobo-to-database jobs: -https://github.com/OpenFn/consosci

    - +https://github.com/OpenFn/consosci

    + \ No newline at end of file diff --git a/adaptors/library.html b/adaptors/library.html index 06b522d0c194..da1c0606583b 100644 --- a/adaptors/library.html +++ b/adaptors/library.html @@ -17,7 +17,7 @@ - + @@ -58,7 +58,7 @@ experience in the future. We'd like to provide a way for users to "upvote" or "downvote" certain jobs (think: StackOverflow) which they found useful. Get in touch if you're interested in helping out!

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/0-Get-TEI-data-2021-06-02.html b/adaptors/library/jobs/auto/0-Get-TEI-data-2021-06-02.html index a33b1e508341..2ea68070bd9e 100644 --- a/adaptors/library/jobs/auto/0-Get-TEI-data-2021-06-02.html +++ b/adaptors/library/jobs/auto/0-Get-TEI-data-2021-06-02.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    0 - Get TEI data

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    alterState, dataValue, getData

    Expression

    // TODO: get all TEIs with vaccination state 'NOT YET REQUESTED' via save filter from Austin.


    // NOTE: if we can get a webhook with the desired info, let's drop this job!

    getData('trackedEntityInstances', {
    fields: '*',
    ou: 'V5XvX1wr1kF', // traningland?
    program: 'EZkN8vYZwjR', //
    trackedEntityInstance: dataValue('id'), // the value from the post
    });

    alterState(state => {
    console.log('The response from DHIS2', state.data);
    console.log('Only pass necessary data to the DIVOC job.');
    const necessary = state.data.trackedEntityInstances[0];
    console.log(necessary);
    return { ...state, data: necessary };
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/01-send-mailgun-email-2018-12-04.html b/adaptors/library/jobs/auto/01-send-mailgun-email-2018-12-04.html index 1ce4fb4e8631..837fde67b1cd 100644 --- a/adaptors/library/jobs/auto/01-send-mailgun-email-2018-12-04.html +++ b/adaptors/library/jobs/auto/01-send-mailgun-email-2018-12-04.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    01 send mailgun email

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields, send

    Expression

    send(
    fields(
    field('from', 'aleksa@openfn.org'),
    field('to', 'aleksa@openfn.org, aleksa@verasolutions.org'),
    field('subject', 'Kobo: New Form Submitted'),
    //You can write your own custom, anonymous functions to do whatever you desire - see function(state)
    field('text', function(state) {
    const msgText = "A form was submitted by "+ dataValue("_submitted_by")(state) + ". Please login to review!"
    return msgText
    //result will be an email with body text "A form was submitted by [Kobo Submitted By User]. Please login to review!"

    })
    )
    )
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/01a-Create-Registrants-2019-11-19.html b/adaptors/library/jobs/auto/01a-Create-Registrants-2019-11-19.html index a2873d0f8734..142b25401d83 100644 --- a/adaptors/library/jobs/auto/01a-Create-Registrants-2019-11-19.html +++ b/adaptors/library/jobs/auto/01a-Create-Registrants-2019-11-19.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    01a/ Create Registrants

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: 01a/ Create Registrants
    • Adaptor: @openfn/language-http
    • Adaptor Version: latest
    • Created about 5 years ago
    • Updated almost 5 years ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    alterState, post, JSON

    Expression

    // @trigger 'odk submission' either via Aggregate JSON Forwarding or via direct
    // submission to OpenFn.org/inbox
    // @credential 'ihris'
    // @adaptor 'http'
    // -----------------------------------------------------------------------------

    // =============================================================================
    // Pluck out parts of the ODK submission and prepare our 'person' object that we
    // will use in multiple requests to iHRIS. =====================================
    console.log(JSON.stringify(state.data))
    alterState(state => {
    state.person = {
    'form[person][0][0][fields][id]': 'person|0',
    'form[person][0][0][fields][surname]': state.data.RegistrationForm.last_name,
    'form[person][0][0][fields][firstname]': state.data.RegistrationForm.first_name,
    'form[person][0][0][fields][nationality]': `country|${state.data.RegistrationForm.country}`,
    'form[person][0][0][fields][residence]': 'district|3',
    };
    return state;
    });

    // =============================================================================
    // Create records via iHRIS api, with the hostUrl, port, and authentication
    // handled by the credential ===================================================
    post(
    '/manage/person',
    {
    formData: state => {
    state.person.submit_type = 'confirm';
    return state.person;
    },
    },
    post('/manage/person', {
    formData: state => {
    state.person.submit_type = 'save';
    return state.person;
    },
    options: {
    successCodes: [302],
    },
    })
    );


    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/01b-Query-new-person-record-2019-12-13.html b/adaptors/library/jobs/auto/01b-Query-new-person-record-2019-12-13.html index 4cfe902fd790..a38084107cf0 100644 --- a/adaptors/library/jobs/auto/01b-Query-new-person-record-2019-12-13.html +++ b/adaptors/library/jobs/auto/01b-Query-new-person-record-2019-12-13.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    01b/ Query new person record

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: 01b/ Query new person record
    • Adaptor: @openfn/language-mysql
    • Adaptor Version: latest
    • Created about 5 years ago
    • Updated almost 5 years ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    alterState

    Expression

    sqlString(state => {
    // The person information is in state from the previous operation
    console.log(state.references[0].RegistrationForm)
    return (
    `SELECT id FROM hippo_person WHERE firstname='` +
    state.references[0].RegistrationForm.first_name +
    `' AND surname='` +
    state.references[0].RegistrationForm.last_name +
    `'`
    );
    });

    alterState(state => {
    // Note: we pluck out on the 'RowDataResponses' from the SQL server.
    const personData = state.response.body;
    console.log(personData);
    // Get the first record
    state.data.person_id = personData[0] && personData[0].id
    return state;
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/01c-Create-person_position-record-2019-12-13.html b/adaptors/library/jobs/auto/01c-Create-person_position-record-2019-12-13.html index cdb40a7db782..2d9f1e5c9c2f 100644 --- a/adaptors/library/jobs/auto/01c-Create-person_position-record-2019-12-13.html +++ b/adaptors/library/jobs/auto/01c-Create-person_position-record-2019-12-13.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    01c/ Create person_position record

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: 01c/ Create person_position record
    • Adaptor: @openfn/language-http
    • Adaptor Version: latest
    • Created about 5 years ago
    • Updated almost 5 years ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    alterState, post

    Expression

    // Pluck out parts of the ODK submission and prepare our 'person_postion' object that we
    // will use in multiple requests to iHRIS. =====================================
    alterState(state => {
    console.log(state);
    // The position field in the form holds the position ID and the salary
    const positionData = state.references[0].RegistrationForm.position.split('_');
    const startDateComponents = state.references[0].RegistrationForm.start_date.split('-')
    state.person_position = {
    'form[person_position][0][0][fields][id]': 'person_position|0',
    'form[person_position][0][0][fields][parent]': state.data.person_id,
    'form[person_position][0][0][fields][position]': 'position|'+positionData[0],
    'form[person_position][0][0][fields][start_date][day]': startDateComponents[2],
    'form[person_position][0][0][fields][start_date][month]': startDateComponents[1],
    'form[person_position][0][0][fields][start_date][year]': startDateComponents[0],
    'form[salary][0][0][fields][salary]': 'currency|3='+positionData[1],
    'can_edit_position': '1'
    };
    state.person_contact = {
    'form[person_contact_personal][0][0][fields][id]': 'person_contact_personal|0',
    'form[person_contact_personal][0][0][fields][parent]': state.data.person_id,
    'form[person_contact_personal][0][0][fields][mobile_phone]': state.references[0].RegistrationForm.phone_number,
    'contact_type': 'personal',
    };
    return state;
    });

    // =============================================================================
    // Create records via iHRIS api, with the hostUrl, port, and authentication
    // handled by the credential ===================================================
    post(
    '/manage/make_offer',
    {
    formData: state => {
    state.person_position.submit_type = 'confirm';
    return state.person_position;
    },
    },
    post('/manage/make_offer', {
    formData: state => {
    state.person_position.submit_type = 'save';
    return state.person_position;
    },
    options: {
    successCodes: [302],
    },
    })
    );

    post(
    '/manage/contact?contact_type=personal',
    {
    formData: state => {
    state.person_contact.submit_type = 'confirm';
    return state.person_contact;
    },
    },
    post('/manage/contact?contact_type=personal', {
    formData: state => {
    state.person_contact.submit_type = 'save';
    return state.person_contact;
    },
    options: {
    successCodes: [302],
    },
    })
    );


    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/02a-Query-DB-for-people-to-pay-2019-12-11.html b/adaptors/library/jobs/auto/02a-Query-DB-for-people-to-pay-2019-12-11.html index 80783170feb8..6a1f31567367 100644 --- a/adaptors/library/jobs/auto/02a-Query-DB-for-people-to-pay-2019-12-11.html +++ b/adaptors/library/jobs/auto/02a-Query-DB-for-people-to-pay-2019-12-11.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    02a/ Query DB for people to pay

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: 02a/ Query DB for people to pay
    • Adaptor: @openfn/language-mysql
    • Adaptor Version: latest
    • Created about 5 years ago
    • Updated almost 5 years ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    alterState

    Expression


    sqlString(state => {
    // stored procedure will return a list of names, phone numbers (MSISDN), and salary info for employees that should be paid today
    return 'CALL get_employees_to_pay();';
    });

    //alterState(state => {
    // Note: we pluck out on the 'RowDataResponses' from the SQL server.
    // state.data.records = state.response.body[0];
    // return state;
    //});
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/02b-Initiate-Payments-2019-11-19.html b/adaptors/library/jobs/auto/02b-Initiate-Payments-2019-11-19.html index 001473299a7d..5e7c7e38fee7 100644 --- a/adaptors/library/jobs/auto/02b-Initiate-Payments-2019-11-19.html +++ b/adaptors/library/jobs/auto/02b-Initiate-Payments-2019-11-19.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    02b/ Initiate Payments

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: 02b/ Initiate Payments
    • Adaptor: @openfn/language-http
    • Adaptor Version: latest
    • Created about 5 years ago
    • Updated almost 5 years ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    alterState, dataPath, each, map, post

    Expression

    // @trigger 'when 2a succeeds'
    // @credential 'ihris-mifos-combined'
    // @adaptor 'http'
    // -----------------------------------------------------------------------------

    // Hang 'payees' on state so that operations which replace "response" don't
    // overwrite these data. QUESTION: Why pluck body[0] instead of body[*]? What
    // happens if there are multiple payees? Is that first item in the body array an
    // array itself?
    alterState(state => {
    state.data = { payees: state.response.body[0] };
    state.saved_config = state.configuration;
    return state;
    });

    // ===========================================================================
    // Make payment requests in Mifos with the reponse, either in bulk or by
    // iterating through the array of registrants and making a separate request
    // for each one ==============================================================
    each(
    dataPath('payees[*]'),
    post(
    `${state.configuration.mifosUrl}/channel/transactions`,
    {
    authentication: state.configuration.mifosAuth,
    headers: {
    'content-type': 'application/json',
    'X-Tenant-Identifier': 'tn07',
    },
    // Can we send an array of payments to make in a single request?
    // body: state.data.registrants.map(r => {
    // console.log(`Initiating payment for ${r.name}.`);
    // return {
    // payer: { msisdn: state.configuration.mifosAcct },
    // payee: { msisdn: r.phone },
    // amount: r.amount,
    // };
    // }),
    body: state => {
    return {
    payer: {
    partyIdInfo: {
    partyIdType: 'MSISDN',
    partyIdentifier: '27710203999',
    },
    },
    payee: {
    partyIdInfo: {
    partyIdType: 'MSISDN',
    partyIdentifier: state.data.msisdn,
    },
    },
    amountType: 'SEND',
    transactionType: {
    scenario: 'PAYMENT',
    initiator: 'PAYER',
    initiatorType: 'CONSUMER',
    },
    amount: {
    currency: 'USD',
    amount: state.data.salary / 52,
    },
    };
    },
    },
    state => {
    const today = new Date();
    const currPayee = state.references[0];
    state.data.person_payment = {
    'form[person_payments][0][0][fields][id]': 'person_payments|0',
    'form[person_payments][0][0][fields][parent]':
    'person|' + currPayee.person_id,
    'form[person_payments][0][0][fields][date][day]': today.getDate(),
    'form[person_payments][0][0][fields][date][month]':
    today.getMonth() + 1,
    'form[person_payments][0][0][fields][date][year]': today.getFullYear(),
    'form[person_payments][0][0][fields][amount]': currPayee.salary / 52,
    'form[person_payments][0][0][fields][transactionId]':
    state.data.body.transactionId,
    'form[person_payments][0][0][fields][status]':
    state.data.body.transactionId ? 'initiated' : 'failed',
    };
    // =====================================================================
    // Create "initiated" payments in iHRIS with their mifos external IDs ==
    post(
    `${state.saved_config.ihrisUrl}/manage/person_payments`,
    {
    authentication: state.configuration.ihrisAuth,
    formData: state => {
    state.data.person_payment.submit_type = 'confirm';
    console.log('PaymentData: ' + state.data.person_payment);
    return state.data.person_payment;
    },
    },
    post(`${state.saved_config.ihrisUrl}/manage/person_payments`, {
    authentication: state.configuration.ihrisAuth,
    formData: state => {
    state.references[1].person_payment.submit_type = 'save';
    return state.references[1].person_payment;
    },
    options: {
    successCodes: [302],
    },
    })
    )(state);
    }
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/03-Update-Payment-Status-2019-11-19.html b/adaptors/library/jobs/auto/03-Update-Payment-Status-2019-11-19.html index d3d000284f0e..7d425f726a2b 100644 --- a/adaptors/library/jobs/auto/03-Update-Payment-Status-2019-11-19.html +++ b/adaptors/library/jobs/auto/03-Update-Payment-Status-2019-11-19.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    03/ Update Payment Status

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: 03/ Update Payment Status
    • Adaptor: @openfn/language-mysql
    • Adaptor Version: latest
    • Created about 5 years ago
    • Updated almost 5 years ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    alterState

    Expression

    sqlString(state => {
    console.log(state.data.transactionCode);
    return `SELECT record FROM entry WHERE string_value='${state.data.transactionCode}'`;
    });

    alterState(state => {
    // Note: we pluck out on the 'RowDataResponses' from the SQL server.
    const recordData = state.response.body.filter(x => x.record !== undefined);
    // Get the first record
    state.data.record = recordData[0] && recordData[0].record;
    return state;
    });

    sqlString(state => {
    return `UPDATE entry SET string_value='completed' where record=${state.data.record} and string_value='initiated'`;
    });

    sqlString(state => {
    return `UPDATE last_entry SET string_value='completed' where record=${state.data.record} and string_value='initiated'`;
    });

    sqlString(state => {
    return `UPDATE hippo_person_payments SET status='completed' where id='person_payments|${state.data.record}'`;
    });
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/04a-Query-for-job-changes-2019-12-12.html b/adaptors/library/jobs/auto/04a-Query-for-job-changes-2019-12-12.html index a81e2db62c72..019ba7bd85c5 100644 --- a/adaptors/library/jobs/auto/04a-Query-for-job-changes-2019-12-12.html +++ b/adaptors/library/jobs/auto/04a-Query-for-job-changes-2019-12-12.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    04a/Query for job changes

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: 04a/Query for job changes
    • Adaptor: @openfn/language-mysql
    • Adaptor Version: latest
    • Created about 5 years ago
    • Updated almost 5 years ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    alterState

    Expression

    sqlString(state => {
    return "SELECT position_id, position_name, salary, facility_id, facility_name, status \
    FROM position_updates WHERE status in ('NEW', 'CLOSED');";
    });

    alterState(state => {
    state.new_jobs = state.response.body;
    console.log(state.new_jobs);
    return state;
    })

    sqlString(state => {
    return `UPDATE position_updates SET status='PROCESSED' WHERE status in ('NEW','CLOSED')`;
    });
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/04b-Update-ODK-form-2019-12-03.html b/adaptors/library/jobs/auto/04b-Update-ODK-form-2019-12-03.html index 5e8df8d7b7df..f33d5200969a 100644 --- a/adaptors/library/jobs/auto/04b-Update-ODK-form-2019-12-03.html +++ b/adaptors/library/jobs/auto/04b-Update-ODK-form-2019-12-03.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    04b/ Update ODK form

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: 04b/ Update ODK form
    • Adaptor: @openfn/language-http
    • Adaptor Version: latest
    • Created about 5 years ago
    • Updated almost 5 years ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    get, post, Number

    Expression

    // Your job goes here.
    get(
    'http://165.227.185.106/formXml',
    {
    query: {
    formId: 'registration_form',
    },
    },
    state => {
    console.log('Start processing state and form template!');

    let template = state.data.body;
    let templateUpdated = false;

    const itemEx = /<item>\s?<label>[^<>]*<\/label>\s?<value>[^<>]*<\/value>\s?<\/item>/gi;
    const itemMatches = template.match(itemEx);

    const selectFacilityEx = /<select1\s+ref="\/RegistrationForm\/position_facility">/gi;
    //const selectFacilityEx = /<select1\s+ref="\/data\/position_facility">/gi;
    const selectPositionEx = /<select1\s+ref="\/RegistrationForm\/position">/gi;
    //const selectPositionEx = /<select1\s+ref="\/data\/position">/gi;

    console.log(`Received ${state.new_jobs.length} new data!`);

    for(let j = 0; j < state.new_jobs.length; j ++) {
    let facilityExists = false;
    let positionExists = false;

    let facilityId = state.new_jobs[j].facility_id;
    console.log(`Processing facility: ${facilityId}.`);

    const positions = state.new_jobs[j].position_id.split('|');
    const salaries = state.new_jobs[j].salary.split('=');

    let positionId = `${positions[1]}_${salaries[1]}`;
    console.log(`Processing position: ${positionId}.`);
    for(let i = 0; i < itemMatches.length; i ++) {
    if (itemMatches[i].indexOf(facilityId) >= 0) {
    facilityExists = true;
    }
    if (itemMatches[i].indexOf(positionId) >= 0) {
    if (state.new_jobs[j].status === 'CLOSED') {
    console.log(`Removing closed position: ${positionId}.`);
    template = template.replace(itemMatches[i], '');
    templateUpdated = true;
    }
    positionExists = true;
    }
    }

    if (!facilityExists) {
    const selectFacilityMatches = template.match(selectFacilityEx);
    console.log("Facility matches: "+selectFacilityMatches)
    const facilityItem =
    `<item><label>${state.new_jobs[j].facility_name}</label><value>${facilityId}</value></item>`;
    console.log(`Adding facility: ${facilityItem}.`);
    template = template.replace(
    selectFacilityEx,
    selectFacilityMatches[0] + facilityItem
    );
    templateUpdated = true;
    } else {
    console.log('Not seeing any facility to add. Moving along!');
    }

    if (!positionExists && state.new_jobs[j].status === 'NEW') {
    const selectPositionMatches = template.match(selectPositionEx);
    const positionItem =
    `<item><label>${state.new_jobs[j].position_name}</label><value>${positionId}</value></item>`;
    console.log(`Adding position: ${positionItem}.`);
    template = template.replace(
    selectPositionEx,
    selectPositionMatches[0] + positionItem
    );
    templateUpdated = true;
    } else {
    console.log('Not seeing any position to add. Moving along!');
    }
    }

    if (templateUpdated) {
    const versionEx = /id="\S+"\s+version="(\S+)"/;
    const versionMatches = template.match(versionEx);
    const currentVersion = Number.parseInt(versionMatches[1]);
    console.log(`Updating form version from: ${currentVersion}`);
    template = template.replace(currentVersion, currentVersion + 1);
    }

    state.template = template;
    return state;
    }
    );

    post('http://165.227.185.106/formUpload', {
    formData: state => {
    return {
    form_def_file: {
    value: state.template,
    options: {
    filename: 'registration_form.xml'
    }
    }
    };
    },
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/05-Submit-employee-evaluation-2019-12-03.html b/adaptors/library/jobs/auto/05-Submit-employee-evaluation-2019-12-03.html index 794d8f14d74d..86367e226be5 100644 --- a/adaptors/library/jobs/auto/05-Submit-employee-evaluation-2019-12-03.html +++ b/adaptors/library/jobs/auto/05-Submit-employee-evaluation-2019-12-03.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    05/ Submit employee evaluation

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: 05/ Submit employee evaluation
    • Adaptor: @openfn/language-http
    • Adaptor Version: latest
    • Created about 5 years ago
    • Updated almost 5 years ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    alterState, post

    Expression

    // @trigger 'when employee evaluation form arrives'
    // @credential 'ihris-mifos-combined'
    // @adaptor 'http'
    // -----------------------------------------------------------------------------

    alterState(state => {
    state.payee = state.data.EvaluationForm;
    state.saved_config = state.configuration;
    return state;
    });

    post(
    `${state.configuration.mifosUrl}/channel/transactions`,
    {
    authentication: state.configuration.mifosAuth,
    headers: {
    'content-type': 'application/json',
    'X-Tenant-Identifier': 'tn07',
    },
    body: state => {
    return {
    payer: {
    partyIdInfo: {
    partyIdType: 'MSISDN',
    partyIdentifier: '27710407990',
    },
    },
    payee: {
    partyIdInfo: {
    partyIdType: 'MSISDN',
    partyIdentifier: state.payee.social_worker_id.split('_')[1],
    },
    },
    amountType: 'SEND',
    transactionType: {
    scenario: 'PAYMENT',
    initiator: 'PAYER',
    initiatorType: 'CONSUMER',
    },
    amount: {
    currency: 'USD',
    // Calculate the bonus amount - for now just use number of clients seen * 100
    amount: state.payee.client_counts*100,
    },
    };
    },
    },
    state => {
    const today = new Date();
    state.data.person_payment = {
    'form[person_payments][0][0][fields][id]': 'person_payments|0',
    'form[person_payments][0][0][fields][parent]':
    'person|' + state.payee.social_worker_id.split('_')[0],
    'form[person_payments][0][0][fields][date][day]': today.getDate(),
    'form[person_payments][0][0][fields][date][month]':
    today.getMonth() + 1,
    'form[person_payments][0][0][fields][date][year]': today.getFullYear(),
    'form[person_payments][0][0][fields][amount]': state.payee.client_counts*100,
    'form[person_payments][0][0][fields][transactionId]':
    state.data.body.transactionId,
    'form[person_payments][0][0][fields][status]':
    state.data.body.transactionId ? 'initiated' : 'failed',
    };
    // =====================================================================
    // Create "initiated" payments in iHRIS with their mifos external IDs ==
    post(
    `${state.saved_config.ihrisUrl}/manage/person_payments`,
    {
    authentication: state.configuration.ihrisAuth,
    formData: state => {
    state.data.person_payment.submit_type = 'confirm';
    console.log('PaymentData: ' + state.data.person_payment);
    return state.data.person_payment;
    },
    },
    post(`${state.saved_config.ihrisUrl}/manage/person_payments`, {
    authentication: state.configuration.ihrisAuth,
    formData: state => {
    state.references[1].person_payment.submit_type = 'save';
    return state.references[1].person_payment;
    },
    options: {
    successCodes: [302],
    },
    })
    )(state);
    }
    );


    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/05a-Query-for-new-employees-2019-12-19.html b/adaptors/library/jobs/auto/05a-Query-for-new-employees-2019-12-19.html index 9b81c286742a..0c25902e96ab 100644 --- a/adaptors/library/jobs/auto/05a-Query-for-new-employees-2019-12-19.html +++ b/adaptors/library/jobs/auto/05a-Query-for-new-employees-2019-12-19.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    05a/Query for new employees

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: 05a/Query for new employees
    • Adaptor: @openfn/language-mysql
    • Adaptor Version: latest
    • Created about 5 years ago
    • Updated almost 5 years ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    alterState

    Expression

    sqlString(state => {
    return "SELECT person_id, person_name, msisdn, status FROM employee_updates WHERE status='NEW';";
    });

    alterState(state => {
    state.new_employees = state.response.body;
    console.log(state.new_employees);
    return state;
    })

    sqlString(state => {
    return `UPDATE employee_updates SET status='PROCESSED' WHERE status='NEW'`;
    });
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/05b-Update-ODK-eval-form-2019-12-19.html b/adaptors/library/jobs/auto/05b-Update-ODK-eval-form-2019-12-19.html index 11f3706a73ee..65750363286b 100644 --- a/adaptors/library/jobs/auto/05b-Update-ODK-eval-form-2019-12-19.html +++ b/adaptors/library/jobs/auto/05b-Update-ODK-eval-form-2019-12-19.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    05b/Update ODK eval form

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: 05b/Update ODK eval form
    • Adaptor: @openfn/language-http
    • Adaptor Version: latest
    • Created about 5 years ago
    • Updated almost 5 years ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    get, post, Number

    Expression

    // Your job goes here.
    get(
    'http://165.227.185.106/formXml',
    {
    query: {
    formId: 'evaluation_form',
    },
    },
    state => {
    let template = state.data.body;
    let templateUpdated = false;

    const itemEx = /<item>\s?<label>[^<>]*<\/label>\s?<value>[^<>]*<\/value>\s?<\/item>/gi;
    const itemMatches = template.match(itemEx);

    const selectUserEx = /<select1\s+ref="\/EvaluationForm\/social_worker_id">/gi;

    console.log(`Receiving ${state.new_employees.length} new data!`);

    for (let j = 0; j < state.new_employees.length; j++) {
    let userExists = false;

    let userId = state.new_employees[j].person_id.split('|')[1];
    console.log(`Processing user: ${userId}.`);

    for (let i = 0; i < itemMatches.length; i++) {
    if (itemMatches[i].indexOf(userId) >= 0) {
    userExists = true;
    }
    }

    if (!userExists) {
    const selectUserMatches = template.match(selectUserEx);
    const msisdn = state.new_employees[j].msisdn;
    const userItem =
    `<item><label>${state.new_employees[j].person_name}</label><value>${userId}_${msisdn}</value></item>`;
    console.log(`Adding user: ${userItem}.`);
    template = template.replace(
    selectUserEx,
    selectUserMatches[0] + userItem
    );
    templateUpdated = true;
    } else {
    console.log('Not seeing any user to add. Moving along!');
    }
    }

    if (templateUpdated) {
    const versionEx = /id="\S+"\s+version="(\S+)"/;
    const versionMatches = template.match(versionEx);
    const currentVersion = Number.parseInt(versionMatches[1]);
    console.log(`Updating form version from: ${currentVersion}`);
    template = template.replace(currentVersion, currentVersion + 1);
    }

    state.template = template;
    return state;
    }
    );

    post('http://165.227.185.106/formUpload', {
    formData: state => {
    return {
    form_def_file: {
    value: state.template,
    options: {
    filename: 'evaluation_form.xml'
    }
    }
    };
    },
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/1-Create-Payment-in-SF-2018-09-03.html b/adaptors/library/jobs/auto/1-Create-Payment-in-SF-2018-09-03.html index 2481bb12dd01..61d784dcef00 100644 --- a/adaptors/library/jobs/auto/1-Create-Payment-in-SF-2018-09-03.html +++ b/adaptors/library/jobs/auto/1-Create-Payment-in-SF-2018-09-03.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    1. Create Payment in SF

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    create, dataValue, field, fields, relationship

    Expression

    create('Payment__c', fields(
    field('Name', dataValue('reference_number')),
    field('Amount__c', dataValue('amount')),
    field('Phone_Number__c', dataValue('sender_number')),
    relationship('Contract__r', 'ContractNumber', dataValue('contract_number'))
    ));
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/1-Get-CommCare-Forms-Bulk-Extract-2021-04-08.html b/adaptors/library/jobs/auto/1-Get-CommCare-Forms-Bulk-Extract-2021-04-08.html index 814ad2330c65..d0e3fd36b577 100644 --- a/adaptors/library/jobs/auto/1-Get-CommCare-Forms-Bulk-Extract-2021-04-08.html +++ b/adaptors/library/jobs/auto/1-Get-CommCare-Forms-Bulk-Extract-2021-04-08.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    1 Get CommCare Forms Bulk Extract

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: 1 Get CommCare Forms Bulk Extract
    • Adaptor: @openfn/language-http
    • Adaptor Version: v3.1.7
    • Created almost 4 years ago
    • Updated 15 days ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    each, get, post

    Expression

    get(
    'https://www.commcarehq.org/a/grassrootsoccertrial/api/v0.5/form/',
    {
    query: {
    limit: 1000, //max limit: 1000
    offset: state.meta && state.meta.next ? state.meta.limit + state.meta.offset : 0,
    received_on_start: '2024-05-16',
    received_on_end: '2024-05-30',
    xmlns: 'http://openrosa.org/formdesigner/6F130211-5A05-4915-8F55-A413A6B9D61B',
    },
    },
    state => {
    const { meta, objects } = state.data;
    const { openfnInboxUrl } = state.configuration;
    const xmlnsList = [
    `http://openrosa.org/formdesigner/6F130211-5A05-4915-8F55-A413A6B9D61B`, //Outcome Survey form
    // 'http://openrosa.org/formdesigner/40BBC9E3-C650-4F72-A027-235BF33D87AB', //Create Intervention form
    // 'http://openrosa.org/formdesigner/D50A9A33-B1B4-41B2-9ACA-15DBBDFBCF8C', // My Team/Group Name form
    //'http://openrosa.org/formdesigner/D771417E-354E-4906-A686-DF0BA230F16A', // Register Participant form
    // 'http://openrosa.org/formdesigner/2B9F69A2-7E51-49F6-9FF9-F72F3EC14A9E', // Register Participant skillz
    // 'http://openrosa.org/formdesigner/304CABA9-C8A8-4360-83C6-5E2EC1D2C2AC', // Intervention notes
    //'http://openrosa.org/formdesigner/56DB98AC-67EC-4BBA-91FC-9443E84E43CE', //PHQ9
    // 'http://openrosa.org/formdesigner/5E2E3990-2C3C-42F5-BE0B-922ED29939C4', // ART Adherence Self-Reporting Tool
    // 'http://openrosa.org/formdesigner/4CFAC371-88F7-4349-BEB2-3DA2BDE445EA', //Malaria Testing Event Snapshot
    // 'http://openrosa.org/formdesigner/FAF8F169-0FF1-4DE4-98B7-E4450BECBC84', //Malaria Testing Event Statistics
    // 'http://openrosa.org/formdesigner/E31B9126-1DCA-4603-AD57-271A843448B3', //Register Skillz Plus Club
    //'http://openrosa.org/formdesigner/5D8455CE-6044-471D-83BB-131A3D52794B', // Service Referral Followup -> confirm services received
    // 'http://openrosa.org/formdesigner/0B3DD3B4-A767-4671-A63C-8A352DAA8E2D', // service referral followup
    //'http://openrosa.org/formdesigner/59E1207B-969F-402D-9EEE-675504036F78', //Home Visit log form
    // 'http://openrosa.org/formdesigner/3B4B1C64-092A-4922-B033-94D80A11D960', // Coach Session Register form
    // 'http://openrosa.org/formdesigner/41DF97A0-0E4B-460D-B983-13D404565009', //HIV Testing Event Snapshot
    // 'http://openrosa.org/formdesigner/EAA0ABBB-C517-4E7F-82A9-5799E944FE52', //HIV Testing Event Statistics
    // 'http://openrosa.org/formdesigner/EA6C0348-91F7-44FC-8786-B34F50B0CB62', //Register Event
    // 'http://openrosa.org/formdesigner/34DD6DFD-13E7-4E19-8A27-F18B6D39E12E', //Attendance
    //'http://openrosa.org/formdesigner/F55C4DF9-0CCD-4AED-A5C4-1E39ED2E45C4', //Attendance skillz plus club
    // 'http://openrosa.org/formdesigner/A3AF9DA6-1D57-46E4-8431-A5C262DC2DBA', // Pre Challenges
    // 'http://openrosa.org/formdesigner/D2F0F23F-9C0E-41E7-9C46-7553F8B5DCC8', // Post Challenges
    //'http://openrosa.org/formdesigner/0DAB6FD9-A7C1-4F56-A1C8-794B7C123F95', // Service Referral
    // 'http://openrosa.org/formdesigner/98041DA3-B37D-4E8E-A9B9-29EDC036A46A', // Aggregate Service Referrals
    // 'http://openrosa.org/formdesigner/50A337EB-FBD8-4607-A664-21AAE51DFCD1', // Coach Support Visit form
    // 'http://openrosa.org/formdesigner/AA396157-EBF9-4B51-B25A-D5BDA4F3DF73', // Coach Support Visit form Zambia
    // 'http://openrosa.org/formdesigner/3FFDCE4F-35A9-4FA9-971F-EFFDC94E597F', //Risk & vulnerability assessment
    //'http://openrosa.org/formdesigner/3DAF13EC-FA77-4480-8946-667D841B439A', //risk & vulnerability assessment | new Referrals
    ];

    // const forms = objects.filter(obj => xmlnsList.includes(obj.form['@xmlns']));
    const forms = objects;

    state.configuration = { baseUrl: 'https://www.openfn.org' };
    console.log('Posting form submissions to OpenFn Inbox...');

    return each(forms, state => {
    return post(`/inbox/${openfnInboxUrl}`, { body: state.data }, state => ({
    ...state,
    data: {},
    references: [],
    }))(state);
    })(state);
    return state;
    }
    );
    //ALL form xmlns codes
    //xmlns: 'http://openrosa.org/formdesigner/D50A9A33-B1B4-41B2-9ACA-15DBBDFBCF8C', // My Team/Group Name form
    //xmlns: 'http://openrosa.org/formdesigner/D771417E-354E-4906-A686-DF0BA230F16A', // Register Participant form
    //xmlns: 'http://openrosa.org/formdesigner/2B9F69A2-7E51-49F6-9FF9-F72F3EC14A9E', // Register Participant skillz
    //xmlns: 'http://openrosa.org/formdesigner/304CABA9-C8A8-4360-83C6-5E2EC1D2C2AC', // Intervention notes
    //xmlns: 'http://openrosa.org/formdesigner/304CABA9-C8A8-4360-83C6-5E2EC1D2C2AC', // Intervention Notes form
    //xmlns: 'http://openrosa.org/formdesigner/AA396157-EBF9-4B51-B25A-D5BDA4F3DF73', // Coach Support Visit form Zambia
    //xmlns: 'http://openrosa.org/formdesigner/50A337EB-FBD8-4607-A664-21AAE51DFCD1', // Coach Support Visit form
    //xmlns: 'http://openrosa.org/formdesigner/3B4B1C64-092A-4922-B033-94D80A11D960', // Coach Session Register form
    //xmlns: 'http://openrosa.org/formdesigner/34DD6DFD-13E7-4E19-8A27-F18B6D39E12E', //Attendance
    //xmlns: 'http://openrosa.org/formdesigner/4CFAC371-88F7-4349-BEB2-3DA2BDE445EA', //Malaria Testing Event Snapshot
    //xmlns: 'http://openrosa.org/formdesigner/59E1207B-969F-402D-9EEE-675504036F78', //Home Visit log form
    //xmlns: 'http://openrosa.org/formdesigner/41DF97A0-0E4B-460D-B983-13D404565009', //HIV Testing Event Snapshot
    //xmlns: 'http://openrosa.org/formdesigner/551BCED9-077B-40EE-849D-0416756B9A75', // PHQ9
    //xmlns: 'http://openrosa.org/formdesigner/0DAB6FD9-A7C1-4F56-A1C8-794B7C123F95', // Service Referral
    //xmlns: 'http://openrosa.org/formdesigner/0B3DD3B4-A767-4671-A63C-8A352DAA8E2D', // Service Referral Followup
    //xmlns: 'http://openrosa.org/formdesigner/98041DA3-B37D-4E8E-A9B9-29EDC036A46A', // Aggregate Service Referrals
    //xmlns: 'http://openrosa.org/formdesigner/5E2E3990-2C3C-42F5-BE0B-922ED29939C4', // ART Adherence Self-Reporting Tool
    //xmlns: 'http://openrosa.org/formdesigner/A3AF9DA6-1D57-46E4-8431-A5C262DC2DBA', // Pre Challenges
    //xmlns: 'http://openrosa.org/formdesigner/D2F0F23F-9C0E-41E7-9C46-7553F8B5DCC8', // Post Challenges
    //xmlns: 'http://openrosa.org/formdesigner/FAF8F169-0FF1-4DE4-98B7-E4450BECBC84', // Malaria Testing Event Statistics
    //xmlns: 'http://openrosa.org/formdesigner/EA6C0348-91F7-44FC-8786-B34F50B0CB62', //Register Event
    //xmlns: 'http://openrosa.org/formdesigner/EAA0ABBB-C517-4E7F-82A9-5799E944FE52', //HIV Testing Event Statistics

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/1-Get-data-from-SLUHIS-2023-03-08.html b/adaptors/library/jobs/auto/1-Get-data-from-SLUHIS-2023-03-08.html index 0802010c025a..cfabc1b99fd4 100644 --- a/adaptors/library/jobs/auto/1-Get-data-from-SLUHIS-2023-03-08.html +++ b/adaptors/library/jobs/auto/1-Get-data-from-SLUHIS-2023-03-08.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/2-SMS-Balance-Update-to-Customer-2018-12-14.html b/adaptors/library/jobs/auto/2-SMS-Balance-Update-to-Customer-2018-12-14.html index 7a8e7380f957..0ebc40819353 100644 --- a/adaptors/library/jobs/auto/2-SMS-Balance-Update-to-Customer-2018-12-14.html +++ b/adaptors/library/jobs/auto/2-SMS-Balance-Update-to-Customer-2018-12-14.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    2. SMS Balance Update to Customer

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields, send

    Expression

    send(
    fields(
    field('to_number',
    dataValue('Envelope.Body.notification.Phone_Number__c')
    ),
    field('message_type', 'sms'),
    field('route_id', 'PN5d224d8136086997'),
    field('content',
    'Payment successful! Your updated contract balance is '
    + state.data.Envelope.Body.notification.AmountDue__c
    )
    )
    );
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Add-DHIS2-Data-Value-Sets-2016-03-28.html b/adaptors/library/jobs/auto/Add-DHIS2-Data-Value-Sets-2016-03-28.html index 80bb2d4d3fdb..a20700a7170f 100644 --- a/adaptors/library/jobs/auto/Add-DHIS2-Data-Value-Sets-2016-03-28.html +++ b/adaptors/library/jobs/auto/Add-DHIS2-Data-Value-Sets-2016-03-28.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Add DHIS2 Data Value Sets

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: Add DHIS2 Data Value Sets
    • Adaptor: @openfn/language-dhis2
    • Adaptor Version: v0.1.0
    • Created almost 9 years ago
    • Updated over 7 years ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    dataPath, dataValue, each, field, fields

    Expression

    each(
    dataPath("data[*]"),
    // Use our system specific helper functions...
    dataValueSet(
    fields(
    field("dataSet", "pBOMPrpg1QX"),
    field("orgUnit", "DiszpKrYNg8"),
    field("period", "201401"),
    field("completeData", dataValue("today")),
    field("dataValues", function(state) {
    // Or write your own JS...
    console.log("Do anything you want in here.");
    return [
    dataElement("qrur9Dvnyt5", state.data.site_school_number),
    dataElement("oZg33kd9taw", state.data.light_source),
    dataElement("msodh3rEMJa", state.data.number_of_children)
    ];
    })
    )
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Asana-test-2024-07-29.html b/adaptors/library/jobs/auto/Asana-test-2024-07-29.html index a7cc8b2687d2..685007364633 100644 --- a/adaptors/library/jobs/auto/Asana-test-2024-07-29.html +++ b/adaptors/library/jobs/auto/Asana-test-2024-07-29.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Attendance-Non-Skillz-2021-06-14.html b/adaptors/library/jobs/auto/Attendance-Non-Skillz-2021-06-14.html index a2bc03c01825..bc842cd7be50 100644 --- a/adaptors/library/jobs/auto/Attendance-Non-Skillz-2021-06-14.html +++ b/adaptors/library/jobs/auto/Attendance-Non-Skillz-2021-06-14.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Attendance Non Skillz

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataPath, dataValue, each, field, fields, lastReferenceValue, map, merge, query, relationship, upsert, Array

    Expression

    fn(state => {
    if (!state.data.form.attendance_list.update_participant_cases.item) {
    console.log('No participant attendance data was provided, not upserting to Salesforce.');
    return state;
    } else {
    // query(
    // `SELECT Id, Name, CommCare_Ext_ID__c FROM Event__c WHERE CommCare_Case_ID__c = '${state.data.form.attendance_list.update_participant_cases.item[0]['@id']}'`
    // );

    // fn(state => {
    const records = lastReferenceValue('records')(state);
    const eventName = lastReferenceValue('records[0].CommCare_Ext_ID__c')(state);

    // if (!eventName) {
    // console.log(
    // `Participant not found with CommCare_Case_ID__c: ${state.data.form.attendance_list.update_participant_cases.item[0]['@id']}`
    // );
    // return state;
    // }

    return execute(
    fn(state => {
    // Note: lastReferenceValue selects the first item in the references array.
    state.data.eventName = eventName ? eventName.replace(/\//gi, '') : null;

    function getSessionValue(present) {
    switch (present.toString().toLowerCase()) {
    case 'yes':
    return 'X';
    case 'no':
    return 'A';
    case '':
    return 'N';
    default:
    return 'U';
    }
    }

    function getSessionId(session_text) {
    return session_text.toString().trim().slice(0, session_text.indexOf(' ')).slice(1);
    }

    function objectToArray(object) {
    if (!object) return [];
    return !Array.isArray(object) ? [object] : object;
    }

    state.data.form.attendance_list.update_participant_cases.item = objectToArray(
    state.data.form.attendance_list.update_participant_cases.item
    );

    //When GRS enters session names incorrectly in CommCare (e.g., session: "P8 // My body is mine)
    function findPValue(input) {
    // Regular expression to match "P" followed by one or more digits, then "//"
    const regex = /P(\d+)\s*\/\//;

    // Match the input against the regex
    const match = input.match(regex);

    // If a match is found, return the captured digits as an integer
    if (match) {
    return parseInt(match[1], 10);
    } else {
    // If no match is found, return null or handle as needed
    return 'Session_not_found';
    }
    }

    const sessionText = dataValue('form.attendance_list.session')(state);
    const sessionId = sessionText.includes('//') ? findPValue(sessionText) : getSessionId(sessionText);

    console.log('sessionText:: ', sessionText);
    console.log('sessionId:: ', sessionText);

    const sessionDate = dataValue("form.case['@date_modified']")(state);

    state.data.form.attendance_list.update_participant_cases.item =
    state.data.form.attendance_list.update_participant_cases.item.map(item => {
    const sessionValue = getSessionValue(item.attendance_session);
    return {
    ...item,
    dynamicFields: {
    [`Session_${sessionId}__c`]: sessionValue,
    [`Session_${sessionId}_Date__c`]: sessionDate,
    },
    };
    });

    return state;
    }),

    each(
    merge(
    dataPath('form.attendance_list.update_participant_cases.item[*]'),
    fields(
    field('intervention_name', dataValue('form.intervention_name')),
    field('eventName', dataValue('eventName')),
    field('caseid', dataValue('form.case.@case_id'))
    )
    ),
    upsert('Attendance__c', 'CommCare_Ext_ID__c', state => ({
    ...fields(
    relationship('Event__r', 'CommCare_Case_ID__c', dataValue('caseid')),
    field(
    'CommCare_Ext_ID__c',
    state => `${state.data['@id']}-${toUTF8(state.data.intervention_name)}`
    ),
    relationship('Person_Attendance__r', 'Participant_Identification_Number_PID__c', dataValue('@id'))
    ),
    ...state.data.dynamicFields,
    }))
    )
    )(state);
    }
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/CHW-case-to-DHIS2-2023-04-27.html b/adaptors/library/jobs/auto/CHW-case-to-DHIS2-2023-04-27.html index 3b22fe2e7574..47c2fe5198f5 100644 --- a/adaptors/library/jobs/auto/CHW-case-to-DHIS2-2023-04-27.html +++ b/adaptors/library/jobs/auto/CHW-case-to-DHIS2-2023-04-27.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    CHW case to DHIS2

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    create, dataValue

    Expression

    create('trackedEntityInstances', {
    trackedEntityType: 'nEenWmSyUEp', // a person
    orgUnit: 'DiszpKrYNg8',
    attributes: [
    {
    attribute: 'w75KJ2mc4zz', // attribute id for first name
    value: dataValue('case.firstName')(state) // data from submission
    },
    {
    attribute: 'zDhUuAYrxNC', // attribute id for last name
    value: dataValue('case.lastName')(state) // data from another submission field
    }
    ]
    });
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Catch-Error-in-HTTP-Request-2016-08-26.html b/adaptors/library/jobs/auto/Catch-Error-in-HTTP-Request-2016-08-26.html index 95a6a1721967..b659d2f85180 100644 --- a/adaptors/library/jobs/auto/Catch-Error-in-HTTP-Request-2016-08-26.html +++ b/adaptors/library/jobs/auto/Catch-Error-in-HTTP-Request-2016-08-26.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Catch Error in HTTP Request

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: Catch Error in HTTP Request
    • Adaptor: @openfn/language-http
    • Adaptor Version: latest
    • Created over 8 years ago
    • Updated over 2 years ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    get, JSON

    Expression

    get(
    'https://jsonplaceholder.typicode.com/wrongUrl', // the url
    {
    transformResponse: [
    data => {
    console.log("The data from the response, BEFORE the error is thrown");
    console.log(JSON.stringify(data, null, 2))
    return data;
    }
    ],
    }, // no additional options
    state => { // the callback
    console.log('the data', state.data)
    return state;
    }
    );
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Coach-Session-Register-2021-05-03.html b/adaptors/library/jobs/auto/Coach-Session-Register-2021-05-03.html index 533b395827d9..c8ecf7cb2ad7 100644 --- a/adaptors/library/jobs/auto/Coach-Session-Register-2021-05-03.html +++ b/adaptors/library/jobs/auto/Coach-Session-Register-2021-05-03.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Coach Session Register

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, each, field, fields, query, relationship, upsert

    Expression

    // push to production
    query(
    `SELECT Coach_A__c, Coach_A__r.Name from Event__c where CommCare_Case_ID__c = '${state.data.form.case['@case_id']}'`
    );

    fn(state => {
    const present = dataValue('form.present')(state).toLowerCase();

    function getSessionValue() {
    let value;
    switch (present) {
    case 'yes':
    value = 'X';
    break;
    case 'no':
    value = 'A';
    break;
    case '':
    value = 'N';
    break;
    default:
    value = 'U';
    break;
    }
    return value;
    }

    const session_text = dataValue('form.session')(state);

    const session_id = session_text.trim().slice(0, session_text.indexOf(' ')).slice(1);
    console.log("session_id: ", session_id);

    const coachname = dataValue('form.coach_name')(state)
    ? dataValue('form.coach_name')(state)
    : state.references[0].records[0].Coach_A__r.Name;

    let external_id = `${dataValue('form.case.@case_id')(state)}
    ${coachname}`; //case_id + coach_name for external Id

    state.data.commcare_external_id = external_id.toLowerCase().replace(/\s/g, '').trim();

    state.data.dynamicFields = [
    field(`Session_${session_id}__c`, getSessionValue()),
    field(`Session_${session_id}_Date__c`, dataValue('form.date')(state)),
    //field(`Session_${session_id}_Duration__c`, dataValue('form.duration')(state)), //NOTE: Duration fields don't exist in SF?
    ];

    state.data.durationFields = [field(`Session_${session_id}_Duration__c`, dataValue('form.duration')(state))];
    console.log(state.data.durationFields);

    return state;
    });

    upsert('Event__c', 'CommCare_Case_ID__c', state => ({
    ...fields(field('CommCare_Case_ID__c', dataValue('form.case.@case_id'))),
    ...fields(...state.data.durationFields),
    }));

    query(
    `SELECT Coach_A__c, Coach_A__r.CommCare_Ext_ID__c from Event__c where CommCare_Case_ID__c = '${state.data.form.case['@case_id']}'`
    );

    fn(state => {
    const coaches = dataValue('form.coach_name')(state).split(' ');
    const dynamicFields = state.data.dynamicFields;
    const commcare_external_id = state.data.commcare_external_id;
    const caseid = state.data.form.case['@case_id'];
    return each(
    coaches,
    upsert('Attendance__c', 'CommCare_Ext_ID__c', state => ({
    ...fields(
    //relationship('RecordType', 'Name', 'Coach Development'),
    field('RecordTypeId', '012500000009jqaAAA'),
    relationship('Event__r', 'CommCare_Case_ID__c', caseid),
    relationship('Person_Attendance__r', 'CommCare_Ext_ID__c', state => {
    const coach_name = state.data;
    return coach_name;
    }),
    field('CommCare_Ext_ID__c', commcare_external_id)
    ),
    ...fields(...dynamicFields),
    }))
    )(state);
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/CommCare-FHIR.html b/adaptors/library/jobs/auto/CommCare-FHIR.html index 37f4847d3580..0153f6a873c7 100644 --- a/adaptors/library/jobs/auto/CommCare-FHIR.html +++ b/adaptors/library/jobs/auto/CommCare-FHIR.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Create encounter in OpenHIM

    📜 This job is an official example from OpenFn.

    Metadata

    Key Functions

    dataValue, field, fields

    Expression

    // CommCare form submission mapped to the FHIR patient encounter standard,
    // submitted by Simon Kelly @ Dimagi.
    encounter(
    fields(
    field('resourceType', 'Encounter'),
    field('status', 'finished'),
    field('type', function (state) {
    return [
    {
    coding: [
    {
    system: 'momconnect:type',
    code: '8',
    },
    ],
    },
    ];
    }),
    field('contained', function (state) {
    return [
    {
    resourceType: 'Patient',
    id: 'patient',
    identifier: [
    {
    use: 'official',
    system: 'momconnect:sanid',
    value: dataValue('properties.id_number')(state),
    },
    ],
    name: [
    {
    use: 'official',
    family: [dataValue('properties.family_name')(state)],
    given: [dataValue('properties.given_name')(state)],
    text: dataValue('properties.given_name')(state).concat(
    ' ',
    dataValue('properties.family_name')(state)
    ),
    },
    ],
    gender: 'female',
    birthDate: dataValue('properties.dob')(state),
    telecom: [
    {
    system: 'phone',
    value: dataValue('properties.msisdn')(state),
    },
    ],
    communication: [
    {
    language: {
    coding: [
    {
    system: 'urn:ietf:bcp:47',
    code: dataValue('properties.language_code')(state),
    },
    ],
    },
    preferred: true,
    },
    ],
    },
    {
    resourceType: 'Observation',
    id: 'edd',
    code: {
    coding: [
    {
    system: 'http://loinc.org',
    code: '11778-8',
    display: 'Delivery date Estimated',
    },
    ],
    },
    valueDateTime: dataValue('properties.edd')(state),
    status: 'preliminary',
    },
    ];
    }),
    field('patient', function (state) {
    return {
    reference: '#patient',
    };
    }),
    field('period', function (state) {
    return {
    start: dataValue('properties.visit_date')(state),
    };
    }),
    field('extension', function (state) {
    return [
    {
    url: 'momconnect:mha',
    valueInteger: 2,
    },
    {
    url: 'momconnect:swt',
    valueInteger: 3,
    },
    {
    url: 'momconnect:dmsisdn',
    valueString: '+27831111111',
    },
    ];
    })
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/CommCare-to-Azure-Sql-2020-01-27.html b/adaptors/library/jobs/auto/CommCare-to-Azure-Sql-2020-01-27.html index 29ed3f739043..ed74be6207e7 100644 --- a/adaptors/library/jobs/auto/CommCare-to-Azure-Sql-2020-01-27.html +++ b/adaptors/library/jobs/auto/CommCare-to-Azure-Sql-2020-01-27.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    CommCare to Azure Sql

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    alterState, join, map, sql

    Expression

    // Insert household, fail on duplicate (consider upsert strategy, if you want!)
    sql({
    query:
    'INSERT INTO Household (' +
    [
    'commcare_id',
    'is_head',
    'total_members',
    'head_name',
    'date_registered',
    'village',
    'new_thing',
    ].join(', ') +
    `) VALUES ('` +
    [
    state.data.metadata.instanceID,
    state.data.form.head_of_household === 'yes' ? 1 : 0,
    state.data.form.hh_members,
    state.data.form.individual_name,
    state.data.form.registration_date,
    state.data.form.village_name,
    state.data.form.new_q,
    ].join(`', '`) +
    `');`,
    });

    // Prepare a string to be used for VALUES (...) in our member insert.
    alterState(state => {
    const data = state.references[0];
    const form = data.form;
    const parentId = data.metadata.instanceID;
    const memArr = form.register_hh_members.map((m, i) => {
    return `('${parentId}-${i}', '${parentId}', '${m.hh_member_name}', '${m.age}')`;
    });

    state.members = memArr.join(', ');
    return state;
    });

    // Insert members, fail on duplicate
    sql({
    query: state =>
    `INSERT INTO HouseholdMember (commcare_id, parent, name, age) VALUES ${state.members}`,
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Create-Intervention-2021-04-08.html b/adaptors/library/jobs/auto/Create-Intervention-2021-04-08.html index 81d9c4782930..a29a69855e80 100644 --- a/adaptors/library/jobs/auto/Create-Intervention-2021-04-08.html +++ b/adaptors/library/jobs/auto/Create-Intervention-2021-04-08.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Create Intervention

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    alterState, dataValue, field, fields, join, map, relationship, upsert

    Expression

    alterState((state) => {

    function clean(str) {
    if (!!str)
    return str
    .split('_')
    .map(word => {
    let new_word = word.toString().toLowerCase();
    return new_word.slice(0, 1).toUpperCase() + new_word.slice(1);
    })
    .join(' ');
    }

    state.data.form.delivery_method = clean(state.data.form.delivery_method);

    const coachFieldNames = ['Coach_A__r','Coach_B__r','Coach_C__r','Coach_D__r']

    state.data.destinationCoachFields = state.data.form.coaches
    .split(' ')
    .reduce(
    (accumulator, currentValue, currentIndex) => [
    ...accumulator,
    (currentIndex < coachFieldNames.length && !!currentValue
    ? relationship(coachFieldNames[currentIndex], 'CommCare_Ext_ID__c', currentValue)
    : []),
    ],
    []
    );

    return state;
    });

    upsert(
    'Event__c',
    'CommCare_Case_ID__c',
    state=>({
    ...fields(
    field('Name', dataValue('form.name_of_intervention')),
    field('CommCare_Ext_ID__c', state => {
    return dataValue('form.name_of_intervention')(state).replace(/\//gi, '');
    }),
    field('CommCare_Case_ID__c', dataValue('form.case.@case_id')),
    relationship('RecordType', 'Name', 'Intervention'),
    field('Business_Unit__c', state => {
    const bu = dataValue('form.business_unit')(state);
    return bu==='65680f0c4c144b03ad0f86bdc46c1ebc' ? 'GRS Zambia' :
    bu==='04d98397e28046118fade28ced6b65cb' ? 'GRS Zimbabwe' :
    bu==='ed125ab19ec34aacab79585e59eb76f4' ? 'GRS Partnerships': undefined ;
    }),
    relationship(
    'Site__r',
    'CommCare_Ext_ID__c',
    dataValue('form.site')
    ),
    relationship(
    'Venue__r',
    'CommCare_Ext_ID__c',
    dataValue('form.Venue')

    ),
    relationship(
    'Curriculum__r',
    'CommCare_Ext_ID__c',
    dataValue('form.curriculum_selection.curriculum')
    ),
    // relationship(
    // 'Grant__r',
    // 'CommCare_Ext_ID__c',
    // dataValue('form.grant')
    // ),
    field('Delivery_Method__c', dataValue('form.delivery_method')),
    field('Class_Group_Team__c', dataValue('form.class_grade')),
    field('Pre_Post_Administered__c', dataValue('form.prepost_administered')),
    field('Start_Date__c', dataValue('form.intervention_dates.start_date')),
    field('End_Date__c', dataValue('form.intervention_dates.end_date'))
    ),
    ...fields(...state.data.destinationCoachFields)
    })
    );
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Create-Patient-in-OpenMRS-2019-10-24.html b/adaptors/library/jobs/auto/Create-Patient-in-OpenMRS-2019-10-24.html index efce6f70fff3..69207673f1e0 100644 --- a/adaptors/library/jobs/auto/Create-Patient-in-OpenMRS-2019-10-24.html +++ b/adaptors/library/jobs/auto/Create-Patient-in-OpenMRS-2019-10-24.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Create Patient in OpenMRS

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields

    Expression

    //Job to create patient in OpenMRS 
    patient(
    fields(
    field("gender", dataValue("form.gender")), //map values from CommCare forms
    field("names", function(state) {
    return [{
    "patient_id": dataValue("form.case.@case_id")(state),
    "creator": dataValue("form.user")(state)
    }]
    })
    )
    )





    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Create-Person-in-OpenMRS-2016-02-12.html b/adaptors/library/jobs/auto/Create-Person-in-OpenMRS-2016-02-12.html index dc00b84978f5..91ee77204202 100644 --- a/adaptors/library/jobs/auto/Create-Person-in-OpenMRS-2016-02-12.html +++ b/adaptors/library/jobs/auto/Create-Person-in-OpenMRS-2016-02-12.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Create Person in OpenMRS

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields

    Expression

    person(
    fields(
    field("gender", "M"),
    field("names", function(state) {
    return [{
    "givenName": dataValue("form.first_name")(state),
    "familyName": "Sports_Music_Field_Day"
    }]
    })
    )
    )
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Create-Person-in-SF-2019-02-25.html b/adaptors/library/jobs/auto/Create-Person-in-SF-2019-02-25.html index 81d5c3415a6a..88dc2620a6d9 100644 --- a/adaptors/library/jobs/auto/Create-Person-in-SF-2019-02-25.html +++ b/adaptors/library/jobs/auto/Create-Person-in-SF-2019-02-25.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Create Person in SF

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields, humanProper, relationship, upsert

    Expression

    upsert("Patient__c", "CommCare_Case_ID__c", fields(
    field('CommCare_Case_ID__c', dataValue("form.case.@case_id")),
    relationship('Clinic__r', 'Location_ID__c', dataValue('form.case.create.owner_id')),
    field('First_Name__c', humanProper(state.data.form.case.update.patient_first_name)),
    field('Last_Name__c', humanProper(state.data.form.case.update.patient_last_name)),
    field('Patient_ID__c', dataValue('form.case.update.patient_id')),
    field('Age_Months_Started_Treatment__c', dataValue('form.case.update.age_months_start_treatment_rounded')),
    field('Registration_Date__c', (state) => {
    const validDate = state.data.form.case.update.registration_date
    return ( validDate ? new Date(validDate).toISOString() : null )
    })
    ))
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Create-SMS-Linked-to-Contact-in-SF.html b/adaptors/library/jobs/auto/Create-SMS-Linked-to-Contact-in-SF.html index 87dae7903ec8..ab0fdbf24264 100644 --- a/adaptors/library/jobs/auto/Create-SMS-Linked-to-Contact-in-SF.html +++ b/adaptors/library/jobs/auto/Create-SMS-Linked-to-Contact-in-SF.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Create SMS linked to contact

    📜 This job is an official example from OpenFn.

    Metadata

    Key Functions

    create, dataValue, field, fields, relationship

    Expression

    create(
    'SMS__c',
    fields(
    field('text__c', dataValue('message_text')),
    relationship(
    'Contact__r',
    'Contact_Phone_Number__c',
    dataValue('from_number')
    ),
    field('date__c', dataValue('date'))
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Create-TEI-dhis2-2021-03-22.html b/adaptors/library/jobs/auto/Create-TEI-dhis2-2021-03-22.html index e7a77a25fe5f..74d5ffdd2999 100644 --- a/adaptors/library/jobs/auto/Create-TEI-dhis2-2021-03-22.html +++ b/adaptors/library/jobs/auto/Create-TEI-dhis2-2021-03-22.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Create TEI (dhis2)

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    create, dataValue

    Expression

    create('trackedEntityInstances', {
    orgUnit: 'g8upMTyEZGZ',
    trackedEntityType: 'nEenWmSyUEp',
    program: 'IpHINAT79UW',
    attributes: [
    { attribute: 'zDhUuAYrxNC', value: dataValue('body.Patient_name') },
    { attribute: 'w75KJ2mc4zz', value: dataValue('body.Last_Name_of_Patient') },
    ],
    enrollments: [
    {
    orgUnit: 'g8upMTyEZGZ',
    program: 'IpHINAT79UW',
    programState: 'oRySG82BKE6', // active
    enrollmentDate: dataValue('body.Date'),
    incidentDate: dataValue('body.Date'),
    },
    ],
    });
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Create-contact-2021-03-01.html b/adaptors/library/jobs/auto/Create-contact-2021-03-01.html index cddd028275c7..2584d89cf7b9 100644 --- a/adaptors/library/jobs/auto/Create-contact-2021-03-01.html +++ b/adaptors/library/jobs/auto/Create-contact-2021-03-01.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Create contact

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    create, dataValue

    Expression

    create('Contact', {
    FirstName: dataValue("body.Patient_name"),
    LastName: dataValue('body.Last_Name_of_Patient'),
    Age__c: dataValue("body.Age"),
    Sex__c: dataValue('body.Sex'),
    Case_ID__c: dataValue("body.National_ID"),
    Comments__c: dataValue("body.Comments")
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/DHIS2-DataValues-API.html b/adaptors/library/jobs/auto/DHIS2-DataValues-API.html index 3746d10fde19..d8601a34f91d 100644 --- a/adaptors/library/jobs/auto/DHIS2-DataValues-API.html +++ b/adaptors/library/jobs/auto/DHIS2-DataValues-API.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Create data values

    📜 This job is an official example from OpenFn.

    Metadata

    Key Functions

    create

    Expression

    // ----
    // Add data to data value sets in DHIS2 using a generic JSON message, submitted
    // by Taylor Downs @ OpenFn. Co-authored by @mtuchi
    // ---

    create('dataValueSets', {
    dataSet: 'pBOMPrpg1QX',
    completeDate: $.form.date,
    period: '201401',
    orgUnit: 'DiszpKrYNg8',
    dataValues: [
    {
    dataElement: 'f7n9E0hX8qk',
    value: $.form.prop_a,
    },
    {
    dataElement: 'Ix2HsbDMLea',
    value: $.form.prop_b,
    },
    {
    dataElement: 'eY5ehpbEsB7',
    value: $.form.prop_c,
    },
    ],
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/DHIS2-Events-2016-01-27.html b/adaptors/library/jobs/auto/DHIS2-Events-2016-01-27.html index 094986cac64f..d72b93031d99 100644 --- a/adaptors/library/jobs/auto/DHIS2-Events-2016-01-27.html +++ b/adaptors/library/jobs/auto/DHIS2-Events-2016-01-27.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    DHIS2 Events

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    create, dataValue, Math

    Expression

    create('trackedEntityInstances', {
    orgUnit: 'DiszpKrYNg8',
    trackedEntityType: 'Zy2SEgA61ys',
    attributes: [
    {
    attribute: 'flGbXLXCrEo', // system case ID
    value: Math.random(),
    },
    ],
    });

    // create('trackedEntityInstances', {
    // trackedEntityType: 'nEenWmSyUEp', // a person
    // orgUnit: 'g8upMTyEZGZ', // Njandama MCHP
    // attributes: [
    // {
    // attribute: 'w75KJ2mc4zz', // attribute id for first name
    // value: dataValue('case.firstName')(state), // data from submission
    // },
    // {
    // attribute: 'zDhUuAYrxNC', // attribute id for last name
    // value: dataValue('case.lastName')(state), // data from another submission field
    // },
    // ],
    // enrollments: [
    // {
    // orgUnit: 'g8upMTyEZGZ', // Njandama MCHP
    // program: 'IpHINAT79UW', // enroll in Child Program
    // enrollmentDate: new Date().toISOString().slice(0, 10), // some custom javascript
    // incidentDate: state.data.metadata.timeStart.slice(0, 10), // more custom javascript
    // },
    // ],
    // });
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/DHIS2-Events-API.html b/adaptors/library/jobs/auto/DHIS2-Events-API.html index a57f6881d695..8aefc697f431 100644 --- a/adaptors/library/jobs/auto/DHIS2-Events-API.html +++ b/adaptors/library/jobs/auto/DHIS2-Events-API.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Create new events

    📜 This job is an official example from OpenFn.

    Metadata

    Key Functions

    create

    Expression

    // ----
    // Create new events in DHIS2 using a generic JSON message, submitted by
    // Taylor Downs @ OpenFn, Co-authored by @mtuchi
    // ---

    create('events', {
    program: 'eBAyeGv0exc',
    orgUnit: 'DiszpKrYNg8',
    occurredAt: $.meta.date,
    status: 'COMPLETED',
    storedBy: 'admin',
    geometry: {
    type: 'POINT',
    coordinates: [59.8, 10.9],
    },
    dataValues: [
    {
    dataElement: 'qrur9Dvnyt5',
    value: $.form.prop_a,
    },
    {
    dataElement: 'oZg33kd9taw',
    value: $.form.prop_b,
    },
    {
    dataElement: 'msodh3rEMJa',
    value: $.form.prop_c,
    },
    ],
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Extract-Vitas-Data-2021-05-11.html b/adaptors/library/jobs/auto/Extract-Vitas-Data-2021-05-11.html index f170d6fd8479..2b2da05d0eab 100644 --- a/adaptors/library/jobs/auto/Extract-Vitas-Data-2021-05-11.html +++ b/adaptors/library/jobs/auto/Extract-Vitas-Data-2021-05-11.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Failed-Payment-Notification-2021-04-23.html b/adaptors/library/jobs/auto/Failed-Payment-Notification-2021-04-23.html index 864e4dcb2c13..a25aee4e770a 100644 --- a/adaptors/library/jobs/auto/Failed-Payment-Notification-2021-04-23.html +++ b/adaptors/library/jobs/auto/Failed-Payment-Notification-2021-04-23.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Failed Payment Notification

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: Failed Payment Notification
    • Adaptor: @openfn/language-http
    • Adaptor Version: v3.1.7
    • Created almost 4 years ago
    • Updated almost 4 years ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    alterState

    Expression

    alterState(state => {
    console.log("We have notified the administrator to manually initiate payment.");
    console.log("We have notified the CHW that payment is pending.");
    return state;
    })
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Fetch-Claims-2023-07-17.html b/adaptors/library/jobs/auto/Fetch-Claims-2023-07-17.html index 2595d3d3a3c2..93fc89f01f1e 100644 --- a/adaptors/library/jobs/auto/Fetch-Claims-2023-07-17.html +++ b/adaptors/library/jobs/auto/Fetch-Claims-2023-07-17.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Fetch Claims

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    create, get, map, JSON

    Expression

    // establish a baseline for the cursor
    fn(state => {
    const today = new Date().toISOString().split('T')[0];
    console.log(
    `Fetching all claims updated on or after ${state.cursor || '2023-07-19'}`
    );
    return { ...state, today };
    });

    // Get claims and related patients from HAPI, updated since cursor date
    get(
    'Claim',
    {
    query: {
    _lastUpdated: `ge${state.cursor || '2023-07-19'}`,
    _include: 'Claim:patient',
    _sort: '-_lastUpdated',
    _count: 200,
    },
    },
    next => {
    if (next.data.total == 0)
    return { ...next, data: { claims: [], patients: [] } };

    const byType = next.data.entry.reduce((r, a) => {
    r[a.resource.resourceType] = r[a.resource.resourceType] || [];
    r[a.resource.resourceType].push(a);
    return r;
    }, Object.create(null));

    return {
    ...next,
    data: {
    claims: byType.Claim,
    patients: byType.Patient,
    },
    };
    }
    );

    // clean and merge data
    fn(state => {
    const { claims, patients } = state.data;

    // Noisy logs to help debug data quality issues
    claims.forEach(c => {
    const { resource } = c;
    if (!resource.id) console.log('claim', resource.id, 'has no id');
    if (!resource.item) {
    console.log('claim', resource.id, 'has no item');
    } else if (!resource.item[0].productOrService.coding) {
    console.log('claim', resource.id, 'has no coding');
    }

    if (!resource.patient.reference.split('/')[1])
    console.log('claim', resource.id, 'has no patient');
    });

    const patientsWithClaims = patients
    // drop all patients without identifiers
    .filter(p => p.resource.identifier)
    .map(p => ({
    ...p,
    claims: claims.filter(c => {
    return (
    // has item
    c.resource.item &&
    // has coding
    c.resource.item[0].productOrService.coding &&
    // for this patient
    p.resource.id == c.resource.patient.reference.split('/')[1]
    );
    }),
    }));

    return { ...state, data: { patientsWithClaims } };
    });

    // print some logs and update the cursor for next time
    fn(state => {
    const { data, today } = state;

    console.log('Found the following patients and claims in FHIR:');
    console.log(
    JSON.stringify(
    data.patientsWithClaims.map(p => ({
    patient: p.resource.id,
    claims: p.claims.map(c => c.resource.id),
    })),
    null,
    2
    )
    );

    return { data: state.data, cursor: today };
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Get-CommCare-Forms-Bulk-Extract-2022-05-16.html b/adaptors/library/jobs/auto/Get-CommCare-Forms-Bulk-Extract-2022-05-16.html index 77fc2ed3123f..793095127d3e 100644 --- a/adaptors/library/jobs/auto/Get-CommCare-Forms-Bulk-Extract-2022-05-16.html +++ b/adaptors/library/jobs/auto/Get-CommCare-Forms-Bulk-Extract-2022-05-16.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Get CommCare Forms (Bulk Extract)

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: Get CommCare Forms (Bulk Extract)
    • Adaptor: @openfn/language-http
    • Adaptor Version: v3.1.7
    • Created over 2 years ago
    • Updated over 2 years ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    each, get, post

    Expression

    // Your job goes here.
    get(
    'https://www.commcarehq.org/a/commcare-demo-2035/api/v0.5/form/',
    {
    query: {
    limit: 1000, //max limit: 1000
    offset: state.meta && state.meta.next ? state.meta.limit + state.meta.offset : 0,
    received_on_start: '2022-05-16',
    received_on_end: '2022-05-18',
    xmlns: 'http://openrosa.org/formdesigner/C87A7E2A-D98D-4E2C-9F0B-997E0AE635C6',
    },
    },
    state => {
    const { meta, objects } = state.data;
    const { openfnInboxUrl } = state.configuration;
    const xmlnsList = [
    'http://openrosa.org/formdesigner/C87A7E2A-D98D-4E2C-9F0B-997E0AE635C6'

    ];

    // const forms = objects.filter(obj => xmlnsList.includes(obj.form['@xmlns']));
    const forms = objects;

    state.configuration = { baseUrl: 'https://www.openfn.org' };
    console.log('Posting form submissions to OpenFn Inbox...');

    return each(forms, state => {
    return post(`/inbox/${openfnInboxUrl}`, { body: state.data }, state => ({
    ...state,
    data: {},
    references: [],
    }))(state);
    })(state);
    }
    );
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Get-cases-from-Primero-2021-09-23.html b/adaptors/library/jobs/auto/Get-cases-from-Primero-2021-09-23.html index 5af1c718670a..81ee7db6d5df 100644 --- a/adaptors/library/jobs/auto/Get-cases-from-Primero-2021-09-23.html +++ b/adaptors/library/jobs/auto/Get-cases-from-Primero-2021-09-23.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Get cases from Primero

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    getCases, JSON

    Expression

    getCases({
    remote: true,
    case_id: "234bbac3-7278-430a-98b5-1abc460671ec" //extract 1 case using case id
    //query: //...or use 'query' to filter by other criteria to get many cases
    }, state => {
    console.log(`Primero cases extracted: ${JSON.stringify(state.data)}`); //logging Primero response
    return { ...state, data: {}, references: [] }
    })
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/HIV-Testing-Event-Snapshot-2021-05-03.html b/adaptors/library/jobs/auto/HIV-Testing-Event-Snapshot-2021-05-03.html index a7f7501124ad..4cb64f949a97 100644 --- a/adaptors/library/jobs/auto/HIV-Testing-Event-Snapshot-2021-05-03.html +++ b/adaptors/library/jobs/auto/HIV-Testing-Event-Snapshot-2021-05-03.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    HIV Testing Event Snapshot

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields, upsert

    Expression

    // push to production
    upsert(
    'Event__c',
    'CommCare_Ext_ID__c',
    fields(
    field('Name', dataValue('form.basic_information.intervention')),
    field('Venue__c', dataValue('form.basic_information.venue')),
    field('Coach_A__c', dataValue('form.hidden_properties.coach_name')),
    field('Date__c', dataValue('form.basic_information.event_date')),
    field('Testing_Partner_Contact_Persion__c', dataValue('form.basic_information.testing_partner__contact_people')),
    field('of_People_in_Attendance_Testing_Events__c', dataValue('form.basic_information.number_in_attendance')),
    field('Event_Type__c', dataValue('form.basic_information.testing_event_type')),
    field('Coordinator__c', dataValue('form.basic_information.event_coordinator')),
    field(
    'What_organization_discussed_VMMC__c',
    dataValue('form.basic_information.question2.what_organisation_discussed_mmc')
    ),
    field(
    'What_organization_s_What_topic_s__c',
    dataValue(
    'form.basic_information.information_sessions_other.what_organisations_delivered_a_session_and_what_was_the_topic_of_the_sessio'
    )
    ),
    field(
    'How_was_the_information_presented__c',
    dataValue('form.basic_information.question2.how_was_this_information_presented_eg_lecture_individua_sessions_etc')
    ),
    field('how_many_people_attended_the_sessions__c', dataValue('form.basic_information.number_in_attendance')),
    field(
    'How_many_people_attended_the_sessions_oh__c',
    dataValue('form.basic_information.question2.approximately_how_many_people_attended_the_sessions_in_total')
    ),
    field(
    'Did_other_organizations_conduct__c',
    dataValue(
    'form.basic_information.information_sessions_other.did_other_organisations_eg_youth-friendly_clinic_ministry_of_health_etc_con'
    )
    ),
    field(
    'Testing_Key_Lesson_s_Learned__c',
    dataValue('form.basic_information.event_overview.highlights_key_challenges')
    ),
    field(
    'X2_Main_challenges__c',
    dataValue(
    'form.basic_information.event_overview.please_describe_highlights_key_challenges_and_main_lessons_learned_from_thi'
    )
    )
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/HIV-Testing-Event-Statistics-2021-05-03.html b/adaptors/library/jobs/auto/HIV-Testing-Event-Statistics-2021-05-03.html index 78447a089dcf..ed7c0d835f7c 100644 --- a/adaptors/library/jobs/auto/HIV-Testing-Event-Statistics-2021-05-03.html +++ b/adaptors/library/jobs/auto/HIV-Testing-Event-Statistics-2021-05-03.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    HIV Testing Event Statistics

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields, upsert

    Expression

    // push to production
    upsert(
    'Event__c',
    'CommCare_Case_ID__c',
    fields(
    field('Name', dataValue('form.event_name')),
    field('CommCare_Case_ID__c', dataValue('form.case.@case_id')),
    field('Tested_Negative_Males_0_9__c', dataValue('form.table_1_testing_results.male_hiv_negative.question2')),
    field('Tested_Negative_Males_10_14__c', dataValue('form.table_1_testing_results.male_hiv_negative.question7')),
    field('Tested_Negative_Males_15_19__c', dataValue('form.table_1_testing_results.male_hiv_negative.question13')),
    field('Tested_Negative_Males_20_24__c', dataValue('form.table_1_testing_results.male_hiv_negative.question18')),
    field('Tested_Negative_Males_25_49__c', dataValue('form.table_1_testing_results.male_hiv_negative.question28')),
    field('Tested_Negative_Males_50__c', dataValue('form.table_1_testing_results.male_hiv_negative.question32')),
    field('Tested_Positive_Males_0_9__c', dataValue('form.table_1_testing_results.question33.question36')),
    field('Tested_Positive_Males_10_14__c', dataValue('form.table_1_testing_results.question33.question41')),
    field('Tested_Positive_Males_15_19__c', dataValue('form.table_1_testing_results.question33.question45')),
    field('Tested_Positive_Males_20_24__c', dataValue('form.table_1_testing_results.question33.question50')),
    field('Tested_Positive_Males_25_49__c', dataValue('form.table_1_testing_results.question33.question56')),
    field('Tested_Positive_Males_50__c', dataValue('form.table_1_testing_results.question33.question60')),
    field('Tested_Negative_Females_0_9__c', dataValue('form.table_1_testing_results.question61.question65')),
    field('Tested_Negative_Females_10_14__c', dataValue('form.table_1_testing_results.question61.question69')),
    field('Tested_Negative_Females_15_19__c', dataValue('form.table_1_testing_results.question61.question73')),
    field('Tested_Negative_Females_20_24__c', dataValue('form.table_1_testing_results.question61.question78')),
    field('Tested_Negative_Females_25_49__c', dataValue('form.table_1_testing_results.question61.question84')),
    field('Tested_Negative_Females_50__c', dataValue('form.table_1_testing_results.question61.question88')),
    field('Tested_Positive_Females_0_9__c', dataValue('form.table_1_testing_results.question89.question92')),
    field('Tested_Positive_Females_10_14__c', dataValue('form.table_1_testing_results.question89.question97')),
    field('Tested_Positive_Females_15_19__c', dataValue('form.table_1_testing_results.question89.question101')),
    field('Tested_Positive_Females_20_24__c', dataValue('form.table_1_testing_results.question89.question106')),
    field('Tested_Positive_Females_25_49__c', dataValue('form.table_1_testing_results.question89.question112')),
    field('Tested_Positive_Females_50__c', dataValue('form.table_1_testing_results.question89.question116')),
    field(
    'Pregnant_Women_Tested_0_9__c',
    dataValue(
    'form.table_3_pregnant_women_tested.enter_the_number_of_pregnant_women_tested_for_each_following_age_group.question120'
    )
    ),
    field(
    'Pregnant_Women_Tested_10_14__c',
    dataValue(
    'form.table_3_pregnant_women_tested.enter_the_number_of_pregnant_women_tested_for_each_following_age_group.question124'
    )
    ),
    field(
    'Pregnant_Women_Tested_15_19__c',
    dataValue(
    'form.table_3_pregnant_women_tested.enter_the_number_of_pregnant_women_tested_for_each_following_age_group.question129'
    )
    ),
    field(
    'Pregnant_Women_Tested_20_24__c',
    dataValue(
    'form.table_3_pregnant_women_tested.enter_the_number_of_pregnant_women_tested_for_each_following_age_group.question134'
    )
    ),
    field(
    'Pregnant_Women_Tested_25_49__c',
    dataValue(
    'form.table_3_pregnant_women_tested.enter_the_number_of_pregnant_women_tested_for_each_following_age_group.question140'
    )
    ),
    field(
    'Pregnant_Women_Tested_50__c',
    dataValue(
    'form.table_3_pregnant_women_tested.enter_the_number_of_pregnant_women_tested_for_each_following_age_group.question144'
    )
    ),
    //field(
    // 'Total_Pregnant_Women_Tested__c',
    // dataValue(
    // 'form.table_3_pregnant_women_tested.enter_the_number_of_pregnant_women_tested_for_each_following_age_group.total_tested_pregnant'
    // )
    //),
    field(
    'First_Time_Females_0_9__c',
    state =>
    dataValue('form.table_4_first_time_testers.question61.question65')(state) +
    dataValue('form.table_4_first_time_testers.question89.question92')(state)
    ),
    field(
    'First_Time_Females_10_14__c',
    state =>
    dataValue('form.table_4_first_time_testers.question61.question69')(state) +
    dataValue('form.table_4_first_time_testers.question89.question97')(state)
    ),
    field(
    'First_Time_Females_15_19__c',
    state =>
    dataValue('form.table_4_first_time_testers.question61.question73')(state) +
    dataValue('form.table_4_first_time_testers.question89.question101')(state)
    ),
    field(
    'First_Time_Females_20_24__c',
    state =>
    dataValue('form.table_4_first_time_testers.question61.question78')(state) +
    dataValue('form.table_4_first_time_testers.question89.question106')(state)
    ),
    field(
    'First_Time_Females_25_49__c',
    state =>
    dataValue('form.table_4_first_time_testers.question61.question84')(state) +
    dataValue('form.table_4_first_time_testers.question89.question112')(state)
    ),
    field(
    'First_Time_Females_50__c',
    state =>
    dataValue('form.table_4_first_time_testers.question61.question88')(state) +
    dataValue('form.table_4_first_time_testers.question89.question116')(state)
    ),
    field(
    'First_Time_Males_0_9__c',
    state =>
    dataValue('form.table_4_first_time_testers.male_hiv_negative.question2')(state) +
    dataValue('form.table_4_first_time_testers.question33.question36')(state)
    ),
    field(
    'First_Time_Males_10_14__c',
    state =>
    dataValue('form.table_4_first_time_testers.male_hiv_negative.question7')(state) +
    dataValue('form.table_4_first_time_testers.question33.question41')(state)
    ),
    field(
    'First_Time_Males_15_19__c',
    state =>
    dataValue('form.table_4_first_time_testers.male_hiv_negative.question13')(state) +
    dataValue('form.table_4_first_time_testers.question33.question45')(state)
    ),
    field(
    'First_Time_Males_20_24__c',
    state =>
    dataValue('form.table_4_first_time_testers.male_hiv_negative.question18')(state) +
    dataValue('form.table_4_first_time_testers.question33.question50')(state)
    ),
    field(
    'First_Time_Males_25_49__c',
    state =>
    dataValue('form.table_4_first_time_testers.male_hiv_negative.question28')(state) +
    dataValue('form.table_4_first_time_testers.question33.question56')(state)
    ),
    field(
    'First_Time_Males_50__c',
    state =>
    dataValue('form.table_4_first_time_testers.male_hiv_negative.question32')(state) +
    dataValue('form.table_4_first_time_testers.question33.question60')(state)
    ),
    field(
    'of_Males_Referred_to_Sexual_Abuse__c',
    dataValue(
    'form.table5_referrals.enter_the_number_of_men_and_women_referred_for_each_referral_tye_and_the_or.abuseviolence_referral'
    )
    ),
    field(
    'of_Males_Referred_to_Family_Referral__c',
    dataValue(
    'form.table5_referrals.enter_the_number_of_men_and_women_referred_for_each_referral_tye_and_the_or.family_planning_referral'
    )
    ),
    field(
    'of_Males_Referred_for_HIV_Positive__c',
    dataValue(
    'form.table5_referrals.enter_the_number_of_men_and_women_referred_for_each_referral_tye_and_the_or.hiv_positive_referral'
    )
    ),
    field(
    'of_Males_Referred_to_MMC_Referral__c',
    dataValue(
    'form.table5_referrals.enter_the_number_of_men_and_women_referred_for_each_referral_tye_and_the_or.medical_male_circumcision_referral'
    )
    ),
    field(
    'of_Males_Referred_to_STI__c',
    dataValue(
    'form.table5_referrals.enter_the_number_of_men_and_women_referred_for_each_referral_tye_and_the_or.sexually_transmitted_infection_sti_referral'
    )
    ),
    field(
    'of_Males_Referred_to_Tuberculosis__c',
    dataValue(
    'form.table5_referrals.enter_the_number_of_men_and_women_referred_for_each_referral_tye_and_the_or.tuberculosis_tb_referral'
    )
    ),
    field(
    'of_Females_Referred_to_Sexual_Abuse__c',
    dataValue('form.table5_referrals.women_referred_number.abuseviolence_referral_women')
    ),
    field(
    'of_Females_Referred_to_Antenatal_Care__c',
    dataValue('form.table5_referrals.women_referred_number.antenatal_care_anc_referral_women')
    ),
    field(
    'of_Females_Referred_to_Family_Referral__c',
    dataValue('form.table5_referrals.women_referred_number.family_planning_referral_women')
    ),
    field(
    'of_Females_Referred_for_HIV_Positive__c',
    dataValue('form.table5_referrals.women_referred_number.hiv_positive_referral_women')
    ),
    field(
    'of_Females_Referred_to_PMTCT__c',
    dataValue('form.table5_referrals.women_referred_number.prevention_of_mother-to-child_transmission_women')
    ),
    field(
    'of_Females_Referred_to_STI__c',
    dataValue('form.table5_referrals.women_referred_number.sexually_transmitted_infection_sti_referral_women')
    ),
    field(
    'of_Females_Referred_to_Tuberculosis__c',
    dataValue('form.table5_referrals.women_referred_number.tuberculosis_tb_referral_women')
    ),

    field('Community_Members__c', dataValue('form.table_2_tested_profile.enter_the_number_tested_for_each_following_profile.community_members')),
    field('GRS_Coaches__c', dataValue('form.table_2_tested_profile.enter_the_number_tested_for_each_following_profile.skillz_coaches')),
    field('GRS_Participants__c', dataValue('form.table_2_tested_profile.enter_the_number_tested_for_each_following_profile.skillz_participants')),
    field('GRS_Staff__c', dataValue('form.table_2_tested_profile.enter_the_number_tested_for_each_following_profile.staff')),
    //field('Total_Tested__c', dataValue('form.table_2_tested_profile.enter_the_number_tested_for_each_following_profile.total_tested')),
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Kobo-to-sheets-2023-10-13.html b/adaptors/library/jobs/auto/Kobo-to-sheets-2023-10-13.html index 9054bd91c129..4e78e48abe83 100644 --- a/adaptors/library/jobs/auto/Kobo-to-sheets-2023-10-13.html +++ b/adaptors/library/jobs/auto/Kobo-to-sheets-2023-10-13.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Kobo to sheets

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    appendValues, dataValue

    Expression

    appendValues({
    spreadsheetId: '13JNoH_nzG4x_mwvW83BMrpTWdKt4asBiZiLfQduB7B0',
    range: 'Sheet1!A1:E1',
    values: [
    [
    dataValue('National_ID'),
    dataValue('First_Name_of_Patient'),
    dataValue('Last_Name_of_Patient'),
    ],
    ],
    });
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Load-to-DB-2022-05-16.html b/adaptors/library/jobs/auto/Load-to-DB-2022-05-16.html index eaf7f3db84f9..36cabfb1fa9d 100644 --- a/adaptors/library/jobs/auto/Load-to-DB-2022-05-16.html +++ b/adaptors/library/jobs/auto/Load-to-DB-2022-05-16.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Load to DB

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, upsert

    Expression

    // Your job goes here.
    upsert('patient', 'ON CONSTRAINT patient_pk', {
    patient_id: dataValue('data.patient_name'),
    patient_name: dataValue('data.patient_name'),
    village_name: dataValue('data.village_name'),
    last_menstrual_period: dataValue('data.last_menstrual_period'),
    expected_delivery_date: dataValue('data.expected_delivery_date'),
    children_alive: dataValue('data.children_alive'),
    living_children: dataValue('data.living_children'),
    feeling_sick: dataValue('data.feeling_sick'),
    total_children: dataValue('data.Total_children'),
    risk_level: dataValue('data.Risk_level')

    });
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Load-to-DHIS2-2023-07-17.html b/adaptors/library/jobs/auto/Load-to-DHIS2-2023-07-17.html index feda344dc676..5d43da82944e 100644 --- a/adaptors/library/jobs/auto/Load-to-DHIS2-2023-07-17.html +++ b/adaptors/library/jobs/auto/Load-to-DHIS2-2023-07-17.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Load to DHIS2

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    create, get, join, map, async

    Expression

    // build and log nested dhis2 records
    fn(state => {
    const { patientsWithClaims } = state.data;
    const today = new Date().toISOString().split('T')[0];

    const teis = patientsWithClaims.map(p => {
    const patient = p.resource;
    const claims = p.claims;
    const treatments = claims
    .map(c => c.resource.item[0])
    .map(t => t.productOrService.coding[0].display)
    .join('; ');

    const enrollments = claims.map(c => {
    const claim = c.resource;
    const display = claim.insurance && claim.insurance[0].coverage.display;

    const oclMapping = {
    PARN: 'GMfuAqBFS1g',
    'Programme Vaccination': 'GMfuAqBFS1g',
    'Santé Maternelle': 'wBUDpZSS4Bh',
    };

    console.log(
    `We could use OCL to map "${display}" to "${
    oclMapping[display] || 'q5Qyv66pIAI (mTOMADY Other)'
    }"`
    );

    return {
    orgUnit: 'KUVJPjmUmWc',
    program: oclMapping[display] || 'q5Qyv66pIAI',
    status: 'ACTIVE', // active
    enrolledAt: today,
    occurredAt: today,
    };
    });

    return {
    orgUnit: 'KUVJPjmUmWc', // Madagascar
    trackedEntityType: 'x5fZpgCyv50', // Patient
    attributes: [
    { attribute: 'rDeWj9yYtzv', value: patient.identifier[0].value },
    { attribute: 'E4f4wBsDVgR', value: patient.name[0].family },
    { attribute: 'Fz33peSkK1I', value: patient.name[0].given[0] },
    {
    attribute: 'POCXiJxpYX1',
    value: `${treatments}`,
    },
    { attribute: 'dA6ShmrHmhk', value: patient.birthDate },
    { attribute: 'mWOlfweGigO', value: patient.gender },
    ],
    enrollments: enrollments,
    };
    });

    return { ...state, teis };
    });

    // get current TEIs
    get('tracker/trackedEntities', {
    orgUnit: 'KUVJPjmUmWc',
    trackedEntityType: 'x5fZpgCyv50',
    });

    // create upsertable array
    fn(state => {
    const { configuration, teis } = state;
    const existing = state.data.instances;

    const createable = [];
    const updateable = [];

    teis.forEach(t => {
    const match = existing.find(e => {
    const idAttr = e.attributes.find(a => a.displayName == 'Unique ID');
    return idAttr && idAttr.value == t.attributes[0].value;
    });

    if (match) {
    const enrollments =
    (match.enrollments && match.enrollments.concat(t.enrollments)) ||
    t.enrollments;

    updateable.push({ ...match, ...t, enrollments });
    } else {
    createable.push(t);
    }
    });

    console.log(`${updateable.length} to update; ${createable.length} to create`);
    const trackedEntities = [...createable, ...updateable];

    return { configuration, trackedEntities, references: [] };
    });

    // send data to DHIS2
    create('tracker', state => ({ trackedEntities: state.trackedEntities }), {
    params: {
    importStrategy: 'CREATE_AND_UPDATE',
    atomicMode: 'OBJECT',
    async: 'false',
    },
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Malaria-Testing-Event-Snapshot-2021-05-03.html b/adaptors/library/jobs/auto/Malaria-Testing-Event-Snapshot-2021-05-03.html index ca5ba82c230b..8b8b15b3f149 100644 --- a/adaptors/library/jobs/auto/Malaria-Testing-Event-Snapshot-2021-05-03.html +++ b/adaptors/library/jobs/auto/Malaria-Testing-Event-Snapshot-2021-05-03.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Malaria Testing Event Snapshot

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields, upsert

    Expression

    // push to production
    upsert(
    'Event__c',
    'CommCare_Case_ID__c',
    fields(
    field('Name', dataValue('form.hidden_properties.event_name')),
    field('Date__c', dataValue('form.basic_information.event_details.event_date')),
    field('Testing_Partner_Contact_Persion__c', dataValue('form.event_information.testing_partner__contact_people')),
    field('of_People_in_Attendance_Testing_Events__c', dataValue('form.event_information.number_in_attendance')),
    field('Coordinator__c', dataValue('form.event_information.event_coordinator')),
    field(
    'Did_an_organization_discuss_Malaria__c',
    dataValue('form.malaria_treatment_prevention.info_malaria_treatment')
    ),
    field('What_organization_s_What_topic_s__c', dataValue('form.malaria_treatment_prevention.which_organizations')),
    field(
    'How_was_the_information_presented__c',
    dataValue('form.malaria_treatment_prevention.how_was_info_presented')
    ),
    //field('of_Participants__c', dataValue('form.malaria_treatment_prevention.how_many_total_participants')),
    field(
    'Did_other_organizations_conduct__c',
    dataValue("form.skills_activities['did_other_organisations_eg_youth-friendly_clinic_ministry_of_health_etc_con']")
    ),
    field(
    'What_organization_s_What_topic_s__c',
    dataValue('form.skills_activities.what_organisations_delivered_a_session_and_what_was_the_topic_of_the_sessio')
    ),
    field('Facilitator_1__c', dataValue('form.skills_activities.facilitators')),
    field(
    'How_many_people_attended_the_sessions__c',
    dataValue('form.skills_activities.how_many_people_attended_the_sessions_in_total')
    ),
    field(
    'How_many_people_attended_the_sessions_oh__c',
    dataValue('form.skills_activities.how_many_people_attended_the_sessions_in_total')
    ),
    field(
    'X2_Main_challenges__c',
    dataValue('form.bed_net_distribution.please_describe_highlights_key_challenges_and_main_lessons_learned_from_thi')
    ),
    field(
    'X1_Main_successes__c',
    dataValue('form.bed_net_distribution.please_describe_highlights_key_challenges_and_main_lessons_learned_from_thi')
    ),
    field(
    'Number_of_Bed_Nets_Distributed__c',
    dataValue('form.bed_net_distribution.total_number_of_bed_nets_distributed')
    ),
    //field('Site__c', dataValue('form.event_information.site')),
    //field('Venue__c', dataValue('form.event_information.venue')),
    //field('Curriculum__c', dataValue('form.event_information.curriculum')),
    field('X1_0_Intervention_Name__c', dataValue('form.event_information.intervention')),
    //field('Coach_1__c', dataValue('form.hidden_properties.coach_name')),
    field('CommCare_Case_ID__c', dataValue('form.case.@case_id')),
    field('Date__c', dataValue('form.event_information.event_date')),
    field('Testing_Partner_Contact_Persion__c', dataValue('form.event_information.testing_partner__contact_people')),
    field('of_People_in_Attendance_Testing_Events__c', dataValue('form.event_information.number_in_attendance')),
    field('Coordinator__c', dataValue('form.event_information.event_coordinator'))
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Malaria-Testing-Event-Statistics-2021-05-03.html b/adaptors/library/jobs/auto/Malaria-Testing-Event-Statistics-2021-05-03.html index 642f2a1e360a..76f8d9c707cc 100644 --- a/adaptors/library/jobs/auto/Malaria-Testing-Event-Statistics-2021-05-03.html +++ b/adaptors/library/jobs/auto/Malaria-Testing-Event-Statistics-2021-05-03.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Malaria Testing Event Statistics

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields, upsert

    Expression

    // push to production
    upsert(
    'Event__c',
    'CommCare_Case_ID__c',
    fields(
    field('Name', dataValue('form.event_information.event_name')),
    field('CommCare_Case_ID__c', dataValue('form.case.@case_id')),
    field(
    'Tested_Negative_Males_0_9__c',
    dataValue('form.table_1_testing_results_malaria.male_malaria_negative.question2')
    ),
    field(
    'Tested_Negative_Males_10_14__c',
    dataValue('form.table_1_testing_results_malaria.male_malaria_negative.question7')
    ),
    field(
    'Tested_Negative_Males_15_19__c',
    dataValue('form.table_1_testing_results_malaria.male_malaria_negative.question13')
    ),
    field(
    'Tested_Negative_Males_20_24__c',
    dataValue('form.table_1_testing_results_malaria.male_malaria_negative.question18')
    ),
    field(
    'Tested_Negative_Males_25_49__c',
    dataValue('form.table_1_testing_results_malaria.male_malaria_negative.question28')
    ),
    field(
    'Tested_Negative_Males_50__c',
    dataValue('form.table_1_testing_results_malaria.male_malaria_negative.question32')
    ),
    field('Tested_Positive_Males_0_9__c', dataValue('form.table_1_testing_results_malaria.question33.question36')),
    field('Tested_Positive_Males_10_14__c', dataValue('form.table_1_testing_results_malaria.question33.question41')),
    field('Tested_Positive_Males_15_19__c', dataValue('form.table_1_testing_results_malaria.question33.question45')),
    field('Tested_Positive_Males_20_24__c', dataValue('form.table_1_testing_results_malaria.question33.question50')),
    field('Tested_Positive_Males_25_49__c', dataValue('form.table_1_testing_results_malaria.question33.question56')),
    field('Tested_Positive_Males_50__c', dataValue('form.table_1_testing_results_malaria.question33.question60')),
    field('Tested_Negative_Females_0_9__c', dataValue('form.table_1_testing_results_malaria.question61.question65')),
    field('Tested_Negative_Females_10_14__c', dataValue('form.table_1_testing_results_malaria.question61.question69')),
    field('Tested_Negative_Females_15_19__c', dataValue('form.table_1_testing_results_malaria.question61.question73')),
    field('Tested_Negative_Females_20_24__c', dataValue('form.table_1_testing_results_malaria.question61.question78')),
    field('Tested_Negative_Females_25_49__c', dataValue('form.table_1_testing_results_malaria.question61.question84')),
    field('Tested_Negative_Females_50__c', dataValue('form.table_1_testing_results_malaria.question61.question88')),
    field('Tested_Positive_Females_0_9__c', dataValue('form.table_1_testing_results_malaria.question89.question92')),
    field('Tested_Positive_Females_10_14__c', dataValue('form.table_1_testing_results_malaria.question89.question97')),
    field('Tested_Positive_Females_15_19__c', dataValue('form.table_1_testing_results_malaria.question89.question101')),
    field('Tested_Positive_Females_20_24__c', dataValue('form.table_1_testing_results_malaria.question89.question106')),
    field('Tested_Positive_Females_25_49__c', dataValue('form.table_1_testing_results_malaria.question89.question112')),
    field('Tested_Positive_Females_50__c', dataValue('form.table_1_testing_results_malaria.question89.question116'))
    ));

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/ODK-Create-Many-Records-Moving-In-And-Out-Of-Repeat-Blocks.html b/adaptors/library/jobs/auto/ODK-Create-Many-Records-Moving-In-And-Out-Of-Repeat-Blocks.html index a2781efc8fc7..9da78f16a498 100644 --- a/adaptors/library/jobs/auto/ODK-Create-Many-Records-Moving-In-And-Out-Of-Repeat-Blocks.html +++ b/adaptors/library/jobs/auto/ODK-Create-Many-Records-Moving-In-And-Out-Of-Repeat-Blocks.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Handling multiple ODK repeat groups

    📜 This job is an official example from OpenFn.

    Metadata

    Key Functions

    create, dataPath, dataValue, each, field, fields, lastReferenceValue, merge

    Expression

    /*
    Create many records from an ODK submission, moving in and out of repeat
    blocks, submitted by Taylor Downs @ OpenFn.
    */

    beta.each(
    '$.data.data[*]',
    create(
    'ODK__c',
    fields(
    field('Event_Type__c', dataValue('event_type')),
    field('Training_Type__c', dataValue('training_type')),
    field('Event_Leader_ID__c', dataValue('leader')),
    field('Event_Date__c', dataValue('date')),
    field('metainstanceid__c', dataValue('*meta-instance-id*'))
    )
    )
    );

    beta.each(
    merge(
    dataPath('data[*].attendee_new[*]'),
    fields(field('parentId', lastReferenceValue('id')))
    ),
    create(
    'ODK_Child_2__c',
    fields(
    field('ODK__c', dataValue('parentId')),
    field('Barcode__c', dataValue('new_attendee_id')),
    field('First_Name__c', dataValue('new_attendee_first_name')),
    field('Last_Name__c', dataValue('new_attendee_last_name')),
    field('Phone_Number__c', dataValue('new_attendee_phone'))
    )
    )
    );

    beta.each(
    merge(
    dataPath('data[*].attendee[*]'),
    fields(
    field('parentId', function (state) {
    return state.references[state.references.length - 1].id;
    })
    // ^^ This will get the sfID of the 1st item created.
    )
    ),
    create(
    'ODK_Child_1__c',
    fields(
    field('ODK__c', dataValue('parentId')),
    field('Barcode__c', dataValue('attendee_id')),
    field('Late__c', dataValue('late'))
    )
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Outcome-Survey-2024-07-16.html b/adaptors/library/jobs/auto/Outcome-Survey-2024-07-16.html index f3c2fd7d11ce..0109f2e74dd3 100644 --- a/adaptors/library/jobs/auto/Outcome-Survey-2024-07-16.html +++ b/adaptors/library/jobs/auto/Outcome-Survey-2024-07-16.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Outcome Survey

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, upsert

    Expression

    fn((state) => {


    state.capitalizeFirstLetter = (text) => {
    if (!text) return text; // Return the text if it's empty or undefined
    return text.charAt(0).toUpperCase() + text.slice(1);
    };

    state.replaceUnderscoreWithSpace = (text) => {
    if (typeof text !== 'string') {
    return ''; // Return an empty string if input is not a string
    }
    return text.replace(/_/g, ' ');
    }

    state.replaceSpaceWithSemiColon = (text) => {
    if (typeof text !== 'string') {
    return ''; // Return an empty string if input is not a string
    }
    return text.replace(/ /g, ';');

    }

    state.HIVtestMap = {
    agree: "Positive",
    negative: "Negative",
    "copy-2-of-days": "5 - 6 days",
    "i_dont_knowdeclined": "I don't know / Declined to answer",
    "i_dont_knowdeclined_answer": "I don't know / Declined to answer",
    "i_dont_knowdeclined_to_answer": "I don't know / Declined to answer"
    };



    state.daysMap = {
    days: "1 - 2 days",
    "copy-1-of-days": "3 - 4 days",
    "copy-2-of-days": "5 - 6 days",
    "more_than_6_days": "More than 6 days",
    "none": "None"
    };

    state.agreeDisagreeMap = {
    Agree: 'Yes', //New
    Disagree: 'No', // Continued
    "I don't know/Declined to answer": "Declined to answer",
    "I_dont_know_declined_to_answer": "Declined to answer",
    "I_dont_knowdeclined_to_answer": "I don't know",
    "choice2": "No"
    };

    state.agreeDisagreeMap2 = {
    Agree: 'Yes', //New
    Disagree: 'No', // Continued
    "I don't know/Declined to answer": "Declined to answer",
    "I_dont_know_declined_to_answer": "Declined to answer",
    "I_dont_knowdeclined_to_answer": "Declined to answer",
    "choice2": "No"
    };

    state.timeMap = {
    "all_of_the_time": "All of the time",
    "most_of_the_time": "Most of the time",
    "more_than_half_of_the_time": "More than half of the time",
    "less_than_half_of_the_time": "Less than half of the time",
    "some_of_the_time": "Some of the time",
    "at_no_time": "At no time",
    "choice10": "Less than half of the time"
    }

    state.choiceMapping = {
    "choice1": "Confidentiality concerns",
    "choice2": "Contraceptives including pills, injections, implants or similar",
    "choice3": "Condoms – male or female",
    "choice4": "Voluntary medical male circumcision",
    "choice10": "Less than half of the time",
    "Sexual and reproductive health informationtalks": "Sexual and reproductive health information/talks"

    }

    state.choiceMapping2 = {
    "Choice2": "Yes",
    }

    state.idkdeclinedtodeclined = {
    "I_dont_know_declined_to_answer": "Declined to answer",
    }

    state.idkdeclinedtoidkdeclined = {
    "I_dont_know_declined_to_answer": "I don't know / Declined to answer",
    "I_dont_knowdeclined_to_answer": "I don't know / Declined to answer"
    }


    // function capitalizeFirstLetter(text) {
    // if (!text) return text; // Return the text if it's empty or undefined
    // return text.charAt(0).toUpperCase() + text.slice(1);
    // }

    function transform(value) {
    if (!value) return;
    //console.log("value in switch", value.toString().trim().toLowerCase());
    switch (value.toString().trim().toLowerCase()) {
    case "Agree":
    return "Yes";
    case "Disagree":
    return "No";
    case "I don't know/Declined to answer":
    return "Declined to answer";
    default:
    return value;
    }
    }

    state.helperFunctions = { transform };

    return state;
    });

    fn((state) => {
    const { form } = state.data;
    state.surveyMappings = {
    CommCare_Ext_ID__c: dataValue("id"),
    Name_of_Interviewer__c: form["name_of_interviewer"],
    Date__c: form.date,
    Interview_Start_Time__c: form.interview_start_time,
    Interview_End_Time__c: form.interview_end_time,
    What_was_the_main_reason_the_participant__c:
    form[
    "copy-1-of-what_was_the_main_reason_the_participant_did_not_consent_to_participate_in_"
    ],
    Site_Name__c: state.capitalizeFirstLetter(form.site),
    Venue_Name__c: form.venue,
    Group_Name__c: form.group_name,
    //Grade__c: 'form.grade',
    Curriculum_Attended__c: form.curriculum,
    Give_permission_to_participate__c:
    form["did_the_individual_give_permission_to_participate_in_the_survey"],
    Main_reason_of_not_consenting__c: state.choiceMapping[state.replaceUnderscoreWithSpace(state.capitalizeFirstLetter(
    form["what_was_the_main_reason_the_participant_did_not_consent_to_participate_in_"]))],
    Participant_Name__c: form.participant_name,
    Participant_Gender__c: state.capitalizeFirstLetter(form.participant_gender),
    Participant_DOB__c: form.participant_date_of_birth,
    Currently_live_with_at_home__c: state.replaceUnderscoreWithSpace(state.capitalizeFirstLetter(form["who_do_you_currently_live_with_at_home"])),
    Days_did_you_go_without_food__c: state.daysMap[form["in_the_last_week_how_many_days_did_you_go_without_food"]],
    Ever_been_in_any_kind_of_sexual_relation__c: state.capitalizeFirstLetter(form["have_you_ever_been_in_any_kind_of_sexual_relationship_with_someone"]),
    In_any_form_of_sexual_relationship__c: state.choiceMapping2[state.capitalizeFirstLetter(form["are_you_currently_in_any_form_of_sexual_relationship"])],
    Age_of_your_current_last_sexual_partner__c: state.capitalizeFirstLetter(form["what_is_the_age_of_your_currentlast_sexual_partner"]),
    Ever_had_sexual_intercourse__c: state.capitalizeFirstLetter(form["have_you_ever_had_sexual_intercourse"]),
    Age_at_first_sex__c: state.capitalizeFirstLetter(form["how_old_were_you_when_you_had_sexual_intercourse_for_the_first_time"]),
    La__c: state.replaceUnderscoreWithSpace(state.capitalizeFirstLetter(form["the_last_time_you_had_sexual_intercourse_why_did_you_do_it"])),
    Last_2_years_pregnant_or_given_birth__c: state.capitalizeFirstLetter(form["in_the_last_2_years_did_you_ever_get_pregnant_or_give_birth_instruction_thi"]),
    HIV_positive_should_hide_it_from_others__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["people_who_test_hiv_positive_should_hide_it_from_others"])],
    I_would_rather_not_know_if_I_have_HIV__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["i_would_rather_not_know_if_i_have_hiv"])],
    someone_with_HIV_to_stop_taking_their_AR__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["it_is_okay_for_someone_with_hiv_to_stop_taking_their_arv_as_soon_as_they_st"])],
    People_with_HIV_to_have_unprotected_sex__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["it_is_okay_for_two_people_with_hiv_to_have_unprotected_sex_with_each_other"])],
    Someone_has_HIV_by_looking_at_him_or_her__c: state.capitalizeFirstLetter(form["i_can_tell_whether_someone_has_hiv_by_looking_at_him_or_her"]),
    talk_to_a_partner_about_HIV_STI_testing__c: state.capitalizeFirstLetter(form["i_know_how_to_talk_to_a_partner_about_hivsti_testing"]),
    HIV_testing_is_free_at_government_health__c: state.agreeDisagreeMap2[state.capitalizeFirstLetter(form["hiv_testing_is_free_at_government_health_facilities"])],
    Have_you_ever_tested_for_HIV__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["have_you_ever_tested_for_hiv"])],
    Result_of_your_last_HIV_test__c: state.HIVtestMap[form["what_was_the_result_of_your_last_most_recent_hiv_test"]],
    Where_to_get_support_services__c: state.capitalizeFirstLetter(form["i_know_where_to_get_support_services_for_me_or_someone_else_for_hiv-related"]),
    Right_to_access_sexual_health_services__c: state.capitalizeFirstLetter(form["i_have_the_right_to_access_sexual_health_services_such_as_sti_and_hiv_testi"]),
    Where_to_get_support_services_for_GBV__c: state.agreeDisagreeMap[state.capitalizeFirstLetter[form["i_know_where_to_get_support_services_for_me_or_someone_else_for_gender-base"]]],
    Services_accessed_in_the_past_2_years__c: state.choiceMapping[state.replaceUnderscoreWithSpace(state.capitalizeFirstLetter(form["in_the_last_2_years_which_of_these_services_have_you_accessed_through_the_c"]))],
    Accessed_the_above_services__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["did_you_access_the_above_services_more_than_once_per_year"])],
    The_staff_at_my_nearest_clinic_are_frien__c: state.capitalizeFirstLetter(form["the_staff_at_my_nearest_clinic_are_friendly"]),
    Keep_my_personal_information_private__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["the_staff_at_my_nearest_clinic_will_keep_my_personal_information_private"])],
    Feel_stigmatism_or_judged__c: state.agreeDisagreeMap2[state.capitalizeFirstLetter(form["i_do_not_feel_stigmatism_or_judged_when_i_go_to_access_sexual_reproductive_"])],
    Suggests_using_a_condom__c: state.agreeDisagreeMap[state.capitalizeFirstLetter[form["when_a_partner_suggests_using_a_condom_it_means_he_or_she_has_had_sex_with_"]]],
    //A_condom_would_make_sex_less_pleasing__c: state.agreeDisagreeMap2[state.capitalizeFirstLetter(form["using_a_condom_would_make_sex_less_pleasant"])],
    I_know_how_to_correctly_use_a_condom__c: state.agreeDisagreeMap2[state.capitalizeFirstLetter(form["i_know_how_to_correctly_use_a_condom"])],
    Able_to_refuse_to_have_sex__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["i_would_be_able_to_refuse_to_have_sex_if_my_partner_did_not_want_to_use_a_c"])],
    Condoms_are_the_only_contraceptive__c: state.agreeDisagreeMap2[state.capitalizeFirstLetter(form["condoms_are_the_only_contraceptive_method_that_protect_against_pregnancy_as"])],
    Use_a_condom__c: state.idkdeclinedtoidkdeclined[state.capitalizeFirstLetter(form["i_should_use_a_condom_even_if_my_girlfriend_is_on_another_form_of_birth_con"])],
    The_last_time_you_had_sexual_intercourse__c: state.capitalizeFirstLetter(form["the_last_time_you_had_sexual_intercourse_did_you_and_your_partner_use_a_con"]),
    A_girl_woman_can_get_pregnant__c: state.idkdeclinedtoidkdeclined[state.capitalizeFirstLetter(form["a_girl_or_woman_can_get_pregnant_the_very_first_time_she_has_sex"])],
    Sign_of_Pregnancy__c: state.capitalizeFirstLetter(form["one_sign_of_pregnancy_is_a_girl_missing_her_period"]),
    Ever_used_family_planning_method__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["have_you_ever_used_any_type_of_family_planning"])],
    Recieved_Family_Planning__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["in_the_last_2_years_did_you_ask_for_or_receive_family_planning"])],
    Type_of_Family_Planning_accessed__c: state.replaceUnderscoreWithSpace(state.capitalizeFirstLetter(form["in_the_last_2_years_what_type_of_family_planning_services_did_you_access"])),
    Methods_to_avoid_unwanted_pregnancy__c: state.capitalizeFirstLetter(form["i_know_at_least_three_methods_to_avoid_an_unwanted_pregnancy"]),
    Support_for_prevention_of_teen_pregnancy__c: state.capitalizeFirstLetter(form["in_the_last_2_years_did_you_get_support_for_prevention_of_teenage_pregnancy"]),
    I_have_felt_cheerful_and_in_good_spirits__c: state.timeMap[(form["i_have_felt_cheerful_and_in_good_spirits"])],
    I_have_felt_calm_and_relaxed__c: state.timeMap[form["i_have_felt_calm_and_relaxed"]],
    I_have_felt_active_and_vigorous__c: state.timeMap[form["question11"]],
    I_woke_up_feeling_fresh_and_rested__c: state.timeMap[form["i_woke_up_feeling_fresh_and_rested"]],
    Life_filled_with_things_interesting_me__c: state.replaceUnderscoreWithSpace(state.capitalizeFirstLetter(form["my_daily_life_has_been_filled_with_things_that_interest_me"])),
    Sign_of_personal_weakness__c: state.idkdeclinedtoidkdeclined[state.capitalizeFirstLetter(form["a_mental_illness_is_a_sign_of_personal_weakness"])],
    //Sign_of_personal_weakness__c: state.capitalizeFirstLetter(form["seeking_help_for_mental_health_challenges_is_a_sign_of_weakness"]),
    Expectations_dealing_with_emotions__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["society_expects_boys_and_girls_to_deal_with_their_emotions_differently"])],
    Self_control_and_smart_decisions__c: state.capitalizeFirstLetter(form["self-control_helps_you_make_smart_decisions_when_you_are_angry_or_upset"]),
    Avoid_using_violent_behaviour__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["when_i_am_angry_i_know_how_to_avoid_using_violent_behaviour"])],
    Confidence_and_face_to_face_appointments__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["i_am_confident_attending_face_to_face_appointments_to_seek_information_abou"])],
    Seek_information_about_mental_illness__c: state.idkdeclinedtoidkdeclined[state.capitalizeFirstLetter(form["i_am_confident_that_i_know_where_to_seek_information_about_mental_illness"])],
    Bounce_back_from_difficult_situations__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["i_can_bounce_back_from_difficult_situations"])],
    Avoid_people_with_mental_illness__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["it_is_best_to_avoid_people_with_mental_illness_so_that_you_dont_develop_thi"])],
    Informed_decisions_about_sexual_health__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["i_can_make_my_own_informed_decisions_about_my_sexual_healthcare"])],
    Say_no_to_sex_despite_pressure__c: state.capitalizeFirstLetter(form["i_can_say_no_to_sex_even_if_my_boyfriend_or_friends_pressure_me_to_have_sex"]),
    Make_my_own_decisions_pressure__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["i_can_make_my_own_decisions_no_matter_how_much_pressure_i_get_from_others"])],
    Tell_someone_if_I_were_touched__c: state.capitalizeFirstLetter(form["i_would_tell_someone_if_i_were_touched_in_a_manner_that_made_me_uncomfortab"]),
    Say_no_to_sex_no_matter_who_asks_me__c: state.capitalizeFirstLetter(form["i_can_say_no_to_sex_no_matter_who_asks_me"]),
    How_to_overcome_challenges__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["i_know_how_to_overcome_challenges_that_i_may_face_in_my_life"])],
    I_can_achieve_my_goals__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["i_can_achieve_my_goals_even_if_i_face_challenges"])],
    Confident_setting_measurable_goals__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["i_feel_confident_setting_measurable_goals"])],
    Good_reason_to_hit_his_girlfriend_wife__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["sometimes_a_man_or_boyfriend_may_have_a_good_reason_to_hit_his_girlfriend_o"])],
    Take_part_in_household_chores__c: state.capitalizeFirstLetter(form["men_should_take_part_in_household_chores_such_as_washing_plates_and_sweepin"]),
    Girls_responsibility_on_pregnancy__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["it_is_only_the_girls_responsibility_to_avoid_getting_pregnant"])],
    Right_to_have_sex__c: state.capitalizeFirstLetter(form["a_man_has_the_right_to_have_sex_with_his_girlfriend_even_if_she_doesnt_want"]),
    Appropriate_for_a_girl_to_carry_condoms__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["it_is_not_appropriate_for_a_girlwoman_to_carry_condoms"])],
    Where_to_get_support__c: state.idkdeclinedtoidkdeclined[state.capitalizeFirstLetter(form["copy-1-of-i_know_where_to_get_support_services_for_me_or_someone_else_for_gender-base"])],
    Gone_to_seek_support_forself__c: state.agreeDisagreeMap[state.capitalizeFirstLetter(form["in_the_last_2_years_have_you_ever_gone_to_seek_support_for_yourself_or_for_"])],
    People_in_my_life_who_I_can_get_help__c: state.idkdeclinedtoidkdeclined[state.capitalizeFirstLetter(form["there_are_people_in_my_life_who_i_can_get_help_from_if_i_need_it"])],
    People_in_my_life_who_I_can_talk_to__c: state.capitalizeFirstLetter(form["there_are_people_in_my_life_who_i_can_talk_to_about_how_to_handle_things"]),
    Where_to_go_for_support_for_alcohol__c: state.idkdeclinedtoidkdeclined[state.capitalizeFirstLetter(form["i_know_where_to_go_for_support_if_i_or_someone_i_know_drinks_too_much_alcoh"])],
    };
    return state;
    });

    upsert(
    "SKILLZ_Outcome_Monitoring_Survey__c",
    "CommCare_Ext_ID__c",
    (state) => state.surveyMappings
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/PHQ9-2021-05-03.html b/adaptors/library/jobs/auto/PHQ9-2021-05-03.html index acee8855cf31..1b1b7510b6f9 100644 --- a/adaptors/library/jobs/auto/PHQ9-2021-05-03.html +++ b/adaptors/library/jobs/auto/PHQ9-2021-05-03.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    PHQ9

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    alterState, dataValue, field, fields, relationship, upsert

    Expression

    alterState(state => {
    function capitalizeFirstLetter(str) {
    if (!str) return;
    let new_str = str.toString().toLowerCase();
    return new_str.slice(0, 1).toUpperCase() + new_str.slice(1);
    }

    function transform(value) {
    if (!value) return;
    switch (value.toString().trim()) {
    case 'Daughterson':
    return 'Daughter/Son';
    case 'Other_specify':
    return 'Other';
    case 'Single_never_married':
    return 'Single/Never Married';
    case 'Divorced__separated':
    return 'Divorced/separated';
    default:
    return value;
    }
    }

    function getAge(dateString) {
    if (!dateString) return;

    const today = new Date();
    const birthDate = new Date(dateString);
    var age = today.getFullYear() - birthDate.getFullYear();
    var m = today.getMonth() - birthDate.getMonth();
    if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) {
    age--;
    }
    return age;
    }

    state.data.form.begin_interview.what_is_your_marital_status = state.data.form.begin_interview && state.data.form.begin_interview.what_is_your_marital_status ? transform(
    capitalizeFirstLetter(state.data.form.begin_interview.what_is_your_marital_status)
    ): undefined;

    state.data.form.begin_interview.position_of_respondent_in_the_household = state.data.form.begin_interview && state.data.form.begin_interview.position_of_respondent_in_the_household ? transform(
    capitalizeFirstLetter(state.data.form.begin_interview.position_of_respondent_in_the_household)
    ): undefined;

    state.helperFunctions = { getAge };
    return state;
    });

    upsert(
    'PHQ_9_Strong_Minds__c',
    'CommCare_Ext_ID__c',
    fields(
    field('CommCare_Ext_ID__c', dataValue('id')),

    // relationship('Intervention_Name__r', 'CommCare_Case_ID__c', state => {
    // if (state.data.form.hidden_properties.intervention_id) return state.data.form.hidden_properties.intervention_id;
    // else return "990221ac-3c05-475d-87c7-24d8a5fcb63e";
    // }),
    relationship('Intervention_Name__r', 'CommCare_Case_ID__c', dataValue('form.hidden_properties.intervention_id')),


    //relationship('Participant__r','CommCare_Ext_ID__c', dataValue('form.hidden_properties.participant_fullname')),
    field('Mobile_Contact_Information__c', dataValue('form.hidden_properties.mobile_number')),
    field('Curriculum__c', dataValue('form.hidden_properties.curriculum')),
    //field('Intervention__c', dataValue('form.hidden_properties.intervention')),
    field('Gender__c', dataValue('form.hidden_properties.gender')),
    field('Participant_Name__c', state => {
    const firstname = state.data.form.hidden_properties.participant_first_name;
    const lastname = state.data.form.hidden_properties.participant_surname;
    return firstname + ' ' + lastname;
    }),

    field('Coach_Name__c', dataValue('form.hidden_properties.coach_name')),
    relationship(
    'Venue2__r',
    'CommCare_Ext_ID__c',
    dataValue('form.hidden_properties.venue')
    ),
    //field('Venue__c', dataValue('form.hidden_properties.venue')), replacing with the lookup
    relationship(
    'Site2__r',
    'CommCare_Ext_ID__c',
    dataValue('form.hidden_properties.site')
    ),
    //field('Site__c', dataValue('form.hidden_properties.site')), replacing with the lookup
    field('Interview_Date__c', dataValue('form.interview_date')),
    field('Resident_not_shifting_in_3_months_time__c', dataValue('form.full_time_resident')),
    field('Participant_DOB__c', state => {
    const dob = dataValue('form.hidden_properties.date_of_birth')(state);
    return dob ? dob : null;
    }),
    //field('Area_Center__c', dataValue('form.hidden_properties.venue')), //Can get from Intervention
    field('Age_of_Participant__c', state => {
    const dob = dataValue('form.hidden_properties.date_of_birth')(state);

    return dob ? state.helperFunctions.getAge(dob) : null;
    }),


    field('Marital_Status__c', dataValue('form.begin_interview.what_is_your_marital_status')),
    field(
    'Position_of_Respondent_in_Household__c',
    dataValue('form.begin_interview.position_of_respondent_in_the_household')
    ),
    field('Q1_Little_interest_pleasure__c', dataValue('form.begin_interview.questions.little_interest')),
    field('Q2_Sad_Down_Depressed_Hopeless__c', dataValue('form.begin_interview.questions.depressed_sad_hopeless')),
    field('Q3_Trouble_sleeping__c', dataValue('form.begin_interview.questions.trouble_sleeping')),
    field('Q4_Feeling_tired__c', dataValue('form.begin_interview.questions.heavy_burden')),
    field('Q5_Appetite_problems__c', dataValue('form.begin_interview.questions.appetite_problems')),
    field('Q6_Failure_Worthless_Guilt__c', dataValue('form.begin_interview.questions.feeling_bad')),
    field('Q7_Trouble_concentrating__c', dataValue('form.begin_interview.questions.trouble_concentrating')),
    field('Q8_Trouble_in_speech__c', dataValue('form.begin_interview.questions.moving_slowly')),
    field('Q9_Suicidal_thoughts__c', dataValue('form.begin_interview.questions.thoughts_suicide'))
    //field('PHQ9_Total_Score__c', dataValue('form.begin_interview.questions.phq9_result.PHQ9_score'))
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Pay-CHW-2021-04-23.html b/adaptors/library/jobs/auto/Pay-CHW-2021-04-23.html index def589c0008e..c52715bda9b3 100644 --- a/adaptors/library/jobs/auto/Pay-CHW-2021-04-23.html +++ b/adaptors/library/jobs/auto/Pay-CHW-2021-04-23.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Q3-2022-Create-Distribution-Referral-in-SF-2020-06-19.html b/adaptors/library/jobs/auto/Q3-2022-Create-Distribution-Referral-in-SF-2020-06-19.html index e4a5de7246f7..029f16894520 100644 --- a/adaptors/library/jobs/auto/Q3-2022-Create-Distribution-Referral-in-SF-2020-06-19.html +++ b/adaptors/library/jobs/auto/Q3-2022-Create-Distribution-Referral-in-SF-2020-06-19.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Q3 2022 Create Distribution & Referral in SF

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields, join, map, relationship, upsert

    Expression

    //Job to integrate CommCare 'Distribution & Referrals' form
    upsert(
    'Family_Planning_community_Distribution__c',
    'Commcare_Case_ID__c',
    fields(
    field('Commcare_Case_ID__c', dataValue('id')),
    relationship('RecordType', 'Name', 'FP Community Distribution & Referrals'),
    field('Distribute_Date__c', dataValue('form.date')),
    field('Client_Name__c', dataValue('form.name')),
    field('Client_Gender__c', dataValue('form.gender')),
    field('Client_Age__c', dataValue('form.age')),
    field('Client_currently_on_FP__c', dataValue('form.current_use')),
    field('Referral_Date__c', dataValue('form.Referral_Date')),
    field('Referral_Method__c', state => {
    var method = dataValue('form.referral_method')(state);
    var newMethod = method
    ? method
    .split(/_/g)
    .map(
    word =>
    `${word.substring(0, 1).toUpperCase()}${word.substring(1)}`
    )
    .join(' ')
    : '';
    return newMethod;
    }),
    field('Implant_Type__c', state => {
    var type = dataValue('form.implant_type')(state);
    var newType = '';
    if (type) {
    if (type === 'implanon') {
    newType = '3-year Implanon';
    } else {
    newType = type === 'jadelle' ? '5-year Jadelle' : null;
    }
    }
    return newType;
    }),
    field('Male_Condoms__c', dataValue('form.male_condoms_count')),
    field('Female_Condoms__c', dataValue('form.female_condoms_count')),
    field('POP__c', dataValue('form.POP_count')),
    field('COC__c', dataValue('form.COC_count')),
    field('Emergency_Pills__c', dataValue('form.emergency_pills_count')),
    field(
    'Pregnancy_test_positive__c',
    dataValue('form.positive_pregnancy_tests')
    ),
    field('Pregnancy_referrals__c', dataValue('form.pregnancy_referrals')),
    field(
    'Contraception_referrals__c',
    dataValue('form.family_planning_referrals')
    )
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Q3-2022-Update-HH-Name-in-CommCare-2021-09-27.html b/adaptors/library/jobs/auto/Q3-2022-Update-HH-Name-in-CommCare-2021-09-27.html index 8deff17534a5..5e588fb4b88c 100644 --- a/adaptors/library/jobs/auto/Q3-2022-Update-HH-Name-in-CommCare-2021-09-27.html +++ b/adaptors/library/jobs/auto/Q3-2022-Update-HH-Name-in-CommCare-2021-09-27.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Q3 2022 Update HH Name in CommCare

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    map, submitXls, Array

    Expression

    // Update CommCare case
    fn(state => {
    const { Notification } = state.data.Envelope.Body.notifications;

    const Notifications = Array.isArray(Notification)
    ? Notification
    : [Notification];

    const notifications = Notifications.map(notification => {
    console.log(
    `Mapping HH code to CommCare: `,
    notification.sObject.Household_Code_Autonumber__c
    );
    return {
    case_id: notification.sObject.Commcare_Code__c,
    name: notification.sObject.Household_Code_Autonumber__c,
    };
    });

    return { ...state, notifications };
    });

    submitXls(state => state.notifications, {
    case_type: 'Household',
    search_field: 'case_id',
    search_column: 'case_id',
    name_column: 'name',
    create_new_cases: 'off',
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Q3-2022-Upsert-Household-Household-Visit-in-SF-2022-06-28.html b/adaptors/library/jobs/auto/Q3-2022-Upsert-Household-Household-Visit-in-SF-2022-06-28.html index 9bf651a7fca9..9c8f95ba88e6 100644 --- a/adaptors/library/jobs/auto/Q3-2022-Upsert-Household-Household-Visit-in-SF-2022-06-28.html +++ b/adaptors/library/jobs/auto/Q3-2022-Upsert-Household-Household-Visit-in-SF-2022-06-28.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Q3 2022 Upsert Household & Household Visit in SF

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: Q3 2022 Upsert Household & Household Visit in SF
    • Adaptor: @openfn/language-salesforce
    • Adaptor Version: latest
    • Created over 2 years ago
    • Updated 11 months ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    dataValue, field, fields, join, map, query, relationship, upsertIf, Array

    Expression

    query(
    `SELECT Id, Parent_Geographic_Area__c, Parent_Geographic_Area__r.Name, Parent_Geographic_Area__r.Parent_Geographic_Area__c FROM Location__c WHERE CommCare_User_ID__c = '${dataValue(
    'properties.owner_id'
    )(state)}'`
    );

    fn(state => { console.log("query1 done"); return state; });
    fn(state => {
    return new Promise((resolve, reject) => {
    setTimeout(() => {
    console.log('4 second cooldown finished.');
    resolve(state);
    }, 4000);
    });
    });

    fn(state => ({
    ...state,
    data: {
    ...state.data,
    villageNewId:
    state.references[0].records && state.references[0].records.length !== 0
    ? state.references[0].records[0].Id
    : undefined,
    areaNewId:
    state.references[0].records && state.references[0].records.length !== 0
    ? state.references[0].records[0].Parent_Geographic_Area__c
    : undefined,
    catchmentNewId:
    state.references[0].records && state.references[0].records.length !== 0
    ? (state.references[0].records[0].Parent_Geographic_Area__r
    ? state.references[0].records[0].Parent_Geographic_Area__r.Parent_Geographic_Area__c
    : undefined)
    : undefined,
    },
    }));

    upsertIf(
    state.data.properties.commcare_username !== 'openfn.test' &&
    state.data.properties.commcare_username !== 'test.2021' &&
    state.data.properties.test_user !== 'Yes' ,
    'Household__c',
    'CommCare_Code__c',
    fields(
    field('CommCare_Username__c', dataValue('properties.commcare_username')),
    field('MOH_household_code__c', dataValue('properties.moh_code')),
    field('CommCare_Code__c', dataValue('case_id')),
    field('Source__c', true),
    //field('Household_CHW__c', 'a030Q00000A0jeYQAR'), //sandbox hardcoded mapping
    field('Household_CHW__c', state => {
    var chw = dataValue('properties.CHW_ID')(state);
    return chw === 'a030800001zQrk'
    ? 'a030800001zQrk5'
    : chw
    ? chw
    : undefined;
    }),
    //TODO: Prod mapping to add back before go-live
    field('Catchment__c', dataValue('catchmentNewId')),
    field('Area__c', dataValue('areaNewId')),
    field('Village__c', dataValue('villageNewId')),
    field('Household_Village__c', dataValue('properties.village')),
    // relationship('Catchment__r', 'Name', state => {
    // var catchment =
    // state.data.properties.catchement ||
    // state.data.properties.catchment_name;
    // return catchment === '' || catchment === undefined
    // ? 'Unknown Location'
    // : catchment;
    // }), // check
    // field('Area__c', state => {
    // // var area = dataValue('properties.Area_Name')(state);
    // return area === '' || area === undefined ? 'a000Q00000Egmu4' : area;
    // }), // Commented out because it was causing a job error
    // field('Household_village__c', dataValue('properties.village')),//case property, but not in message

    // field('Village__c',dataValue('properties.village_name')), //lookup
    field('Deaths_in_the_last_6_months__c', state => {
    var death = dataValue(
    'properties.deaths_in_past_6_months'
    )(state);
    return death > 0 ? 'Yes' : 'No';
    }),
    field('Access_to_safe_water__c',dataValue('properties.Safe_Water')),//not coming through
    field('Treats_Drinking_Water__c',dataValue('properties.Treats_Drinking_Water')),//not coming through
    field('Tippy_Tap__c',dataValue('properties.Active_Handwashing_Station')),//not coming through
    field('Pit_Latrine__c',dataValue('properties.Functional_Latrine')),//not coming through
    field('Rubbish_Pit__c',dataValue('properties.Rubbish_Pit')),//not coming through
    field('Drying_Rack__c',dataValue('properties.Drying_Rack')),//not coming through
    field('Kitchen_Garden__c',dataValue('properties.Kitchen_Garden')),//not coming through
    field('Cookstove__c',dataValue('properties.Improved_Cooking_Method')),//not coming through
    field('Clothe__c',dataValue('properties.Clothesline')),//not coming through
    field('WASH_Trained__c',dataValue('properties.WASH_Trained')),//not coming through
    field('Uses_ITNs__c',dataValue('properties.ITNs')),
    field(
    'Has_muac_tape__c',
    dataValue('properties.family_muac_tape_available')
    ),
    //field('Total_household_people__c',dataValue('properties.Total_Number_of_Members')), //not coming through
    field('Health_insurance__c', dataValue('properties.health_insurace_cover')),
    field('Health_insurance_active_status__c',dataValue('properties.healthinsurance_active')),
    field('Health_insurance_type__c', state => {
    var status = dataValue('properties.health_insurance')(state);
    return status && status === 'other_please_specify_if_active'
    ? 'Other'
    : status === 'nhif'
    ? 'NHIF'
    : status === 'Linda_mama' || 'linda_mama'
    ? 'Linda mama'
    : status;
    }),
    field('Other_Health_Insurance__c',dataValue('properties.if_other_please_specify')),
    field('Work_with_TBA__c', dataValue('properties.tba')),
    field('TBA_name__c', dataValue('properties.which_tba')),
    field('Last_Modified_Date_CommCare__c', dataValue('server_date_modified')),//Need a case property),
    field('Active_Household__c', state => {
    var status = dataValue('properties.Household_Status')(state);
    return status && status === 'No'
    ? false
    : status === 'Yes'
    ? true
    : status;
    }),
    // relationship('Head_of_Household__r', 'CommCare_ID__c', dataValue('properties.head_of_household_case_id')),
    field('Inactive_Reason__c', state => {
    var reason = dataValue('properties.Reason_for_Inactive')(state);
    return reason ? reason.toString().replace(/_/g, ' ') : null;
    }),
    field(
    'Active_in_Nutrition_Program__c',
    dataValue(
    'properties.enrolled_in_a_lwala_nutrition_program'
    )
    ),
    field(
    'lwala_nutrition_program_enrollment_date__c',
    dataValue(
    'properties.lwala_nutrition_program_enrollment_date'
    )
    ),
    field(
    'Trained_in_gardening__c',
    dataValue('properties.household_trained_on_gardening')
    ),
    field(
    'household_trained_on_gardening_date__c',
    dataValue(
    'properties.when_was_the_household_trained_on_gardening'
    )
    ),
    field(
    'Seed_Input_Support__c',
    dataValue('properties.household_provided_with_seed_input_support'
    )
    ),
    field(
    'household_provided_with_seed_input_suppo__c',
    dataValue(
    'properties.when_was_the_household_provided_with_seed_input_support'
    )
    ),
    field(
    'MIYCN_Trained__c',
    dataValue('properties.household_trained_on_MIYCN')
    ),
    // not in message:
    // field(
    // 'Kitchen_Garden__c',
    // dataValue('properties.nutrition_enrollment.household_has_kitchen_garden')
    // ),

    //field('Case_Closed_Date__c', state => {
    // var closed = dataValue('date_closed')(state);
    // var date = dataValue('server_date_modified')(state);
    // return closed && closed == true ? date : undefined;
    // })
    )
    );

    fn(state => { console.log("upsertIf1 done"); return state; });
    fn(state => {
    return new Promise((resolve, reject) => {
    setTimeout(() => {
    console.log('4 second cooldown finished.');
    resolve(state);
    }, 4000);
    });
    });

    //Household Visit
    query(
    `SELECT Id, Parent_Geographic_Area__c, Parent_Geographic_Area__r.Name, Parent_Geographic_Area__r.Parent_Geographic_Area__c FROM Location__c WHERE CommCare_User_ID__c = '${dataValue(
    'properties.owner_id'
    )(state)}'`
    );

    fn(state => { console.log("query2 done"); return state; });
    fn(state => {
    return new Promise((resolve, reject) => {
    setTimeout(() => {
    console.log('4 second cooldown finished.');
    resolve(state);
    }, 4000);
    });
    });

    fn(state => ({
    ...state,
    data: {
    ...state.data,
    catchmentNewId:
    state.references[0].records && state.references[0].records.length !== 0
    ? (state.references[0].records[0].Parent_Geographic_Area__r
    ? state.references[0].records[0].Parent_Geographic_Area__r.Parent_Geographic_Area__c
    : undefined)
    : undefined,
    },
    }));

    fn(state => {
    /* const deaths = state.data.form.household_deaths
    ? state.data.form.household_deaths.deaths
    : '';
    if (deaths !== '' && !Array.isArray(deaths)) {
    state.data.form.household_deaths.deaths = [deaths];
    }*/

    const supervisorMap = {
    community_health_nurse: 'Community Health Nurse',
    chw_supervisor: 'CHW Supervisor',
    chewschas: 'CHEWs/CHAs',
    other: 'Other',
    none: 'None',
    };

    const insuranceMap = {
    nhif: 'NHIF',
    Linda_mama: 'Linda mama',
    other_please_specify_if_active: 'Other',
    none: 'None',
    };

    return { ...state, supervisorMap, insuranceMap };
    });

    upsertIf(
    // state.data.properties.username !== 'openfn.test' &&
    state.data.properties.username !== 'test.2021' &&
    state.data.properties.test_user !== 'Yes' ,
    'Visit__c',
    'CommCare_Visit_ID__c',
    fields(
    field('CommCare_Username__c', dataValue('properties.commcare_username')),//
    // field('CommCare_Visit_ID__c', dataValue('id')),
    field('CommCare_Visit_ID__c', state => {
    var case_id = dataValue('case_id')(state);
    var submitted = dataValue('properties.last_form_opened_date_and_time')(state);
    return case_id + '_' + submitted;
    }),
    // field('Household_CHW__c', 'a030Q00000A0jeY'),
    // field('Catchment__c', dataValue('a000Q00000Egmtk')),
    field('Catchment__c', dataValue('catchmentNewId')),
    // field('Household__c','a010Q00000BL6lT'),
    // field('Household__c', dataValue('form.case.@case_id')),
    relationship(
    'Household__r',
    'CommCare_Code__c',
    dataValue('case_id')),
    field('Date__c',dataValue('properties.Date')),
    field('Form_Submitted__c', dataValue('properties.last_form_opened_name')),

    //field('MOH_household_code__c', state => {
    // var moh = dataValue('form.Household_Information.moh_code')(state);
    // var mohLinked = dataValue('form.MOH_household_code_linked')(state);
    // return moh ? moh : mohLinked && mohLinked !== '' ? mohLinked : undefined;
    // }),
    field('Active_Household__c', state => {
    var status = dataValue('properties.Household_Status')(state);
    return status && status === 'No'
    ? false
    : status === 'Yes'
    ? true
    : status;
    }),
    //field('Inactive_Reason__c', state => {
    // var reason = dataValue('form.Reason_for_Inactive')(state);
    // return reason ? reason.toString().replace(/_/g, ' ') : null;
    //}),
    //field('Source__c', 1),//
    //relationship(
    // 'Household_CHW__r',
    // 'CommCare_ID__c',
    // dataValue('form.sfid')),TO UPDATE IN PRODUCTION
    // field('Household_village__c', dataValue('form.village')),//
    //New Nutrition Field (MOTG)
    field(
    'Active_in_Nutrition_Program__c',
    dataValue(
    'properties.enrolled_in_a_lwala_nutrition_program'
    )
    ),
    field(
    'lwala_nutrition_program_enrollment_date__c',
    dataValue(
    'properties.lwala_nutrition_program_enrollment_date'
    )
    ),
    field(
    'Trained_in_gardening__c',
    dataValue('properties.household_trained_on_gardening')
    ),
    field(
    'household_trained_on_gardening_date__c',
    dataValue(
    'properties.when_was_the_household_trained_on_gardening'
    )
    ),
    field(
    'Seed_Input_Support__c',
    dataValue(
    'properties.household_provided_with_seed_input_support'
    )
    ),
    field(
    'household_provided_with_seed_input_suppo__c',
    dataValue(
    'properties.when_was_the_household_provided_with_seed_input_support'
    )
    ),
    field(
    'MIYCN_Trained__c',
    dataValue('properties.household_trained_on_MIYCN')
    ),
    field(
    'Kitchen_Garden__c',
    dataValue('properties.Kitchen_Garden')
    ),

    field(
    'Access_to_safe_water__c',
    dataValue('properties.Safe_Water')
    ),
    field(
    'Treats_Drinking_Water__c',
    dataValue('properties.Treats_Drinking_Water')
    ),
    field(
    'Tippy_Tap__c',
    dataValue('properties.Active_Handwashing_Station')
    ),
    field(
    'Pit_Latrine__c',
    dataValue('properties.Functional_Latrine')
    ),
    field(
    'Rubbish_Pit__c',
    dataValue('properties.Rubbish_Pit')
    ),
    field(
    'Drying_Rack__c',
    dataValue('properties.Drying_Rack')
    ),
    field(
    'Kitchen_Garden__c',
    dataValue('properties.Kitchen_Garden')
    ),
    field(
    'Cookstove__c',
    dataValue('properties.Improved_Cooking_Method')
    ),
    field('Clothe__c', dataValue('properties.Clothesline')),
    field(
    'WASH_Trained__c',
    dataValue('properties.WASH_Trained')
    ),
    field(
    'Has_muac_tape__c',
    dataValue('properties.family_muac_tape_available')
    ),
    field('Uses_ITNs__c', dataValue('properties.ITNs')),
    field('Supervisor_Visit__c', state =>
    state.data.properties.supervisor_visit
    ? state.supervisorMap[state.data.properties.supervisor_visit]
    : null
    ),
    field('Health_insurance__c', dataValue('properties.health_insurace_cover')),
    field(
    'Health_insurance_active_status__c',
    dataValue('properties.healthinsurance_active')
    ),
    field('Health_insurance_type__c', state => {
    var status = dataValue('properties.health_insurance')(state);
    var value =
    status && status !== ''
    ? status
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return state.insuranceMap[value] || value;
    })
    : undefined;
    return value ? value.join(';') : undefined;
    }),
    field(
    'Other_Health_Insurance__c',
    dataValue('properties.if_other_please_specify')
    ),
    //field('Last_Modified_Date_CommCare__c', dataValue('server_modified_on')),
    field('CommCare_Form_Opened__c', state=> {
    var form_opened = dataValue('properties.last_form_opened_date_and_time')(state);
    var value1 = form_opened.split('-').slice(0, 2).join('-');
    var value2 = form_opened.split('-').slice(2).join('-');
    var formattedValue = [value1, value2].join(' ');
    return new Date(formattedValue).toISOString();
    }),
    field('Case_Closed_Date__c', state => {
    var closed = dataValue('date_closed')(state);
    var date = dataValue('server_modified_on')(state);
    return closed && closed == true ? date : undefined;
    })
    )
    );

    fn(state => { console.log("upsertIf2 done"); return state; });
    fn(state => {
    return new Promise((resolve, reject) => {
    setTimeout(() => {
    console.log('Final 4 second cooldown finished.');
    resolve(state);
    }, 4000);
    });
    });


    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Q3-2022-Upsert-Person-2022-04-21.html b/adaptors/library/jobs/auto/Q3-2022-Upsert-Person-2022-04-21.html index a6be5c7a7bba..d9c077658ce4 100644 --- a/adaptors/library/jobs/auto/Q3-2022-Upsert-Person-2022-04-21.html +++ b/adaptors/library/jobs/auto/Q3-2022-Upsert-Person-2022-04-21.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Q3 2022 Upsert Person

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields, join, map, query, relationship, upsertIf

    Expression

    // create constants and functions
    fn(state => {
    state.cleanChoice = function (state, choice) {
    if (choice) {
    return choice.charAt(0).toUpperCase() + choice.slice(1).replace('_', ' ');
    } else {
    return '';
    }
    };

    state.handleMultiSelect = function (state, multiField) {
    return multiField
    ? multiField
    .replace(/ /gi, ';')
    .toLowerCase()
    .split(';')
    .map(value => {
    return (
    value.charAt(0).toUpperCase() + value.slice(1).replace('_', ' ')
    );
    })
    .join(';')
    : '';
    };

    const pregDangerMap = {
    Vaginal_Bleeding: 'Vaginal Bleeding',
    Water_Breaks: 'Water Breaks before Time of Delivery',
    Prolonged_Labour: 'Prolonged Labour over 12 Hours',
    Convulsions: 'Convulsions or Fits',
    Abdominal_Pain: 'Severe Abdominal Pain before Delivery',
    High_Fever: 'High Fever',
    Low_Baby_Movement: 'Feeling the Baby move less or not at all',
    Swelling: 'Swelling of Face and Hands',
    Severe_Headache: 'Severe or Continuous Headache for more than 12 hours',
    Severe_Vomiting: 'Severe or Continuous Vomiting',
    none: 'None',
    };

    const counselMap = {
    anc_visits: 'ANC Visits',
    early_initiation_of_anc_less_than_3_months:
    'Early initiation of ANC (less than 3 months)',
    completing_recomended_anc_visits: 'Completing recomended ANC visits',
    danger_signs: 'Danger signs',
    skilled_birth: 'Skilled birth',
    immunization: 'Immunization',
    individual_birth_plan: 'Individual Birth Plan',
    emergency_preparedness: 'Emergency preparedness',
    childcare_and_affection: 'Childcare and affection',
    nutrition_counseling: 'Nutrition counseling',
    growth_monitoring: 'Growth monitoring',
    exclusive_breastfeeding: 'Exclusive breastfeeding',
    complementary_feeding: 'Complementary feeding',
    sleeping_under_llitn: 'Sleeping under LLITN',
    knowing_hiv_status: 'Knowing HIV status',
    indoor_pollution: 'Indoor pollution',
    personal_hygiene: 'Personal Hygiene',
    safe_drinking_water: 'Safe drinking water',
    safe_disposal_of_human_waste: 'Safe disposal of human waste',
    };

    const serviceMap = {
    Scheduled_PSC_Apt: 'Scheduled PSC Apt',
    Adverse_Drug_Reaction_Side_Effect: 'Adverse Drug Reaction/Side Effect',
    Malnutrition: 'Malnutrition',
    Malaria: 'Malaria',
    TB: 'TB',
    Treatment_for_Other_OIs: 'Treatment for other Ols',
    ARI: 'ARI',
    Anemia: 'Anemia',
    Diarrhea: 'Diarrhea',
    Pregnancy_Care: 'Pregnancy Care (ANC)',
    Family_Planning: 'Family Planning (FP)',
    Preconception_Counseling: 'Preconception Counseling',
    Injury: 'Injury',
    Other: 'Other',
    };

    const reasonMapping = {
    lack_of_access_to_fp_information: 'Lack of access to FP information',
    no_access_to_fp_services_hospitals:
    'Lack of hospitals or places where FP services can be accessed',
    not_willing_to_use_fp_due_to_negative_effects_myths_and_misconceptions:
    'Myths and misconceptions',
    barriers_at_service_delivery_points: 'Barriers at service delivery points',
    pregnant: 'The client is pregnant',
    intentions_of_getting_pregnant: 'Intentions of getting pregnant',
    not_sexually_active: 'The client is not sexually active',
    other_barriers_culture_male_partners_parents_etc:
    'Other barriers (culture, male partners, parents, etc)',
    };

    const milestoneTypeMap = {
    cognitive_delays_learning_difficulties:
    'Cognitive Delays Learning Difficulties',
    motor_delays: 'Motor Delays',
    speech_and_language_delay: 'Delay Speech and Language Delay',
    social_and_emotional: 'Social and emotional',
    };

    const milestoneMap = {
    movement: 'Movement',
    hearing: 'Hearing',
    communication: 'Communication',
    seeing: 'Seeing',
    cognitive_delays: 'Cognitive Delays',
    play: 'Play',
    };
    const nutritionMap = {
    severe: 'Severely Malnourished',
    moderate: 'Moderately Malnourished',
    normal: 'Normal',
    };

    const fpMethodMap = {
    male_condoms: 'Male condoms',
    female_condoms: 'Female condoms',
    pop: 'POP',
    coc: 'COC',
    emergency_pills: 'Emergency pills',
    none: 'None',
    };

    return {
    ...state,
    counselMap,
    serviceMap,
    reasonMapping,
    milestoneTypeMap,
    milestoneMap,
    nutritionMap,
    pregDangerMap,
    fpMethodMap,
    };
    });

    // get data from SF
    query(
    `SELECT Id, Parent_Geographic_Area__c, Parent_Geographic_Area__r.Name, Parent_Geographic_Area__r.Parent_Geographic_Area__c FROM Location__c WHERE CommCare_User_ID__c = '${dataValue(
    'properties.owner_id'
    )(state)}'`
    );

    // build IDs from queried SF data
    fn(state => ({
    ...state,
    data: {
    ...state.data,
    villageNewId:
    state.references[0].records && state.references[0].records.length !== 0
    ? state.references[0].records[0].Id
    : undefined,
    areaNewId:
    state.references[0].records && state.references[0].records.length !== 0
    ? state.references[0].records[0].Parent_Geographic_Area__c
    : undefined,
    catchmentNewId:
    state.references[0].records && state.references[0].records.length !== 0
    ? state.references[0].records[0].Parent_Geographic_Area__r
    ? state.references[0].records[0].Parent_Geographic_Area__r
    .Parent_Geographic_Area__c
    : undefined
    : undefined,
    },
    }));

    upsertIf(
    state.data.properties.commcare_username !== 'test.2021' &&
    state.data.properties.test_user !== 'Yes',
    'Household__c',
    'CommCare_Code__c',
    fields(
    field('CommCare_Code__c', state => {
    return (
    dataValue('indices.parent.case_id')(state) ||
    dataValue('properties.parent_id')(state)
    );
    })
    )
    ),

    // build sfRecord before upserting
    fn(state => {
    // This mapping was initially constructed with fields(field(), ...) syntax. We
    // preserve it here and use "expandReferences" but could also refactor this to
    // use standard object syntax, as Salesforce looks for { k: v, ... }.
    const originalMapping = fields(
    /* field(
    'deworming_medication__c',
    dataValue('form.TT5.Child_Information.Deworming')
    ),depracated field*/
    field('Source__c', 1),
    field('CommCare_ID__c', dataValue('case_id')),
    relationship(
    'Household__r',
    'CommCare_Code__c', state => {
    // (dataValue('properties.parent_id') || dataValue('indices.parent.case_id'))
    return (
    dataValue('properties.parent_id')(state) ||
    dataValue('indices.parent.case_id')(state)
    );
    }),
    field('commcare_location_id__c',dataValue('properties.commcare_location_id')),
    field('CommCare_Username__c',dataValue('properties.commcare_username')),
    field('Telephone__c', dataValue('properties.contact_phone_number')),
    field(
    'Consent_for_data_use__c',
    dataValue('properties.data_sharing_consent')
    ),
    field('CommCare_HH_Code__c', dataValue('indices.parent.case_id')),
    field('Client_Status__c', dataValue('properties.Client_Status')),
    field('Catchment__c', dataValue('catchmentNewId')),
    field('Area__c', dataValue('areaNewId')),
    field('Household_Village__c', dataValue('villageNewId')),
    field('Name', state => {
    var name1 = dataValue('properties.Person_Name')(state); //check
    var unborn = dataValue('properties.name')(state); //check
    var name2 =
    name1 === undefined || name1 === '' || name1 === null
    ? unborn
    : name1.replace(/\w\S*/g, function (txt) {
    return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
    });
    return name1 !== null ? name2 : 'Unborn Child';
    }),
    field('Chronic_illness__c', state => {
    var choice = dataValue(
    'properties.please_specify_which_chronic_illness_the_person_has'
    )(state);
    var choice2 = state.handleMultiSelect(state, choice);
    return choice2 ? choice2.replace(/_/g, ' ') : '';
    }),
    field(
    'Currently_enrolled_in_school__c',
    dataValue('properties.enrolled_in_school')
    ),
    field('Education_Level__c', state => {
    var level = dataValue('properties.Education_Level')(state);
    return level ? level.toString().replace(/_/g, ' ') : null;
    }),
    field('Relation_to_the_head_of_the_household__c', state => {
    var relation = dataValue('properties.relation_to_hh')(state);
    if (relation) {
    relation = relation.toString().replace(/_/g, ' ');
    var toTitleCase = relation.charAt(0).toUpperCase() + relation.slice(1);
    return toTitleCase;
    }

    return null;
    }),
    field('Gender__c',dataValue('properties.Gender')),
    field('Disability__c', state => {
    var disability = dataValue('properties.disability')(state);
    var toTitleCase =
    disability !== undefined
    ? disability
    .toLowerCase()
    .split(' ')
    .map(word => word.charAt(0).toUpperCase() + word.slice(1))
    .join(';')
    : null;
    return toTitleCase;
    }), //need case property
    field('Other_disability__c', state => {
    var disability = dataValue('properties.other_disability')(state);
    var toTitleCase =
    disability !== undefined
    ? disability
    .toLowerCase()
    .split(' ')
    .map(word => word.charAt(0).toUpperCase() + word.slice(1))
    .join(';')
    : null;
    return toTitleCase;
    }), //need case property

    field('Use_mosquito_net__c', dataValue('properties.sleep_under_net')), //need case property
    // field('Birth_Certificate__c',dataValue('properties.birth_certificate')),
    field('Birth_Certificate__c', dataValue('properties.birth_certificate')),
    field('Child_Status__c', state => {
    var status = dataValue('properties.Child_Status')(state);
    var rt = dataValue('properties.Record_Type')(state); //check that this is the right one
    if (status && rt === 'Unborn') {
    status = 'Unborn';
    } else if (status && rt === 'Born') {
    status = 'Born';
    }
    return status;
    }),
    //===================================================//
    relationship('RecordType', 'Name', state => {
    var rt = dataValue('properties.Record_Type')(state);
    return rt === 'Unborn' || rt === ''
    ? 'Child'
    : rt.toString().replace(/_/g, ' '); //convert Unborn children to Child RT
    }),

    //TT5 Mother Information

    field('MCH_booklet__c', dataValue('properties.mch_booklet')), //need to create a case property
    field('Reason_for_not_taking_a_pregnancy_test__c', state => {
    var reason = dataValue('properties.No_Preg_Test')(state);
    return reason ? reason.toString().replace(/_/g, ' ') : undefined;
    }),
    field('Pregnancy_danger_signs__c', state => {
    var signs = dataValue('properties.pregnancy_danger_signs')(state);
    return signs ? state.pregDangerMap[signs] : undefined;
    }),
    field(
    'Individual_birth_plan_counselling__c',
    dataValue('properties.individual_birth_plan')
    ),
    field('Child_Danger_Signs__c', state => {
    var signs = dataValue('properties.Other_Danger_Signs')(state);
    return signs
    ? signs
    .toLowerCase()
    .split(' ')
    .map(word => word.charAt(0).toUpperCase() + word.slice(1))
    .join(';')
    .toString()
    .replace(/_/g, ' ')
    : signs;
    }),

    //HAWI
    field(
    'Unique_Patient_Code__c',
    dataValue('properties.Unique_Patient_Code')
    ),
    field(
    'Active_in_Support_Group__c',
    dataValue('properties.Active_in_Support_Group')
    ),
    field(
    'Preferred_Care_Facility__c',
    dataValue('properties.Preferred_Care_Facility')
    ),
    field('Currently_on_ART_s__c', dataValue('properties.ART')),
    field('ART_Regimen__c', dataValue('properties.ARVs')),
    field('HAWI_Defaulter__c', state => {
    var hawi = dataValue('properties.default')(state);
    return hawi === 'Yes' ? true : false;
    }),
    field('Date_of_Default__c', dataValue('properties.date_of_default')),
    field('Know_HIV_status__c', dataValue('properties.known_hiv_status')),
    field('HIV_Status__c', dataValue('properties.hiv_status')),
    /*field('HIV_Status__c', state => {
    var status = dataValue('properties.hiv_status')(state);
    return status === 'yes'
    ? 'Known'
    : status === 'no'
    ? 'Unknown'
    : undefined;
    }),//CHECK MAPPING ON THIS ONE*/

    //Illness
    field('Persons_temperature__c', dataValue('properties.temperature')),
    field(
    'Days_since_illness_start__c',
    dataValue('properties.duration_of_sickness')
    ),
    field(
    'Current_Malaria_Status__c',
    dataValue('properties.malaria_test_results')
    ),
    field('Malaria_test__c', dataValue('properties.malaria_test')),
    field(
    'Last_Malaria_Home_Test__c',
    dataValue('properties.malaria_test_date')
    ),
    field('Last_Malaria_Home_Treatment__c', state => {
    var choice = dataValue(
    'properties.malaria_test_date'
    )(state);
    return state.cleanChoice(state, choice);
    }),
    /*field('Current_Malaria_Status__c', dataValue('form.Malaria_Status')),//check
    field('Malaria_Facility__c',dataValue('form.treatment_and_tracking.malaria_referral_facility')),
    field('Fever_over_7days__c',dataValue('form.treatment_and_tracking.symptoms_check_fever')),//check*/
    field('Cough_over_14days__c', dataValue('properties.symptoms_check_cough')),
    /*field('Diarrhoea_over_14days__c',dataValue('form.treatment_and_tracking.symptoms_check_diarrhea')),//check
    field('Diarrhoea_less_than_14_days__c',dataValue('form.treatment_and_tracking.mild_symptoms_check_diarrhea')),//check*/
    field(
    'TB_patients_therapy_observed__c',
    dataValue('properties.observed_tb_therapy')
    ),
    field('Injuries_or_wounds__c', dataValue('properties.wounds_or_injuries')),
    field(
    'Pulse_Oximeter__c',
    dataValue('properties.pulse_oximeter_available')
    ),
    field(
    'Heart_Rate_Pulse_Oximeter__c',
    dataValue('properties.heart_rate_pulse_oximeter')
    ),
    field(
    'Oxygen_Concentration_Pulse_Oximeter__c',
    dataValue('properties.oxygen_concentration')
    ),
    field('Can_child_drink__c', dataValue('properties.can_child_drink')),
    // field('Antibiotic_provided_for_fast_breathing__c',dataValue('properties.antibiotic_fast_breathing')),
    field('Antibiotic_provided_for_fast_breathing__c', state => {
    var choice = dataValue('properties.antibiotic_fast_breathing')(state);
    return state.cleanChoice(state, choice);
    }),
    // field('Antibiotic_provided_for_chest_indrawing__c',dataValue('properties.antibiotic_chest_indrawing')),
    field('Antibiotic_provided_for_chest_indrawing__c', state => {
    var choice = dataValue('properties.antibiotic_chest_indrawing')(state);
    return state.cleanChoice(state, choice);
    }),
    /*field('Child_zinc__c',dataValue('form.TT5.Child_Information.Clinical_Services.diarrhea_clinic_treatment_zinc')),//check
    field('Child_ORS__c',dataValue('form.TT5.Child_Information.Clinical_Services.diarrhea_clinic_treatment_ORS')),//check
    field('Childs_breath_per_minute__c',dataValue('form.psbi.breaths_per_minuite')),//check
    field('Child_chest_in_drawing__c',dataValue('form.psbi.Child_chest_in_drawing_c')),//check*/
    field('Default_on_TB_treatment__c', state => {
    var choice = dataValue('properties.default_tb_treatment')(state); //check
    return state.cleanChoice(state, choice);
    }),
    field('Treatment_Distribution__c', state => {
    var choice = dataValue('properties.distributed_treatments')(state);
    return state.cleanChoice(state, choice);
    }), //check

    //Delivery
    field(
    'Immediate_Breastfeeding__c',
    dataValue('properties.Breastfeeding_Delivery')
    ),
    field('Place_of_Delivery__c', state => {
    var facility = dataValue('properties.Delivery_Type')(state);
    return facility === 'Skilled'
    ? 'Facility'
    : facility === 'Unskilled'
    ? 'Home'
    : undefined;
    }),
    field('Delivery_Facility__c', state => {
    var facility = dataValue('properties.Delivery_Facility')(state);
    return facility ? facility.toString().replace(/_/g, ' ') : null;
    }),
    /* field('Delivery_Facility__c', state => {
    //HMN 21//11/2022
    var birthFacility =dataValue('properties.Birth_Facility')(state);
    var deliveryFacility = dataValue('properties.Delivery_Facility')(state);
    var facilityOfBirth = dataValue ('properties.Facility_of_Birth')(state);
    var faciliy_val =
    facilityOfBirth //!== undefined || facilityOfBirth !== '' || facilityOfBirth !== null
    ? facilityOfBirth
    :birthFacility //!== undefined || birthFacility !== '' || birthFacility !== null
    ? birthFacility
    :deliveryFacility //!== undefined || deliveryFacility !== '' || deliveryFacility !== null
    ? deliveryFacility
    :"";
    return faciliy_val.toString().replace(/_/g, ' ');
    //HMN
    }), */
    //field('Delivery_Facility__c', state => {
    // var facility = dataValue('properties.Birth_Facility')(state);
    // return facility ? facility.toString().replace(/_/g, ' ') : null;
    //}),
    field(
    'Delivery_Facility_Other__c',
    dataValue('properties.Delivery_Facility_Other')
    ),

    //Family Planning

    field('LMP__c', dataValue('properties.LMP')),
    field('Family_Planning__c', dataValue('properties.family_planning')),
    field(
    'Family_Planning_Method__c',
    dataValue('properties.family_planning_method')
    ),
    field('FP_Method_Distributed__c', state => {
    var status = dataValue('properties.FP_commodity')(state);
    var value =
    status && status !== ''
    ? status
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return state.fpMethodMap[value] || value;
    })
    : undefined;
    return value ? value.join(';') : undefined;
    }),
    field('Reasons_for_not_taking_FP_method__c', state => {
    var status = dataValue('properties.No_FPmethod_reason')(state);
    var value =
    status && status !== ''
    ? status
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return state.reasonMapping[value] || value;
    })
    : undefined;
    return value ? value.join(';') : undefined;
    }),
    field('Pregnant__c', state => {
    var preg = dataValue('properties.Pregnant')(state);
    return preg === 'Yes' ? true : false;
    }),
    field('Date_of_Delivery__c', dataValue('properties.delivery_date')),
    field(
    'Counselled_on_FP_Methods__c',
    dataValue('properties.CounselledFP_methods')
    ),
    field('Client_counselled_on__c', state => {
    var choices =
    dataValue('properties.counsel_topic')(state) ||
    dataValue('properties.counsel_topic')(state); //need to create a case property
    var choiceGroups = choices ? choices.split(' ') : null;
    var choicesMulti = choiceGroups
    ? choiceGroups
    .map(cg => {
    return state.counselMap[cg];
    })
    .join(';')
    : choiceGroups;
    return choicesMulti;
    }), //OpenFn Question - can this be simplified now that this is a case property
    field('Client_provided_with_FP__c', state => {
    var choice = dataValue(
    'properties.was_the_woman_15-49yrs_provided_with_family_planning_commodities_by_chv'
    )(state);
    return state.cleanChoice(state, choice);
    }),
    field(
    'Received_pregnancy_test__c',
    dataValue('properties.did_you_adminsiter_a_pregnancy_test')
    ),
    field(
    'Pregnancy_test_result__c',
    dataValue('properties.pregnancy_test_result')
    ),
    field('Gravida__c', dataValue('properties.Gravida')),
    field('Parity__c', dataValue('properties.Parity')),

    //TT5 Child Information

    field(
    'Exclusive_Breastfeeding__c',
    dataValue('properties.Exclusive_Breastfeeding')
    ),
    field(
    'Counselled_on_Exclusive_Breastfeeding__c',
    dataValue('properties.counseling')
    ),
    field(
    'Newborn_visited_48_hours_of_delivery__c',
    dataValue('properties.newborn_visited_48_hours_of_delivery')
    ),
    field('Newborn_visit_counselling__c', state => {
    var choice = dataValue('properties.did_you_consel_the_mother_on1')(state);
    return state.cleanChoice(state, choice);
    }),
    field(
    'mother_visited_48_hours_of_the_delivery__c',
    dataValue('properties.visit_mother_48')
    ),
    /*
    //HMN -06012023- The object Visit_after_unskilled__c seems to be missing in sfRecord
    //Investigation issue https://lwala.atlassian.net/browse/LWAL-716 raised
    //Meanwhile this is being removed to allow re-processing
    field(
    'Visit_after_unskilled__c',
    dataValue('properties.visit_24hours_after_unskilled_delivery')
    ),
    */
    field('Mother_visit_counselling__c', state => {
    var choice = dataValue('properties.did_you_consel_the_mother_on2')(state);
    return state.cleanChoice(state, choice);
    }),
    /*field('Newborn_visited_48_hours_of_delivery__c',dataValue('properties.newborn_visited_48_hours_of_delivery')), Duplicate Mapping*/
    field(
    'Newborn_visited_by_a_CHW_within_6_days__c',
    dataValue('properties.visit_6_days_from_delivery')
    ),

    //Nutrition

    field(
    'Caretaker_action_after_muac_screening__c',
    dataValue('properties.mother_screened_muac_action')
    ),
    field(
    'Caretaker_muac_findings__c',
    dataValue('properties.mother_screened_child_muac_result')
    ),
    field('Food_groups_3_times_a_day__c',dataValue('properties.food_groups')),
    // field('Caretaker_screened_for_muac_this__c', dataValue('properties.mother_screened_child_muac')),
    field('Caretaker_screened_for_muac_this__c', state => {
    var choice = dataValue('properties.mother_screened_child_muac')(state); //check
    return state.cleanChoice(state, choice);
    }),
    // field('Caretaker_trained_in_muac__c', dataValue('properties.mother_trained_muac')),
    field('Caretaker_trained_in_muac__c', state => {
    var choice = dataValue('properties.mother_trained_muac')(state); //check
    return state.cleanChoice(state, choice);
    }),
    field(
    'of_Caretaker_MUAC_screenings__c',
    dataValue('properties.mother_nb_screening')
    ),
    field('Current_Weight__c', dataValue('properties.Current_Weight')), //Only on task update
    field('Current_Height__c', dataValue('properties.current_height')),
    field('Current_MUAC__c', dataValue('properties.MUAC')),
    field('Current_Nutrition_Status__c', state => {
    var status = dataValue('properties.Nutrition_Status')(state);
    return status ? state.nutritionMap[status] : undefined;
    }),

    //TT5 & HAWI
    field('TT5_Mother_Registrant__c', state => {
    var preg = dataValue('properties.Pregnant')(state);
    return preg == 'Yes' ? 'Yes' : null;
    }),
    field('Enrollment_Date__c', state => {
    var age = dataValue('properties.age')(state);
    var date = dataValue('server_date_modified')(state);
    var preg = dataValue('properties.Pregnant')(state);
    return age < 5 || preg == 'Yes' ? date : null;
    }),
    field('HAWI_Enrollment_Date__c', state => {
    var date = dataValue('server_date_modified')(state);
    var status = dataValue('properties.hiv_status')(state);
    return status == 'positive' ? date : null;
    }),
    field('Thrive_Thru_5_Registrant__c', state => {
    var age = dataValue('properties.age')(state);
    var preg = dataValue('properties.Pregnant')(state);
    return age < 5 || preg == 'Yes' ? 'Yes' : 'No';
    }), //check mapping
    field('HAWI_Registrant__c', state => {
    var status = dataValue('properties.hiv_status')(state);
    return status == 'positive' ? 'Yes' : 'No';
    }),

    //ANC
    field('ANC_1__c', state => {
    var date = dataValue('properties.ANC_1')(state);
    return date && date !== '' ? date : undefined;
    }),
    field('ANC_2__c', state => {
    var date = dataValue('properties.ANC_2')(state);
    return date && date !== '' ? date : undefined;
    }),
    field('ANC_3__c', state => {
    var date = dataValue('properties.ANC_3')(state);
    return date && date !== '' ? date : undefined;
    }),
    field('ANC_4__c', state => {
    var date = dataValue('properties.ANC_4')(state);
    return date && date !== '' ? date : undefined;
    }),
    field('ANC_5__c', state => {
    var date = dataValue('properties.ANC_5')(state);
    return date && date !== '' ? date : undefined;
    }),
    field('Date_of_Birth__c', state => {
    var date = dataValue('properties.DOB')(state);
    return date && date !== '' ? date : undefined;
    }),

    //Immunization

    field(
    'Child_missed_immunization_type__c',
    dataValue('form.TT5.Child_Information.Immunizations.immunization_type')
    ), //check
    field('BCG__c', dataValue('properties.BCG')),
    field('OPV_0__c', dataValue('properties.OPV_0')),
    field('Measles_6__c', dataValue('properties.Measles_6')),
    field('Measles_9__c', dataValue('properties.Measles_9')),
    field('Measles_18__c', dataValue('properties.Measles_18')),
    field('OPV_1__c', dataValue('properties.OPV_PCV_Penta_1')),
    field('OPV_2__c', dataValue('properties.OPV_PCV_Penta_2')),
    field('OPV_3__c', dataValue('properties.OPV_PCV_Penta_3')),
    field('Rotavirus_1__c', dataValue('properties.rotavirus_1')),
    field('Rotavirus_2__c', dataValue('properties.rotavirus_2')),
    field('IPV__c', dataValue('properties.IPV')),
    field('Vitamin_A_12__c', dataValue('properties.Vitamine_A')),
    field('Vitamin_A_18__c', dataValue('properties.Vitamine_A_2')),
    field('Vitamin_A_24__c', dataValue('properties.Vitamine_A_3')),
    field('Deworming_12__c', dataValue('properties.Deworming_1')),
    field('Deworming_18__c', dataValue('properties.Deworming_2')),
    field('Deworming_24__c', dataValue('properties.Deworming_3')),

    //ECD
    // field('Did_you_counsel_caregiver_on__c',dataValue('properties.did_you_counsel_the_caregiver_on_delayed_milestones')),
    field('Did_you_counsel_caregiver_on__c', state => {
    var choice = dataValue(
    'properties.did_you_counsel_the_caregiver_on_delayed_milestones'
    )(state);
    return state.cleanChoice(state, choice);
    }),
    // field('Delayed_Milestone__c',dataValue('properties.does_the_child_has_a_delayed_milestone')),
    field('Delayed_Milestone__c', state => {
    var choice = dataValue(
    'properties.does_the_child_has_a_delayed_milestone'
    )(state);
    return state.cleanChoice(state, choice);
    }),
    // field('Child_has_2_or_more_play_items__c',dataValue('properties.does_the_child_has_2_or_more_play_items_at_home')),
    field('Child_has_2_or_more_play_items__c', state => {
    var choice = dataValue(
    'properties.does_the_child_has_2_or_more_play_items_at_home'
    )(state);
    return state.cleanChoice(state, choice);
    }),
    // field('Child_has_3_or_more_picture_books__c',dataValue('properties.does_the_child_has_3_or_more_picture_books')),
    field('Child_has_3_or_more_picture_books__c', state => {
    var choice = dataValue(
    'properties.does_the_child_has_3_or_more_picture_books'
    )(state);
    return state.cleanChoice(state, choice);
    }),
    field('Delayed_Milestones_Counselled_On__c', state => {
    var ms = dataValue(
    'properties.which_delayed_milestone_area_did_you_counsel_the_caregiver_on'
    )(state);
    return ms ? state.milestoneMap[ms] : undefined;
    }),
    field('Delayed_Milestone_Type__c', state => {
    var ms = dataValue('properties.which_delayed_milestone')(state);
    return ms ? state.milestoneTypeMap[ms] : undefined;
    }),

    //Death
    field('Date_of_Death__c', dataValue('properties.Date_of_Death')),
    field('Cause_of_Death__c', state => {
    var death = dataValue('properties.cause_of_death_dead')(state);
    return death ? death.toString().replace(/_/g, ' ') : death;
    }), //check which case property to use - there are 2
    field('Verbal_autopsy__c', dataValue('properties.verbal_autopsy')),

    //Closing
    field('Last_Modified_Date_CommCare__c', dataValue('date_modified')),
    field('Case_Closed_Date__c',dataValue('date_closed')),
    //field('Case_Closed_Date__c', state => {
    // var closed = dataValue('date_closed')(state);
    // var date = dataValue('date_modified')(state);
    // return closed && closed == true ? date : undefined;
    //}) //need case property
    );

    let sfRecord = expandReferences(originalMapping)(state);

    Object.entries(sfRecord).forEach(([key, value]) => {
    if (value === '') sfRecord[key] = undefined;
    });

    return { ...state, sfRecord };
    });

    // upsert data to SF
    upsertIf(
    state.data.properties.commcare_username !== 'test.2021' &&
    state.data.properties.test_user !== 'Yes' ,
    'Person__c', 'CommCare_ID__c', state => state.sfRecord);

    upsertIf(
    state.data.properties.commcare_username !== 'test.2021' &&
    state.data.properties.test_user !== 'Yes' &&
    state.data.properties.caretaker_case_id !== undefined && state.data.properties.caretaker_case_id !== '',
    'Person__c', 'CommCare_ID__c',
    fields(
    relationship('Primary_Caregiver_Lookup__r', 'CommCare_ID__c', state => {
    return caregiver = dataValue('properties.caretaker_case_id')(state);
    }),
    field('CommCare_ID__c', dataValue('case_id')),
    )
    );

    upsertIf(
    state.data.properties.commcare_username !== 'test.2021' &&
    state.data.properties.test_user !== 'Yes' &&
    state.data.properties.mother_case_id !== undefined && state.data.properties.mother_case_id !== '',
    'Person__c', 'CommCare_ID__c',
    fields(
    relationship('Mother__r', 'CommCare_ID__c', state => {
    return caregiver = dataValue('properties.mother_case_id')(state);
    }),
    field('CommCare_ID__c', dataValue('case_id')),
    )
    );

    upsertIf(
    state.data.properties.commcare_username !== 'test.2021' &&
    state.data.properties.test_user !== 'Yes' &&
    state.data.properties.head_of_household_case_id !== undefined && state.data.properties.head_of_household_case_id !== '',
    'Household__c', 'CommCare_Code__c',
    fields(
    field('CommCare_Code__c', state => {
    return (
    dataValue('indices.parent.case_id')(state) ||
    dataValue('properties.parent_id')(state)
    )
    }),
    relationship('Head_of_Household__r', 'CommCare_ID__c', dataValue('properties.head_of_household_case_id')),
    )
    )

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Q3-2022-Upsert-Person-Visit-2022-06-28.html b/adaptors/library/jobs/auto/Q3-2022-Upsert-Person-Visit-2022-06-28.html index a4521b74710d..f4cd00e6bc5d 100644 --- a/adaptors/library/jobs/auto/Q3-2022-Upsert-Person-Visit-2022-06-28.html +++ b/adaptors/library/jobs/auto/Q3-2022-Upsert-Person-Visit-2022-06-28.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Q3 2022 Upsert Person Visit

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields, join, map, query, relationship, upsertIf

    Expression

    //UPSERT PERSON VISIT
    query(
    `SELECT Id, Parent_Geographic_Area__c, Parent_Geographic_Area__r.Name, Parent_Geographic_Area__r.Parent_Geographic_Area__c FROM Location__c WHERE CommCare_User_ID__c = '${dataValue(
    'properties.owner_id'
    )(state)}'`
    );

    fn(state => {
    state.cleanChoice = function (state, choice) {
    if (choice) {
    return choice.charAt(0).toUpperCase() + choice.slice(1).replace('_', ' ');
    } else {
    return '';
    }
    };

    fn(state => ({
    ...state,
    data: {
    ...state.data,
    catchmentNewId:
    state.references[0].records && state.references[0].records.length !== 0
    ? (state.references[0].records[0].Parent_Geographic_Area__r
    ? state.references[0].records[0].Parent_Geographic_Area__r.Parent_Geographic_Area__c
    : undefined)
    : undefined,
    },
    }));

    state.handleMultiSelect = function (state, multiField) {
    return multiField
    ? multiField
    .replace(/ /gi, ';')
    .toLowerCase()
    .split(';')
    .map(value => {
    return (
    value.charAt(0).toUpperCase() + value.slice(1).replace('_', ' ')
    );
    })
    .join(';')
    : '';
    };

    state.handleMultiSelectOriginal = function (state, multiField) {
    return multiField
    ? multiField
    .replace(/ /gi, ';')
    .toLowerCase()
    .split(';')
    .map(value => {
    return (
    value
    );
    })
    .join(';')
    : '';
    };

    const pregDangerMap = {
    Vaginal_Bleeding: 'Vaginal Bleeding',
    Water_Breaks: 'Water Breaks before Time of Delivery',
    Prolonged_Labour: 'Prolonged Labour over 12 Hours',
    Convulsions: 'Convulsions or Fits',
    Abdominal_Pain: 'Severe Abdominal Pain before Delivery',
    High_Fever: 'High Fever',
    Low_Baby_Movement: 'Feeling the Baby move less or not at all',
    Swelling: 'Swelling of Face and Hands',
    Severe_Headache: 'Severe or Continuous Headache for more than 12 hours',
    Severe_Vomiting: 'Severe or Continuous Vomiting',
    none: 'None',
    };

    const counselMap = {
    anc_visits: 'ANC Visits',
    early_initiation_of_anc_less_than_3_months:
    'Early initiation of ANC (less than 3 months)',
    completing_recomended_anc_visits: 'Completing recomended ANC visits',
    danger_signs: 'Danger signs',
    skilled_birth: 'Skilled birth',
    immunization: 'Immunization',
    individual_birth_plan: 'Individual Birth Plan',
    emergency_preparedness: 'Emergency preparedness',
    childcare_and_affection: 'Childcare and affection',
    nutrition_counseling: 'Nutrition counseling',
    growth_monitoring: 'Growth monitoring',
    exclusive_breastfeeding: 'Exclusive breastfeeding',
    complementary_feeding: 'Complementary feeding',
    sleeping_under_llitn: 'Sleeping under LLITN',
    knowing_hiv_status: 'Knowing HIV status',
    indoor_pollution: 'Indoor pollution',
    personal_hygiene: 'Personal Hygiene',
    safe_drinking_water: 'Safe drinking water',
    safe_disposal_of_human_waste: 'Safe disposal of human waste',
    };

    const serviceMap = {
    Scheduled_PSC_Apt: 'Scheduled PSC Apt',
    Adverse_Drug_Reaction_Side_Effect: 'Adverse Drug Reaction/Side Effect',
    Malnutrition: 'Malnutrition',
    Malaria: 'Malaria',
    TB: 'TB',
    Treatment_for_Other_OIs: 'Treatment for other Ols',
    ARI: 'ARI',
    Anemia: 'Anemia',
    Diarrhea: 'Diarrhea',
    Pregnancy_Care: 'Pregnancy Care (ANC)',
    Family_Planning: 'Family Planning (FP)',
    Preconception_Counseling: 'Preconception Counseling',
    Injury: 'Injury',
    Other: 'Other',
    };

    const reasonMap = {
    lack_of_access_to_fp_information: 'Lack of access to FP information',
    no_access_to_fp_services_hospitals:
    'Lack of hospitals or places where FP services can be accessed',
    not_willing_to_use_fp_due_to_negative_effects_myths_and_misconceptions:
    'Myths and misconceptions',
    barriers_at_service_delivery_points: 'Barriers at service delivery points',
    pregnant: 'The client is pregnant',
    intentions_of_getting_pregnant: 'Intentions of getting pregnant',
    not_sexually_active: 'The client is not sexually active',
    other_barriers_culture_male_partners_parents_etc:
    'Other barriers (culture, male partners, parents, etc)',
    };

    const milestoneTypeMap = {
    cognitive_delays_learning_difficulties:
    'Cognitive Delays Learning Difficulties',
    motor_delays: 'Motor Delays',
    speech_and_language_delay: 'Delay Speech and Language Delay',
    social_and_emotional: 'Social and emotional',
    };

    const milestoneMap = {
    movement: 'Movement',
    hearing: 'Hearing',
    communication: 'Communication',
    seeing: 'Seeing',
    cognitive_delays: 'Cognitive Delays',
    play: 'Play',
    };
    const nutritionMap = {
    severe: 'Severely Malnourished',
    moderate: 'Moderately Malnourished',
    normal: 'Normal',
    };

    const fpMethodMap = {
    male_condoms: "Male condoms",
    female_condoms: "Female condoms",
    pop: "POP",
    coc: "COC",
    emergency_pills: "Emergency pills",
    none: "None",
    //HMN -12/01/2023-
    //adding normalization for the family_planning_method to Family_Planning_Method__c
    iucd: "IUCD",
    condoms: "Condoms",
    depo:"Depo",
    implant: "Implant",
    injection: "Injection",
    pills: "Pills",
    traditional: "Traditional"
    };

    const symptomsMap = {
    convulsions: 'Convulsions',
    not_able_to_eatdrink: 'Not able to drink or feed at all',
    vomits_everything: 'Vomits everything',
    'chest_in-drawing': 'Chest in - drawing',
    unusually_sleepyunconscious: 'Unusually sleepy or unconscious',
    swelling_of_both_feet: 'Swelling of both feet',
    none: "None",
    };

    const supervisorMap ={
    community_health_nurse: "Community_health_nurse",
    chw_supervisor: "CHW_supervisor",
    chewschas: "Chewschas",
    other: "Other",
    none: "None"
    };

    const treatmentDistributionMap = {
    ors_205gltr_sachets: 'ORS (20.5h/ltr): Sachets',
    acts_6s: 'ACTs (6s)',
    acts_12s: 'ACTs (12s)',
    acts_18s: 'ACTs (18s)',
    acts_24s: 'ACTs (24s)',
    albendazole_abz_tabs: 'Albendazole (ABZ): Tabs',
    paracetamol_tabs: 'Tetracycline Eye Ointment (TEO): 1%:tube',
    tetracycline_eye_ointment_teo_1_tube: 'Tetracycline Eye Ointment (TEO): 1%:tube',
    amoxycillin: 'Amoxycillin (125mg/5mls: Bottle',
    none: 'None'
    };

    const childDangerSignsMap = {
    none: 'None',
    Poor_Breastfeeding: 'Poor Breastfeeding',
    not_able_to_feed_since_birth_or_stopped_feeding_well: 'Not able to feed since birth, or stopped feeding well',
    not_able_to_breastfeed: 'Not able to breastfeed',
    Fever: 'Fever',
    very_low_temperature: 'Very low temperature (35.4 C or less)',
    shivering: 'Shivering',
    Fast_Breathing: 'Fast Breathing',
    Very_Sleepy: 'Very Sleepy',
    Convulsions_and_Fits: 'Convulsions and Fits',
    only_moves_when_stimulated_or_does_not_move_even_on_stimulation: 'Only moves when stimulated, or does not move even on stimulation',
    yellow_solebaby_body_turning_yellow_especially_eyes_palms_soles: 'Yellow sole(Baby body turning yellow especially eyes, palms,soles)',
    bleeding_from_the_umbilical_stump: 'Bleeding from the umbilical stump',
    signs_of_local_infection_umbilicus_is_red_or_draining_pus_skin_boils_or_eye: 'Signs of local infection: umbilicus is red or draining pus, skin boils, or eyes draining pus',
    weight_chart_using_color_coded_scales_if_red_or_yellowweight_below_25kg_or_: 'Weight chart using color coded scales if RED or YELLOW(Weight below 2.5kg or born less than 36 weeks of age)',
    unable_to_cry: 'Unable to cry',
    cyanosis: 'Cyanosis',
    bulging_fontanelle: 'Bulging fontanelle'
    }

    return {
    ...state,
    counselMap,
    serviceMap,
    reasonMap,
    milestoneTypeMap,
    milestoneMap,
    nutritionMap,
    pregDangerMap,
    fpMethodMap,
    symptomsMap,
    supervisorMap,
    treatmentDistributionMap,
    childDangerSignsMap
    };
    });

    upsertIf(
    // state.data.properties.username !== 'openfn.test' &&
    state.data.properties.username !== 'test.2021' &&
    state.data.properties.test_user !== 'Yes' ,
    'Person_visit__c',
    'CommCare_ID__c',
    fields(
    //field('CommCare_ID__c', dataValue('form.case.@case_id')),
    // field('CommCare_ID__c', dataValue('id')),
    //field('CommCare_ID__c', state => {
    // var case_id = dataValue('case_id')(state);
    // var submitted = dataValue('properties.last_form_opened_date_and_time')(state);
    // return case_id + '_' + submitted;
    //}),
    field('CommCare_ID__c',dataValue('case_id')),

    relationship(
    'Person__r',
    'CommCare_ID__c',
    dataValue('indices.parent.case_id')
    ),
    /*relationship(
    'Household_CHW__r',
    'CommCare_ID__c',
    dataValue('properties.sfid')),*/
    // field('CommCare_Visit_ID__c',dataValue('metadata.instanceID')),
    field('CommCare_Visit_ID__c', state => {
    var case_id = dataValue('case_id')(state);
    var submitted = dataValue('properties.last_form_opened_date_and_time')(state);
    return case_id + '_' + submitted;
    }),
    field('Date__c',dataValue('properties.Date')),
    field('Form_Submitted__c', dataValue('properties.last_form_opened_name')),
    field('Birth_Status__c',dataValue('properties.child_status')),
    field('Catchment__c', dataValue('catchmentNewId')),
    /*
    //HMN 05/01/2022 Caused alot of failures, removed this RecordType Field
    relationship('RecordType', 'Name', state => {
    var rt = dataValue('properties.RecordType')(state);
    if (rt === 'Unborn' || rt === 'Child') {
    return 'Child Visit';
    };
    if (rt === 'Youth') {
    return 'Youth Visit';
    };
    if (rt === 'Male Adult') {
    return 'Adult Male Visit';
    };
    if (rt === 'Female Adult') {
    return 'Adult Female Visit';
    };
    }),*/
    field('Use_mosquito_net__c', state => {
    var choice = dataValue(
    'properties.sleep_under_net'
    )(state);
    return state.cleanChoice(state, choice);
    }),
    field(
    'Individual_birth_plan_counselling__c',
    dataValue('properties.individual_birth_plan')
    ),
    field('Reason_for_not_taking_a_pregnancy_test__c', state => {
    var reason = dataValue('properties.No_Preg_Test')(state);
    return reason ? reason.toString().replace(/_/g, ' ') : undefined;
    }),
    field('Pregnancy_danger_signs__c', state => {
    var signs = dataValue(
    'properties.No_Preg_Test'
    )(state);
    return signs ? state.pregDangerMap[signs] : undefined;
    }),
    field('Child_Danger_Signs__c', state => {
    var signs = dataValue(
    'properties.Other_Danger_Signs'
    )(state);
    return signs ? state.childDangerSignsMap[signs] : undefined
    }),
    field('Current_Malaria_Status__c', state => {
    var choice = dataValue(
    'properties.malaria_test_results'
    )(state);
    return state.cleanChoice(state, choice);
    }),
    field('Malaria_Home_Test__c', dataValue('properties.malaria_test_date')),
    /*field('Current_Malaria_Status__c', state => {
    var choice = dataValue(
    'properties.Malaria_Status'
    )(state);
    return state.cleanChoice(state, choice);
    }),*/
    // field('Malaria_Home_Treatment__c',dataValue('form.treatment_and_tracking.home_treatment')),
    field('Malaria_Home_Treatment__c', dataValue('properties.malaria_test_date')),
    field('Persons_symptoms__c', state => {
    var check = dataValue('properties.symptoms_check_other')(state);
    var value =
    check && check !== ''
    ? check
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return state.symptomsMap[value] || value;
    })
    : undefined;
    return value ? value.join(';') : undefined;
    }),
    field('Active_in_Support_Group__c', dataValue('properties.Active_in_Support_Group')),
    field('HAWI_Defaulter__c', state => {
    var hawi = dataValue('properties.default')(state);
    return hawi === 'Yes' ? true : false;
    }),
    field(
    'Date_of_Default__c',
    dataValue('properties.date_of_default')
    ),
    field(
    'Persons_temperature__c',
    dataValue('properties.temperature')
    ),
    field(
    'Days_since_illness_start__c',
    dataValue('properties.duration_of_sickness')
    ),
    field(
    'Newborn_visited_48_hours_of_delivery__c',
    dataValue(
    'properties.newborn_visited_48_hours_of_delivery'
    )
    ),
    field(
    'Newborn_visited_by_a_CHW_within_6_days__c',
    dataValue('properties.visit_6_days_from_delivery')
    ),
    field(
    'Current_Malaria_Status__c',
    dataValue('properties.malaria_test_results')
    ),
    field('Malaria_test__c', state => {
    var choice = dataValue(
    'properties.malaria_test'
    )(state);
    return state.cleanChoice(state, choice);
    }),
    field('Fever__c', state => {
    var choice = dataValue(
    'properties.symptoms_check_fever'
    )(state);
    return state.cleanChoice(state, choice);
    }),
    field('Cough__c', state => {
    var choice = dataValue(
    'properties.symptoms_check_cough'
    )(state);
    return state.cleanChoice(state, choice);
    }),
    field('Diarrhoea__c', state => {
    var choice = dataValue(
    'properties.symptoms_check_diarrhea'
    )(state);
    return state.cleanChoice(state, choice);
    }),
    field(
    'TB_patients_therapy_observed__c',
    dataValue('properties.observed_tb_therapy')
    ),
    field(
    'Injuries_or_wounds__c',
    dataValue('properties.wounds_or_injuries')
    ),
    field('Currently_on_ART_s__c', dataValue('properties.ART')),
    /*field('ART_Regimen__c', state => {
    var choice = dataValue(
    'properties.ARVs'
    )(state);
    return state.cleanChoice(state, choice);
    }),*/
    field(
    'Immediate_Breastfeeding__c',
    dataValue(
    'properties.Breastfeeding_Delivery'
    )
    ),
    field(
    'Exclusive_Breastfeeding__c',
    dataValue(
    'properties.Exclusive_Breastfeeding'
    )
    ),
    field(
    'Counselled_on_Exclusive_Breastfeeding__c',
    dataValue('properties.counseling')
    ),
    field('LMP__c',dataValue('properties.when_was_your_lmp')),
    field('Family_Planning__c', state => {
    var choice = dataValue(
    'properties.family_planning'
    )(state);
    return state.cleanChoice(state, choice);
    }),
    //HMN 12/01/2023 Failures on picklist within Salesforce
    /*
    field(
    'Family_Planning_Method__c',
    dataValue('properties.family_planning_method')
    ),*/
    field('Family_Planning_Method__c', state => {
    //var status = dataValue('form.treatment_and_tracking.distribution.distributed_treatments')(state);
    var status = dataValue('properties.family_planning_method')(state);
    var value =
    status && status !== ''
    ? status
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return state.fpMethodMap[value] || value;
    })
    : undefined;
    return value ? value.join(';') : undefined;
    }),
    field('FP_Method_Distributed__c', state => {
    //var status = dataValue('form.treatment_and_tracking.distribution.distributed_treatments')(state);
    var status = dataValue('properties.FP_commodity')(state);
    var value =
    status && status !== ''
    ? status
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return state.fpMethodMap[value] || value;
    })
    : undefined;
    return value ? value.join(';') : undefined;
    }),
    field('Reasons_for_not_taking_FP_method__c', state => {
    // var reason = dataValue('form.TT5.Mother_Information.No_FPmethod_reason')(state);
    // return reason ? state.reasonMap[reason] : undefined;
    var status = dataValue('properties.No_FPmethod_reason')(state);
    var value =
    status && status !== ''
    ? status
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return state.reasonMap[value] || value;
    })
    : undefined;
    return value ? value.join(';') : undefined;
    }),
    field('Pregnant__c', state => {
    var preg = dataValue('properties.Pregnant')(state);
    return preg === 'Yes' ? true : false;
    }),
    field('Counselled_on_FP_Methods__c', state => {
    var choice = dataValue(
    'properties.CounselledFP_methods'
    )(state);
    return state.cleanChoice(state, choice);
    }),
    field('Client_counselled_on__c', state => {
    var choices =
    dataValue('properties.counsel_topic')(
    state
    ) || dataValue('properties.counsel_topic')(state);
    var choiceGroups = choices ? choices.split(' ') : null;
    var choicesMulti = choiceGroups
    ? choiceGroups
    .map(cg => {
    return state.counselMap[cg];
    })
    .join(';')
    : choiceGroups;
    return choicesMulti;
    }),
    field('Client_provided_with_FP__c', state => {
    var choice = dataValue(
    'properties.was_the_woman_15-49yrs_provided_with_family_planning_commodities_by_chv'
    )(state);
    return state.cleanChoice(state, choice);
    }),
    field(
    'Newborn_visited_48_hours_of_delivery__c',
    dataValue(
    'properties.newborn_visited_48_hours_of_delivery'
    )
    ),
    field('Mother_visit_counselling__c', state => {
    var choice = dataValue(
    'properties.did_you_consel_the_mother_on1'
    )(state);
    return state.handleMultiSelectOriginal(state, choice);
    }),
    field(
    'mother_visited_48_hours_of_the_delivery__c',
    dataValue('properties.visit_mother_48')
    ),
    field('Newborn_visit_counselling__c', state => {
    var choice = dataValue(
    'properties.did_you_consel_the_mother_on2'
    )(state);
    return state.handleMultiSelectOriginal(state, choice);
    }),
    field('Know_HIV_status__c', state => {
    var choice = dataValue(
    'properties.known_hiv_status'
    )(state);
    return state.cleanChoice(state, choice);
    }),
    field('HIV_Status__c', dataValue('properties.hiv_status')),
    field('Treatment_Distribution__c', state => {
    //var status = dataValue('form.treatment_and_tracking.distribution.distributed_treatments')(state);
    var status = dataValue('properties.distributed_treatments')(state);
    var value =
    status && status !== ''
    ? status
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return state.treatmentDistributionMap[value] || value;
    })
    : undefined;
    return value ? value.join(';') : undefined;
    }),
    field(
    'Current_Weight__c',
    dataValue('properties.Current_Weight')
    ),
    field(
    'Current_Height__c',
    dataValue('properties.current_height')
    ),
    field(
    'Current_MUAC__c',
    dataValue('properties.MUAC')
    ),
    field('Food_groups_3_times_a_day__c',dataValue('properties.food_groups')),
    field('Nutrition_Case_Managed__c',dataValue('properties.nutrition_case_managed')),
    field('Nutrition_Danger_Signs__c',state => {
    var choice = dataValue(
    'properties.nutrition_danger_signs'
    )(state);
    return state.handleMultiSelectOriginal(state, choice);

    }),
    field('Why_was_nutrition_case_not_managed__c',dataValue('properties.nutrition_case_not_managed_why')),
    field('Community_Nutrition_Treatment__c',dataValue('properties.nutrition_treatment_severe')),
    field('Community_Nutrition_Treatment__c',dataValue('properties.nutrition_treatment_moderate')),
    field('Why_was_nutrition_treatment_not_given__c',dataValue('properties.nutrition_treatment_not_given')),
    field('Current_Nutrition_Status__c', state => {
    var status = dataValue(
    'properties.Nutrition_Status'
    )(state);
    return status ? state.nutritionMap[status] : undefined;
    }),
    field('Default_on_TB_treatment__c', state => {
    var choice = dataValue(
    'properties.default_tb_treatment'
    )(state);
    return state.cleanChoice(state, choice);
    }),
    field('Received_pregnancy_test__c', state => {
    var choice = dataValue(
    'properties.did_you_adminsiter_a_pregnancy_test'
    )(state);
    return state.cleanChoice(state, choice);
    }),
    field('Pregnancy_test_result__c', state => {
    var choice = dataValue(
    'properties.pregnancy_test_result'
    )(state);
    return state.cleanChoice(state, choice);
    }),
    field('Chronic_illness__c', state => {
    var choice = dataValue(
    'properties.please_specify_which_chronic_illness_the_person_has'
    )(state);
    var choice2 = state.handleMultiSelect(state, choice);
    return choice2 ? choice2.replace(/_/g, ' ') : '';
    }),
    /*field(
    'Birth_Certificate__c',
    dataValue('form.Status.birth_certificate')
    ),
    field(
    'Child_zinc__c',
    dataValue(
    'form.TT5.Child_Information.Clinical_Services.diarrhea_clinic_treatment_zinc'
    )
    ),
    field(
    'Child_ORS__c',
    dataValue(
    'form.TT5.Child_Information.Clinical_Services.diarrhea_clinic_treatment_ORS'
    )
    ),*/
    field(
    'Childs_breath_per_minute__c',
    dataValue('properties.breaths_per_minuite')
    ),
    field(
    'Child_chest_in_drawing__c',
    dataValue('properties.Child_chest_in_drawing_c')
    ),
    field(
    'Caregiver_counseled_on_delayed_milestone__c',
    dataValue(
    'properties.did_you_counsel_the_caregiver_on_delayed_milestones'
    )
    ),
    field(
    'Delayed_Milestone__c',
    dataValue(
    'properties.does_the_child_has_a_delayed_milestone'
    )
    ),
    field(
    'Child_has_2_or_more_play_items__c',
    dataValue(
    'properties.does_the_child_has_2_or_more_play_items_at_home'
    )
    ),
    field(
    'Child_has_3_more_picture_books__c',
    dataValue(
    'properties.does_the_child_has_3_or_more_picture_books'
    )
    ),
    field('Delayed_Milestones_Counselled_On__c', state => {
    var ms = dataValue(
    'properties.which_delayed_milestone_area_did_you_counsel_the_caregiver_on'
    )(state);
    return ms ? state.milestoneMap[ms] : undefined;
    }),
    field('Delayed_Milestone_Type__c', state => {
    var ms = dataValue('properties.which_delayed_milestone')(
    state
    );
    return ms ? state.milestoneTypeMap[ms] : undefined;
    }),
    field(
    'Caretaker_trained_in_muac__c',
    dataValue('properties.mother_trained_muac')
    ),
    field(
    'Caretaker_screened_for_muac_this__c',
    dataValue(
    'properties.mother_screened_child_muac'
    )
    ),
    field(
    'Caretaker_muac_findings__c',
    dataValue(
    'properties.mother_screened_child_muac_result'
    )
    ),
    field(
    'Caretaker_action_after_muac_screening__c',
    dataValue(
    'properties.mother_screened_muac_action'
    )
    ),
    field(
    'of_Caretaker_MUAC_screenings__c',
    dataValue('properties.mother_nb_screening')
    ),
    field('Pulse_Oximeter__c', dataValue('properties.pulse_oximeter_available')),
    field(
    'Heart_Rate_Pulse_Oximeter__c',
    dataValue('properties.heart_rate_pulse_oximeter')
    ),
    field(
    'Oxygen_Concentration_Pulse_Oximeter__c',
    dataValue('properties.oxygen_concentration')
    ),
    field('Can_child_drink__c', dataValue('properties.can_child_drink')),
    field(
    'Antibiotic_provided_for_fast_breathing__c',
    dataValue('properties.antibiotic_fast_breathing')
    ),
    field(
    'Antibiotic_provided_for_chest_indrawing__c',
    dataValue('properties.antibiotic_chest_indrawing')
    ),
    field('Supervisor_Visit__c', state => {
    var check = dataValue('properties.supervisor_visit')(state);
    var value =
    check && check !== ''
    ? check
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return state.supervisorMap[value] || value;
    })
    : undefined;
    return value ? value.join(';') : undefined;
    }),
    /*
    //HMN- 05012023 - Removed field('Visit_Closed_Date__c', dataValue('date_closed')),
    //Because I could not find it in Salesforce. It was causing errors on staging
    field('Visit_Closed_Date__c', dataValue('date_closed')),
    */
    //field('Case_Closed_Date__c', state => {
    // var closed = dataValue('date_closed')(state);
    // var date = dataValue('date_modified')(state);
    // return closed && closed == true ? date : undefined;
    // })
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Q4-2022-Upsert-Supervision-Accompaniment-2022-08-22.html b/adaptors/library/jobs/auto/Q4-2022-Upsert-Supervision-Accompaniment-2022-08-22.html index 1fe96b94aeb3..6f2f9779a40a 100644 --- a/adaptors/library/jobs/auto/Q4-2022-Upsert-Supervision-Accompaniment-2022-08-22.html +++ b/adaptors/library/jobs/auto/Q4-2022-Upsert-Supervision-Accompaniment-2022-08-22.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Q4 2022 Upsert Supervision - Accompaniment

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields, relationship, upsert, upsertIf

    Expression

    //Job to integrate CommCare 'Accompaniement' form from the Supervision App.
    fn(state => {
    state.handleMultiSelect = function (state, multiField) {
    return multiField
    ? multiField
    .replace(/ /g, ';')
    : '';
    };

    state.cleanChoice = function (state, choice) {
    if (choice) {
    return choice.charAt(0).toUpperCase() + choice.slice(1).replace('_', ' ');
    } else {
    return '';
    }
    }

    return {
    ...state
    };

    });


    upsert(
    'Supervision_Forms__c',
    'CommCare_Form_ID__c',
    fields(
    field('CommCare_Form_ID__c', dataValue('id')),
    relationship('RecordType', 'Name', 'Accompanient Form'),
    field('Supervisor_Name__c', dataValue('form.prologue.supervisor_sfid')),
    field('CHW_Name__c', dataValue('form.prologue.chw_sfid')),
    relationship(
    'Village__r',
    'CommCare_User_ID__c',
    dataValue('form.prologue.chw_village')
    ),
    field('Form_Date__c',dataValue('form.Date')),
    field('Fertile_Women_in_Household__c',dataValue('form.WRA_check')),
    field('CHW_Asked_About_Family_Planning__c',dataValue('form.women_of_reproductive_age.fp_check')),
    field('Contraception_Distributed__c', state => {
    var choice = dataValue(
    'form.women_of_reproductive_age.fp_resources_check'
    )(state);
    return state.handleMultiSelect(state, choice);
    }),


    field('Household_members_aware_of_CHW_SRH__c',dataValue('form.women_of_reproductive_age.srh_awareness_check')),
    field('Pregnant_Women_in_HH__c',dataValue('form.pregnancy_check')),
    field('CHW_Asked_About_ANC_Visits__c',dataValue('form.pregnant_women.anc_check')),
    field('CHW_Counseled_On_Value_of_ANC_Visits__c',dataValue('form.pregnant_women.anc_counsel_check')),
    field('CHW_Read_Each_Pregnancy_Danger_Sign__c',dataValue('form.pregnant_women.danger_sign_check')),
    field('Household_aware_of_CHW_MCH_Services__c',dataValue('form.pregnant_women.pregnancy_support_awareness_check')),
    field('Pregnant_Woman_Delivered__c',dataValue('form.pregnant_women.delivery_check')),
    field('Used_MCH_Booklet__c',dataValue('form.delivery.vaccination_check')),
    field('Counsel_on_vaccination_schedule__c',dataValue('form.delivery.vaccination_counsel_check')),
    field('Counselled_on_Exclusive_Breastfeeding__c',dataValue('form.delivery.ebf_check')),
    field('Children_Under_5_in_Household__c',dataValue('form.cu5_check')),
    field('All_children_under_5_registered__c',dataValue('form.children_under_5.cu5_enrollment_check')),
    field('MUAC_taken_for_all_children__c',dataValue('form.children_under_5.muac_check')),
    field('Measured_MUAC_circumference_properly__c',dataValue('form.children_under_5.muac_method_check')),
    // field('Measured_MUAC_circumference_properly__c', state => {
    // var choice = dataValue(
    // 'form.children_under_5.muac_method_check'
    // )(state);
    // return state.cleanChoice(state, choice);
    // }),
    field('HIV_Members_in_the_Household__c',dataValue('form.hiv_check')),
    field('Recorded_HIV_Status_Information__c',dataValue('form.hiv_clients.hiv_info_check')),
    field('Counselled_on_ART_Adherence_HIV_Services__c',dataValue('form.hiv_clients.hiv_counsel_check')),
    field('Sick_Household_Members_at_Visit__c',dataValue('form.illness_check')),
    field('Household_member_reported_fever__c',dataValue('form.illness_referrals.fever_check')),
    field('Conducted_malaria_home_test__c', dataValue('form.illness_referrals.malaria_test_check')),
    field('Malaria_test_protocol_followed__c',dataValue('form.illness_referrals.malaria_test_method_check')),
    field('Sick_person_referred__c',dataValue('form.illness_referrals.referral_accompaniment_check')),
    field('Referral_discussed_with_family__c',dataValue('form.illness_referrals.referral_followup_check')),
    field('Distributed_treatments_medications__c',dataValue('form.distribution_check')),
    field('Stock_is_full__c',dataValue('form.stocks_check')),
    field('Missing_Stock__c', state => {
    var choice = dataValue(
    'form.missing_stocks_details'
    )(state);
    return state.handleMultiSelect(state, choice);
    }),
    field('Other_Missing_Stock__c',dataValue('form.missing_stocks_details_other')),
    field('Demonstrated_active_listening__c',dataValue('form.chw_behavior.active_listening_check')),
    field('Acted_with_respect_courtesy__c',dataValue('form.chw_behavior.respect_check')),
    field('CHW_Rating__c',dataValue('form.chw_behavior.interview_technique_check')),
    field('Tablet_used__c',dataValue('form.chw_behavior.tablet_use_check')),
    field('Tablet_used_effectively__c',dataValue('form.chw_behavior.tablet_competency_check')),
    field('Tablet_problem_observed__c', state => {
    var choice = dataValue(
    'form.chw_behavior.tablet_issues'
    )(state);
    return state.handleMultiSelect(state, choice);
    }),
    field('Visit_Length_Mins__c',dataValue('form.visit_length')),
    field('Accompanient_components_covered__c', state => {
    var choice = dataValue(
    'form.feedback_type'
    )(state);
    return state.handleMultiSelect(state, choice);
    }),
    field('Other_comments__c',dataValue('form.supervisor_comments')),
    field('Contraception_Distributed__c', state => {
    var choice = dataValue(
    'form.women_of_reproductive_age.fp_resources_check'
    )(state);
    return state.handleMultiSelect(state, choice);
    }),
    )
    );

    upsertIf(
    state.data.form.prologue.hh_code !== '' &&
    state.data.form.prologue.hh_code !== null,
    'Supervision_Forms__c',
    'CommCare_Form_ID__c',
    relationship('Household_Code__r',
    'Name',
    dataValue('form.prologue.hh_code')
    )
    );
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Q4-2022-Upsert-Supervision-Feedback-2022-08-19.html b/adaptors/library/jobs/auto/Q4-2022-Upsert-Supervision-Feedback-2022-08-19.html index 3ce2e5f599a3..481fdd13d91b 100644 --- a/adaptors/library/jobs/auto/Q4-2022-Upsert-Supervision-Feedback-2022-08-19.html +++ b/adaptors/library/jobs/auto/Q4-2022-Upsert-Supervision-Feedback-2022-08-19.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Q4 2022 Upsert Supervision - Feedback

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields, relationship, upsert

    Expression

    //Job to integrate CommCare 'Feedback' form from the Supervision App

    upsert(
    'Supervision_Forms__c',
    'CommCare_Form_ID__c',
    fields(
    field('CommCare_Form_ID__c', dataValue('id')),
    relationship('RecordType', 'Name', 'Feedback Form'),
    field('Supervisor_Name__c', dataValue('form.prologue.supervisor_sfid')),
    field('CHW_Name__c', dataValue('form.prologue.chw_sfid')),
    relationship(
    'Village__r',
    'CommCare_User_ID__c',
    dataValue('form.prologue.chw_village')
    ),
    relationship('Catchment__r',
    'Name',
    dataValue('form.prologue.catchment')
    ),
    field('Form_Date__c',dataValue('form.Date')),
    field('Strengths__c', dataValue('form.chw_perspectives_and_reflections.chw_strengths')),
    field('Weaknesses__c', dataValue('form.chw_perspectives_and_reflections.chw_improvement_areas')),
    field('Challenges__c', dataValue('form.chw_perspectives_and_reflections.chw_challenges')),
    field('Solutions__c', dataValue('form.chw_perspectives_and_reflections.chw_improvement_areas')),
    field('of_Household_Visit_As_Expected__c', dataValue('form.supervision_dashboard_feedback.hh_visits_check')),
    field('of_Household_Visit_Explanation__c',dataValue('form.supervision_dashboard_feedback.hh_visits_explanation')),
    field('of_Priority_Clients_as_Expected__c', dataValue('form.supervision_dashboard_feedback.priority_hh_visits_check')),
    field('of_Priority_Clients_Explanation__c',dataValue('form.supervision_dashboard_feedback.priority_hh_visits_explanation')),
    field('Feedback_on_Indicators__c',dataValue('form.supervision_dashboard_feedback.chw_sd_feedback')),
    field('CHW_Strengths__c',dataValue('form.supervisor_perspectives_and_reflections.chw_strengths_supervisor')),
    field('CHW_Areas_for_Improvement__c',dataValue('form.supervisor_perspectives_and_reflections.chw_improvement_areas_supervisor')),
    field('CHW_Immediate_Solutions__c',dataValue('form.supervisor_perspectives_and_reflections.chw_solutions_supervisor')),
    field('Other_Recommendations__c',dataValue('form.supervisor_perspectives_and_reflections.chw_recommendation_other_supervisor')),
    )
    );
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Q4-2022-Upsert-Supervision-Household-Spot-Check-2022-08-24.html b/adaptors/library/jobs/auto/Q4-2022-Upsert-Supervision-Household-Spot-Check-2022-08-24.html index 06c4e949d704..f16534ef912a 100644 --- a/adaptors/library/jobs/auto/Q4-2022-Upsert-Supervision-Household-Spot-Check-2022-08-24.html +++ b/adaptors/library/jobs/auto/Q4-2022-Upsert-Supervision-Household-Spot-Check-2022-08-24.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Q4 2022 Upsert Supervision - Household Spot Check

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: Q4 2022 Upsert Supervision - Household Spot Check
    • Adaptor: @openfn/language-salesforce
    • Adaptor Version: latest
    • Created over 2 years ago
    • Updated 13 days ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    dataValue, field, fields, relationship, upsert, upsertIf

    Expression

    //Job to integrate CommCare 'Household Spotcheck' form from the Supervision App
    fn(state => {
    state.handleMultiSelect = function (state, multiField) {
    return multiField
    ? multiField
    .replace(/ /g, ';')
    : '';
    };
    return {
    ...state
    };
    });


    upsert(
    'Supervision_Forms__c',
    'CommCare_Form_ID__c',
    fields(
    field('CommCare_Form_ID__c', dataValue('id')),
    relationship('RecordType', 'Name', 'Household Spotcheck Form'),
    // relationship('Household_Code__r',
    //'Name',
    //dataValue('form.prologue.hh_code')
    // ),
    field('Supervisor_Name__c', dataValue('form.prologue.spot_checker_sfid')),
    field('CHW_Name__c', dataValue('form.prologue.chw_sfid')),
    relationship(
    'Village__r',
    'CommCare_User_ID__c',
    dataValue('form.prologue.village')
    ),
    relationship('Catchment__r',
    'Name',
    dataValue('form.prologue.catchment')
    ),
    field('Form_Date__c',dataValue('form.Date')),
    field('CHW_Name_Identified__c',dataValue('form.chw_awareness.chw_name_reported')),
    field('Knows_where_CHW_lives__c',dataValue('form.chw_awareness.chw_location_confirmation')),
    field('Knows_CHW_contact_number__c',dataValue('form.chw_awareness.chw_contact_number')),
    field('CHW_paid_for_services__c',dataValue('form.chw_awareness.service_fee')),
    field('CHW_Visit_Frequency__c',dataValue('form.chw_awareness.chw_visit_frequency')),
    field('Household_member_reported_fever__c',dataValue('form.iccm.fever_management')),
    field('details_on_chw_conduct__c',dataValue('form.chw_behavior.chw_conduct_detail')),
    field('Tablet_used__c',dataValue('form.chw_behavior.tablet_use_check')),
    field('Other_Recommendations__c',dataValue('form.community_comments.community_recommendations_detail')),
    field('Other_comments__c',dataValue('form.community_comments.do_you_have_any_other_comments_at_this_time')),
    field('CHW_tested_treated_child_for_malaria__c',dataValue('form.iccm.malaria_management')),
    field('If_so_when_Within_the__c',dataValue('form.iccm.malaria_management_timeline')),
    field('CHW_ever_managed_your_child_for_diarrhea__c',dataValue('form.iccm.diarrhea_management')),
    field('CHW_measured_child_s_arm_past_90_days__c',dataValue('form.iccm.muac_check')),
    field('CHW_ever_managed_child_for__c',dataValue('form.iccm.pneumonia_management')),
    field('rate_the_quality_of_services__c',dataValue('form.iccm.chw_service_quality')),
    field('CHW_revisit__c',dataValue('form.referrals_and_follow-up_visits.follow_up_check_1')),
    field('follow_up_within_3_days_of_initial_visit__c',dataValue('form.referrals_and_follow-up_visits.follow_up_check_2')),
    field('does_CHW_revisit_child_for_follow_up__c',dataValue('form.referrals_and_follow-up_visits.follow_up_check_3')),
    field('when_child_is_sick__c',dataValue('form.referrals_and_follow-up_visits.follow_up_check_4')),
    field('CHW_conduct__c',dataValue('form.chw_behavior.chw_conduct_check')),
    field('comfortable_sharing_sensitive_info__c',dataValue('form.chw_behavior.sensitive_info_check')),
    field('Please_explain__c',dataValue('form.chw_behavior.sensitive_info_detail')),
    field('Does_your_CHW_listen_to_your_perspective__c',dataValue('form.chw_behavior.listening_check')),
    field('ever_experienced_a_problem_with_CHW__c', dataValue('form.chw_behavior.problem_check')),
    field('describe_problem_experienced_with_CHW__c',dataValue('form.chw_behavior.problem_detail')),
    field('any_recommendations_for_impr__c',dataValue('form.community_comments.community_recommendations')),
    field('How_was_the_fever_managed__c', state => {
    var choice = dataValue(
    'form.iccm.fever_management_detail'
    )(state);
    return state.handleMultiSelect(state, choice);
    }),
    field('How_was_the_malaria_managed__c', state => {
    var choice = dataValue(
    'form.iccm.malaria_management_detail'
    )(state);
    return state.handleMultiSelect(state, choice);
    }),
    field('How_did_she_he_manage_the_diarrhea__c', state => {
    var choice = dataValue(
    'form.iccm.malaria_management_detail'
    )(state);
    return state.handleMultiSelect(state, choice);
    }),
    field('How_did_she_he_manage_the_pneumonia__c', state => {
    var choice = dataValue(
    'form.iccm.pneumonia_managemnt_detail'
    )(state);
    return state.handleMultiSelect(state, choice);
    }),
    field('COHORT_ONE_Maternal_and_Child_Health__c', state => {
    var choice = dataValue(
    'form.chw_service_provision.cohort_one'
    )(state);
    return state.handleMultiSelect(state, choice);
    }),
    field('COHORT_TWO_Childcare__c', state => {
    var choice = dataValue(
    'form.chw_service_provision.cohort_two'
    )(state);
    return state.handleMultiSelect(state, choice);
    }),
    field('COHORT_THREE_WASH_and_Nutrition__c', state => {
    var choice = dataValue(
    'form.chw_service_provision.cohort_three'
    )(state);
    return state.handleMultiSelect(state, choice);
    }),
    field('COHORT_FOUR_FIVE_Sexual_Reproductive__c', state => {
    var choice = dataValue(
    'form.chw_service_provision.cohort_four_-_five'
    )(state);
    return state.handleMultiSelect(state, choice);
    }),
    )
    );

    upsertIf(
    state.data.form.prologue.hh_code !== '' &&
    state.data.form.prologue.hh_code !== null,
    'Supervision_Forms__c',
    'CommCare_Form_ID__c',
    relationship('Household_Code__r',
    'Name',
    dataValue('form.prologue.hh_code')
    )
    );
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Register-Participant-V2-Skillz-2021-06-02.html b/adaptors/library/jobs/auto/Register-Participant-V2-Skillz-2021-06-02.html index c0873ea01949..7efa182a05c9 100644 --- a/adaptors/library/jobs/auto/Register-Participant-V2-Skillz-2021-06-02.html +++ b/adaptors/library/jobs/auto/Register-Participant-V2-Skillz-2021-06-02.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Register Participant - V2 Skillz

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    alterState, dataPath, dataValue, each, field, fields, lastReferenceValue, map, merge, query, relationship, upsert, Array

    Expression

    query(`SELECT Id, Name, CommCare_Ext_ID__c FROM Event__c WHERE CommCare_Case_ID__c = '${state.data.form.case['@case_id']}'`);

    alterState(state => {
    // Note: lastReferenceValue selects the first item in the references array.
    state.data.eventName = lastReferenceValue('records[0].CommCare_Ext_ID__c')(state);

    function objectToArray(object) {
    return !Array.isArray(object) ? [object] : object;
    }

    // if (state.data.form.question1) {
    // console.log('Ensuring that "question1" is an array.');
    // state.data.form.question1 = objectToArray(state.data.form.question1);
    // } else {
    // console.log('Shifting "new_participants" to "question1" array.');
    // state.data.form.question1 = objectToArray(state.data.form.new_participants);
    // console.log('Creating a "case" object inside each item in that array.');
    // state.data.form.question1 = state.data.form.question1.map(item => ({
    // ...item,
    // case: item.create_skillz_plus_participant.case,
    // }));
    // }

    console.log('Done with initial data manipulation.');

    return state;
    });

    // beta.each(
    // merge(
    // dataPath('form.question1[*]'),
    // fields(
    // field('intervention_notes_to_save', dataValue('form.intervention_notes_to_save')))
    // ),

    upsert(
    'Person__c',
    'Participant_Identification_Number_PID__c',
    fields(
    field('Notes__c', dataValue('form.intervention_notes_to_save')),
    field('First_Name__c', dataValue('form.new_participants.participant_first_name')),
    field('Surname__c', dataValue('form.new_participants.participant_surname')),
    relationship('RecordType', 'Name', 'Participant'),
    field('Participant_Identification_Number_PID__c', state => state.data.form.new_participants.create_skillz_plus_participant.case['@case_id']),
    field('Sex__c', dataValue('gender')),
    field('Mobile_Number_1__c', dataValue('form.new_participants.mobile_number')), //QUESTION: In CommCare, phone doesn't look like it's saving?
    field('School_name_person__c', dataValue('form.new_participants.school_name')),
    field('Date_of_Birth__c', dataValue('date_of_birth')),
    field('School_name_person__c', dataValue('form.new_participants.school_name')),
    field('Physical_Address__c', dataValue('form.new_participants.participants_home_address'))
    //field('Age__c', dataValue('form.question1.age_in_years')), //This is a SF formula field, cannot map
    )
    )
    //);

    // each(
    // merge(dataPath('form.question1[*]'), fields(
    // field('intervention_name', dataValue('form.intervention_name')),
    // field('eventName', dataValue('eventName')))),
    upsert(
    'Attendance__c',
    'CommCare_Ext_ID__c',
    fields(
    field('CommCare_Ext_ID__c', state => {
    var eventid = `${state.data.eventName}` || dataValue('form.intervention_name')(state);
    var personid = state.data.form.new_participants.create_skillz_plus_participant.case['case_id'];//state.data.case['@case_id'];
    return personid + '-' + eventid;
    }),
    relationship(
    //Attendance looks up to Persn via the case_id
    'Person_Attendance__r',
    'Participant_Identification_Number_PID__c',
    state => state.data.case['@case_id']
    ),
    relationship(
    //Attendance looks up to Event via the intervention_name
    'Event__r',
    'CommCare_Case_ID__c',
    state.data.form.new_participants.create_skillz_plus_participant.case.index.parent['#text']
    ),
    field('Date_of_Birth__c', dataValue('form.new_participants.date_of_birth'))
    )
    )
    //);
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Register-Patient-2021-03-02.html b/adaptors/library/jobs/auto/Register-Patient-2021-03-02.html index 9931aa5783cc..9fae9f215cd4 100644 --- a/adaptors/library/jobs/auto/Register-Patient-2021-03-02.html +++ b/adaptors/library/jobs/auto/Register-Patient-2021-03-02.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Register Patient

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    appendValues, JSON

    Expression

    appendValues({
    spreadsheetId: '1EFkY4zD4qqxnJdH-QaeasKd1zXC-1sNKpEg08W-3sT0',
    range: 'COVID-19 Cases!A2',
    values: state => {
    const kobo = state.data.body;

    console.log('Submission data: ' + JSON.stringify(kobo, null, 2));

    return [
    [
    kobo['National_ID'],
    kobo['Patient_name'],
    kobo['Last_Name_of_Patient'],
    kobo['Sex'],
    kobo['Age'],
    kobo['Comments'],
    Date(),
    ],
    ];
    },
    });
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Request-Vitas-Sync-2021-05-11.html b/adaptors/library/jobs/auto/Request-Vitas-Sync-2021-05-11.html index 4587c355c2db..0752bc09295c 100644 --- a/adaptors/library/jobs/auto/Request-Vitas-Sync-2021-05-11.html +++ b/adaptors/library/jobs/auto/Request-Vitas-Sync-2021-05-11.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Request Vitas Sync

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: Request Vitas Sync
    • Adaptor: @openfn/language-http
    • Adaptor Version: v3.1.7
    • Created almost 4 years ago
    • Updated over 3 years ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    alterState, dataPath, dataValue, each, post

    Expression

    alterState(state => {
    const vitasSystemsToCheck = [
    'vitas-1',
    'thatMinistry-vitas-7',
    '3',
    '4',
    '5',
    ]
    return { ...state, data: { vitasSystemsToCheck } };
    });

    each(
    dataPath('vitasSystemsToCheck[*]'),
    post(state.configuration.inboxUrl, {
    body: { "db": dataValue('database-id') },
    })
    );
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Risk-and-Vulnerability-Assessment-2021-05-27.html b/adaptors/library/jobs/auto/Risk-and-Vulnerability-Assessment-2021-05-27.html index 2050229ac6f6..c8867e14fb12 100644 --- a/adaptors/library/jobs/auto/Risk-and-Vulnerability-Assessment-2021-05-27.html +++ b/adaptors/library/jobs/auto/Risk-and-Vulnerability-Assessment-2021-05-27.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Risk and Vulnerability Assessment

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    alterState, dataValue, field, fields, join, map, upsert

    Expression

    // Your job goes here. Testing github
    alterState(state => {
    function checked(key, str) {
    if (!str) return false;
    return str.toString().split(' ').indexOf(key) >= 0;
    }

    function capitalizeFirstLetter(str) {
    if (!str) return;
    let new_str = str.toString().toLowerCase();
    return new_str.slice(0, 1).toUpperCase() + new_str.slice(1);
    }

    function transformDont(str) {
    if (!str) return str;
    return str
    .toString()
    .split('_')
    .map(word => word.replace(/dont/i, "don't"))
    .join('_')
    .toString()
    .trim();
    }

    function transformCant(str) {
    if (!str) return str;
    return str
    .toString()
    .split('_')
    .map(word => word.replace(/cant/i, "can't"))
    .join('_')
    .toString()
    .trim();
    }

    function splitAndJoin(str, splitDelimiter, joinDelimiter) {
    if (!str) return;

    return str.toString().split(splitDelimiter).join(joinDelimiter).toString().trim();
    }

    function transformHowOften(str) {
    if (!str) return;
    if (str === 'special_occasions') return 'Special Occasions';
    return transformGenericText(str).toString().trim();
    }

    function transformHIVStatus(status) {
    switch (status) {
    case 'yes_negative':
    return 'Yes,Negative';
    case 'yes_positive':
    return 'Yes,Positive';
    case 'no_i_dont':
    return "No,I don't know";
    case 'yes_dont_want_to_disclose':
    return "Yes, don't want to disclose";
    default:
    return;
    }
    }

    function transformLastTested(str) {
    if (!str) return;
    switch (str.toString()) {
    case 'yes_negative':
    return 'Yes,Negative';
    case 'yes_positive':
    return 'Yes,Positive';
    case 'no_i_dont':
    return "No,I don't know";
    case 'yes_dont_want_to_disclose':
    return "Yes, don't want to disclose";
    default:
    return;
    }
    }

    function transformMonthAgo(str) {
    if (!str) return;
    switch (str) {
    case 'month_ago':
    return '1 month ago';
    case 'months_ago':
    return '3 months ago';
    case 'month_ago':
    return 'copy-1-of-months_ago ';
    case 'month_ago':
    return '6 months ago';
    case 'a_year_or_more_ago':
    return 'A year or more';
    default:
    return;
    }
    }

    function transformGenericText(str) {
    if (!str) return;
    return capitalizeFirstLetter(splitAndJoin(transformDont(str), '_', ' '))
    .toString()
    .trim();
    }

    function transformRange(range) {
    if (!range) return;
    return range
    .toString()
    .replace(/\d_\d/i, match => match.replace('_', '-'))
    .toString()
    .trim();
    }

    function transformAgeRange(range) {
    if (!range) return;
    if (range === '10_years') return '< 10 years';
    if (range === 'greater_than_19') return '> 19 years';
    return capitalizeFirstLetter(transformDont(transformCant(splitAndJoin(transformRange(range), '_', ' '))))
    .toString()
    .trim();
    }

    function transformAbuseExperienced(str) {
    if (!str) return;
    return str
    .split(' ')
    .map(word => capitalizeFirstLetter(word))
    .join(' ')
    .toString()
    .trim();
    }

    function getAge(dateString) {
    if (!dateString) return;

    const today = new Date();
    const birthDate = new Date(dateString);
    var age = today.getFullYear() - birthDate.getFullYear();
    var m = today.getMonth() - birthDate.getMonth();
    if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) {
    age--;
    }
    return age;
    }

    state.data.perform_a_risk_assessment = state.data.form.do_you_want_to_perform_a_risk_assessment === 'yes';

    state.data.complete_service_referrals = state.data.form.referral_services ? true : false;

    state.data.form.hidden_properties.gender =
    capitalizeFirstLetter(state.data.form.hidden_properties.gender);

    state.helperFunctions = {
    checked,
    transformAgeRange,
    transformHIVStatus,
    transformLastTested,
    transformMonthAgo,
    transformGenericText,
    transformDont,
    splitAndJoin,
    transformHowOften,
    transformAbuseExperienced,
    getAge,
    };
    return state;
    });

    upsert(
    'Risk_Assessment__c',
    'CommCare_Ext_ID__c',
    fields(
    field('CommCare_Ext_ID__c', dataValue('id')),
    field('Date__c', dataValue('form.date')),
    field('Participant_Name__c', state => {
    var firstname = state.data.form.hidden_properties.praticipant_first_name;
    var lastname = state.data.form.hidden_properties.participant_surname;
    return firstname + ' ' + lastname;
    }),
    field('Participant_Age__c', state => {
    const dob = dataValue('form.hidden_properties.date_of_birth')(state);

    return state.helperFunctions.getAge(dob);
    }),
    field('Participant_Sex__c', dataValue('form.hidden_properties.gender')),
    field('X1_0_Sexually_Active_past_12_month__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.sexual_risk_and_pregnancy.sexually_active_12_months')(state)
    )
    ),
    field('X1_1_Age_at_first_sex__c', state =>
    state.helperFunctions.transformAgeRange(
    dataValue('form.sexual_risk_and_pregnancy.age_at_first_sex')(state)
    )
    ),
    field('X1_2_Have_you_ever_had_unprotected_sex__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.sexual_risk_and_pregnancy.have_you_ever_had_unprotected_sex')(state)
    )
    ),
    field('X1_3_Sex_for_monetary_or_material_benefi__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.sexual_risk_and_pregnancy.sex_monetary_material')(state)
    )
    ),
    field('Do_you_know_your_HIV_status__c', state =>
    state.helperFunctions.transformHIVStatus(
    dataValue('form.sexual_risk_and_pregnancy.hiv_status.do_you_know_your_hiv_status')(state)
    )
    ),
    field('X2_1_When_last_did_you_test_for_HIV__c', state =>
    state.helperFunctions.transformMonthAgo(
    dataValue('form.sexual_risk_and_pregnancy.hiv_status.when_last_did_you_test_for_hiv')(state)
    )
    ),
    field('X2_2_Are_you_on_treatment_ART__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.sexual_risk_and_pregnancy.hiv_status.are_you_on_treatment_art')(state)
    )
    ),
    field('X3_0_Had_an_STI_in_the_last_12months_yea__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.sexual_risk_and_pregnancy.hiv_status.sti_and_pep.hiv_last_12_months')(state)
    )
    ),
    field('X3_1_Past_12_months_sex_HIV_status_part__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.sexual_risk_and_pregnancy.hiv_status.sti_and_pep.knowing_partners_hiv_status')(state)
    )
    ),
    //PENDING Donny change data type in SF
    // field('X4_0_Forms_of_abuse_experienced_before__c', state =>
    // state.helperFunctions.transformAbuseExperienced(
    // dataValue('form.risk_assessment.gender_based_violence.abuse_experienced')(state)
    // )
    // ),
    field('X4_1_Feel_unsafe_any1_interact_with_ofte__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.sexual_risk_and_pregnancy.hiv_status.sti_and_pep.gender_based_violence.unsafe_with_others')(state)
    )
    ),
    field('X4_2_Of_what_relationship_person_to_you__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.sexual_risk_and_pregnancy.hiv_status.sti_and_pep.gender_based_violence.relationship_of_abuser')(state)
    )
    ),
    field('X5_0_Do_you_take_alcohol_or_drugs__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.sexual_risk_and_pregnancy.hiv_status.sti_and_pep.gender_based_violence.drugs_and_alcohol_use.do_you_take_alcohol_andor_drugs')(state)
    )
    ),
    field('X5_1_On_average_how_often_drink_alcohol__c', state =>
    state.helperFunctions.transformHowOften(
    dataValue('form.sexual_risk_and_pregnancy.hiv_status.sti_and_pep.gender_based_violence.drugs_and_alcohol_use.how_often_alcohol')(state)
    )
    ),
    field('X5_2_On_average_how_often_take_drugs__c', state =>
    state.helperFunctions.transformHowOften(
    dataValue('form.sexual_risk_and_pregnancy.hiv_status.sti_and_pep.gender_based_violence.drugs_and_alcohol_use.how_often_drugs')(state)
    )
    ),
    field('X5_3_Easy_for_teens_to_obtain_alcohol__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.sexual_risk_and_pregnancy.hiv_status.sti_and_pep.gender_based_violence.drugs_and_alcohol_use.alcohol_19')(state)
    )
    ),
    field('X5_4__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.sexual_risk_and_pregnancy.hiv_status.sti_and_pep.gender_based_violence.drugs_and_alcohol_use.illegal_drugs_19')(state)
    )
    )
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-ART-Adherence-Self-Reporting-Tool-2021-04-30.html b/adaptors/library/jobs/auto/Upsert-ART-Adherence-Self-Reporting-Tool-2021-04-30.html index 73fb8adbbc92..ae70d7e439e3 100644 --- a/adaptors/library/jobs/auto/Upsert-ART-Adherence-Self-Reporting-Tool-2021-04-30.html +++ b/adaptors/library/jobs/auto/Upsert-ART-Adherence-Self-Reporting-Tool-2021-04-30.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Upsert ART Adherence Self-Reporting Tool

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    alterState, dataValue, field, fields, upsert

    Expression

    // Push to production
    alterState(state => {

    function getAge(dateString) {
    if (!dateString) return;

    const today = new Date();
    const birthDate = new Date(dateString);
    var age = today.getFullYear() - birthDate.getFullYear();
    var m = today.getMonth() - birthDate.getMonth();
    if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) {
    age--;
    }
    return age;
    }

    function transform(value) {
    if (!value) return;
    switch (value.toString().trim()) {
    case 'i_dont_know__i_dont_recall':
    return "I don't know/I don't recall";
    case 'i_dont_recall':
    return "I don't know/I don't recall";
    case 'no':
    return 'No';
    case 'yes':
    return 'Yes';
    case 'na':
    return 'NA';
    case 'disagree':
    return '2 (Disagree)';
    case 'agree':
    return '4 (Agree)';
    case 'neither_agree_or_disagree':
    return '3 (Neither Agree or Disagree)';
    case 'strongly_agree':
    return '5 (Strongly Agree)';
    case 'strongly_disagree':
    return '1 (Strongly Disagree)';
    case 'sure':
    return '4 (Agree)';
    case 'very_sure':
    return '5 (Strongly Agree)';
    case 'i_dont_know':
    return 'I dont know';
    case 'suppressed':
    return 'Suppressed';
    case 'unsuppressed':
    return 'Unsuppressed';
    default:
    return value;
    }
    }

    state.helperFunctions = { getAge };

    state.data.form.behavioural.are_you_taking_any_other_religious_treatment_ie_holy_water_anointing_oilwat =
    transform(state.data.form.behavioural.are_you_taking_any_other_religious_treatment_ie_holy_water_anointing_oilwat)

    state.data.form.behavioural.are_you_taking_any_traditional_medicine_as_a_supplement_to_the_arvs =
    transform(state.data.form.behavioural.are_you_taking_any_traditional_medicine_as_a_supplement_to_the_arvs)

    state.data.form.behavioural.if_yes_to_any_of_the_above_did_it_affect_your_taking_of_medication_treatmen =
    transform(state.data.form.behavioural.if_yes_to_any_of_the_above_did_it_affect_your_taking_of_medication_treatmen)

    state.data.form.behavioural.in_the_past_month_did_you_go_for_a_party_or_other_leisure_activities =
    transform(state.data.form.behavioural.in_the_past_month_did_you_go_for_a_party_or_other_leisure_activities)

    state.data.form.behavioural.in_the_past_month_did_you_sleep_away_from_home =
    transform(state.data.form.behavioural.in_the_past_month_did_you_sleep_away_from_home)

    state.data.form.clinical_knowledge.do_you_know_your_cd4_count =
    transform(state.data.form.clinical_knowledge.do_you_know_your_cd4_count)

    state.data.form.clinical_knowledge.question16 =
    transform(state.data.form.clinical_knowledge.question16)

    state.data.form.clinical_knowledge.do_you_know_your_viral_load =
    transform(state.data.form.clinical_knowledge.do_you_know_your_viral_load)

    state.data.form.clinical_knowledge.when_did_you_last_go_for_these_two_clinical_tests =
    transform(state.data.form.clinical_knowledge.when_did_you_last_go_for_these_two_clinical_tests)

    state.data.form.treatment_adherence.did_you_encounter_any_challenges_in_taking_your_medication_as_prescribed_in =
    transform(state.data.form.treatment_adherence.did_you_encounter_any_challenges_in_taking_your_medication_as_prescribed_in)

    state.data.form.treatment_adherence.in_the_past_month_have_you_failed_to_take_any_of_your_art_treatment =
    transform(state.data.form.treatment_adherence.in_the_past_month_have_you_failed_to_take_any_of_your_art_treatment)

    state.data.form.treatment_adherence.in_the_past_month_have_you_taken_any_of_your_art_treatment_at_times_other_t =
    transform(state.data.form.treatment_adherence.in_the_past_month_have_you_taken_any_of_your_art_treatment_at_times_other_t)

    state.data.form.treatment_adherence.in_the_past_month_have_you_taken_less_or_more_pills_of_any_of_your_art_trea =
    transform(state.data.form.treatment_adherence.in_the_past_month_have_you_taken_less_or_more_pills_of_any_of_your_art_trea)

    state.data.form['treatment_self-efficacy'].how_sure_are_you_that_you_will_be_taking_your_medication_as_are_directed = how_sure_are_you_that_you_will_be_taking_your_medication_as_are_directed =
    transform(state.data.form['treatment_self-efficacy'].how_sure_are_you_that_you_will_be_taking_your_medication_as_are_directed)

    state.data.form['treatment_self-efficacy'].how_sure_are_you_that_your_medication_will_have_a_positive_effect_on_your_h =
    transform(state.data.form['treatment_self-efficacy'].how_sure_are_you_that_your_medication_will_have_a_positive_effect_on_your_h)

    state.data.form['treatment_self-efficacy'].how_sure_are_you_that_your_medication_will_help_you_live_a_longer_and_healt =
    transform(state.data.form['treatment_self-efficacy'].how_sure_are_you_that_your_medication_will_help_you_live_a_longer_and_healt)

    state.data.form.clinical_knowledge.question16 =
    transform(state.data.form.clinical_knowledge.question16)

    state.data.form.clinical_knowledge.when_did_you_last_have_your_clinical_test =
    state.data.form.clinical_knowledge.when_did_you_last_have_your_clinical_test ? transform(state.data.form.clinical_knowledge.when_did_you_last_have_your_clinical_test)
    : transform(state.data.form.clinical_knowledge.when_did_you_last_go_for_these_two_clinical_tests);

    return state;
    });



    upsert(
    'ART_ADHERENCE_SELF_SELF_REPORTING_TOOL__c',
    'CommCare_Ext_ID__c',
    fields(
    field('CommCare_Ext_ID__c', dataValue('id')),
    field('Date__c', dataValue('form.demographic_information.date')),
    field('Sex__c', dataValue('form.gender')),
    field('Facility_Name__c', dataValue('form.school')),
    field('Patient_ID_or_Facility_File_Number__c', dataValue('form.skillz_lplus_number')),
    //field('Business_Unit__c', 'GRS Zambia'),
    field('Captured_By__c', dataValue('form.coach_name')),
    field('Verified_By__c', dataValue('form.coach_name')),
    field('Captured_Date__c', dataValue('form.demographic_information.date')),
    field('Verified_Date__c', dataValue('form.demographic_information.date')),
    field('Age__c', state => {
    const dob = dataValue('form.date_of_birth')(state);
    return state.helperFunctions.getAge(dob);
    }),
    field(
    'Treatment_Adherence_3__c',
    dataValue('form.treatment_adherence.in_the_past_month_have_you_taken_any_of_your_art_treatment_at_times_other_t')
    ),
    field(
    'Treatment_Adherence_2__c',
    dataValue('form.treatment_adherence.in_the_past_month_have_you_failed_to_take_any_of_your_art_treatment')
    ),
    field(
    'Treatment_Adherence_4__c',
    dataValue('form.treatment_adherence.in_the_past_month_have_you_taken_less_or_more_pills_of_any_of_your_art_trea')
    ),
    field(
    'Treatment_Adherence_5_a__c',
    dataValue('form.treatment_adherence.did_you_encounter_any_challenges_in_taking_your_medication_as_prescribed_in')
    ),


    field('Clinical_Knowledge_2__c', dataValue('form.clinical_knowledge.question16')),
    field(
    'Clinical_Knowledge_1__c',
    dataValue('form.clinical_knowledge.when_did_you_last_have_your_clinical_test')
    ),
    field(
    'Treatment_Self_Efficacy__c',
    dataValue('form.treatment_self-efficacy.how_sure_are_you_that_you_will_be_taking_your_medication_as_are_directed')
    ),
    field(
    'Treatment_Self_Efficacy_10__c',
    dataValue(
    'form.treatment_self-efficacy.how_sure_are_you_that_your_medication_will_have_a_positive_effect_on_your_h'
    )
    ),
    field(
    'Treatment_Self_Efficacy_11__c',
    dataValue(
    'form.treatment_self-efficacy.how_sure_are_you_that_your_medication_will_help_you_live_a_longer_and_healt'
    )
    ),
    field(
    'Behavioural_Factors_12__c',
    dataValue('form.behavioural.in_the_past_month_did_you_go_for_a_party_or_other_leisure_activities')
    ),
    field('Behavioural_Factors_13__c', dataValue('form.behavioural.in_the_past_month_did_you_sleep_away_from_home')),
    field(
    'Behavioural_Factors_14__c',
    dataValue('form.behavioural.are_you_taking_any_traditional_medicine_as_a_supplement_to_the_arvs')
    ),
    field(
    'Behavioural_Factors_14__c',
    dataValue('form.behavioural.are_you_taking_any_other_religious_treatment_ie_holy_water_anointing_oilwat')
    ),
    field(
    'Behavioural_Factors_15__c',
    dataValue('form.behavioural.if_yes_to_any_of_the_above_did_it_affect_your_taking_of_medication_treatmen')
    )
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-Aggregate-Service-Referrals-2021-04-30.html b/adaptors/library/jobs/auto/Upsert-Aggregate-Service-Referrals-2021-04-30.html index 09968c1e27a7..3946a8e8c4a7 100644 --- a/adaptors/library/jobs/auto/Upsert-Aggregate-Service-Referrals-2021-04-30.html +++ b/adaptors/library/jobs/auto/Upsert-Aggregate-Service-Referrals-2021-04-30.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Upsert Aggregate Service Referrals

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields, relationship, upsert

    Expression

    // Push to production
    upsert(
    'GRS_Referral_Agg__c',
    'CommCare_Ext_ID__c',
    fields(
    relationship(
    'SiteName__r',
    'CommCare_Ext_ID__c',
    dataValue('form.general_referral_information.event_information.site')
    ),
    field('CommCare_Ext_ID__c', dataValue('form.general_referral_information.event_information.site')),
    //TO DO
    //field('Business_Unit__c', dataValue('form.general_referral_information.event_information.business_unit')),
    field('Business_Unit__c', state => {
    const bu = dataValue('form.general_referral_information.event_information.business_unit')(state);
    return bu==='65680f0c4c144b03ad0f86bdc46c1ebc' ? 'GRS Zambia' :
    bu==='04d98397e28046118fade28ced6b65cb' ? 'GRS Zimbabwe' :
    bu==='ed125ab19ec34aacab79585e59eb76f4' ? 'GRS Partnerships': undefined ;
    }),
    relationship(
    //Attendance looks up to Event via the intervention_name
    'Events__r',
    'CommCare_Ext_ID__c',
    dataValue('form.general_referral_information.event_information.event_name')
    ),
    field('Type_of_Referral__c', dataValue('form.general_referral_information.type_of_referral')),
    field(
    'Enter_Partner_s_Name__c',
    dataValue('form.general_referral_information.partner_or_organization_referred_to')
    ),
    field('Males_Referred_HIV_Testing__c', dataValue('form.hivsti_services.males_referred_for_hiv_testing')),
    field('Males_referred_for_STI_Screening__c', dataValue('form.hivsti_services.males_referred_for_sti_screening')),
    field('Males_Referred_for_PEP__c', dataValue('form.hivsti_services.males_referred_for_pep')),
    field('Males_Referred_for_PrEP__c', dataValue('form.hivsti_services.males_referred_for_prep')),
    field('Males_Referred_for_VMMC__c', dataValue('form.hivsti_services.males_referred_for_vmmc')),
    field('Females_Referred_for_HIV_Testing__c', dataValue('form.hivsti_services.females_referred_for_hiv_testing')),
    field(
    'Females_Referred_for_STI_Screening__c',
    dataValue('form.hivsti_services.females_referred_for_sti_screening')
    ),
    field('Date_Referred__c', dataValue('form.general_referral_information.date_referred')),
    field('Females_Referred_for_PEP__c', dataValue('form.hivsti_services.females_referred_for_pep')),
    field('Females_Referred_for_PrEP__c', dataValue('form.hivsti_services.females_referred_for_prep')),
    field('Males_Referred_for_ART__c', dataValue('form.art_services.males_referred_for_art')),
    field('Males_Referred_for_SKILLZ_Club__c', dataValue('form.art_services.males_referred_for_skillz__club')),
    field('Females_Referred_for_ART__c', dataValue('form.art_services.females_referred_for_art')),
    field('Females_Referred_SKILLZ_Club__c', dataValue('form.art_services.females_referred_for_skillz__club')),
    field('Females_Referred_for_PMTCT__c', dataValue('form.art_services.females_referred_for_pmtct')),

    field(
    'Males_Referred_for_Psycho_Social_Support__c',
    dataValue('form.psycho_-_social_services.males_referred_for_psycho-social_support')
    ),
    field(
    'Females_Referred_Psycho_Social_Support__c',
    dataValue('form.psycho_-_social_services.females_referred_for_psycho-social_support')
    ),
    field('Males_Referred_for_TB_Screening__c', dataValue('form.tb_services.males_referred_for_tb_screening')),
    field('Females_Referred_for_TB_Screening__c', dataValue('form.tb_services.females_referred_for_rb_screening')),
    field(
    'Number_of_Male_Condoms_distributed__c',
    dataValue('form.condom_distributions.number_of_male_condoms_distributed')
    ),
    field('Number_of_Male_Condoms_Accessed__c', dataValue('form.condom_distributions.number_of_male_condoms_accessed')),
    field(
    'Number_of_Female_Condoms_distributed__c',
    dataValue('form.condom_distributions.number_of_female_condoms_distributed')
    ),
    field(
    'Number_of_Female_Condoms_Accessedx__c',
    dataValue('form.condom_distributions.number_of_female_condoms_accessed')
    ),
    field(
    'Females_Referred_for_Family_Planning__c',
    dataValue('form.other_srhr_services.females_referred_for_family_planning')
    ),
    field(
    'Females_Referred_for_Cervical_Cancer__c',
    dataValue('form.other_srhr_services.females_referred_for_cervical_cancer')
    ),
    field('Females_Referred_for_Antenatal__c', dataValue('form.other_srhr_services.females_referred_for_antenatal')),
    field(
    'Males_Referred_for_Malaria_Testing__c',
    dataValue('form.other_referral_services.males_referred_for_malaria_testing')
    ),
    field('Males_Referred_for_GBV__c', dataValue('form.other_referral_services.males_referred_for_gbv')),
    field(
    'Females_Referred_for_Malaria_Testing__c',
    dataValue('form.other_referral_services.females_referred_for_malaria_testing')
    ),
    field('Females_Referred_for_GBV__c', dataValue('form.other_referral_services.females_referred_for_gbv')),
    field(
    'Females_Referred_for_HPV_Vaccine__c',
    dataValue('form.other_referral_services.females_referred_for_hpv_vaccine')
    )
    )
    );
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-Attendance-Skillz-Plus-Club-2021-05-24.html b/adaptors/library/jobs/auto/Upsert-Attendance-Skillz-Plus-Club-2021-05-24.html index 6570f8bfe3cc..78387b1975b9 100644 --- a/adaptors/library/jobs/auto/Upsert-Attendance-Skillz-Plus-Club-2021-05-24.html +++ b/adaptors/library/jobs/auto/Upsert-Attendance-Skillz-Plus-Club-2021-05-24.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Upsert Attendance Skillz Plus Club

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, each, field, fields, lastReferenceValue, map, query, relationship, upsert, Array

    Expression

    query(
    `SELECT Participant_Identification_Number_PID__c from Person__c where Participant_Identification_Number_PID__c = '${state.data.form.attendance_list.update_participant_cases.item[0]['@id']}'`
    );

    fn(state => {
    const PID = lastReferenceValue('records[0].Participant_Identification_Number_PID__c')(state);

    if (!PID) {
    console.log(
    `Participant not found with Participant_Identification_Number_PID__c: ${state.data.form.attendance_list.update_participant_cases.item[0]['@id']}`
    );
    return state;
    }
    return execute(
    // Set state.references to event record
    query(
    `SELECT Id, Name, CommCare_Ext_ID__c FROM Event__c WHERE CommCare_Case_ID__c = '${state.data.form.case['@case_id']}'`
    ),
    // Organise data and keep it safe
    fn(state => {
    function objectToArray(object) {
    if (!object) return [];
    return !Array.isArray(object) ? [object] : object;
    }

    const eventName = lastReferenceValue('records[0].CommCare_Ext_ID__c')(state);
    state.data.eventName = eventName;

    state.data.form.attendance_list.update_participant_cases.item = objectToArray(
    state.data.form.attendance_list.update_participant_cases.item
    );

    state.data.form.attendance_list.update_participant_cases.item =
    state.data.form.attendance_list.update_participant_cases.item.map(item => ({
    ...item,
    CommCare_Ext_ID__c: `${item['@id']}-${eventName}`,
    event_case_id: state.data.form.case['@case_id'],
    }));

    // Keep our data safe
    state.items = state.data.form.attendance_list.update_participant_cases.item;

    // Reset references
    state.references = [];

    return state;
    }),
    // Set state.references to an array of attendance records for each participant
    beta.each(
    '$.items[*]',
    query(
    state => `SELECT CommCare_Ext_ID__c, Session_1__c, Session_2__c, Session_3__c, Session_4__c, Session_5__c, Session_6__c, Session_7__c, Session_8__c, Session_9__c, Session_10__c, Session_11__c, Session_12__c, Session_13__c, Session_14__c, Session_15__c, Session_16__c, Session_17__c, Session_18__c, Session_19__c, Session_20__c, Session_21__c, Session_22__c, Session_23__c,Session_24__c, Session_25__c, Session_26__c, Session_27__c, Session_28__c
    FROM Attendance__c
    WHERE CommCare_Ext_ID__c = '${state.data.CommCare_Ext_ID__c}'
    `
    )
    ),
    // Calculate dynamic fields
    fn(state => {
    state.items = state.items.map(item => {
    const record = state.references.find(rec =>
    rec.records[0] ? rec.records[0].CommCare_Ext_ID__c === item.CommCare_Ext_ID__c : true
    ).records[0];

    function getSessionValue(present) {
    if (!present) return 'U';
    switch (present.toString().toLowerCase()) {
    case 'yes':
    return 'X';
    case 'no':
    return 'A';
    case '':
    return 'N';
    default:
    return 'U';
    }
    }

    function getSessionFieldName(record) {
    if (!record || Object.keys(record).length === 0) {
    return 'Session_1__c';
    }

    const fieldName = Object.entries(record)
    .filter(rec => rec[1] === null && rec[0] !== 'CommCare_Ext_ID__c')
    .sort(function (a, b) {
    return a[0].split('_')[1] - b[0].split('_')[1];
    })[0][0];

    return fieldName;
    }

    const sessionValue = getSessionValue(item.attendance_session);
    const sessionDate = item.date;
    const sessionFieldName = getSessionFieldName(record);
    const sessionDateFieldName = `Session_${sessionFieldName.split('_')[1]}_Date__c`;

    return {
    ...item,
    dynamicFields: {
    [sessionFieldName]: sessionValue,
    [sessionDateFieldName]: sessionDate,
    },
    };
    });

    // Reset state.references
    state.references = [];

    return state;
    }),

    // Upsert
    beta.each(
    '$.items[*]',
    upsert('Attendance__c', 'CommCare_Ext_ID__c', state => ({
    ...fields(
    field('CommCare_Ext_ID__c', dataValue('CommCare_Ext_ID__c')),
    relationship('Person_Attendance__r', 'Participant_Identification_Number_PID__c', dataValue('@id')),
    relationship('Event__r', 'CommCare_Case_ID__c', dataValue('event_case_id'))
    ),
    ...state.data.dynamicFields,
    }))
    )
    )(state);
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-Coach-Support-Visit-CSV-2021-04-28.html b/adaptors/library/jobs/auto/Upsert-Coach-Support-Visit-CSV-2021-04-28.html index 8c11f36684af..a5d11537cb68 100644 --- a/adaptors/library/jobs/auto/Upsert-Coach-Support-Visit-CSV-2021-04-28.html +++ b/adaptors/library/jobs/auto/Upsert-Coach-Support-Visit-CSV-2021-04-28.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Upsert Coach Support Visit CSV

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    alterState, dataValue, field, fields, join, map, relationship, upsert

    Expression

    //openfn.org source
    alterState(state => {
    function clean(str) {
    console.log('str', str);

    if (!str) return '';

    return str
    .split('_')
    .map(word => {
    let new_word = word.toString().toLowerCase();
    return new_word.slice(0, 1).toUpperCase() + new_word.slice(1);
    })
    .join(' ');
    }

    if (state.data.form['step_3_-_the_big_5'] !== undefined ){
    state.data.form['step_3_-_the_big_5'].faciliation = clean(state.data.form['step_3_-_the_big_5'].faciliation);
    }
    else{
    state.data.form.step_4_comments.for_each_practice_component_describe_what_the_coach_did_well_and_how_the_co.faciliation =
    clean(state.data.form.step_4_comments.for_each_practice_component_describe_what_the_coach_did_well_and_how_the_co.faciliation);
    }

    function transform(value) {
    if (!value) return;
    switch (value.toString().trim()) {
    case 'copy-1-of-excellent':
    return 'Excellent';
    case 'needs_improvement':
    return 'Needs Improvement';
    case 'meets_expectations':
    return 'Meets Expectations';
    case 'excellent':
    return 'Excellent';
    case 'unsatisfactory':
    return 'Unsatisfactory';
    case 'exceeds_expectations':
    return 'Exceeds Expectations';
    default:
    return value;
    }
    }

    state.data.form['step_3_-_the_big_5'].builds_personal_connections =
    transform(state.data.form['step_3_-_the_big_5'].builds_personal_connections)

    state.data.form['step_3_-_the_big_5'].cool_down =
    transform(state.data.form['step_3_-_the_big_5'].cool_down)

    state.data.form['step_3_-_the_big_5'].creates_safe_space =
    transform(state.data.form['step_3_-_the_big_5'].creates_safe_space)

    state.data.form['step_3_-_the_big_5'].faciliation =
    transform(state.data.form['step_3_-_the_big_5'].faciliation)

    state.data.form['step_3_-_the_big_5'].gives_praise =
    transform(state.data.form['step_3_-_the_big_5'].gives_praise)

    state.data.form['step_3_-_the_big_5'].praise =
    transform(state.data.form['step_3_-_the_big_5'].praise)

    state.data.form['step_3_-_the_big_5'].preparation =
    transform(state.data.form['step_3_-_the_big_5'].preparation)

    state.data.form['step_3_-_the_big_5'].shares_accurate_information_about_hivaids_sexual_reproductive_health_and_ri =
    transform(state.data.form['step_3_-_the_big_5'].shares_accurate_information_about_hivaids_sexual_reproductive_health_and_ri)

    state.data.form['step_3_-_the_big_5'].sparks_vital_conversations =
    transform(state.data.form['step_3_-_the_big_5'].sparks_vital_conversations)

    state.data.form['step_3_-_the_big_5'].time_management =
    transform(state.data.form['step_3_-_the_big_5'].time_management)

    state.data.form['step_3_-_the_big_5'].warm_up =
    transform(state.data.form['step_3_-_the_big_5'].warm_up)


    return state;
    });

    upsert(
    'Coach_Support_Visit__c',
    'CommCare_Ext_ID__c',
    fields(
    field('CommCare_Ext_ID__c', dataValue('id')),
    relationship('Coach_Person__r', 'CommCare_Ext_ID__c', state => {
    return dataValue('form.step_1_basic_information.select_coach')(state) ||
    dataValue('form.step_1_csv_information.select_coach')(state);
    }),
    relationship('Venue__r', 'CommCare_Ext_ID__c', state => {
    return dataValue('form.hidden_properties.venue')(state) ||
    dataValue('form.step_1_csv_information.venue')(state);
    }),
    relationship('Event__r', 'CommCare_Ext_ID__c', state => {
    return dataValue('form.hidden_properties.intervention')(state) ||
    dataValue('form.step_1_csv_information.intervention')(state);
    }),
    relationship('Curriculum_Aggregate__r', 'CommCare_Ext_ID__c', state => {
    return dataValue('form.hidden_properties.curriculum')(state) ||
    dataValue('form.step_1_csv_information.curriculum')(state);
    }),
    relationship('Site_Lookup__r', 'CommCare_Ext_ID__c', state => {
    return dataValue('form.hidden_properties.site')(state) ||
    dataValue('form.step_1_csv_information.site')(state);
    }),
    field('Date__c', dataValue('form.step_2_practice_information.date_of_csv')),
    //== TODO: FIx repeated mappings to only reference destination field 1 time ===//
    field(
    'Accurate_Information__c', state => {
    return dataValue('form.step_3_-_the_big_5.shares_accurate_information_about_hivaids_sexual_reproductive_health_and_ri')(state) ||
    dataValue(
    'form.step_3_the_big_five.question1.shares_accurate_information_about_hivaids_sexual_reproductive_health_and_ri'
    )(state);
    }),
    field('Creates_safe_space__c', state => {
    return dataValue('form.step_3_-_the_big_5.creates_safe_space')(state) ||
    dataValue('form.step_3_the_big_five.question1.creates_safe_space')(state);

    }),
    field('Builds_personal_connections__c', state => {
    return dataValue('form.step_3_-_the_big_5.builds_personal_connections')(state) ||
    dataValue('form.step_3_the_big_five.question1.builds_personal_connections')(state);
    }),
    field('Gives_praise__c', state => {
    return dataValue('form.step_3_-_the_big_5.gives_praise')(state) ||
    dataValue('form.step_3_the_big_five.question1.gives_powerful_praise')(state);
    }),
    field('Sparks_vital_conversations__c', state => {
    return dataValue('form.step_3_-_the_big_5.sparks_vital_conversations')(state) ||
    dataValue('form.step_3_the_big_five.question1.sparks_vital_conversations')(state);
    }),
    field('X2_Warm_Up__c', state => {
    return dataValue('form.step_3_-_the_big_5.warm_up')(state) ||
    dataValue(
    'form.step_4_comments.for_each_practice_component_describe_what_the_coach_did_well_and_how_the_co.warm_up'
    )(state);
    }),
    field('X3_Activity__c', state => {
    return dataValue('form.step_3_-_the_big_5.activity')(state) || dataValue(
    'form.step_4_comments.for_each_practice_component_describe_what_the_coach_did_well_and_how_the_co.activity'
    )(state);
    }),
    field('X4_Cool_Down__c', state => {
    return dataValue('form.step_3_-_the_big_5.cool_down')(state) || dataValue(
    'form.step_4_comments.for_each_practice_component_describe_what_the_coach_did_well_and_how_the_co.cool_down'
    )(state);
    }),
    field('X5_Facilitation__c', state => {
    return dataValue('form.step_3_-_the_big_5.faciliation')(state) ||
    dataValue(
    'form.step_4_comments.for_each_practice_component_describe_what_the_coach_did_well_and_how_the_co.faciliation'
    )(state);
    }),
    field(
    'X6_Time_Management__c',
    dataValue('form.step_3_-_the_big_5.time_management')
    ),
    field(
    'X1_Preparation__c',
    dataValue('form.step_3_-_the_big_5.preparation')
    ),
    field('Introduces_micromove__c', state => {
    return //dataValue('form.step_3_-_the_big_5.faciliation')(state) ||
    dataValue(
    'form.step_4_comments.for_each_practice_component_describe_what_the_coach_did_well_and_how_the_co.micromove'
    )(state);
    }),
    field(
    'Notes__c',
    dataValue(
    'form.step_3_-_the_big_5.additional_notes.include_your_obsevations_related_to_preparation_punctuality_process'
    )
    )
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-Confirm-Services-Received-2021-06-14.html b/adaptors/library/jobs/auto/Upsert-Confirm-Services-Received-2021-06-14.html index 8d7b09edc8c3..1ba6e803534a 100644 --- a/adaptors/library/jobs/auto/Upsert-Confirm-Services-Received-2021-06-14.html +++ b/adaptors/library/jobs/auto/Upsert-Confirm-Services-Received-2021-06-14.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Upsert Confirm Services Received

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    alterState, dataValue, field, fields, upsert

    Expression

    // Your job goes here.
    alterState(state => {
    state.data.external_commcare_id = (
    dataValue('form.hidden_properties.intervention_name')(state) +
    dataValue('form.hidden_properties.participant_first_name')(state) +
    dataValue('form.hidden_properties.participant_surname')(state)
    )
    .toString()
    .toLowerCase()
    .replace(/\s/g, '')
    .trim();

    return state;
    });

    upsert(
    'NewReferral__c',
    'CommCare_Ext_ID__c',
    fields(
    field('Business_Unit_Site__c', state => {
    const bu = dataValue('form.business_unit')(state);
    return bu === 'X' ? 'GRS Zambia' : bu;
    }),
    field('CommCare_Ext_ID__c', dataValue('form.case.@case_id')),
    field('HIV_Testing_Services_Service_Provider__c', state =>
    Boolean(
    dataValue('form.referral_services.hiv_support__care.check_services_label.hiv_support_care_option1')(state)
    )
    ),
    field('TB_Screening_Service_Provider__c', state =>
    Boolean(
    dataValue('form.referral_services.hiv_support__care.check_services_label.hiv_support_care_option2')(state)
    )
    ),
    field('VMMC_Service_Provider__c', state =>
    Boolean(
    dataValue('form.referral_services.hiv_support__care.check_services_label.hiv_support_care_option3')(state)
    )
    ),
    field('Post_Exposure_Prophylaxis_Service_Provid__c', state =>
    Boolean(
    dataValue(
    'form.referral_services.hiv_support__care.check_services_label.hiv_support_care_option4'
    )(state)
    )
    ),
    field('PrEP_Service_Provider__c', state =>
    Boolean(
    dataValue(
    'form.referral_services.hiv_support__care.check_services_label.hiv_support_care_option5'
    )(state)
    )
    ),
    field('HIV_STI_PREVENTION_Other_Service_Provid__c', state =>
    Boolean(
    dataValue(
    'form.referral_services.hiv_support__care.check_services_label.hiv_support_care_option6'
    )(state)
    )
    ),
    field('ART_Initiation_Service_Provider__c', state =>
    Boolean(
    dataValue('form.referral_services.art_support_services.art_services_group.art_services_option1')(
    state
    )
    )
    ),
    field('SKILLZ_Plus_Club_Support_Service_Provid__c', state =>
    Boolean(
    dataValue('form.referral_services.art_support_services.art_services_group.art_services_option2')(
    state
    )
    )
    ),

    field(
    'PMTCT_Service_Provider__c',
    state =>
    Boolean(
    dataValue('form.referral_services.art_support_services.art_services_group.art_services_option3')(
    state
    )
    )
    ),
    field('IPTG_Health_Facility__c', state =>
    Boolean(
    dataValue('form.referral_services.mental_health_services.confirmation_of_services_provided_label.mental_health_select_services_option1')(
    state
    )
    )
    ),
    field('IPTG_Specialized_to_SMZ__c', state =>
    Boolean(
    dataValue('form.referral_services.mental_health_services.confirmation_of_services_provided_label.mental_health_select_services_option2')(
    state
    )
    )
    ),

    field('ART_Services_Other_Service_Provider__c', state =>
    Boolean(
    dataValue('form.referral_services.art_support_services.referred_art_support_services')(state)
    )
    ),
    field(
    'Victim_Friendly_Services_Service_Provide__c',
    state =>
    Boolean(
    dataValue(
    'form.referral_services.child_protection_support_services.copy-1-of-check_the_services_that_were_provided.child_protection_option1'
    )(state)
    ) ||
    Boolean(
    dataValue(
    'form.referral_services.child_protection_support_services.copy-1-of-check_the_services_that_were_provided.child_protection_option2'
    )(state)
    ) ||
    Boolean(
    dataValue(
    'form.referral_services.child_protection_support_services.copy-1-of-check_the_services_that_were_provided.child_protection_option3'
    )(state)
    )
    ),
    field('Legal_Services_Other_Service_Provider__c', state =>
    Boolean(
    dataValue(
    'form.referral_services.other_legal_services.confirmation_of_services_provided_label.legal_services_option3'
    )(state)
    )
    ),

    field('STI_Screen_Testing_Service_Provider__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option1')(state))
    ),

    field('Contraception_Family_Plan_Servi_Provider__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option2')(state))
    ),
    field('Cervical_Cancer_Screen_Servi_Provider__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option3')(state))
    ),
    field('HPV_vaccine_Service_Provider__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option4')(state))
    ),
    field('Antenatal_Care_ANC_Service_Provider__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option5')(state))
    ),
    field('Sexual_and_GBV_Abuse_Servi_Provider__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option6')(state))
    ),
    field(
    'Psycho_Social_Support_Service_Provider__c',
    state =>
    Boolean(
    dataValue(
    'form.referral_services.other_srhr_services.service_label.srhr_option9'
    )(state)
    ) ||
    Boolean(
    dataValue(
    'form.referral_services.other_srhr_services.service_label.srhr_option8'
    )(state)
    ) ||
    Boolean(
    dataValue(
    'form.referral_services.other_srhr_services.service_label.srhr_option7'
    )(state)
    )
    ),
    field('Psycho_Social_Services_Other_Service_Pro__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option10')(state))
    ),
    field(
    'Legal_Services_Other_Service_Provider__c',
    state =>
    Boolean(
    dataValue('form.referral_services.other_legal_services.confirmation_of_services_provided_label.legal_referral_services')(state)
    ) ||
    Boolean(
    dataValue('form.referral_services.other_legal_services.confirmation_of_services_provided_label.legal_services_option1')(state)
    ) ||
    Boolean(
    dataValue('form.referral_services.other_legal_services.confirmation_of_services_provided_label.legal_services_option2')(state)
    )
    ),

    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-Home-Visit-Log-Form-2021-05-03.html b/adaptors/library/jobs/auto/Upsert-Home-Visit-Log-Form-2021-05-03.html index 7050724bed90..17a2ce7b6044 100644 --- a/adaptors/library/jobs/auto/Upsert-Home-Visit-Log-Form-2021-05-03.html +++ b/adaptors/library/jobs/auto/Upsert-Home-Visit-Log-Form-2021-05-03.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Upsert Home Visit Log Form

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields, lastReferenceValue, query, relationship, upsert

    Expression

    // push to production

    query(
    `SELECT Participant_Identification_Number_PID__c from Person__c where Participant_Identification_Number_PID__c = '${state.data.form.case['@case_id']}'`
    );

    fn(state => {
    const PID = lastReferenceValue('records[0].Participant_Identification_Number_PID__c')(state);
    if (!PID) {
    console.log(
    `Participant not found with Participant_Identification_Number_PID__c: ${state.data.form.case['@case_id']}`
    );
    return state;
    }

    return execute(
    fn(state => {
    const { form } = state.data;
    const { basic_information } = form;
    if (basic_information.intervention_hidden) {
    return query(
    `SELECT Id, Event__c, CreatedDate, Person_Attendance__c
    FROM Attendance__c
    WHERE Person_Attendance__r.Participant_Identification_Number_PID__c = '${form.case['@case_id']}'
    ORDER BY CreatedDate DESC LIMIT 1`
    )(state).then(state => {
    const { records } = state.references[0];
    const eventId = records[0].Event__c;
    state.data.eventField = [field('Event__c', eventId)];
    return state;
    });
    // state.data.eventField = [
    // relationship('Event__r', 'CommCare_Ext_ID__c', dataValue('form.basic_information.intervention_hidden')(state)),
    // ];
    // return state;
    } else {
    return query(
    `SELECT Id, Event__c, CreatedDate, Person_Attendance__c
    FROM Attendance__c
    WHERE Person_Attendance__r.Participant_Identification_Number_PID__c = '${form.case['@case_id']}'
    ORDER BY CreatedDate DESC LIMIT 1`
    )(state).then(state => {
    const { records } = state.references[0];
    const eventId = records[0].Event__c;
    state.data.eventField = [field('Event__c', eventId)];
    return state;
    });
    }
    }),

    upsert('Home_Visit__c', 'CommCare_Ext_ID__c', state => ({
    ...fields(
    field('CommCare_Ext_ID__c', dataValue('id')),
    // relationship('Event__r', 'CommCare_Ext_ID__c', dataValue('form.basic_information.intervention_hidden')),
    relationship('Person_visiting__r', 'Participant_Identification_Number_PID__c', dataValue('form.case.@case_id')),
    //=== NOTE: We do not need to map People information because Home Visit is related to Person. ======//
    //This info already lives on the Person-level.
    // field('First_Name__c', dataValue('form.basic_information.participant_first_name')),
    // field('Surname__c', dataValue('form.basic_information.participant_surname')),
    // field('Sex__c', dataValue('form.basic_information.gender')),
    // field('Date_of_Birth__c', dataValue('form.basic_information.date_of_birth')),
    // field('Physical Address Community City', dataValue('form.basic_information.participant_address')),
    //================
    field('Mobile_Number__c', dataValue('form.basic_information.Mobile_number')),
    field('Consent_Given__c', dataValue('form.basic_information.consent_received')),
    //field('Consent_Given__c', dataValue('form.participant_infomation.visit_information.consent_given')) //Repeated mapping
    //field('From_Venue__c', dataValue('form.basic_information.venue_hidden')),
    field('Reason_for_Home_Visit__c', dataValue('form.participant_infomation.reason_for_home_visit')),
    field('Visit_Date__c', dataValue('form.participant_infomation.visit_information.visit_date')),
    field('Additional_Comments__c', dataValue('form.administrative.visit_notes'))
    ),
    ...fields(...state.data.eventField),
    }))
    )(state);
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-Intervention-Notes-2021-04-28.html b/adaptors/library/jobs/auto/Upsert-Intervention-Notes-2021-04-28.html index 4599b34ae2e6..ea72dfbc1ade 100644 --- a/adaptors/library/jobs/auto/Upsert-Intervention-Notes-2021-04-28.html +++ b/adaptors/library/jobs/auto/Upsert-Intervention-Notes-2021-04-28.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Upsert Intervention Notes

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields, relationship, upsert

    Expression

    //openfn.org source 
    upsert(
    'Event__c',
    'CommCare_Case_ID__c',
    fields(
    field('CommCare_Case_ID__c', dataValue('form.case.@case_id')),
    //field('Name', dataValue('form.intervention_name')),
    field('Notes__c', dataValue('form.intervention_notes_to_save')),
    relationship('RecordType', 'Name', 'Intervention')
    )
    );
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-Post-Challenges-2021-04-30.html b/adaptors/library/jobs/auto/Upsert-Post-Challenges-2021-04-30.html index b330489f4a33..1918a919de0f 100644 --- a/adaptors/library/jobs/auto/Upsert-Post-Challenges-2021-04-30.html +++ b/adaptors/library/jobs/auto/Upsert-Post-Challenges-2021-04-30.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Upsert Post Challenges

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields, lastReferenceValue, query, relationship, upsert

    Expression

    fn(state => {
    function transform(value) {
    if (!value) return;
    switch (value.toString().trim().toLowerCase()) {
    case 'true':
    case 'yes':
    case 'agree':
    case 'concordo':
    case 'verdade':
    case 'copy-1-of-yes':
    case 'choice1':
    return 1;
    case 'false':
    case 'no':
    case 'disagree':
    case 'discordo':
    case 'falso':
    case 'copy-1-of-no':
    case 'choice3':
    case 'choice6':
    return 2;
    case 'i_dont_know':
    case 'na':
    return 3;
    case 'unanswered':
    case `not_sexually_active`:
    return 4;
    case 'not_applicable':
    return 5;
    default:
    return value;
    }
    }

    state.helperFunctions = { transform };

    return query(
    `SELECT Participant_Identification_Number_PID__c from Person__c where Participant_Identification_Number_PID__c = '${state.data.form.case['@case_id']}'`
    )(state);
    });

    fn(state => {
    const { form } = state.data;

    const formVersion = Object.keys(form).find(key => key.includes('challenge'));
    if (formVersion == 'post_challenge_ecap_-_post_-_season_survey_for_athletes') {
    console.log('Skipping upsert for ECAP data');
    return { ...state, formVersion };
    }
    console.log('form version', formVersion);

    const sfFieldMapping = {
    'portuguese_pre_challenge_gcr_-_skillz_malaria': {
    Post_1__c:
    'form.portuguese_pre_challenge_gcr_-_skillz_malaria.dormir_dentro_da_rede_mosquiteira_tratada_todas_as_noites_pode_proteger_me_',
    Post_2__c:
    'form.portuguese_pre_challenge_gcr_-_skillz_malaria.posso_esperar_uns_dias_antes_de_fazer_o_teste_de_malria_se_tiver_febres',
    Post_3__c:
    'form.portuguese_pre_challenge_gcr_-_skillz_malaria.um_mdico_tradicionalcurandeiro_pode_me_dar_um_tratamento_para_curar_a_malri',
    Post_4__c:
    'form.portuguese_pre_challenge_gcr_-_skillz_malaria.se_tiver_malria_e_no_for_tratado_posso_transmitir_a_malria_a_algum',
    Post_5__c:
    'form.portuguese_pre_challenge_gcr_-_skillz_malaria.somente_as_mulheres_grvidas_e_as_crianas_menores_de_5_anos__que_precisam_de',
    Post_6__c: 'form.portuguese_pre_challenge_gcr_-_skillz_malaria.a_malria_pode_matar_se_no_fr_tratada',
    Post_7__c: 'form.portuguese_pre_challenge_gcr_-_skillz_malaria.a_febre__um_sintoma_da_malria',
    Post_8__c: 'form.portuguese_pre_challenge_gcr_-_skillz_malaria.eu_me_sinto_bem_conmigo_mesmo',
    Post_9__c:
    'form.portuguese_pre_challenge_gcr_-_skillz_malaria.tenho_algum_na_minha_vida_que_pode_me_dar_bons_conselhos_quando_preciso_de_',
    Post_10__c:
    'form.portuguese_pre_challenge_gcr_-_skillz_malaria.eu_sei_onde_posso_ter_tratamento_para_malria_na_minha_comunidade',
    Post_11__c: 'form.portuguese_pre_challenge_gcr_-_skillz_malaria.posso_proteger-me_da_malria',
    },

    'post_challenge_south_africa_-_skillz_girl': {
    Post_1__c:
    'form.post_challenge_south_africa_-_skillz_girl.i_have_an_older_person_in_my_life_i_can_go_to_for_advice_i_have_an_older_pe',
    Post_2__c:
    'form.post_challenge_south_africa_-_skillz_girl.i_know_how_to_make_a_plan_to_deal_with_the_challenges_i_may_face_in_reachin',
    Post_3__c:
    'form.post_challenge_south_africa_-_skillz_girl.i_can_identify_my_strengths_or_things_that_i_am_good_at_in_life',
    Post_4__c: 'form.post_challenge_south_africa_-_skillz_girl.every_day_i_can_find_something_to_be_grateful_for',
    Post_5__c:
    'form.post_challenge_south_africa_-_skillz_girl.having_more_than_one_sexual_partner_increases_my_risk_of_getting_hiv',
    Post_6__c:
    'form.post_challenge_south_africa_-_skillz_girl.i_can_say_no_to_sex_even_if_my_partner_or_friends_pressure_me_to_have_sex',
    Post_7__c:
    'form.post_challenge_south_africa_-_skillz_girl.girls_have_a_greater_risk_of_contracting_hiv_than_boys',
    Post_8__c:
    'form.post_challenge_south_africa_-_skillz_girl.if_i_am_sexually_active_i_go_to_a_clinic_to_get_protection_from_hivstis_and',
    Post_9__c: 'form.post_challenge_south_africa_-_skillz_girl.like_physical_health_we_all_have_mental_health',
    Post_10__c:
    'form.post_challenge_south_africa_-_skillz_girl.i_know_where_to_go_for_support_if_i_or_someone_i_know_drinks_too_much_alcoh',
    Post_11__c:
    'form.post_challenge_south_africa_-_skillz_girl.it_is_the_males_responsibility_to_make_decisions_in_a_relationship',
    Post_12__c:
    'form.post_challenge_south_africa_-_skillz_girl.if_a_girl_is_sexually_abused_she_can_reduce_her_risk_of_getting_hiv_by_goin',
    Post_13__c:
    'form.post_challenge_south_africa_-_skillz_girl.sometimes_a_man_may_have_a_good_reason_to_hit_his_partner',
    Post_14__c:
    'form.post_challenge_south_africa_-_skillz_girl.i_know_where_to_get_contraception_to_prevent_unwanted_pregnancy',
    Post_15__c:
    'form.post_challenge_south_africa_-_skillz_girl.drinking_too_much_alcohol_can_have_serious_negative_consequences_for_mental',
    Post_16__c:
    'form.post_challenge_south_africa_-_skillz_girl.if_sexually_active_i_or_my_partner_is_using_a_prevention_method_to_protect_',
    Post_17__c:
    'form.post_challenge_south_africa_-_skillz_girl.i_know_where_to_go_to_receive_counselling_for_mental_health_challenges',
    Post_18__c:
    'form.post_challenge_south_africa_-_skillz_girl.loss_of_interest_in_funenjoyable_activities_is_a_common_sign_of_depression',
    Post_19__c:
    'form.post_challenge_south_africa_-_skillz_girl.i_know_at_least_three_methods_to_prevent_an_unwanted_pregnancy',
    },
    'portuguese_post_challenge_gcr_-_skillz_girl': {
    Post_1__c:
    'form.portuguese_post_challenge_gcr_-_skillz_girl.falei_sobre_o_hiv_com_uma_pessoa_adulta_nos_ltimos_2_meses_fora_do_skillz',
    Post_2__c: 'form.portuguese_post_challenge_gcr_-_skillz_girl.sei_como_expressar_a_minha_raiva_sem_ser_violento',
    Post_3__c:
    'form.portuguese_post_challenge_gcr_-_skillz_girl.sei_como_superar_os_desafios_que_possa_enfrentar_na_minha_vida',
    Post_4__c:
    'form.portuguese_post_challenge_gcr_-_skillz_girl.sei_quais_as_decises_a_tomar_para_alcanar_os_meus_objectivos',
    Post_5__c:
    'form.portuguese_post_challenge_gcr_-_skillz_girl.os_rapazes_correm_um_risco_mais_elevado_de_serem_vtimas_de_violncia_do_que_',
    Post_6__c:
    'form.portuguese_post_challenge_gcr_-_skillz_girl.conheco_que_mudanas_ocorrem_no_meu_corpo_durante_a_puberdade',
    Post_7__c:
    'form.portuguese_post_challenge_gcr_-_skillz_girl.conheo_pelo_menos_trs_mtodos_para_evitar_uma_gravidez_indesejada',
    Post_8__c:
    'form.portuguese_post_challenge_gcr_-_skillz_girl.os_preservativos_so_o_nico_mtodo_contraceptivo_que_protege_contra_a_gravide',
    Post_9__c:
    'form.portuguese_post_challenge_gcr_-_skillz_girl.conheco_onde_obter_servios_de_apoio_para_mim_ou_outra_pessoa_para_casos_de_',
    Post_10__c:
    'form.portuguese_post_challenge_gcr_-_skillz_girl.se_uma_rapariga_inicia_seu_perodo_menstrual_significa_que_est_pronta_para_c',
    Post_11__c:
    'form.portuguese_post_challenge_gcr_-_skillz_girl.caso_eu_seja_abusada_sexualmente_prefiro_guard-lo_para_mim_para_evitar_que_',
    Post_12__c:
    'form.portuguese_post_challenge_gcr_-_skillz_girl.um_homem_tem_o_direito_de_ter_sexo_com_a_sua_namorada_mesmo_que_ela_no_o_qu',
    Post_13__c:
    'form.portuguese_post_challenge_gcr_-_skillz_girl.pessoas_com_problemas_de_sade_mental_so_apenas_confusas_ou_loucas',
    Post_14__c:
    'form.portuguese_post_challenge_gcr_-_skillz_girl.pessoas_com_problemas_de_sade_mental_so_apenas_confusas_ou_loucas',
    Post_15__c:
    'form.portuguese_post_challenge_gcr_-_skillz_girl.informaria_a_algum_caso_fosse_tocada_por_alguem_de_uma_forma_que_me_deixass',
    Post_16__c:
    'form.portuguese_post_challenge_gcr_-_skillz_girl.uma_filha_deve_sempre_respeitar_a_deciso_dos_seus_pais_para_se_casar',
    Post_17__c:
    'form.portuguese_post_challenge_gcr_-_skillz_girl.um_casamento_bem_sucedido__mais_importante_para_as_raparigas_do_que_termina',
    Post_18__c: 'form.portuguese_post_challenge_gcr_-_skillz_girl.eu_no_praticaria_desporto_com_algum_que_tem_hiv',
    Post_19__c:
    'form.portuguese_post_challenge_gcr_-_skillz_girl.um_namorado_pode_ter_boas_razes_para_bater_na_sua_namorada',
    Post_20__c:
    'form.portuguese_post_challenge_gcr_-_skillz_girl.no_faz_mal_que_um_rapaz_ameace_bater_na_sua_namorada_se_nunca_a_bater_fisic',
    },
    'post_challenge_zambia_-_plus_mh_enhanced_zambia': {
    Post_1__c: 'form.post_challenge_zambia_-_plus_mh_enhanced_zambia.in_general_i_feel_good_about_myself',
    Post_2__c:
    'form.post_challenge_zambia_-_plus_mh_enhanced_zambia.i_have_the_skills_and_knowledge_to_avoid_getting_infected_with_another_kind',
    Post_3__c:
    'form.post_challenge_zambia_-_plus_mh_enhanced_zambia.it_is_important_to_know_why_and_how_i_want_to_tell_someone_my_hiv_status',
    Post_4__c: 'form.post_challenge_zambia_-_plus_mh_enhanced_zambia.i_accept_myself_and_my_hiv_status',
    Post_5__c:
    'form.post_challenge_zambia_-_plus_mh_enhanced_zambia.i_can_make_my_own_informed_decisions_about_my_sexual_healthcare',
    Post_6__c:
    'form.post_challenge_zambia_-_plus_mh_enhanced_zambia.are_you_or_have_you_been_past_12_months_in_a_sexual_relationship_na_if_not_',
    Post_7__c:
    'form.post_challenge_zambia_-_plus_mh_enhanced_zambia.are_you_or_your_boyfriendgirlfriend_currently_using_any_contraceptive_or_pr',
    Post_8__c:
    'form.post_challenge_zambia_-_plus_mh_enhanced_zambia.i_have_an_older_person_in_my_life_i_can_go_to_for_advice',
    Post_9__c:
    'form.post_challenge_zambia_-_plus_mh_enhanced_zambia.there_are_people_i_trust_with_whom_i_can_talk_about_my_status',
    Post_10__c:
    'form.post_challenge_zambia_-_plus_mh_enhanced_zambia.it_is_okay_for_two_people_with_hiv_to_have_unprotected_sex_with_each_other',
    Post_11__c:
    'form.post_challenge_zambia_-_plus_mh_enhanced_zambia.it_is_okay_for_someone_with_hiv_to_stop_taking_their_arv_as_soon_as_they_st',
    Post_12__c:
    'form.post_challenge_zambia_-_plus_mh_enhanced_zambia.when_i_have_a_choice_it_is_important_to_eat_a_variety_of_foods_including_gr',
    Post_13__c:
    'form.post_challenge_zambia_-_plus_mh_enhanced_zambia.mental_health_problems_have_nothing_to_do_with_being_lazy_or_weak_and_many_',
    Post_14__c:
    'form.post_challenge_zambia_-_plus_mh_enhanced_zambia.art_adherence_is_an_important_part_of_my_overall_health_and_well-being',
    Post_15__c:
    'form.post_challenge_zambia_-_plus_mh_enhanced_zambia.the_most_common_illnesses_of_mental_health_are_depression_and_anxiety',
    Post_16__c:
    'form.post_challenge_zambia_-_plus_mh_enhanced_zambia.biological_and_social_factors_contribute_to_females_and_males_experiencing_',
    },
    'post_challenge_nigeria_-_advanced_skills': {
    Post_1__c:
    'form.post_challenge_nigeria_-_advanced_skills.i_have_talked_about_hiv_with_an_adult_in_the_past_two_months_outside_skillz',
    Post_2__c:
    'form.post_challenge_nigeria_-_advanced_skills.i_have_talked_about_malaria_with_an_adult_in_the_past_two_months_outside_sk',
    Post_3__c:
    'form.post_challenge_nigeria_-_advanced_skills.unequal_power_in_relationships_can_contribute_to_the_spread_of_hiv',
    Post_4__c:
    'form.post_challenge_nigeria_-_advanced_skills.the_most_effective_way_to_avoid_getting_hiv_is_to_abstain_from_sex',
    Post_5__c: 'form.post_challenge_nigeria_-_advanced_skills.malaria_is_spread_by_standing_under_the_hot_sun',
    Post_6__c: 'form.post_challenge_nigeria_-_advanced_skills.drinking_alcohol_can_increase_my_risk_of_getting_hiv',
    Post_7__c:
    'form.post_challenge_nigeria_-_advanced_skills.sleeping_under_a_mosquito_net_every_night_can_help_protect_me_from_malaria',
    Post_8__c:
    'form.post_challenge_nigeria_-_advanced_skills.having_more_than_one_sexual_partner_over_the_same_time_period_increases_my_',
    Post_9__c:
    'form.post_challenge_nigeria_-_advanced_skills.it_is_okay_for_someone_with_malaria_to_stop_taking_their_medication_as_soon',
    Post_10__c:
    'form.post_challenge_nigeria_-_advanced_skills.i_can_abstain_from_sex_until_i_am_older_even_if_it_is_difficult',
    Post_11__c:
    'form.post_challenge_nigeria_-_advanced_skills.i_would_say_no_to_playing_sport_with_someone_who_has_hiv',
    Post_12__c:
    'form.post_challenge_nigeria_-_advanced_skills.men_should_share_the_work_around_the_house_such_as_cleaning',
    Post_13__c:
    'form.post_challenge_nigeria_-_advanced_skills.it_is_the_males_responsibilty_to_make_decisions_in_a_relationship',
    Post_14__c:
    'form.post_challenge_nigeria_-_advanced_skills.i_can_use_drugs_and_still_easily_reach_my_goals_in_life',
    Post_15__c:
    'form.post_challenge_nigeria_-_advanced_skills.when_sick_it_is_better_to_visit_the_herb_seller_than_to_visit_a_doctor_or_a',
    Post_16__c:
    'form.post_challenge_nigeria_-_advanced_skills.it_is_okay_to_use_violence_with_my_partner_if_he_or_she_makes_me_angry',
    Post_17__c:
    'form.post_challenge_nigeria_-_advanced_skills.i_have_the_power_to_change_gender_expectations_that_i_do_not_agree_with',
    },
    'post_challenge_zimbabwe_-_skillz_core_zimbabwe': {
    Post_1__c:
    'form.post_challenge_zimbabwe_-_skillz_core_zimbabwe.copy-1-of-i_know_what_decisions_to_make_to_achieve_my_goals',
    Post_2__c:
    'form.post_challenge_zimbabwe_-_skillz_core_zimbabwe.copy-1-of-i_dont_always_have_to_do_what_people_expect_just_because_i_am_a_girlboy',
    Post_3__c: 'form.post_challenge_zimbabwe_-_skillz_core_zimbabwe.i_know_what_i_am_good_at',
    Post_4__c:
    'form.post_challenge_zimbabwe_-_skillz_core_zimbabwe.i_can_make_my_own_decisions_no_matter_how_much_pressure_i_get_from_others',
    Post_5__c:
    'form.post_challenge_zimbabwe_-_skillz_core_zimbabwe.copy-1-of-i_have_the_right_to_say_no_to_sex_no_matter_who_asks_me',
    Post_6__c:
    'form.post_challenge_zimbabwe_-_skillz_core_zimbabwe.i_can_make_my_own_informed_decisions_about_my_sexual_healthcare',
    Post_7__c:
    'form.post_challenge_zimbabwe_-_skillz_core_zimbabwe.copy-1-of-i_have_the_right_to_access_sexual_health_services_such_as_sti_and_hiv_testi',
    Post_8__c:
    'form.post_challenge_zimbabwe_-_skillz_core_zimbabwe.it_is_the_mans_responsibility_to_make_decisions_in_a_relationship',
    Post_9__c:
    'form.post_challenge_zimbabwe_-_skillz_core_zimbabwe.a_man_has_the_right_to_have_sex_with_his_girlfriend_even_if_she_doesnt_want',
    Post_10__c:
    'form.post_challenge_zimbabwe_-_skillz_core_zimbabwe.girls_should_be_obedient_and_should_not_disagree_with_boys',
    Post_11__c:
    'form.post_challenge_zimbabwe_-_skillz_core_zimbabwe.if_a_girl_gets_pregnant_she_should_drop_out_of_school',
    Post_12__c: 'form.post_challenge_zimbabwe_-_skillz_core_zimbabwe.my_skillz_coach_helps_me_to_be_a_better_person',
    Post_13__c:
    'form.post_challenge_zimbabwe_-_skillz_core_zimbabwe.i_have_someone_in_my_life_i_can_turn_to_when_i_need_advice_or_when_i_have_a',
    Post_14__c:
    'form.post_challenge_zimbabwe_-_skillz_core_zimbabwe.if_i_test_positive_for_hiv_there_will_be_someone_who_will_help_and_support_',
    Post_15__c:
    'form.post_challenge_zimbabwe_-_skillz_core_zimbabwe.i_know_who_to_go_to_if_i_amsomeone_i_know_is_abused_sexually_physically_and',
    Post_16__c:
    'form.post_challenge_zimbabwe_-_skillz_core_zimbabwe.i_know_who_to_go_to_if_someone_touches_me_in_a_way_that_makes_me_uncomforta',
    Post_17__c:
    'form.post_challenge_zimbabwe_-_skillz_core_zimbabwe.i_know_where_to_get_support_services_for_me_or_someone_else_for_hiv-related',
    Post_18__c:
    'form.post_challenge_zimbabwe_-_skillz_core_zimbabwe.i_would_say_no_to_playing_sport_with_someone_who_has_hiv',
    Post_19__c:
    'form.post_challenge_zimbabwe_-_skillz_core_zimbabwe.i_can_tell_whether_someone_has_hiv_by_looking_at_him_or_her',
    },
    'copy-1-of-post_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe': {
    Post_1__c:
    'form.copy-1-of-post_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe.copy-1-of-i_know_what_decisions_to_make_to_achieve_my_goals',
    Post_2__c:
    'form.copy-1-of-post_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe.i_dont_always_have_to_do_what_people_expect_just_because_i_am_girlboy',
    Post_3__c:
    'form.copy-1-of-post_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe.copy-1-of-i_have_the_right_to_say_no_to_sex_no_matter_who_asks_me',
    Post_4__c:
    'form.copy-1-of-post_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe.i_can_make_my_own_informed_decisions_about_my_sexual_health',
    Post_5__c:
    'form.copy-1-of-post_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe.it_is_the_mans_responsibility_to_make_decisions_in_a_relationship',
    Post_6__c:
    'form.copy-1-of-post_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe.a_man_has_the_right_to_have_sex_with_his_girlfriend_even_if_she_doesnt_want',
    Post_7__c:
    'form.copy-1-of-post_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe.my_skillz_coach_helps_me_to_be_a_better_person',
    Post_8__c:
    'form.copy-1-of-post_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe.i_have_someone_in_my_life_i_can_turn_to_when_i_need_advise_or_when_i_have_a',
    Post_9__c:
    'form.copy-1-of-post_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe.copy-1-of-i_know_where_to_get_support_services_for_me_or_someone_else_for_hiv-related',
    },
    'post_challenge_skillz_girl_-_zam_311': {
    Post_1__c: 'form.post_challenge_skillz_girl_-_zam_311.i_know_what_i_am_good_at',
    Post_2__c: 'form.post_challenge_skillz_girl_-_zam_311.i_know_how_to_overcome_challenges_that_i_may_face_in_my_life',
    Post_3__c: 'form.post_challenge_skillz_girl_-_zam_311.i_dont_always_have_to_do_what_people_expect_just_because_i_am_a_girl',
    Post_4__c: 'form.post_challenge_skillz_girl_-_zam_311.i_would_be_able_to_ask_my_boyfriend_that_i_want_to_use_a_condom',
    Post_5__c: 'form.post_challenge_skillz_girl_-_zam_311.i_can_say_no_to_sex_even_if_my_boyfriend_or_friends_pressure_me_to_have_sex',
    Post_6__c: 'form.post_challenge_skillz_girl_-_zam_311.if_i_am_sexually_active_i_go_to_a_healthcare_provider_to_get_protection_fro',
    Post_7__c: 'form.post_challenge_skillz_girl_-_zam_311.i_can_make_my_own_informed_decisions_about_my_sexual_healthcare',
    Post_8__c: 'form.post_challenge_skillz_girl_-_zam_311.it_is_only_the_girls_responsibility_to_avoid_getting_pregnant',
    Post_9__c: 'form.post_challenge_skillz_girl_-_zam_311.a_man_has_the_right_to_have_sex_with_his_girlfriend_even_if_she_doesnt_want',
    Post_10__c: 'form.post_challenge_skillz_girl_-_zam_311.sometimes_a_man_may_have_a_good_reason_to_hit_his_girlfriend_or_wife',
    Post_11__c: 'form.post_challenge_skillz_girl_-_zam_311.a_successful_marriage_is_more_important_to_girls_than_completing_school',
    Post_12__c: 'form.post_challenge_skillz_girl_-_zam_311.a_daughter_should_always_respect_her_parents_decision_for_her_to_get_marrie',
    Post_13__c: 'form.post_challenge_skillz_girl_-_zam_311.i_can_decide_when_is_the_right_time_for_me_to_have_a_baby',
    Post_14__c: 'form.post_challenge_skillz_girl_-_zam_311.i_have_someone_in_my_life_i_can_turn_to_when_i_need_advice_or_when_i_have_a',
    Post_15__c: 'form.post_challenge_skillz_girl_-_zam_311.i_know_where_to_get_support_services_for_me_or_someone_else_for_hiv-related',
    Post_16__c: 'form.post_challenge_skillz_girl_-_zam_311.i_know_where_to_get_support_services_for_me_or_someone_else_for_gender_base',
    Post_17__c: 'form.post_challenge_skillz_girl_-_zam_311.i_know_where_to_get_support_services_for_me_or_someone_else_for_prevention_',
    Post_18__c: 'form.post_challenge_skillz_girl_-_zam_311.one_sign_of_pregnancy_is_a_girl_missing_her_period',
    Post_19__c: 'form.post_challenge_skillz_girl_-_zam_311.i_know_at_least_three_methods_to_avoid_an_unwanted_pregnancy',
    Post_20__c: 'form.post_challenge_skillz_girl_-_zam_311.are_you_or_your_boyfriend_currently_using_any_contraceptive_method',
    },
    'post_challenge_skillz_core_zambia_211': {
    Post_1__c: 'form.post_challenge_skillz_core_zambia_211.question1',
    Post_2__c: 'form.post_challenge_skillz_core_zambia_211.i_know_how_to_overcome_challenges_i_may_have_in_my_life',
    Post_3__c: 'form.post_challenge_skillz_core_zambia_211.i_can_make_my_own_decisions_no_matter_how_much_pressure_i_get_from_others',
    Post_4__c: 'form.post_challenge_skillz_core_zambia_211.it_is_the_mans_responsibility_to_make_decisions_in_a_relationship',
    Post_5__c: 'form.post_challenge_skillz_core_zambia_211.i_dont_always_have_to_do_what_people_expect_because_i_am_a_boygirl',
    Post_6__c: 'form.post_challenge_skillz_core_zambia_211.a_man_has_the_right_to_have_sex_with_his_girlfriend_even_if_she_doesnt_want',
    Post_7__c: 'form.post_challenge_skillz_core_zambia_211.girls_should_not_disagree_with_boys',
    Post_8__c: 'form.post_challenge_skillz_core_zambia_211.if_a_girl_gets_pregnant_she_should_drop_out_of_school',
    Post_9__c: 'form.post_challenge_skillz_core_zambia_211.i_have_the_right_to_say_no_to_sex_no_matter_who_asks_me',
    Post_10__c: 'form.post_challenge_skillz_core_zambia_211.i_have_an_older_person_in_my_life_i_can_go_to_for_advice',
    Post_11__c: 'form.post_challenge_skillz_core_zambia_211.if_i_test_positive_for_hivthere_will_be_someone_who_will_help_and_support_m',
    Post_12__c: 'form.post_challenge_skillz_core_zambia_211.male_circumcision_reduces_a_males_risk_of_getting_hiv',
    Post_13__c: 'form.post_challenge_skillz_core_zambia_211.drinking_alcohol_can_increase_my_risk_of_getting_hiv',
    Post_14__c: 'form.post_challenge_skillz_core_zambia_211.i_know_where_to_get_support_services_for_me_or_someone_elsefor_hiv_-_relate',
    Post_15__c: 'form.post_challenge_skillz_core_zambia_211.i_know_where_to_get_support_services_for_me_or_someone_elsefor_abuse',
    Post_16__c: 'form.post_challenge_skillz_core_zambia_211.i_have_the_right_to_access_sexual_health_servicessuch_as_sti_and_hiv_testin',
    Post_17__c: 'form.post_challenge_skillz_core_zambia_211.one_sign_of_pregnancy_is_a_girl_missing_her_period',
    Post_18__c: 'form.post_challenge_skillz_core_zambia_211.i_would_say_no_to_playing_sport_with_someone_who_has_hiv',
    Post_19__c: 'form.post_challenge_skillz_core_zambia_211.i_can_tell_whether_someone_has_hiv_by_looking_at_him_or_her',
    Post_20__c: 'form.post_challenge_skillz_core_zambia_211.i_know_what_decisions_to_make_to_achieve_my_goals',
    },
    'post_challenge_skillz_boy_zambia110': {
    Post_1__c: 'form.post_challenge_skillz_boy_zambia110.in_general_i_feel_good_about_myself',
    Post_2__c: 'form.post_challenge_skillz_boy_zambia110.i_would_be_able_to_ask_my_girlfriend_that_i_want_to_use_a_condom',
    Post_3__c: 'form.post_challenge_skillz_boy_zambia110.i_dont_always_have_to_do_what_people_expect_just_because_i_am_a_boy',
    Post_4__c: 'form.post_challenge_skillz_boy_zambia110.it_is_the_mans_responsibility_to_make_decisions_in_a_relationship',
    Post_5__c: 'form.post_challenge_skillz_boy_zambia110.it_is_more_important_for_boys_to_be_educated_than_girls',
    Post_6__c: 'form.post_challenge_skillz_boy_zambia110.men_are_better_leaders_than_women',
    Post_7__c: 'form.post_challenge_skillz_boy_zambia110.a_man_has_the_right_to_have_sex_with_his_girlfriend_even_if_she_doesnt_want',
    Post_8__c: 'form.post_challenge_skillz_boy_zambia110.it_is_only_the_girls_responsibility_to_avoid_getting_pregnant',
    Post_9__c: 'form.post_challenge_skillz_boy_zambia110.it_is_okay_for_a_boyfriend_to_threaten_to_hit_his_girlfriend_if_he_never_hi',
    Post_10__c: 'form.post_challenge_skillz_boy_zambia110.i_can_say_no_to_sex_even_if_my_friends_or_girlfriend_pressure_me_to_have_se',
    Post_11__c: 'form.post_challenge_skillz_boy_zambia110.people_who_abuse_alcohol_are_more_likely_to_engage_in_risky_sexual_behaviou',
    Post_12__c: 'form.post_challenge_skillz_boy_zambia110.i_know_where_to_go_for_support_if_i_or_someone_i_know_drinks_too_much_alcoh',
    Post_13__c: 'form.post_challenge_skillz_boy_zambia110.i_have_a_friend_that_i_can_go_to_for_advice_when_i_have_a_problem',
    Post_14__c: 'form.post_challenge_skillz_boy_zambia110.i_have_the_right_to_access_sexual_health_services_such_as_hiv_and_sti_testi',
    Post_15__c: 'form.post_challenge_skillz_boy_zambia110.i_know_where_to_access_sexual_health_services_such_as_sti_and_hiv_testing',
    Post_16__c: 'form.post_challenge_skillz_boy_zambia110.before_making_a_decision_i_think_about_how_it_can_affect_me_or_others',
    Post_17__c: 'form.post_challenge_skillz_boy_zambia110.i_know_how_to_express_my_anger_without_being_violent_such_as_hitting_kickin',
    Post_18__c: 'form.post_challenge_skillz_boy_zambia110.male_circumcision_reduces_a_males_risk_of_getting_hiv',
    Post_19__c: 'form.post_challenge_skillz_boy_zambia110.i_know_how_to_correctly_use_a_male_condom',
    Post_20__c: 'form.post_challenge_skillz_boy_zambia110.are_you_or_your_boyfriendgirlfriend_currently_using_any_contraceptive_or_pr',
    },
    'post_challenge_skillz_guyz_mh_-_sa_100':{
    Post_1__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.i_have_to_be_respectful_communicate_and_take_action_to_be_a_role_model_in_m',
    Post_2__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.i_have_skills_that_help_me_bounce_back_from_difficult_situations',
    Post_3__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.i_can_identify_my_strengths_or_things_that_i_am_good_at',
    Post_4__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.when_i_am_angry_i_know_how_to_avoid_using_violent_behaviour',
    Post_5__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.when_i_express_my_feelings_clearly_people_understand_me_better',
    Post_6__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.i_know_what_changes_to_expect_in_my_body_during_puberty',
    Post_7__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.sadness_and_a_loss_of_pleasure_in_things_you_enjoy_are_common_symptoms_of_d',
    Post_8__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.i_know_where_to_access_health_services_and_mental_health_services',
    Post_9__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.i_will_share_accurate_information_about_mental_health_services_to_avoid_sti',
    Post_10__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.society_expects_boys_and_girls_to_deal_with_their_emotions_differently',
    Post_11__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.men_should_share_the_work_around_the_house_such_as_cleaning_and_taking_care',
    Post_12__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.its_okay_for_a_guy_to_beat_a_girl_when_there_is_a_misunderstanding',
    Post_13__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.i_should_respect_the_rights_of_others_such_as_their_right_to_their_own_opin',
    Post_14__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.i_feel_confident_setting_my_goals',
    Post_15__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.stress_is_a_normal_part_of_life',
    Post_16__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.deep_breathing_is_a_healthy_way_to_deal_with_difficult_and_stressful_situat',
    Post_17__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.there_are_people_i_trust_with_whom_i_can_talk_to_about_my_mental_health',
    Post_18__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.i_have_no_fear_or_shame_when_accessing_health_services_or_mental_health_ser',
    Post_19__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.having_more_than_one_sexual_partner_over_the_same_time_period_increases_my_',
    Post_20__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.it_is_the_males_responsibility_to_make_decisions_in_a_relationship',
    Post_21__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.i_can_stand_up_to_peer_pressure_when_i_have_to',
    Post_22__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.i_should_use_a_condom_even_if_my_girlfriend_is_on_another_form_of_birth_con',
    Post_23__c: 'form.post_challenge_skillz_guyz_mh_-_sa_100.i_know_where_to_go_for_support_if_i_or_someone_i_know_abuses_alcohol',
    },
    'post_challenge_mindskillz-_zambia_100': {
    Post_1__c:'form.post_challenge_mindskillz-_zambia_100.when_i_express_my_feelings_clearly_people_understand_me_better',
    Post_2__c:'form.post_challenge_mindskillz-_zambia_100.i_have_skills_that_help_me_bounce_back_from_difficult_situations',
    Post_3__c:'form.post_challenge_mindskillz-_zambia_100.stress_is_a_normal_part_of_life',
    Post_4__c:'form.post_challenge_mindskillz-_zambia_100.i_can_reach_my_goals_in_life',
    Post_5__c:'form.post_challenge_mindskillz-_zambia_100.if_i_have_a_problem_i_have_someone_in_my_life_i_can_go_to_for_support',
    Post_6__c:'form.post_challenge_mindskillz-_zambia_100.i_can_identify_my_strengths_or_things_that_i_am_good_at_in_life',
    Post_7__c:'form.post_challenge_mindskillz-_zambia_100.self_control_helps_you_make_smart_decisions_when_you_are_angry_or_upset',
    Post_8__c:'form.post_challenge_mindskillz-_zambia_100.society_expects_boys_and_girls_to_deal_with_their_emotions_differently',
    Post_9__c:'form.post_challenge_mindskillz-_zambia_100.i_know_how_to_express_my_anger_without_being_violent',
    Post_10__c:'form.post_challenge_mindskillz-_zambia_100.listening_carefully_to_others_is_an_important_communication_skill',
    Post_11__c:'form.post_challenge_mindskillz-_zambia_100.drinking_too_much_alcohol_can_have_serious_negative_consequences_for_mental',
    Post_12__c:'form.post_challenge_mindskillz-_zambia_100.i_can_understand_how_others_are_feeling_and_be_sensitive_to_their_emotions',
    Post_13__c:'form.post_challenge_mindskillz-_zambia_100.i_am_confident_that_i_know_where_to_seek_information_about_mental_illness',
    Post_14__c:'form.post_challenge_mindskillz-_zambia_100.i_am_confident_using_the_computer_or_telephone_to_seek_information_about_me',
    Post_15__c:'form.post_challenge_mindskillz-_zambia_100.i_am_confident_attending_face_to_face_appointments_to_seek_information_abou',
    Post_16__c:'form.post_challenge_mindskillz-_zambia_100.i_am_confident_i_have_access_to_resources_eg_doctor_internet_friends_that_i',
    Post_17__c:'form.post_challenge_mindskillz-_zambia_100.people_with_mental_illness_could_snap_out_of_it_if_they_wanted',
    Post_18__c:'form.post_challenge_mindskillz-_zambia_100.a_mental_illness_is_a_sign_of_personal_weakness',
    Post_19__c:'form.post_challenge_mindskillz-_zambia_100.a_mental_illness_is_not_a_real_medical_illness',
    Post_20__c:'form.post_challenge_mindskillz-_zambia_100.people_with_mental_illness_are_dangerous',
    Post_21__c:'form.post_challenge_mindskillz-_zambia_100.it_is_best_to_avoid_people_with_mental_illness_so_that_you_dont_develop_thi',
    Post_22__c:'form.post_challenge_mindskillz-_zambia_100.if_i_had_a_mental_illness_i_would_not_tell_anyone',
    Post_23__c:'form.post_challenge_mindskillz-_zambia_100.seeing_a_mental_health_professional_means_you_are_not_strong_enough_to_mana',
    Post_24__c:'form.post_challenge_mindskillz-_zambia_100.if_i_had_mental_illness_i_would_not_seek_help_from_a_mental_health_professi',
    Post_25__c:'form.post_challenge_mindskillz-_zambia_100.i_believe_treatment_for_a_mental_illness_provided_by_a_mental_health_profes',
    },

    'post_challenge_skillz_girl_nih200': {
    Post_1__c:'form.post_challenge_skillz_girl_nih200.i_have_talked_about_hiv_with_an_adult_in_the_past_two_months_outside_skillz',
    Post_2__c:'form.post_challenge_skillz_girl_nih200.i_have_talked_about_hiv_with_a_friend_in_the_past_two_months_outside_skillz',
    Post_3__c:'form.post_challenge_skillz_girl_nih200.having_sex_with_an_older_partner_increases_my_risk_of_getting_hiv',
    Post_4__c:'form.post_challenge_skillz_girl_nih200.i_know_where_to_get_contraception_to_prevent_unwanted_pregnancy',
    Post_5__c:'form.post_challenge_skillz_girl_nih200.i_know_someone_in_my_community_who_distributes_contraceptives_and_other_sex',
    Post_6__c:'form.post_challenge_skillz_girl_nih200.having_more_than_one_sexual_partner_increases_my_risk_of_getting_hiv',
    Post_7__c:'form.post_challenge_skillz_girl_nih200.i_have_the_right_to_say_no_to_sex_no_matter_who_asks',
    Post_8__c:'form.post_challenge_skillz_girl_nih200.as_a_girl_i_have_a_greater_risk_of_getting_hiv_than_boys',
    Post_9__c:'form.post_challenge_skillz_girl_nih200.i_know_where_to_get_support_services_for_rape',
    Post_10__c:'form.post_challenge_skillz_girl_nih200.if_a_girl_is_sexually_abused_she_can_reduce_her_risk_of_getting_hiv_by_taki',
    Post_11__c:'form.post_challenge_skillz_girl_nih200.i_feel_good_about_being_a_girl',
    Post_12__c:'form.post_challenge_skillz_girl_nih200.it_is_the_mans_responsibility_to_make_decisions_in_a_relationship',
    Post_13__c:'form.post_challenge_skillz_girl_nih200.boys_should_share_the_work_around_the_home_such_as_household_chores',
    Post_14__c:'form.post_challenge_skillz_girl_nih200.i_know_what_i_want_to_be_after_finishing_secondary_school',
    Post_15__c:'form.post_challenge_skillz_girl_nih200.if_i_have_a_problem_i_have_someone_in_my_life_i_can_talk_to_for_advise',
    Post_16__c:'form.post_challenge_skillz_girl_nih200.a_boyfriend_may_have_good_reason_to_hit_his_girlfriend',
    Post_17__c:'form.post_challenge_skillz_girl_nih200.i_would_tell_someone_if_i_were_touched_in_a_manner_that_made_me_uncomfortab',
    Post_18__c:'form.post_challenge_skillz_girl_nih200.i_can_reach_my_goals_in_life',
    Post_19__c:'form.post_challenge_skillz_girl_nih200.a_girl_should_wait_to_get_married_until_after_college',
    Post_20__c:'form.post_challenge_skillz_girl_nih200.biological_and_social_factors_contribute_to_females_and_males_experiencing_',
    Post_21__c:'form.post_challenge_skillz_girl_nih200.the_most_common_illness_of_mental_health_are_depression_and_anxiety',
    Post_22__c:'form.post_challenge_skillz_girl_nih200.mental_health_problems_have_nothing_to_do_with_being_lazy_or_weak_and_many_',
    Post_23__c:'form.post_challenge_skillz_girl_nih200.i_am_ready_to_take_an_hiv_test',
    Post_24__c:'form.post_challenge_skillz_girl_nih200.are_you_or_your_boyfriendgirlfriend_currently_using_any_contraceptive_or_pr',
    },

    'post_challenge_mindskillz_pamumvuri':{
    Post_1__c: 'form.post_challenge_mindskillz_pamumvuri.when_i_express_my_feelings_clearly_people_understand_me_better',
    Post_2__c: 'form.post_challenge_mindskillz_pamumvuri.have_skills_that_help_me_bounce_back_from_difficult_situations',
    Post_3__c: 'form.post_challenge_mindskillz_pamumvuri.stress_is_a_normal_part_of_life',
    Post_4__c: 'form.post_challenge_mindskillz_pamumvuri.i_can_reach_my_goals_in_life',
    Post_5__c: 'form.post_challenge_mindskillz_pamumvuri.if_i_have_a_problem_i_have_someone_in_my_life_i_can_go_to_for_support',
    Post_6__c: 'form.post_challenge_mindskillz_pamumvuri.i_can_identify_my_strengths_or_things_that_i_am_good_at_in_life',
    Post_7__c: 'form.post_challenge_mindskillz_pamumvuri.self_control_helps_you_make_smart_decisions_when_you_are_angry_or_upset',
    Post_8__c: 'form.post_challenge_mindskillz_pamumvuri.society_expects_boys_and_girls_to_deal_with_their_emotions_differently',
    Post_9__c: 'form.post_challenge_mindskillz_pamumvuri.i_know_how_to_express_my_anger_without_being_violent',
    Post_10__c: 'form.post_challenge_mindskillz_pamumvuri.listening_carefully_to_others_is_an_important_communication_skill',
    Post_11__c: 'form.post_challenge_mindskillz_pamumvuri.drinking_too_much_alcohol_can_have_serious_negative_consequences_for_mental',
    Post_12__c: 'form.post_challenge_mindskillz_pamumvuri.i_can_understand_how_others_are_feeling_and_be_sensitive_to_their_emotions',
    Post_13__c: 'form.post_challenge_mindskillz_pamumvuri.i_am_confident_that_i_know_where_to_seek_information_about_mental_illness',
    Post_14__c: 'form.post_challenge_mindskillz_pamumvuri.i_am_confident_using_the_computer_or_telephone_to_seek_information_about_me',
    Post_15__c: 'form.post_challenge_mindskillz_pamumvuri.i_am_confident_attending_face_to_face_appointments_to_seek_information_abou',
    Post_16__c: 'form.post_challenge_mindskillz_pamumvuri.i_am_confident_i_have_access_to_resources_eg_doctor_internet_friends_that_i',
    Post_17__c: 'form.post_challenge_mindskillz_pamumvuri.people_with_mental_illness_could_snap_out_of_it_if_they_wanted',
    Post_18__c: 'form.post_challenge_mindskillz_pamumvuri.a_mental_illness_is_a_sign_of_personal_weakness',
    Post_19__c: 'form.post_challenge_mindskillz_pamumvuri.a_mental_illness_is_not_a_real_medical_illness',
    Post_20__c: 'form.post_challenge_mindskillz_pamumvuri.people_with_mental_illness_are_dangerous',
    Post_21__c: 'form.post_challenge_mindskillz_pamumvuri.it_is_best_to_avoid_people_with_mental_illness_so_that_you_dont_develop_thi',
    Post_22__c: 'form.post_challenge_mindskillz_pamumvuri.if_i_had_a_mental_illness_i_would_not_tell_anyone',
    Post_23__c: 'form.post_challenge_mindskillz_pamumvuri.seeing_a_mental_health_professional_means_you_are_not_strong_enough_to_mana',
    Post_24__c: 'form.post_challenge_mindskillz_pamumvuri.if_i_had_mental_illness_i_would_not_seek_help_from_a_mental_health_professi',
    Post_25__c: 'form.post_challenge_mindskillz_pamumvuri.i_believe_treatment_for_a_mental_illness_provided_by_a_mental_health_profes',

    },

    'post_challenge_south_africa_-_skillz_girl_mh_sa_211':{
    Post_1__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.i_know_my_rights_and_responsibilities',
    Post_2__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.i_can_identify_my_strengths_or_things_that_i_am_good_at_in_life',
    Post_3__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.i_know_where_to_get_contraception_to_prevent_unwanted_pregnancy',
    Post_4__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.stress_is_a_normal_part_of_life',
    Post_5__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.like_physical_health_we_all_have_mental_health',
    Post_6__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.it_is_the_males_responsibility_to_make_decisions_in_a_relationship',
    Post_7__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.healthy_relationships_are_based_on_healthy_communication_and_mutual_respect',
    Post_8__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.sometimes_a_man_may_have_a_good_reason_to_hit_his_girlfriend_partner_or_wif',
    Post_9__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.i_can_say_no_to_sex_even_if_my_partner_or_friends_pressure_me_to_have_sex',
    Post_10__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.having_more_than_one_sexual_partner_increases_my_risk_of_getting_hiv',
    Post_11__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.taking_prep_and_using_a_condom_can_lower_my_risk_of_getting_hiv',
    Post_12__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.i_know_where_to_go_for_support_if_i_or_someone_i_know_drinks_too_much_alcoh',
    Post_13__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.deep_breathing_is_a_healthy_way_to_deal_with_difficult_and_stressful_situat',
    Post_14__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.post_exposure_prophylaxis_pep_can_reduce_my_risk_of_getting_hiv_if_taken_1-',
    Post_15__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.it_is_my_right_to_access_health_services',
    Post_16__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.i_have_an_adult_or_someone_in_my_life_i_can_go_to_for_advice',
    Post_17__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.i_can_give_support_and_encouragement_to_a_friend_or_family_member_who_is_li',
    Post_18__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.using_a_condom_and_another_contraceptive_method_can_help_prevent_unwanted_p',
    Post_19__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.i_know_what_changes_to_expect_in_my_body_during_puberty',
    Post_20__c: 'form.post_challenge_south_africa_-_skillz_girl_mh_sa_211.drinking_too_much_alcohol_can_harm_the_body_and_the_mind',
    },

    'post_challenge_skillz_girl_abbreviated_south_africa':{
    Post_1__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.i_know_my_rights_and_responsibilities',
    Post_2__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.i_can_identify_my_strengths_or_things_that_i_am_good_at_in_life',
    Post_3__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.i_know_where_to_get_contraception_to_prevent_unwanted_pregnancy',
    Post_4__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.stress_is_a_normal_part_of_life',
    Post_5__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.like_physical_health_we_all_have_mental_health',
    Post_6__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.it_is_the_males_responsibility_to_make_decisions_in_a_relationship',
    Post_7__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.in_a_relationship_it_is_both_partners_responsibility_to_prevent_unwanted_pr',
    Post_8__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.healthy_relationships_are_based_on_healthy_communication_and_respect',
    Post_9__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.sometimes_a_man_may_have_a_good_reason_to_hit_his_girlfriend_partner_or_wif',
    Post_10__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.a_person_has_the_right_to_have_sex_with_their_partner_even_if_the_partner_d',
    Post_11__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.i_can_say_no_to_sex_even_if_my_partner_or_friends_pressure_me_to_have_sex',
    Post_12__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.having_more_than_one_sexual_partner_increases_my_risk_of_getting_hiv',
    Post_13__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.taking_prep_and_using_a_condom_can_lower_my_risk_of_getting_hiv',
    Post_14__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.i_know_where_to_go_for_support_if_i_or_someone_i_know_drinks_too_much_alcoh',
    Post_15__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.deep_breathing_is_a_healthy_way_to_deal_with_difficult_and_stressful_situat',
    Post_16__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.i_can_use_coping_skills_to_handle_stress',
    Post_17__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.post_exposure_prophylaxis_pep_can_reduce_my_risk_of_getting_hiv_if_taken_1-',
    Post_18__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.it_is_my_right_to_access_health_services',
    Post_19__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.i_have_an_adult_or_someone_in_my_life_i_can_go_to_for_advice',
    Post_20__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.using_a_condom_and_another_contraceptive_method_can_help_prevent_unwanted_p',
    Post_21__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.i_know_what_changes_to_expect_in_my_body_during_puberty',
    Post_22__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.drinking_too_much_alcohol_can_harm_the_body_and_mind',
    Post_23__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.i_know_at_least_two_ways_of_saving_money',
    Post_24__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.a_budget_is_the_estimated_income_and_expenses_for_a_certain_time_period',
    Post_25__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.accepting_money_for_sexual_favors_can_create_risks_to_my_health_and_safety',
    Post_26__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.using_assertive_communication_means_respectfully_sharing_my_thoughts_and_fe',
    Post_27__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.i_have_the_right_to_access_emergency_contraception',
    Post_28__c: 'form.post_challenge_skillz_girl_abbreviated_south_africa.if_a_girl_has_unprotected_sex_and_misses_her_period_this_could_mean_she_is_',
    },

    'post_challenge_skillz_guyz_-_yedi__323':{
    Post_1__c: 'form.post_challenge_skillz_guyz_-_yedi__323.i_know_how_to_stand_up_to_peer_pressure_ie_to_drink_alcohol_or_have_sex_fro',
    Post_2__c: 'form.post_challenge_skillz_guyz_-_yedi__323.it_is_better_to_express_yourself_with_anger_when_upset_than_to_use_self-con',
    Post_3__c: 'form.post_challenge_skillz_guyz_-_yedi__323.i_have_someone_i_can_go_to_for_advice',
    Post_4__c: 'form.post_challenge_skillz_guyz_-_yedi__323.no_one_has_the_right_to_touch_me_in_a_way_that_makes_me_uncomfortable_such_',
    Post_5__c: 'form.post_challenge_skillz_guyz_-_yedi__323.i_know_where_to_go_for_support_if_i_or_someone_i_know_drinks_too_much_alcoh',
    Post_6__c: 'form.post_challenge_skillz_guyz_-_yedi__323.people_who_abuse_alcohol_are_more_likely_to_engage_in_risky_behaviours_such',
    Post_7__c: 'form.post_challenge_skillz_guyz_-_yedi__323.it_is_the_males_responsibility_to_make_decisions_in_a_relationship',
    Post_8__c: 'form.post_challenge_skillz_guyz_-_yedi__323.a_mental_illness_is_a_sign_of_personal_weakness',
    Post_9__c: 'form.post_challenge_skillz_guyz_-_yedi__323.young_people_should_avoid_people_with_mental_illness_as_they_are_always_vio',
    Post_10__c: 'form.post_challenge_skillz_guyz_-_yedi__323.i_can_make_my_own_informed_decisions_about_my_sexual_healthcare',
    Post_11__c: 'form.post_challenge_skillz_guyz_-_yedi__323.a_boys_opinion_is_more_important_than_a_girls',
    Post_12__c: 'form.post_challenge_skillz_guyz_-_yedi__323.men_should_share_the_work_around_the_house_such_as_cleaning_and_taking_care',
    Post_13__c: 'form.post_challenge_skillz_guyz_-_yedi__323.its_okay_for_a_guy_to_beat_a_girl_when_she_misbehaves',
    Post_14__c: 'form.post_challenge_skillz_guyz_-_yedi__323.seeking_help_for_mental_health_challenges_is_a_sign_of_weakness',
    Post_15__c: 'form.post_challenge_skillz_guyz_-_yedi__323.it_is_only_the_girls_responsibility_to_avoid_getting_pregnant',
    Post_16__c: 'form.post_challenge_skillz_guyz_-_yedi__323.condoms_are_the_only_contraceptive_method_that_protect_against_pregnancy_as',
    Post_17__c: 'form.post_challenge_skillz_guyz_-_yedi__323.i_would_stand_up_to_my_friends_if_they_were_harming_others_such_as_touching',
    Post_18__c: 'form.post_challenge_skillz_guyz_-_yedi__323.having_more_than_one_sexual_partner_over_the_same_time_period_increases_my_',
    Post_19__c: 'form.post_challenge_skillz_guyz_-_yedi__323.a_man_has_the_right_to_have_sex_with_his_girlfriend_even_if_she_doesnt_want',
    Post_20__c: 'form.post_challenge_skillz_guyz_-_yedi__323.i_have_the_ability_to_shape_my_own_life',
    },

    'post_challenge_skillz_girl_mh_zambia':{
    Post_1__c: 'form.post_challenge_skillz_girl_mh_zambia.a_mental_illness_is_a_sign_of_personal_weakness',
    Post_2__c: 'form.post_challenge_skillz_girl_mh_zambia.it_is_better_to_express_yourself_with_anger_when_upset_than_to_use_self-con',
    Post_3__c: 'form.post_challenge_skillz_girl_mh_zambia.i_dont_always_have_to_do_what_people_expect_just_because_i_am_a_girl',
    Post_4__c: 'form.post_challenge_skillz_girl_mh_zambia.if_i_had_a_boyfriend_i_would_be_able_to_ask_him_to_use_a_condom_before_havi',
    Post_5__c: 'form.post_challenge_skillz_girl_mh_zambia.i_can_say_no_to_sex_even_if_my_boyfriend_or_friends_pressure_to_have_sex',
    Post_6__c: 'form.post_challenge_skillz_girl_mh_zambia.seeking_help_for_mental_health_challenges_is_a_sign_of_weakness',
    Post_7__c: 'form.post_challenge_skillz_girl_mh_zambia.i_can_make_my_own_informed_decisions_about_my_sexual_healthcare',
    Post_8__c: 'form.post_challenge_skillz_girl_mh_zambia.young_people_should_avoid_people_with_mental_illness_as_they_are_always_vio',
    Post_9__c: 'form.post_challenge_skillz_girl_mh_zambia.a_man_has_the_right_to_have_sex_with_his_girlfriend_even_if_she_doesnt_want',
    Post_10__c: 'form.post_challenge_skillz_girl_mh_zambia.sometimes_a_man_may_have_a_good_reason_to_hit_his_girlfriend_or_wife',
    Post_11__c: 'form.post_challenge_skillz_girl_mh_zambia.a_successful_marrige_is_more_important_to_girls_than_completing_school',
    Post_12__c: 'form.post_challenge_skillz_girl_mh_zambia.a_daughter_should_always_respect_her_parents_decision_to_get_married',
    Post_13__c: 'form.post_challenge_skillz_girl_mh_zambia.i_can_decide_when_is_the_right_time_for_me_to_have_a_baby',
    Post_14__c: 'form.post_challenge_skillz_girl_mh_zambia.i_have_someone_in_my_life_i_can_turn_to_when_i_need_advice_or_when_i_have_a',
    Post_15__c: 'form.post_challenge_skillz_girl_mh_zambia.i_know_where_to_get_support_services_for_me_or_someone_else_for_hiv-related',
    Post_16__c: 'form.post_challenge_skillz_girl_mh_zambia.i_know_where_to_get_support_services_for_me_or_someone_else_for_gender_base',
    Post_17__c: 'form.post_challenge_skillz_girl_mh_zambia.i_know_where_to_get_support_services_for_me_or_someone_else_for_prevention_',
    Post_18__c: 'form.post_challenge_skillz_girl_mh_zambia.if_sexually_active_one_sign_of_pregnance_is_a_girl_missing_her_period',
    Post_19__c: 'form.post_challenge_skillz_girl_mh_zambia.i_know_at_least_three_methods_to_avoid_an_unwanted_pregnancy',
    Post_20__c: 'form.post_challenge_skillz_girl_mh_zambia.are_you_or_your_boyfriend_currently_using_any_contraceptive_method',

    },

    'post_challenge_skillz_core_mh_zambia':{
    Post_1__c: 'form.post_challenge_skillz_core_mh_zambia.i_know_what_i_am_good_at',
    Post_2__c: 'form.post_challenge_skillz_core_mh_zambia.i_know_how_to_overcome_challenges_that_i_may_have_in_life',
    Post_3__c: 'form.post_challenge_skillz_core_mh_zambia.i_can_make_my_own_decisions_no_matter_how_much_pressure_i_get_from_others',
    Post_4__c: 'form.post_challenge_skillz_core_mh_zambia.it_is_the_mans_responsibility_to_make_decisions_in_a_relationship',
    Post_5__c: 'form.post_challenge_skillz_core_mh_zambia.i_dont_always_have_to_do_what_people_expect_just_because_i_am_a_girlboy',
    Post_6__c: 'form.post_challenge_skillz_core_mh_zambia.a_man_has_the_right_to_have_sex_with_his_wifegirlfriend_even_if_she_doesnt_',
    Post_7__c: 'form.post_challenge_skillz_core_mh_zambia.girls_should_not_disagree_with_boys',
    Post_8__c: 'form.post_challenge_skillz_core_mh_zambia.if_a_girl_gets_pregnant_she_should_drop_out_of_school',
    Post_9__c: 'form.post_challenge_skillz_core_mh_zambia.i_have_the_right_to_say_no_to_sex_no_matter_who_asks_me',
    Post_10__c: 'form.post_challenge_skillz_core_mh_zambia.i_have_an_older_person_in_my_life_i_can_go_to_for_advice',
    Post_11__c: 'form.post_challenge_skillz_core_mh_zambia.if_i_test_positive_for_hiv_there_will_be_someone_who_will_help_and_support_',
    Post_12__c: 'form.post_challenge_skillz_core_mh_zambia.people_with_mental_illness_live_on_the_streets_and_eat_dirty_food_from_garb',
    Post_13__c: 'form.post_challenge_skillz_core_mh_zambia.drinking_alcohol_can_increase_my_risk_of_getting_hiv',
    Post_14__c: 'form.post_challenge_skillz_core_mh_zambia.i_only_use_violent_behaviour_when_someone_angers_me',
    Post_15__c: 'form.post_challenge_skillz_core_mh_zambia.i_know_where_to_get_support_services_for_me_or_someone_else_for_abuse_or_hi',
    Post_16__c: 'form.post_challenge_skillz_core_mh_zambia.i_have_the_right_to_access_sexual_health_services_such_as_sti_and_hiv_testi',
    Post_17__c: 'form.post_challenge_skillz_core_mh_zambia.if_sexually_active_one_sign_of_pregnancy_can_be_a_girl_missing_her_period',
    Post_18__c: 'form.post_challenge_skillz_core_mh_zambia.i_would_say_no_to_playing_sport_with_someone_who_has_hiv',
    Post_19__c: 'form.post_challenge_skillz_core_mh_zambia.i_can_tell_whether_someone_has_hiv_by_looking_at_him_or_her',
    Post_20__c: 'form.post_challenge_skillz_core_mh_zambia.i_know_what_decisions_to_make_to_achieve_my_goals',
    },

    'post_challenge_skillz_guyz_mh_zambia':{
    Post_1__c: 'form.post_challenge_skillz_guyz_mh_zambia.a_mental_illness_is_a_sign_of_personal_weakness',
    Post_2__c: 'form.post_challenge_skillz_guyz_mh_zambia.i_would_be_able_to_tell_my_girlfriend_that_i_want_to_use_a_condom',
    Post_3__c: 'form.post_challenge_skillz_guyz_mh_zambia.i_dont_always_have_to_do_what_people_expect_just_because_i_am_a_boy',
    Post_4__c: 'form.post_challenge_skillz_guyz_mh_zambia.it_is_the_mans_responsibility_to_make_decisions_in_a_relationship',
    Post_5__c: 'form.post_challenge_skillz_guyz_mh_zambia.it_is_more_important_for_boys_to_be_educated_than_girls',
    Post_6__c: 'form.post_challenge_skillz_guyz_mh_zambia.men_are_better_leaders_than_women',
    Post_7__c: 'form.post_challenge_skillz_guyz_mh_zambia.a_manboy_has_the_right_to_have_sex_with_his_girlfriendwomanwife_even_if_she',
    Post_8__c: 'form.post_challenge_skillz_guyz_mh_zambia.it_is_better_to_express_yourself_with_anger_when_upset_than_to_use_self-con',
    Post_9__c: 'form.post_challenge_skillz_guyz_mh_zambia.it_is_okay_for_a_boyfriend_to_threaten_to_hit_his_girlfriend_if_he_never_hi',
    Post_10__c: 'form.post_challenge_skillz_guyz_mh_zambia.i_can_say_no_to_sex_even_if_my_friends_or_girlfriend_pressure_me_to_have_se',
    Post_11__c: 'form.post_challenge_skillz_guyz_mh_zambia.people_who_abuse_alcohol_are_more_likely_to_engage_in_risky_sexual_behaviou',
    Post_12__c: 'form.post_challenge_skillz_guyz_mh_zambia.i_know_where_to_go_for_support_if_i_or_someone_i_know_drinks_too_much_alcoh',
    Post_13__c: 'form.post_challenge_skillz_guyz_mh_zambia.i_have_a_friend_that_i_can_go_to_for_advice_when_i_have_a_problem',
    Post_14__c: 'form.post_challenge_skillz_guyz_mh_zambia.i_have_the_right_to_access_sexual_health_services_such_as_hiv_and_sti_testi',
    Post_15__c: 'form.post_challenge_skillz_guyz_mh_zambia.i_know_where_to_access_sexual_health_services_such_as_sti_and_hiv_testing',
    Post_16__c: 'form.post_challenge_skillz_guyz_mh_zambia.seeking_help_for_mental_health_challenges_is_a_sign_of_weakness',
    Post_17__c: 'form.post_challenge_skillz_guyz_mh_zambia.young_people_should_avoid_people_with_mental_illness_as_they_are_always_vio',
    Post_18__c: 'form.post_challenge_skillz_guyz_mh_zambia.male_circumcision_reduces_a_males_risk_of_getting_hiv',
    Post_19__c: 'form.post_challenge_skillz_guyz_mh_zambia.i_know_how_to_correctly_use_a_male_condom',
    Post_20__c: 'form.post_challenge_skillz_guyz_mh_zambia.are_you_or_your_girlfriend_currently_using_any_contraceptive_or_protective_',

    }

    };

    const pluckSfValue = val => {
    // if sfFieldMapping[formVersion][val] == undefined
    return sfFieldMapping[formVersion][val];
    };

    return { ...state, formVersion, pluckSfValue };
    });

    fn(state => {
    if (state.formVersion == 'post_challenge_ecap_-_post_-_season_survey_for_athletes') {
    return state;
    }
    const PID = lastReferenceValue('records[0].Participant_Identification_Number_PID__c')(state);

    if (!PID) {
    console.log(
    `Participant not found with Participant_Identification_Number_PID__c: ${state.data.form.case['@case_id']}`
    );
    return state;
    }

    return upsert(
    'Attendance__c',
    'CommCare_Ext_ID__c',
    fields(
    //field('Event__c', dataValue('form.hidden_properties.intervention_name')),

    // field('CommCare_Ext_ID__c', state => {
    // const value =
    // dataValue('form.case.@case_id')(state) +
    // '-' +
    // toUTF8(dataValue('form.hidden_properties.intervention_name')(state)).replace(/\//gi, '');
    // return scrubEmojis(value, '');
    // }),
    field("CommCare_Ext_ID__c", (state) => {
    return toUTF8(`${dataValue("form.case.@case_id")(state)}-${scrubEmojis(
    dataValue("form.hidden_properties.intervention_name")(state),
    ""
    ).replace(/\//gi, "")}`);
    }),

    //relationship('Event__r', 'CommCare_Ext_ID__c', dataValue('form.hidden_properties.intervention_name')),
    relationship('Person_Attendance__r', 'Participant_Identification_Number_PID__c', dataValue('form.case.@case_id')),
    field('Pre_Post_Completed__c', state => {
    var done = dataValue('form.hidden_properties.post_questionnaire_complete')(state);
    return done === 'Yes' ? true : done === 'No' ? false : undefined;
    }),
    field('Date_Post_Administered__c', dataValue('form.hidden_properties.date')),
    field('Post_1__c', state => {
    const value = dataValue(state.pluckSfValue('Post_1__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_2__c', state => {
    if (state.pluckSfValue('Post_2__c') == null) return undefined;
    const value = dataValue(state.pluckSfValue('Post_2__c'))(state);
    return state.helperFunctions.transform(value);
    }),

    field('Post_3__c', state => {
    const value = dataValue(state.pluckSfValue('Post_3__c'))(state);
    return state.helperFunctions.transform(value);
    }),

    field('Post_4__c', state => {
    const value = dataValue(state.pluckSfValue('Post_4__c'))(state);
    return state.helperFunctions.transform(value);
    }),

    field('Post_5__c', state => {
    const value = dataValue(state.pluckSfValue('Post_5__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_6__c', state => {
    const value = dataValue(state.pluckSfValue('Post_6__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_7__c', state => {
    const value = dataValue(state.pluckSfValue('Post_7__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_8__c', state => {
    const value = dataValue(state.pluckSfValue('Post_8__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_9__c', state => {
    const value = dataValue(state.pluckSfValue('Post_9__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_10__c', state => {
    if (state.pluckSfValue('Post_10__c') == null) return undefined;
    const value = dataValue(state.pluckSfValue('Post_10__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_11__c', state => {
    if (state.pluckSfValue('Post_11__c') == null) return undefined;
    const value = dataValue(state.pluckSfValue('Post_10__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_12__c', state => {
    if (state.pluckSfValue('Post_12__c') == null) return undefined;
    const value = dataValue(state.pluckSfValue('Post_12__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_13__c', state => {
    if (state.pluckSfValue('Post_13__c') == null) return undefined;
    const value = dataValue(state.pluckSfValue('Post_13__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_14__c', state => {
    if (state.pluckSfValue('Post_14__c') == null) return undefined;
    const value = dataValue(state.pluckSfValue('Post_14__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_15__c', state => {
    if (state.pluckSfValue('Post_15__c') == null) return undefined;
    const value = dataValue(state.pluckSfValue('Post_15__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_16__c', state => {
    if (state.pluckSfValue('Post_16__c') == null) return undefined;
    const value = dataValue(state.pluckSfValue('Post_16__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_17__c', state => {
    if (state.pluckSfValue('Post_17__c') == null) return undefined;
    const value = dataValue(state.pluckSfValue('Post_17__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_18__c', state => {
    if (state.pluckSfValue('Post_18__c') == null) return undefined;
    const value = dataValue(state.pluckSfValue('Post_18__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_19__c', state => {
    if (state.pluckSfValue('Post_19__c') == null) return undefined;
    const value = dataValue(state.pluckSfValue('Post_19__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_20__c', state => {
    if (state.pluckSfValue('Post_20__c') == null) return undefined;
    const value = dataValue(state.pluckSfValue('Post_20__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_21__c', state => {
    if (state.pluckSfValue('Post_21__c') == null) return undefined;
    const value = dataValue(state.pluckSfValue('Post_21__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_22__c', state => {
    if (state.pluckSfValue('Post_22__c') == null) return undefined;
    const value = dataValue(state.pluckSfValue('Post_22__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_23__c', state => {
    if (state.pluckSfValue('Post_23__c') == null) return undefined;
    const value = dataValue(state.pluckSfValue('Post_23__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_24__c', state => {
    if (state.pluckSfValue('Post_24__c') == null) return undefined;
    const value = dataValue(state.pluckSfValue('Post_24__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_25__c', state => {
    if (state.pluckSfValue('Post_25__c') == null) return undefined;
    const value = dataValue(state.pluckSfValue('Post_25__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_26__c', state => {
    if (state.pluckSfValue('Post_26__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Post_26__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_27__c', state => {
    if (state.pluckSfValue('Post_27__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Post_27__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Post_28__c', state => {
    if (state.pluckSfValue('Post_28__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Post_28__c'))(state);
    return state.helperFunctions.transform(value);
    })
    )
    )(state);
    });

    //Removing mapping... need case_id to upsert Events. Date_of_Post__c update should be handled on the SF side.
    /*upsert(
    'Event__c',
    'CommCare_Ext_ID__c',
    fields(
    field('CommCare_Ext_ID__c', dataValue('form.hidden_properties.intervention_name')),
    field('Date_of_Post__c', dataValue('form.date')),
    )
    );*/

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-Pre-Challenges-2021-04-30.html b/adaptors/library/jobs/auto/Upsert-Pre-Challenges-2021-04-30.html index 9e469f8d93a9..3d07c4f64cec 100644 --- a/adaptors/library/jobs/auto/Upsert-Pre-Challenges-2021-04-30.html +++ b/adaptors/library/jobs/auto/Upsert-Pre-Challenges-2021-04-30.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Upsert Pre Challenges

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields, lastReferenceValue, query, relationship, upsert

    Expression

    fn(state => {
    function transform(value) {
    if (!value) return;
    //console.log("value in switch", value.toString().trim().toLowerCase());
    switch (value.toString().trim().toLowerCase()) {
    case 'true':
    case 'yes':
    case 'agree':
    case 'verdade':
    case 'concorda':
    case 'concordo':
    case 'choice1':
    return 1;
    case 'false':
    case 'no':
    case 'disagree':
    case 'discorda':
    case 'discordo':
    case 'falso':
    case 'choice6':
    case 'choice3':
    return 2;
    case 'i_dont_know':
    case 'na':
    return 3;
    case 'unanswered':
    return 4;
    case 'not_applicable':
    return 5;
    default:
    return value;
    }
    }

    state.helperFunctions = { transform };

    return query(
    `SELECT Participant_Identification_Number_PID__c from Person__c where Participant_Identification_Number_PID__c = '${state.data.form.case['@case_id']}'`
    )(state);
    });

    fn(state => {
    const { form } = state.data;

    const formVersion = Object.keys(form).find(key => key.includes('pre_challenge'));

    console.log("form version", formVersion);

    const sfFieldMapping = {
    'pre_challenge_south_africa_-_skillz_girl': {
    Pre_1__c: 'form.pre_challenge_south_africa_-_skillz_girl.i_have_an_older_person_in_my_life_i_can_go_to_for_advice_i_have_an_older_pe',
    Pre_2__c: 'form.pre_challenge_south_africa_-_skillz_girl.i_know_how_to_make_a_plan_to_deal_with_the_challenges_i_may_face_in_reachin',
    Pre_3__c: 'form.pre_challenge_south_africa_-_skillz_girl.i_can_identify_my_strengths_or_things_that_i_am_good_at_in_life',
    Pre_4__c: 'form.pre_challenge_south_africa_-_skillz_girl.every_day_i_can_find_something_to_be_grateful_for',
    Pre_5__c: 'form.pre_challenge_south_africa_-_skillz_girl.having_more_than_one_sexual_partner_increases_my_risk_of_getting_hiv',
    Pre_6__c: 'form.pre_challenge_south_africa_-_skillz_girl.i_can_say_no_to_sex_even_if_my_partner_or_friends_pressure_me_to_have_sex',
    Pre_7__c: 'form.pre_challenge_south_africa_-_skillz_girl.girls_have_a_greater_risk_of_contracting_hiv_than_boys',
    Pre_8__c: 'form.pre_challenge_south_africa_-_skillz_girl.if_i_am_sexually_active_i_go_to_a_clinic_to_get_protection_from_hivstis_and',
    Pre_9__c: 'form.pre_challenge_south_africa_-_skillz_girl.like_physical_health_we_all_have_mental_health',
    Pre_10__c: 'form.pre_challenge_south_africa_-_skillz_girl.i_know_where_to_go_for_support_if_i_or_someone_i_know_drinks_too_much_alcoh',
    Pre_11__c: 'form.pre_challenge_south_africa_-_skillz_girl.it_is_the_males_responsibility_to_make_decisions_in_a_relationship',
    Pre_12__c: 'form.pre_challenge_south_africa_-_skillz_girl.if_a_girl_is_sexually_abused_she_can_reduce_her_risk_of_getting_hiv_by_goin',
    Pre_13__c: 'form.pre_challenge_south_africa_-_skillz_girl.sometimes_a_man_may_have_a_good_reason_to_hit_his_partner',
    Pre_14__c: 'form.pre_challenge_south_africa_-_skillz_girl.i_know_where_to_get_contraception_to_prevent_unwanted_pregnancy',
    Pre_15__c: 'form.pre_challenge_south_africa_-_skillz_girl.drinking_too_much_alcohol_can_have_serious_negative_consequences_for_mental',
    Pre_16__c: 'form.pre_challenge_south_africa_-_skillz_girl.if_sexually_active_i_or_my_partner_is_using_a_prevention_method_to_protect_',
    Pre_17__c: 'form.pre_challenge_south_africa_-_skillz_girl.i_know_where_to_go_to_receive_counselling_for_mental_health_challenges',
    Pre_18__c: 'form.pre_challenge_south_africa_-_skillz_girl.loss_of_interest_in_funenjoyable_activities_is_a_common_sign_of_depression',
    Pre_19__c: 'form.pre_challenge_south_africa_-_skillz_girl.i_know_at_least_three_methods_to_prevent_an_unwanted_pregnancy',
    },
    'portuguese_pre_challenge_gcr_-_skillz_malaria': {
    Pre_1__c: 'form.portuguese_pre_challenge_gcr_-_skillz_malaria.dormir_dentro_da_rede_mosquiteira_tratada_todas_as_noites_pode_proteger_me_',
    Pre_2__c: 'form.portuguese_pre_challenge_gcr_-_skillz_malaria.posso_esperar_uns_dias_antes_de_fazer_o_teste_de_malria_se_tiver_febres',
    Pre_3__c: 'form.portuguese_pre_challenge_gcr_-_skillz_malaria.um_mdico_tradicionalcurandeiro_pode_me_dar_um_tratamento_para_curar_a_malri',
    Pre_4__c: 'form.portuguese_pre_challenge_gcr_-_skillz_malaria.se_tiver_malria_e_no_for_tratado_posso_transmitir_a_malria_a_algum',
    Pre_5__c: 'form.portuguese_pre_challenge_gcr_-_skillz_malaria.somente_as_mulheres_grvidas_e_as_crianas_menores_de_5_anos__que_precisam_de',
    Pre_6__c: 'form.portuguese_pre_challenge_gcr_-_skillz_malaria.a_malria_pode_matar_se_no_fr_tratada',
    Pre_7__c: 'form.portuguese_pre_challenge_gcr_-_skillz_malaria.a_febre__um_sintoma_da_malria',
    Pre_8__c: 'form.portuguese_pre_challenge_gcr_-_skillz_malaria.eu_me_sinto_bem_conmigo_mesmo',
    Pre_9__c: 'form.portuguese_pre_challenge_gcr_-_skillz_malaria.tenho_algum_na_minha_vida_que_pode_me_dar_bons_conselhos_quando_preciso_de_',
    Pre_10__c: 'form.portuguese_pre_challenge_gcr_-_skillz_malaria.eu_sei_onde_posso_ter_tratamento_para_malria_na_minha_comunidade',
    Pre_11__c: 'form.portuguese_pre_challenge_gcr_-_skillz_malaria.posso_proteger-me_da_malria',
    },

    'portuguese_pre_challenge_gcr_-_skillz_girl': {
    Pre_1__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.falei_sobre_o_hiv_com_uma_pessoa_adulta_nos_ltimos_2_meses_fora_do_skillz',
    Pre_2__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.sei_como_expressar_a_minha_raiva_sem_ser_violento',
    Pre_3__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.sei_como_superar_os_desafios_que_possa_enfrentar_na_minha_vida',
    Pre_4__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.sei_quais_as_decises_a_tomar_para_alcanar_os_meus_objectivos',
    Pre_5__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.os_rapazes_correm_um_risco_mais_elevado_de_serem_vtimas_de_violncia_do_que_',
    Pre_6__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.conheco_que_mudanas_ocorrem_no_meu_corpo_durante_a_puberdade',
    Pre_7__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.conheo_pelo_menos_trs_mtodos_para_evitar_uma_gravidez_indesejada',
    Pre_8__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.os_preservativos_so_o_nico_mtodo_contraceptivo_que_protege_contra_a_gravide',
    Pre_9__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.conheco_onde_obter_servios_de_apoio_para_mim_ou_outra_pessoa_para_casos_de_',
    Pre_10__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.se_uma_rapariga_inicia_seu_perodo_menstrual_significa_que_est_pronta_para_c',
    Pre_11__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.caso_eu_seja_abusada_sexualmente_prefiro_guard-lo_para_mim_para_evitar_que_',
    Pre_12__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.um_homem_tem_o_direito_de_ter_sexo_com_a_sua_namorada_mesmo_que_ela_no_o_qu',
    Pre_13__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.pessoas_com_problemas_de_sade_mental_so_apenas_confusas_ou_loucas',
    Pre_14__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.pessoas_com_problemas_de_sade_mental_so_apenas_confusas_ou_loucas',
    Pre_15__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.informaria_a_algum_caso_fosse_tocada_por_alguem_de_uma_forma_que_me_deixass',
    Pre_16__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.uma_filha_deve_sempre_respeitar_a_deciso_dos_seus_pais_para_se_casar',
    Pre_17__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.um_casamento_bem_sucedido__mais_importante_para_as_raparigas_do_que_termina',
    Pre_18__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.eu_no_praticaria_desporto_com_algum_que_tem_hiv',
    Pre_19__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.um_namorado_pode_ter_boas_razes_para_bater_na_sua_namorada',
    Pre_20__c: 'form.portuguese_pre_challenge_gcr_-_skillz_girl.no_faz_mal_que_um_rapaz_ameace_bater_na_sua_namorada_se_nunca_a_bater_fisic',
    },
    'pre_challenge_zambia_-_plus_mh_enhanced_zambia': {
    Pre_1__c: 'form.pre_challenge_zambia_-_plus_mh_enhanced_zambia.in_general_i_feel_good_about_myself',
    Pre_2__c: 'form.pre_challenge_zambia_-_plus_mh_enhanced_zambia.i_have_the_skills_and_knowledge_to_avoid_getting_infected_with_another_kind',
    Pre_3__c: 'form.pre_challenge_zambia_-_plus_mh_enhanced_zambia.it_is_important_to_know_why_and_how_i_want_to_tell_someone_my_hiv_status',
    Pre_4__c: 'form.pre_challenge_zambia_-_plus_mh_enhanced_zambia.i_accept_myself_and_my_hiv_status',
    Pre_5__c: 'form.pre_challenge_zambia_-_plus_mh_enhanced_zambia.i_can_make_my_own_informed_decisions_about_my_sexual_healthcare',
    Pre_6__c: 'form.pre_challenge_zambia_-_plus_mh_enhanced_zambia.are_you_or_have_you_been_past_12_months_in_a_sexual_relationship_na_if_not_',
    Pre_7__c: 'form.pre_challenge_zambia_-_plus_mh_enhanced_zambia.are_you_or_your_boyfriendgirlfriend_currently_using_any_contraceptive_or_pr',
    Pre_8__c: 'form.pre_challenge_zambia_-_plus_mh_enhanced_zambia.i_have_an_older_person_in_my_life_i_can_go_to_for_advice',
    Pre_9__c: 'form.pre_challenge_zambia_-_plus_mh_enhanced_zambia.there_are_people_i_trust_with_whom_i_can_talk_about_my_status',
    Pre_10__c: 'form.pre_challenge_zambia_-_plus_mh_enhanced_zambia.it_is_okay_for_two_people_with_hiv_to_have_unprotected_sex_with_each_other',
    Pre_11__c: 'form.pre_challenge_zambia_-_plus_mh_enhanced_zambia.it_is_okay_for_someone_with_hiv_to_stop_taking_their_arv_as_soon_as_they_st',
    Pre_12__c: 'form.pre_challenge_zambia_-_plus_mh_enhanced_zambia.when_i_have_a_choice_it_is_important_to_eat_a_variety_of_foods_including_gr',
    Pre_13__c: 'form.pre_challenge_zambia_-_plus_mh_enhanced_zambia.mental_health_problems_have_nothing_to_do_with_being_lazy_or_weak_and_many_',
    Pre_14__c: 'form.pre_challenge_zambia_-_plus_mh_enhanced_zambia.art_adherence_is_an_important_part_of_my_overall_health_and_well-being',
    Pre_15__c: 'form.pre_challenge_zambia_-_plus_mh_enhanced_zambia.the_most_common_illnesses_of_mental_health_are_depression_and_anxiety',
    Pre_16__c: 'form.pre_challenge_zambia_-_plus_mh_enhanced_zambia.biological_and_social_factors_contribute_to_females_and_males_experiencing_',
    },
    'pre_challenge_nigeria_-_advanced_skills':{
    Pre_1__c: 'form.pre_challenge_nigeria_-_advanced_skills.i_have_talked_about_hiv_with_an_adult_in_the_past_two_months_outside_skillz',
    Pre_2__c: 'form.pre_challenge_nigeria_-_advanced_skills.i_have_talked_about_malaria_with_an_adult_in_the_past_two_months_outside_sk',
    Pre_3__c: 'form.pre_challenge_nigeria_-_advanced_skills.unequal_power_in_relationships_can_contribute_to_the_spread_of_hiv',
    Pre_4__c: 'form.pre_challenge_nigeria_-_advanced_skills.the_most_effective_way_to_avoid_getting_hiv_is_to_abstain_from_sex',
    Pre_5__c: 'form.pre_challenge_nigeria_-_advanced_skills.malaria_is_spread_by_standing_under_the_hot_sun',
    Pre_6__c: 'form.pre_challenge_nigeria_-_advanced_skills.drinking_alcohol_can_increase_my_risk_of_getting_hiv',
    Pre_7__c: 'form.pre_challenge_nigeria_-_advanced_skills.sleeping_under_a_mosquito_net_every_night_can_help_protect_me_from_malaria',
    Pre_8__c: 'form.pre_challenge_nigeria_-_advanced_skills.having_more_than_one_sexual_partner_over_the_same_time_period_increases_my_',
    Pre_9__c: 'form.pre_challenge_nigeria_-_advanced_skills.it_is_okay_for_someone_with_malaria_to_stop_taking_their_medication_as_soon',
    Pre_10__c: 'form.pre_challenge_nigeria_-_advanced_skills.i_can_abstain_from_sex_until_i_am_older_even_if_it_is_difficult',
    Pre_11__c: 'form.pre_challenge_nigeria_-_advanced_skills.i_would_say_no_to_playing_sport_with_someone_who_has_hiv',
    Pre_12__c: 'form.pre_challenge_nigeria_-_advanced_skills.men_should_share_the_work_around_the_house_such_as_cleaning',
    Pre_13__c: 'form.pre_challenge_nigeria_-_advanced_skills.it_is_the_males_responsibilty_to_make_decisions_in_a_relationship',
    Pre_14__c: 'form.pre_challenge_nigeria_-_advanced_skills.i_can_use_drugs_and_still_easily_reach_my_goals_in_life',
    Pre_15__c: 'form.pre_challenge_nigeria_-_advanced_skills.when_sick_it_is_better_to_visit_the_herb_seller_than_to_visit_a_doctor_or_a',
    Pre_16__c: 'form.pre_challenge_nigeria_-_advanced_skills.it_is_okay_to_use_violence_with_my_partner_if_he_or_she_makes_me_angry',
    Pre_17__c: 'form.pre_challenge_nigeria_-_advanced_skills.i_have_the_power_to_change_gender_expectations_that_i_do_not_agree_with',
    },
    'pre_challenge_zimbabwe_-_skillz_core_zimbabwe': {
    Pre_1__c: 'form.pre_challenge_zimbabwe_-_skillz_core_zimbabwe.copy-1-of-i_know_what_decisions_to_make_to_achieve_my_goals',
    Pre_2__c: 'form.pre_challenge_zimbabwe_-_skillz_core_zimbabwe.copy-1-of-i_dont_always_have_to_do_what_people_expect_just_because_i_am_a_girlboy',
    Pre_3__c: 'form.pre_challenge_zimbabwe_-_skillz_core_zimbabwe.i_know_what_i_am_good_at',
    Pre_4__c: 'form.pre_challenge_zimbabwe_-_skillz_core_zimbabwe.i_can_make_my_own_decisions_no_matter_how_much_pressure_i_get_from_others',
    Pre_5__c: 'form.pre_challenge_zimbabwe_-_skillz_core_zimbabwe.copy-1-of-i_have_the_right_to_say_no_to_sex_no_matter_who_asks_me',
    Pre_6__c: 'form.pre_challenge_zimbabwe_-_skillz_core_zimbabwe.i_can_make_my_own_informed_decisions_about_my_sexual_healthcare',
    Pre_7__c: 'form.pre_challenge_zimbabwe_-_skillz_core_zimbabwe.copy-1-of-i_have_the_right_to_access_sexual_health_services_such_as_sti_and_hiv_testi',
    Pre_8__c: 'form.pre_challenge_zimbabwe_-_skillz_core_zimbabwe.it_is_the_mans_responsibility_to_make_decisions_in_a_relationship',
    Pre_9__c: 'form.pre_challenge_zimbabwe_-_skillz_core_zimbabwe.a_man_has_the_right_to_have_sex_with_his_girlfriend_even_if_she_doesnt_want',
    Pre_10__c: 'form.pre_challenge_zimbabwe_-_skillz_core_zimbabwe.girls_should_be_obedient_and_should_not_disagree_with_boys',
    Pre_11__c: 'form.pre_challenge_zimbabwe_-_skillz_core_zimbabwe.if_a_girl_gets_pregnant_she_should_drop_out_of_school',
    Pre_12__c: 'form.pre_challenge_zimbabwe_-_skillz_core_zimbabwe.my_skillz_coach_helps_me_to_be_a_better_person',
    Pre_13__c: 'form.pre_challenge_zimbabwe_-_skillz_core_zimbabwe.i_have_someone_in_my_life_i_can_turn_to_when_i_need_advice_or_when_i_have_a',
    Pre_14__c: 'form.pre_challenge_zimbabwe_-_skillz_core_zimbabwe.if_i_test_positive_for_hiv_there_will_be_someone_who_will_help_and_support_',
    Pre_15__c: 'form.pre_challenge_zimbabwe_-_skillz_core_zimbabwe.i_know_who_to_go_to_if_i_amsomeone_i_know_is_abused_sexually_physically_and',
    Pre_16__c: 'form.pre_challenge_zimbabwe_-_skillz_core_zimbabwe.i_know_who_to_go_to_if_someone_touches_me_in_a_way_that_makes_me_uncomforta',
    Pre_17__c: 'form.pre_challenge_zimbabwe_-_skillz_core_zimbabwe.i_know_where_to_get_support_services_for_me_or_someone_else_for_hiv-related',
    Pre_18__c: 'form.pre_challenge_zimbabwe_-_skillz_core_zimbabwe.i_would_say_no_to_playing_sport_with_someone_who_has_hiv',
    Pre_19__c: 'form.pre_challenge_zimbabwe_-_skillz_core_zimbabwe.i_can_tell_whether_someone_has_hiv_by_looking_at_him_or_her',
    },
    'pre_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe': {
    Pre_1__c: 'form.pre_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe.copy-1-of-i_know_what_decisions_to_make_to_achieve_my_goals',
    Pre_2__c: 'form.pre_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe.i_dont_always_have_to_do_what_people_expect_just_because_i_am_girlboy',
    Pre_3__c: 'form.pre_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe.copy-1-of-i_have_the_right_to_say_no_to_sex_no_matter_who_asks_me',
    Pre_4__c: 'form.pre_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe.i_can_make_my_own_informed_decisions_about_my_sexual_health',
    Pre_5__c: 'form.pre_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe.it_is_the_mans_responsibility_to_make_decisions_in_a_relationship',
    Pre_6__c: 'form.pre_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe.a_man_has_the_right_to_have_sex_with_his_girlfriend_even_if_she_doesnt_want',
    Pre_7__c: 'form.pre_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe.my_skillz_coach_helps_me_to_be_a_better_person',
    Pre_8__c: 'form.pre_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe.i_have_someone_in_my_life_i_can_turn_to_when_i_need_advise_or_when_i_have_a',
    Pre_9__c: 'form.pre_challenge_zimbabwe_-_virtual_skillz_core_zimbabwe.copy-1-of-i_know_where_to_get_support_services_for_me_or_someone_else_for_hiv-related',
    },
    'pre_challenge_mindskillz-_zambia_100': {
    Pre_1__c:'form.pre_challenge_mindskillz-_zambia_100.when_i_express_my_feelings_clearly_people_understand_me_better',
    Pre_2__c:'form.pre_challenge_mindskillz-_zambia_100.i_have_skills_that_help_me_bounce_back_from_difficult_situations',
    Pre_3__c:'form.pre_challenge_mindskillz-_zambia_100.stress_is_a_normal_part_of_life',
    Pre_4__c:'form.pre_challenge_mindskillz-_zambia_100.i_can_reach_my_goals_in_life',
    Pre_5__c:'form.pre_challenge_mindskillz-_zambia_100.if_i_have_a_problem_i_have_someone_in_my_life_i_can_go_to_for_support',
    Pre_6__c:'form.pre_challenge_mindskillz-_zambia_100.i_can_identify_my_strengths_or_things_that_i_am_good_at_in_life',
    Pre_7__c:'form.pre_challenge_mindskillz-_zambia_100.self_control_helps_you_make_smart_decisions_when_you_are_angry_or_upset',
    Pre_8__c:'form.pre_challenge_mindskillz-_zambia_100.society_expects_boys_and_girls_to_deal_with_their_emotions_differently',
    Pre_9__c:'form.pre_challenge_mindskillz-_zambia_100.i_know_how_to_express_my_anger_without_being_violent',
    Pre_10__c:'form.pre_challenge_mindskillz-_zambia_100.listening_carefully_to_others_is_an_important_communication_skill',
    Pre_11__c:'form.pre_challenge_mindskillz-_zambia_100.drinking_too_much_alcohol_can_have_serious_negative_consequences_for_mental',
    Pre_12__c:'form.pre_challenge_mindskillz-_zambia_100.i_can_understand_how_others_are_feeling_and_be_sensitive_to_their_emotions',
    Pre_13__c:'form.pre_challenge_mindskillz-_zambia_100.i_am_confident_that_i_know_where_to_seek_information_about_mental_illness',
    Pre_14__c:'form.pre_challenge_mindskillz-_zambia_100.i_am_confident_using_the_computer_or_telephone_to_seek_information_about_me',
    Pre_15__c:'form.pre_challenge_mindskillz-_zambia_100.i_am_confident_attending_face_to_face_appointments_to_seek_information_abou',
    Pre_16__c:'form.pre_challenge_mindskillz-_zambia_100.i_am_confident_i_have_access_to_resources_eg_doctor_internet_friends_that_i',
    Pre_17__c:'form.pre_challenge_mindskillz-_zambia_100.people_with_mental_illness_could_snap_out_of_it_if_they_wanted',
    Pre_18__c:'form.pre_challenge_mindskillz-_zambia_100.a_mental_illness_is_a_sign_of_personal_weakness',
    Pre_19__c:'form.pre_challenge_mindskillz-_zambia_100.a_mental_illness_is_not_a_real_medical_illness',
    Pre_20__c:'form.pre_challenge_mindskillz-_zambia_100.people_with_mental_illness_are_dangerous',
    Pre_21__c:'form.pre_challenge_mindskillz-_zambia_100.it_is_best_to_avoid_people_with_mental_illness_so_that_you_dont_develop_thi',
    Pre_22__c:'form.pre_challenge_mindskillz-_zambia_100.if_i_had_a_mental_illness_i_would_not_tell_anyone',
    Pre_23__c:'form.pre_challenge_mindskillz-_zambia_100.seeing_a_mental_health_professional_means_you_are_not_strong_enough_to_mana',
    Pre_24__c:'form.pre_challenge_mindskillz-_zambia_100.if_i_had_mental_illness_i_would_not_seek_help_from_a_mental_health_professi',
    Pre_25__c:'form.pre_challenge_mindskillz-_zambia_100.i_believe_treatment_for_a_mental_illness_provided_by_a_mental_health_profes',
    },
    'pre_challenge_skillz_girl_nih200':{
    Pre_1__c:'form.pre_challenge_skillz_girl_nih200.i_have_talked_about_hiv_with_an_adult_in_the_past_two_months_outside_skillz',
    Pre_2__c:'form.pre_challenge_skillz_girl_nih200.i_have_talked_about_hiv_with_a_friend_in_the_past_two_months_outside_skillz',
    Pre_3__c:'form.pre_challenge_skillz_girl_nih200.having_sex_with_an_older_partner_increases_my_risk_of_getting_hiv',
    Pre_4__c:'form.pre_challenge_skillz_girl_nih200.i_know_where_to_get_contraception_to_prevent_unwanted_pregnancy',
    Pre_5__c:'form.pre_challenge_skillz_girl_nih200.i_know_someone_in_my_community_who_distributes_contraceptives_and_other_sex',
    Pre_6__c:'form.pre_challenge_skillz_girl_nih200.having_more_than_one_sexual_partner_increases_my_risk_of_getting_hiv',
    Pre_7__c:'form.pre_challenge_skillz_girl_nih200.i_have_the_right_to_say_no_to_sex_no_matter_who_asks',
    Pre_8__c:'form.pre_challenge_skillz_girl_nih200.as_a_girl_i_have_a_greater_risk_of_getting_hiv_than_boys',
    Pre_9__c:'form.pre_challenge_skillz_girl_nih200.i_know_where_to_get_support_services_for_rape',
    Pre_10__c:'form.pre_challenge_skillz_girl_nih200.if_a_girl_is_sexually_abused_she_can_reduce_her_risk_of_getting_hiv_by_taki',
    Pre_11__c:'form.pre_challenge_skillz_girl_nih200.i_feel_good_about_being_a_girl',
    Pre_12__c:'form.pre_challenge_skillz_girl_nih200.it_is_the_mans_responsibility_to_make_decisions_in_a_relationship',
    Pre_13__c:'form.pre_challenge_skillz_girl_nih200.boys_should_share_the_work_around_the_home_such_as_household_chores',
    Pre_14__c:'form.pre_challenge_skillz_girl_nih200.i_know_what_i_want_to_be_after_finishing_secondary_school',
    Pre_15__c:'form.pre_challenge_skillz_girl_nih200.if_i_have_a_problem_i_have_someone_in_my_life_i_can_talk_to_for_advise',
    Pre_16__c:'form.pre_challenge_skillz_girl_nih200.a_boyfriend_may_have_good_reason_to_hit_his_girlfriend',
    Pre_17__c:'form.pre_challenge_skillz_girl_nih200.i_would_tell_someone_if_i_were_touched_in_a_manner_that_made_me_uncomfortab',
    Pre_18__c:'form.pre_challenge_skillz_girl_nih200.i_can_reach_my_goals_in_life',
    Pre_19__c:'form.pre_challenge_skillz_girl_nih200.a_girl_should_wait_to_get_married_until_after_college',
    Pre_20__c:'form.pre_challenge_skillz_girl_nih200.biological_and_social_factors_contribute_to_females_and_males_experiencing_',
    Pre_21__c:'form.pre_challenge_skillz_girl_nih200.the_most_common_illness_of_mental_health_are_depression_and_anxiety',
    Pre_22__c:'form.pre_challenge_skillz_girl_nih200.mental_health_problems_have_nothing_to_do_with_being_lazy_or_weak_and_many_',
    Pre_23__c:'form.pre_challenge_skillz_girl_nih200.i_am_ready_to_take_an_hiv_test',
    Pre_24__c:'form.pre_challenge_skillz_girl_nih200.are_you_or_your_boyfriendgirlfriend_currently_using_any_contraceptive_or_pr',
    },

    'pre_challenge_mindskillz_pamumvuri':{
    Pre_1__c: 'form.pre_challenge_mindskillz_pamumvuri.when_i_express_my_feelings_clearly_people_understand_me_better',
    Pre_2__c: 'form.pre_challenge_mindskillz_pamumvuri.i_have_skills_that_help_me_bounce_back_from_difficult_situations',
    Pre_3__c: 'form.pre_challenge_mindskillz_pamumvuri.stress_is_a_normal_part_of_life',
    Pre_4__c: 'form.pre_challenge_mindskillz_pamumvuri.i_can_reach_my_goals_in_life',
    Pre_5__c: 'form.pre_challenge_mindskillz_pamumvuri.if_i_have_a_problem_i_have_someone_in_my_life_i_can_go_to_for_support',
    Pre_6__c: 'form.pre_challenge_mindskillz_pamumvuri.i_can_identify_my_strengths_or_things_that_i_am_good_at_in_life',
    Pre_7__c: 'form.pre_challenge_mindskillz_pamumvuri.self_control_helps_you_make_smart_decisions_when_you_are_angry_or_upset',
    Pre_8__c: 'form.pre_challenge_mindskillz_pamumvuri.society_expects_boys_and_girls_to_deal_with_their_emotions_differently',
    Pre_9__c: 'form.pre_challenge_mindskillz_pamumvuri.i_know_how_to_express_my_anger_without_being_violent',
    Pre_10__c: 'form.pre_challenge_mindskillz_pamumvuri.listening_carefully_to_others_is_an_important_communication_skill',
    Pre_11__c: 'form.pre_challenge_mindskillz_pamumvuri.drinking_too_much_alcohol_can_have_serious_negative_consequences_for_mental',
    Pre_12__c: 'form.pre_challenge_mindskillz_pamumvuri.i_can_understand_how_others_are_feeling_and_be_sensitive_to_their_emotions',
    Pre_13__c: 'form.pre_challenge_mindskillz_pamumvuri.i_am_confident_that_i_know_where_to_seek_information_about_mental_illness',
    Pre_14__c: 'form.pre_challenge_mindskillz_pamumvuri.i_am_confident_using_the_computer_or_telephone_to_seek_information_about_me',
    Pre_15__c: 'form.pre_challenge_mindskillz_pamumvuri.i_am_confident_attending_face_to_face_appointments_to_seek_information_abou',
    Pre_16__c: 'form.pre_challenge_mindskillz_pamumvuri.i_am_confident_i_have_access_to_resources_eg_doctor_internet_friends_that_i',
    Pre_17__c: 'form.pre_challenge_mindskillz_pamumvuri.people_with_mental_illness_could_snap_out_of_it_if_they_wanted',
    Pre_18__c: 'form.pre_challenge_mindskillz_pamumvuri.a_mental_illness_is_a_sign_of_personal_weakness',
    Pre_19__c: 'form.pre_challenge_mindskillz_pamumvuri.a_mental_illness_is_not_a_real_medical_illness',
    Pre_20__c: 'form.pre_challenge_mindskillz_pamumvuri.people_with_mental_illness_are_dangerous',
    Pre_21__c: 'form.pre_challenge_mindskillz_pamumvuri.it_is_best_to_avoid_people_with_mental_illness_so_that_you_dont_develop_thi',
    Pre_22__c: 'form.pre_challenge_mindskillz_pamumvuri.if_i_had_a_mental_illness_i_would_not_tell_anyone',
    Pre_23__c: 'form.pre_challenge_mindskillz_pamumvuri.seeing_a_mental_health_professional_means_you_are_not_strong_enough_to_mana',
    Pre_24__c: 'form.pre_challenge_mindskillz_pamumvuri.if_i_had_mental_illness_i_would_not_seek_help_from_a_mental_health_professi',
    Pre_25__c: 'form.pre_challenge_mindskillz_pamumvuri.i_believe_treatment_for_a_mental_illness_provided_by_a_mental_health_profes',
    },
    'pre_challenge_skillz_girl_-_zam_311': {
    Pre_1__c: 'form.pre_challenge_skillz_girl_-_zam_311.i_know_what_i_am_good_at',
    Pre_2__c: 'form.pre_challenge_skillz_girl_-_zam_311.i_know_how_to_overcome_challenges_that_i_may_face_in_my_life',
    Pre_3__c: 'form.pre_challenge_skillz_girl_-_zam_311.i_dont_always_have_to_do_what_people_expect_just_because_i_am_a_girl',
    Pre_4__c: 'form.pre_challenge_skillz_girl_-_zam_311.i_would_be_able_to_ask_my_boyfriend_that_i_want_to_use_a_condom',
    Pre_5__c: 'form.pre_challenge_skillz_girl_-_zam_311.i_can_say_no_to_sex_even_if_my_boyfriend_or_friends_pressure_me_to_have_sex',
    Pre_6__c: 'form.pre_challenge_skillz_girl_-_zam_311.if_i_am_sexually_active_i_go_to_a_healthcare_provider_to_get_protection_fro',
    Pre_7__c: 'form.pre_challenge_skillz_girl_-_zam_311.i_can_make_my_own_informed_decisions_about_my_sexual_healthcare',
    Pre_8__c: 'form.pre_challenge_skillz_girl_-_zam_311.it_is_only_the_girls_responsibility_to_avoid_getting_pregnant',
    Pre_9__c: 'form.pre_challenge_skillz_girl_-_zam_311.a_man_has_the_right_to_have_sex_with_his_girlfriend_even_if_she_doesnt_want',
    Pre_10__c: 'form.pre_challenge_skillz_girl_-_zam_311.sometimes_a_man_may_have_a_good_reason_to_hit_his_girlfriend_or_wife',
    Pre_11__c: 'form.pre_challenge_skillz_girl_-_zam_311.a_successful_marriage_is_more_important_to_girls_than_completing_school',
    Pre_12__c: 'form.pre_challenge_skillz_girl_-_zam_311.a_daughter_should_always_respect_her_parents_decision_for_her_to_get_marrie',
    Pre_13__c: 'form.pre_challenge_skillz_girl_-_zam_311.i_can_decide_when_is_the_right_time_for_me_to_have_a_baby',
    Pre_14__c: 'form.pre_challenge_skillz_girl_-_zam_311.i_have_someone_in_my_life_i_can_turn_to_when_i_need_advice_or_when_i_have_a',
    Pre_15__c: 'form.pre_challenge_skillz_girl_-_zam_311.i_know_where_to_get_support_services_for_me_or_someone_else_for_hiv-related',
    Pre_16__c: 'form.pre_challenge_skillz_girl_-_zam_311.i_know_where_to_get_support_services_for_me_or_someone_else_for_gender_base',
    Pre_17__c: 'form.pre_challenge_skillz_girl_-_zam_311.i_know_where_to_get_support_services_for_me_or_someone_else_for_prevention_',
    Pre_18__c: 'form.pre_challenge_skillz_girl_-_zam_311.one_sign_of_pregnancy_is_a_girl_missing_her_period',
    Pre_19__c: 'form.pre_challenge_skillz_girl_-_zam_311.i_know_at_least_three_methods_to_avoid_an_unwanted_pregnancy',
    Pre_20__c: 'form.pre_challenge_skillz_girl_-_zam_311.are_you_or_your_boyfriend_currently_using_any_contraceptive_method',
    },
    'pre_challenge_skillz_core_zambia_211':{
    Pre_1__c: 'form.pre_challenge_skillz_core_zambia_211.i_know_what_i_am_good_at',
    Pre_2__c: 'form.pre_challenge_skillz_core_zambia_211.i_know_how_to_overcome_challenges_i_may_have_in_my_life',
    Pre_3__c: 'form.pre_challenge_skillz_core_zambia_211.i_can_make_my_own_decisions_no_matter_how_much_pressure_i_get_from_others',
    Pre_4__c: 'form.pre_challenge_skillz_core_zambia_211.it_is_the_mans_responsibility_to_make_decisions_in_a_relationship',
    Pre_5__c: 'form.pre_challenge_skillz_core_zambia_211.i_dont_always_have_to_do_what_people_expect_because_i_am_a_boygirl',
    Pre_6__c: 'form.pre_challenge_skillz_core_zambia_211.a_man_has_the_right_to_have_sex_with_his_girlfriend_even_if_she_doesnt_want',
    Pre_7__c: 'form.pre_challenge_skillz_core_zambia_211.girls_should_not_disagree_with_boys',
    Pre_8__c: 'form.pre_challenge_skillz_core_zambia_211.if_a_girl_gets_pregnant_she_should_drop_out_of_school',
    Pre_9__c: 'form.pre_challenge_skillz_core_zambia_211.i_have_the_right_to_say_no_to_sex_no_matter_who_asks_me',
    Pre_10__c: 'form.pre_challenge_skillz_core_zambia_211.i_have_an_older_person_in_my_life_i_can_go_to_for_advice',
    Pre_11__c: 'form.pre_challenge_skillz_core_zambia_211.if_i_test_positive_for_hivthere_will_be_someone_who_will_help_and_support_m',
    Pre_12__c: 'form.pre_challenge_skillz_core_zambia_211.male_circumcision_reduces_a_males_risk_of_getting_hiv',
    Pre_13__c: 'form.pre_challenge_skillz_core_zambia_211.drinking_alcohol_can_increase_my_risk_of_getting_hiv',
    Pre_14__c: 'form.pre_challenge_skillz_core_zambia_211.i_know_where_to_get_support_services_for_me_or_someone_elsefor_hiv_-_relate',
    Pre_15__c: 'form.pre_challenge_skillz_core_zambia_211.i_know_where_to_get_support_services_for_me_or_someone_elsefor_abuse',
    Pre_16__c: 'form.pre_challenge_skillz_core_zambia_211.i_have_the_right_to_access_sexual_health_servicessuch_as_sti_and_hiv_testin',
    Pre_17__c: 'form.pre_challenge_skillz_core_zambia_211.one_sign_of_pregnancy_is_a_girl_missing_her_period',
    Pre_18__c: 'form.pre_challenge_skillz_core_zambia_211.i_would_say_no_to_playing_sport_with_someone_who_has_hiv',
    Pre_19__c: 'form.pre_challenge_skillz_core_zambia_211.i_can_tell_whether_someone_has_hiv_by_looking_at_him_or_her',
    Pre_20__c: 'form.pre_challenge_skillz_core_zambia_211.i_know_what_decisions_to_make_to_achieve_my_goals',
    },
    'pre_challenge_skillz_boy_zambia110':{
    Pre_1__c: 'form.pre_challenge_skillz_boy_zambia110.in_general_i_feel_good_about_myself',
    Pre_2__c: 'form.pre_challenge_skillz_boy_zambia110.i_would_be_able_to_ask_my_girlfriend_that_i_want_to_use_a_condom',
    Pre_3__c: 'form.pre_challenge_skillz_boy_zambia110.i_dont_always_have_to_do_what_people_expect_just_because_i_am_a_boy',
    Pre_4__c: 'form.pre_challenge_skillz_boy_zambia110.it_is_the_mans_responsibility_to_make_decisions_in_a_relationship',
    Pre_5__c: 'form.pre_challenge_skillz_boy_zambia110.it_is_more_important_for_boys_to_be_educated_than_girls',
    Pre_6__c: 'form.pre_challenge_skillz_boy_zambia110.men_are_better_leaders_than_women',
    Pre_7__c: 'form.pre_challenge_skillz_boy_zambia110.a_man_has_the_right_to_have_sex_with_his_girlfriend_even_if_she_doesnt_want',
    Pre_8__c: 'form.pre_challenge_skillz_boy_zambia110.it_is_only_the_girls_responsibility_to_avoid_getting_pregnant',
    Pre_9__c: 'form.pre_challenge_skillz_boy_zambia110.it_is_okay_for_a_boyfriend_to_threaten_to_hit_his_girlfriend_if_he_never_hi',
    Pre_10__c: 'form.pre_challenge_skillz_boy_zambia110.i_can_say_no_to_sex_even_if_my_friends_or_girlfriend_pressure_me_to_have_se',
    Pre_11__c: 'form.pre_challenge_skillz_boy_zambia110.people_who_abuse_alcohol_are_more_likely_to_engage_in_risky_sexual_behaviou',
    Pre_12__c: 'form.pre_challenge_skillz_boy_zambia110.i_know_where_to_go_for_support_if_i_or_someone_i_know_drinks_too_much_alcoh',
    Pre_13__c: 'form.pre_challenge_skillz_boy_zambia110.i_have_a_friend_that_i_can_go_to_for_advice_when_i_have_a_problem',
    Pre_14__c: 'form.pre_challenge_skillz_boy_zambia110.i_have_the_right_to_access_sexual_health_services_such_as_hiv_and_sti_testi',
    Pre_15__c: 'form.pre_challenge_skillz_boy_zambia110.i_know_where_to_access_sexual_health_services_such_as_sti_and_hiv_testing',
    Pre_16__c: 'form.pre_challenge_skillz_boy_zambia110.before_making_a_decision_i_think_about_how_it_can_affect_me_or_others',
    Pre_17__c: 'form.pre_challenge_skillz_boy_zambia110.i_know_how_to_express_my_anger_without_being_violent_such_as_hitting_kickin',
    Pre_18__c: 'form.pre_challenge_skillz_boy_zambia110.male_circumcision_reduces_a_males_risk_of_getting_hiv',
    Pre_19__c: 'form.pre_challenge_skillz_boy_zambia110.i_know_how_to_correctly_use_a_male_condom',
    Pre_20__c: 'form.pre_challenge_skillz_boy_zambia110.are_you_or_your_boyfriendgirlfriend_currently_using_any_contraceptive_or_pr',

    },
    'pre_challenge_skillz_guyz_mh_-_sa_100':{
    Pre_1__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.i_have_to_be_respectful_communicate_and_take_action_to_be_a_role_model_in_m',
    Pre_2__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.i_have_skills_that_help_me_bounce_back_from_difficult_situations',
    Pre_3__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.i_can_identify_my_strengths_or_things_that_i_am_good_at',
    Pre_4__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.when_i_am_angry_i_know_how_to_avoid_using_violent_behaviour',
    Pre_5__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.when_i_express_my_feelings_clearly_people_understand_me_better',
    Pre_6__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.i_know_what_changes_to_expect_in_my_body_during_puberty',
    Pre_7__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.sadness_and_a_loss_of_pleasure_in_things_you_enjoy_are_common_symptoms_of_d',
    Pre_8__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.i_know_where_to_access_health_services_and_mental_health_services',
    Pre_9__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.i_will_share_accurate_information_about_mental_health_services_to_avoid_sti',
    Pre_10__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.society_expects_boys_and_girls_to_deal_with_their_emotions_differently',
    Pre_11__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.men_should_share_the_work_around_the_house_such_as_cleaning_and_taking_care',
    Pre_12__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.its_okay_for_a_guy_to_beat_a_girl_when_there_is_a_misunderstanding',
    Pre_13__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.i_should_respect_the_rights_of_others_such_as_their_right_to_their_own_opin',
    Pre_14__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.i_feel_confident_setting_my_goals',
    Pre_15__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.stress_is_a_normal_part_of_life',
    Pre_16__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.deep_breathing_is_a_healthy_way_to_deal_with_difficult_and_stressful_situat',
    Pre_17__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.there_are_people_i_trust_with_whom_i_can_talk_to_about_my_mental_health',
    Pre_18__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.i_have_no_fear_or_shame_when_accessing_health_services_or_mental_health_ser',
    Pre_19__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.having_more_than_one_sexual_partner_over_the_same_time_period_increases_my_',
    Pre_20__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.it_is_the_males_responsibility_to_make_decisions_in_a_relationship',
    Pre_21__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.i_can_stand_up_to_peer_pressure_when_i_have_to',
    Pre_22__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.i_should_use_a_condom_even_if_my_girlfriend_is_on_another_form_of_birth_con',
    Pre_23__c: 'form.pre_challenge_skillz_guyz_mh_-_sa_100.i_know_where_to_go_for_support_if_i_or_someone_i_know_abuses_alcohol',
    },


    'pre_challenge_south_africa_-_skillz_girl_mh_sa_211':{
    Pre_1__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.i_know_my_rights_and_responsibilities',
    Pre_2__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.i_can_identify_my_strengths_or_things_that_i_am_good_at_in_life',
    Pre_3__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.i_know_where_to_get_contraception_to_prevent_unwanted_pregnancy',
    Pre_4__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.stress_is_a_normal_part_of_life',
    Pre_5__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.like_physical_health_we_all_have_mental_health',
    Pre_6__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.it_is_the_males_responsibility_to_make_decisions_in_a_relationship',
    Pre_7__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.healthy_relationships_are_based_on_healthy_communication_and_mutual_respect',
    Pre_8__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.sometimes_a_man_may_have_a_good_reason_to_hit_his_girlfriend_partner_or_wif',
    Pre_9__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.i_can_say_no_to_sex_even_if_my_partner_or_friends_pressure_me_to_have_sex',
    Pre_10__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.having_more_than_one_sexual_partner_increases_my_risk_of_getting_hiv',
    Pre_11__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.taking_prep_and_using_a_condom_can_lower_my_risk_of_getting_hiv',
    Pre_12__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.i_know_where_to_go_for_support_if_i_or_someone_i_know_drinks_too_much_alcoh',
    Pre_13__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.deep_breathing_is_a_healthy_way_to_deal_with_difficult_and_stressful_situat',
    Pre_14__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.post_exposure_prophylaxis_pep_can_reduce_my_risk_of_getting_hiv_if_taken_1-',
    Pre_15__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.it_is_my_right_to_access_health_services',
    Pre_16__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.i_have_an_adult_or_someone_in_my_life_i_can_go_to_for_advice',
    Pre_17__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.i_can_give_support_and_encouragement_to_a_friend_or_family_member_who_is_li',
    Pre_18__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.using_a_condom_and_another_contraceptive_method_can_help_prevent_unwanted_p',
    Pre_19__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.i_know_what_changes_to_expect_in_my_body_during_puberty',
    Pre_20__c: 'form.pre_challenge_south_africa_-_skillz_girl_mh_sa_211.drinking_too_much_alcohol_can_harm_the_body_and_the_mind',
    },

    'pre_challenge_skillz_girl_abbreviated_south_africa':{
    Pre_1__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.i_know_my_rights_and_responsibilities',
    Pre_2__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.i_can_identify_my_strengths_or_things_that_i_am_good_at_in_life',
    Pre_3__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.i_know_where_to_get_contraception_to_prevent_unwanted_pregnancy',
    Pre_4__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.stress_is_a_normal_part_of_life',
    Pre_5__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.like_physical_health_we_all_have_mental_health',
    Pre_6__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.it_is_the_males_responsibility_to_make_decisions_in_a_relationship',
    Pre_7__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.in_a_relationship_it_is_both_partners_responsibility_to_prevent_unwanted_pr',
    Pre_8__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.healthy_relationships_are_based_on_healthy_communication_and_respect',
    Pre_9__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.sometimes_a_man_may_have_a_good_reason_to_hit_his_girlfriend_partner_or_wif',
    Pre_10__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.a_person_has_the_right_to_have_sex_with_their_partner_even_if_the_partner_d',
    Pre_11__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.i_can_say_no_to_sex_even_if_my_partner_or_friends_pressure_me_to_have_sex',
    Pre_12__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.having_more_than_one_sexual_partner_increases_my_risk_of_getting_hiv',
    Pre_13__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.taking_prep_and_using_a_condom_can_lower_my_risk_of_getting_hiv',
    Pre_14__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.i_know_where_to_go_for_support_if_i_or_someone_i_know_drinks_too_much_alcoh',
    Pre_15__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.deep_breathing_is_a_healthy_way_to_deal_with_difficult_and_stressful_situat',
    Pre_16__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.i_can_use_coping_skills_to_handle_stress',
    Pre_17__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.post_exposure_prophylaxis_pep_can_reduce_my_risk_of_getting_hiv_if_taken_1-',
    Pre_18__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.it_is_my_right_to_access_health_services',
    Pre_19__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.i_have_an_adult_or_someone_in_my_life_i_can_go_to_for_advice',
    Pre_20__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.using_a_condom_and_another_contraceptive_method_can_help_prevent_unwanted_p',
    Pre_21__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.i_know_what_changes_to_expect_in_my_body_during_puberty',
    Pre_22__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.drinking_too_much_alcohol_can_harm_the_body_and_mind',
    Pre_23__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.i_know_at_least_two_ways_of_saving_money',
    Pre_24__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.a_budget_is_the_estimated_income_and_expenses_for_a_certain_time_period',
    Pre_25__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.accepting_money_for_sexual_favors_can_create_risks_to_my_health_and_safety',
    Pre_26__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.using_assertive_communication_means_respectfully_sharing_my_thoughts_and_fe',
    Pre_27__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.i_have_the_right_to_access_emergency_contraception',
    Pre_28__c: 'form.pre_challenge_skillz_girl_abbreviated_south_africa.if_a_girl_has_unprotected_sex_and_misses_her_period_this_could_mean_she_is_',
    },

    'pre_challenge_skillz_guyz_-_yedi__323':{
    Pre_1__c: 'form.pre_challenge_skillz_guyz_-_yedi__323.i_know_how_to_stand_up_to_peer_pressure_ie_to_drink_alcohol_or_have_sex_fro',
    Pre_2__c: 'form.pre_challenge_skillz_guyz_-_yedi__323.it_is_better_to_express_yourself_with_anger_when_upset_than_to_use_self-con',
    Pre_3__c: 'form.pre_challenge_skillz_guyz_-_yedi__323.i_have_someone_i_can_go_to_for_advice',
    Pre_4__c: 'form.pre_challenge_skillz_guyz_-_yedi__323.no_one_has_the_right_to_touch_me_in_a_way_that_makes_me_uncomfortable_such_',
    Pre_5__c: 'form.pre_challenge_skillz_guyz_-_yedi__323.i_know_where_to_go_for_support_if_i_or_someone_i_know_drinks_too_much_alcoh',
    Pre_6__c: 'form.pre_challenge_skillz_guyz_-_yedi__323.people_who_abuse_alcohol_are_more_likely_to_engage_in_risky_behaviours_such',
    Pre_7__c: 'form.pre_challenge_skillz_guyz_-_yedi__323.it_is_the_males_responsibility_to_make_decisions_in_a_relationship',
    Pre_8__c: 'form.pre_challenge_skillz_guyz_-_yedi__323.a_mental_illness_is_a_sign_of_personal_weakness',
    Pre_9__c: 'form.pre_challenge_skillz_guyz_-_yedi__323.young_people_should_avoid_people_with_mental_illness_as_they_are_always_vio',
    Pre_10__c: 'form.pre_challenge_skillz_guyz_-_yedi__323.i_can_make_my_own_informed_decisions_about_my_sexual_healthcare',
    Pre_11__c: 'form.pre_challenge_skillz_guyz_-_yedi__323.a_boys_opinion_is_more_important_than_a_girls',
    Pre_12__c: 'form.pre_challenge_skillz_guyz_-_yedi__323.men_should_share_the_work_around_the_house_such_as_cleaning_and_taking_care',
    Pre_13__c: 'form.pre_challenge_skillz_guyz_-_yedi__323.its_okay_for_a_guy_to_beat_a_girl_when_she_misbehaves',
    Pre_14__c: 'form.pre_challenge_skillz_guyz_-_yedi__323.seeking_help_for_mental_health_challenges_is_a_sign_of_weakness',
    Pre_15__c: 'form.pre_challenge_skillz_guyz_-_yedi__323.it_is_only_the_girls_responsibility_to_avoid_getting_pregnant',
    Pre_16__c: 'form.pre_challenge_skillz_guyz_-_yedi__323.condoms_are_the_only_contraceptive_method_that_protect_against_pregnancy_as',
    Pre_17__c: 'form.pre_challenge_skillz_guyz_-_yedi__323.i_would_stand_up_to_my_friends_if_they_were_harming_others_such_as_touching',
    Pre_18__c: 'form.pre_challenge_skillz_guyz_-_yedi__323.having_more_than_one_sexual_partner_over_the_same_time_period_increases_my_',
    Pre_19__c: 'form.pre_challenge_skillz_guyz_-_yedi__323.a_man_has_the_right_to_have_sex_with_his_girlfriend_even_if_she_doesnt_want',
    Pre_20__c: 'form.pre_challenge_skillz_guyz_-_yedi__323.i_have_the_ability_to_shape_my_own_life',
    },

    'pre_challenge_skillz_girl_mh_zambia':{
    Pre_1__c: 'form.pre_challenge_skillz_girl_mh_zambia.a_mental_illness_is_a_sign_of_personal_weakness',
    Pre_2__c: 'form.pre_challenge_skillz_girl_mh_zambia.it_is_better_to_express_yourself_with_anger_when_upset_than_to_use_self-con',
    Pre_3__c: 'form.pre_challenge_skillz_girl_mh_zambia.i_dont_always_have_to_do_what_people_expect_just_because_i_am_a_girl',
    Pre_4__c: 'form.pre_challenge_skillz_girl_mh_zambia.if_i_had_a_boyfriend_i_would_be_able_to_ask_him_to_use_a_condom_before_havi',
    Pre_5__c: 'form.pre_challenge_skillz_girl_mh_zambia.i_can_say_no_to_sex_even_if_my_boyfriend_or_friends_pressure_to_have_sex',
    Pre_6__c: 'form.pre_challenge_skillz_girl_mh_zambia.seeking_help_for_mental_health_challenges_is_a_sign_of_weakness',
    Pre_7__c: 'form.pre_challenge_skillz_girl_mh_zambia.i_can_make_my_own_informed_decisions_about_my_sexual_healthcare',
    Pre_8__c: 'form.pre_challenge_skillz_girl_mh_zambia.young_people_should_avoid_people_with_mental_illness_as_they_are_always_vio',
    Pre_9__c: 'form.pre_challenge_skillz_girl_mh_zambia.a_man_has_the_right_to_have_sex_with_his_girlfriend_even_if_she_doesnt_want',
    Pre_10__c: 'form.pre_challenge_skillz_girl_mh_zambia.sometimes_a_man_may_have_a_good_reason_to_hit_his_girlfriend_or_wife',
    Pre_11__c: 'form.pre_challenge_skillz_girl_mh_zambia.a_successful_marrige_is_more_important_to_girls_than_completing_school',
    Pre_12__c: 'form.pre_challenge_skillz_girl_mh_zambia.a_daughter_should_always_respect_her_parents_decision_to_get_married',
    Pre_13__c: 'form.pre_challenge_skillz_girl_mh_zambia.i_can_decide_when_is_the_right_time_for_me_to_have_a_baby',
    Pre_14__c: 'form.pre_challenge_skillz_girl_mh_zambia.i_have_someone_in_my_life_i_can_turn_to_when_i_need_advice_or_when_i_have_a',
    Pre_15__c: 'form.pre_challenge_skillz_girl_mh_zambia.i_know_where_to_get_support_services_for_me_or_someone_else_for_hiv-related',
    Pre_16__c: 'form.pre_challenge_skillz_girl_mh_zambia.i_know_where_to_get_support_services_for_me_or_someone_else_for_gender_base',
    Pre_17__c: 'form.pre_challenge_skillz_girl_mh_zambia.i_know_where_to_get_support_services_for_me_or_someone_else_for_prevention_',
    Pre_18__c: 'form.pre_challenge_skillz_girl_mh_zambia.if_sexually_active_one_sign_of_pregnance_is_a_girl_missing_her_period',
    Pre_19__c: 'form.pre_challenge_skillz_girl_mh_zambia.i_know_at_least_three_methods_to_avoid_an_unwanted_pregnancy',
    Pre_20__c: 'form.pre_challenge_skillz_girl_mh_zambia.are_you_or_your_boyfriend_currently_using_any_contraceptive_method',
    },

    'pre_challenge_skillz_core_mh_zambia':{
    Pre_1__c: 'form.pre_challenge_skillz_core_mh_zambia.i_know_what_i_am_good_at',
    Pre_2__c: 'form.pre_challenge_skillz_core_mh_zambia.i_know_how_to_overcome_challenges_that_i_may_have_in_life',
    Pre_3__c: 'form.pre_challenge_skillz_core_mh_zambia.i_can_make_my_own_decisions_no_matter_how_much_pressure_i_get_from_others',
    Pre_4__c: 'form.pre_challenge_skillz_core_mh_zambia.it_is_the_mans_responsibility_to_make_decisions_in_a_relationship',
    Pre_5__c: 'form.pre_challenge_skillz_core_mh_zambia.i_dont_always_have_to_do_what_people_expect_just_because_i_am_a_girlboy',
    Pre_6__c: 'form.pre_challenge_skillz_core_mh_zambia.a_man_has_the_right_to_have_sex_with_his_wifegirlfriend_even_if_she_doesnt_',
    Pre_7__c: 'form.pre_challenge_skillz_core_mh_zambia.girls_should_not_disagree_with_boys',
    Pre_8__c: 'form.pre_challenge_skillz_core_mh_zambia.if_a_girl_gets_pregnant_she_should_drop_out_of_school',
    Pre_9__c: 'form.pre_challenge_skillz_core_mh_zambia.i_have_the_right_to_say_no_to_sex_no_matter_who_asks_me',
    Pre_10__c: 'form.pre_challenge_skillz_core_mh_zambia.i_have_an_older_person_in_my_life_i_can_go_to_for_advice',
    Pre_11__c: 'form.pre_challenge_skillz_core_mh_zambia.if_i_test_positive_for_hiv_there_will_be_someone_who_will_help_and_support_',
    Pre_12__c: 'form.pre_challenge_skillz_core_mh_zambia.people_with_mental_illness_live_on_the_streets_and_eat_dirty_food_from_garb',
    Pre_13__c: 'form.pre_challenge_skillz_core_mh_zambia.drinking_alcohol_can_increase_my_risk_of_getting_hiv',
    Pre_14__c: 'form.pre_challenge_skillz_core_mh_zambia.i_only_use_violent_behaviour_when_someone_angers_me',
    Pre_15__c: 'form.pre_challenge_skillz_core_mh_zambia.i_know_where_to_get_support_services_for_me_or_someone_else_for_abuse_or_hi',
    Pre_16__c: 'form.pre_challenge_skillz_core_mh_zambia.i_have_the_right_to_access_sexual_health_services_such_as_sti_and_hiv_testi',
    Pre_17__c: 'form.pre_challenge_skillz_core_mh_zambia.if_sexually_active_one_sign_of_pregnancy_can_be_a_girl_missing_her_period',
    Pre_18__c: 'form.pre_challenge_skillz_core_mh_zambia.i_would_say_no_to_playing_sport_with_someone_who_has_hiv',
    Pre_19__c: 'form.pre_challenge_skillz_core_mh_zambia.i_can_tell_whether_someone_has_hiv_by_looking_at_him_or_her',
    Pre_20__c: 'form.pre_challenge_skillz_core_mh_zambia.i_know_what_decisions_to_make_to_achieve_my_goals',
    },

    'pre_challenge_skillz_guyz_mh_zambia':{
    Pre_1__c: 'form.pre_challenge_skillz_guyz_mh_zambia.a_mental_illness_is_a_sign_of_personal_weakness',
    Pre_2__c: 'form.pre_challenge_skillz_guyz_mh_zambia.i_would_be_able_to_tell_my_girlfriend_that_i_want_to_use_a_condom',
    Pre_3__c: 'form.pre_challenge_skillz_guyz_mh_zambia.i_dont_always_have_to_do_what_people_expect_just_because_i_am_a_boy',
    Pre_4__c: 'form.pre_challenge_skillz_guyz_mh_zambia.it_is_the_mans_responsibility_to_make_decisions_in_a_relationship',
    Pre_5__c: 'form.pre_challenge_skillz_guyz_mh_zambia.it_is_more_important_for_boys_to_be_educated_than_girls',
    Pre_6__c: 'form.pre_challenge_skillz_guyz_mh_zambia.men_are_better_leaders_than_women',
    Pre_7__c: 'form.pre_challenge_skillz_guyz_mh_zambia.a_manboy_has_the_right_to_have_sex_with_his_girlfriendwomanwife_even_if_she',
    Pre_8__c: 'form.pre_challenge_skillz_guyz_mh_zambia.it_is_better_to_express_yourself_with_anger_when_upset_than_to_use_self-con',
    Pre_9__c: 'form.pre_challenge_skillz_guyz_mh_zambia.it_is_okay_for_a_boyfriend_to_threaten_to_hit_his_girlfriend_if_he_never_hi',
    Pre_10__c: 'form.pre_challenge_skillz_guyz_mh_zambia.i_can_say_no_to_sex_even_if_my_friends_or_girlfriend_pressure_me_to_have_se',
    Pre_11__c: 'form.pre_challenge_skillz_guyz_mh_zambia.people_who_abuse_alcohol_are_more_likely_to_engage_in_risky_sexual_behaviou',
    Pre_12__c: 'form.pre_challenge_skillz_guyz_mh_zambia.i_know_where_to_go_for_support_if_i_or_someone_i_know_drinks_too_much_alcoh',
    Pre_13__c: 'form.pre_challenge_skillz_guyz_mh_zambia.i_have_a_friend_that_i_can_go_to_for_advice_when_i_have_a_problem',
    Pre_14__c: 'form.pre_challenge_skillz_guyz_mh_zambia.i_have_the_right_to_access_sexual_health_services_such_as_hiv_and_sti_testi',
    Pre_15__c: 'form.pre_challenge_skillz_guyz_mh_zambia.i_know_where_to_access_sexual_health_services_such_as_sti_and_hiv_testing',
    Pre_16__c: 'form.pre_challenge_skillz_guyz_mh_zambia.seeking_help_for_mental_health_challenges_is_a_sign_of_weakness',
    Pre_17__c: 'form.pre_challenge_skillz_guyz_mh_zambia.young_people_should_avoid_people_with_mental_illness_as_they_are_always_vio',
    Pre_18__c: 'form.pre_challenge_skillz_guyz_mh_zambia.male_circumcision_reduces_a_males_risk_of_getting_hiv',
    Pre_19__c: 'form.pre_challenge_skillz_guyz_mh_zambia.i_know_how_to_correctly_use_a_male_condom',
    Pre_20__c: 'form.pre_challenge_skillz_guyz_mh_zambia.are_you_or_your_girlfriend_currently_using_any_contraceptive_or_protective_',


    }
    };

    const pluckSfValue = val => {
    return sfFieldMapping[formVersion][val];
    };

    return { ...state, pluckSfValue };
    });

    // fn(state => {
    // console.log("test")
    // console.log(state.pluckSfValue('Pre_1__c'));
    // return state;
    // });

    fn(state => {
    const PID = lastReferenceValue('records[0].Participant_Identification_Number_PID__c')(state);

    if (!PID) {
    console.log(
    `Participant not found with Participant_Identification_Number_PID__c: ${state.data.form.case['@case_id']}`
    );
    return state;
    }

    return upsert(
    'Attendance__c',
    'CommCare_Ext_ID__c',
    fields(
    //field('Event__c', dataValue('form.hidden_properties.intervention_name')),
    //relationship('Event__r', 'CommCare_Ext_ID__c', dataValue('form.hidden_properties.intervention_name')),
    relationship('Person_Attendance__r', 'Participant_Identification_Number_PID__c', dataValue('form.case.@case_id')),
    // relationship('Person_Attendance__r','CommCare_Ext_ID__c', state => {
    // return (
    // dataValue('form.hidden_properties.participant_first_name')(state) +
    // dataValue('form.hidden_properties.participant_surname')(state)
    // )
    // }),

    // field('CommCare_Ext_ID__c', state => {
    // return `${dataValue('form.case.@case_id')(state)}-${scrubEmojis(
    // dataValue('form.hidden_properties.intervention_name')(state),
    // ''
    // ).replace(/\//gi, '')}`;
    // }),
    field("CommCare_Ext_ID__c", (state) => {
    return toUTF8(`${dataValue("form.case.@case_id")(state)}-${scrubEmojis(
    dataValue("form.hidden_properties.intervention_name")(state),
    ""
    ).replace(/\//gi, "")}`);
    }),

    //field(
    //'Person_Attendance__c',
    // state =>
    // dataValue('form.hidden_properties.participant_first_name')(state) +
    // ' ' +
    // dataValue('form.hidden_properties.participant_surname')(state)
    //),
    field('Gender__c', dataValue('form.hidden_properties.gender')),
    field('Grade__c', state => {
    const grade = dataValue('form.hidden_properties.grade')(state);
    return grade ? grade.replace(/\D/g, '') : undefined;
    }),
    field('Class__c', dataValue('form.hidden_properties.class')),
    field('Pre_Post_Completed__c', state => {
    var done = dataValue('form.hidden_properties.pre_questionnaire_complete')(state);
    return done === 'Yes' ? true : done === 'No' ? false : undefined;
    }),
    field('Date_Pre_Administered__c', dataValue('form.date')),
    field('Pre_1__c', state => {
    const value = dataValue(state.pluckSfValue('Pre_1__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_2__c', state => {
    if (state.pluckSfValue('Pre_2__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_2__c'))(state);
    return state.helperFunctions.transform(value);
    }),

    field('Pre_3__c', state => {
    const value = dataValue(state.pluckSfValue('Pre_3__c'))(state);
    return state.helperFunctions.transform(value);
    }),

    field('Pre_4__c', state => {
    const value = dataValue(state.pluckSfValue('Pre_4__c'))(state);
    return state.helperFunctions.transform(value);
    }),

    field('Pre_5__c', state => {
    const value = dataValue(state.pluckSfValue('Pre_5__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_6__c', state => {
    const value = dataValue(state.pluckSfValue('Pre_6__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_7__c', state => {
    const value = dataValue(state.pluckSfValue('Pre_7__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_8__c', state => {
    const value = dataValue(state.pluckSfValue('Pre_8__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_9__c', state => {
    const value = dataValue(state.pluckSfValue('Pre_9__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_10__c', state => {
    if (state.pluckSfValue('Pre_10__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_10__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_11__c', state => {
    if (state.pluckSfValue('Pre_11__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_10__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_12__c', state => {
    if (state.pluckSfValue('Pre_12__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_12__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_13__c', state => {
    if (state.pluckSfValue('Pre_13__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_13__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_14__c', state => {
    if (state.pluckSfValue('Pre_14__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_14__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_15__c', state => {
    if (state.pluckSfValue('Pre_15__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_15__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_16__c', state => {
    if (state.pluckSfValue('Pre_16__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_16__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_17__c', state => {
    if (state.pluckSfValue('Pre_17__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_17__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_18__c', state => {
    if (state.pluckSfValue('Pre_18__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_18__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_19__c', state => {
    if (state.pluckSfValue('Pre_19__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_19__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_20__c', state => {
    if (state.pluckSfValue('Pre_20__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_20__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_21__c', state => {
    if (state.pluckSfValue('Pre_21__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_21__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_22__c', state => {
    if (state.pluckSfValue('Pre_22__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_22__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_23__c', state => {
    if (state.pluckSfValue('Pre_23__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_23__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_24__c', state => {
    if (state.pluckSfValue('Pre_24__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_24__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_25__c', state => {
    if (state.pluckSfValue('Pre_25__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_25__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_26__c', state => {
    if (state.pluckSfValue('Pre_26__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_26__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_27__c', state => {
    if (state.pluckSfValue('Pre_27__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_27__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    field('Pre_28__c', state => {
    if (state.pluckSfValue('Pre_28__c') == null) return undefined
    const value = dataValue(state.pluckSfValue('Pre_28__c'))(state);
    return state.helperFunctions.transform(value);
    }),
    )
    )(state);
    });

    //Removing mapping... need case_id to upsert Events. Date_of_Pre__c update should be handled on the SF side.
    // upsert(
    // 'Event__c',
    // 'CommCare_Ext_ID__c',
    // fields(
    // field('CommCare_Ext_ID__c', dataValue('form.hidden_properties.intervention_name')),
    // field('Date_of_Pre__c', dataValue('form.date')),

    // )
    // );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-Register-Event-2021-04-30.html b/adaptors/library/jobs/auto/Upsert-Register-Event-2021-04-30.html index 6a94007482e1..2c02032dd3ca 100644 --- a/adaptors/library/jobs/auto/Upsert-Register-Event-2021-04-30.html +++ b/adaptors/library/jobs/auto/Upsert-Register-Event-2021-04-30.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Upsert Register Event

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    alterState, dataValue, field, fields, join, map, relationship, upsert

    Expression

    alterState((state) => {

    function clean(str) {
    if (!!str)
    return str
    .split('_')
    .map(word => {
    let new_word = word.toString().toLowerCase();
    return new_word.slice(0, 1).toUpperCase() + new_word.slice(1);
    })
    .join(' ');
    }

    const coachFieldNames = ['Coach_A__r','Coach_B__r','Coach_C__r','Coach_D__r']

    state.data.destinationCoachFields = state.data.form.event_information.coaches
    .split(' ')
    .reduce(
    (accumulator, currentValue, currentIndex) => [
    ...accumulator,
    (currentIndex < coachFieldNames.length && !!currentValue
    ? relationship(coachFieldNames[currentIndex], 'CommCare_Ext_ID__c', currentValue)
    : []),
    ],
    []
    );

    const eventtype = state.data.form.event_information.event_type;

    const recordtype = eventtype==='community_health_event' || eventtype==='soccer_tournament' ? 'Testing Event' : 'Malaria Testing Event';
    console.log(recordtype)

    state.data.recordtype = recordtype;

    return state;
    });

    upsert(
    'Event__c',
    'CommCare_Case_ID__c',
    state=>({
    ...fields(
    field('Name', dataValue('form.event_information.Event_Name')),
    relationship('RecordType', 'Name', dataValue('recordtype')),
    field('CommCare_Ext_ID__c', state => {
    var event = dataValue('form.event_information.Event_Name')(state);
    return event ? event.replace(/\//gi, '') : event;
    }),
    field('CommCare_Case_ID__c', dataValue('form.case.@case_id')),
    field('Business_Unit__c', state => {
    const bu = dataValue('form.event_information.business_unit')(state);
    return bu==='65680f0c4c144b03ad0f86bdc46c1ebc' ? 'GRS Zambia' :
    bu==='04d98397e28046118fade28ced6b65cb' ? 'GRS Zimbabwe' :
    bu==='ed125ab19ec34aacab79585e59eb76f4' ? 'GRS Partnerships': undefined ;
    }),
    relationship('Site__r','CommCare_Ext_ID__c', dataValue('form.event_information.site')),
    relationship('Venue__r', 'CommCare_Ext_ID__c',dataValue('form.event_information.Venue')),
    field('Date__c', dataValue('form.event_information.event_date')),
    field('Event_Type__c', dataValue('recordtype')),
    field('Testing_Event_Type__c', state => {
    const type = dataValue('form.event_information.event_type')(state);
    return type.includes('malaria') ? 'Malaria Testing Event (General Event)' : 'Other';
    }),
    field('Coordinator__c', dataValue('form.event_information.event_coordinator')),
    ),
    ...fields(...state.data.destinationCoachFields)
    })
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-Register-Participant-2021-04-28.html b/adaptors/library/jobs/auto/Upsert-Register-Participant-2021-04-28.html index 46ca741ad308..dab47cfc9174 100644 --- a/adaptors/library/jobs/auto/Upsert-Register-Participant-2021-04-28.html +++ b/adaptors/library/jobs/auto/Upsert-Register-Participant-2021-04-28.html @@ -17,15 +17,15 @@ - +
    -
    Skip to main content

    Upsert Register Participant

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataPath, dataValue, each, field, fields, lastReferenceValue, map, merge, query, relationship, upsert, Array

    Expression

    query(
    `SELECT Id, Name, CommCare_Ext_ID__c FROM Event__c WHERE CommCare_Case_ID__c = '${state.data.form.case['@case_id']}'`
    );

    fn(state => {
    // Note: lastReferenceValue selects the first item in the references array.
    state.data.eventName = lastReferenceValue('records[0].CommCare_Ext_ID__c')(state);
    state.data.eventCase = dataValue('form.case.@case_id')(state);

    function objectToArray(object) {
    return !Array.isArray(object) ? [object] : object;
    }

    const { form } = state.data;
    if (form.question1) {
    console.log('Ensuring that "question1" is an array.');
    form.question1 = objectToArray(form.question1);
    } else if (!form.new_participants) {
    console.log('Nothing to upsert. No participants were registered');
    } else {
    console.log('Shifting "new_participants" to "question1" array.');
    form.question1 = objectToArray(form.new_participants);
    console.log('Creating a "case" object inside each item in that array.');
    form.question1 = form.question1.map(item => ({
    ...item,
    case: item.create_skillz_plus_participant.case,
    }));
    }

    console.log('Done with initial data manipulation.');
    const persons = merge(
    dataPath('form.question1[*]'),
    fields(field('intervention_notes_to_save', dataValue('form.intervention_notes_to_save')))
    )(state);

    const attendances = merge(
    dataPath('form.question1[*]'),
    fields(
    field('intervention_name', dataValue('form.intervention_name')),
    field('eventCase', dataValue('eventCase')),
    field('eventName', dataValue('eventName'))
    )
    )(state);

    return { ...state, persons, attendances };
    });

    each(
    'persons[*]',
    upsert(
    'Person__c',
    'Participant_Identification_Number_PID__c',
    fields(
    field('Notes__c', dataValue('intervention_notes_to_save')),
    field('First_Name__c', dataValue('participant_first_name')),
    field('Surname__c', dataValue('participant_surname')),
    relationship('RecordType', 'Name', 'Participant'),
    relationship('Site__r', 'CommCare_Ext_ID__c', dataValue('grp_location.site_id')),
    field('Participant_Identification_Number_PID__c', state => state.data.case['@case_id']),
    field('Sex__c', dataValue('gender')),
    field('Mobile_Number_1__c', dataValue('mobile_number')), //QUESTION: In CommCare, phone doesn't look like it's saving?
    field('School_name_person__c', dataValue('school_name')),
    field('Date_of_Birth__c', dataValue('date_of_birth')),
    field('School_name_person__c', dataValue('school_name')),
    field('Physical_Address__c', dataValue('participants_home_address')),
    field('Age_1_0__c', dataValue('participants_age_to_save'))
    )
    )
    );

    each(
    'attendances[*]',
    upsert(
    'Attendance__c',
    'CommCare_Ext_ID__c',
    fields(
    field('CommCare_Ext_ID__c', state => {
    const eventid = toUTF8(`${state.data.intervention_name}` || `${state.data.eventName}`); //dataValue('intervention_name')(state) || `${state.data.eventName}`;
    const personid = state.data.case['@case_id'];
    const value = personid + '-' + eventid.replace(/\//gi, '');
    return scrubEmojis(value, '');
    }),
    relationship(
    //Attendance looks up to Persn via the case_id
    'Person_Attendance__r',
    'Participant_Identification_Number_PID__c',
    state => state.data.case['@case_id']
    ),
    relationship(
    //Attendance looks up to Event via the Event case_id
    'Event__r',
    'CommCare_Case_ID__c',
    state => `${state.data.eventCase}`
    ),
    // relationship(
    // //Attendance looks up to Event via the intervention_name
    // 'Event__r',
    // 'CommCare_Ext_ID__c',
    // state => `${state.data.intervention_name}` || `${state.data.eventName}`
    // ),
    field('Date_of_Birth__c', dataValue('date_of_birth'))
    )
    )
    );

    //First we insert Person record
    // fn(state => {
    // return upsert(
    // 'Person__c',
    // 'Participant_Identification_Number_PID__c',
    // fields(
    // field('Notes__c', dataValue('form.intervention_notes_to_save')),
    // field('First_Name__c', dataValue('form.question1.participant_first_name')),
    // field('Surname__c', dataValue('form.question1.participant_surname')),
    // relationship('RecordType', 'Name', 'Participant'),
    // field('Participant_Identification_Number_PID__c', state => state.data.case['@case_id']),
    // field('Sex__c', dataValue('form.question1.gender')),
    // //field('Age__c', dataValue('form.question1.age_in_years')), //This is a SF formula field, cannot map
    // field('Mobile_Number_1__c', dataValue('form.question1.mobile_number')),
    // field('School_name_person__c', dataValue('form.question1.school_name'))
    // )
    // )(state);
    // });

    // fn(state => {
    // //Then we upsert related Attendance records
    // return upsert(
    // 'Attendance__c',
    // 'CommCare_Ext_ID__c',
    // fields(
    // field('CommCare_Ext_ID__c', state => {
    // var eventid = dataValue('form.intervention_name')(state);
    // var personid = dataValue('form.case.@case_id')(state);
    // return personid + '-' + eventid;
    // }),
    // relationship(
    // //Attendance looks up to Persn via the case_id
    // 'Person_Attendance__r',
    // 'Participant_Identification_Number_PID__c',
    // dataValue('form.case.@case_id')
    // ),
    // relationship(
    // //Attendance looks up to Event via the intervention_name
    // 'Event__r',
    // 'Name',
    // dataValue('form.intervention_name')
    // ),
    // field('Date_of_Birth__c', dataValue('form.question1.date_of_birth'))
    // )
    // )(state);
    // });

    - +
    Skip to main content

    Upsert Register Participant

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataPath, dataValue, each, field, fields, lastReferenceValue, map, merge, query, relationship, upsert, Array

    Expression

    query(
    `SELECT Id, Name, CommCare_Ext_ID__c FROM Event__c WHERE CommCare_Case_ID__c = '${state.data.form.case['@case_id']}'`
    );

    fn(state => {
    // Note: lastReferenceValue selects the first item in the references array.
    state.data.eventName = lastReferenceValue('records[0].CommCare_Ext_ID__c')(state);
    state.data.eventCase = dataValue('form.case.@case_id')(state);

    function objectToArray(object) {
    return !Array.isArray(object) ? [object] : object;
    }

    const { form } = state.data;
    if (form.question1) {
    console.log('Ensuring that "question1" is an array.');
    form.question1 = objectToArray(form.question1);
    } else if (!form.new_participants) {
    console.log('Nothing to upsert. No participants were registered');
    } else {
    console.log('Shifting "new_participants" to "question1" array.');
    form.question1 = objectToArray(form.new_participants);
    console.log('Creating a "case" object inside each item in that array.');
    form.question1 = form.question1.map(item => ({
    ...item,
    case: item.create_skillz_plus_participant.case,
    }));
    }

    console.log('Done with initial data manipulation.');
    const persons = merge(
    dataPath('form.question1[*]'),
    fields(field('intervention_notes_to_save', dataValue('form.intervention_notes_to_save')))
    )(state);

    const attendances = merge(
    dataPath('form.question1[*]'),
    fields(
    field('intervention_name', dataValue('form.intervention_name')),
    field('eventCase', dataValue('eventCase')),
    field('eventName', dataValue('eventName'))
    )
    )(state);

    return { ...state, persons, attendances };
    });

    each(
    'persons[*]',
    upsert(
    'Person__c',
    'Participant_Identification_Number_PID__c',
    fields(
    field('Notes__c', dataValue('intervention_notes_to_save')),
    field('First_Name__c', dataValue('participant_first_name')),
    field('Surname__c', dataValue('participant_surname')),
    relationship('RecordType', 'Name', 'Participant'),
    relationship('Site__r', 'CommCare_Ext_ID__c', dataValue('grp_location.site_id')),
    field('Participant_Identification_Number_PID__c', state => state.data.case['@case_id']),
    field('Sex__c', dataValue('gender')),
    field('Mobile_Number_1__c', dataValue('mobile_number')), //QUESTION: In CommCare, phone doesn't look like it's saving?
    field('School_name_person__c', dataValue('school_name')),
    field('Date_of_Birth__c', dataValue('date_of_birth')),
    field('School_name_person__c', dataValue('school_name')),
    field('Physical_Address__c', dataValue('participants_home_address')),
    field('Age_1_0__c', dataValue('participants_age_to_save'))
    )
    )
    );

    each(
    'attendances[*]',
    upsert(
    'Attendance__c',
    'CommCare_Ext_ID__c',
    fields(
    field('CommCare_Ext_ID__c', state => {
    const eventid = toUTF8(`${state.data.intervention_name}` || `${state.data.eventName}`); //dataValue('intervention_name')(state) || `${state.data.eventName}`;
    const personid = state.data.case['@case_id'];
    const value = personid + '-' + eventid.replace(/\//gi, '');
    return scrubEmojis(value, '');
    }),
    relationship(
    //Attendance looks up to Persn via the case_id
    'Person_Attendance__r',
    'Participant_Identification_Number_PID__c',
    state => state.data.case['@case_id']
    ),
    relationship(
    //Attendance looks up to Event via the Event case_id
    'Event__r',
    'CommCare_Case_ID__c',
    state => `${state.data.eventCase}`
    ),
    // relationship(
    // //Attendance looks up to Event via the intervention_name
    // 'Event__r',
    // 'CommCare_Ext_ID__c',
    // state => `${state.data.intervention_name}` || `${state.data.eventName}`
    // ),
    field('Date_of_Birth__c', dataValue('date_of_birth'))
    )
    )
    );

    //First we insert Person record
    // fn(state => {
    // return upsert(
    // 'Person__c',
    // 'Participant_Identification_Number_PID__c',
    // fields(
    // field('Notes__c', dataValue('form.intervention_notes_to_save')),
    // field('First_Name__c', dataValue('form.question1.participant_first_name')),
    // field('Surname__c', dataValue('form.question1.participant_surname')),
    // relationship('RecordType', 'Name', 'Participant'),
    // field('Participant_Identification_Number_PID__c', state => state.data.case['@case_id']),
    // field('Sex__c', dataValue('form.question1.gender')),
    // //field('Age__c', dataValue('form.question1.age_in_years')), //This is a SF formula field, cannot map
    // field('Mobile_Number_1__c', dataValue('form.question1.mobile_number')),
    // field('School_name_person__c', dataValue('form.question1.school_name'))
    // )
    // )(state);
    // });

    // fn(state => {
    // //Then we upsert related Attendance records
    // return upsert(
    // 'Attendance__c',
    // 'CommCare_Ext_ID__c',
    // fields(
    // field('CommCare_Ext_ID__c', state => {
    // var eventid = dataValue('form.intervention_name')(state);
    // var personid = dataValue('form.case.@case_id')(state);
    // return personid + '-' + eventid;
    // }),
    // relationship(
    // //Attendance looks up to Persn via the case_id
    // 'Person_Attendance__r',
    // 'Participant_Identification_Number_PID__c',
    // dataValue('form.case.@case_id')
    // ),
    // relationship(
    // //Attendance looks up to Event via the intervention_name
    // 'Event__r',
    // 'Name',
    // dataValue('form.intervention_name')
    // ),
    // field('Date_of_Birth__c', dataValue('form.question1.date_of_birth'))
    // )
    // )(state);
    // });

    + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-Register-Participant-Skillz-2021-08-30.html b/adaptors/library/jobs/auto/Upsert-Register-Participant-Skillz-2021-08-30.html index 04b60d1dfdab..4bb579a3167d 100644 --- a/adaptors/library/jobs/auto/Upsert-Register-Participant-Skillz-2021-08-30.html +++ b/adaptors/library/jobs/auto/Upsert-Register-Participant-Skillz-2021-08-30.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Upsert Register Participant Skillz

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataPath, dataValue, each, field, fields, lastReferenceValue, map, merge, query, relationship, upsert, Array

    Expression

    query(
    `SELECT Id, Name, CommCare_Ext_ID__c FROM Event__c WHERE CommCare_Case_ID__c = '${state.data.form.case['@case_id']}'`
    );

    fn(state => {
    // Note: lastReferenceValue selects the first item in the references array.
    state.data.eventName = lastReferenceValue('records[0].CommCare_Ext_ID__c')(state);
    state.data.eventCase = dataValue('form.case.@case_id')(state);

    function objectToArray(object) {
    return !Array.isArray(object) ? [object] : object;
    }

    const { form } = state.data;
    if (form.question1) {
    console.log('Ensuring that "question1" is an array.');
    form.question1 = objectToArray(form.question1);
    } else if (!form.new_participants) {
    console.log('Nothing to upsert. No participants were registered');
    } else {
    console.log('Shifting "new_participants" to "question1" array.');
    form.question1 = objectToArray(form.new_participants);
    console.log('Creating a "case" object inside each item in that array.');
    form.question1 = form.question1.map(item => ({
    ...item,
    case: item.create_skillz_plus_participant.case,
    }));
    }

    console.log('Done with initial data manipulation.');
    const persons = merge(
    dataPath('form.question1[*]'),
    fields(field('intervention_notes_to_save', dataValue('form.intervention_notes_to_save')))
    )(state);

    const attendances = merge(
    dataPath('form.question1[*]'),
    fields(
    field('intervention_name', dataValue('form.intervention_name')),
    field('eventCase', dataValue('eventCase')),
    field('eventName', dataValue('eventName'))
    )
    )(state);

    return { ...state, persons, attendances };
    });

    each(
    'persons[*]',
    upsert(
    'Person__c',
    'Participant_Identification_Number_PID__c',
    fields(
    field('Notes__c', dataValue('intervention_notes_to_save')),
    field('First_Name__c', dataValue('participant_first_name')),
    field('Surname__c', dataValue('participant_surname')),
    relationship('RecordType', 'Name', 'Participant'),
    relationship('Site__r', 'CommCare_Ext_ID__c', dataValue('grp_location.site_id')),
    field('Participant_Identification_Number_PID__c', state => state.data.case['@case_id']),
    field('Sex__c', dataValue('gender')),
    field('Mobile_Number_1__c', dataValue('mobile_number')), //QUESTION: In CommCare, phone doesn't look like it's saving?
    field('School_name_person__c', dataValue('school_name')),
    field('Date_of_Birth__c', dataValue('date_of_birth')),
    field('School_name_person__c', dataValue('school_name')),
    field('Physical_Address__c', dataValue('participants_home_address')),
    field('Age_1_0__c', dataValue('participants_age_to_save'))
    )
    )
    );

    each(
    'attendances[*]',
    upsert(
    'Attendance__c',
    'CommCare_Ext_ID__c',
    fields(
    field('CommCare_Ext_ID__c', state => {
    const eventid = toUTF8(`${state.data.intervention_name}` || `${state.data.eventName}`); //dataValue('intervention_name')(state) || `${state.data.eventName}`;
    const personid = state.data.case['@case_id'];
    const value = personid + '-' + eventid.replace(/\//gi, '');
    return scrubEmojis(value, '');
    }),
    relationship(
    //Attendance looks up to Persn via the case_id
    'Person_Attendance__r',
    'Participant_Identification_Number_PID__c',
    state => state.data.case['@case_id']
    ),
    relationship(
    //Attendance looks up to Event via the Event case_id
    'Event__r',
    'CommCare_Case_ID__c',
    state => `${state.data.eventCase}`
    ),
    // relationship(
    // //Attendance looks up to Event via the intervention_name
    // 'Event__r',
    // 'CommCare_Ext_ID__c',
    // state => `${state.data.intervention_name}` || `${state.data.eventName}`
    // ),
    field('Date_of_Birth__c', dataValue('date_of_birth'))
    )
    )
    );

    //First we insert Person record
    // fn(state => {
    // return upsert(
    // 'Person__c',
    // 'Participant_Identification_Number_PID__c',
    // fields(
    // field('Notes__c', dataValue('form.intervention_notes_to_save')),
    // field('First_Name__c', dataValue('form.question1.participant_first_name')),
    // field('Surname__c', dataValue('form.question1.participant_surname')),
    // relationship('RecordType', 'Name', 'Participant'),
    // field('Participant_Identification_Number_PID__c', state => state.data.case['@case_id']),
    // field('Sex__c', dataValue('form.question1.gender')),
    // //field('Age__c', dataValue('form.question1.age_in_years')), //This is a SF formula field, cannot map
    // field('Mobile_Number_1__c', dataValue('form.question1.mobile_number')),
    // field('School_name_person__c', dataValue('form.question1.school_name'))
    // )
    // )(state);
    // });

    // fn(state => {
    // //Then we upsert related Attendance records
    // return upsert(
    // 'Attendance__c',
    // 'CommCare_Ext_ID__c',
    // fields(
    // field('CommCare_Ext_ID__c', state => {
    // var eventid = dataValue('form.intervention_name')(state);
    // var personid = dataValue('form.case.@case_id')(state);
    // return personid + '-' + eventid;
    // }),
    // relationship(
    // //Attendance looks up to Persn via the case_id
    // 'Person_Attendance__r',
    // 'Participant_Identification_Number_PID__c',
    // dataValue('form.case.@case_id')
    // ),
    // relationship(
    // //Attendance looks up to Event via the intervention_name
    // 'Event__r',
    // 'Name',
    // dataValue('form.intervention_name')
    // ),
    // field('Date_of_Birth__c', dataValue('form.question1.date_of_birth'))
    // )
    // )(state);
    // });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-Register-Skills-plus-Club-2021-04-30.html b/adaptors/library/jobs/auto/Upsert-Register-Skills-plus-Club-2021-04-30.html index 38a6294be1f1..73d863f9a667 100644 --- a/adaptors/library/jobs/auto/Upsert-Register-Skills-plus-Club-2021-04-30.html +++ b/adaptors/library/jobs/auto/Upsert-Register-Skills-plus-Club-2021-04-30.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Upsert Register Skills plus Club

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    alterState, dataValue, field, fields, join, map, relationship, upsert

    Expression

    // push to production
    alterState((state) => {

    function clean(str) {
    if (!!str)
    return str
    .split('_')
    .map(word => {
    let new_word = word.toString().toLowerCase();
    return new_word.slice(0, 1).toUpperCase() + new_word.slice(1);
    })
    .join(' ');
    }

    const coachFieldNames = ['Coach_A__r','Coach_B__r','Coach_C__r','Coach_D__r']

    state.data.destinationCoachFields = state.data.form.coaches
    .split(' ')
    .reduce(
    (accumulator, currentValue, currentIndex) => [
    ...accumulator,
    (currentIndex < coachFieldNames.length && !!currentValue
    ? relationship(coachFieldNames[currentIndex], 'CommCare_Ext_ID__c', currentValue)
    : []),
    ],
    []
    );

    return state;
    });



    upsert(
    'Event__c',
    'CommCare_Case_ID__c',
    state=>({
    ...fields(
    field('Name', dataValue('form.name_of_skillz_plus_club')),
    field('CommCare_Ext_ID__c', dataValue('form.name_of_skillz_plus_club')),
    field('CommCare_Case_ID__c', dataValue('form.case.@case_id')),
    relationship('RecordType', 'Name', 'Intervention'),
    relationship('Site__r', 'CommCare_Ext_ID__c', dataValue('form.skillz_plus_site')),
    relationship('Venue__r', 'CommCare_Ext_ID__c', dataValue('form.skillz_plus_venue')),
    ),
    ...fields(...state.data.destinationCoachFields)
    })
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-Risk-and-Vulnerability-Assessment-Service-Referral-2021-05-25.html b/adaptors/library/jobs/auto/Upsert-Risk-and-Vulnerability-Assessment-Service-Referral-2021-05-25.html index eae4b2c12e27..885e0885104c 100644 --- a/adaptors/library/jobs/auto/Upsert-Risk-and-Vulnerability-Assessment-Service-Referral-2021-05-25.html +++ b/adaptors/library/jobs/auto/Upsert-Risk-and-Vulnerability-Assessment-Service-Referral-2021-05-25.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Upsert Risk and Vulnerability Assessment - Service Referral

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: Upsert Risk and Vulnerability Assessment - Service Referral
    • Adaptor: @openfn/language-salesforce
    • Adaptor Version: v2.7.4
    • Created over 3 years ago
    • Updated 15 days ago
    • Score: 72 (an indicator of how useful this job may be)

    Key Functions

    alterState, dataValue, field, fields, join, map, relationship, upsertIf, Array

    Expression

    // Your job goes here.
    alterState(state => {
    function split(str, separator) {
    if (!str) {
    return [];
    } else {
    return str.toString().split(separator);
    }
    }
    function checked(key, str) {
    if (!str) return false;
    return split(str.toString(), ' ').indexOf(key) >= 0;
    }

    function capitalizeFirstLetter(str) {
    if (!str) return;
    let new_str = str.toString().toLowerCase();
    return new_str.slice(0, 1).toUpperCase() + new_str.slice(1);
    }

    function transformDont(str) {
    if (!str) return str;
    return split(str.toString(), '_')
    .map(word => word.replace(/dont/i, "don't"))
    .join('_')
    .toString()
    .trim();
    }

    function transformCant(str) {
    if (!str) return str;
    return split(str.toString(), '_')
    .map(word => word.replace(/cant/i, "can't"))
    .join('_')
    .toString()
    .trim();
    }

    function splitAndJoin(str, splitDelimiter, joinDelimiter) {
    if (!str) return;

    return split(str.toString(), splitDelimiter).join(joinDelimiter).toString().trim();
    }

    function transformHowOften(str) {
    if (!str) return;
    if (str === 'special_occasions') return 'Special Occasions';
    if (str === 'no_dont_want_to_disclose') return "Don't want to disclose";
    if (str === 'dont_want_to_disclose') return "Don't want to disclose";
    return transformGenericText(str).toString().trim();
    }

    function transformHIVStatus(status) {
    switch (status) {
    case 'yes_negative':
    return 'Yes,Negative';
    case 'yes_positive':
    return 'Yes,Positive';
    case 'no_i_dont':
    return "No,I don't know";
    case 'yes_dont_want_to_disclose':
    return "Yes, don't want to disclose";
    default:
    return;
    }
    }

    function transformLastTested(str) {
    if (!str) return;
    switch (str.toString()) {
    case 'yes_negative':
    return 'Yes,Negative';
    case 'yes_positive':
    return 'Yes,Positive';
    case 'no_i_dont':
    return "No,I don't know";
    case 'yes_dont_want_to_disclose':
    return "Yes, don't want to disclose";
    default:
    return;
    }
    }

    function transformMonthAgo(str) {
    if (!str) return;
    switch (str) {
    case 'month_ago':
    return '1 month ago';
    case 'months_ago':
    return '3 months ago';
    case 'month_ago':
    return 'copy-1-of-months_ago ';
    case 'month_ago':
    return '6 months ago';
    case 'a_year_or_more_ago':
    return 'A year or more';
    default:
    return;
    }
    }

    function transformGenericText(str) {
    if (!str) return;
    return capitalizeFirstLetter(splitAndJoin(transformDont(str), '_', ' '))
    .toString()
    .trim();
    }

    function transformRange(range) {
    if (!range) return;
    return range
    .toString()
    .replace(/\d_\d/i, match => match.replace('_', '-'))
    .toString()
    .trim();
    }

    function transformAgeRange(range) {
    if (!range) return;
    if (range === '10_years') return '< 10 years';
    if (range === 'greater_than_19') return '> 19 years';
    return capitalizeFirstLetter(transformDont(transformCant(splitAndJoin(transformRange(range), '_', ' '))))
    .toString()
    .trim();
    }

    function transformAbuseExperienced(str) {
    if (!str) return;
    return split(str, ' ')
    .map(word => capitalizeFirstLetter(word))
    .join(';')
    .toString()
    .trim();
    }

    function getAge(dateString) {
    if (!dateString) return;

    const today = new Date();
    const birthDate = new Date(dateString);
    var age = today.getFullYear() - birthDate.getFullYear();
    var m = today.getMonth() - birthDate.getMonth();
    if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) {
    age--;
    }
    return age;
    }

    state.data.perform_a_risk_assessment = state.data.form.do_you_want_to_perform_a_risk_assessment === 'yes';

    state.data.complete_service_referrals = state.data.form.referral_services ? true : false;

    state.data.form.client_information.gender = capitalizeFirstLetter(state.data.form.client_information.gender);

    state.helperFunctions = {
    split,
    checked,
    transformAgeRange,
    transformHIVStatus,
    transformLastTested,
    transformMonthAgo,
    transformGenericText,
    transformDont,
    splitAndJoin,
    transformHowOften,
    transformAbuseExperienced,
    getAge,
    };
    return state;
    });

    upsertIf(
    dataValue('perform_a_risk_assessment'),
    'Risk_Assessment__c',
    'CommCare_Ext_ID__c',
    fields(
    field('CommCare_Ext_ID__c', dataValue('id')),
    field('Date__c', dataValue('form.risk_assessment.date')),
    field('Participant_Name__c', dataValue('form.client_information.participant_full_name')),
    field('Participant_Age__c', state => {
    const dob = dataValue('form.client_information.date_of_birth')(state);

    return state.helperFunctions.getAge(dob);
    }),
    relationship('Site2__r', 'CommCare_Ext_ID__c', dataValue('form.client_information.site')),
    relationship('EventLink__r', 'CommCare_Ext_ID__c', dataValue('form.client_information.intervention_name')),
    relationship('Venue__r', 'CommCare_Ext_ID__c', dataValue('form.client_information.venue')),

    field('Participant_Sex__c', dataValue('form.client_information.gender')),
    field('X1_0_Sexually_Active_past_12_month__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.risk_assessment.sexual_risk_and_pregnancy.sexually_active_12_months')(state)
    )
    ),
    field('X1_1_Age_at_first_sex__c', state =>
    state.helperFunctions.transformAgeRange(
    dataValue('form.risk_assessment.sexual_risk_and_pregnancy.age_at_first_sex')(state)
    )
    ),
    field('X1_2_Have_you_ever_had_unprotected_sex__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.risk_assessment.sexual_risk_and_pregnancy.have_you_ever_had_unprotected_sex')(state)
    )
    ),
    field('X1_3_Sex_for_monetary_or_material_benefi__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.risk_assessment.sexual_risk_and_pregnancy.sex_monetary_material')(state)
    )
    ),
    field('Do_you_know_your_HIV_status__c', state =>
    state.helperFunctions.transformHIVStatus(
    dataValue('form.risk_assessment.hiv_status.do_you_know_your_hiv_status')(state)
    )
    ),
    field('X2_1_When_last_did_you_test_for_HIV__c', state =>
    state.helperFunctions.transformMonthAgo(
    dataValue('form.risk_assessment.hiv_status.when_last_did_you_test_for_hiv')(state)
    )
    ),
    field('X2_2_Are_you_on_treatment_ART__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.risk_assessment.hiv_status.are_you_on_treatment_art')(state)
    )
    ),
    field('X3_0_Had_an_STI_in_the_last_12months_yea__c', state =>
    state.helperFunctions.transformHowOften(dataValue('form.risk_assessment.sti_and_pep.hiv_last_12_months')(state))
    ),
    field('X3_1_Past_12_months_sex_HIV_status_part__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.risk_assessment.sti_and_pep.knowing_partners_hiv_status')(state)
    )
    ),
    field('X4_0_Forms_of_abuse_experienced_before__c', state => {
    const abusesArray = state.helperFunctions.split(
    dataValue('form.risk_assessment.gender_based_violence.abuse_experienced')(state),
    ' '
    );
    const abuses = [];
    abusesArray.forEach(ab => {
    abuses.push(state.helperFunctions.transformGenericText(ab));
    });
    return abuses.join(';');
    }),
    field('X4_1_Feel_unsafe_any1_interact_with_ofte__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.risk_assessment.gender_based_violence.unsafe_with_others')(state)
    )
    ),
    field('X4_2_Of_what_relationship_person_to_you__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.risk_assessment.gender_based_violence.relationship_of_abuser')(state)
    )
    ),
    field('X5_0_Do_you_take_alcohol_or_drugs__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.risk_assessment.drugs_and_alcohol_use.do_you_take_alcohol_andor_drugs')(state)
    )
    ),
    field('X5_1_On_average_how_often_drink_alcohol__c', state =>
    state.helperFunctions.transformHowOften(
    dataValue('form.risk_assessment.drugs_and_alcohol_use.how_often_alcohol')(state)
    )
    ),
    field('X5_2_On_average_how_often_take_drugs__c', state =>
    state.helperFunctions.transformHowOften(
    dataValue('form.risk_assessment.drugs_and_alcohol_use.how_often_drugs')(state)
    )
    ),
    field('X5_3_Easy_for_teens_to_obtain_alcohol__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.risk_assessment.drugs_and_alcohol_use.alcohol_19')(state)
    )
    ),
    field('X5_4__c', state =>
    state.helperFunctions.transformGenericText(
    dataValue('form.risk_assessment.drugs_and_alcohol_use.illegal_drugs_19')(state)
    )
    )
    )
    );

    fn(state => {
    state.data.intervention_name = state.data.form.client_information.intervention_name
    ? [relationship('Event__r', 'CommCare_Ext_ID__c', dataValue('form.client_information.intervention_name'))]
    : [];

    return state;
    });

    upsertIf(dataValue('complete_service_referrals'), 'NewReferral__c', 'CommCare_Ext_ID__c', state => ({
    ...fields(
    field('CommCare_Ext_ID__c', state => {
    if (state.data.form.subcase_0.case) return state.data.form.subcase_0.case['@case_id'];
    else if (state.data.form.referral_services) {
    if (state.data.form.referral_services.art_support_services.skillz_plus_club_details)
    return state.data.form.referral_services.art_support_services.skillz_plus_club_details
    .create_skillz_plus_club_participant_case.case['@case_id'];
    }
    return undefined;
    }),
    field('Participants_Full_Name__c', dataValue('form.client_information.participant_full_name')),
    field('Service_Provider_Name__c', dataValue('form.client_information.coach_name')),
    field('Parent_Guardian_Full_Name__c', dataValue('form.parent__guardian_information.parent__guardian_full_name')),
    field('Relationship__c', dataValue('form.parent__guardian_information.relationship_to_client')),
    //field('', dataValue('form.parent__guardian_information.please_specify')),
    field('Parent_Guardian_Contact_Number__c', dataValue('form.parent__guardian_information.contact_number')),
    //field('', dataValue('form.parent__guardian_information.guardian_consent')),
    field('Institution_Referred_To_1__c', dataValue('form.referral_information.institution_referred_to')),
    field('Institution_Referred_To_2__c', dataValue('form.referral_information.copy-1-of-institution_referred_to')),
    field('Institution_Referred_To_3__c', dataValue('form.referral_information.copy-2-of-institution_referred_to')),
    field('HIV_Testing_Services_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'hiv_testing_services',
    dataValue('form.referral_services.hiv_support__care.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('HIV_Other__c', dataValue('form.referral_services.hiv_support__care.please_specify')),
    field('ART_Initiation_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'art_initiationenrollment',
    dataValue('form.referral_services.art_support_services.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('SKILLZ_Plus_Club_Support_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'grs_skillz_plus_club',
    dataValue('form.referral_services.art_support_services.skillz_plus_club_option')(state)
    )
    ),
    field('PMTCT_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'pmtct',
    dataValue('form.referral_services.art_support_services.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('VMMC_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'vmmc',
    dataValue('form.referral_services.hiv_support__care.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('TB_Screening_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'tb_screening_treatment_adherence',
    dataValue('form.referral_services.hiv_support__care.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('Legal_Other__c', dataValue('form.referral_services.legal_services.please_specify_other_legal')),
    field('Post_Exposure_Prophylaxis_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'post_exposure_prophylaxis',
    dataValue('form.referral_services.hiv_support__care.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('PrEP_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'prep',
    dataValue('form.referral_services.hiv_support__care.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('HIV_STI_PREVENTION_Other_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'other',
    dataValue('form.referral_services.hiv_support__care.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('HIV_Other__c', dataValue('form.referral_services.hiv_support__care.please_specify')),
    field(
    'Victim_Friendly_Services_GRS_Staff__c',
    state =>
    state.helperFunctions.checked(
    'suspected_abuse_reported_police_court_other_authority',
    dataValue(
    'form.referral_services.child_protection_support_services.check_the_services_that_client_was_referred_to'
    )(state)
    ) ||
    state.helperFunctions.checked(
    'post_violence_care_medical_legal_counseling',
    dataValue(
    'form.referral_services.child_protection_support_services.check_the_services_that_client_was_referred_to'
    )(state)
    ) ||
    state.helperFunctions.checked(
    'child_support_grant_social_foster_general_support',
    dataValue(
    'form.referral_services.child_protection_support_services.check_the_services_that_client_was_referred_to'
    )(state)
    ) ||
    state.helperFunctions.checked(
    'other',
    dataValue(
    'form.referral_services.child_protection_support_services.check_the_services_that_client_was_referred_to'
    )(state)
    )
    ),

    field('Sexual_and_GBV_Abuse_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'sexual__gender-based_violenceabus',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(state)
    )
    ),

    // field('missing in SF', dataValue('form.referral_services.child_protection_support_services.type_of_post_violence_care')),
    // field('missing in SF', dataValue('form.referral_services.child_protection_support_services.child_support_grant_for')),
    field(
    'Legal_Services_Other_GRS_Staff__c',
    state =>
    state.helperFunctions.checked(
    'other',
    dataValue('form.referral_services.legal_services.legal_services')(state)
    ) ||
    state.helperFunctions.checked('id', dataValue('form.referral_services.legal_services.legal_services')(state)) ||
    state.helperFunctions.checked(
    'birth_bertificate',
    dataValue('form.referral_services.legal_services.legal_services')(state)
    )
    ),
    field('Legal_Other__c', dataValue('form.referral_services.legal_services.please_specify_other_legal')),
    field('IPTG_Health_Facility__c', state =>
    state.helperFunctions.checked(
    'iptg_to_health_facility',
    dataValue('form.referral_services.mental_health_services.mental_health_select_services')
    )
    ),
    field('IPTG_Specialized_to_SMZ__c', state =>
    state.helperFunctions.checked(
    'iptg_specialised_to_smz',
    dataValue('form.referral_services.mental_health_services.mental_health_select_services')
    )
    ),
    field('STI_Screen_Testing_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'sti_screening_diagnosis_treatment',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('Contraception_Family_Plan_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'contraceptivesfamily_planning',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('Cervical_Cancer_Screening_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'cervical_cancer_screening',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('HPV_vaccine_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'hpv',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('Antenatal_Care_ANC_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'antenatal_care_anc',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(state)
    )
    ),

    field(
    'Psycho_Social_Support_GRS_Staff__c',
    state =>
    state.helperFunctions.checked(
    'drug_or_alcohol_abuse',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(state)
    ) ||
    state.helperFunctions.checked(
    'psychiatric_careintensive_counseling',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(state)
    ) ||
    state.helperFunctions.checked(
    'psychosocial_support',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('Psycho_Social_Services_Other_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'other',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('Psycho_Other__c', dataValue('form.referral_services.other_srhr_services.please_specify_srhr_referred')),

    field('Date_Referred__c', dataValue('form.follow-up.date_referred')),
    field('Expected_Visit_Date__c', dataValue('form.follow-up.expected_visit_date')),
    field('Client_Follow_up_Consent_given__c', state =>
    state.helperFunctions.checked('client_follow-up_consent_given', dataValue('form.follow-up.select')(state))
    ),
    field('Client_Linked_to_care__c', state =>
    state.helperFunctions.checked('client_linked_to_care', dataValue('form.follow-up.select')(state))
    ),

    field('Business_Unit_Site__c', state => {
    const bu = dataValue('form.client_information.business_unit')(state);
    return bu === '65680f0c4c144b03ad0f86bdc46c1ebc'
    ? 'GRS Zambia'
    : bu === '04d98397e28046118fade28ced6b65cb'
    ? 'GRS Zimbabwe'
    : bu === 'ed125ab19ec34aacab79585e59eb76f4'
    ? 'GRS Partnerships'
    : undefined;
    })
    ),
    ...fields(...state.data.intervention_name),
    }));

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-Service-Referral-2-2021-06-14.html b/adaptors/library/jobs/auto/Upsert-Service-Referral-2-2021-06-14.html index 61d4cea69f8e..e21bc63ba9b1 100644 --- a/adaptors/library/jobs/auto/Upsert-Service-Referral-2-2021-06-14.html +++ b/adaptors/library/jobs/auto/Upsert-Service-Referral-2-2021-06-14.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Upsert Service Referral 2

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    alterState, dataValue, field, fields, upsert

    Expression

    // push to production
    alterState(state => {
    state.data.external_commcare_id = (
    dataValue('form.hidden_properties.intervention_name')(state) +
    dataValue('form.hidden_properties.participant_first_name')(state) +
    dataValue('form.hidden_properties.participant_surname')(state)
    )
    .toString()
    .toLowerCase()
    .replace(/\s/g, '')
    .trim();

    return state;
    });

    upsert(
    'NewReferral__c',
    'CommCare_Ext_ID__c',
    fields(
    field('Business_Unit_Site__c', state => {
    const bu = dataValue('form.business_unit')(state);
    return bu === 'X' ? 'GRS Zambia' : bu;
    }),
    field('CommCare_Ext_ID__c', dataValue('form.case.@case_id')),
    field('HIV_Testing_Services_Service_Provider__c', state =>
    Boolean(
    dataValue('form.referral_services.hiv_support__care.check_services_label.hiv_support_care_option1')(state)
    )
    ),
    field('TB_Screening_Service_Provider__c', state =>
    Boolean(
    dataValue('form.referral_services.hiv_support__care.check_services_label.hiv_support_care_option2')(state)
    )
    ),
    field('VMMC_Service_Provider__c', state =>
    Boolean(
    dataValue('form.referral_services.hiv_support__care.check_services_label.hiv_support_care_option3')(state)
    )
    ),
    field('Post_Exposure_Prophylaxis_Service_Provid__c', state =>
    Boolean(
    dataValue(
    'form.referral_services.hiv_support__care.check_services_label.hiv_support_care_option4'
    )(state)
    )
    ),
    field('PrEP_Service_Provider__c', state =>
    Boolean(
    dataValue(
    'form.referral_services.hiv_support__care.check_services_label.hiv_support_care_option5'
    )(state)
    )
    ),
    field('HIV_STI_PREVENTION_Other_Service_Provid__c', state =>
    Boolean(
    dataValue(
    'form.referral_services.hiv_support__care.check_services_label.hiv_support_care_option6'
    )(state)
    )
    ),
    field('ART_Initiation_Service_Provider__c', state =>
    Boolean(
    dataValue('form.referral_services.art_support_services.art_services_group.art_services_option1')(
    state
    )
    )
    ),
    field('SKILLZ_Plus_Club_Support_Service_Provid__c', state =>
    Boolean(
    dataValue('form.referral_services.art_support_services.art_services_group.art_services_option2')(
    state
    )
    )
    ),

    field(
    'PMTCT_Service_Provider__c',
    state =>
    Boolean(
    dataValue('form.referral_services.art_support_services.art_services_group.art_services_option3')(
    state
    )
    )
    ),
    field('IPTG_Health_Facility__c', state =>
    Boolean(
    dataValue('form.referral_services.mental_health_services.confirmation_of_services_provided_label.mental_health_select_services_option1')(
    state
    )
    )
    ),
    field('IPTG_Specialized_to_SMZ__c', state =>
    Boolean(
    dataValue('form.referral_services.mental_health_services.confirmation_of_services_provided_label.mental_health_select_services_option2')(
    state
    )
    )
    ),

    field('ART_Services_Other_Service_Provider__c', state =>
    Boolean(
    dataValue('form.referral_services.art_support_services.referred_art_support_services')(state)
    )
    ),
    field(
    'Victim_Friendly_Services_Service_Provide__c',
    state =>
    Boolean(
    dataValue(
    'form.referral_services.child_protection_support_services.copy-1-of-check_the_services_that_were_provided.child_protection_option1'
    )(state)
    ) ||
    Boolean(
    dataValue(
    'form.referral_services.child_protection_support_services.copy-1-of-check_the_services_that_were_provided.child_protection_option2'
    )(state)
    ) ||
    Boolean(
    dataValue(
    'form.referral_services.child_protection_support_services.copy-1-of-check_the_services_that_were_provided.child_protection_option3'
    )(state)
    )
    ),
    field('Legal_Services_Other_Service_Provider__c', state =>
    Boolean(
    dataValue(
    'form.referral_services.other_legal_services.confirmation_of_services_provided_label.legal_services_option3'
    )(state)
    )
    ),

    field('STI_Screen_Testing_Service_Provider__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option1')(state))
    ),

    field('Contraception_Family_Plan_Servi_Provider__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option2')(state))
    ),
    field('Cervical_Cancer_Screen_Servi_Provider__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option3')(state))
    ),
    field('HPV_vaccine_Service_Provider__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option4')(state))
    ),
    field('Antenatal_Care_ANC_Service_Provider__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option5')(state))
    ),
    field('Sexual_and_GBV_Abuse_Servi_Provider__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option6')(state))
    ),
    field(
    'Psycho_Social_Support_Service_Provider__c',
    state =>
    Boolean(
    dataValue(
    'form.referral_services.other_srhr_services.service_label.srhr_option9'
    )(state)
    ) ||
    Boolean(
    dataValue(
    'form.referral_services.other_srhr_services.service_label.srhr_option8'
    )(state)
    ) ||
    Boolean(
    dataValue(
    'form.referral_services.other_srhr_services.service_label.srhr_option7'
    )(state)
    )
    ),
    field('Psycho_Social_Services_Other_Service_Pro__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option10')(state))
    ),
    field(
    'Legal_Services_Other_Service_Provider__c',
    state =>
    Boolean(
    dataValue('form.referral_services.other_legal_services.confirmation_of_services_provided_label.legal_referral_services')(state)
    ) ||
    Boolean(
    dataValue('form.referral_services.other_legal_services.confirmation_of_services_provided_label.legal_services_option1')(state)
    ) ||
    Boolean(
    dataValue('form.referral_services.other_legal_services.confirmation_of_services_provided_label.legal_services_option2')(state)
    )
    ),

    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-Service-Referral-2021-04-30.html b/adaptors/library/jobs/auto/Upsert-Service-Referral-2021-04-30.html index 8a77cd9777cc..3e3e8dbe828d 100644 --- a/adaptors/library/jobs/auto/Upsert-Service-Referral-2021-04-30.html +++ b/adaptors/library/jobs/auto/Upsert-Service-Referral-2021-04-30.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Upsert Service Referral

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    alterState, dataValue, field, fields, relationship, upsert

    Expression

    alterState(state => {
    function checked(key, str) {
    if (!str) return false;
    return str.split(' ').indexOf(key) >= 0;
    }

    state.helperFunctions = { checked };

    function capitalizeFirstLetter(str) {
    if (!str) return;
    let new_str = str.toString().toLowerCase();
    return new_str.slice(0, 1).toUpperCase() + new_str.slice(1);
    }

    function transform(value) {
    if (!value) return;
    switch (value.toString().trim()) {
    case 'Daughterson':
    return 'Daughter/Son';
    case 'Other_specify':
    return 'Other';
    case 'Single_never_married':
    return 'Single/Never Married';
    case 'Divorced__separated':
    return 'Divorced/separated';
    default:
    return value;
    }
    }

    state.data.form.parent__guardian_information.relationship_to_client = transform(
    capitalizeFirstLetter(state.data.form.parent__guardian_information.relationship_to_client)
    );

    return state;
    });

    alterState(state => {
    if (!state.data.form.subcase_0) {
    console.log('No referral services to upsert');
    return state;
    }
    return upsert(
    'NewReferral__c',
    'CommCare_Ext_ID__c',
    fields(
    // field('Enter_Partner_s_Name__c', dataValue('form.referral_information.institution_referred_to')),
    // field('Type_of_Referral__c', dataValue('form.referral_information.type_of_referral')),
    field('Participants_Full_Name__c', dataValue('form.client_registration.participant_full_name')),
    //field('Parent_Guardian_Contact_Number__c', dataValue('form.client_registration.mobile_number')),
    relationship('Event__r', 'CommCare_Case_ID__c', dataValue('form.event_name')),
    field('CommCare_Ext_ID__c', state => {
    var subid = state.data.form.subcase_0;
    return subid && subid !== '' ? state.data.form.subcase_0.case['@case_id'] : dataValue('id')(state); //Set external id to 'service' subcase if available, otherwise use formid
    }),
    //field('Venue__c', dataValue('form.client_registration.school_name')),
    //field('Grade__c', dataValue('form.client_registration.grade')),
    //field('Class__c', dataValue('form.client_registration.class')),
    field('Parent_Guardian_Full_Name__c', dataValue('form.parent__guardian_information.parent__guardian_full_name')),
    field('Relationship_To_Client__c', dataValue('form.parent__guardian_information.relationship_to_client')),
    field('Parent_Guardian_Contact_Number__c', dataValue('form.parent__guardian_information.contact_number')),
    field('Institution_Referred_To_1__c', dataValue('form.referral_information.institution_referred_to')),
    field('Institution_Referred_To_2__c', dataValue('form.referral_information.copy-1-of-institution_referred_to')),
    field('Institution_Referred_To_3__c', dataValue('form.referral_information.copy-2-of-institution_referred_to')),
    field('Service_Provider_Name__c', dataValue('form.hidden_props.coach_name')),
    field('HIV_Testing_Services_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'hiv_testing_services',
    dataValue('form.referral_services.hiv_support__care.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('VMMC_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'vmmc',
    dataValue('form.referral_services.hiv_support__care.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('TB_Screening_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'tb_screening_treatment_adherence',
    dataValue('form.referral_services.hiv_support__care.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('Post_Exposure_Prophylaxis_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'post_exposure_prophylaxis',
    dataValue('form.referral_services.hiv_support__care.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('PrEP_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'prep',
    dataValue('form.referral_services.hiv_support__care.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('HIV_STI_PREVENTION_Other_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'other',
    dataValue('form.referral_services.hiv_support__care.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('HIV_Other__c', dataValue('form.referral_services.hiv_support__care.please_specify')),
    field('ART_Initiation_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'art_initiationenrollment',
    dataValue('form.referral_services.art_support_services.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('PMTCT_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'pmtct',
    dataValue('form.referral_services.art_support_services.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('SKILLZ_Plus_Club_Support_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'grs_skillz_plus_club',
    dataValue('form.referral_services.art_support_services.skillz_plus_club_option')(state)
    )
    ),
    field(
    'Victim_Friendly_Services_GRS_Staff__c',
    state =>
    state.helperFunctions.checked(
    'suspected_abuse_reported_police_court_other_authority',
    dataValue(
    'form.referral_services.child_protection_support_services.check_the_services_that_client_was_referred_to'
    )(state)
    ) ||
    state.helperFunctions.checked(
    'post_violence_care_medical_legal_counseling',
    dataValue(
    'form.referral_services.child_protection_support_services.check_the_services_that_client_was_referred_to'
    )(state)
    ) ||
    state.helperFunctions.checked(
    'child_support_grant_social_foster_general_support',
    dataValue(
    'form.referral_services.child_protection_support_services.check_the_services_that_client_was_referred_to'
    )(state)
    ) ||
    state.helperFunctions.checked(
    'other',
    dataValue(
    'form.referral_services.child_protection_support_services.check_the_services_that_client_was_referred_to'
    )(state)
    )
    ),
    field('Business_Unit_Site__c', state => {
    const bu = dataValue('form.business_unit')(state);
    return bu === '65680f0c4c144b03ad0f86bdc46c1ebc'
    ? 'GRS Zambia'
    : bu === '04d98397e28046118fade28ced6b65cb'
    ? 'GRS Zimbabwe'
    : bu === 'ed125ab19ec34aacab79585e59eb76f4'
    ? 'GRS Partnerships'
    : undefined;
    }),
    field(
    'Sexual_and_GBV_Abuse_GRS_Staff__c',
    dataValue('form.referral_services.child_protection_support_services.abuse_reported_to')
    ),

    field('Legal_Other__c', dataValue('form.referral_services.legal_services.please_specify_other_legal')),
    field(
    'Legal_Services_Other_GRS_Staff__c',
    state =>
    state.helperFunctions.checked(
    'other',
    dataValue('form.referral_services.legal_services.legal_services')(state)
    ) ||
    state.helperFunctions.checked(
    'id',
    dataValue('form.referral_services.legal_services.legal_services')(state)
    ) ||
    state.helperFunctions.checked(
    'birth_bertificate',
    dataValue('form.referral_services.legal_services.legal_services')(state)
    )
    ),
    field('STI_Screen_Testing_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'sti_screening_diagnosis_treatment',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('Contraception_Family_Plan_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'contraceptivesfamily_planning',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('Cervical_Cancer_Screening_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'cervical_cancer_screening',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('HPV_vaccine_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'hpv',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('Antenatal_Care_ANC_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'antenatal_care_anc',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('Sexual_and_GBV_Abuse_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'based_violenceabus',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field(
    'Psycho_Social_Support_GRS_Staff__c',
    state =>
    state.helperFunctions.checked(
    'drug_or_alcohol_abuse',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(
    state
    )
    ) ||
    state.helperFunctions.checked(
    'psychiatric_careintensive_counseling',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(
    state
    )
    ) ||
    state.helperFunctions.checked(
    'psychosocial_support',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(
    state
    )
    )
    ),
    field('Psycho_Social_Services_Other_GRS_Staff__c', state =>
    state.helperFunctions.checked(
    'other',
    dataValue('form.referral_services.other_srhr_services.check_the_services_that_client_was_referred_to')(state)
    )
    ),
    field('Psycho_Other__c', dataValue('form.referral_services.other_srhr_services.please_specify_srhr_referred')),
    field('Date_Referred__c', dataValue('form.follow-up.date_referred')),
    field('Expected_Visit_Date__c', dataValue('form.follow-up.expected_visit_date')),
    field('Client_Follow_up_Consent_given__c', state =>
    state.helperFunctions.checked('client_follow-up_consent_given', dataValue('form.follow-up.select')(state))
    ),
    field('Client_Linked_to_care__c', state =>
    state.helperFunctions.checked('client_linked_to_care', dataValue('form.follow-up.select')(state))
    )
    )
    )(state);
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-Service-Referral-Followup-2021-04-30.html b/adaptors/library/jobs/auto/Upsert-Service-Referral-Followup-2021-04-30.html index 497b242ce791..7fb5fce76ffa 100644 --- a/adaptors/library/jobs/auto/Upsert-Service-Referral-Followup-2021-04-30.html +++ b/adaptors/library/jobs/auto/Upsert-Service-Referral-Followup-2021-04-30.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Upsert Service Referral Followup

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    alterState, dataValue, field, fields, upsert

    Expression

    // push to production
    alterState(state => {
    state.data.external_commcare_id = (
    dataValue('form.hidden_properties.intervention_name')(state) +
    dataValue('form.hidden_properties.participant_first_name')(state) +
    dataValue('form.hidden_properties.participant_surname')(state)
    )
    .toString()
    .toLowerCase()
    .replace(/\s/g, '')
    .trim();

    return state;
    });

    upsert(
    'NewReferral__c',
    'CommCare_Ext_ID__c',
    fields(
    field('Business_Unit_Site__c', state => {
    const bu = dataValue('form.business_unit')(state);
    return bu === 'X' ? 'GRS Zambia' : bu;
    }),
    field('CommCare_Ext_ID__c', dataValue('form.case.@case_id')),
    field('HIV_Testing_Services_Service_Provider__c', state =>
    Boolean(
    dataValue('form.referral_services.hiv_support__care.check_services_label.hiv_support_care_option1')(state)
    )
    ),
    field('TB_Screening_Service_Provider__c', state =>
    Boolean(
    dataValue('form.referral_services.hiv_support__care.check_services_label.hiv_support_care_option2')(state)
    )
    ),
    field('VMMC_Service_Provider__c', state =>
    Boolean(
    dataValue('form.referral_services.hiv_support__care.check_services_label.hiv_support_care_option3')(state)
    )
    ),
    field('Post_Exposure_Prophylaxis_Service_Provid__c', state =>
    Boolean(
    dataValue(
    'form.referral_services.hiv_support__care.check_services_label.hiv_support_care_option4'
    )(state)
    )
    ),
    field('PrEP_Service_Provider__c', state =>
    Boolean(
    dataValue(
    'form.referral_services.hiv_support__care.check_services_label.hiv_support_care_option5'
    )(state)
    )
    ),
    field('HIV_STI_PREVENTION_Other_Service_Provid__c', state =>
    Boolean(
    dataValue(
    'form.referral_services.hiv_support__care.check_services_label.hiv_support_care_option6'
    )(state)
    )
    ),
    field('ART_Initiation_Service_Provider__c', state =>
    Boolean(
    dataValue('form.referral_services.art_support_services.art_services_group.art_services_option1')(
    state
    )
    )
    ),
    field('SKILLZ_Plus_Club_Support_Service_Provid__c', state =>
    Boolean(
    dataValue('form.referral_services.art_support_services.art_services_group.art_services_option2')(
    state
    )
    )
    ),

    field(
    'PMTCT_Service_Provider__c',
    state =>
    Boolean(
    dataValue('form.referral_services.art_support_services.art_services_group.art_services_option3')(
    state
    )
    )
    ),
    field('IPTG_Health_Facility__c', state =>
    Boolean(
    dataValue('form.referral_services.mental_health_services.confirmation_of_services_provided_label.mental_health_select_services_option1')(
    state
    )
    )
    ),
    field('IPTG_Specialized_to_SMZ__c', state =>
    Boolean(
    dataValue('form.referral_services.mental_health_services.confirmation_of_services_provided_label.mental_health_select_services_option2')(
    state
    )
    )
    ),

    field('ART_Services_Other_Service_Provider__c', state =>
    Boolean(
    dataValue('form.referral_services.art_support_services.referred_art_support_services')(state)
    )
    ),
    field(
    'Victim_Friendly_Services_Service_Provide__c',
    state =>
    Boolean(
    dataValue(
    'form.referral_services.child_protection_support_services.copy-1-of-check_the_services_that_were_provided.child_protection_option1'
    )(state)
    ) ||
    Boolean(
    dataValue(
    'form.referral_services.child_protection_support_services.copy-1-of-check_the_services_that_were_provided.child_protection_option2'
    )(state)
    ) ||
    Boolean(
    dataValue(
    'form.referral_services.child_protection_support_services.copy-1-of-check_the_services_that_were_provided.child_protection_option3'
    )(state)
    )
    ),
    field('Legal_Services_Other_Service_Provider__c', state =>
    Boolean(
    dataValue(
    'form.referral_services.other_legal_services.confirmation_of_services_provided_label.legal_services_option3'
    )(state)
    )
    ),

    field('STI_Screen_Testing_Service_Provider__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option1')(state))
    ),

    field('Contraception_Family_Plan_Servi_Provider__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option2')(state))
    ),
    field('Cervical_Cancer_Screen_Servi_Provider__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option3')(state))
    ),
    field('HPV_vaccine_Service_Provider__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option4')(state))
    ),
    field('Antenatal_Care_ANC_Service_Provider__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option5')(state))
    ),
    field('Sexual_and_GBV_Abuse_Servi_Provider__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option6')(state))
    ),
    field(
    'Psycho_Social_Support_Service_Provider__c',
    state =>
    Boolean(
    dataValue(
    'form.referral_services.other_srhr_services.service_label.srhr_option9'
    )(state)
    ) ||
    Boolean(
    dataValue(
    'form.referral_services.other_srhr_services.service_label.srhr_option8'
    )(state)
    ) ||
    Boolean(
    dataValue(
    'form.referral_services.other_srhr_services.service_label.srhr_option7'
    )(state)
    )
    ),
    field('Psycho_Social_Services_Other_Service_Pro__c', state =>
    Boolean(dataValue('form.referral_services.other_srhr_services.service_label.srhr_option10')(state))
    ),
    field(
    'Legal_Services_Other_Service_Provider__c',
    state =>
    Boolean(
    dataValue('form.referral_services.other_legal_services.confirmation_of_services_provided_label.legal_referral_services')(state)
    ) ||
    Boolean(
    dataValue('form.referral_services.other_legal_services.confirmation_of_services_provided_label.legal_services_option1')(state)
    ) ||
    Boolean(
    dataValue('form.referral_services.other_legal_services.confirmation_of_services_provided_label.legal_services_option2')(state)
    )
    ),

    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-Team-or-Group-Name-2021-04-28.html b/adaptors/library/jobs/auto/Upsert-Team-or-Group-Name-2021-04-28.html index 7d5d4f91f589..c6c1956dff91 100644 --- a/adaptors/library/jobs/auto/Upsert-Team-or-Group-Name-2021-04-28.html +++ b/adaptors/library/jobs/auto/Upsert-Team-or-Group-Name-2021-04-28.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Upsert Team or Group Name

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataValue, field, fields, relationship, upsert

    Expression

    // Upsert event by unique 'Name'
    upsert(
    'Event__c',
    'CommCare_Case_ID__c',
    fields(
    field(
    'Class_Group_Team__c',
    dataValue('form.question_group.group__team_name')
    ),
    relationship('RecordType', 'Name', 'Intervention'),
    field(
    'CommCare_Case_ID__c',
    dataValue('form.case.@case_id')
    ),
    )
    );
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-User-in-Salesforce-2021-04-16.html b/adaptors/library/jobs/auto/Upsert-User-in-Salesforce-2021-04-16.html index e74d459bdcbc..ad55d96784f9 100644 --- a/adaptors/library/jobs/auto/Upsert-User-in-Salesforce-2021-04-16.html +++ b/adaptors/library/jobs/auto/Upsert-User-in-Salesforce-2021-04-16.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Upsert User in Salesforce

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    dataPath, dataValue, each, field, fields, upsert

    Expression

    //Example job to upsert Users in Salesforce
    each('$.users[*]',
    dataPath('state.data.users'),
    upsert('User', 'Email', fields(
    field('Email', dataValue('email')),
    field('FirstName', dataValue('firstName')),
    field('LastName', dataValue('surname')),
    field('Active', 'true')
    ))
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/Upsert-to-mBrana-2021-05-11.html b/adaptors/library/jobs/auto/Upsert-to-mBrana-2021-05-11.html index cf538d524360..49f51ab82dc2 100644 --- a/adaptors/library/jobs/auto/Upsert-to-mBrana-2021-05-11.html +++ b/adaptors/library/jobs/auto/Upsert-to-mBrana-2021-05-11.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/WF1-1-Bulk-get-HH-cases-2023-05-19.html b/adaptors/library/jobs/auto/WF1-1-Bulk-get-HH-cases-2023-05-19.html index f11bd7c7f8e9..ab2fa16745b5 100644 --- a/adaptors/library/jobs/auto/WF1-1-Bulk-get-HH-cases-2023-05-19.html +++ b/adaptors/library/jobs/auto/WF1-1-Bulk-get-HH-cases-2023-05-19.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    WF1-1 Bulk get HH cases

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    each, get, map

    Expression

    fn(state => {
    const { baseUrl } = state.configuration;

    const caseTypes = ['Household'];

    //NOTE: You can use 'limit' to modify this batch size as desired
    const limit = 1000;

    //NOTE: indexedOnStart is the default sync start data the FIRST time the job runs
    const indexedOnStart = '2024-04-26T10:00:00';

    //NOTE: After first job run, OpenFn will check the job sync data ("lastRunAt") to set as the indexedOnStart
    const lastRunAt =
    typeof state.lastRunAt !== 'undefined' ? state.lastRunAt : indexedOnStart;
    console.log('Filtering cases with indexed_on_start > than ::', lastRunAt);
    //May 31st, 2023 at 3:00:13 PM.
    const queries = caseTypes.map(
    t => `?type=${t}&indexed_on_start=${lastRunAt}&limit=${limit}`
    //NOTE: If for testing, you want to fetch data for a specific historical range (e.g., between April 23 and 24)...
    //...then use the query string below instead of the one above on L16, and custom adjust the index_on start/end dates
    //t => `?type=${t}&indexed_on_start=2023-03-03T00:00:00&limit=${limit}&indexed_on_end=2023-03-06T00:00:00` //returns 14 records
    //t => `?type=${t}&indexed_on_start=2024-04-26T10:00:00&limit=${limit}&indexed_on_end=2024-01-16T23:59:59`
    );

    return { ...state, queries, baseUrl, payloads: [] };
    });

    // create a "recursiveGet" which will call itself if CommCare tells us there's
    // more data to fetch for the same form
    fn(state => {
    const recursiveGet = url =>
    get(
    url,
    {
    headers: { 'content-type': 'application/json' },
    },
    nextState => {
    const now = new Date();
    const { baseUrl, data, payloads } = nextState;

    const { meta, objects } = data;
    console.log('Metadata in CommCare response:', meta);

    const finalState = {
    ...nextState,
    payloads: [...payloads, ...objects],
    };

    if (meta.next) {
    console.log('Next query detected, recursing...');
    return recursiveGet(`${baseUrl}${meta.next}`)(finalState);
    }
    finalState.lastRunAt = now.toISOString().slice(0, 19);
    return finalState;
    }
    );

    return { ...state, recursiveGet };
    });

    // for each initial query, fetch data recursively
    each(
    '$.queries[*]',
    fn(state => {
    return state.recursiveGet(`${state.baseUrl}${state.data}`)(state);
    })
    );
    // log the total number of payloads returned
    fn(state => {
    console.log('Count of payloads', state.payloads.length);

    return { ...state, references: [], data: {} };
    });
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/WF1-2-Bulk-upsert-HHs-and-HH-Visits-2023-05-19.html b/adaptors/library/jobs/auto/WF1-2-Bulk-upsert-HHs-and-HH-Visits-2023-05-19.html index ab6ede63a9b6..31f55952c00c 100644 --- a/adaptors/library/jobs/auto/WF1-2-Bulk-upsert-HHs-and-HH-Visits-2023-05-19.html +++ b/adaptors/library/jobs/auto/WF1-2-Bulk-upsert-HHs-and-HH-Visits-2023-05-19.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    WF1-2 Bulk upsert HHs and HH Visits

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    bulk, join, map, query, JSON

    Expression

    fn(state => {
    if (state.payloads.length == 0)
    return { ...state, housevisits: [], households: [] };

    const owner_ids = state.payloads.map(data => data.properties.owner_id);
    const uniq_owner_ids = [...new Set(owner_ids)];

    return { ...state, uniq_owner_ids };
    });


    fn(state => {
    if (state.payloads.length == 0) return state;

    return query(
    `SELECT CommCare_User_ID__c, Id village, Parent_Geographic_Area__c area, Parent_Geographic_Area__r.Name name, Parent_Geographic_Area__r.Parent_Geographic_Area__c catchment FROM Location__c catchment WHERE CommCare_User_ID__c IN ('${state.uniq_owner_ids.join(
    "','"
    )}') GROUP BY Id, CommCare_User_ID__c, Parent_Geographic_Area__c, Parent_Geographic_Area__r.Name, Parent_Geographic_Area__r.Parent_Geographic_Area__c`
    )(state);
    });

    fn(state => {
    if (state.payloads.length == 0) return state;

    console.log('Done querying ✅');

    return state;
    });

    fn(state => {
    if (state.payloads.length == 0) return state;

    console.log(
    'Filtering out unwanted users and applying mapping for households and housevisits'
    );

    const [reference] = state.references;

    //HMN 06/11/2023
    // console.log(JSON.stringify(reference.records, null, 2));

    const records = reference.records;
    const fetchReference = (owner_id, arg) => {
    const result =
    records && records.length > 0
    ? records.filter(record => record.CommCare_User_ID__c === owner_id)
    : 0;

    //TODO: Update default value for 'unknown location' before go-live
    return result.length > 0
    ? result[0][arg]
    : 'a000800001tMobaAAC' /*unknown location*/;
    };

    const supervisorMap = {
    community_health_nurse: 'Community Health Nurse',
    chw_supervisor: 'CHW Supervisor',
    chewschas: 'CHEWs/CHAs',
    other: 'Other',
    none: 'None',
    };

    const insuranceMap = {
    nhif: 'NHIF',
    Linda_mama: 'Linda mama',
    other_please_specify_if_active: 'Other',
    none: 'None',
    };

    const households = state.payloads
    /* HMN 050723
    .filter(
    h =>
    h.properties.commcare_username !== 'openfn.test' &&
    h.properties.commcare_username !== 'test.2021' &&
    h.properties.test_user !== 'Yes'
    )
    */
    .map(h => {
    // Special calculations ==================================================
    const insuranceStatus = h.properties.health_insurance;
    const Health_insurance_type__c =
    insuranceStatus && insuranceStatus === 'other_please_specify_if_active'
    ? 'Other'
    : insuranceStatus === 'nhif'
    ? 'NHIF'
    : insuranceStatus === 'Linda_mama' || 'linda_mama'
    ? 'Linda mama'
    : insuranceStatus;

    const hhStatus = h.properties.Household_Status;
    const Active_Household__c =
    hhStatus && hhStatus === 'No'
    ? false
    : hhStatus === 'Yes'
    ? true
    : hhStatus;

    const reason = h.properties.Reason_for_Inactive;
    const Inactive_Reason__c = reason
    ? reason.toString().replace(/_/g, ' ')
    : null;
    //HMN 06/11/2023
    // console.log(JSON.stringify(h.properties, null, 2));
    /*HMN remove this dependancy 07/07/2023
    const chw = h.properties.CHW_ID;
    const Household_CHW__c =
    chw === 'a030800001zQrk' ? 'a030800001zQrk5' : chw ? chw : undefined;
    // =======================================================================
    */

    return {
    CommCare_Username__c: h.properties.commcare_username,
    MOH_household_code__c: h.properties.moh_code,
    CommCare_Code__c: h.case_id,
    Source__c: true,
    // TODO: Prod mapping to add back before go-live =======================
    Household_CHW__c: h.properties.CHW_ID, // Uncomment me to go live!
    //Household_CHW__c: 'a032400000GHpdsAAD', // Comment me OUT to go live!
    // Household_CHW__c: 'a03AW00000643nLYAQ',
    // =====================================================================
    Catchment__c: fetchReference(h.properties.owner_id, 'catchment'),
    Area__c: fetchReference(h.properties.owner_id, 'area'),
    Village__c: fetchReference(h.properties.owner_id, 'village'),
    Household_Village__c: h.properties.village,
    Deaths_in_the_last_6_months__c:
    h.properties.deaths_in_past_6_months > 0 ? 'Yes' : 'No',
    Access_to_safe_water__c: h.properties.Safe_Water,
    Treats_Drinking_Water__c: h.properties.Treats_Drinking_Water,
    Tippy_Tap__c: h.properties.Active_Handwashing_Station,
    Pit_Latrine__c: h.properties.Functional_Latrine,
    Rubbish_Pit__c: h.properties.Rubbish_Pit,
    Drying_Rack__c: h.properties.Drying_Rack,
    Kitchen_Garden__c: h.properties.Kitchen_Garden,
    Cookstove__c: h.properties.Improved_Cooking_Method,
    Clothe__c: h.properties.Clothesline,
    WASH_Trained__c: h.properties.WASH_Trained,
    Uses_ITNs__c: h.properties.ITNs,
    Has_muac_tape__c: h.properties.family_muac_tape_available,
    Health_insurance__c: h.properties.health_insurace_cover,
    Health_insurance_active_status__c: h.properties.healthinsurance_active,
    Health_insurance_type__c,
    Other_Health_Insurance__c: h.properties.if_other_please_specify,
    Work_with_TBA__c: h.properties.tba,
    TBA_name__c: h.properties.which_tba,
    Last_Modified_Date_CommCare__c: h.server_date_modified, //Need a case property,
    Active_Household__c,
    Inactive_Reason__c,
    Active_in_Nutrition_Program__c:
    h.properties.enrolled_in_a_lwala_nutrition_program,
    lwala_nutrition_program_enrollment_date__c:
    h.properties.lwala_nutrition_program_enrollment_date,
    Trained_in_gardening__c: h.properties.household_trained_on_gardening,
    household_trained_on_gardening_date__c:
    h.properties.when_was_the_household_trained_on_gardening,
    Seed_Input_Support__c:
    h.properties.household_provided_with_seed_input_support,
    household_provided_with_seed_input_suppo__c:
    h.properties.when_was_the_household_provided_with_seed_input_support,
    MIYCN_Trained__c: h.properties.household_trained_on_MIYC,
    // TODO: @Aleksa to find out if Case_Closed_Date__c still exist
    Case_Closed_Date__c: h.date_closed //&& h.date_closed == true
    ? h.date_closed
    : undefined
    };
    });

    const housevisits = state.payloads
    //HMN remove test user filters
    /*
    .filter(
    h =>
    h.properties.commcare_username !== 'openfn.test' &&
    h.properties.commcare_username !== 'test.2021' &&
    h.properties.test_user !== 'Yes'
    )*/
    .map(h => {
    // Special calculations ==================================================


    const visitIdC =
    h.case_id + '_' + h.properties.last_form_opened_date_and_time;

    const hVstatus = h.properties.Household_Status;
    const Active_Household__c =
    hVstatus === 'No' ? false : hVstatus === 'Yes' ? true : hVstatus;

    const insuranceTypeC = () => {
    let status = h.properties.health_insurance;

    let value =
    status && status !== ''
    ? status
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return insuranceMap[value] || value;
    })
    : undefined;
    return value ? value.join(';') : undefined;
    };

    const openedC = () => {
    const form_opened = h.properties.last_form_opened_date_and_time;

    if (form_opened) {
    const value1 = form_opened.split('-').slice(0, 2).join('-');
    const value2 = form_opened.split('-').slice(2).join('-');
    const formattedValue = [value1, value2].join(' ');
    return new Date(formattedValue).toISOString();
    }
    return undefined;
    };

    return {
    CommCare_Username__c: h.properties.commcare_username,
    CommCare_Visit_ID__c: visitIdC,
    Catchment__c: fetchReference(h.properties.owner_id, 'catchment'),
    'Household__r.CommCare_Code__c': h.case_id,
    Date__c: h.properties.Date,
    Form_Submitted__c: h.properties.last_form_opened_name,
    Active_Household__c: Active_Household__c,
    Active_in_Nutrition_Program__c:
    h.properties.enrolled_in_a_lwala_nutrition_program,
    lwala_nutrition_program_enrollment_date__c:
    h.properties.lwala_nutrition_program_enrollment_date,
    Trained_in_gardening__c: h.properties.household_trained_on_gardening,
    household_trained_on_gardening_date__c:
    h.properties.when_was_the_household_trained_on_gardening,
    Seed_Input_Support__c:
    h.properties.household_provided_with_seed_input_support,
    household_provided_with_seed_input_suppo__c:
    h.properties.when_was_the_household_provided_with_seed_input_support,
    MIYCN_Trained__c: h.properties.household_trained_on_MIYCN,
    Kitchen_Garden__c: h.properties.Kitchen_Garden,
    Access_to_safe_water__c: h.properties.Safe_Water,
    Treats_Drinking_Water__c: h.properties.Treats_Drinking_Water,
    Tippy_Tap__c: h.properties.Active_Handwashing_Station,
    Pit_Latrine__c: h.properties.Functional_Latrine,
    Rubbish_Pit__c: h.properties.Rubbish_Pit,
    Drying_Rack__c: h.properties.Drying_Rack,
    Cookstove__c: h.properties.Improved_Cooking_Method,
    Clothe__c: h.properties.Clothesline,
    WASH_Trained__c: h.properties.WASH_Trained,
    Has_muac_tape__c: h.properties.family_muac_tape_available,
    Uses_ITNs__c: h.properties.ITNs,
    Supervisor_Visit__c: h.properties.supervisor_visit
    ? supervisorMap[h.properties.supervisor_visit]
    : null,
    Health_insurance__c: h.properties.health_insurace_cover,
    Health_insurance_active_status__c: h.properties.healthinsurance_active,
    Health_insurance_type__c: insuranceTypeC(),

    Other_Health_Insurance__c: h.properties.if_other_please_specify,
    CommCare_Form_Opened__c: openedC(),

    };
    });

    return { ...state, households, housevisits, fetchReference };
    });

    //JSON logging of records
    //HMN 06/11/2023
    /*fn(state => {
    console.log('HHs to upsert ::', JSON.stringify(state.households));
    return state;
    });*/


    bulk(
    'Household__c',
    'upsert',
    {
    extIdField: 'CommCare_Code__c',
    failOnError: true,
    allowNoOp: true,
    },
    state => {
    console.log('Bulk upserting households...');
    return state.households;
    }
    );

    fn(state => {
    if (state.payloads.length == 0) return state;

    console.log('house holds bulk upsert done');
    return state;
    });

    // TODO clean up in QA used for troubleshooting
    // Uncomment this block to add cooldown
    // fn(state => {
    // return new Promise((resolve, reject) => {
    // setTimeout(() => {
    // console.log('4 second cooldown finished.');
    // resolve(state);
    // }, 4000);
    // });
    // });

    bulk(
    'Visit__c',
    'upsert',
    {
    extIdField: 'CommCare_Visit_ID__c',
    failOnError: true,
    allowNoOp: true,
    },
    state => {
    console.log('Bulk upserting housevisits...');
    return state.housevisits;
    }
    );

    fn(state => {
    if (state.payloads.length == 0) return state;
    console.log('house visits bulk upsert done');
    return state;
    });

    // TODO clean up in QA for troubleshooting
    // Uncomment this block to add cooldown
    // fn(state => {
    // return new Promise((resolve, reject) => {
    // setTimeout(() => {
    // console.log('Final 4 second cooldown finished.');
    // resolve(state);
    // }, 4000);
    // });
    // });
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/WF2-1-Bulk-get-Person-cases-2023-05-19.html b/adaptors/library/jobs/auto/WF2-1-Bulk-get-Person-cases-2023-05-19.html index e8e11a249c69..dd51a018a948 100644 --- a/adaptors/library/jobs/auto/WF2-1-Bulk-get-Person-cases-2023-05-19.html +++ b/adaptors/library/jobs/auto/WF2-1-Bulk-get-Person-cases-2023-05-19.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    WF2-1 Bulk get Person cases

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: WF2-1 Bulk get Person cases
    • Adaptor: @openfn/language-http
    • Adaptor Version: v4.2.8
    • Created over 1 year ago
    • Updated 13 days ago
    • Score: 72 (an indicator of how useful this job may be)

    Key Functions

    each, get, map, JSON

    Expression

    fn(state => {
    const { baseUrl } = state.configuration;

    const caseTypes = ['Person'];

    //NOTE: You can use 'limit' to modify this batch size as desired
    const limit = 1000; //E.g., change to 10 to process records in smaller batch sizes

    //NOTE: indexedOnStart is the default sync start data the FIRST time the job runs
    const indexedOnStart = '2024-05-30T03:00:00';


    //NOTE: After first job run, OpenFn will check the job sync data ("lastRunAt") to set as the indexedOnStart
    const lastRunAt =
    typeof state.lastRunAt !== 'undefined' ? state.lastRunAt : indexedOnStart;
    console.log('Filtering cases with indexed_on_start > than ::', lastRunAt);

    const queries = caseTypes.map(
    t => `?type=${t}&indexed_on_start=${lastRunAt}&limit=${limit}`
    //NOTE: If for testing, you want to fetch data for a specific historical range (e.g., between April 23 and 24)...
    //...then use the query string below instead of the one above on L16, and custom adjust the index_on start/end dates
    // t => `?type=${t}&indexed_on_start=2024-01-16T00:00:00&limit=${limit}&indexed_on_end=2024-01-16T23:59:59`
    );

    return { ...state, queries, baseUrl, payloads: [] };
    });

    // create a "recursiveGet" which will call itself if CommCare tells us there's
    // more data to fetch for the same form
    fn(state => {
    const recursiveGet = url =>
    get(
    url,
    {
    headers: { 'content-type': 'application/json' },
    },
    nextState => {
    const now = new Date();
    const { baseUrl, data, payloads } = nextState;

    const { meta, objects } = data;
    console.log('Metadata in CommCare response:', meta);

    const finalState = {
    ...nextState,
    payloads: [...payloads, ...objects],
    };

    if (meta.next) {
    console.log('Next query detected, recursing...');
    return recursiveGet(`${baseUrl}${meta.next}`)(finalState);
    }
    finalState.lastRunAt = now.toISOString().slice(0, 19);
    return finalState;
    }
    );

    return { ...state, recursiveGet };
    });

    // for each initial query, fetch data recursively
    each(
    '$.queries[*]',
    fn(state => {
    return state.recursiveGet(`${state.baseUrl}${state.data}`)(state);
    })
    );
    // log the total number of payloads returned
    fn(state => {
    console.log('Count of payloads', state.payloads.length);
    //HMN 11072023
    // console.log(JSON.stringify(state.payloads, null, 2));

    return { ...state, references: [], data: {} };
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/WF2-2-Bulk-upsert-Persons-2023-05-19.html b/adaptors/library/jobs/auto/WF2-2-Bulk-upsert-Persons-2023-05-19.html index 84104a88fa72..c5f0b3414cd8 100644 --- a/adaptors/library/jobs/auto/WF2-2-Bulk-upsert-Persons-2023-05-19.html +++ b/adaptors/library/jobs/auto/WF2-2-Bulk-upsert-Persons-2023-05-19.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    WF2-2 Bulk upsert Persons

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    bulk, dataValue, field, fields, join, map, query, relationship, upsertIf, JSON

    Expression

    fn(state => {
    if (state.payloads.length == 0)
    return {
    ...state,
    householdMapping: [],
    headOfHouseholdMapping: [],
    motherMapping: [],
    caregiverMapping: [],
    sfRecordMapping: [],
    };
    // JSON logging of records
    //HMN debug
    //console.log('cases before query :: ', JSON.stringify(state.payloads, null, 2));
    const owner_ids = state.payloads.map(data => data.properties.owner_id);
    const uniq_owner_ids = [...new Set(owner_ids)];

    return { ...state, uniq_owner_ids };
    });

    // get data from SF
    fn(state => {
    if (state.payloads.length == 0) return state;

    return query(
    `SELECT CommCare_User_ID__c, Id village, Parent_Geographic_Area__c area, Parent_Geographic_Area__r.Name name, Parent_Geographic_Area__r.Parent_Geographic_Area__c catchment FROM Location__c WHERE CommCare_User_ID__c IN ('${state.uniq_owner_ids.join(
    "','"
    )}') GROUP BY Id, CommCare_User_ID__c, Parent_Geographic_Area__c, Parent_Geographic_Area__r.Name, Parent_Geographic_Area__r.Parent_Geographic_Area__c`
    )(state);
    });

    fn(state => {
    if (state.payloads.length == 0) return state;

    const [reference] = state.references;

    // console.log(JSON.stringify(reference.records, null, 2));

    const records = reference.records;
    const fetchReference = (owner_id, arg) => {
    const result =
    records && records.length > 0
    ? records.filter(record => record.CommCare_User_ID__c === owner_id)
    : 0;

    //TODO: Update default value for 'unknown location' before go-live
    return result.length > 0 ? result[0][arg]
    : 'a000800001tMobaAAC' /*unknown location*/;

    };

    const cleanChoice = choice => {
    if (choice) {
    return choice.charAt(0).toUpperCase() + choice.slice(1).replace('_', ' ');
    } else {
    return '';
    }
    };

    const handleMultiSelect = multiField => {
    return multiField
    ? multiField
    .replace(/ /gi, ';')
    .toLowerCase()
    .split(';')
    .map(value => {
    return (
    value.charAt(0).toUpperCase() + value.slice(1).replace('_', ' ')
    );
    })
    .join(';')
    : '';
    };

    const pregDangerMap = {
    Vaginal_Bleeding: 'Vaginal Bleeding',
    Water_Breaks: 'Water Breaks before Time of Delivery',
    Prolonged_Labour: 'Prolonged Labour over 12 Hours',
    Convulsions: 'Convulsions or Fits',
    Abdominal_Pain: 'Severe Abdominal Pain before Delivery',
    High_Fever: 'High Fever',
    Low_Baby_Movement: 'Feeling the Baby move less or not at all',
    Swelling: 'Swelling of Face and Hands',
    Severe_Headache: 'Severe or Continuous Headache for more than 12 hours',
    Severe_Vomiting: 'Severe or Continuous Vomiting',
    none: 'None',
    };

    const counselMap = {
    anc_visits: 'ANC Visits',
    early_initiation_of_anc_less_than_3_months:
    'Early initiation of ANC (less than 3 months)',
    completing_recomended_anc_visits: 'Completing recomended ANC visits',
    danger_signs: 'Danger signs',
    skilled_birth: 'Skilled birth',
    immunization: 'Immunization',
    individual_birth_plan: 'Individual Birth Plan',
    emergency_preparedness: 'Emergency preparedness',
    childcare_and_affection: 'Childcare and affection',
    nutrition_counseling: 'Nutrition counseling',
    growth_monitoring: 'Growth monitoring',
    exclusive_breastfeeding: 'Exclusive breastfeeding',
    complementary_feeding: 'Complementary feeding',
    sleeping_under_llitn: 'Sleeping under LLITN',
    knowing_hiv_status: 'Knowing HIV status',
    indoor_pollution: 'Indoor pollution',
    personal_hygiene: 'Personal Hygiene',
    safe_drinking_water: 'Safe drinking water',
    safe_disposal_of_human_waste: 'Safe disposal of human waste',
    };

    const serviceMap = {
    Scheduled_PSC_Apt: 'Scheduled PSC Apt',
    Adverse_Drug_Reaction_Side_Effect: 'Adverse Drug Reaction/Side Effect',
    Malnutrition: 'Malnutrition',
    Malaria: 'Malaria',
    TB: 'TB',
    Treatment_for_Other_OIs: 'Treatment for other Ols',
    ARI: 'ARI',
    Anemia: 'Anemia',
    Diarrhea: 'Diarrhea',
    Pregnancy_Care: 'Pregnancy Care (ANC)',
    Family_Planning: 'Family Planning (FP)',
    Preconception_Counseling: 'Preconception Counseling',
    Injury: 'Injury',
    Other: 'Other',
    };

    const reasonMapping = {
    lack_of_access_to_fp_information: 'Lack of access to FP information',
    no_access_to_fp_services_hospitals:
    'Lack of hospitals or places where FP services can be accessed',
    not_willing_to_use_fp_due_to_negative_effects_myths_and_misconceptions:
    'Myths and misconceptions',
    barriers_at_service_delivery_points: 'Barriers at service delivery points',
    pregnant: 'The client is pregnant',
    intentions_of_getting_pregnant: 'Intentions of getting pregnant',
    not_sexually_active: 'The client is not sexually active',
    other_barriers_culture_male_partners_parents_etc:
    'Other barriers (culture, male partners, parents, etc)',
    };

    const milestoneTypeMap = {
    cognitive_delays_learning_difficulties:
    'Cognitive Delays Learning Difficulties',
    motor_delays: 'Motor Delays',
    speech_and_language_delay: 'Delay Speech and Language Delay',
    social_and_emotional: 'Social and emotional',
    };

    const milestoneMap = {
    movement: 'Movement',
    hearing: 'Hearing',
    communication: 'Communication',
    seeing: 'Seeing',
    cognitive_delays: 'Cognitive Delays',
    play: 'Play',
    };
    const nutritionMap = {
    severe: 'Severely Malnourished',
    moderate: 'Moderately Malnourished',
    normal: 'Normal',
    };

    const fpMethodMap = {
    male_condoms: 'Male condoms',
    female_condoms: 'Female condoms',
    pop: 'POP',
    coc: 'COC',
    emergency_pills: 'Emergency pills',
    none: 'None',
    };

    return {
    ...state,
    counselMap,
    serviceMap,
    reasonMapping,
    milestoneTypeMap,
    milestoneMap,
    nutritionMap,
    pregDangerMap,
    fpMethodMap,
    cleanChoice,
    handleMultiSelect,
    fetchReference,
    };
    });

    // build sfRecord before upserting
    fn(state => {
    if (state.payloads.length == 0) return state;

    const {
    counselMap,
    reasonMapping,
    milestoneTypeMap,
    milestoneMap,
    nutritionMap,
    pregDangerMap,
    fpMethodMap,
    cleanChoice,
    handleMultiSelect,
    fetchReference,
    } = state;

    const householdMapping = [
    ...new Map(
    state.payloads
    .filter(
    p =>
    p.indices.parent.case_id !== undefined &&
    p.indices.parent.case_id !== ''
    )
    .map(p => {
    return {
    CommCare_Code__c:
    p.indices.parent.case_id || p.properties.parent_id,
    };
    })
    .map(h => [h.CommCare_Code__c, h])
    ).values(),
    ];

    const headOfHouseholdMapping = state.payloads
    .filter(
    p =>
    p.properties.head_of_household_case_id !== undefined &&
    p.properties.head_of_household_case_id !== ''
    )
    .map(p => {
    return {
    CommCare_Code__c: p.indices.parent.case_id || p.properties.parent_id,
    'Head_of_Household__r.CommCare_ID__c':
    p.properties.head_of_household_case_id,
    };
    });

    const motherMapping = state.payloads
    .filter(
    p =>
    /*HMN 050723 p.properties.commcare_username !== 'test.2021' &&
    p.properties.test_user !== 'Yes' &&
    */
    p.properties.mother_case_id !== undefined &&
    p.properties.mother_case_id !== '' &&
    p.case_id!== undefined
    )
    .map(p => {
    return {
    'Mother__r.CommCare_ID__c': p.properties.mother_case_id,
    CommCare_ID__c: p.case_id,
    };
    });

    const caregiverMapping = state.payloads
    .filter(
    p =>
    /*HMN 070523 p.properties.commcare_username !== 'test.2021' &&
    p.properties.test_user !== 'Yes' &&
    */
    p.properties.caretaker_case_id !== undefined &&
    p.properties.caretaker_case_id !== '' &&
    p.case_id!== undefined
    )
    .map(p => {
    return {
    'Primary_Caregiver_Lookup__r.CommCare_ID__c':
    p.properties.caretaker_case_id,
    CommCare_ID__c: p.case_id,
    };
    });

    const sfRecordMapping = state.payloads
    .filter(
    p =>
    /*HMN 050723
    p.properties.commcare_username !== 'test.2021' &&
    p.properties.test_user !== 'Yes'
    */
    p.case_id !== undefined &&
    p.case_id !== ''
    )
    .map(p => {
    // For unbornOrName
    const name1 = p.properties.Person_Name || p.properties.case_name;
    const unborn = p.properties.name;

    const name2 =
    name1 === undefined || name1 === '' || name1 === null
    ? unborn
    : name1.replace(/\w\S*/g, function (txt) {
    return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();
    });
    const unbornOrName = name1 !== null ? name2 : 'Unborn Child';
    // console.log('Person Name ::', unbornOrName);

    // For chronicIllness
    const chronicChoice =p.properties.please_specify_which_chronic_illness_the_person_has;
    const choice2 = handleMultiSelect(chronicChoice);
    const chronicIllness = choice2 ? choice2.replace(/_/g, ' ') : '';

    const disabilityC =
    p.properties.disability !== undefined && p.properties.disability !=='---' && p.properties.disability !== null
    ? p.properties.disability
    .toLowerCase()
    .split(' ')
    .map(word => word.charAt(0).toUpperCase() + word.slice(1))
    .join(';')
    : null;
    //HMN remove
    console.log(p.case_id)
    //console.log(disabilityC)
    //
    const otherDisability =
    p.properties.other_disability !== undefined && p.properties.other_disability !=='---' && p.properties.other_disability !== null
    ? p.properties.other_disability
    .toLowerCase()
    .split(' ')
    .map(word => word.charAt(0).toUpperCase() + word.slice(1))
    .join(';')
    : null;
    //HMN remove
    //console.log(otherDisability)
    //HMN
    const hh_relation = p.properties.relation_to_hh;

    const relationToTheHead = hh_relation !== undefined && hh_relation !== null
    ? hh_relation.toString().replace(/_/g, ' ').charAt(0).toUpperCase() +
    hh_relation.toString().replace(/_/g, ' ').slice(1)
    : null;

    const childStatus =
    p.properties.Child_Status && p.properties.Record_Type === 'Unborn'
    ? (p.properties.Child_Status = 'Unborn')
    : p.properties.Child_Status && p.properties.Record_Type === 'Born'
    ? (p.properties.Child_Status = 'Born')
    : p.properties.Child_Status;

    const childDangerSigns = p.properties.Other_Danger_Signs !== undefined && p.properties.Other_Danger_Signs !== null
    ? p.properties.Other_Danger_Signs.toLowerCase()
    .split(' ')
    .map(word => word.charAt(0).toUpperCase() + word.slice(1))
    .join(';')
    .toString()
    .replace(/_/g, ' ')
    : p.properties.Other_Danger_Signs;

    //clientCounselled
    const clientChoices = p.properties.counsel_topic;
    const choiceGroups = clientChoices ? clientChoices.split(' ') : null;
    const clientCounselled = choiceGroups
    ? choiceGroups
    .map(cg => {
    return counselMap[cg];
    })
    .join(';')
    : choiceGroups;

    // fpMethodDistributed
    const fpStatus = p.properties.FP_commodity;
    const fpValue =
    fpStatus && fpStatus !== ''
    ? fpStatus
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return fpMethodMap[value] || value;
    })
    : undefined;
    const fpMethodDistributed = fpValue ? fpValue.join(';') : undefined;

    // placeOfDelivery
    const pFacility = p.properties.Delivery_Type;
    const placeOfDelivery =
    pFacility === 'Skilled'
    ? 'Facility'
    : pFacility === 'Unskilled'
    ? 'Home'
    : undefined;

    // reasonForNotTakingFP
    const rStatus = p.properties.No_FPmethod_reason;
    const rValue =
    rStatus && rStatus !== ''
    ? rStatus
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return reasonMapping[value] || value;
    })
    : undefined;
    const reasonForNotTakingFP = rValue ? rValue.join(';') : undefined;

    const recordType = p.properties.Record_Type;


    return {
    // TODO @aleksa, Source__c is causing an error
    Source__c: true,
    CommCare_ID__c: p.case_id,

    //HMN 05072023 'Primary_Caregiver_Lookup__r.CommCare_ID__c':p.properties.caretaker_case_id,
    //HMN 05072023 'Mother__r.CommCare_ID__c': p.properties.mother_case_id,
    'Household__r.CommCare_Code__c':
    p.properties.parent_id || p.indices.parent.case_id,
    commcare_location_id__c: p.properties.commcare_location_id,
    CommCare_Username__c: p.properties.commcare_username,
    Telephone__c: p.properties.contact_phone_number,

    Consent_for_data_use__c: p.properties.data_sharing_consent,
    CommCare_HH_Code__c: p.indices.parent.case_id,
    Client_Status__c: p.properties.Client_Status,
    Catchment__c: fetchReference(p.properties.owner_id, 'catchment'),
    Area__c: fetchReference(p.properties.owner_id, 'area'),
    Household_Village__c: fetchReference(p.properties.owner_id, 'village'),
    Name: unbornOrName,
    Chronic_illness__c: chronicIllness,
    Currently_enrolled_in_school__c: p.properties.enrolled_in_school,
    Education_Level__c: p.properties.Education_Level !== null && p.properties.Education_Level !== undefined
    ? p.properties.Education_Level.toString().replace(/_/g, ' ')
    : null,
    Relation_to_the_head_of_the_household__c: relationToTheHead,
    Gender__c: p.properties.Gender !== undefined ? p.properties.Gender : null,
    Disability__c: disabilityC,
    Other_disability__c: otherDisability,
    Use_mosquito_net__c: p.properties.sleep_under_net,
    Birth_Certificate__c: p.properties.birth_certificate,
    Child_Status__c: childStatus,
    'RecordType.Name': recordType === 'Unborn' || recordType === ''
    ? 'Child'
    : recordType.toString().replace(/_/g, ' '), //convert Unborn children to Child RT
    //TT5 Mother Information =====================//
    MCH_booklet__c: p.properties.mch_booklet,
    Reason_for_not_taking_a_pregnancy_test__c: p.properties.No_Preg_Test
    ? p.properties.No_Preg_Test.toString().replace(/_/g, ' ')
    : undefined,
    Pregnancy_danger_signs__c: p.properties.pregnancy_danger_signs
    ? pregDangerMap[p.properties.pregnancy_danger_signs]
    : undefined,
    Individual_birth_plan_counselling__c:
    p.properties.individual_birth_plan,
    Child_Danger_Signs__c: childDangerSigns,
    //HAWI =====================//

    Unique_Patient_Code__c: p.properties.Unique_Patient_Code,
    Active_in_Support_Group__c: p.properties.Active_in_Support_Group,
    Preferred_Care_Facility__c: p.properties.Preferred_Care_Facility,
    Currently_on_ART_s__c: p.properties.ART,
    ART_Regimen__c: p.properties.ARVs,
    HAWI_Defaulter__c: p.properties.default === 'Yes' ? true : false,
    Date_of_Default__c: p.properties.date_of_default,
    Know_HIV_status__c: p.properties.known_hiv_status,
    HIV_Status__c: p.properties.hiv_status,
    //Illness ========================//
    Persons_temperature__c: p.properties.temperature,
    Days_since_illness_start__c: p.properties.duration_of_sickness,
    Current_Malaria_Status__c: p.properties.malaria_test_results,
    Malaria_test__c: p.properties.malaria_test,
    Last_Malaria_Home_Test__c: p.properties.malaria_test_date,
    Last_Malaria_Home_Treatment__c: cleanChoice(
    p.properties.malaria_test_date
    ),
    Cough_over_14days__c: p.properties.symptoms_check_cough,
    TB_patients_therapy_observed__c: p.properties.observed_tb_therapy,
    Injuries_or_wounds__c: p.properties.wounds_or_injuries,
    Pulse_Oximeter__c: p.properties.pulse_oximeter_available,
    Heart_Rate_Pulse_Oximeter__c: p.properties.heart_rate_pulse_oximeter,
    Oxygen_Concentration_Pulse_Oximeter__c:
    p.properties.oxygen_concentration,
    Can_child_drink__c: p.properties.can_child_drink,
    Antibiotic_provided_for_fast_breathing__c: cleanChoice(
    p.properties.antibiotic_fast_breathing
    ),
    Antibiotic_provided_for_chest_indrawing__c: cleanChoice(
    p.properties.antibiotic_chest_indrawing
    ),
    Default_on_TB_treatment__c: cleanChoice(
    p.properties.default_tb_treatment
    ),
    Treatment_Distribution__c: cleanChoice(
    p.properties.distributed_treatments
    ),
    //Delivery =====================//
    Immediate_Breastfeeding__c: p.properties.Breastfeeding_Delivery,
    Place_of_Delivery__c: placeOfDelivery,
    Delivery_Facility__c: p.properties.Delivery_Facility
    ? p.properties.Delivery_Facility.toString().replace(/_/g, ' ')
    : null,
    Delivery_Facility_Other__c: p.properties.Delivery_Facility_Other,
    //Family Planning =====================//
    LMP__c: p.properties.LMP,
    Family_Planning__c: p.properties.family_planning,
    Family_Planning_Method__c: p.properties.family_planning_method,
    FP_Method_Distributed__c: fpMethodDistributed,
    Reasons_for_not_taking_FP_method__c: reasonForNotTakingFP,
    Pregnant__c: p.properties.Pregnant === 'Yes' ? true : false,
    Date_of_Delivery__c: p.properties.delivery_date,
    Counselled_on_FP_Methods__c: p.properties.CounselledFP_methods,
    Client_counselled_on__c: clientCounselled,
    Client_provided_with_FP__c: cleanChoice(
    p.properties[
    'was_the_woman_15-49yrs_provided_with_family_planning_commodities_by_chv'
    ]
    ),
    Received_pregnancy_test__c:
    p.properties.did_you_adminsiter_a_pregnancy_test,
    Pregnancy_test_result__c: p.properties.pregnancy_test_result,
    Gravida__c: p.properties.Gravida,
    Parity__c: p.properties.Parity,
    //TT5 Child Information =====================//
    Exclusive_Breastfeeding__c: p.properties.Exclusive_Breastfeeding,
    Counselled_on_Exclusive_Breastfeeding__c: p.properties.counseling,
    Newborn_visited_48_hours_of_delivery__c:
    p.properties.newborn_visited_48_hours_of_delivery,
    Newborn_visit_counselling__c: cleanChoice(
    p.properties.did_you_consel_the_mother_on1
    ),
    mother_visited_48_hours_of_the_delivery__c:
    p.properties.visit_mother_48,
    Mother_visit_counselling__c: cleanChoice(
    p.properties.did_you_consel_the_mother_on2
    ),
    Newborn_visited_by_a_CHW_within_6_days__c:
    p.properties.visit_6_days_from_delivery,
    //Nutrition =====================//
    Caretaker_action_after_muac_screening__c:
    p.properties.mother_screened_muac_action,
    Caretaker_muac_findings__c:
    p.properties.mother_screened_child_muac_result,
    Food_groups_3_times_a_day__c: p.properties.food_groups,
    Caretaker_screened_for_muac_this__c: cleanChoice(
    p.properties.mother_screened_child_muac
    ),
    Caretaker_trained_in_muac__c: cleanChoice(
    p.properties.mother_trained_muac
    ),
    of_Caretaker_MUAC_screenings__c: p.properties.mother_nb_screening,
    Current_Height__c: p.properties.current_height,
    Current_MUAC__c: p.properties.MUAC,
    Current_Nutrition_Status__c: p.properties.Nutrition_Status
    ? nutritionMap[p.properties.Nutrition_Status]
    : undefined,
    //TT5 & HAWI =====================//
    TT5_Mother_Registrant__c: p.properties.Pregnant == 'Yes' ? 'Yes' : null,
    Enrollment_Date__c:
    p.properties.age < 5 || p.properties.Pregnant == 'Yes'
    ? p.server_date_modified
    : null,
    HAWI_Enrollment_Date__c:
    p.properties.hiv_status == 'positive' ? p.server_date_modified : null,
    Thrive_Thru_5_Registrant__c:
    p.properties.age < 5 || p.properties.Pregnant == 'Yes' ? 'Yes' : 'No',
    HAWI_Registrant__c:
    p.properties.hiv_status == 'positive' ? 'Yes' : 'No',
    //ANC =====================//
    ANC_1__c:
    p.properties.ANC_1 && p.properties.ANC_1 !== ''
    ? p.properties.ANC_1
    : undefined,
    ANC_2__c:
    p.properties.ANC_2 && p.properties.ANC_2 !== ''
    ? p.properties.ANC_2
    : undefined,
    ANC_3__c:
    p.properties.ANC_3 && p.properties.ANC_3 !== ''
    ? p.properties.ANC_3
    : undefined,
    ANC_4__c:
    p.properties.ANC_4 && p.properties.ANC_4 !== ''
    ? p.properties.ANC_4
    : undefined,
    ANC_5__c:
    p.properties.ANC_5 && p.properties.ANC_5 !== ''
    ? p.properties.ANC_5
    : undefined,
    Date_of_Birth__c:
    p.properties.DOB && p.properties.DOB !== ''
    ? p.properties.DOB.replace(/\\/g, '-')
    : undefined,
    //Immunization =====================//
    // Child_missed_immunization_type__c:
    // p.form.TT5.Child_Information.Immunizations.immunization_type,
    BCG__c: p.properties.BCG,
    OPV_0__c: p.properties.OPV_0,
    Measles_6__c: p.properties.Measles_6,
    Measles_9__c: p.properties.Measles_9,
    Measles_18__c: p.properties.Measles_18,
    OPV_1__c: p.properties.OPV_PCV_Penta_1,
    OPV_2__c: p.properties.OPV_PCV_Penta_2,
    OPV_3__c: p.properties.OPV_PCV_Penta_3,
    Rotavirus_1__c: p.properties.rotavirus_1,
    Rotavirus_2__c: p.properties.rotavirus_2,
    IPV__c: p.properties.IPV,
    Vitamin_A_12__c: p.properties.Vitamine_A,
    Vitamin_A_18__c: p.properties.Vitamine_A_2,
    Vitamin_A_24__c: p.properties.Vitamine_A_3,
    Deworming_12__c: p.properties.Deworming_1,
    Deworming_18__c: p.properties.Deworming_2,
    Deworming_24__c: p.properties.Deworming_3,
    //ECD =====================//
    Did_you_counsel_caregiver_on__c: cleanChoice(
    p.properties.did_you_counsel_the_caregiver_on_delayed_milestones
    ),
    Delayed_Milestone__c: cleanChoice(
    p.properties.does_the_child_has_a_delayed_milestone
    ),
    Child_has_2_or_more_play_items__c: cleanChoice(
    p.properties.does_the_child_has_2_or_more_play_items_at_home
    ),
    Child_has_3_or_more_picture_books__c: cleanChoice(
    p.properties.does_the_child_has_3_or_more_picture_books
    ),
    Delayed_Milestones_Counselled_On__c: p.properties
    .which_delayed_milestone_area_did_you_counsel_the_caregiver_on
    ? milestoneMap[
    p.properties
    .which_delayed_milestone_area_did_you_counsel_the_caregiver_on
    ]
    : undefined,
    Delayed_Milestone_Type__c: p.properties.which_delayed_milestone
    ? milestoneTypeMap[p.properties.which_delayed_milestone]
    : undefined,
    //Death =====================//
    Date_of_Death__c: p.properties.Date_of_Death,
    Cause_of_Death__c: p.properties.cause_of_death_dead
    ? p.properties.cause_of_death_dead.toString().replace(/_/g, ' ')
    : p.properties.cause_of_death_dead,
    Verbal_autopsy__c: p.properties.verbal_autopsy,
    //Closing =====================//
    Last_Modified_Date_CommCare__c: p.date_modified,
    Case_Closed_Date__c: p.date_closed,
    };
    });

    sfRecordMapping.forEach(rec => {
    Object.entries(rec).forEach(([key, value]) => {
    if (value === '' || value === null) rec[key] = undefined;
    });
    });

    // TODO clean up after QA
    // console.log(JSON.stringify(caregiverMapping, null, 2), 'careGiver');
    // console.log(JSON.stringify(motherMapping, null, 2), 'Mother');
    //console.log(JSON.stringify(sfRecordMapping, null, 2), 'sfRecordMapping');
    // console.log(JSON.stringify(householdMapping, null, 2), 'householdMapping');
    // console.log(
    // JSON.stringify(headOfHouseholdMapping, null, 2),
    // 'headOfHouseholdMapping'
    // );

    return {
    ...state,
    motherMapping,
    sfRecordMapping,
    caregiverMapping,
    householdMapping,
    headOfHouseholdMapping,
    };
    });


    // TODO, Clean up when pass QA
    /*fn(state => {
    state.sfRecordMapping.forEach(rec => {
    Object.entries(rec).forEach(([key, value]) => {
    if (typeof key !== 'string') throw `${key} is not a string`;
    });
    });
    return state;
    });
    */
    // bulk(
    // 'Household__c',
    // 'upsert',
    // {
    // extIdField: 'CommCare_Code__c',
    // failOnError: true,
    // allowNoOp: true,
    // },
    // state => {
    // console.log('Bulk upserting...');
    // return state.householdMapping;
    // }
    // );

    // TODO, Clean up when pass QA
    // upsert data to SF
    // upsertIf(
    // state.data.properties.commcare_username !== 'test.2021' &&
    // state.data.properties.test_user !== 'Yes',
    // 'Person__c',
    // 'CommCare_ID__c',
    // state => state.sfRecord
    // );

    bulk(
    'Person__c',
    'upsert',
    {
    extIdField: 'CommCare_ID__c',
    failOnError: true,
    allowNoOp: true,
    },
    state => {
    console.log('Bulk upserting persons ::');
    //HMN commented this
    //console.log(JSON.stringify(state.sfRecordMapping, null, 2));
    return state.sfRecordMapping;
    }
    );
    // TODO, Clean up when pass QA
    // upsertIf(
    // state.data.properties.commcare_username !== 'test.2021' &&
    // state.data.properties.test_user !== 'Yes' &&
    // state.data.properties.caretaker_case_id !== undefined &&
    // state.data.properties.caretaker_case_id !== '',
    // 'Person__c',
    // 'CommCare_ID__c',
    // fields(
    // relationship('Primary_Caregiver_Lookup__r', 'CommCare_ID__c', state => {
    // return (caregiver = dataValue('properties.caretaker_case_id')(state));
    // }),
    // field('CommCare_ID__c', dataValue('case_id'))
    // )
    // );

    bulk(
    'Person__c',
    'upsert',
    {
    extIdField: 'CommCare_ID__c',
    failOnError: true,
    allowNoOp: true,
    },
    state => {
    console.log('Bulk upserting primary caregiver Persons ::');
    //console.log(JSON.stringify(state.caregiverMapping, null, 2));
    return state.caregiverMapping;
    }
    );

    // TODO, Clean up when pass QA
    // upsertIf(
    // state.data.properties.commcare_username !== 'test.2021' &&
    // state.data.properties.test_user !== 'Yes' &&
    // state.data.properties.mother_case_id !== undefined &&
    // state.data.properties.mother_case_id !== '',
    // 'Person__c',
    // 'CommCare_ID__c',
    // fields(
    // relationship('Mother__r', 'CommCare_ID__c', state => {
    // return (caregiver = dataValue('properties.mother_case_id')(state));
    // }),
    // field('CommCare_ID__c', dataValue('case_id'))
    // )
    // );
    bulk(
    'Person__c',
    'upsert',
    {
    extIdField: 'CommCare_ID__c',
    failOnError: true,
    allowNoOp: true,
    },
    state => {
    console.log('Bulk upserting mother Person::');
    // console.log(JSON.stringify(state.motherMapping, null, 2));
    return state.motherMapping;
    }
    );

    // TODO, Clean up when pass QA
    // upsertIf(
    // state.data.properties.commcare_username !== 'test.2021' &&
    // state.data.properties.test_user !== 'Yes' &&
    // state.data.properties.head_of_household_case_id !== undefined &&
    // state.data.properties.head_of_household_case_id !== '',
    // 'Household__c',
    // 'CommCare_Code__c',
    // fields(
    // field('CommCare_Code__c', dataValue('indices.parent.case_id')),
    // relationship(
    // 'Head_of_Household__r',
    // 'CommCare_ID__c',
    // dataValue('properties.head_of_household_case_id')
    // )
    // )
    // );

    bulk(
    'Household__c',
    'upsert',
    {
    extIdField: 'CommCare_Code__c',
    failOnError: true,
    allowNoOp: true,
    },
    state => {
    console.log('Bulk upserting head of household field on HH ::');
    // console.log(JSON.stringify(state.headOfHouseholdMapping, null, 2));
    return state.headOfHouseholdMapping;
    }
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/WF3-1-Bulk-get-Person-Visit-cases-2023-05-19.html b/adaptors/library/jobs/auto/WF3-1-Bulk-get-Person-Visit-cases-2023-05-19.html index 09169e29a628..eb6199a016e8 100644 --- a/adaptors/library/jobs/auto/WF3-1-Bulk-get-Person-Visit-cases-2023-05-19.html +++ b/adaptors/library/jobs/auto/WF3-1-Bulk-get-Person-Visit-cases-2023-05-19.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    WF3-1 Bulk get Person Visit cases

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: WF3-1 Bulk get Person Visit cases
    • Adaptor: @openfn/language-http
    • Adaptor Version: v4.2.8
    • Created over 1 year ago
    • Updated 13 days ago
    • Score: 72 (an indicator of how useful this job may be)

    Key Functions

    each, get, map

    Expression

    fn(state => {
    const { baseUrl } = state.configuration;

    const caseTypes = ['visite'];

    //NOTE: You can use 'limit' to modify this batch size as desired
    const limit = 1000; //E.g., change to 10 to process records in smaller batch sizes

    //NOTE: indexedOnStart is the default sync start data the FIRST time the job runs
    const indexedOnStart = '2024-05-30T03:00:00';

    //NOTE: After first job run, OpenFn will check the job sync data ("lastRunAt") to set as the indexedOnStart
    const lastRunAt =
    typeof state.lastRunAt !== 'undefined' ? state.lastRunAt : indexedOnStart;
    console.log('Filtering cases with indexed_on_start > than ::', lastRunAt);

    const aMinuteAgo = new Date( Date.now() - 1000 * 60 );
    console.log(aMinuteAgo);

    const queries = caseTypes.map(
    t => `?type=${t}&indexed_on_start=${lastRunAt}&limit=${limit}`
    //NOTE: If for testing, you want to fetch data for a specific historical range (e.g., between April 23 and 24)...
    //...then use the query string below instead of the one above on L16, and custom adjust the index_on start/end dates
    //t => `?type=${t}&indexed_on_start=2024-01-15T00:00:00&limit=${limit}&indexed_on_end=2024-01-16T23:59:59`
    );

    return { ...state, queries, baseUrl, payloads: [] };
    });

    // create a "recursiveGet" which will call itself if CommCare tells us there's
    // more data to fetch for the same form

    fn(state => {
    const recursiveGet = url =>
    get(
    url,
    {
    headers: { 'content-type': 'application/json' },
    },
    nextState => {
    const now = new Date();
    const { baseUrl, data, payloads } = nextState;

    const { meta, objects } = data;
    console.log('Metadata in CommCare response:', meta);

    const finalState = {
    ...nextState,
    payloads: [...payloads, ...objects],
    };

    if (meta.next) {
    console.log('Next query detected, recursing...');
    return recursiveGet(`${baseUrl}${meta.next}`)(finalState);
    }
    finalState.lastRunAt = now.toISOString().slice(0, 19);
    return finalState;
    }
    );

    return { ...state, recursiveGet };
    });

    // for each initial query, fetch data recursively
    each(
    '$.queries[*]',
    fn(state => {
    return state.recursiveGet(`${state.baseUrl}${state.data}`)(state);
    })
    );
    // log the total number of payloads returned
    fn(state => {
    console.log('Count of payloads', state.payloads.length);

    return { ...state, references: [], data: {} };
    });
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/WF3-2-Bulk-upsert-Person-Visits-2023-05-19.html b/adaptors/library/jobs/auto/WF3-2-Bulk-upsert-Person-Visits-2023-05-19.html index 7c8c02f534b4..e1028f4fa28a 100644 --- a/adaptors/library/jobs/auto/WF3-2-Bulk-upsert-Person-Visits-2023-05-19.html +++ b/adaptors/library/jobs/auto/WF3-2-Bulk-upsert-Person-Visits-2023-05-19.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    WF3-2 Bulk upsert Person Visits

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    bulk, dataValue, join, map, query, JSON

    Expression

    fn(state => {
    if (state.payloads.length == 0) return { ...state, personVisits: [] };

    const owner_ids = state.payloads.map(data => data.properties.owner_id);
    const uniq_owner_ids = [...new Set(owner_ids)];

    return { ...state, uniq_owner_ids };
    });

    fn(state => {
    if (state.payloads.length == 0) return state;
    return query(
    `SELECT CommCare_User_ID__c, Id village, Parent_Geographic_Area__c area, Parent_Geographic_Area__r.Name name, Parent_Geographic_Area__r.Parent_Geographic_Area__c catchment FROM Location__c WHERE CommCare_User_ID__c IN ('${state.uniq_owner_ids.join(
    "','"
    )}') GROUP BY Id, CommCare_User_ID__c, Parent_Geographic_Area__c, Parent_Geographic_Area__r.Name, Parent_Geographic_Area__r.Parent_Geographic_Area__c`
    )(state);
    });

    fn(state => {
    if (state.payloads.length == 0) return state;
    const [reference] = state.references;


    // console.log(JSON.stringify(reference, null, 2));
    const records = reference.records;
    const fetchReference = (owner_id, arg) => {
    const result =
    records && records.length > 0
    ? records.filter(record => record.CommCare_User_ID__c === owner_id)
    : 0;

    return result.length > 0 ? result[0][arg] : undefined;
    };
    const cleanChoice = choice => {
    if (choice) {
    return choice.charAt(0).toUpperCase() + choice.slice(1).replace('_', ' ');
    } else {
    return '';
    }
    };

    const handleMultiSelect = multiField => {
    return multiField
    ? multiField
    .replace(/ /gi, ';')
    .toLowerCase()
    .split(';')
    .map(value => {
    return (
    value.charAt(0).toUpperCase() + value.slice(1).replace('_', ' ')
    );
    })
    .join(';')
    : '';
    };

    const handleMultiSelectOriginal = multiField => {
    return multiField
    ? multiField
    .replace(/ /gi, ';')
    .toLowerCase()
    .split(';')
    .map(value => {
    return value;
    })
    .join(';')
    : '';
    };

    const pregDangerMap = {
    Vaginal_Bleeding: 'Vaginal Bleeding',
    Water_Breaks: 'Water Breaks before Time of Delivery',
    Prolonged_Labour: 'Prolonged Labour over 12 Hours',
    Convulsions: 'Convulsions or Fits',
    Abdominal_Pain: 'Severe Abdominal Pain before Delivery',
    High_Fever: 'High Fever',
    Low_Baby_Movement: 'Feeling the Baby move less or not at all',
    Swelling: 'Swelling of Face and Hands',
    Severe_Headache: 'Severe or Continuous Headache for more than 12 hours',
    Severe_Vomiting: 'Severe or Continuous Vomiting',
    none: 'None',
    };

    const counselMap = {
    anc_visits: 'ANC Visits',
    early_initiation_of_anc_less_than_3_months:
    'Early initiation of ANC (less than 3 months)',
    completing_recomended_anc_visits: 'Completing recomended ANC visits',
    danger_signs: 'Danger signs',
    skilled_birth: 'Skilled birth',
    immunization: 'Immunization',
    individual_birth_plan: 'Individual Birth Plan',
    emergency_preparedness: 'Emergency preparedness',
    childcare_and_affection: 'Childcare and affection',
    nutrition_counseling: 'Nutrition counseling',
    growth_monitoring: 'Growth monitoring',
    exclusive_breastfeeding: 'Exclusive breastfeeding',
    complementary_feeding: 'Complementary feeding',
    sleeping_under_llitn: 'Sleeping under LLITN',
    knowing_hiv_status: 'Knowing HIV status',
    indoor_pollution: 'Indoor pollution',
    personal_hygiene: 'Personal Hygiene',
    safe_drinking_water: 'Safe drinking water',
    safe_disposal_of_human_waste: 'Safe disposal of human waste',
    };

    const serviceMap = {
    Scheduled_PSC_Apt: 'Scheduled PSC Apt',
    Adverse_Drug_Reaction_Side_Effect: 'Adverse Drug Reaction/Side Effect',
    Malnutrition: 'Malnutrition',
    Malaria: 'Malaria',
    TB: 'TB',
    Treatment_for_Other_OIs: 'Treatment for other Ols',
    ARI: 'ARI',
    Anemia: 'Anemia',
    Diarrhea: 'Diarrhea',
    Pregnancy_Care: 'Pregnancy Care (ANC)',
    Family_Planning: 'Family Planning (FP)',
    Preconception_Counseling: 'Preconception Counseling',
    Injury: 'Injury',
    Other: 'Other',
    };

    const reasonMap = {
    lack_of_access_to_fp_information: 'Lack of access to FP information',
    no_access_to_fp_services_hospitals:
    'Lack of hospitals or places where FP services can be accessed',
    not_willing_to_use_fp_due_to_negative_effects_myths_and_misconceptions:
    'Myths and misconceptions',
    barriers_at_service_delivery_points: 'Barriers at service delivery points',
    pregnant: 'The client is pregnant',
    intentions_of_getting_pregnant: 'Intentions of getting pregnant',
    not_sexually_active: 'The client is not sexually active',
    other_barriers_culture_male_partners_parents_etc:
    'Other barriers (culture, male partners, parents, etc)',
    };

    const milestoneTypeMap = {
    cognitive_delays_learning_difficulties:
    'Cognitive Delays Learning Difficulties',
    motor_delays: 'Motor Delays',
    speech_and_language_delay: 'Delay Speech and Language Delay',
    social_and_emotional: 'Social and emotional',
    };

    const milestoneMap = {
    movement: 'Movement',
    hearing: 'Hearing',
    communication: 'Communication',
    seeing: 'Seeing',
    cognitive_delays: 'Cognitive Delays',
    play: 'Play',
    };
    const nutritionMap = {
    severe: 'Severely Malnourished',
    moderate: 'Moderately Malnourished',
    normal: 'Normal',
    };

    const fpMethodMap = {
    male_condoms: 'Male condoms',
    female_condoms: 'Female condoms',
    pop: 'POP',
    coc: 'COC',
    emergency_pills: 'Emergency pills',
    none: 'None',
    //HMN -12/01/2023-
    //adding normalization for the family_planning_method to Family_Planning_Method__c
    iucd: 'IUCD',
    condoms: 'Condoms',
    depo: 'Depo',
    implant: 'Implant',
    injection: 'Injection',
    pills: 'Pills',
    traditional: 'Traditional',
    };

    const symptomsMap = {
    convulsions: 'Convulsions',
    not_able_to_eatdrink: 'Not able to drink or feed at all',
    vomits_everything: 'Vomits everything',
    'chest_in-drawing': 'Chest in - drawing',
    unusually_sleepyunconscious: 'Unusually sleepy or unconscious',
    swelling_of_both_feet: 'Swelling of both feet',
    none: 'None',
    };

    const supervisorMap = {
    community_health_nurse: 'Community_health_nurse',
    chw_supervisor: 'CHW_supervisor',
    chewschas: 'Chewschas',
    other: 'Other',
    none: 'None',
    };

    const treatmentDistributionMap = {
    ors_205gltr_sachets: 'ORS (20.5h/ltr): Sachets',
    acts_6s: 'ACTs (6s)',
    acts_12s: 'ACTs (12s)',
    acts_18s: 'ACTs (18s)',
    acts_24s: 'ACTs (24s)',
    albendazole_abz_tabs: 'Albendazole (ABZ): Tabs',
    paracetamol_tabs: 'Tetracycline Eye Ointment (TEO): 1%:tube',
    tetracycline_eye_ointment_teo_1_tube:
    'Tetracycline Eye Ointment (TEO): 1%:tube',
    amoxycillin: 'Amoxycillin (125mg/5mls: Bottle',
    none: 'None',
    };

    const childDangerSignsMap = {
    none: 'None',
    Poor_Breastfeeding: 'Poor Breastfeeding',
    not_able_to_feed_since_birth_or_stopped_feeding_well:
    'Not able to feed since birth, or stopped feeding well',
    not_able_to_breastfeed: 'Not able to breastfeed',
    Fever: 'Fever',
    very_low_temperature: 'Very low temperature (35.4 C or less)',
    shivering: 'Shivering',
    Fast_Breathing: 'Fast Breathing',
    Very_Sleepy: 'Very Sleepy',
    Convulsions_and_Fits: 'Convulsions and Fits',
    only_moves_when_stimulated_or_does_not_move_even_on_stimulation:
    'Only moves when stimulated, or does not move even on stimulation',
    yellow_solebaby_body_turning_yellow_especially_eyes_palms_soles:
    'Yellow sole(Baby body turning yellow especially eyes, palms,soles)',
    bleeding_from_the_umbilical_stump: 'Bleeding from the umbilical stump',
    signs_of_local_infection_umbilicus_is_red_or_draining_pus_skin_boils_or_eye:
    'Signs of local infection: umbilicus is red or draining pus, skin boils, or eyes draining pus',
    weight_chart_using_color_coded_scales_if_red_or_yellowweight_below_25kg_or_:
    'Weight chart using color coded scales if RED or YELLOW(Weight below 2.5kg or born less than 36 weeks of age)',
    unable_to_cry: 'Unable to cry',
    cyanosis: 'Cyanosis',
    bulging_fontanelle: 'Bulging fontanelle',
    };

    return {
    ...state,
    counselMap,
    serviceMap,
    reasonMap,
    milestoneTypeMap,
    milestoneMap,
    nutritionMap,
    pregDangerMap,
    fpMethodMap,
    symptomsMap,
    supervisorMap,
    treatmentDistributionMap,
    childDangerSignsMap,
    fetchReference,
    cleanChoice,
    handleMultiSelect,
    handleMultiSelectOriginal,
    };
    });

    fn(state => {
    if (state.payloads.length == 0) return state;
    const {
    counselMap,
    serviceMap,
    reasonMap,
    milestoneTypeMap,
    milestoneMap,
    nutritionMap,
    pregDangerMap,
    fpMethodMap,
    symptomsMap,
    supervisorMap,
    treatmentDistributionMap,
    childDangerSignsMap,
    fetchReference,
    cleanChoice,
    handleMultiSelect,
    handleMultiSelectOriginal,
    } = state;

    const personVisits = state.payloads
    //HMN 30/06/2023 Allow test user to post
    /*
    .filter(
    p =>
    p.properties.username !== 'test.2021' &&
    p.properties.test_user !== 'Yes'
    )*/
    .map(p => {
    // commCareVisitID
    const commCareCase_id = p.case_id;
    const dateVisit = p.properties.date_opened;
    const commCareVisitID = commCareCase_id + '_' + dateVisit;

    // personsSymptoms
    const psCheck = p.properties.symptoms_check_other;
    const psValue =
    psCheck && psCheck !== ''
    ? psCheck
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return symptomsMap[value] || value;
    })
    : undefined;
    const personsSymptoms = psValue ? psValue.join(';') : undefined;

    // familyPlanningMethod
    const fpmStatus = p.properties.family_planning_method;
    const fpmValue =
    fpmStatus && fpmStatus !== ''
    ? fpmStatus
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return fpMethodMap[value] || value;
    })
    : undefined;
    const familyPlanningMethod = fpmValue ? fpmValue.join(';') : undefined;

    // fpMethodDistributed
    const fpmdStatus = p.properties.FP_commodity;
    const fpmdValue =
    fpmdStatus && fpmdStatus !== ''
    ? fpmdStatus
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return fpMethodMap[value] || value;
    })
    : undefined;
    const fpMethodDistributed = fpmdValue ? fpmdValue.join(';') : undefined;

    // reasonForNotTakingFPMethod
    const rfntStatus = p.properties.No_FPmethod_reason;
    const rfntValue =
    rfntStatus && rfntStatus !== ''
    ? rfntStatus
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return reasonMap[value] || value;
    })
    : undefined;
    const reasonForNotTakingFPMethod = rfntValue
    ? rfntValue.join(';')
    : undefined;

    // clientCounselledOnC
    const ccocChoices =
    p.properties.counsel_topic || p.properties.counsel_topic;
    const ccocVhoiceGroups = ccocChoices ? ccocChoices.split(' ') : null;
    const clientCounselledOnC = ccocVhoiceGroups
    ? ccocVhoiceGroups
    .map(cg => {
    return counselMap[cg];
    })
    .join(';')
    : ccocVhoiceGroups;

    // treatmentDistributionC
    //const tdcStatus = p.form.treatment_and_tracking.distribution.distributed_treatments;
    const tdcStatus = p.properties.distributed_treatments;
    const tdcValue =
    tdcStatus && tdcStatus !== ''
    ? tdcStatus
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return treatmentDistributionMap[value] || value;
    })
    : undefined;
    const treatmentDistributionC = tdcValue ? tdcValue.join(';') : undefined;

    // chronicIllnesC
    const ciChoice =
    p.properties.please_specify_which_chronic_illness_the_person_has;
    const ciChoice2 = handleMultiSelect(ciChoice);
    const chronicIllnesC = ciChoice2 ? ciChoice2.replace(/_/g, ' ') : '';

    // supervisorVisit
    const svCheck = p.properties.supervisor_visit;
    const svValue =
    svCheck && svCheck !== ''
    ? svCheck
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return supervisorMap[value] || value;
    })
    : undefined;
    const supervisorVisit = svValue ? svValue.join(';') : undefined;
    const recordType = p.properties.RecordType;

    return {
    CommCare_ID__c: p.case_id, //'visit' case_id
    'Person__r.CommCare_ID__c':
    p.indices.parent.case_id || p.properties.parent_id,
    CommCare_Visit_ID__c: commCareVisitID,
    Date__c: p.properties.Date,
    Birth_Status__c: p.properties.child_status,
    Catchment__c: fetchReference(p.properties.owner_id, 'catchment'),
    //HMN Accommodating Record Type in Visit
    'RecordType.Name': recordType === 'Unborn' || recordType === 'Child'
    ? 'Child Visit'
    :recordType === 'Youth'
    ? 'Youth Visit'
    :recordType === 'Male Adult'
    ? 'Adult Male Visit'
    : recordType === 'Female Adult'
    ? 'Adult Female Visit'
    :undefined,
    Use_mosquito_net__c: cleanChoice(p.properties.sleep_under_net),
    Individual_birth_plan_counselling__c:
    p.properties.individual_birth_plan,
    Reason_for_not_taking_a_pregnancy_test__c: p.properties.No_Preg_Test
    ? p.properties.No_Preg_Test.toString().replace(/_/g, ' ')
    : undefined,
    Pregnancy_danger_signs__c: p.properties.No_Preg_Test
    ? pregDangerMap[p.properties.No_Preg_Test]
    : undefined,
    Child_Danger_Signs__c: p.properties.Other_Danger_Signs
    ? childDangerSignsMap[p.properties.Other_Danger_Signs]
    : undefined,
    Current_Malaria_Status__c: cleanChoice(
    p.properties.malaria_test_results
    ),
    Malaria_Home_Test__c: p.properties.malaria_test_date,
    Malaria_Home_Treatment__c: p.properties.malaria_test_date,
    Persons_symptoms__c: personsSymptoms,
    Active_in_Support_Group__c: p.properties.Active_in_Support_Group,
    HAWI_Defaulter__c: p.properties.default === 'Yes' ? true : false,
    Date_of_Default__c: p.properties.date_of_default,
    Persons_temperature__c: p.properties.temperature,
    Days_since_illness_start__c: p.properties.duration_of_sickness,
    Newborn_visited_48_hours_of_delivery__c:
    p.properties.newborn_visited_48_hours_of_delivery,
    Newborn_visited_by_a_CHW_within_6_days__c:
    p.properties.visit_6_days_from_delivery,
    Current_Malaria_Status__c: p.properties.malaria_test_results,
    Malaria_test__c: cleanChoice(p.properties.malaria_test),
    Fever__c: cleanChoice(p.properties.symptoms_check_fever),
    Cough__c: cleanChoice(p.properties.symptoms_check_cough),
    Diarrhoea__c: cleanChoice(p.properties.symptoms_check_diarrhea),
    TB_patients_therapy_observed__c: p.properties.observed_tb_therapy,
    Injuries_or_wounds__c: p.properties.wounds_or_injuries,
    Currently_on_ART_s__c: p.properties.ART,
    // ART_Regimen__c: () => {
    // const choice = dataValue(
    // 'properties.ARVs;
    // return cleanChoice(choice);
    // },
    Immediate_Breastfeeding__c: p.properties.Breastfeeding_Delivery,
    Exclusive_Breastfeeding__c: p.properties.Exclusive_Breastfeeding,
    Counselled_on_Exclusive_Breastfeeding__c: p.properties.counseling,
    LMP__c: p.properties.when_was_your_lmp,
    Family_Planning__c: cleanChoice(p.properties.family_planning),
    Family_Planning_Method__c: p.properties.family_planning_method,
    Family_Planning_Method__c: familyPlanningMethod,
    FP_Method_Distributed__c: fpMethodDistributed,
    Reasons_for_not_taking_FP_method__c: reasonForNotTakingFPMethod,
    Pregnant__c: p.properties.Pregnant === 'Yes' ? true : false,
    Counselled_on_FP_Methods__c: cleanChoice(
    p.properties.CounselledFP_methods
    ),
    Client_counselled_on__c: clientCounselledOnC,
    Client_provided_with_FP__c: cleanChoice(
    p.properties[
    'was_the_woman_15-49yrs_provided_with_family_planning_commodities_by_chv'
    ]
    ),
    Newborn_visited_48_hours_of_delivery__c:
    p.properties.newborn_visited_48_hours_of_delivery,
    Mother_visit_counselling__c: cleanChoice(
    p.properties.did_you_consel_the_mother_on1
    ),
    mother_visited_48_hours_of_the_delivery__c:
    p.properties.visit_mother_48,
    Newborn_visit_counselling__c: cleanChoice(
    p.properties.did_you_consel_the_mother_on2
    ),
    Know_HIV_status__c: cleanChoice(p.properties.known_hiv_status),
    HIV_Status__c: p.properties.hiv_status,
    Treatment_Distribution__c: treatmentDistributionC,
    // QUESTION: Field name not found : Current_Weight__c
    // Current_Weight__c: p.properties.Current_Weight,
    Current_Height__c: p.properties.current_height,
    Current_MUAC__c: p.properties.MUAC,
    Food_groups_3_times_a_day__c: p.properties.food_groups,
    Nutrition_Case_Managed__c: p.properties.nutrition_case_managed,
    Nutrition_Danger_Signs__c: handleMultiSelectOriginal(
    p.properties.nutrition_danger_signs
    ),
    Why_was_nutrition_case_not_managed__c:
    p.properties.nutrition_case_not_managed_why,
    Community_Nutrition_Treatment__c:
    p.properties.nutrition_treatment_severe,
    Community_Nutrition_Treatment__c:
    p.properties.nutrition_treatment_moderate,
    Why_was_nutrition_treatment_not_given__c:
    p.properties.nutrition_treatment_not_given,
    Current_Nutrition_Status__c: p.properties.Nutrition_Status
    ? nutritionMap[p.properties.Nutrition_Status]
    : undefined,
    Default_on_TB_treatment__c: cleanChoice(
    p.properties.default_tb_treatment
    ),
    Received_pregnancy_test__c: cleanChoice(
    p.properties.did_you_adminsiter_a_pregnancy_test
    ),
    Pregnancy_test_result__c: cleanChoice(
    p.properties.pregnancy_test_result
    ),
    Chronic_illness__c: chronicIllnesC,
    Childs_breath_per_minute__c: p.properties.breaths_per_minuite,
    Child_chest_in_drawing__c: p.properties.Child_chest_in_drawing_c,
    Caregiver_counseled_on_delayed_milestone__c:
    p.properties.did_you_counsel_the_caregiver_on_delayed_milestones,
    Delayed_Milestone__c:
    p.properties.does_the_child_has_a_delayed_milestone,
    Child_has_2_or_more_play_items__c:
    p.properties.does_the_child_has_2_or_more_play_items_at_home,
    Child_has_3_more_picture_books__c:
    p.properties.does_the_child_has_3_or_more_picture_books,
    Delayed_Milestones_Counselled_On__c: p.properties
    .which_delayed_milestone_area_did_you_counsel_the_caregiver_on
    ? milestoneMap[
    p.properties
    .which_delayed_milestone_area_did_you_counsel_the_caregiver_on
    ]
    : undefined,
    Delayed_Milestone_Type__c: p.properties.which_delayed_milestone
    ? milestoneMap[p.properties.which_delayed_milestone]
    : undefined,
    Caretaker_trained_in_muac__c: p.properties.mother_trained_muac,
    Caretaker_screened_for_muac_this__c:
    p.properties.mother_screened_child_muac,
    Caretaker_muac_findings__c:
    p.properties.mother_screened_child_muac_result,
    Caretaker_action_after_muac_screening__c:
    p.properties.mother_screened_muac_action,
    of_Caretaker_MUAC_screenings__c: p.properties.mother_nb_screening,
    Pulse_Oximeter__c: p.properties.pulse_oximeter_available,
    Heart_Rate_Pulse_Oximeter__c: p.properties.heart_rate_pulse_oximeter,
    Oxygen_Concentration_Pulse_Oximeter__c:
    p.properties.oxygen_concentration,
    Can_child_drink__c: p.properties.can_child_drink,
    Antibiotic_provided_for_fast_breathing__c:
    p.properties.antibiotic_fast_breathing,
    Antibiotic_provided_for_chest_indrawing__c:
    p.properties.antibiotic_chest_indrawing,
    Supervisor_Visit__c: supervisorVisit,
    //HMN commented this one due to error "Error: InvalidBatch : Field name not found : Visit_Closed_Date__c"
    //Visit_Closed_Date__c: p.properties.date_closed,
    //29/06/2023 Added Malaria Vaccine mapping
    malaria_vaccine_received__c:
    p.properties.malaria_vaccine_received,
    rts_s_1_date__c:
    p.properties.rts_s_1_date,
    rts_s_2_date__c:
    p.properties.rts_s_2_date,
    rts_s_3_date__c:
    p.properties.rts_s_3_date,
    rts_s_4_date__c:
    p.properties.rts_s_4_date,

    //HMN 29/06/2023
    };
    });

    personVisits.forEach(person => {
    Object.entries(person).forEach(([key, value]) => {
    if (value === '' || value === null) person[key] = undefined;
    });
    });

    // JSON logging of records
    //HMN debugger 19/10/2023
    // console.log(JSON.stringify(personVisits, null, 2));

    return { ...state, personVisits };
    });

    bulk(
    'Person_visit__c',
    'upsert',
    {
    extIdField: 'CommCare_ID__c',
    failOnError: true,
    allowNoOp: true,
    },
    state => {
    console.log('Bulk upserting person visit...');
    return state.personVisits;
    }
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/WF3-2a-Repeat-Failed-Person-Visits-2023-05-31.html b/adaptors/library/jobs/auto/WF3-2a-Repeat-Failed-Person-Visits-2023-05-31.html index 97e41685520e..e48e10f1e524 100644 --- a/adaptors/library/jobs/auto/WF3-2a-Repeat-Failed-Person-Visits-2023-05-31.html +++ b/adaptors/library/jobs/auto/WF3-2a-Repeat-Failed-Person-Visits-2023-05-31.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    WF3-2a Repeat Failed Person Visits

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    each, get, map

    Expression

    fn(state => {
    const { baseUrl } = state.configuration;

    const caseTypes = ['visite'];

    //NOTE: You can use 'limit' to modify this batch size as desired
    const limit = 1000; //E.g., change to 10 to process records in smaller batch sizes

    //NOTE: indexedOnStart is the default sync start data the FIRST time the job runs
    const indexedOnStart = '2024-05-30T03:00:00';

    //NOTE: After first job run, OpenFn will check the job sync data ("lastRunAt") to set as the indexedOnStart
    const lastRunAt =
    typeof state.lastRunAt !== 'undefined' ? state.lastRunAt : indexedOnStart;
    console.log('Filtering cases with indexed_on_start > than ::', lastRunAt);

    const aMinuteAgo = new Date( Date.now() - 1000 * 60 );
    console.log(aMinuteAgo);

    const queries = caseTypes.map(
    t => `?type=${t}&indexed_on_start=${lastRunAt}&limit=${limit}`
    //NOTE: If for testing, you want to fetch data for a specific historical range (e.g., between April 23 and 24)...
    //...then use the query string below instead of the one above on L16, and custom adjust the index_on start/end dates
    //t => `?type=${t}&indexed_on_start=2024-01-15T00:00:00&limit=${limit}&indexed_on_end=2024-01-16T23:59:59`
    );

    return { ...state, queries, baseUrl, payloads: [] };
    });

    // create a "recursiveGet" which will call itself if CommCare tells us there's
    // more data to fetch for the same form

    fn(state => {
    const recursiveGet = url =>
    get(
    url,
    {
    headers: { 'content-type': 'application/json' },
    },
    nextState => {
    const now = new Date();
    const { baseUrl, data, payloads } = nextState;

    const { meta, objects } = data;
    console.log('Metadata in CommCare response:', meta);

    const finalState = {
    ...nextState,
    payloads: [...payloads, ...objects],
    };

    if (meta.next) {
    console.log('Next query detected, recursing...');
    return recursiveGet(`${baseUrl}${meta.next}`)(finalState);
    }
    finalState.lastRunAt = now.toISOString().slice(0, 19);
    return finalState;
    }
    );

    return { ...state, recursiveGet };
    });

    // for each initial query, fetch data recursively
    each(
    '$.queries[*]',
    fn(state => {
    return state.recursiveGet(`${state.baseUrl}${state.data}`)(state);
    })
    );
    // log the total number of payloads returned
    fn(state => {
    console.log('Count of payloads', state.payloads.length);

    return { ...state, references: [], data: {} };
    });
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/WF4-1-Bulk-get-Referral-Cases-2023-05-19.html b/adaptors/library/jobs/auto/WF4-1-Bulk-get-Referral-Cases-2023-05-19.html index d4464a45c857..dad3462b0d38 100644 --- a/adaptors/library/jobs/auto/WF4-1-Bulk-get-Referral-Cases-2023-05-19.html +++ b/adaptors/library/jobs/auto/WF4-1-Bulk-get-Referral-Cases-2023-05-19.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    WF4-1 Bulk get Referral Cases

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: WF4-1 Bulk get Referral Cases
    • Adaptor: @openfn/language-http
    • Adaptor Version: v4.2.8
    • Created over 1 year ago
    • Updated 13 days ago
    • Score: 72 (an indicator of how useful this job may be)

    Key Functions

    each, get, map

    Expression

    fn(state => {
    const { baseUrl } = state.configuration;

    const caseTypes = ['Case'];

    //NOTE: You can use 'limit' to modify this batch size as desired
    const limit = 1000; //E.g., change to 10 to process records in smaller batch sizes

    //NOTE: indexedOnStart is the default sync start data the FIRST time the job runs
    const indexedOnStart = '2024-01-17T00:00:00';

    //NOTE: After first job run, OpenFn will check the job sync data ("lastRunAt") to set as the indexedOnStart
    const lastRunAt =
    typeof state.lastRunAt !== 'undefined' ? state.lastRunAt : indexedOnStart;
    console.log('Filtering cases with indexed_on_start > than ::', lastRunAt);

    const queries = caseTypes.map(
    t => `?type=${t}&indexed_on_start=${lastRunAt}&limit=${limit}`
    //NOTE: If for testing, you want to fetch data for a specific historical range (e.g., between April 23 and 24)...
    //...then use the query string below instead of the one above on L16, and custom adjust the index_on start/end dates
    //t => `?type=${t}&indexed_on_start=2024-01-14T00:00:00&limit=${limit}&indexed_on_end=2024-01-16T23:59:59`
    );

    return { ...state, queries, baseUrl, payloads: [] };
    });

    // create a "recursiveGet" which will call itself if CommCare tells us there's
    // more data to fetch for the same form
    fn(state => {
    const recursiveGet = url =>
    get(
    url,
    {
    headers: { 'content-type': 'application/json' },
    },
    nextState => {
    const now = new Date();
    const { baseUrl, data, payloads } = nextState;

    const { meta, objects } = data;
    console.log('Metadata in CommCare response:', meta);

    const finalState = {
    ...nextState,
    payloads: [...payloads, ...objects],
    };

    if (meta.next) {
    console.log('Next query detected, recursing...');
    return recursiveGet(`${baseUrl}${meta.next}`)(finalState);
    }
    finalState.lastRunAt = now.toISOString().slice(0, 19);
    return finalState;
    }
    );

    return { ...state, recursiveGet };
    });

    // for each initial query, fetch data recursively
    each(
    '$.queries[*]',
    fn(state => {
    return state.recursiveGet(`${state.baseUrl}${state.data}`)(state);
    })
    );
    // log the total number of payloads returned
    fn(state => {
    console.log('Count of payloads', state.payloads.length);
    return { ...state, references: [], data: {} };
    });
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/WF4-2-Bulk-upsert-Services-2023-05-19.html b/adaptors/library/jobs/auto/WF4-2-Bulk-upsert-Services-2023-05-19.html index e53a8683fe0b..aa9c0591b87b 100644 --- a/adaptors/library/jobs/auto/WF4-2-Bulk-upsert-Services-2023-05-19.html +++ b/adaptors/library/jobs/auto/WF4-2-Bulk-upsert-Services-2023-05-19.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    WF4-2 Bulk upsert Services

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    bulk, join, map, query, JSON

    Expression

    // NOTE: We perform a query before anything else if this is a 'Case'
    fn(state => {
    // state.type = state.data.indices.parent.case_type;
    if (state.payloads.length == 0) return { ...state, services: [] };

    const caseType = state.payloads
    .filter(c => c.indices.parent.case_type === 'Case')
    .map(c => c.indices.parent.case_id);

    console.log(JSON.stringify(caseType, null, 2));

    if (caseType.length > 0)
    return query(
    `SELECT Person__r.CommCare_ID__c FROM Service__c WHERE Service_UID__c IN ('${caseType.join(
    "','"
    )}')`
    )(state).then(state => {
    const { records } = state.references[0];
    const ccId =
    records.length == 1 ? records[0].Person__r.CommCare_ID__c : null;
    return { ...state, ccId };
    });

    return state;
    });

    // NOTE: We construct a facilityMap and populate some conditional relationships
    fn(state => {
    if (state.payloads.length == 0) return state;
    const facilityMap = {
    Lwala_Hospital: 'Lwala Hospital',
    Minyenya_Dispensary: 'Minyenya Dispensary',
    Ndege_Oriedo_Dispensary: 'Ndege Oriedo Dispensary',
    'Rongo_Sub-District_Hospital': 'Rongo Sub-District Hospital',
    Kangeso_Dispensary: 'Kangeso Dispensary',
    Ngodhe_Dispensary: 'Ngodhe Dispensary',
    Ngere_Dispensary: 'Ngere Dispensary',
    Verna_Health_Center: 'Verna Health Center',
    Kochola_Dispensary: 'Kochola Dispensary',
    Ongo_Health_Center: 'Ongo Health Center',
    Royal_Medical_Center: 'Royal Medical Center',
    Rosewood_Facility: 'Rosewood Facility',
    Other: 'Other',
    };

    const pregDangerMap = {
    Vaginal_Bleeding: 'Vaginal Bleeding',
    Water_Breaks: 'Water Breaks before Time of Delivery',
    Prolonged_Labour: 'Prolonged Labour over 12 Hours',
    Convulsions: 'Convulsions or Fits',
    Abdominal_Pain: 'Severe Abdominal Pain before Delivery',
    High_Fever: 'High Fever',
    Low_Baby_Movement: 'Feeling the Baby move less or not at all',
    Swelling: 'Swelling of Face and Hands',
    Severe_Headache: 'Severe or Continuous Headache for more than 12 hours',
    Severe_Vomiting: 'Severe or Continuous Vomiting',
    none: 'None',
    };

    const serviceMap = {
    Scheduled_PSC_Apt: 'Scheduled PSC Apt',
    Adverse_Drug_Reaction_Side_Effect: 'Adverse Drug Reaction/Side Effect',
    Malnutrition: 'Malnutrition',
    Malaria: 'Malaria',
    TB: 'TB',
    Treatment_for_Other_OIs: 'Treatment for Other OIs',
    ARI: 'ARI',
    Anemia: 'Anemia',
    Diarrhea: 'Diarrhea',
    Pregnancy_Care: 'Pregnancy Care (ANC)',
    Family_Planning: 'Family Planning (FP)',
    Preconception_Counseling: 'Preconception Counseling',
    Injury: 'Injury',
    Other: 'Other',
    };

    const milestoneTypeMap = {
    cognitive_delays_learning_difficulties:
    'Cognitive Delays (Learning Difficulties)',
    motor_delays: 'Motor Delays',
    speech_and_language_delay: 'Speech and language Delay',
    social_and_emotional: 'Social and emotional',
    };

    const symptomsMap = {
    convulsions: 'Convulsions',
    not_able_to_eatdrink: 'Not able to eat/drink',
    vomits_everything: 'Vomits everything',
    'chest_in-drawing': 'Chest in-drawing',
    unusually_sleepyunconscious: 'Unusually sleepy/unconscious',
    swelling_of_both_feet: 'Swelling of both feet',
    };

    const childSignMap = {
    Poor_Breastfeeding: 'Poor Breastfeeding (under 6 months old child)',
    not_able_to_feed_since_birth_or_stopped_feeding_well:
    'Not able to feed since birth, or stopped feeding well',
    not_able_to_breastfeed: 'Not able to breastfeed',
    Fever: 'Fever (37.5 C or more)',
    very_low_temperature: 'Very low temperature (35.4 C or less)',
    shivering: 'Shivering',
    Fast_Breathing: 'Fast Breathing',
    Very_Sleepy: 'Very Sleepy',
    Convulsions_and_Fits: 'Convulsions and Fits',
    only_moves_when_stimulated_or_does_not_move_even_on_stimulation:
    'Only moves when stimulated, or does not move even on stimulation',
    yellow_solebaby_body_turning_yellow_especially_eyes_palms_soles:
    'Yellow sole(Baby body turning yellow especially eyes, palms, soles)',
    bleeding_from_the_umbilical_stump: 'Bleeding from the umbilical stump',
    signs_of_local_infection_umbilicus_is_red_or_draining_pus_skin_boils_or_eye:
    'Signs of local infection: umbilicus is red or draining pus, skin boils, or eyes draining pus',
    weight_chart_using_color_coded_scales_if_red_or_yellowweight_below_25kg_or_:
    'Weight chart using color coded scales if RED or YELLOW(Weight below 2.5kg or born less than 36 weeks of age)',
    unable_to_cry: 'Unable to cry',
    cyanosis: 'Cyanosis',
    bulging_fontanelle: 'Bulging fontanelle',
    };

    const otherReferralMap = {
    HIV_Testing_and_Counseling: 'HIV Testing and Counseling',
    Visit_to_Clinician: 'Visit to Clinician',
    Adverse_Drug_Reaction_Side_Effect: 'Adverse Drug Reaction Side Effect',
    Malnutrition: 'Malnutrition',
    Malaria: 'Malaria',
    PMTCT: 'PMTCT',
    TB: 'TB',
    Treatment_for_other_OIs: 'Treatment for other OIs',
    ARI: 'ARI',
    Anemia: 'Anemia',
    Diarrhea: 'Diarrhea',
    Pregnancy_Care_ANCE: 'Pregnancy Care (ANC)',
    Family_Planning_FP: 'Family Planning (FP)',
    Preconception_Counseling: 'Preconception Counseling',
    Injury: 'Injury',
    blood_in_stool: 'Blood in Stool',
    Blood_in_Stool: 'Blood in Stool',
    Immunization: 'Immunization',
    Routine_Health_Check_ups: 'Routine Health Check ups',
    routine_health_check_ups: 'Routine Health Check ups',
    Other: 'Other',
    Poor_Breastfeeding: 'Poor Breastfeeding (under 6 months old child)',
    not_able_to_feed_since_birth_or_stopped_feeding_well:
    'Not able to feed since birth, or stopped feeding well',
    not_able_to_breastfeed: 'Not able to breastfeed',
    Fever: 'Fever (37.5 C or more)',
    very_low_temperature: 'Very low temperature (35.4 C or less)',
    shivering: 'Shivering',
    Fast_Breathing: 'Fast Breathing',
    Very_Sleepy: 'Very Sleepy',
    Convulsions_and_Fits: 'Convulsions and Fits',
    only_moves_when_stimulated_or_does_not_move_even_on_stimulation:
    'Only moves when stimulated, or does not move even on stimulation',
    yellow_solebaby_body_turning_yellow_especially_eyes_palms_soles:
    'Yellow sole(Baby body turning yellow especially eyes, palms, soles)',
    bleeding_from_the_umbilical_stump: 'Bleeding from the umbilical stump',
    signs_of_local_infection_umbilicus_is_red_or_draining_pus_skin_boils_or_eye:
    'Signs of local infection: umbilicus is red or draining pus, skin boils, or eyes draining pus',
    weight_chart_using_color_coded_scales_if_red_or_yellowweight_below_25kg_or_:
    'Weight chart using color coded scales if RED or YELLOW(Weight below 2.5kg or born less than 36 weeks of age)',
    unable_to_cry: 'Unable to cry',
    cyanosis: 'Cyanosis',
    bulging_fontanelle: 'Bulging fontanelle',
    };

    const homeCareMap = {
    Adherence_Counseling: 'Adherence Counseling',
    Pill_Count_Monitoring: 'Pill Count Monitoring',
    Nutrition_Assessment_and_Counseling: 'Nutrition Assessment and Counseling',
    WASH_Counseling: 'WASH Counseling',
    Prevention_Counseling: 'Prevention Counseling',
    Psychosocial_Support: 'Psychosocial Support',
    Provision_of_Supplies: 'Provision of Supplies',
    OI_Management_Support: 'OI Management Support',
    };

    const ecdMap = {
    physiotherapy: 'Physiotherapy',
    speech_therapy: 'Speech Therapy',
    nutrition_education: 'Nutrition Education',
    play_therapy: 'Play Therapy',
    assessment: 'Assessment',
    counselling: 'Counselling',
    other: 'Other',
    };

    const clinicalMap = {
    diarrhea: 'Diarrhea',
    malnutrition: 'Malnutrition',
    malaria: 'Malaria',
    acute_respiratory_infection: 'Acute Respiratoy Infection (ARI)',
    accident_injury: 'Accident/Injury',
    other: 'Other',
    };

    const caseType = state.payloads
    .filter(c => c.indices.parent.case_type === 'Case')
    .map(c => c.indices.parent.case_id);

    const personType = state.payloads
    .filter(c => c.indices.parent.case_type === 'Person')
    .map(c => c.indices.parent.case_id);

    let relationships = [];

    // If it's a person, add the person relationship
    if (personType.length > 0) {
    personType.forEach(case_id => {
    relationships.push({ 'Person__r.CommCare_ID__c': case_id });
    });
    }

    // If it's a service, add the service rship AND a different person rship
    if (caseType.length > 0) {
    caseType.forEach(case_id => {
    relationships.push({ 'Parent_Service__r.Service_UID__c': case_id });
    });

    relationships.push({ 'Person__r.CommCare_ID__c': state.ccId });
    }

    return {
    ...state,
    facilityMap,
    relationships,
    serviceMap,
    pregDangerMap,
    milestoneTypeMap,
    symptomsMap,
    childSignMap,
    otherReferralMap,
    homeCareMap,
    clinicalMap,
    ecdMap,
    };
    });

    // NOTE: We finally upsert to the Service__c object in Salesforce
    fn(state => {
    if (state.payloads.length == 0) return state;
    const services = state.payloads
    .filter(r => r.properties.owner_id !== '8e725928e3ce43d19b390dd604097069')
    .map(r => {
    // pregnancyDangerSigns
    const pCheck = r.properties.pregnancy_danger_signs;
    const pValue =
    pCheck && pCheck !== ''
    ? pCheck
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return state.pregDangerMap[value] || value;
    })
    : undefined;
    const pregnancyDangerSigns = pValue ? pValue.join(';') : undefined;

    // childDangerSigns
    const cCheck = r.properties.Other_Danger_Signs;
    const cValue =
    cCheck && cCheck !== ''
    ? cCheck
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return state.childSignMap[value] || value;
    })
    : undefined;
    const childDangerSigns = cValue ? cValue.join(';') : undefined;

    // delayedMilestone
    const dCheck = r.properties.which_delayed_milestone;
    const dValue =
    dCheck && dCheck !== ''
    ? dCheck
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return state.milestoneTypeMap[value] || value;
    })
    : undefined;
    const delayedMilestone = dValue ? dValue.join(';') : undefined;

    // seriousSymptoms
    const sCheck = r.properties.symptoms_check_other;
    const sValue =
    sCheck && sCheck !== ''
    ? sCheck
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return state.symptomsMap[value] || value;
    })
    : undefined;
    const seriousSymptoms = sValue ? sValue.join(';') : undefined;

    // otherReferralReason
    const otCheck = r.properties.Other_Referral_Reasons;
    const otValue =
    otCheck && otCheck !== ''
    ? otCheck
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return state.otherReferralMap[value] || value;
    })
    : undefined;
    const otherReferralReason = otValue ? otValue.join(';') : undefined;

    // homeBasedCareRendered
    const homeCheck = r.properties.Home_Based_Care_Provided;
    const homeValue =
    homeCheck && homeCheck !== ''
    ? homeCheck
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return state.homeCareMap[value] || value;
    })
    : undefined;
    const homeBasedCareRendered = homeValue ? homeValue.join(';') : undefined;

    // ecdClinicalService
    const ecdCheck = r.properties.ECD_Clinical_Service;
    const ecdValue =
    ecdCheck && ecdCheck !== ''
    ? ecdCheck
    .replace(/ /gi, ';')
    .split(';')
    .map(value => {
    return state.ecdMap[value] || value;
    })
    : undefined;
    const ecdClinicalService = ecdValue ? ecdValue.join(';') : undefined;

    return {
    'Person__r.CommCare_ID__c':
    r.indices.parent.case_type === 'Person'
    ? r.indices.parent.case_id
    : r.indices.parent.case_type === 'Case'
    ? state.ccId
    : undefined,
    Service_UID__c: r.case_id,
    CommCare_Code__c: r.case_id,
    RecordTypeID: '01224000000YAuK',
    'Household_CHW__r.CommCare_ID__c': r.properties.CHW_ID,
    Open_Case__c: r.closed === false ? true : false,
    Case_Closed_Date__c: r.properties.date_closed,
    Age_Time_of_Service__c: r.properties.age,
    Source__c: r.properties.Source === '1',
    Clinical_facility__c: r.properties.Facility_Visited
    ? state.facilityMap[r.properties.Facility_Visited]
    : undefined,
    Client_Received_Services_at_Facility2__c: r.properties.Facility_Visit,
    Clinical_Visit_Date__c:
    r.properties.Facility_Date === '' ||
    r.properties.Facility_Date === undefined
    ? undefined
    : r.properties.Facility_Date,
    CHW_Followed_Up_with_the_Client__c: r['properties.Follow-Up']!== ''
    ? r['properties.Follow-Up']
    : undefined,
    Follow_Up_Date__c: r['properties.Follow-Up_Date'],

    Person_Complied_w_Referral_in_24_hrs__c:r.properties.referral_compliance,
    Skillled_Delivery__c: r.properties.skilled_delivery,
    Child_received_immunizations__c: r.properties.immunization,
    Received_a_diagnosis_for_PSBI__c: r.properties.psbi_diagnosis !== ''
    ? r.properties.psbi_diagnosis
    : undefined, //Form: CHW.Follow-Up.PSBI.psbi_diagnosis
    Received_antibiotics_per_protocol__c: r.properties.antibiotic_8days, //Form: CHW.Follow-Up.PSBI.antibiotic_8day

    Distributed_Treatment_on_Last_Visit__c:
    r.properties.distribute_treatment, //Form: CHW.Follow-Up.distribute_treatment
    Person_had_an_adverse_drug_reaction__c:
    r.properties.adverse_drug_reaction,
    Defaulted__c:
    r.properties.date_of_default && r.properties.date_of_default !== ''
    ? true
    : false,
    Date_of_Default__c: r.properties.date_of_default,
    Client_s_Symptoms_Improved__c: r.properties.Client_Improved,
    Case_Type__c: r.properties.Case_Type,
    Follow_Up_By_Date__c:
    r.properties['Follow-Up_By_Date'] &&
    r.properties['Follow-Up_By_Date'] !== ''
    ? r.properties['Follow-Up_By_Date']
    : undefined,
    Date__c: new Date(r.properties.date_opened).toISOString(),
    Reason_for_Service__c: r.properties.Reason_for_Service,
    Type_of_Service__c: r.properties.Type_of_Service,
    Malaria_Status__c: r.properties.Malaria_Status,
    Home_Treatment_Date__c: r.properties.home_treatment_date,
    Malaria_Home_Test_Date__c: r.properties.malaria_test_date,
    Home_ORS__c: r.properties.clinic_ors,
    Home_Zinc__c: r.properties.clinic_zinc,
    Height__c: r.properties.height,
    Weight__c: r.properties.weight,
    MUAC__c: r.properties.muac,
    Nutrition_Status__c: r.properties.Nutrition_Status,

    //===== NEW MAPPINGS - JAN 14 ===========================//
    Pregnancy_Danger_Signs__c: pregnancyDangerSigns,
    Child_Danger_Signs__c: childDangerSigns,
    Delayed_Milestone__c: delayedMilestone,
    Serious_Symptoms__c: seriousSymptoms,
    Other_Referral_Reasons__c: otherReferralReason,
    Home_Based_Care_Rendered__c: homeBasedCareRendered,
    PSBI_Visit__c:
    r.properties.psbi_task && r.properties.psbi_task !== ''
    ? `Day ${r.properties.psbi_task}`
    : undefined,
    Clinical_Services__c: r.properties.TT5_Clinical_Service
    ? state.clinicalMap[r.properties.TT5_Clinical_Service]
    : r.properties.TT5_Clinical_Service,
    Referred_Facility__c: r.properties.referred_facility
    ? state.facilityMap[r.properties.referred_facility]
    : r.properties.referred_facility,
    HAWI_Clinical_Services__c: r.properties.HAWI_Clinical_Service
    ? state.serviceMap[r.properties.HAWI_Clinical_Service]
    : r.properties.HAWI_Clinical_Service,
    ECD_Clinical_Services__c: ecdClinicalService,

    };
    });

    return { ...state, services };
    });
    /* JSON logging of records
    fn(state => {
    console.log('Services to upsert ::', JSON.stringify(state.services));
    return state;
    });
    */

    bulk(
    'Service__c',
    'upsert',
    {
    extIdField: 'Service_UID__c',
    failOnError: true,
    allowNoOp: true,
    },
    state => {
    console.log('Bulk upserting service...');
    return state.services;
    }
    );
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/aleksa-cron-2022-04-29.html b/adaptors/library/jobs/auto/aleksa-cron-2022-04-29.html index 8ea9960a50ab..c026079925cd 100644 --- a/adaptors/library/jobs/auto/aleksa-cron-2022-04-29.html +++ b/adaptors/library/jobs/auto/aleksa-cron-2022-04-29.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    aleksa cron

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    Expression

    fn(state => {
    console.log(state);
    return state;
    })
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/alter-state-before-operations.html b/adaptors/library/jobs/auto/alter-state-before-operations.html index e827973d36c1..c4d4b2478d79 100644 --- a/adaptors/library/jobs/auto/alter-state-before-operations.html +++ b/adaptors/library/jobs/auto/alter-state-before-operations.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Pre-processing data

    📜 This job is an official example from OpenFn.

    Metadata

    Key Functions

    dataPath, dataValue, each, field, fields, merge, relationship, upsert, Array

    Expression

    // Here, we make sure CommCare gives us an array to use in each(merge(...), ...)
    fn(state => {
    const idCards = state.data.form.ID_cards_given_to_vendor;
    if (!Array.isArray(idCards)) {
    state.data.form.ID_cards_given_to_vendor = [idCards];
    }
    return state;
    });

    // Now state has been changed, and we carry on...
    each(
    merge(
    dataPath('form.ID_cards_given_to_vendor[*]'),
    fields(
    field('Vendor_Id', dataValue('form.ID_vendor')),
    field('form_finished_time', dataValue('form.meta.timeEnd'))
    )
    ),
    upsert(
    'Small_Packet__c',
    'sp_id__c',
    fields(
    field('sp_id__c', dataValue('ID_cards_given_to_vendor')),
    relationship('Vendor__r', 'Badge_Code__c', dataValue('Vendor_Id')),
    field(
    'Small_Packet_Distribution_Date__c',
    dataValue('form_finished_time')
    )
    )
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/async-and-array-dot-map.html b/adaptors/library/jobs/auto/async-and-array-dot-map.html index 96d8c0319b37..f243b0462391 100644 --- a/adaptors/library/jobs/auto/async-and-array-dot-map.html +++ b/adaptors/library/jobs/auto/async-and-array-dot-map.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Using async and array.map

    📜 This job is an official example from OpenFn.

    Metadata

    Key Functions

    map, post, async, await, Promise

    Expression

    fn(state => {
    console.log('Here we will await the result of a LOT of async operations.');

    console.log('First we needed to break large arrays into smaller chunks.');
    function chunk(arr, chunkSize) {
    var R = [];
    for (var i = 0, len = arr.length; i < len; i += chunkSize)
    R.push(arr.slice(i, i + chunkSize));
    return R;
    }

    const clinicSets = chunk(state.data.Clinic, 10);
    const patientSets = chunk(state.data.Patient, 10);
    const visitSets = chunk(state.data.Visit, 10);
    const deletedVisitSets = chunk(state.data.VisitDeleted, 10);

    console.log('Then we define a bunch of different async functions.');
    const postClinics = async cs => {
    return post(state.configuration.inboxUrl, {
    body: { clinics: cs },
    })(state);
    };

    const postPatients = async ps => {
    return post(state.configuration.inboxUrl, {
    body: { patients: ps },
    })(state);
    };

    const postVisits = async vs => {
    return post(state.configuration.inboxUrl, {
    body: { visits: vs },
    })(state);
    };

    const postDeletedVisits = async dvs => {
    return post(state.configuration.inboxUrl, {
    body: { deletedVisits: dvs },
    })(state);
    };

    console.log(
    'Then we define a single function that wraps them all up and waits for all the individual functions to resolve.'
    );
    async function makePosts() {
    return Promise.all([
    ...clinicSets.map(item => postClinics(item)),
    ...patientSets.map(item => postPatients(item)),
    ...visitSets.map(item => postVisits(item)),
    ...deletedVisitSets.map(item => postDeletedVisits(item)),
    ]);
    }

    console.log(
    'Then we return that function, forcing our next operation to await the result of this one.'
    );
    return makePosts();
    });

    fn(state => {
    console.log('I show up AFTER those async functions are resolved.');
    return state;
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/async-findValue.html b/adaptors/library/jobs/auto/async-findValue.html index 080d622095a4..89d1074c0b80 100644 --- a/adaptors/library/jobs/auto/async-findValue.html +++ b/adaptors/library/jobs/auto/async-findValue.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Using findValue with an array of data

    📜 This job is an official example from OpenFn.

    Metadata

    Key Functions

    findValue, upsertMany, async, await

    Expression

    fn(async state => {
    const dataArray =
    state.data.body.st_grass_repeat ||
    state.data.body["plot_forest_area/st_grass_repeat"] ||
    [];
    const dataGrass = [];
    const path = state.data.body.st_grass_repeat
    ? "st_grass_repeat"
    : "plot_forest_area/st_grass_repeat";

    for (let data of uniqueGrass) {
    dataGrass.push({
    WCSPROGRAMS_TaxaID: await findValue({
    uuid: "WCSPROGRAMS_TaxaID",
    relation: "WCSPROGRAMS_Taxa",
    where: {
    ScientificName: `%${state.handleValue(
    data["st_grass_repeat/grass_species"]
    )}%`,
    },
    operator: { ScientificName: "like" },
    })(state),
    UnknownSpeciesImage: data[`${path}/noknown`],
    GrassPercent: data[`${path}/grass_perc`],
    GrassHeight: data[`${path}/grass_height`],
    AnswerId: state.data.body._id,
    });
    }

    return upsertMany(
    "WCSPROGRAMS_VegetationGrass",
    "WCSPROGRAMS_VegetationGrassCode",
    () => dataGrass
    )(state);
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/bring-formId-into-data-array-then-create-parent-and-children-in-salesforce.html b/adaptors/library/jobs/auto/bring-formId-into-data-array-then-create-parent-and-children-in-salesforce.html index e10625d6c88b..a19ca22bd633 100644 --- a/adaptors/library/jobs/auto/bring-formId-into-data-array-then-create-parent-and-children-in-salesforce.html +++ b/adaptors/library/jobs/auto/bring-formId-into-data-array-then-create-parent-and-children-in-salesforce.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Using merge and each

    📜 This job is an official example from OpenFn.

    Metadata

    Key Functions

    create, dataPath, dataValue, each, field, fields, index, join, lastReferenceValue, merge, relationship

    Expression

    each(
    join('$.data.data[*]', '$.data.formId', 'formId'),
    create(
    'ODK_Submission__c',
    fields(
    //bridgetest sandbox record type, comment out when not in use
    field('RecordTypeId', '012J00000005hlb'),
    //prduction record type, comment out when not in use
    //field("RecordType", "XXXXXXXXXXXXXXXX"),
    // or
    //relationship("RecordType", "name", dataValue("recort_type_name")),
    field('Record_Type_Name__c', dataValue('record_type_id')),
    field('ODK_Form_Name__c', dataValue('formId')),
    field('Site_School_ID_Number__c', dataValue('site')),
    field('BT_Staff_ID__c', dataValue('recorded_by')),
    field('Date__c', dataValue('today')),
    field('Head_of_Household__c', dataValue('head_of_household')),
    field(
    'Head_of_Household_Gender__c',
    dataValue('head_of_household_gender')
    ),
    field('Head_of_Household_age__c', dataValue('head_of_household_age')),
    field('Light_Source__c', dataValue('light_source')),
    field('communication__c', dataValue('communication')),
    field('transport__c', dataValue('transport')),
    field(
    'number_of_children_in_household__c',
    dataValue('number_of_children')
    ),
    field('school_visits__c', dataValue('school_visits')),
    field('school_visit_reason__c', dataValue('school_visit_reason')),
    field('Village__c', dataValue('village')),
    field('ODK_Key__c', dataValue('*meta-instance-id*'))
    )
    )
    ),
    each(
    merge(
    dataPath('individual_na[*]'),
    fields(
    field('metaId', dataValue('*meta-instance-id*')),
    field('parentId', lastReferenceValue('id')),
    field('village', dataValue('$data.village'))
    )
    ),
    create(
    'ODK_Submission__c',
    fields(
    //bridgetest sandbox record type, comment out when not in use
    field('RecordTypeId', '012J00000005hla'),
    //prduction record type, comment out when not in use
    //field("RecordType", "XXXXXXXXXXXXXXXX"),
    // or
    //relationship("RecordType", "name", dataValue("recort_type_name")),
    field('Related_ODK_Submission__c', dataValue('parentId')),
    field('family_name__c', dataValue('given_name')),
    field('school_coded__c', dataValue('school_coded')),
    field('school_type__c', dataValue('school_type')),
    field('gender__c', dataValue('gender')),
    field('Pays_School_Fees__c', dataValue('school_fees_yes_no')),
    field('in_primary_school__c', dataValue('in_primary_school')),
    field('School_Fee_Amount__c', dataValue('school_fees')),
    field('Age__c', dataValue('age')),
    field('surname__c', dataValue('surname')),
    field('out_of_school_reason__c', dataValue('out_of_school_reason')),
    field('class_level__c', dataValue('class_level')),
    field(
    'other_out_of_school_reason__c',
    dataValue('other_out_of_school_reason')
    ),
    field('Village__c', dataValue('village')),
    // This is a concatenation, adding the unique child ID.
    field('ODK_Key__c', function (state) {
    return dataValue('metaId')(state).concat('(', index()(state), ')');
    })
    )
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/commcare-asri-bulk-upload.html b/adaptors/library/jobs/auto/commcare-asri-bulk-upload.html index f0c169fe1d13..52979091843b 100644 --- a/adaptors/library/jobs/auto/commcare-asri-bulk-upload.html +++ b/adaptors/library/jobs/auto/commcare-asri-bulk-upload.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Bulk upload obat lookup-table

    📜 This job is an official example from OpenFn.

    Metadata

    Key Functions

    bulk, map

    Expression


    // Bulk update obat lookup-table
    fn(state => {
    const { medication_ids, visit, obat } = state.data
    state.medication_ids = medication_ids;
    state.visit = visit
    state.obat = obat
    return state
    })

    fn(state => {

    const properties = state.visit.properties;

    const data = state.medication_ids
    .flatMap(medicine => {
    const medicineName = properties[Object.keys(medicine)[0]];
    return state.obat.filter(
    item => item.fields['Nama'] === medicineName
    ).map(item => ({ ...item, fields: { ...item.fields, satusehat_id: Object.values(medicine)[0] } }))
    }).map(obat => {
    const data = {
    UID: obat.id,
    'DELETE(Y/N)': 'N',
    'field:Nama': obat.fields['Nama'],
    'field:Satuan': obat.fields['Satuan'],
    'field:Harga': obat.fields['Harga'],
    'field:kfa_codes': obat.fields['kfa_codes'],
    'field:satusehat_id': obat.fields['satusehat_id'],
    'field:strength': obat.fields['strength'],
    'field:strength_unit': obat.fields['strength_unit'],
    }
    return data
    })

    state.medicationMappedData = {
    types: [{
    'DELETE(Y/N)': 'N',
    table_id: 'test_obat',
    'is_global?': 'yes',
    'field 1': 'Nama',
    'field 2': 'Satuan',
    'field 3': 'Harga',
    'field 4': 'kfa_codes',
    'field 5': 'satusehat_id',
    'field 6': 'strength',
    'field 7': 'strength_unit',
    }],
    test_obat: data,
    }

    return state
    })

    bulk(
    'lookup-table',
    state => state.medicationMappedData,
    { replace: false }
    )

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/commcare-reports-api-2016-08-29.html b/adaptors/library/jobs/auto/commcare-reports-api-2016-08-29.html index dfda8947a591..6f224e92ee96 100644 --- a/adaptors/library/jobs/auto/commcare-reports-api-2016-08-29.html +++ b/adaptors/library/jobs/auto/commcare-reports-api-2016-08-29.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    commcare reports api

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    • Name: commcare reports api
    • Adaptor: @openfn/language-http
    • Adaptor Version: v0.0.9
    • Created over 8 years ago
    • Updated over 8 years ago
    • Score: 0 (an indicator of how useful this job may be)

    Key Functions

    get, post, Promise

    Expression

    get("api/v0.5/configurablereportdata/daily_form_stats", {
    query: function(state) {
    return { date: state.lastSubmissionDate || "Aug 29, 2016 4:44:26 PM" }
    },
    callback: function(state) {
    // Pick submissions out in order to avoid `post` overwriting `response`.
    var submissions = state.response.body;
    // Use .slice to limit how much you send to the server for testing
    // return submissions
    return submissions.reduce(function(acc, item) {
    return acc.then(
    post(
    "http://localhost:4000/inbox/8ad63a29-5c25-4d8d-ba2c-fe6274dcfbab",
    { body: item }
    )
    )
    }, Promise.resolve(state))
    .then(function(state) {
    console.log(submissions.length)
    if (submissions.length) {
    state.lastSubmissionDate = submissions[submissions.length-1].SubmissionDate
    }
    return state;
    })
    .then(function(state) {
    delete state.response
    return state;
    })
    }
    })
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/complex-http-request-chains.html b/adaptors/library/jobs/auto/complex-http-request-chains.html index 87a22912c3aa..def626f51afd 100644 --- a/adaptors/library/jobs/auto/complex-http-request-chains.html +++ b/adaptors/library/jobs/auto/complex-http-request-chains.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Chaining HTTP Requests

    📜 This job is an official example from OpenFn.

    Metadata

    Key Functions

    dataPath, each, get, post, put

    Expression

    each(
    dataPath('someArray[*]'),
    post(
    'https://en7a5l7u3izq6.x.pipedream.net/',
    {
    body: state => {
    return { name: state.data.surname, age: state.data.age };
    },
    },
    state => {
    console.log('in the callback');
    console.log(state.data);
    get(
    'https://en7a5l7u3izq6.x.pipedream.net/',
    {},
    // Note how we don't use: `put(args)(state)` because state is already
    // provided by the parent operation, get(), to its callback...
    put('https://en7a5l7u3izq6.x.pipedream.net/')
    // ...but since we've called get() INSIDE an anonymous function, we'll
    // need to pass state to it manually: get(args)(state)...
    )(state);
    return state;
    }
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/complex-state-control.html b/adaptors/library/jobs/auto/complex-state-control.html index 147b050e2b7d..bed0a8996a35 100644 --- a/adaptors/library/jobs/auto/complex-state-control.html +++ b/adaptors/library/jobs/auto/complex-state-control.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Using promises

    📜 This job is an official example from OpenFn.

    Metadata

    Key Functions

    query

    Expression

    // Example with language-salesforce
    fn(state => {
    // return state => {
    return new Promise((resolve, reject) => {
    query('SELECT Name FROM Account')(state)
    .then(state => {
    console.log(state.references[0].records);
    console.log('doing stuff here');
    return state;
    })
    .then(state => {
    console.log('and in here');
    resolve(state);
    });
    });
    // };
    });

    fn(state => {
    console.log('and also in here!');
    console.log(state.references);
    return state;
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/concatenate-many-fields-with-nulls.html b/adaptors/library/jobs/auto/concatenate-many-fields-with-nulls.html index 33ee200e454d..91942f4c8027 100644 --- a/adaptors/library/jobs/auto/concatenate-many-fields-with-nulls.html +++ b/adaptors/library/jobs/auto/concatenate-many-fields-with-nulls.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Concat fields with nulls

    📜 This job is an official example from OpenFn.

    Metadata

    Key Functions

    arrayToString, create, dataValue, each, field, fields, relationship

    Expression

    each(
    '$.data.data[*]',
    create(
    'Verification__c',
    fields(
    field('RecordTypeId', '01236000000Q6PT'),
    relationship(
    'Supplier__r',
    'Unique_Entity_ID__c',
    dataValue('Unique_Entity_ID')
    ),
    field('Currency_ISO_Code__c', dataValue('Currency_ISO_Code')),
    field('Date_Conducted__c', dataValue('Date_Conducted')),
    field('ODK_Key__c', dataValue('*meta-instance-id*')),
    field('Unique_Entity_ID__c', dataValue('Unique_Entity_ID')),
    field('Interviewee__c', dataValue('Interviewee')),
    field('Interviewee_Role__c', dataValue('Interviewee_Role')),
    field(
    'Interviewee_Primary_Phone__c',
    dataValue('Interviewee_Primary_Phone')
    ),
    field('Interviewee_Phone_2__c', dataValue('Interviewee_Phone_2')),
    field('Interviewee_Phone_3__c', dataValue('Interviewee_Phone_3')),
    field(
    'Interviewee_Primary_Email__c',
    dataValue('Interviewee_Primary_Email')
    ),
    field('Trade_Name__c', dataValue('Trade_Name')),
    field('Registered_Name__c', dataValue('Registered_Name')),
    field('Location_Description__c', dataValue('Location_Description')),
    field('Main_Office_Country__c', dataValue('Main_Office_Country')),
    field('Main_Office_Region_Province_or_County__c', function (state) {
    return arrayToString(
    [
    dataValue('Main_Office_Region_Province_or_County_a')(state),
    dataValue('Main_Office_Region_Province_or_County_b')(state),
    dataValue('Main_Office_Region_Province_or_County_c')(state),
    dataValue('Main_Office_Region_Province_or_County_d')(state),
    ].filter(Boolean),
    ','
    );
    }),
    field('Main_Office_City__c', function (state) {
    return arrayToString(
    [
    dataValue('Main_Office_City_a')(state),
    dataValue('Main_Office_City_b')(state),
    dataValue('Main_Office_City_c')(state),
    dataValue('Main_Office_City_d')(state),
    ].filter(Boolean),
    ','
    );
    }),
    field(
    'Main_Office_Street_Address__c',
    dataValue('Main_Office_Street_Address')
    ),
    field('Geolocation__Latitude__s', dataValue('gps:Latitude')),
    field('Geolocation__Longitude__s', dataValue('gps:Longitude')),
    field('Main_Contact_First__c', dataValue('Main_Contact_First')),
    field('Main_Contact_Last__c', dataValue('Main_Contact_Last')),
    field('Main_Contact_Role__c', dataValue('Main_Contact_Role')),
    field('Main_Contact_Role_Other__c', dataValue('Main_Contact_Role_Other')),
    field(
    'Main_Contact_Phone_Mobile__c',
    dataValue('Main_Contact_Phone_Mobile')
    ),
    field('Main_Contact_Phone_Work__c', dataValue('Main_Contact_Phone_Work')),
    field(
    'Main_Contact_Phone_Other__c',
    dataValue('Main_Contact_Phone_Other')
    ),
    field('Main_Contact_Email_Work__c', dataValue('Main_Contact_Email_Work')),
    field('General_Phone__c', dataValue('General_Phone')),
    field('General_Email__c', dataValue('General_Email')),
    field('Website__c', dataValue('Website')),
    field('Interest_in_Website__c', dataValue('Interest_in_Website')),
    field(
    'Hours_of_Operation_Start__c',
    dataValue('Hours_of_Operation_Start')
    ),
    field('Hours_of_Operation_End__c', dataValue('Hours_of_Operation_End')),
    field(
    'Hours_of_Operation_Other__c',
    dataValue('Hours_of_Operation_Other')
    ),
    field(
    'Hours_of_Operation_Other_Start__c',
    dataValue('Hours_of_Operation_Other_Start')
    ),
    field(
    'Hours_of_Operation_Other_End__c',
    dataValue('Hours_of_Operation_Other_End')
    ),
    field(
    'Goods_and_Services_Description__c',
    dataValue('Goods_and_Services_Description')
    ),
    field('Primary_Sector__c', dataValue('Primary_Sector')),
    field('Primary_Subsectors__c', function (state) {
    return arrayToString(
    [
    dataValue('Primary_Subsectors_1')(state),
    dataValue('Primary_Subsectors_2')(state),
    dataValue('Primary_Subsectors_3')(state),
    dataValue('Primary_Subsectors_4')(state),
    dataValue('Primary_Subsectors_5')(state),
    dataValue('Primary_Subsectors_6')(state),
    dataValue('Primary_Subsectors_7')(state),
    dataValue('Primary_Subsectors_8')(state),
    dataValue('Primary_Subsectors_9')(state),
    dataValue('Primary_Subsectors_10')(state),
    dataValue('Primary_Subsectors_l1')(state),
    dataValue('Primary_Subsectors_12')(state),
    dataValue('Primary_Subsectors_13')(state),
    dataValue('Primary_Subsectors_14')(state),
    dataValue('Primary_Subsectors_15')(state),
    dataValue('Primary_Subsectors_16')(state),
    dataValue('Primary_Subsectors_17')(state),
    dataValue('Primary_Subsectors_18')(state),
    dataValue('Primary_Subsectors_19')(state),
    dataValue('Primary_Subsectors_20')(state),
    dataValue('Primary_Subsectors_21')(state),
    ].filter(Boolean),
    ','
    );
    }),
    field('Other_Sectors__c', function (state) {
    return arrayToString(dataValue('Other_Sectors')(state), ',');
    }),
    field('Other_Subsectors__c', function (state) {
    return arrayToString(
    [
    dataValue('Other_Subsectors_1')(state),
    dataValue('Other_Subsectors_2')(state),
    dataValue('Other_Subsectors_3')(state),
    dataValue('Other_Subsectors_4')(state),
    dataValue('Other_Subsectors_5')(state),
    dataValue('Other_Subsectors_6')(state),
    dataValue('Other_Subsectors_7')(state),
    dataValue('Other_Subsectors_8')(state),
    dataValue('Other_Subsectors_9')(state),
    dataValue('Other_Subsectors_10')(state),
    dataValue('Other_Subsectors_l1')(state),
    dataValue('Other_Subsectors_12')(state),
    dataValue('Other_Subsectors_13')(state),
    dataValue('Other_Subsectors_14')(state),
    dataValue('Other_Subsectors_15')(state),
    dataValue('Other_Subsectors_16')(state),
    dataValue('Other_Subsectors_17')(state),
    dataValue('Other_Subsectors_18')(state),
    dataValue('Other_Subsectors_19')(state),
    dataValue('Other_Subsectors_20')(state),
    dataValue('Other_Subsectors_21')(state),
    ].filter(Boolean),
    ','
    );
    }),
    field(
    'Entity_and_Registration_1__c',
    dataValue('Entity_and_Registration_1')
    ),
    field(
    'Entity_and_Registration_2__c',
    dataValue('Entity_and_Registration_2')
    ),
    field(
    'Entity_and_Registration_3__c',
    dataValue('Entity_and_Registration_3')
    ),
    field('Registration_Date__c', dataValue('Registration_Date')),
    field('Registration_Active__c', dataValue('Registration_Active')),
    field(
    'Business_Operation_Licenses__c',
    dataValue('Business_Operation_Licenses')
    ),
    field(
    'Business_Operation_Certificates__c',
    dataValue('Business_Operation_Certificates')
    ),
    field('Association_Memberships__c', dataValue('Association_Memberships')),
    field('Vendor_List_Memberships__c', dataValue('Vendor_List_Memberships')),
    field('Has_Marketing_Plan__c', dataValue('Has_Marketing_Plan')),
    field('Number_of_Competitors__c', dataValue('Number_of_Competitors')),
    field('Start_of_Operations__c', dataValue('Start_of_Operations')),
    field('Primary_Language__c', dataValue('Primary_Language')),
    field('Primary_Language_Other__c', dataValue('Primary_Language_Other')),
    field('English_Speakers__c', dataValue('English_Speakers')),
    field('Other_Languages__c', dataValue('Other_Languages')),
    field(
    'Frequency_of_Internet_Access__c',
    dataValue('Frequency_of_Internet_Access')
    ),
    field(
    'Method_of_Internet_Access__c',
    dataValue('Method_of_Internet_Access')
    ),
    field(
    'Method_of_Internet_Access_Other__c',
    dataValue('Method_of_Internet_Access_Other')
    ),
    field('Frequency_of_Email_Use__c', dataValue('Frequency_of_Email_Use')),
    field('Type_of_Email_Use__c', dataValue('Type_of_Email_Use')),
    field('Counties_Regions_Serviced__c', function (state) {
    return arrayToString(
    [
    dataValue('Counties_Regions_Serviced_a')(state),
    dataValue('Counties_Regions_Serviced_b')(state),
    dataValue('Counties_Regions_Serviced_c')(state),
    dataValue('Counties_Regions_Serviced_d')(state),
    ].filter(Boolean),
    ','
    );
    }),
    field('Additional_Branches__c', dataValue('Additional_Branches')),
    field('Branch_Locations__c', function (state) {
    return arrayToString(
    [
    dataValue('Branch_Locations_a')(state),
    dataValue('Branch_Locations_b')(state),
    dataValue('Branch_Locations_c')(state),
    dataValue('Branch_Locations_d')(state),
    ].filter(Boolean),
    ','
    );
    }),
    field(
    'Majority_Local_or_Foreign__c',
    dataValue('Majority_Local_or_Foreign')
    ),
    field('Num_of_Owners__c', dataValue('Num_of_Owners')),
    field('Num_of_Female_Owners__c', dataValue('Num_of_Female_Owners')),
    field('Num_of_Male_Owners__c', dataValue('Num_of_Male_Owners')),
    field(
    'Primary_Owner_is_Same_as_Main_Contact__c',
    dataValue('Primary_Owner_is_Same_as_Main_Contact')
    ),
    field('Primary_Owner__c', dataValue('Primary_Owner')),
    field('Primary_Owner_Gender__c', dataValue('Primary_Owner_Gender')),
    field(
    'Primary_Owner_Gender_Other__c',
    dataValue('Primary_Owner_Gender_Other')
    ),
    field(
    'Primary_Owner_Nationality__c',
    dataValue('Primary_Owner_Nationality')
    ),
    field(
    'Primary_Owner_Phone_Mobile__c',
    dataValue('Primary_Owner_Phone_Mobile')
    ),
    field(
    'Primary_Owner_Phone_Work__c',
    dataValue('Primary_Owner_Phone_Work')
    ),
    field(
    'Primary_Owner_Phone_Other__c',
    dataValue('Primary_Owner_Phone_Other')
    ),
    field('Primary_Owner_Email__c', dataValue('Primary_Owner_Email')),
    field('Num_of_Businesses_Owned__c', dataValue('Num_of_Businesses_Owned')),
    field(
    'Names_of_Businesses_Owned__c',
    dataValue('Names_of_Businesses_Owned')
    ),
    field('Num_of_Managers__c', dataValue('Num_of_Managers')),
    field('Num_of_Female_Managers__c', dataValue('Num_of_Female_Managers')),
    field('Num_of_Male_Managers__c', dataValue('Num_of_Male_Managers')),
    field('Finance_Management__c', dataValue('Finance_Management')),
    field(
    'Finance_Management_Other__c',
    dataValue('Finance_Management_Other')
    ),
    field('Dedicated_HR_Manager__c', dataValue('Dedicated_HR_Manager')),
    field(
    'Num_of_Permanent_Full_Time_Employees__c',
    dataValue('Num_of_Permanent_Full_Time_Employees')
    ),
    field(
    'Num_of_Perm_Full_Time_Female_Employees__c',
    dataValue('Num_of_Perm_Full_Time_Female_Employees')
    ),
    field(
    'Num_of_Perm_Full_Time_Male_Employees__c',
    dataValue('Num_of_Perm_Full_Time_Male_Employees')
    ),
    field(
    'Num_of_Full_Time_Temporary_Employees__c',
    dataValue('Num_of_Full_Time_Temporary_Employees')
    ),
    field(
    'Num_of_Full_Time_Temp_Female_Employees__c',
    dataValue('Num_of_Full_Time_Temp_Female_Employees')
    ),
    field(
    'Num_of_Full_Time_Temp_Male_Employees__c',
    dataValue('Num_of_Full_Time_Temp_Male_Employees')
    ),
    field(
    'Num_of_Local_Staff_Full_Part_Time__c',
    dataValue('Num_of_Local_Staff_Full_Part_Time')
    ),
    field(
    'Num_of_Expatriate_Staff_Full_Part_Time__c',
    dataValue('Num_of_Expatriate_Staff_Full_Part_Time')
    ),
    field(
    'International_Client_in_Past_Six_Months__c',
    dataValue('International_Client_in_Past_Six_Months')
    ),
    field('Principal_Client_Name__c', dataValue('Principal_Client_Name')),
    field(
    'Foreign_or_Domestic_Principal_Client__c',
    dataValue('Foreign_or_Domestic_Principal_Client')
    ),
    field('Principal_Client_Sector__c', dataValue('Principal_Client_Sector')),
    field(
    'Goods_Services_Provided_to_this_Client__c',
    dataValue('Goods_Services_Provided_to_this_Client')
    ),
    field(
    'End_of_Last_Contract_with_this_Client__c',
    dataValue('End_of_Last_Contract_with_this_Client')
    ),
    field(
    'Value_Goods_Services_Sold_Last_6_Months__c',
    dataValue('Value_Goods_Services_Sold_Last_6_Months')
    ),
    field(
    'Value_Goods_Sold_Last_6_Months_USD__c',
    dataValue('Value_Goods_Sold_Last_6_Months_USD')
    ),
    field(
    'Access_to_Finance_Constraint_Ranking__c',
    dataValue('Access_to_Finance_Constraint_Ranking')
    ),
    field('Bank_Account__c', dataValue('Bank_Account')),
    field('Bank_Guarantee__c', dataValue('Bank_Guarantee')),
    field(
    'Satisfied_with_Current_Bank__c',
    dataValue('Satisfied_with_Current_Bank')
    ),
    field(
    'Describe_Satisfaction_with_Current_Bank__c',
    dataValue('Describe_Satisfaction_with_Current_Bank')
    ),
    field(
    'Has_Received_a_Formal_Loan__c',
    dataValue('Has_Received_a_Formal_Loan')
    ),
    field('Formal_Loan_Provider__c', dataValue('Formal_Loan_Provider')),
    field(
    'Formal_Loan_Amount_Received__c',
    dataValue('Formal_Loan_Amount_Received')
    ),
    field(
    'Formal_Loan_Amount_Received_USD__c',
    dataValue('Formal_Loan_Amount_Received_USD')
    ),
    field(
    'Date_Formal_Loan_Received__c',
    dataValue('Date_Formal_Loan_Received')
    ),
    field('Formal_Loan_Purpose__c', dataValue('Formal_Loan_Purpose')),
    field(
    'Formal_Loan_Purpose_Other__c',
    dataValue('Formal_Loan_Purpose_Other')
    ),
    field('Formal_Loan_Repaid__c', dataValue('Formal_Loan_Repaid')),
    field('Interested_in_Loan__c', dataValue('Interested_in_Loan')),
    field('Interested_Loan_Amount__c', dataValue('Interested_Loan_Amount')),
    field(
    'Interested_Loan_Amount_USD__c',
    dataValue('Interested_Loan_Amount_USD')
    ),
    field(
    'Interested_Loan_Duration__c',
    dataValue('Interested_Loan_Duration')
    ),
    field('Interested_Loan_Purpose__c', dataValue('Interested_Loan_Purpose')),
    field(
    'Interested_Loan_Purpose_Other__c',
    dataValue('Interested_Loan_Purpose_Other')
    ),
    field(
    'Formal_Loan_Confidence_Ranking__c',
    dataValue('Formal_Loan_Confidence_Ranking')
    ),
    field(
    'Received_Loan_from_Family_Friends__c',
    dataValue('Received_Loan_from_Family_Friends')
    ),
    field(
    'Family_Friend_Loan_Amount__c',
    dataValue('Family_Friend_Loan_Amount')
    ),
    field(
    'Family_Friend_Loan_Amount_USD__c',
    dataValue('Family_Friend_Loan_Amount_USD')
    ),
    field(
    'Received_Loan_from_Informal_Lenders__c',
    dataValue('Received_Loan_from_Informal_Lenders')
    ),
    field(
    'Informal_Lender_Loan_Amount__c',
    dataValue('Informal_Lender_Loan_Amount')
    ),
    field(
    'Informal_Lender_Loan_Amount_USD__c',
    dataValue('Informal_Lender_Loan_Amount_USD')
    ),
    field(
    'Interested_in_Investor_Business_Partner__c',
    dataValue('Interested_in_Investor_Business_Partner')
    ),
    field(
    'Total_Turnover_Previous_Month__c',
    dataValue('Total_Turnover_Previous_Month')
    ),
    field(
    'Total_Turnover_Previous_Month_USD__c',
    dataValue('Total_Turnover_Previous_Month_USD')
    ),
    field(
    'Total_Turnover_Previous_Fiscal_Year__c',
    dataValue('Total_Turnover_Previous_Fiscal_Year')
    ),
    field(
    'Total_Turnover_Previous_Fiscal_Yr_USD__c',
    dataValue('Total_Turnover_Previous_Fiscal_Yr_USD')
    ),
    field(
    'Total_Profit_Previous_Fiscal_Year__c',
    dataValue('Total_Profit_Previous_Fiscal_Year')
    ),
    field(
    'Total_Profit_Previous_Fiscal_Year_USD__c',
    dataValue('Total_Profit_Previous_Fiscal_Year_USD')
    ),
    field(
    'Accepted_Modes_of_Payment__c',
    dataValue('Accepted_Modes_of_Payment')
    ),
    field(
    'Accepted_Modes_of_Payment_Other__c',
    dataValue('Accepted_Modes_of_Payment_Other')
    ),
    field(
    'Avg_Expen_Spent_on_Imported_Goods_Year__c',
    dataValue('Avg_Expen_Spent_on_Imported_Goods_Year')
    ),
    field(
    'Avg_Expen_Spent_on_Domestic_Goods_Year__c',
    dataValue('Avg_Expen_Spent_on_Domestic_Goods_Year')
    ),
    field(
    'Avg_Expen_on_Domestic_Suppliers_Year__c',
    dataValue('Avg_Expen_on_Domestic_Suppliers_Year')
    ),
    field(
    'Avg_Expen_on_Intl_Suppliers_Year__c',
    dataValue('Avg_Expen_on_Intl_Suppliers_Year')
    ),
    field(
    'Avg_Expen_Spent_on_Salaries_Year__c',
    dataValue('Avg_Expen_Spent_on_Salaries_Year')
    ),
    field(
    'Balance_Sheet_Statement_Available__c',
    dataValue('Balance_Sheet_Statement_Available')
    ),
    field('Profit_Loss_Statement__c', dataValue('Profit_Loss_Statement')),
    field('Directly_Imports_Goods__c', dataValue('Directly_Imports_Goods')),
    field(
    'Avg_of_Total_Costs_from_Imports__c',
    dataValue('Avg_of_Total_Costs_from_Imports')
    ),
    field('Highest_Costing_Import__c', dataValue('Highest_Costing_Import')),
    field(
    'Origin_Country_of_Highest_Costing_Import__c',
    dataValue('Origin_Country_of_Highest_Costing_Import')
    ),
    field('Other_Import_Countries__c', dataValue('Other_Import_Countries')),
    field('Exports_Products__c', dataValue('Exports_Products')),
    field(
    'Avg_of_Total_Revenue_from_Exports__c',
    dataValue('Avg_of_Total_Revenue_from_Exports')
    ),
    field('Primary_Export__c', dataValue('Primary_Export')),
    field('Destination_of_Exports__c', dataValue('Destination_of_Exports')),
    field(
    'Profits_Expectation_Next_Six_Months__c',
    dataValue('Profits_Expectation_Next_Six_Months')
    ),
    field(
    'Staff_Expectation_Next_Six_Months__c',
    dataValue('Staff_Expectation_Next_Six_Months')
    ),
    field(
    'Int_l_Entities_Represent_Good_Opp__c',
    dataValue('Int_l_Entities_Represent_Good_Opp')
    ),
    field(
    'Int_l_Concessionaires_Represent_Good_Opp__c',
    dataValue('Int_l_Concessionaires_Represent_Good_Opp')
    ),
    field(
    'Sectors_Representing_Best_Local_Opps__c',
    dataValue('Sectors_Presenting_Best_Local_Opps')
    ),
    field(
    'Obstacle_Working_with_Intl_Entities__c',
    dataValue('Obstacle_Working_with_Intl_Entities')
    ),
    field(
    'Biggest_Challenge_Next_6_Months__c',
    dataValue('Biggest_Challenge_Next_6_Months')
    ),
    field(
    'Second_Biggest_Challenge_Next_6_Months__c',
    dataValue('Second_Biggest_Challenge_Next_6_Months')
    ),
    field(
    'Financial_Management_Ranking__c',
    dataValue('Financial_Management_Ranking')
    ),
    field(
    'Access_to_Finance_Ranking__c',
    dataValue('Access_to_Finance_Ranking')
    ),
    field('Administration_Ranking__c', dataValue('Administration_Ranking')),
    field('Human_Resources_Ranking__c', dataValue('Human_Resources_Ranking')),
    field(
    'Technical_Expertise_Ranking__c',
    dataValue('Technical_Expertise_Ranking')
    ),
    field(
    'Training_Helps_Efficiency__c',
    dataValue('Training_Helps_Efficiency')
    ),
    field(
    'Capacity_Building_Activities_Offered__c',
    dataValue('Capacity_Building_Activities_Offered')
    ),
    field(
    'Capacity_Building_Offered_Other__c',
    dataValue('Capacity_Building_Offered_Other')
    ),
    field(
    'Can_Provide_Quotations_WP_on_Request__c',
    dataValue('Can_Provide_Quotations_WP_on_Request')
    ),
    field('Knows_What_a_Tender_is__c', dataValue('Knows_What_a_Tender_is')),
    field(
    'Frequency_Checking_for_Tenders__c',
    dataValue('Frequency_Checking_for_Tenders')
    ),
    field(
    'Has_Submitted_a_Tender_Bid__c',
    dataValue('Has_Submitted_a_Tender_Bid')
    ),
    field(
    'Has_Won_Tenders_in_Past_Six_Months__c',
    dataValue('Has_Won_Tenders_in_Past_Six_Months')
    ),
    field(
    'Details_of_Recently_Won_Tenders__c',
    dataValue('Details_of_Recently_Won_Tenders')
    ),
    field(
    'Num_of_Gov_t_Bids_in_Last_Six_Months__c',
    dataValue('Num_of_Govt_Bids_in_Last_Six_Months')
    ),
    field(
    'Num_of_Private_Bids_in_Last_Six_Months__c',
    dataValue('Num_of_Private_Bids_in_Last_Six_Months')
    ),
    field(
    'Num_of_NGO_INGO_IO_Bids_Last_Six_Months__c',
    dataValue('Num_of_NGO_INGO_IO_Bids_Last_Six_Months')
    ),
    field(
    'Main_Reason_for_Lost_Bids__c',
    dataValue('Main_Reason_for_Lost_Bids')
    ),
    field(
    'Main_Reason_for_Lost_Bids_Other__c',
    dataValue('Main_Reason_for_Lost_Bids_Other__c')
    ),
    field(
    'Main_Reason_for_Not_Bidding_on_Tenders__c',
    dataValue('Main_Reason_for_Not_Bidding_on_Tenders')
    ),
    field(
    'Main_Reason_Not_Bidding_Tenders_Others__c',
    dataValue('Main_Reason_Not_Bidding_Tenders_Others__c')
    ),
    field(
    'Planning_to_Bid_on_Future_Tenders__c',
    dataValue('Planning_to_Bid_on_Tenders_in_the_Future')
    ),
    field(
    'Services_That_Would_Help_to_Win_Tenders__c',
    dataValue('Services_That_Would_Help_to_Win_Tenders')
    ),
    field(
    'Interested_in_Future_BM_Communications__c',
    dataValue('Interested_in_Future_BM_Communications')
    ),
    field(
    'Future_BM_Communications__c',
    dataValue('Future_BM_Communications')
    ),
    field(
    'Interested_in_Attending_Future_Training__c',
    dataValue('Interested_in_Attending_Future_Training')
    ),
    field(
    'Training_Most_Interested_in_Attending__c',
    dataValue('Training_Most_Interested_in_Attending')
    ),
    field(
    'Training_Most_Interested_in_Other__c',
    dataValue('Training_Most_Interested_in_Other')
    ),
    field(
    'Amount_Willing_to_Pay_for_Training__c',
    dataValue('Amount_Willing_to_Pay_for_Training')
    ),
    field(
    'Amount_Willing_to_Pay_for_Training__c',
    dataValue('Amount_Willing_to_Pay_for_Training')
    ),
    field(
    'Training_Interested_In_but_Not_Offered__c',
    dataValue('Training_Interested_In_but_Not_Offered')
    ),
    field(
    'Advice_to_Entrepreneurs_in_your_Country__c',
    dataValue('Advice_to_Entrepreneurs_in_your_Country')
    ),
    field('Interviewer_Comments__c', dataValue('Interviewer_Comments'))
    )
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/create-if-proposal.html b/adaptors/library/jobs/auto/create-if-proposal.html index cf47294af028..12b733102035 100644 --- a/adaptors/library/jobs/auto/create-if-proposal.html +++ b/adaptors/library/jobs/auto/create-if-proposal.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Create/update records if...

    📜 This job is an official example from OpenFn.

    Metadata

    Key Functions

    createIf, dataValue, field, fields, relationship, upsertIf

    Expression

    // Using upsertIf and createIf we can conditionally create or update records if
    // some condition in the source data is met.

    upsertIf(
    // a path which resolves to true/false
    dataValue('form.legal.allowedToSync'),
    'Patient__c',
    'Patient_ID__c',
    fields(
    field('Name__c', dataValue('form.name')),
    field('Patient_ID__c', dataValue('form.identification.govId'))
    )
    );

    createIf(
    // or a function which returns true/false
    state => state.data.form.completedVisit === 'yes',
    'Visit__c',
    fields(
    field('Date__c', dataValue('form.visit.visit_date')),
    field('Type__c', 'checkup'),
    relationship(
    'Patient__r',
    'Patient_ID__c',
    dataValue('form.identification.govId')
    )
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/getKoboData.html b/adaptors/library/jobs/auto/getKoboData.html index 419f19141bf3..aa35c94c3ee5 100644 --- a/adaptors/library/jobs/auto/getKoboData.html +++ b/adaptors/library/jobs/auto/getKoboData.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Extract Kobo data from API to send to OpenFn Inbox

    📜 This job is an official example from OpenFn.

    Metadata

    • Name: Extract Kobo data from API to send to OpenFn Inbox
    • Adaptor: @openfn/language-http
    • Adaptor Version: v3.1.7
    • Created date unknown
    • Updated date unknown
    • Score: 100 (an indicator of how useful this job may be)

    Key Functions

    dataPath, each, get, map, post

    Expression

    //Sample job to get Kobo data and post back to OpenFn Inbox
    fn(state => {
    console.log(`Started at: ${new Date().toISOString()}`);
    state.submissions = [];
    state.data = {
    surveys: [
    // =========================================================================
    //== TODO: Specify new forms to fetch here, including the Kobo form id, tag, name, and owner ==//
    { id: 'aijj9FSpuCzMTRnMPGike8', tag: 'nrgt_historical', name: 'NRGT Makira 2017 - Test OpenFn', owner: 'bns' }, // example
    //consider listing multiple forms
    // =========================================================================

    ].map(survey => ({
    formId: survey.id,
    tag: survey.tag,
    name: survey.name,
    owner: survey.owner,
    url: `https://kf.kobotoolbox.org/api/v2/assets/${survey.id}/data/?format=json`,
    })),
    };
    console.log(`Fetching data for ${state.data.surveys.length} surveys.`);
    return state;
    });

    each(dataPath('surveys[*]'), state => {
    const { url, tag, formId, name, owner } = state.data;
    return get(url, {}, state => {
    state.data.submissions = state.data.results.map((submission, i) => {
    return {
    i,
    // Here we append the tags defined above to the Kobo form submission data
    form: tag,
    formName: name,
    formOwner: owner,
    body: submission,
    };
    });
    const count = state.data.submissions.length;
    console.log(`Fetched ${count} submissions from ${formId} (${tag}).`);
    //Once we fetch the data, we want to post each individual Kobo survey
    //back to the OpenFn inbox to run through the jobs
    return each(dataPath('submissions[*]'), state => {
    console.log(`Posting ${state.data.i + 1} of ${count}...`);
    // =========================================================================
    //== TODO: replace openfnInboxUrl with your OpenFn Project Inbox URL ====//
    return post(openfnInboxUrl, { body: state => state.data })(state);
    })(state);
    // =========================================================================
    })(state);
    });

    fn(state => {
    console.log(`Finished at: ${new Date().toISOString()}`);
    return {
    data: {
    message: "No cursor required. Job fetches all submission for given forms."
    },
    references: []
    };
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/google-oauth-test-2024-12-20.html b/adaptors/library/jobs/auto/google-oauth-test-2024-12-20.html index 8bb65daf903d..ae2634355adb 100644 --- a/adaptors/library/jobs/auto/google-oauth-test-2024-12-20.html +++ b/adaptors/library/jobs/auto/google-oauth-test-2024-12-20.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    google oauth test

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    appendValues

    Expression

    appendValues({
    spreadsheetId: '1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos',
    range: 'Sheet1!A1:E1',
    values: [
    ['From expression', '$15', '2', '3/15/2016'],
    ['Really now!', '$100', '1', '3/20/2016'],
    ],
    })
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/no-return-2023-01-06.html b/adaptors/library/jobs/auto/no-return-2023-01-06.html index 722d1bf01b1a..ccd9c10f38a0 100644 --- a/adaptors/library/jobs/auto/no-return-2023-01-06.html +++ b/adaptors/library/jobs/auto/no-return-2023-01-06.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    no return

    This job was provided by an OpenFn.org user via the job library API.

    Metadata

    Key Functions

    Expression

    fn(state => {
    console.log("no return");
    });
    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/promise-all-nested-requests.html b/adaptors/library/jobs/auto/promise-all-nested-requests.html index 1ff349948a64..71cbff996e3a 100644 --- a/adaptors/library/jobs/auto/promise-all-nested-requests.html +++ b/adaptors/library/jobs/auto/promise-all-nested-requests.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Promises and nested requests

    📜 This job is an official example from OpenFn.

    Metadata

    • Name: Promises and nested requests
    • Adaptor: @openfn/language-http
    • Adaptor Version: latest
    • Created date unknown
    • Updated date unknown
    • Score: 100 (an indicator of how useful this job may be)

    Key Functions

    each, get, Promise

    Expression

    each(
    '$.enrolledUsers[10]',
    fn(state => {
    const { host } = state.configuration;
    const { id } = state.data;
    const usersfields = [];
    return get(
    host,
    {
    query: {
    wstoken: state.token,
    wsfunction: 'core_user_get_users_by_field',
    field: 'id',
    'values[]': id,
    moodlewsrestformat: 'json',
    },
    },
    state => {
    const { id, phone1, address } = state.data[0];
    const fields = [
    { id, 'Teléfono móvil': phone1, Dirección: address, grades: [] },
    ];
    console.log(state.courseIds);
    let promises = [];
    state.courseIds.forEach(courseid => {
    promises.push(
    get(
    host,
    {
    query: {
    wstoken: state.token,
    wsfunction: 'gradereport_user_get_grade_items',
    userid: id,
    courseid,
    moodlewsrestformat: 'json',
    },
    },
    state => {
    console.log('fetched');
    const { graderaw } = state.data.usergrades[0].gradeitems[0];
    const grades = [{ courseid, graderaw }];
    fields[0].grades.push(...grades);
    }
    )(state)
    );
    });

    return Promise.all(promises).then(() => {
    usersfields.push(...fields);
    return {
    ...state,
    usersfields,
    enrolledUsers: [],
    response: [],
    };
    });
    }
    )(state);
    })
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/send-mail-in-mailgun.html b/adaptors/library/jobs/auto/send-mail-in-mailgun.html index a01243783aaf..7f774e08c78a 100644 --- a/adaptors/library/jobs/auto/send-mail-in-mailgun.html +++ b/adaptors/library/jobs/auto/send-mail-in-mailgun.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    send email

    📜 This job is an official example from OpenFn.

    Metadata

    Key Functions

    dataValue, field, fields, send

    Expression

    send(
    fields(
    field('from', 'you@domain.com'),
    field('to', dataValue('form.submission.respondantEmail')),
    field('subject', 'Thanks for completing our survey.'),
    field('text', 'Your message goes here.')
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/send-sms-from-salesforce-workflow.html b/adaptors/library/jobs/auto/send-sms-from-salesforce-workflow.html index 89aa22295635..5d3f53175af2 100644 --- a/adaptors/library/jobs/auto/send-sms-from-salesforce-workflow.html +++ b/adaptors/library/jobs/auto/send-sms-from-salesforce-workflow.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Send sms from Salesforce workflow action

    📜 This job is an official example from OpenFn.

    Metadata

    Key Functions

    dataValue, field, fields, send

    Expression

    send(
    fields(
    field(
    'to_number',
    dataValue(
    'Envelope.Body.notifications.Notification.sObject.phone_number__c'
    )
    ),
    field('message_type', 'sms'),
    field('route_id', ''),
    field('content', function (state) {
    return 'Hey there. Your name is '.concat(
    dataValue('Envelope.Body.notifications.Notification.sObject.name__c')(
    state
    ),
    '.'
    );
    })
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/synchronous-http-request.html b/adaptors/library/jobs/auto/synchronous-http-request.html index cd0ef586e88a..501ca8cfadbe 100644 --- a/adaptors/library/jobs/auto/synchronous-http-request.html +++ b/adaptors/library/jobs/auto/synchronous-http-request.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Chaining synchronous http requests

    📜 This job is an official example from OpenFn.

    Metadata

    • Name: Chaining synchronous http requests
    • Adaptor: @openfn/language-http
    • Adaptor Version: latest
    • Created date unknown
    • Updated date unknown
    • Score: 100 (an indicator of how useful this job may be)

    Key Functions

    post, async, await

    Expression

    fn(async state => {
    const { Patient, Visit } = state.data;

    console.log('Here we break large arrays into smaller chunks.');
    const chunk = (arr, chunkSize) => {
    var R = [];
    for (var i = 0, len = arr.length; i < len; i += chunkSize) R.push(arr.slice(i, i + chunkSize));
    return R;
    };

    const patientSets = chunk(Patient, 10);
    const visitSets = chunk(Visit, 10);

    console.log('Patient sets:', patientSets.length);
    console.log('Visit sets:', visitSets.length);

    const visitChunks = [];
    const patientChunks = [];

    patientSets.forEach(sets => {
    const data = {
    Visit: [],
    Patient: sets,
    };
    patientChunks.push(data);
    });

    visitSets.forEach(sets => {
    const data = {
    Visit: sets,
    Patient: [],
    };
    visitChunks.push(data);
    });

    let countInbox = 0;
    console.log('Then we define our async function that make multiple posts requests,');
    console.log('each after a fix period of time.');
    const postToInbox = async data => {
    countInbox++;
    console.log(`${countInbox} request to inbox`);

    await new Promise(resolve => setTimeout(resolve, 2000));
    await post(state.configuration.inboxUrl, { body: data })(state);
    };

    console.log('For each one of our chunks, we send one by one awaiting response.');
    for (const patient of patientChunks) {
    await postToInbox(patient);
    }
    for (const visit of visitChunks) {
    await postToInbox(visit);
    }

    return { ...state, patientChunks, visitChunks };
    });

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/timeout.html b/adaptors/library/jobs/auto/timeout.html index edcb76cf0d60..3f26f99431e4 100644 --- a/adaptors/library/jobs/auto/timeout.html +++ b/adaptors/library/jobs/auto/timeout.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Timeout to create a delay

    📜 This job is an official example from OpenFn.

    Metadata

    Key Functions

    get

    Expression

    // To properly use a timeout, wrap it in a promise. This job has two operations
    // and it executes the get(...) operation after the fn(...) operation
    // waits for 4000ms.
    fn(state => {
    return new Promise((resolve, reject) => {
    setTimeout(() => {
    console.log('wait, and then resolve');
    resolve(state);
    }, 4000);
    });
    });

    get('https://jsonplaceholder.typicode.com/todos/1');

    - + \ No newline at end of file diff --git a/adaptors/library/jobs/auto/upsert-many-items-in-array-with-value-outside-array.html b/adaptors/library/jobs/auto/upsert-many-items-in-array-with-value-outside-array.html index 2dd42d26aac7..aa20b13879de 100644 --- a/adaptors/library/jobs/auto/upsert-many-items-in-array-with-value-outside-array.html +++ b/adaptors/library/jobs/auto/upsert-many-items-in-array-with-value-outside-array.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Merge data into child array then upsert

    📜 This job is an official example from OpenFn.

    Metadata

    Key Functions

    dataPath, dataValue, each, field, fields, merge, relationship, upsert

    Expression

    each(
    merge(
    dataPath('form.ID_cards_given_to_vendor[*]'),
    fields(
    field('Vendor_Id', dataValue('form.ID_vendor')),
    field('form_finished_time', dataValue('form.meta.timeEnd'))
    )
    ),
    upsert(
    'Small_Packet__c',
    'sp_id__c',
    fields(
    field('sp_id__c', dataValue('ID_cards_given_to_vendor')),
    relationship('Vendor__r', 'Badge_Code__c', dataValue('Vendor_Id')),
    field(
    'Small_Packet_Distribution_Date__c',
    dataValue('form_finished_time')
    )
    )
    )
    );

    - + \ No newline at end of file diff --git a/adaptors/library/triggers/xmlns.html b/adaptors/library/triggers/xmlns.html index 42b391c4cdf8..8b8ef9103a49 100644 --- a/adaptors/library/triggers/xmlns.html +++ b/adaptors/library/triggers/xmlns.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Match a message with a fragment inside another object called `form`

    {
    "form": {
    "@xmlns": "http://openrosa.org/formdesigner/F732194-3278-nota-ReAL-one"
    }
    }
    - + \ No newline at end of file diff --git a/adaptors/magpi.html b/adaptors/magpi.html index 47de2f64c80f..6a002beaa686 100644 --- a/adaptors/magpi.html +++ b/adaptors/magpi.html @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@
    Skip to main content

    Magpi

    Magpi is not able to push data to external URLs. In order to fetch data from Magpi, you must run a scheduled job with a cron trigger using language-magpi:

    fetchSurveyData({
    surveyId: 37479, // the survey id
    afterDate: '2016-05-31', // the initial "after" date
    // after the first run, OpenFn will only fetch new submissions
    postUrl: 'https://www.openfn.org/inbox/secret-5c25-inbox-ba2c-url', // the inbox to post form data to.
    });

    Every time this job runs it will only fetch new data, by default.

    - + \ No newline at end of file diff --git a/adaptors/mailchimp.html b/adaptors/mailchimp.html index 0e592431b86f..23655fe08964 100644 --- a/adaptors/mailchimp.html +++ b/adaptors/mailchimp.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    MailChimp Adaptor

    About Mailchimp

    Mailchimp is a marketing automation platform that allows businesses to design, send, and manage email campaigns. It also provides tools for audience management, analytics, and integrations with other platforms to support marketing efforts.

    Integration Options

    Mailchimp supports two primary integration options:

    1. Rest API: Mailchimp offers a REST API that enables external applications to interact with its services. This option is ideal for applications requiring scheduled or bulk synchronization with OpenMRS. Refer to the Mailchimp REST API documentation for detailed guidelines on endpoints and payload formats.

    2. Webhook: Webhook or Data Forwarding to push data from MailChimp to external systems (see docs). This option is suited for real-time, event-based data integration.

    Authentication

    When integrating with Mailchimp via OpenFn, authentication via API Key is supported (see MC docs. See this adaptor's Configuration docs for more on the required authentication parameters.

    See platform docs on managing credentials for how to configure a credential in OpenFn. If working locally or if using a Raw JSON credential type, then your configuration will look something like this:

    {
    "server": "us11",
    "apiKey": "0eb22c7b4a1c5bcd789379bf8a92902d-us13"
    }
    1. Developer Portal
    2. API Reference
    3. Webhook Setup Guide

    Implementation Examples

    1. GIFE Project - Mailchimp -> Salesforce sync: https://github.com/OpenFn/gife
    - + \ No newline at end of file diff --git a/adaptors/mojatax.html b/adaptors/mojatax.html index 36172514db19..e12608cb3e81 100644 --- a/adaptors/mojatax.html +++ b/adaptors/mojatax.html @@ -17,7 +17,7 @@ - + @@ -42,7 +42,7 @@ if using a Raw JSON credential type, then your configuration will look something like this:

    {
    "baseUrl": "https://vfd-staging.mojatax.com",
    "password": "@some(!)Str0ngp4ss0w0rd",
    "clientId": "the-long-uuid-provided-by-mojatax"
    }
    - + \ No newline at end of file diff --git a/adaptors/mongodb.html b/adaptors/mongodb.html index 6237018039e7..e4758e3551aa 100644 --- a/adaptors/mongodb.html +++ b/adaptors/mongodb.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    MongoDB Adaptor

    About MongoDB

    MongoDB is a NoSQL, document-oriented database that stores data in BSON (Binary JSON) format, enabling easy storage and retrieval of complex and hierarchical data structures

    Integration Options

    The mongodb adaptor provides direct database connections for accessing data and executing SQL and standard database operations. See functions for more on how to use this adaptor.

    Authentication

    See the MongoDB docs for the latest on supported authentication methods. When integrating with a MongoDB database via OpenFn, you authenticate via SSH using authorized database credentials. See this adaptor's configuration docs for more on the required authentication parameters.

    See platform docs on managing credentials for how to configure a credential in OpenFn. If working locally or if using a Raw JSON credential type, then your configuration will look something like this:

    {
    "clusterHostname": "yourCluster-xxxyzzz.mongodb.net",
    "username": "admin",
    "password": "@secret(!)Pass"
    }
    1. MongoDB documentation
    - + \ No newline at end of file diff --git a/adaptors/moodle.html b/adaptors/moodle.html index b9ad26e1e2a6..f4c72800d782 100644 --- a/adaptors/moodle.html +++ b/adaptors/moodle.html @@ -17,7 +17,7 @@ - + @@ -45,7 +45,7 @@ reflected in my mobile app so that I can follow-up with the relevant support to ensure they perform well.

    Example job to get enrolled users via the Moodle API endpoint (aka web service function): core_enrol_get_enrolled_users

    fn(state => {
    const { loginUrl, username, password, host } = state.configuration;
    return get(
    `${loginUrl}&username=${username}&password=${password}`,
    {},
    state => {
    const { token } = state.data;
    const courseIds = [224, 225];
    const enrolledUsers = [];
    return each(
    courseIds,
    fn(state => {
    let courseid = state.data;
    return get(
    `${host}`,
    {
    query: {
    wstoken: token,
    wsfunction: 'core_enrol_get_enrolled_users',
    courseid,
    moodlewsrestformat: 'json',
    },
    headers: { 'content-type': 'application/json' },
    },
    state => {
    console.log(
    `Getting users enrolled in the course with ${courseid}...`
    );
    enrolledUsers.push(state.data);
    return { ...state, enrolledUsers };
    }
    )(state);
    })
    )(state);
    }
    )(state);
    });
    - + \ No newline at end of file diff --git a/adaptors/msgraph.html b/adaptors/msgraph.html index 466c03b633a2..6b6a5ee144cb 100644 --- a/adaptors/msgraph.html +++ b/adaptors/msgraph.html @@ -17,7 +17,7 @@ - + @@ -61,7 +61,7 @@ use case, so please refer to the MS Graph documentation on OAuth Scopes), and/or consult with your system administrator.

    1. User scopes:
      • User.Read (Read user profile)
      • User.ReadBasic.All (Read basic user profile)
      • User.ReadWrite (Read and write user profile)
      • User.ManageIdentities.All (Manage user identities)
    2. Mail scopes:
      • Mail.Read (Read mail)
      • Mail.ReadBasic (Read basic mail)
      • Mail.ReadWrite (Read and write mail)
      • Mail.Send (Send mail)
    3. Calendar scopes:
      • Calendars.Read (Read calendars)
      • Calendars.ReadWrite (Read and write calendars)
    4. Contacts scopes:
      • Contacts.Read (Read contacts)
      • Contacts.ReadWrite (Read and write contacts)
    5. Files scopes:
      • Files.Read (Read files)
      • Files.ReadWrite (Read and write files)
      • Files.Read.All (Read all files)
      • Files.ReadWrite.All (Read and write all files)
    6. Groups scopes:
      • Groups.Read.All (Read all groups)
      • Groups.ReadWrite.All (Read and write all groups)
    7. Directory scopes:
      • Directory.Read.All (Read directory)
      • Directory.ReadWrite.All (Read and write directory)
    8. Application scopes:
      • Application.Read.All (Read applications)
      • Application.ReadWrite.All (Read and write applications)
    9. Other scopes:
      • offline_access (Access resources even when the user is offline)
      • openid (Authenticate with OpenID Connect)
    - + \ No newline at end of file diff --git a/adaptors/mssql.html b/adaptors/mssql.html index 9de5a0c869ed..de034b346eb6 100644 --- a/adaptors/mssql.html +++ b/adaptors/mssql.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    MSSQL Adaptor

    About MSSQL

    Microsoft SQL Server (MSSQL) is a relational database management system (RDBMS) developed by Microsoft. It supports a wide variety of applications, including data warehousing, transaction processing, and business intelligence. It can be accessed and manipulated using SQL to extract or load data.

    Integration Options

    The mssql adaptor provides direct database connections for accessing data and executing SQL and standard database operations. See functions for more on how to use this adaptor.

    Authentication

    See MSSQL docs for the latest on supported authentication methods. When integrating with an MSSQL database via OpenFn, you authenticate via SSH using authorized database credentials. See this adaptor's Configuration docs for more on the required authentication parameters.

    See platform docs on managing credentials for how to configure a credential in OpenFn. If working locally or if using a Raw JSON credential type, then your configuration will look something like this:

    {
    "server": "something.database.windows.net",
    "database": "demo-db",
    "userName": "admin",
    "password": "@super(!)Password"
    }
    1. MSSQL documentation
    - + \ No newline at end of file diff --git a/adaptors/mysql.html b/adaptors/mysql.html index 6143e961293b..51ed29378a45 100644 --- a/adaptors/mysql.html +++ b/adaptors/mysql.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    MySQL Adaptor

    About MySQL

    MySQL is a free and open-source relational database management system. It can be accessed and manipulated using SQL to extract or load data.

    Integration Options

    The mysql adaptor provides direct database connections for accessing data and executing SQL and standard database operations. See functions for more on how to use this adaptor.

    Authentication

    See the MySQL docs for the latest on supported authentication methods. When integrating with a MySQL database via OpenFn, you authenticate via SSH using authorized database credentials. See this adaptor's configuration docs for more on the required authentication parameters.

    See platform docs on managing credentials for how to configure a credential in OpenFn. If working locally or if using a Raw JSON credential type, then your configuration will look something like this:

    {
    "host": "some-host-url.compute-1.amazonaws.com",
    "database": "demo-db",
    "user": "admin-demo",
    "password": "@super(!)Secretpass"
    }
    1. MySQL documentation
    - + \ No newline at end of file diff --git a/adaptors/ocl.html b/adaptors/ocl.html index b236262b6bd9..d691c5c08994 100644 --- a/adaptors/ocl.html +++ b/adaptors/ocl.html @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@
    Skip to main content

    OCL Adaptor

    About OCL

    OCL (Open Concept Lab) is an open-source platform that provides a collaborative environment for creating, managing, and sharing standardized healthcare terminologies, dictionaries, and value sets.

    Relationships between concepts are defined in OCL as mappings. The API supports searching and editing concepts and mappings, building sources, and logically grouping concepts and mappings into collections. See OCL docs to learn more, access the Swagger API, and to learn more about the cloud instance available at https://openconceptlab.org.

    Integration Options

    1. Rest API: OCL offers a REST API that allows systems to interact with its concept dictionaries and value sets. With the API, you can: This option is suited for scheduled synchronization or workflows requiring regular updates to or from OCL. Refer to the OCL REST API documentation for endpoint details and usage examples.

    2. Bulk Export and Import: OCL supports exporting and importing concept dictionaries and value sets in various formats (e.g., JSON, CSV). This allows for manual or automated bulk data integration. Use this option for one-time data transfer or systems without direct API connectivity.

    Authentication

    When integrating with OCL via OpenFn, you must provide a username and password to generate an authorization token (see OCL docs). See this adaptor's Configuration docs for more on the required authentication parameters.

    See platform docs on managing credentials for how to configure a credential in OpenFn. If working locally or if using a Raw JSON credential type, then your configuration will look something like this:

    {
    "hostUrl": "https://api.openconceptlab.org/",
    "username": "usernmame",
    "password": "supersecretpassword"
    }
    1. OCL Developer Guide
    2. OCL API Reference
    3. OCL Community Support
    4. OCL GitHub Repository

    Implementation Examples

    1. OpenFn Prototype for Médecins Sans Frontières (MSF) LIME Project - OpenMRS -> OCL -> DHIS2 sync: https://github.com/OpenFn/openfn-lime
    - + \ No newline at end of file diff --git a/adaptors/odk.html b/adaptors/odk.html index e5daac23a11f..c838bae47f20 100644 --- a/adaptors/odk.html +++ b/adaptors/odk.html @@ -17,7 +17,7 @@ - + @@ -29,7 +29,7 @@ is.

    Integration Options

    In order to fetch data from an ODK Central, you must run a scheduled job with a cron trigger using the odk adaptor.

    Here's an example of a job that gets submission data.

    getSubmissions($.projectId, $.xmlFormId);

    Every time this job runs it will get of all submissions and write them to state.data, leaving your state object looking like this:

    {
    "data": [
    {
    "__id": "uuid:85cb9aff-005e-4edd-9739-dc9c1a829c44",
    "age": 25,
    "meta": {
    "instanceID": "uuid:85cb9aff-005e-4edd-9739-dc9c1a829c44"
    },
    "name": "Bob"
    },
    {
    "__id": "uuid:297000fd-8eb2-4232-8863-d25f82521b87",
    "age": 30,
    "meta": {
    "instanceID": "uuid:297000fd-8eb2-4232-8863-d25f82521b87"
    },
    "name": "Alice"
    }
    ],
    "response": {
    /* ODK response headers, code and context*/
    }
    }
    - + \ No newline at end of file diff --git a/adaptors/ona.html b/adaptors/ona.html index 892398dd0bc0..171e69e69d37 100644 --- a/adaptors/ona.html +++ b/adaptors/ona.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ and select Settings.
  • On the left-side menu, select Webhooks.
  • Paste your OpenFn inbox URL into the URL input field.
  • Click "Add webhook".
  • Ensure that the webhook is now listed with the JSON tag, indicating that it will forward data as JSON.
  • Check to see that, once a form is submitted, it is forwarded to your OpenFn inbox.
  • - + \ No newline at end of file diff --git a/adaptors/openmrs.html b/adaptors/openmrs.html index 8ba6bf0ff9d1..21bc3fbadc70 100644 --- a/adaptors/openmrs.html +++ b/adaptors/openmrs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    OpenMRS Adaptor

    About OpenMRS

    OpenMRS (Open Medical Record System) is an open-source platform designed to manage electronic medical records (EMRs) in low-resource environments. It provides a framework that allows developers to extend its core functionality through custom modules and APIs.

    Integration Options

    1. Rest API: OpenMRS offers a REST API that enables external applications to interact with its database and perform bulk operations. This option is ideal for applications requiring scheduled or bulk synchronization with OpenMRS. Refer to the OpenMRS REST API documentation for detailed guidelines on endpoints and payload formats.

    2. Webhook: OpenMRS does not natively support webhooks as a standard feature. However, the platform is highly extensible and allows for customization through its module system. More details can be found on the OpenMRS documentation page​.

    Authentication

    When integrating with OpenMRS via OpenFn, Basic Authentication is supported. See this adaptor's Configuration docs for more on the required authentication parameters.

    See platform docs on managing credentials for how to configure a credential in OpenFn. If working locally or if using a Raw JSON credential type, then your configuration will look something like this:

    {
    "instanceUrl": "http://openmrs.com/instance/url",
    "password":"test",
    "username":"test"
    }
    1. OpenMRS Developer Guide
    2. Community Forums: OpenMRS Talk

    Implementation Examples

    1. OpenFn Prototype for Médecins Sans Frontières (MSF) LIME Project - OpenMRS -> DHIS2 sync: https://github.com/OpenFn/openfn-lime
    - + \ No newline at end of file diff --git a/adaptors/packages/asana-changelog.html b/adaptors/packages/asana-changelog.html index 48b349c94d09..f89266b7dd33 100644 --- a/adaptors/packages/asana-changelog.html +++ b/adaptors/packages/asana-changelog.html @@ -17,7 +17,7 @@ - + @@ -34,7 +34,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    2.1.6

    Patch Changes

    2.1.5

    Patch Changes

    2.1.4

    Patch Changes

    2.1.3

    Patch Changes

    2.1.2

    Patch Changes

    2.1.1

    Patch Changes

    2.1.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/asana-configuration-schema.html b/adaptors/packages/asana-configuration-schema.html index f93638e00fa2..e04a7e585b06 100644 --- a/adaptors/packages/asana-configuration-schema.html +++ b/adaptors/packages/asana-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "apiVersion": "1.0",
    "token": "sample-tokenyWSJdXBACMLLWMNGgADFA"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "apiVersion": {
    "title": "API Version",
    "type": "string",
    "description": "The API version",
    "examples": [
    "1.0"
    ]
    },
    "token": {
    "title": "Token",
    "type": "string",
    "description": "The API token",
    "examples": [
    "sample-tokenyWSJdXBACMLLWMNGgADFA"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "apiVersion",
    "token"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/asana-docs.html b/adaptors/packages/asana-docs.html index 6d534789cc5c..a8ffd52c1df4 100644 --- a/adaptors/packages/asana-docs.html +++ b/adaptors/packages/asana-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    asana@4.0.8

    createTask(params, callback)
    createTaskStory(taskGid, params, callback)
    getTask(taskGid, params, callback)
    getTasks(projectGid, params, callback)
    request(path, params, callback)
    updateTask(taskGid, params, callback)
    upsertTask(projectGid, params, callback)

    This adaptor exports the following from common:

    alterState()
    cursor()
    dataPath()
    dataValue()
    dateFns
    each()
    field()
    fields()
    fn()
    fnIf()
    http
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    createTask

    createTask(params, callback) ⇒ Operation

    Create a task.

    ParamTypeDescription
    paramsobjectBody parameters
    callbackfunction(Optional) callback function

    Example

    createTask({
    name: "test",
    approval_status: "pending",
    assignee: "12345",
    projects: ["1206933955023739"],
    });

    createTaskStory

    createTaskStory(taskGid, params, callback) ⇒ Operation

    Create a story to a specific task.

    ParamTypeDescription
    taskGidstringGlobally unique identifier for the task
    paramsStoryOptionsStory parameters
    callbackfunction(Optional) callback function

    Example: Create a plain text comment

    createTaskStory("1206933955023739", {
    text: "This is a comment",
    });

    Example: Create a HTML formatted text comment

    createTaskStory("1206933955023739", {
    html_text: "<body>This is a comment</body>",
    });

    getTask

    getTask(taskGid, params, callback) ⇒ Operation

    Get a single task of a given project.

    ParamTypeDescription
    taskGidstringGlobally unique identifier for the task
    paramsobjectQuery params to include.
    callbackfunction(Optional) callback function

    Example

    getTask("1206933955023739", {
    opt_fields: "name,notes,assignee",
    });

    getTasks

    getTasks(projectGid, params, callback) ⇒ Operation

    Get the list of tasks for a given project.

    ParamTypeDescription
    projectGidstringGlobally unique identifier for the project
    paramsobjectQuery params to include.
    callbackfunction(Optional) callback function

    Example

    getTasks("1206933955023739", {
    opt_fields: "name,notes,assignee",
    });

    request

    request(path, params, callback) ⇒ Operation

    Make a HTTP request against the Asana API.

    ParamTypeDescription
    pathstringPath to resource (excluding api/version)
    paramsRequestOptions(Optional) Query, body and method parameters
    callbackfunction(Optional) Callback function

    Example

    Get a task by id
    request("/tasks/1234");

    Example

    Query for tasks in a given project
    request("/tasks", {
    query: { project: "abc" },
    });

    Example

    Create a new task
    request("/tasks", {
    method: "POST",
    body: { data: { name: "do the thing", completed: false } },
    });

    updateTask

    updateTask(taskGid, params, callback) ⇒ Operation

    Update a specific task.

    ParamTypeDescription
    taskGidstringGlobally unique identifier for the task
    paramsobjectBody parameters
    callbackfunction(Optional) callback function

    Example

    updateTask("1206933955023739", {
    name: "test",
    approval_status: "pending",
    assignee: "12345",
    });

    upsertTask

    upsertTask(projectGid, params, callback) ⇒ Operation

    Update or create a task.

    ParamTypeDescription
    projectGidstringGlobally unique identifier for the project
    paramsobjectan object with an externalId and some task data.
    callbackfunction(Optional) callback function

    Example

    upsertTask("1201382240880", {
    externalId: "name",
    data: {
    name: "test",
    approval_status: "pending",
    projects: ["1201382240880"],
    assignee: "12345",
    },
    });

    Interfaces

    RequestOptions

    Options provided to the Asana API request

    Properties

    NameTypeDescription
    bodyobjectBody data to append to the request.
    queryobjectAn object of query parameters to be encoded into the URL.
    methodstringThe HTTP method to use. Defaults to GET

    StoryOptions

    Options provided to the createTaskStory request

    Properties

    NameTypeDescription
    textstringThe plain text of the comment to add. Cannot be used with html_text.
    html_textstringOpt In. HTML formatted text for a comment. This will not include the name of the creator.
    is_pinnedbooleanDefault to false. Whether the story should be pinned on the resource.
    sticker_namestringThe name of the sticker in this story. null if there is no sticker.
    opt_fieldsarrayOpt In. This endpoint returns a compact resource, which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include.
    opt_prettybooleanDefaults to false. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.

    - + \ No newline at end of file diff --git a/adaptors/packages/asana-readme.html b/adaptors/packages/asana-readme.html index 193ff79bed52..209e0f171f68 100644 --- a/adaptors/packages/asana-readme.html +++ b/adaptors/packages/asana-readme.html @@ -17,7 +17,7 @@ - + @@ -36,7 +36,7 @@ the task does not exist, a new one will be created. The first parameter in this function should be the project_id.

    upsertTask('12344', {
    externalId: 'name',
    data: {
    name: 'A new task',
    projects: ['12344'],
    notes: 'This is a new task',
    },
    });

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/azure-storage-changelog.html b/adaptors/packages/azure-storage-changelog.html index 66e69712d8e1..f00f58965bdc 100644 --- a/adaptors/packages/azure-storage-changelog.html +++ b/adaptors/packages/azure-storage-changelog.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Changelog for the azure-storage adaptor

    @openfn/language-azure-storage

    2.0.8

    Patch Changes

    • Updated dependencies [b3d7f59]
    • Updated dependencies [2d709ff]
    • Updated dependencies [41e8cc3]

    2.0.7

    Patch Changes

    2.0.6

    Patch Changes

    2.0.5

    Patch Changes

    2.0.4

    Patch Changes

    2.0.3

    Patch Changes

    2.0.2

    Patch Changes

    2.0.1

    Patch Changes

    2.0.0

    Major Changes

    • Export new common http helpers (http namespace)

    1.1.1

    Patch Changes

    1.1.0

    Minor Changes

    • 73433c20: Add fnIf operation

    Patch Changes

    1.0.2

    Patch Changes

    1.0.1

    Patch Changes

    • 6afba70: Add proper variable declaration (linting)

    1.0.0

    Major Changes

    Intial adaptor release with support for Blob storage.

    • uploadBlob
    • downloadBlob
    • getBlobProperties
    - + \ No newline at end of file diff --git a/adaptors/packages/azure-storage-configuration-schema.html b/adaptors/packages/azure-storage-configuration-schema.html index 51d079438d45..31d389c71e97 100644 --- a/adaptors/packages/azure-storage-configuration-schema.html +++ b/adaptors/packages/azure-storage-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "accountName": "examplestorageaccount01",
    "accountKey": "zzUx5rA4BZkjPet8ztLTEll7azF65Sez7WxGKsJv5B+rp/dby8ARgYpEVe93xFCQDqGBi3FUlxjP+ASt4uepZg=="
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "accountName": {
    "title": "Account Name",
    "type": "string",
    "description": "Azure Storage Account Name",
    "examples": [
    "examplestorageaccount01"
    ]
    },
    "accountKey": {
    "title": "Account Key",
    "type": "string",
    "description": "Azure Account Key",
    "writeOnly": true,
    "examples": [
    "zzUx5rA4BZkjPet8ztLTEll7azF65Sez7WxGKsJv5B+rp/dby8ARgYpEVe93xFCQDqGBi3FUlxjP+ASt4uepZg=="
    ]
    },
    "containerName": {
    "title": "Container Name",
    "type": "string",
    "description": "Name of Azure Blob Storage Container",
    "writeOnly": true,
    "examples": [
    "mycontainername"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "accountName",
    "accountKey"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/azure-storage-docs.html b/adaptors/packages/azure-storage-docs.html index da22e711f4cc..3ed26c93d666 100644 --- a/adaptors/packages/azure-storage-docs.html +++ b/adaptors/packages/azure-storage-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    azure-storage@2.0.8

    downloadBlob(blobName, [options])
    getBlobProperties(blobName, options)
    uploadBlob(blobName, content, uploadOptions, [options])

    This adaptor exports the following from common:

    dataPath()
    dataValue()
    dateFns
    each()
    field()
    fields()
    fn()
    fnIf()
    http
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    downloadBlob

    downloadBlob(blobName, [options]) ⇒ Operation

    Download a blob from Azure Blob Storage.

    ParamTypeDefaultDescription
    blobNamestringName of the blob to download.
    [options]Object{}Additional options for the download process.

    Example

    downloadBlob('mycontainer', 'myblob.txt', { downloadAs: 'string' })

    getBlobProperties

    getBlobProperties(blobName, options) ⇒ Operation

    Get properties of a blob in Azure Blob Storage.

    ParamTypeDescription
    blobNamestringName of the blob to get properties for.
    optionsstringAdditional options for the getBlobProperties process.

    Example

    getBlobProperties('mycontainer', 'myblob.txt')

    uploadBlob

    uploadBlob(blobName, content, uploadOptions, [options]) ⇒ Operation

    Upload content to Azure Blob Storage.

    ParamTypeDefaultDescription
    blobNamestringName of the blob to create or replace.
    contentstringContent to upload.
    uploadOptionsobjectSee BlockBlobUploadOptions in Azure Blob Storage docs
    [options]Object{}Additional options for the upload process.
    [options.createContainer]booleanfalseWhether to create the container if it doesn't exist.
    [options.overwrite]booleanfalseWhether to overwrite an existing blob with the same name.
    [options.containerName]stringContainer name. Overrides state.configuration.

    Example

    uploadBlob('mycontainer', 'myblob.txt', {foo:"bar"}, { blobHTTPHeaders: { blobContentType: 'application/json' } })

    - + \ No newline at end of file diff --git a/adaptors/packages/azure-storage-readme.html b/adaptors/packages/azure-storage-readme.html index c30efdb2ce6e..7202fc87281a 100644 --- a/adaptors/packages/azure-storage-readme.html +++ b/adaptors/packages/azure-storage-readme.html @@ -17,7 +17,7 @@ - + @@ -35,7 +35,7 @@ downloads the same blob and fetches the blob properties. It would be extremely unusual to perform all of these actions in a single job.

    uploadBlob(
    state => {
    const date = new Date();
    const id = '0e82962a-6ed0-4a88-92c1-51ae785b4126';
    return `${date.getFullYear()}/${date.getMonth() + 1}/${id}.json`;
    },
    state.data,
    {
    blobHTTPHeaders: { blobContentType: 'application/json' }
    },
    { createContainer: true, overwrite: true }
    );

    downloadBlob(
    dataValue('blobName');
    );

    getBlobProperties(
    state => {
    return state.references[1].blobName;
    }
    );

    Run the job as follows:

    openfn job -a azure-storage -s state.json -O

    Development

    Clone the adaptors monorepo. Follow the "Getting Started" guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To build only the docs run pnpm build docs.

    - + \ No newline at end of file diff --git a/adaptors/packages/beyonic-changelog.html b/adaptors/packages/beyonic-changelog.html index 51764bead41e..de5aa0587d9c 100644 --- a/adaptors/packages/beyonic-changelog.html +++ b/adaptors/packages/beyonic-changelog.html @@ -17,7 +17,7 @@ - + @@ -29,7 +29,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    0.1.9

    Patch Changes

    0.1.8

    Patch Changes

    0.1.7

    Patch Changes

    0.1.6

    Patch Changes

    0.1.5

    Patch Changes

    0.1.4

    Patch Changes

    0.1.3

    Patch Changes

    0.1.2

    Patch Changes

    0.1.1

    Patch Changes

    0.1.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/beyonic-configuration-schema.html b/adaptors/packages/beyonic-configuration-schema.html index e6802fa0478a..1cd788e69d65 100644 --- a/adaptors/packages/beyonic-configuration-schema.html +++ b/adaptors/packages/beyonic-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "apiUrl": "https://beyonic.com/api",
    "apiToken": "cdjhiooiSIUJHDYSYUIHASIOHKAANOAJJjsiujhaka"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "apiUrl": {
    "title": "API URL",
    "type": "string",
    "description": "API URL",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://beyonic.com/api"
    ]
    },
    "apiToken": {
    "title": "API Token",
    "type": "string",
    "description": "API token",
    "minLength": 1,
    "examples": [
    "cdjhiooiSIUJHDYSYUIHASIOHKAANOAJJjsiujhaka"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "apiUrl",
    "apiToken"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/beyonic-docs.html b/adaptors/packages/beyonic-docs.html index fc89773134b5..84f4f1aff8b0 100644 --- a/adaptors/packages/beyonic-docs.html +++ b/adaptors/packages/beyonic-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    beyonic@0.3.9

    createCollectionRequest(data)
    createContact(data)
    createPayment(data)

    This adaptor exports the following from common:

    dataPath()
    dataValue()
    field()
    fields()
    fn()
    fnIf()
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    createCollectionRequest

    createCollectionRequest(data) ⇒ Operation

    Create a collection request

    ParamTypeDescription
    dataobjectPayload data for the collection request

    Example

    execute(
    createCollectionRequest(data)
    )(state)

    createContact

    createContact(data) ⇒ Operation

    Create a contact

    ParamTypeDescription
    dataobjectPayload data for the contact

    Example

    execute(
    createContact(data)
    )(state)

    createPayment

    createPayment(data) ⇒ Operation

    Create a payment

    ParamTypeDescription
    dataobjectPayload data for the payment

    Example

    execute(
    createPayment(data)
    )(state)

    - + \ No newline at end of file diff --git a/adaptors/packages/beyonic-readme.html b/adaptors/packages/beyonic-readme.html index 0180f3e2a616..69b813e64c7f 100644 --- a/adaptors/packages/beyonic-readme.html +++ b/adaptors/packages/beyonic-readme.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ configuration-schema definition.

    Payments API

    createPayment(...)

    createPayment(
    fields(
    field('phonenumber', '+256773712831'),
    field('first_name', 'Gideon'),
    field('last_name', 'Zelalem'),
    field('amount', 100.2),
    field('currency', 'USD'),
    field('account', 1),
    field('description', 'Long-term contract for Arseal'),
    field('payment_type', 'money'),
    field('callback_url', 'https://my.website/payments/callback')
    )
    );

    Collection Requests API

    createCollectionRequest(...)

    createCollectionRequest(
    fields(
    field('instructions', 'Send me some money, please!'),
    field('phonenumber', '+256773712831'),
    field('amount', 5.0),
    field('currency', 'USD')
    )
    );

    Contacts API

    createContact(...)

    createContact(
    fields(
    field('first_name', 'Granit'),
    field('last_name', 'Xhaka'),
    field('phone_number', '+256773712831'),
    field('email', 'granit@arsenal.com')
    )
    );

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/bigquery-changelog.html b/adaptors/packages/bigquery-changelog.html index 5f7e3ca6303c..09f3fd667eeb 100644 --- a/adaptors/packages/bigquery-changelog.html +++ b/adaptors/packages/bigquery-changelog.html @@ -17,7 +17,7 @@ - + @@ -29,7 +29,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    1.1.5

    Patch Changes

    1.1.4

    Patch Changes

    1.1.3

    Patch Changes

    1.1.2

    Patch Changes

    1.1.1

    Patch Changes

    1.1.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/bigquery-configuration-schema.html b/adaptors/packages/bigquery-configuration-schema.html index efcbbd96edd9..b760b81e1156 100644 --- a/adaptors/packages/bigquery-configuration-schema.html +++ b/adaptors/packages/bigquery-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "type": "service_acconut",
    "project_id": "some-project-id",
    "private_key_id": "670b9e3c8c366e83aa569dd57cbfc5c575b72e42",
    "private_key": "-----BEGIN PRIVATE KEY-----\nblah\nmoreblah=\n-----END PRIVATE KEY-----\n",
    "client_email": "bigquery@some-project.iam.gserviceaccount.com",
    "client_id": "someid",
    "auth_uri": "https://accounts.google.com/o/oauth2/auth",
    "token_uri": "https://oauth2.googleapis.com/token",
    "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
    "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/bigquery%40some-project.iam.gserviceaccount.com"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "additionalProperties": true,
    "properties": {
    "type": {
    "title": "Type",
    "type": "string",
    "description": "",
    "examples": [
    "service_acconut"
    ]
    },
    "project_id": {
    "title": "Prokect id",
    "type": "string",
    "description": "Project id",
    "examples": [
    "some-project-id"
    ]
    },
    "private_key_id": {
    "title": "Private Key Id",
    "type": "string",
    "description": "Private key id",
    "examples": [
    "670b9e3c8c366e83aa569dd57cbfc5c575b72e42"
    ]
    },
    "private_key": {
    "title": "Private Key",
    "type": "string",
    "description": "Private key",
    "examples": [
    "-----BEGIN PRIVATE KEY-----\nblah\nmoreblah=\n-----END PRIVATE KEY-----\n"
    ]
    },
    "client_email": {
    "title": "Client Email",
    "type": "string",
    "description": "Client email",
    "examples": [
    "bigquery@some-project.iam.gserviceaccount.com"
    ]
    },
    "client_id": {
    "title": "Client Id",
    "type": "string",
    "description": "Client id",
    "examples": [
    "someid"
    ]
    },
    "auth_uri": {
    "title": "Auth Uri",
    "type": "string",
    "description": "Auth Uri",
    "examples": [
    "https://accounts.google.com/o/oauth2/auth"
    ]
    },
    "token_uri": {
    "title": "Token Uri",
    "type": "string",
    "description": "Token Uri",
    "examples": [
    "https://oauth2.googleapis.com/token"
    ]
    },
    "auth_provider_x509_cert_url": {
    "title": "Auth Provider x509 Cert Url",
    "type": "string",
    "description": "",
    "examples": [
    "https://www.googleapis.com/oauth2/v1/certs"
    ]
    },
    "client_x509_cert_url": {
    "title": "Client x509 Cert Url",
    "type": "string",
    "description": "",
    "examples": [
    "https://www.googleapis.com/robot/v1/metadata/x509/bigquery%40some-project.iam.gserviceaccount.com"
    ]
    }
    },
    "required": [
    "type",
    "project_id",
    "private_key_id",
    "private_key",
    "client_email",
    "client_id",
    "auth_uri",
    "token_uri",
    "auth_provider_x509_cert_url",
    "client_x509_cert_url"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/bigquery-docs.html b/adaptors/packages/bigquery-docs.html index c88b9c2cbdb1..a0221c5ce2fd 100644 --- a/adaptors/packages/bigquery-docs.html +++ b/adaptors/packages/bigquery-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    bigquery@3.0.9

    load(dirPath, projectId, datasetId, tableId, loadOptions, callback)

    This adaptor exports the following from common:

    alterState()
    combine()
    dataPath()
    dataValue()
    each()
    field()
    fields()
    fn()
    fnIf()
    http
    lastReferenceValue()
    merge()
    parseCsv()
    sourceValue()

    Functions

    load

    load(dirPath, projectId, datasetId, tableId, loadOptions, callback) ⇒ Operation

    Load files to BigQuery

    ParamTypeDescription
    dirPathstringthe path to your local directory
    projectIdstringyour bigquery project id
    datasetIdstringyour bigquery dataset id
    tableIdstringthe name of the table you'd like to load
    loadOptionsobjectoptions to pass to the bigquery.load() API
    callbackfunctionand optional callback

    Example

    load(
    './tmp/files',
    'my-bg-project',
    'test01',
    'product-codes',
    {
    schema: 'FREQ:STRING,DATATYPE:STRING,PRODUCTCODE:STRING,PARTNER:STRING',
    writeDisposition: 'WRITE_APPEND',
    skipLeadingRows: 1,
    schemaUpdateOptions: ['ALLOW_FIELD_ADDITION'],
    createDisposition: 'CREATE_IF_NEEDED',
    }
    )

    - + \ No newline at end of file diff --git a/adaptors/packages/bigquery-readme.html b/adaptors/packages/bigquery-readme.html index aebd8990317d..fba10a833267 100644 --- a/adaptors/packages/bigquery-readme.html +++ b/adaptors/packages/bigquery-readme.html @@ -17,7 +17,7 @@ - + @@ -27,7 +27,7 @@
    Skip to main content

    bigquery Adaptor developer README.md

    Source: https://github.com/OpenFn/adaptors/tree/main/packages/bigquery

    Language BigQuery

    Language Pack for building expressions and operations to make HTTP calls.

    Documentation

    state.json

    The configuration key must be a valid GCP credential as JSON.

    {
    "configuration": {
    "type": "service_account",
    "project_id": "some-project",
    "private_key_id": "670b9e3c8c366e83aa569dd57cbfc5c575b72e42",
    "private_key": "-----BEGIN PRIVATE KEY-----\nblah\nmoreblah=\n-----END PRIVATE KEY-----\n",
    "client_email": "bigquery@some-project.iam.gserviceaccount.com",
    "client_id": "someid",
    "auth_uri": "https://accounts.google.com/o/oauth2/auth",
    "token_uri": "https://oauth2.googleapis.com/token",
    "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
    "client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/bigquery%40some-project.iam.gserviceaccount.com"
    },
    "data": { "a": 1 }
    }

    operations (expression.js)

    load(...)

    Load data to a table in bigquery from a CSV. See full options here.

    load(
    '/home/taylor/Desktop/type-C_r-ALL_ps-201012_freq-M_px-HS_pub-20200731_fmt-csv_ex-20200818.csv',
    'awesome-solutions-project', // project
    'test01', // dataset
    'mytable', // table
    {
    schema:
    'classification:STRING,year:STRING,period:STRING,period_desc:STRING,aggregate_level:STRING,is_leaf_code:STRING,trade_flow_code:STRING,trade_flow:STRING,reporter_code:STRING,reporter:STRING,reporter_iso:STRING,partner_code:STRING,partner:STRING,partner_iso:STRING,commodity_code:STRING,commodity:STRING,qty_unit_code:STRING,qty_unit:STRING,qty:INTEGER,netweight_kg:INTEGER,trade_value:INTEGER,flag:STRING',
    schemaUpdateOptions: ['ALLOW_FIELD_ADDITION'],
    // createDisposition: 'CREATE_IF_NEEDED',
    writeDisposition: 'WRITE_APPEND',
    skipLeadingRows: 1,
    } // loadOptions
    );

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/cartodb-changelog.html b/adaptors/packages/cartodb-changelog.html index ad91f2b2f645..de75b9a14bd7 100644 --- a/adaptors/packages/cartodb-changelog.html +++ b/adaptors/packages/cartodb-changelog.html @@ -17,7 +17,7 @@ - + @@ -29,7 +29,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    0.1.4

    Patch Changes

    0.1.3

    Patch Changes

    0.1.2

    Patch Changes

    0.1.1

    Patch Changes

    0.1.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/cartodb-configuration-schema.html b/adaptors/packages/cartodb-configuration-schema.html index a32e3a392654..ec2cfb31e528 100644 --- a/adaptors/packages/cartodb-configuration-schema.html +++ b/adaptors/packages/cartodb-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "account": "openfn",
    "apiKey": "longsecretkey"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "account": {
    "title": "Account",
    "type": "string",
    "description": "CartoDB account name",
    "minLength": 1,
    "examples": [
    "openfn"
    ]
    },
    "apiKey": {
    "title": "API Key",
    "type": "string",
    "description": "CartoDB API key",
    "minLength": 1,
    "examples": [
    "longsecretkey"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "account",
    "apiKey"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/cartodb-docs.html b/adaptors/packages/cartodb-docs.html index 030bb20ffa15..fbef7a4b79a8 100644 --- a/adaptors/packages/cartodb-docs.html +++ b/adaptors/packages/cartodb-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/cartodb-readme.html b/adaptors/packages/cartodb-readme.html index 228d3a1cbf5a..664fbedf33b8 100644 --- a/adaptors/packages/cartodb-readme.html +++ b/adaptors/packages/cartodb-readme.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ configuration-schema definition.

    Examples

    addRow(
    'your_table',
    fields(
    field('name', 'taylor'),
    field('lat', dataValue('lat')),
    field('long', dataValue('long')),
    field('mookie', dataValue('form.blaylock')),
    field('description', dataValue('type_description')),
    field('date', dataValue('SubmissionDate'))
    )
    );
    sql(function (state) {
    return (
    `INSERT INTO untitled_table (name, the_geom) VALUES ('` +
    dataValue('form.first_name')(state) +
    `', ST_SetSRID(ST_Point(` +
    dataValue('lat')(state) +
    `, ` +
    dataValue('long')(state) +
    `),4326))`
    );
    });

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/cht-changelog.html b/adaptors/packages/cht-changelog.html index 39f1a86b4233..193c0e9cbd55 100644 --- a/adaptors/packages/cht-changelog.html +++ b/adaptors/packages/cht-changelog.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Changelog for the cht adaptor

    @openfn/language-cht

    1.0.8

    Patch Changes

    • Updated dependencies [b3d7f59]
    • Updated dependencies [2d709ff]
    • Updated dependencies [41e8cc3]

    1.0.7

    Patch Changes

    1.0.6

    Patch Changes

    1.0.5

    Patch Changes

    1.0.4

    Patch Changes

    1.0.3

    Patch Changes

    1.0.2

    Patch Changes

    1.0.1

    Patch Changes

    1.0.0

    Initial release for cht adaptor with get, post, and put

    - + \ No newline at end of file diff --git a/adaptors/packages/cht-configuration-schema.html b/adaptors/packages/cht-configuration-schema.html index ce6cc89895a5..9458834eedae 100644 --- a/adaptors/packages/cht-configuration-schema.html +++ b/adaptors/packages/cht-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "password": "@some(!)Str0ngp4ss0w0rd",
    "username": "somenamehere"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "baseUrl": {
    "title": "Base URL",
    "type": "string",
    "description": "Community Health Kit base URL",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://demo-cht.dev.medicmobile.org"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "Username",
    "examples": [
    "somenamehere"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Password",
    "writeOnly": true,
    "examples": [
    "@some(!)Str0ngp4ss0w0rd"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "password",
    "username"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/cht-docs.html b/adaptors/packages/cht-docs.html index 5dd0b0c3eb4b..864468dceba7 100644 --- a/adaptors/packages/cht-docs.html +++ b/adaptors/packages/cht-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    cht@1.0.8

    get(path, options, [callback])
    post(path, body, options, [callback])
    put(path, options, [callback])
    request(method, path, data, options, [callback])

    This adaptor exports the following from common:

    cursor()
    dataPath()
    dataValue()
    dateFns
    each()
    field()
    fields()
    fn()
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    get

    get(path, options, [callback]) ⇒ Operation

    Make a GET request against the base URL.

    ParamTypeDescription
    pathstringPath to resource
    optionsRequestOptionsOptions to configure the HTTP request
    [callback]functionOptional callback to handle the response

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the CHT HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example: Get a list of contacts

    get("/api/v2/export/contacts");

    Example: Filter contacts given a name

    get("/api/v2/export/contacts", {
    query: {"filters": {
    "search": "jim"
    }}
    });

    post

    post(path, body, options, [callback]) ⇒ Operation

    Make a POST request against the base url

    ParamTypeDescription
    pathstringPath to resource
    bodyobjectObject which will be attached to the POST body
    optionsRequestOptionsOptional request options
    [callback]functionOptional callback to handle the response

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the CHT HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example: Create a new person

    post("/api/v1/people", {  
    "name": "Hannah",
    "phone": "+254712345678",
    "type": "contact",
    "contact_type": "patient", });

    put

    put(path, options, [callback]) ⇒ Operation

    Make a PUT request against the base url

    ParamTypeDescription
    pathstringPath to resource
    optionsRequestOptionsOptions to configure the HTTP request
    [callback]functionOptional callback to handle the response

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the CHT HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example: Update settings

    put("/api/v1/settings",{query:{overwrite:true}});

    request

    request(method, path, data, options, [callback]) ⇒ Operation

    Make a general HTTP request to CHT

    ParamTypeDescription
    methodstringHTTP method to use
    pathstringPath to resource
    dataobjectObject which will be attached to the POST body
    optionsRequestOptionsOptional request options
    [callback]functionOptional callback to handle the response

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the CHT HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example

    request("POST","/api/v1/people", {  
    "name": "Hannah",
    "phone": "+254712345678",
    "type": "contact",
    "contact_type": "patient", });

    Interfaces

    RequestOptions

    Options provided to the HTTP request

    Properties

    NameTypeDescription
    bodyobject | stringbody data to append to the request. JSON will be converted to a string (but a content-type header will not be attached to the request).
    errorsobjectMap of errorCodes -> error messages, ie, { 404: 'Resource not found;' }. Pass false to suppress errors for this code.
    formobjectPass a JSON object to be serialised into a multipart HTML form (as FormData) in the body.
    queryobjectAn object of query parameters to be encoded into the URL.
    headersobjectAn object of headers to append to the request.
    parseAsstringParse the response body as json, text or stream. By default will use the response headers.
    timeoutnumberRequest timeout in ms. Default: 300 seconds.

    - + \ No newline at end of file diff --git a/adaptors/packages/cht-readme.html b/adaptors/packages/cht-readme.html index 5cd35f46ebf5..af719dd4df68 100644 --- a/adaptors/packages/cht-readme.html +++ b/adaptors/packages/cht-readme.html @@ -17,7 +17,7 @@ - + @@ -29,7 +29,7 @@ configuration-schema for required and optional configuration properties.

    A example expression using the post function

    post("/api/v1/people", {  
    "name": "Hannah",
    "phone": "+254712345678",
    "type": "contact",
    "contact_type": "patient", });

    Development

    Clone the adaptors monorepo. Follow the "Getting Started" guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To build only the docs run pnpm build docs.

    - + \ No newline at end of file diff --git a/adaptors/packages/collections-changelog.html b/adaptors/packages/collections-changelog.html index f1e26b7940e6..a7e5eb03261b 100644 --- a/adaptors/packages/collections-changelog.html +++ b/adaptors/packages/collections-changelog.html @@ -17,7 +17,7 @@ - + @@ -32,7 +32,7 @@ an error, as in:

    collections.get('my-collection', 'some-item')

    Note that this requires Lightning v2.10.5+

    0.5.2

    Patch Changes

    0.5.1

    Patch Changes

    0.5.0

    Minor Changes

    0.4.0

    Minor Changes

    0.3.0

    Minor Changes

    Patch Changes

    0.2.0

    Minor Changes

    0.1.0

    Initial experiemntal release, with collections.get, collections.each, collections.remove and collections.set

    - + \ No newline at end of file diff --git a/adaptors/packages/collections-configuration-schema.html b/adaptors/packages/collections-configuration-schema.html index 13ab47788856..c41db6b9fe74 100644 --- a/adaptors/packages/collections-configuration-schema.html +++ b/adaptors/packages/collections-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "collections_endpoint": "https://app.openfn.org",
    "collections_token": "x.y.z"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "collections_endpoint": {
    "title": "Collections api endpoint",
    "anyOf": [
    {
    "type": "string"
    },
    {
    "type": "null"
    }
    ],
    "description": "The base URL (http://app.openfn.org)",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://app.openfn.org"
    ],
    "default": "https://app.openfn.org"
    },
    "collections_token": {
    "title": "Access Token",
    "type": "string",
    "description": "Access token for the collection",
    "examples": [
    "x.y.z"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "collections_endpoint",
    "collections_token"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/collections-docs.html b/adaptors/packages/collections-docs.html index c47436007e99..438fbe3192d4 100644 --- a/adaptors/packages/collections-docs.html +++ b/adaptors/packages/collections-docs.html @@ -17,7 +17,7 @@ - + @@ -41,7 +41,7 @@ You can pass a string key and a single value, or a key generator function and an array of values. The function will be called for each value, passing each value as the first argument, and should return a string key.

    ParamTypeDescription
    namestringThe name of the collection to fetch from
    keygena function which generates a key for each value: (value, index) => key. Pass a string to set a static key for a single item.
    valuesan array of values to set, or a single value.

    Example: Set a number of values using each value's id property as a key

    collections.set('my-collection', (item) => item.id, $.data)

    Example: Set a number of values, generating an id from a string template

    collections.set('my-collection', (item) => `${item.category}-${Date.now()}`, $.data)

    Example: Set a single value with a static key

    collections.set('my-collection', 'city-codes', { NY: 'New York', LDN: 'London' })

    Interfaces

    QueryOptions

    Query options. All dates should be parseable as ISO 8601 strings, see https://simple.wikipedia.org/wiki/ISO_8601

    Properties

    NameTypeDescription
    keystringkey or key pattern to match against. Patterns support wildcards, eg 2024-01*
    createdBeforestringmatches values that were created before the start of the provided date
    createdAfterstringmatches values that were created after the end of the provided date
    limitnumberlimit the maximum amount of results. If Infinity or unset, all items will be fetched. Default: Infnity.
    pageSizenumberspecify the number of values downloaded per page (or chunk). Default 1000.
    cursorstringset the cursor position to start searching from a specific index.

    - + \ No newline at end of file diff --git a/adaptors/packages/collections-readme.html b/adaptors/packages/collections-readme.html index 9010e95cc4bb..76210a278061 100644 --- a/adaptors/packages/collections-readme.html +++ b/adaptors/packages/collections-readme.html @@ -17,7 +17,7 @@ - + @@ -34,7 +34,7 @@ collections for that worker. The URL should point to https://<lightning>/collections

    Development

    Clone the adaptors monorepo. Follow the "Getting Started" guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To build only the docs run pnpm build docs.

    - + \ No newline at end of file diff --git a/adaptors/packages/commcare-changelog.html b/adaptors/packages/commcare-changelog.html index 8eb182d0f870..af4ba30dd245 100644 --- a/adaptors/packages/commcare-changelog.html +++ b/adaptors/packages/commcare-changelog.html @@ -17,7 +17,7 @@ - + @@ -33,7 +33,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    1.5.6

    Patch Changes

    1.5.5

    Patch Changes

    1.5.4

    Patch Changes

    1.5.3

    Patch Changes

    1.5.2

    Patch Changes

    1.5.1

    Patch Changes

    1.5.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/commcare-configuration-schema.html b/adaptors/packages/commcare-configuration-schema.html index d340cd1669c2..dbb522f16bf4 100644 --- a/adaptors/packages/commcare-configuration-schema.html +++ b/adaptors/packages/commcare-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "hostUrl": "https://www.commcarehq.org",
    "domain": "some-proof-of-concept",
    "appId": "the-long-uuid-in-the-url-that-designates-a-unique-commcare-project"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "hostUrl": {
    "title": "Host URL",
    "type": "string",
    "description": "The CommCare host url",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://www.commcarehq.org"
    ]
    },
    "domain": {
    "title": "Domain",
    "type": "string",
    "description": "The CommCare domain name",
    "minLength": 1,
    "examples": [
    "some-proof-of-concept"
    ]
    },
    "apiKey": {
    "title": "API Key",
    "type": "string",
    "description": "The CommCare API Key",
    "minLength": 1,
    "examples": [
    "the-long-uuid-provided-by-commcare-that-authenticates-requests"
    ]
    },
    "appId": {
    "title": "App ID",
    "type": "string",
    "description": "Your CommCare project UUID",
    "minLength": 1,
    "examples": [
    "the-long-uuid-in-the-url-that-designates-a-unique-commcare-project"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "The username to log in to CommCare",
    "minLength": 1,
    "examples": [
    "test@openfn.org"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "The password to log in to CommCare",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "superscretepassword"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "hostUrl",
    "domain",
    "appId"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/commcare-docs.html b/adaptors/packages/commcare-docs.html index 79152ba4f7c5..c250ac2780c8 100644 --- a/adaptors/packages/commcare-docs.html +++ b/adaptors/packages/commcare-docs.html @@ -17,7 +17,7 @@ - + @@ -34,7 +34,7 @@ You can pass Commcare body data as a JSON object.

    ParamTypeDescription
    pathstringPath to resource
    dataobjectObject or JSON to create a resource
    [params]ObjectOptional request params
    [callback]functionOptional callback to handle the response

    This operation writes the following keys to state:

    State KeyDescription
    dataThe response body (as JSON)
    responseThe HTTP response from the CommCare server (excluding the body)
    referencesAn array of all previous data objects used in the Job

    Example: Create a user resource.Equivalent to <baseUrl>/user

    post("/user", { "username":"test", "password":"somepassword" })

    request

    request(method, path, body, params) ⇒ Operation

    Make a general HTTP request against the Commcare server. Use this to make any request to Commcare REST API.

    ParamTypeDescription
    methodstringHTTP method to use
    pathstringPath to resource
    bodyobjectObject which will be attached to the body
    paramsobjectAn object of query parameters to be encoded into the URL

    This operation writes the following keys to state:

    State KeyDescription
    dataThe response body (as JSON)
    responseThe HTTP response from the CommCare server (excluding the body)
    referencesAn array of all previous data objects used in the Job

    Example: Get a resource. Equivalent to <baseUrl>/a/asri/api/v0.5/case

    request("GET", "/a/asri/api/v0.5/case");

    Example: Get a resource using query parameters. Equivalent to <baseUrl>/case?offset=0&limit=20

    request("GET", "/case", {}, { offset:0, limit: 20 })

    submit

    submit(data) ⇒ Operation

    Submit forms to CommCare. Use this to send forms directly to Commcare REST API. Accepts an array of JSON objects, converts them into XML, and submits to CommCare as an x-form.

    ParamTypeDescription
    dataObjectThe form as a JSON object

    This operation writes the following keys to state:

    State KeyDescription
    dataThe response body (as JSON)
    responseThe HTTP response from the CommCare server (excluding the body)
    referencesAn array of all previous data objects used in the Job

    Example: Submit a form resource.

    submit(
    fields(
    field('@', state => ({
    xmlns: `http://openrosa.org/formdesigner/${state.formId}`,
    })),
    field('question1', state => state.data.answer1),
    field('question2', state => state.data.answer2)
    )
    );

    submitXls

    submitXls(data, params) ⇒ Operation

    Bulk upload data to CommCare. Use this to send multiple items for a single resource at once to Commcare. It accepts an array of objects, converts them into an XLS representation, and uploads.

    ParamTypeDescription
    dataarrayArray of objects to upload
    paramsObjectInput parameters, see CommCare docs.

    This operation writes the following keys to state:

    State KeyDescription
    dataThe response body (as JSON)
    responseThe HTTP response from the CommCare server (excluding the body)
    referencesAn array of all previous data objects used in the Job

    Example: Upload a single row of data for a resource.

    submitXls([{ name: 'Mamadou', phone: '000000' }], {
    case_type: 'student',
    search_field: 'external_id',
    create_new_cases: 'on',
    });

    Interfaces

    CommcareHttpState

    State object

    Properties

    NameDescription
    dataThe response body (as JSON)
    responseThe HTTP response from the CommCare server (excluding the body)
    referencesAn array of all previous data objects used in the Job

    - + \ No newline at end of file diff --git a/adaptors/packages/commcare-readme.html b/adaptors/packages/commcare-readme.html index 4ef066ada2aa..9fec185890fc 100644 --- a/adaptors/packages/commcare-readme.html +++ b/adaptors/packages/commcare-readme.html @@ -17,7 +17,7 @@ - + @@ -32,7 +32,7 @@ https://www.commcarehq.org/a/YOUR_PROJECT/apps/view/YOUR_APP_ID/

  • Note that the username is your full email address.

  • fetchReportData to pull aggregate data from CommCare

    It takes 3 arguments: reportId, params, and postUrl.

    fetchReportData(
    'reportId',
    { limit: 10, offset: 2, state: 'Vermont' },
    'http://www.openfn.org/inbox/secret-uuid'
    );

    simple body target:

    <data xmlns="http://openrosa.org/formdesigner/39A2CA97-2EB8-4A9C-A0D1-6AA666666A66">
    <firstname>Something</firstname>
    <lastname>Else</lastname>
    <age>29</age>
    </data>

    complex body target:

    <?xml version='1.0' ?>
    <data uiVersion="1" version="17" name="New Form" xmlns:jrm="http://dev.commcarehq.org/jr/xforms" xmlns="http://openrosa.org/formdesigner/1DFD8610-91E3-4409-BF8B-02D3B4FF3530">
    <foo>bar</foo>
    <n0:case case_id="ddb8e2b3-7ce0-43e4-ad45-d7a2eebe9169" user_id="user-xxx-eve" date_modified="2013-04-19T16:53:02.799-04" xmlns:n0="http://commcarehq.org/case/transaction/v2">
    <n0:create>
    <n0:case_name>bar</n0:case_name>
    <n0:owner_id>user-xxx-eve</n0:owner_id>
    <n0:case_type>member</n0:case_type>
    </n0:create>
    </n0:case>
    <n1:meta xmlns:n1="http://openrosa.org/jr/xforms">
    <n1:deviceID>A00000245706EE</n1:deviceID>
    <n1:timeStart>2013-04-19T16:52:41.000-04</n1:timeStart>
    <n1:timeEnd>2013-04-19T16:53:02.799-04</n1:timeEnd>
    <n1:username>eve</n1:username>
    <n1:userID>user-xxx-eve</n1:userID>
    <n1:instanceID>b58df19c-efd5-4ecf-9581-65dda8b8787c</n1:instanceID>
    <n2:appVersion xmlns:n2="http://commcarehq.org/xforms">CommCare ODK, version "2.4.1"(10083). App v19. CommCare Version 2.4. Build 10083, built on: March-12-2013</n2:appVersion>
    </n1:meta>
    </data>

    Submitting data to CommCare HQ

    Submit an XLS file

    This function bulk submit a JSON object as xls file to CommCare HQ

    submitXls([{ name: 'Mamadou', phone: '000000' }], {
    case_type: 'student',
    search_field: 'external_id',
    create_new_cases: 'on',
    });

    submit

    Here we're just building the most basic JSON object, that will be converted to an XML object and posted as the element.

    submit(
    fields(
    field('@', function (state) {
    return {
    xmlns:
    'http://openrosa.org/formdesigner/2BCC3E88-2D0D-4C07-8D4A-6B372F3799D9',
    };
    }),
    field('paitent_namentosh', dataValue('first_name')),
    field('question2', 'Some answer here.'),
    field('question3', 'HKS'),
    field('question4', 'item1'),
    field('question5', 69855),
    field('question6', 12)
    )
    );

    An open rosa form submission body should look like this:

    <?xml version="1.0" ?>
    <data name="Patient Registration" uiVersion="1" version="9" xmlns="http://openrosa.org/formdesigner/2BCC3E88-2D0D-4C07-8D4A-6B372F3799D9" xmlns:jrm="http://dev.commcarehq.org/jr/xforms">
    <paitent_namentosh>Taylor</paitent_namentosh>
    <question2>Moruki</question2>
    <question3>Hks</question3>
    <question4>item1</question4>
    <question5>69855</question5>
    <question6>12</question6>
    <n0:meta xmlns:n0="http://openrosa.org/jr/xforms">
    <n0:deviceID>358239055789384</n0:deviceID>
    <n0:timeStart>2015-08-21T16:21:59.807+02</n0:timeStart>
    <n0:timeEnd>2015-08-21T16:22:15.987+02</n0:timeEnd>
    <n0:username>openfn</n0:username>
    <n0:userID>5fe615b3af2834cb5dca59f7466d6174</n0:userID>
    <n0:instanceID>195e79eb-d823-46fe-9e4f-59b8327d5db2</n0:instanceID>
    <n1:appVersion xmlns:n1="http://commcarehq.org/xforms">CommCare ODK, version &quot;2.22.0&quot;(370023). App v9. CommCare Version 2.22. Build 370023, built on: July-22-2015</n1:appVersion>
    </n0:meta>
    </data>

    So the JSON emitted by your expression should look like this:

    {
    "data": {
    "name": "Patient Registration",
    "uiVersion": "1",
    "version": "9",
    "xmlns": "http://openrosa.org/formdesigner/2BCC3E88-2D0D-4C07-8D4A-6B372F3799D9",
    "xmlns:jrm": "http://dev.commcarehq.org/jr/xforms",
    "paitent_namentosh": "Taylor",
    "question2": " Moruki",
    "question3": "Hks",
    "question4": "item1",
    "question5": "69855",
    "question6": "12",
    "n0:meta": {
    "xmlns:n0": "http://openrosa.org/jr/xforms",
    "n0:deviceID": "358239055789384",
    "n0:timeStart": "2015-08-21T16:21:59.807+02",
    "n0:timeEnd": "2015-08-21T16:22:15.987+02",
    "n0:username": "openfn",
    "n0:userID": "5fe615b3af2834cb5dca59f7466d6174",
    "n0:instanceID": "195e79eb-d823-46fe-9e4f-59b8327d5db2",
    "n1:appVersion": {
    "xmlns:n1": "http://commcarehq.org/xforms",
    "$t": "CommCare ODK, version \"2.22.0\"(370023). App v9. CommCare Version 2.22. Build 370023, built on: July-22-2015"
    }
    }
    }
    }

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/common-changelog.html b/adaptors/packages/common-changelog.html index 3bf46a94086a..39d41a4442bf 100644 --- a/adaptors/packages/common-changelog.html +++ b/adaptors/packages/common-changelog.html @@ -17,7 +17,7 @@ - + @@ -45,7 +45,7 @@ in the data may have an object as it's value (when there is only one item), and an array of objects when there is more than one. toArray can be used to reconcile this inconsistency.
    - + \ No newline at end of file diff --git a/adaptors/packages/common-configuration-schema.html b/adaptors/packages/common-configuration-schema.html index 2aced7eb63b0..526f3b8c6f86 100644 --- a/adaptors/packages/common-configuration-schema.html +++ b/adaptors/packages/common-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/common-docs.html b/adaptors/packages/common-docs.html index f0b7e60e29da..a73bbf0124af 100644 --- a/adaptors/packages/common-docs.html +++ b/adaptors/packages/common-docs.html @@ -17,7 +17,7 @@ - + @@ -63,7 +63,7 @@ easily add commonly used options. The return object is chainable so you can set as many options as you want. Pass an object to set your own options.

    ParamTypeDescription
    optionsCommonRequestOptionsoptions to pass to the request

    Example: Get with a query an oath token

    get($.data.url, http.options({ query: $.query }).oath($.configuration.access_token))

    http.post

    post(url, options) ⇒ Operation

    Make a POST request.

    ParamTypeDescription
    urlstringURL to access
    optionsCommonRequestOptionsRequest options

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example: Post a JSON object (setting the content-type header)

     http.post(
    'https://jsonplaceholder.typicode.com/todos',
    $.data,
    options().json(),
    })

    http.request

    request(method, url, options) ⇒ Operation

    Make a HTTP request.

    ParamTypeDescription
    methodstringThe HTTP method to use.
    urlstringURL to resource.
    optionsCommonRequestOptionsRequest options

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example

    http.request(
    'GET',
    'https://jsonplaceholder.typicode.com/todos'
    )

    Interfaces

    CommonRequestOptions

    Options provided to the HTTP request

    Properties

    NameTypeDescription
    errorsobjectMap of errorCodes -> error messages, ie, { 404: 'Resource not found;' }. Pass false to suppress errors.
    formobjectPass a JSON object to be serialised into a multipart HTML form (as FormData) in the body.
    queryobjectAn object of query parameters to be encoded into the URL.
    headersobjectAn object of headers to append to the request.
    parseAsstringParse the response body as json, text or stream. By default will use the response headers.
    timeoutnumberRequest timeout in ms. Default: 300 seconds.
    tlsobjectTLS/SSL authentication options. See https://nodejs.org/api/tls.html#tlscreatesecurecontextoptions

    OptionsHelpers

    Helper functions provided by http.options.

    Properties

    NameTypeDescription
    jsonfunctionSets the `content-type' header to 'application/json'
    basicfunctionSets basic auth on the Authorization header. Pass username and password
    bearerfunctionSets a Bearer token on the Authorization header. Pass the token.
    oauthfunctionSets a Bearer token on the Authorization header. Pass the oauth token.

    - + \ No newline at end of file diff --git a/adaptors/packages/common-readme.html b/adaptors/packages/common-readme.html index fb1a6b841685..12976a5f3827 100644 --- a/adaptors/packages/common-readme.html +++ b/adaptors/packages/common-readme.html @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/dhis2-changelog.html b/adaptors/packages/dhis2-changelog.html index 760a54241995..9fbaabbccf1a 100644 --- a/adaptors/packages/dhis2-changelog.html +++ b/adaptors/packages/dhis2-changelog.html @@ -17,7 +17,7 @@ - + @@ -42,7 +42,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    3.2.12

    Patch Changes

    3.2.11

    Patch Changes

    3.2.10

    Patch Changes

    3.2.9

    Patch Changes

    3.2.8

    Patch Changes

    3.2.7

    Patch Changes

    3.2.6

    Patch Changes

    3.2.5

    Patch Changes

    3.2.4

    Patch Changes

    3.2.3

    Patch Changes

    3.2.2

    Patch Changes

    3.2.1

    Patch Changes

    3.2.0

    Minor Changes

    3.1.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/dhis2-configuration-schema.html b/adaptors/packages/dhis2-configuration-schema.html index 3c1760a22f02..f7c2fcb1736a 100644 --- a/adaptors/packages/dhis2-configuration-schema.html +++ b/adaptors/packages/dhis2-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "hostUrl": "https://play.dhis2.org/2.36.6",
    "password": "@some(!)Password",
    "username": "admin"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "hostUrl": {
    "title": "Host URL",
    "type": "string",
    "description": "The base DHIS2 instance URL",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://play.dhis2.org/2.36.6"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "Username",
    "minLength": 1,
    "examples": [
    "admin"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Password",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@some(!)Password"
    ]
    },
    "apiVersion": {
    "title": "API Version",
    "anyOf": [
    {
    "type": "string"
    },
    {
    "type": "null"
    }
    ],
    "placeholder": "38",
    "description": "DHIS2 api version",
    "minLength": 1,
    "examples": [
    "v2"
    ]
    },
    "pat": {
    "title": "Personal Access Token",
    "type": "string",
    "description": "Personal access token",
    "minLength": 1,
    "examples": [
    "d2pat_vreYExmi0yh92Soy8CCF2zHG0wRjID494035128247"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "hostUrl",
    "password",
    "username"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/dhis2-docs.html b/adaptors/packages/dhis2-docs.html index 23ed59b842fa..53beeff50a3d 100644 --- a/adaptors/packages/dhis2-docs.html +++ b/adaptors/packages/dhis2-docs.html @@ -17,7 +17,7 @@ - + @@ -27,7 +27,7 @@
    Skip to main content

    dhis2@6.3.0

    attr(attribute, value)
    create(resourceType, data, [options], [callback])
    destroy(resourceType, path, [data], [options], [callback])
    discover(httpMethod, endpoint)
    dv(dataElement, value)
    findAttributeValue(trackedEntity, attributeDisplayName)
    findAttributeValueById(trackedEntity, attributeUid)
    get(resourceType, query, [options], [callback])
    patch(resourceType, path, data, [options], [callback])
    post(resourceType, data, [options], [callback])
    update(resourceType, path, data, [options], [callback])
    upsert(resourceType, query, data, [options], [callback])

    This adaptor exports the following from common:

    alterState()
    cursor()
    dataPath()
    dataValue()
    dateFns
    each()
    field()
    fields()
    fn()
    fnIf()
    group()
    http
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    attr

    attr(attribute, value) ⇒ object

    Converts an attribute ID and value into a DHIS2 attribute object

    ParamTypeDescription
    attributestringA tracked entity instance (TEI) attribute ID.
    valuestringThe value for that attribute.

    Example

    attr('w75KJ2mc4zz', 'Elias')

    create

    create(resourceType, data, [options], [callback]) ⇒ Operation

    Create a record

    ParamTypeDescription
    resourceTypestringType of resource to create. E.g. trackedEntities, programs, events, ...
    dataDhis2DataObject which defines data that will be used to create a given instance of resource. To create a single instance of a resource, data must be a javascript object, and to create multiple instances of a resources, data must be an array of javascript objects.
    [options]ObjectOptional options to define URL parameters via params (E.g. filter, dimension and other import parameters), request config (E.g. auth) and the DHIS2 apiVersion.
    [callback]functionOptional callback to handle the response

    Example: Create a program

    create('programs', {
    name: 'name 20',
    shortName: 'n20',
    programType: 'WITHOUT_REGISTRATION',
    });

    Example: Create a single event

    create('events', {
    program: 'eBAyeGv0exc',
    orgUnit: 'DiszpKrYNg8',
    status: 'COMPLETED',
    });

    Example: Create a single tracker entity. See Create tracker docs

    create('trackedEntities', {
    orgUnit: 'TSyzvBiovKh',
    trackedEntityType: 'nEenWmSyUEp',
    attributes: [
    {
    attribute: 'w75KJ2mc4zz',
    value: 'Gigiwe',
    },
    ]
    });

    Example: Create a dataSet

    create('dataSets', { name: 'OpenFn Data Set', periodType: 'Monthly' });

    Example: a dataSetNotification

    create('dataSetNotificationTemplates', {
    dataSetNotificationTrigger: 'DATA_SET_COMPLETION',
    notificationRecipient: 'ORGANISATION_UNIT_CONTACT',
    name: 'Notification',
    messageTemplate: 'Hello',
    deliveryChannels: ['SMS'],
    dataSets: [],
    });

    Example: Create a dataElement

    create('dataElements', {
    aggregationType: 'SUM',
    domainType: 'AGGREGATE',
    valueType: 'NUMBER',
    name: 'Paracetamol',
    shortName: 'Para',
    });

    Example: Create a dataElementGroup

    create('dataElementGroups', {
    name: 'Data Element Group 1',
    dataElements: [],
    });

    Example: Create a dataElementGroupSet

    create('dataElementGroupSets', {
    name: 'Data Element Group Set 4',
    dataDimension: true,
    shortName: 'DEGS4',
    dataElementGroups: [],
    });

    Example: Create a dataValueSet

    create('dataValueSets', {
    dataElement: 'f7n9E0hX8qk',
    period: '201401',
    orgUnit: 'DiszpKrYNg8',
    value: '12',
    });

    Example: Create a dataValueSet with related dataValues

    create('dataValueSets', {
    dataSet: 'pBOMPrpg1QX',
    completeDate: '2014-02-03',
    period: '201401',
    orgUnit: 'DiszpKrYNg8',
    dataValues: [
    {
    dataElement: 'f7n9E0hX8qk',
    value: '1',
    },
    {
    dataElement: 'Ix2HsbDMLea',
    value: '2',
    },
    {
    dataElement: 'eY5ehpbEsB7',
    value: '3',
    },
    ],
    });

    Example: Create an enrollment

    create('enrollments', {
    trackedEntity: 'bmshzEacgxa',
    orgUnit: 'TSyzvBiovKh',
    program: 'gZBxv9Ujxg0',
    enrollmentDate: '2013-09-17',
    incidentDate: '2013-09-17',
    });

    Example: Create an multiple objects with the Tracker API

     create("tracker", {
    enrollments: [
    {
    trackedEntity: "bmshzEacgxa",
    orgUnit: "TSyzvBiovKh",
    program: "gZBxv9Ujxg0",
    enrollmentDate: "2013-09-17",
    incidentDate: "2013-09-17",
    },
    ],
    trackedEntities: [
    {
    orgUnit: "TSyzvBiovKh",
    trackedEntityType: "nEenWmSyUEp",
    attributes: [
    {
    attribute: "w75KJ2mc4zz",
    value: "Gigiwe",
    },
    ],
    },
    ],
    });

    destroy

    destroy(resourceType, path, [data], [options], [callback]) ⇒ Operation

    Delete a record. A generic helper function to delete an object

    ParamTypeDescription
    resourceTypestringThe type of resource to be deleted. E.g. trackedEntities, organisationUnits, etc.
    pathstringCan be an id of an object or path to the nested object to delete.
    [data]ObjectOptional. This is useful when you want to remove multiple objects from a collection in one request. You can send data as, for example, {"identifiableObjects": [{"id": "IDA"}, {"id": "IDB"}, {"id": "IDC"}]}. See more on DHIS2 API docs
    [options]ObjectOptional options for del operation including params e.g. {preheatCache: true, strategy: 'UPDATE', mergeMode: 'REPLACE'}. Run discover or see DHIS2 documentation. Defaults to {operationName: 'delete', apiVersion: state.configuration.apiVersion, responseType: 'json'}
    [callback]functionOptional callback to handle the response

    Example: a tracked entity instance. See Delete tracker docs

    destroy('trackedEntities', 'LcRd6Nyaq7T');

    discover

    discover(httpMethod, endpoint) ⇒ Operation

    Discover DHIS2 api endpoint query parameters and allowed operators for a given resource's endpoint.

    ParamTypeDescription
    httpMethodstringThe HTTP to inspect parameter usage for a given endpoint, e.g., get, post,put,patch,delete
    endpointstringThe path for a given endpoint. E.g. /trackedEntities or /dataValueSets

    Example: a list of parameters allowed on a given endpoint for specific http method

    discover('post', '/trackedEntities')

    dv

    dv(dataElement, value) ⇒ object

    Converts a dataElement and value into a DHIS2 dataValue object

    ParamTypeDescription
    dataElementstringA data element ID.
    valuestringThe value for that data element.

    Example

    dv('f7n9E0hX8qk', 12)

    findAttributeValue

    findAttributeValue(trackedEntity, attributeDisplayName) ⇒ string

    Gets an attribute value by its case-insensitive display name

    ParamTypeDescription
    trackedEntityObjectA tracked entity instance (TEI) object
    attributeDisplayNamestringThe 'displayName' to search for in the TEI's attributes

    Example

    findAttributeValue(state.data.trackedEntities[0], 'first name')

    findAttributeValueById

    findAttributeValueById(trackedEntity, attributeUid) ⇒ string

    Gets an attribute value by its uid

    ParamTypeDescription
    trackedEntityObjectA tracked entity instance (TEI) object
    attributeUidstringThe uid to search for in the TEI's attributes

    Example

    findAttributeValueById(state.tei, 'y1w2R6leVmh')

    get

    get(resourceType, query, [options], [callback]) ⇒ Operation

    Get data. Generic helper method for getting data of any kind from DHIS2.

    • This can be used to get DataValueSets,events,trackers,etc.

    Returns: Operation - state

    ParamTypeDefaultDescription
    resourceTypestringThe type of resource to get(use its plural name). E.g. dataElements, tracker/trackedEntities,organisationUnits, etc.
    queryObjectA query object that will limit what resources are retrieved when converted into request params.
    [options]ObjectOptional options to define URL parameters via params beyond filters, request configuration (e.g. auth) and DHIS2 api version to use.
    [options.params]ObjectThe parameters for the request.
    [options.requestConfig]ObjectThe configuration for the request, including headers, etc.
    [options.asBase64]booleanfalseOptional flag to indicate if the response should be returned as a Base64 encoded string.
    [callback]functionOptional callback to handle the response

    Example: Get all data values for the 'pBOMPrpg1QX' dataset

    get('dataValueSets', {
    dataSet: 'pBOMPrpg1QX',
    orgUnit: 'DiszpKrYNg8',
    period: '201401',
    fields: '*',
    });

    Example: Get all programs for an organization unit

    get('programs', { orgUnit: 'TSyzvBiovKh', fields: '*' });

    Example: Get a single tracked entity given the provided ID. See TrackedEntities docs

    get('tracker/trackedEntities/F8yKM85NbxW');

    Example: Get an enrollment given the provided ID. See Enrollment docs

    get('tracker/enrollments/abcd');

    Example: Get all events matching given criteria. See Events docs

    get('tracker/events');

    Example: Get the relationship between two tracker entities. The only required parameters are 'trackedEntity', 'enrollment' or 'event'. See Relationships docs

    get('tracker/relationships', {
    trackedEntity:['F8yKM85NbxW'],
    });

    patch

    patch(resourceType, path, data, [options], [callback]) ⇒ Operation

    Patch a record. A generic helper function to send partial updates on one or more object properties.

    • You are not required to send the full body of object properties.
    • This is useful for cases where you don't want or need to update all properties on a object.
    ParamTypeDescription
    resourceTypestringThe type of resource to be updated. E.g. dataElements, organisationUnits, etc.
    pathstringThe id or path to the object to be updated. E.g. FTRrcoaog83 or FTRrcoaog83/{collection-name}/{object-id}
    dataObjectData to update. Include only the fields you want to update. E.g. {name: "New Name"}
    [options]ObjectOptional configuration, including params for the update ({preheatCache: true, strategy: 'UPDATE', mergeMode: 'REPLACE'}). Defaults to {operationName: 'patch', apiVersion: state.configuration.apiVersion, responseType: 'json'}
    [callback]functionOptional callback to handle the response

    Example: a dataElement

    patch('dataElements', 'FTRrcoaog83', { name: 'New Name' });

    post

    post(resourceType, data, [options], [callback]) ⇒ Operation

    Post data. Generic helper method for posting data of any kind to DHIS2. This can be used to create DataValueSets,events,trackers,etc.

    Returns: Operation - state

    ParamTypeDescription
    resourceTypestringType of resource to create. E.g. trackedEntities, programs, events, ...
    dataDhis2DataObject which defines data that will be used to create a given instance of resource. To create a single instance of a resource, data must be a javascript object, and to create multiple instances of a resources, data must be an array of javascript objects.
    [options]ObjectOptional options to define URL parameters via params (E.g. filter, dimension and other import parameters), request config (E.g. auth) and the DHIS2 apiVersion.
    [callback]functionOptional callback to handle the response

    Example: Create an event

    post("tracker", {
    events: [
    {
    program: "eBAyeGv0exc",
    orgUnit: "DiszpKrYNg8",
    status: "COMPLETED",
    },
    ],
    });

    update

    update(resourceType, path, data, [options], [callback]) ⇒ Operation

    Update data. A generic helper function to update a resource object of any type. Updating an object requires to send all required fields or the full body

    ParamTypeDescription
    resourceTypestringThe type of resource to be updated. E.g. dataElements, organisationUnits, etc.
    pathstringThe id or path to the object to be updated. E.g. FTRrcoaog83 or FTRrcoaog83/{collection-name}/{object-id}
    dataObjectData to update. It requires to send all required fields or the full body. If you want partial updates, use patch operation.
    [options]ObjectOptional options to define URL parameters via params (E.g. filter, dimension and other import parameters), request config (E.g. auth) and the DHIS2 apiVersion.
    [callback]functionOptional callback to handle the response

    Example: a program

    update('programs', 'qAZJCrNJK8H', {
    name: '14e1aa02c3f0a31618e096f2c6d03bed',
    shortName: '14e1aa02',
    programType: 'WITHOUT_REGISTRATION',
    });

    Example: an event

    update('events', 'PVqUD2hvU4E', {
    program: 'eBAyeGv0exc',
    orgUnit: 'Ngelehun CHC',
    status: 'COMPLETED',
    storedBy: 'admin',
    dataValues: [],
    });

    Example: Update a tracker entity. See Update tracker docs

    update('trackedEntities', '', {
    createdAt: '2015-08-06T21:12:37.256',
    orgUnit: 'TSyzvBiovKh',
    createdAtClient: '2015-08-06T21:12:37.256',
    trackedEntity: 'IeQfgUtGPq2',
    trackedEntityType: 'nEenWmSyUEp',
    inactive: false,
    deleted: false,
    featureType: 'NONE',
    programOwners: [
    {
    ownerOrgUnit: 'TSyzvBiovKh',
    program: 'IpHINAT79UW',
    trackedEntity: 'IeQfgUtGPq2',
    },
    ],
    attributes: [
    {
    lastUpdated: '2016-01-12T00:00:00.000',
    displayName: 'Last name',
    created: '2016-01-12T00:00:00.000',
    valueType: 'TEXT',
    attribute: 'zDhUuAYrxNC',
    value: 'Russell',
    },
    {
    lastUpdated: '2016-01-12T00:00:00.000',
    code: 'MMD_PER_NAM',
    displayName: 'First name',
    created: '2016-01-12T00:00:00.000',
    valueType: 'TEXT',
    attribute: 'w75KJ2mc4zz',
    value: 'Catherine',
    },
    ],
    });

    Example: Update a dataSet

    update('dataSets', 'lyLU2wR22tC', { name: 'OpenFN Data Set', periodType: 'Weekly' });

    Example: a dataSetNotification

    update('dataSetNotificationTemplates', 'VbQBwdm1wVP', {
    dataSetNotificationTrigger: 'DATA_SET_COMPLETION',
    notificationRecipient: 'ORGANISATION_UNIT_CONTACT',
    name: 'Notification',
    messageTemplate: 'Hello Updated',
    deliveryChannels: ['SMS'],
    dataSets: [],
    });

    Example: Update a dataElement

    update('dataElements', 'FTRrcoaog83', {
    aggregationType: 'SUM',
    domainType: 'AGGREGATE',
    valueType: 'NUMBER',
    name: 'Paracetamol',
    shortName: 'Para',
    });

    Example: Update a dataElementGroup

    update('dataElementGroups', 'QrprHT61XFk', {
    name: 'Data Element Group 1',
    dataElements: [],
    });

    Example: Update a dataElementGroupSet

    update('dataElementGroupSets', 'VxWloRvAze8', {
    name: 'Data Element Group Set 4',
    dataDimension: true,
    shortName: 'DEGS4',
    dataElementGroups: [],
    });

    Example: Update a dataValueSet

    update('dataValueSets', 'AsQj6cDsUq4', {
    dataElement: 'f7n9E0hX8qk',
    period: '201401',
    orgUnit: 'DiszpKrYNg8',
    value: '12',
    });

    Example: Update a dataValueSet with related dataValues

    update('dataValueSets', 'Ix2HsbDMLea', {
    dataSet: 'pBOMPrpg1QX',
    completeDate: '2014-02-03',
    period: '201401',
    orgUnit: 'DiszpKrYNg8',
    dataValues: [
    {
    dataElement: 'f7n9E0hX8qk',
    value: '1',
    },
    {
    dataElement: 'Ix2HsbDMLea',
    value: '2',
    },
    {
    dataElement: 'eY5ehpbEsB7',
    value: '3',
    },
    ],
    });

    Example: Update an enrollment given the provided ID

    update('enrollments', 'CmsHzercTBa' {
    trackedEntity: 'bmshzEacgxa',
    orgUnit: 'TSyzvBiovKh',
    program: 'gZBxv9Ujxg0',
    enrollmentDate: '2013-10-17',
    incidentDate: '2013-10-17',
    });

    upsert

    upsert(resourceType, query, data, [options], [callback]) ⇒ Operation

    Upsert a record. A generic helper function used to atomically either insert a row, or on the basis of the row already existing, UPDATE that existing row instead.

    Throws:

    • RangeError - Throws range error
    ParamTypeDescription
    resourceTypestringThe type of a resource to upsert. E.g. trackedEntities
    queryObjectA query object that allows to uniquely identify the resource to update. If no matches found, then the resource will be created.
    dataObjectThe data to use for update or create depending on the result of the query.
    [options]ObjectOptional configuration that will be applied to both the get and the create or update operations.
    [callback]functionOptional callback to handle the response

    Example: Upsert a trackedEntity

    upsert('trackedEntities', {
    orgUnit: 'TSyzvBiovKh',
    filter: ['w75KJ2mc4zz:Eq:Qassim'],
    }, {
    orgUnit: 'TSyzvBiovKh',
    trackedEntityType: 'nEenWmSyUEp',
    attributes: [
    {
    attribute: 'w75KJ2mc4zz',
    value: 'Qassim',
    },
    ],
    });

    - + \ No newline at end of file diff --git a/adaptors/packages/dhis2-readme.html b/adaptors/packages/dhis2-readme.html index 1bf0c25632a2..6d18e0404888 100644 --- a/adaptors/packages/dhis2-readme.html +++ b/adaptors/packages/dhis2-readme.html @@ -17,7 +17,7 @@ - + @@ -41,7 +41,7 @@ are correctly configured.

    For further technical details, see the documentation or contact the OpenFn community.

    - + \ No newline at end of file diff --git a/adaptors/packages/dynamics-changelog.html b/adaptors/packages/dynamics-changelog.html index a16886b91e9a..4194d2252ad5 100644 --- a/adaptors/packages/dynamics-changelog.html +++ b/adaptors/packages/dynamics-changelog.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    0.3.5

    Patch Changes

    0.3.4

    Patch Changes

    0.3.3

    Patch Changes

    0.3.2

    Patch Changes

    0.3.1

    Patch Changes

    0.3.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/dynamics-configuration-schema.html b/adaptors/packages/dynamics-configuration-schema.html index 6fcc5c0f9dfc..b2b1b99554ec 100644 --- a/adaptors/packages/dynamics-configuration-schema.html +++ b/adaptors/packages/dynamics-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "resource": "https://openfn.crm2.dynamics.com",
    "apiVersion": "8.2.0",
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjlGWERwYmZNRlQyU3ZRdVhoODQ2WVR3RUlCdyIsI"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$comment": "OAuth2",
    "properties": {
    "resource": {
    "title": "Resource",
    "type": "string",
    "description": "Dynamics resource URL",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://openfn.crm2.dynamics.com"
    ]
    },
    "apiVersion": {
    "title": "API Version",
    "type": "string",
    "default": "8.2.0",
    "description": "Dynamics API version to use",
    "minLength": 1,
    "examples": [
    "8.2.0"
    ]
    },
    "access_token": {
    "title": "Access Token",
    "type": "string",
    "description": "Dynamics API access token",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjlGWERwYmZNRlQyU3ZRdVhoODQ2WVR3RUlCdyIsI"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "resource",
    "apiVersion",
    "access_token"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/dynamics-docs.html b/adaptors/packages/dynamics-docs.html index 7407d4650889..f06f0bcd7be3 100644 --- a/adaptors/packages/dynamics-docs.html +++ b/adaptors/packages/dynamics-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/dynamics-readme.html b/adaptors/packages/dynamics-readme.html index 26e861148de2..78ce0565fe52 100644 --- a/adaptors/packages/dynamics-readme.html +++ b/adaptors/packages/dynamics-readme.html @@ -17,7 +17,7 @@ - + @@ -35,7 +35,7 @@ in the expression. Otherwise it will perform a query on all data with the defined Entity Name

    query({
    entityName: 'contacts',
    entityId: '51a0e5b9-88df-e311-b8e5-6c3be5a8b200',
    query: {
    fields: ['fullname', 'birthdate'],
    limit: 10,
    orderBy: {
    field: 'lastname',
    direction: 'asc',
    },
    filter: "firstname eq 'Cat'",
    },
    });

    sample update expression

    updateEntity({
    entityName: 'accounts',
    entityId: 'f4301865-c64a-e711-80f3-e0071b6fd061',
    body: {
    name: 'wilder 2',
    creditonhold: true,
    address1_latitude: 47.639583,
    description: 'This is the description of the sample account',
    revenue: 5000000,
    accountcategorycode: 1,
    },
    });

    sample delete expression

    deleteEntity({
    entityName: 'accounts',
    entityId: 'aeef941b-254a-e711-80f1-e0071b685921',
    });

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/facebook-changelog.html b/adaptors/packages/facebook-changelog.html index 3ff20593b663..8468a603171e 100644 --- a/adaptors/packages/facebook-changelog.html +++ b/adaptors/packages/facebook-changelog.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    0.2.3

    Patch Changes

    0.2.2

    Patch Changes

    0.2.1

    Patch Changes

    0.2.0

    Minor Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/facebook-configuration-schema.html b/adaptors/packages/facebook-configuration-schema.html index dc607ca718e0..e9388e674c88 100644 --- a/adaptors/packages/facebook-configuration-schema.html +++ b/adaptors/packages/facebook-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "access_token": "EAAGm0PX4ZCpsBAEHuZBwZBZCDEZDZD7ZC8ZBZBt7MbZA7sVZA"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$comment": "OAuth2",
    "properties": {
    "access_token": {
    "title": "Access Token",
    "type": "string",
    "description": "Your Facebook API access token",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "EAAGm0PX4ZCpsBAEHuZBwZBZCDEZDZD7ZC8ZBZBt7MbZA7sVZA"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "access_token"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/facebook-docs.html b/adaptors/packages/facebook-docs.html index 2e77d1344fc5..774c62861702 100644 --- a/adaptors/packages/facebook-docs.html +++ b/adaptors/packages/facebook-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/facebook-readme.html b/adaptors/packages/facebook-readme.html index 4f4607a741a6..f341fe14e477 100644 --- a/adaptors/packages/facebook-readme.html +++ b/adaptors/packages/facebook-readme.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ configuration-schema definition.

    postMessage

    sample expression using operation

    postMessage({
    recipient: {
    id: '<PSID>',
    },
    message: {
    text: '<YOUR MESSAGE GOES HERE>',
    },
    });

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/fhir-changelog.html b/adaptors/packages/fhir-changelog.html index 6113496a3076..c53b08e5db1f 100644 --- a/adaptors/packages/fhir-changelog.html +++ b/adaptors/packages/fhir-changelog.html @@ -17,7 +17,7 @@ - + @@ -31,7 +31,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    2.0.0

    Major Changes

    1.1.5

    Patch Changes

    1.1.4

    Patch Changes

    1.1.3

    Patch Changes

    1.1.2

    Patch Changes

    1.1.1

    Patch Changes

    1.1.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/fhir-configuration-schema.html b/adaptors/packages/fhir-configuration-schema.html index b29e89f553ac..5442fb109946 100644 --- a/adaptors/packages/fhir-configuration-schema.html +++ b/adaptors/packages/fhir-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "baseUrl": "https://hapi.fhir.org",
    "apiPath": "baseR4"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "properties": {
    "baseUrl": {
    "title": "Base Url",
    "type": "string",
    "description": "The baseUrl",
    "examples": [
    "https://hapi.fhir.org"
    ]
    },
    "apiPath": {
    "title": "API Path",
    "anyOf": [
    {
    "type": "string"
    },
    {
    "type": "null"
    }
    ],
    "placeholder": "R4",
    "description": "FHIR api path",
    "minLength": 1,
    "examples": [
    "baseR4",
    "R3",
    "R4"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "Username",
    "examples": [
    "openfn_test"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Password",
    "writeOnly": true,
    "examples": [
    "@some(!)Str0ngp4ss0w0rd"
    ]
    },
    "access_token": {
    "title": "Access Token",
    "type": "string",
    "description": "Your FHIR access token",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "the-long-access-token-from-your-auth"
    ]
    }
    },
    "required": [
    "baseUrl",
    "apiPath"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/fhir-docs.html b/adaptors/packages/fhir-docs.html index 04c22f679ba7..e4ed667074cb 100644 --- a/adaptors/packages/fhir-docs.html +++ b/adaptors/packages/fhir-docs.html @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@
    Skip to main content

    fhir@5.0.3

    create(resourceType, resource, params, callback)
    createTransactionBundle(entries, callback)
    get(path, params, options, callback)
    getClaim(claimId, params, callback)
    post(path, data, options, callback)

    This adaptor exports the following from common:

    alterState()
    dataPath()
    dataValue()
    dateFns
    each()
    field()
    fields()
    fn()
    fnIf()
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    create

    create(resourceType, resource, params, callback) ⇒ Operation

    Creates a new resource with a server assigned resourceType. The resource object doesn't need resourceType or id

    ParamTypeDescription
    resourceTypestringThe resource type to create
    resourceobjectThe resource to create
    paramsobject(Optional) FHIR parameters to control and configure resource creation
    callbackfunction(Optional) callback function

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the FHIR HTTP server (with the body removed)
    referencesan array of all the previous data values

    Example: Create a new patient

    create('Patient', {
    name: [
    {
    use: 'official',
    family: 'La Paradisio',
    given: ['Josephine', 'Nessa'],
    },
    ],
    });

    createTransactionBundle

    createTransactionBundle(entries, callback) ⇒ Operation

    Create a transaction bundle to process multiple requests at once

    ParamTypeDescription
    entriesarrayarray of transactions
    callbackfunction(Optional) callback function

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the FHIR HTTP server (with the body removed)
    referencesan array of all the previous data values

    Example

    createTransactionBundle([
    {
    fullUrl: "https://hapi.fhir.org/baseR4/Patient/592442",
    resource: {
    resourceType: "Patient",
    id: "592442",
    name: [{ given: "Caleb", family: "Cushing" }],
    },
    request: {
    method: "POST",
    url: "Patient",
    },
    },
    ]);

    get

    get(path, params, options, callback) ⇒ Operation

    Send a HTTP GET request to the baseURL defined in config

    ParamTypeDescription
    pathstringPath to resource
    paramsobject(Optional) Parameters to encode into the URL query
    optionsGetOptions(Optional) Options to control the request
    callbackfunction(Optional) callback function

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the FHIR HTTP server (with the body removed)
    referencesan array of all the previous data values

    Example: Get a Patient resource by id

    get('Patient/0bd0038b-8aad-4719-8d55-ff94bd3de5d0');

    Example: Get a resource with query parameters

    get("Claim", { _include: "Claim:patient", _sort: "-_lastUpdated", _count: 200 })

    getClaim

    getClaim(claimId, params, callback) ⇒ Operation

    Get Claim in a FHIR system

    ParamTypeDescription
    claimIdstringclaim id
    paramsobjectquery parameters
    callbackfunctioncallback function

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the FHIR HTTP server (with the body removed)
    referencesan array of all the previous data values

    Example

    getClaim('',{ _include: "Claim:patient", _sort: "-_lastUpdated", _count: 200 });

    post

    post(path, data, options, callback) ⇒ Operation

    Send a HTTP POST request to the baseURL defined in config

    ParamTypeDescription
    pathstringPath to resource
    dataobjectJSON data to append to the POST body
    optionsRequestOptions(Optional) Additional options for the request
    callbackfunction(Optional) callback function

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the FHIR HTTP server (with the body removed)
    referencesan array of all the previous data values

    Example: Create bundle

    post("Bundle",{
    "resourceType": "Bundle"
    })

    Interfaces

    FHIRHttpState

    State object

    Properties

    NameDescription
    datathe parsed response body
    responsethe response from the FHIR HTTP server (with the body removed)
    referencesan array of all the previous data values

    GetOptions

    Options provided to a GET HTTP request

    Properties

    NameTypeDescription
    errorsobjectMap of errorCodes -> error messages, ie, { 404: 'Resource not found;' }. Pass false to suppress errors for this code.
    timeoutnumberRequest timeout in ms. Default: 300 seconds.

    RequestOptions

    Options provided to a HTTP request

    Properties

    NameTypeDescription
    headersobjectObject of headers to append to the request
    bodyobjectJSON payload to attach to the request
    queryobjectQuery parameters for the request. Will be encoded into the URL
    errorsobjectMap of errorCodes -> error messages, ie, { 404: 'Resource not found;' }. Pass false to suppress errors for this code.
    timeoutnumberRequest timeout in ms. Default: 300 seconds.

    - + \ No newline at end of file diff --git a/adaptors/packages/fhir-fr-changelog.html b/adaptors/packages/fhir-fr-changelog.html index 1f540335936a..a601e1a7ba22 100644 --- a/adaptors/packages/fhir-fr-changelog.html +++ b/adaptors/packages/fhir-fr-changelog.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/fhir-fr-configuration-schema.html b/adaptors/packages/fhir-fr-configuration-schema.html index 312452aeafb9..f308a16023b9 100644 --- a/adaptors/packages/fhir-fr-configuration-schema.html +++ b/adaptors/packages/fhir-fr-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "baseUrl": "https://hapi.fhir.org",
    "apiPath": "baseR4"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "properties": {
    "baseUrl": {
    "title": "Base Url",
    "type": "string",
    "description": "The baseUrl",
    "examples": [
    "https://hapi.fhir.org"
    ]
    },
    "apiPath": {
    "title": "API Path",
    "anyOf": [
    {
    "type": "string"
    },
    {
    "type": "null"
    }
    ],
    "placeholder": "R4",
    "description": "FHIR api path",
    "minLength": 1,
    "examples": [
    "baseR4",
    "R3",
    "R4"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "Username",
    "examples": [
    "openfn_test"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Password",
    "writeOnly": true,
    "examples": [
    "@some(!)Str0ngp4ss0w0rd"
    ]
    },
    "access_token": {
    "title": "Access Token",
    "type": "string",
    "description": "Your FHIR access token",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "the-long-access-token-from-your-auth"
    ]
    }
    },
    "required": [
    "baseUrl",
    "apiPath"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/fhir-fr-docs.html b/adaptors/packages/fhir-fr-docs.html index 98443d4c908b..d7e02b3f40a6 100644 --- a/adaptors/packages/fhir-fr-docs.html +++ b/adaptors/packages/fhir-fr-docs.html @@ -17,7 +17,7 @@ - + @@ -39,7 +39,7 @@ If ref is a FHIR resource, a reference to it will be generated If ref is a string, it'll be treated as a reference id and returned as an object If ref is a valid FHIR reference, it'll just be returned.

    ParamDescription
    refthe thing to generate a reference from

    utils.setSystemMap

    setSystemMap()

    Define a set of mapped system values.

    Builder functions will use this mappings when they encounter them in system keys. Useful for setting shortcuts.

    Example: Set shortcut sustem mappings

    util.setSystemMap({
    SmartCareID: 'http://moh.gov.et/fhir/hiv/identifier/SmartCareID'
    });
    builders.patient('patient', { identifier: util.identifier('xyz', 'SmartCareId') })
    };

    builders

    These functions belong to the builders namespace.

    builders.address

    address(type, props)

    Create a FHIR Address resource.

    ParamTypeDescription
    typestringThe profile id for the resource variant
    propsProperties to apply to the resource

    builders.appointment

    appointment(type, props)

    Create a FHIR Appointment resource.

    ParamTypeDescription
    typestringThe profile id for the resource variant
    propsProperties to apply to the resource

    builders.contactPoint

    contactPoint(type, props)

    Create a FHIR ContactPoint resource.

    ParamTypeDescription
    typestringThe profile id for the resource variant
    propsProperties to apply to the resource

    builders.encounter

    encounter(type, props)

    Create a FHIR Encounter resource.

    ParamTypeDescription
    typestringThe profile id for the resource variant
    propsProperties to apply to the resource

    builders.extension

    extension(type, props)

    Create a FHIR Extension resource.

    ParamTypeDescription
    typestringThe profile id for the resource variant
    propsProperties to apply to the resource

    builders.healthcareService

    healthcareService(type, props)

    Create a FHIR HealthcareService resource.

    ParamTypeDescription
    typestringThe profile id for the resource variant
    propsProperties to apply to the resource

    builders.humanName

    humanName(type, props)

    Create a FHIR HumanName resource.

    ParamTypeDescription
    typestringThe profile id for the resource variant
    propsProperties to apply to the resource

    builders.location

    location(type, props)

    Create a FHIR Location resource.

    ParamTypeDescription
    typestringThe profile id for the resource variant
    propsProperties to apply to the resource

    builders.medicationAdministration

    medicationAdministration(type, props)

    Create a FHIR MedicationAdministration resource.

    ParamTypeDescription
    typestringThe profile id for the resource variant
    propsProperties to apply to the resource

    builders.observation

    observation(type, props)

    Create a FHIR Observation resource.

    ParamTypeDescription
    typestringThe profile id for the resource variant
    propsProperties to apply to the resource

    builders.organization

    organization(type, props)

    Create a FHIR Organization resource.

    ParamTypeDescription
    typestringThe profile id for the resource variant
    propsProperties to apply to the resource

    builders.patient

    patient(type, props)

    Create a FHIR Patient resource.

    ParamTypeDescription
    typestringThe profile id for the resource variant
    propsProperties to apply to the resource

    builders.practitioner

    practitioner(type, props)

    Create a FHIR Practitioner resource.

    ParamTypeDescription
    typestringThe profile id for the resource variant
    propsProperties to apply to the resource

    builders.practitionerRole

    practitionerRole(type, props)

    Create a FHIR PractitionerRole resource.

    ParamTypeDescription
    typestringThe profile id for the resource variant
    propsProperties to apply to the resource

    builders.relatedPerson

    relatedPerson(type, props)

    Create a FHIR RelatedPerson resource.

    ParamTypeDescription
    typestringThe profile id for the resource variant
    propsProperties to apply to the resource

    builders.schedule

    schedule(type, props)

    Create a FHIR Schedule resource.

    ParamTypeDescription
    typestringThe profile id for the resource variant
    propsProperties to apply to the resource

    builders.slot

    slot(type, props)

    Create a FHIR Slot resource.

    ParamTypeDescription
    typestringThe profile id for the resource variant
    propsProperties to apply to the resource

    - + \ No newline at end of file diff --git a/adaptors/packages/fhir-fr-readme.html b/adaptors/packages/fhir-fr-readme.html index b7534b8d07a8..31e8e17167a2 100644 --- a/adaptors/packages/fhir-fr-readme.html +++ b/adaptors/packages/fhir-fr-readme.html @@ -17,7 +17,7 @@ - + @@ -31,7 +31,7 @@ for required and optional configuration properties.

    Development

    Clone the adaptors monorepo. Follow the "Getting Started" guide inside to get set up.

    Run tests using pnpm run test

    Build the adaptor using pnpm build.

    Re-generate the adaptor source with pnpm generate-fhir fhir-fr

    To update the spec an re-generate, run pnpm generate-fhir fhir-fr --respec. You can update the spec url with --spec <www> or by modifying package.json

    - + \ No newline at end of file diff --git a/adaptors/packages/fhir-ndr-et-changelog.html b/adaptors/packages/fhir-ndr-et-changelog.html index 8dcab9368b75..ee1b732854a7 100644 --- a/adaptors/packages/fhir-ndr-et-changelog.html +++ b/adaptors/packages/fhir-ndr-et-changelog.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ value)

    0.0.9

    0.0.8

    Ignore nullish keys in mapping (ie, passing undefined will not set a key on the new object)

    0.0.7

    0.0.6

    0.0.5

    0.0.4

    add type variants add flat assignment of props to resource

    0.0.3

    expose more stuff from common

    0.0.2

    expose fn

    0.0.1

    Initial alpha release.

    - + \ No newline at end of file diff --git a/adaptors/packages/fhir-ndr-et-configuration-schema.html b/adaptors/packages/fhir-ndr-et-configuration-schema.html index 83c6a0feb027..03e01385d6d0 100644 --- a/adaptors/packages/fhir-ndr-et-configuration-schema.html +++ b/adaptors/packages/fhir-ndr-et-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "password": "@some(!)Str0ngp4ss0w0rd",
    "username": "test@openfn.org"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "baseUrl": {
    "title": "Base URL",
    "anyOf": [
    {
    "type": "string"
    },
    {
    "type": "null"
    }
    ],
    "description": "The base URL (http://www.example.com)",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://example.com"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "Username",
    "examples": [
    "test@openfn.org"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Password",
    "writeOnly": true,
    "examples": [
    "@some(!)Str0ngp4ss0w0rd"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "password",
    "username"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/fhir-ndr-et-docs.html b/adaptors/packages/fhir-ndr-et-docs.html index 56153d1c52b2..79fddcdcd58f 100644 --- a/adaptors/packages/fhir-ndr-et-docs.html +++ b/adaptors/packages/fhir-ndr-et-docs.html @@ -17,7 +17,7 @@ - + @@ -40,7 +40,7 @@ If ref is a FHIR resource, a reference to it will be generated If ref is a string, it'll be treated as a reference id and returned as an object If ref is a valid FHIR reference, it'll just be returned.

    ParamDescription
    refthe thing to generate a reference from

    utils.setSystemMap

    setSystemMap()

    Define a set of mapped system values.

    Builder functions will use this mappings when they encounter them in system keys. Useful for setting shortcuts.

    Example: Set shortcut sustem mappings

    util.setSystemMap({
    SmartCareID: 'http://moh.gov.et/fhir/hiv/identifier/SmartCareID'
    });
    builders.patient('patient', { identifier: util.identifier('xyz', 'SmartCareId') })
    };

    builders

    These functions belong to the builders namespace.

    builders.carePlan

    carePlan(type, props)

    Create a FHIR CarePlan resource.

    ParamTypeDescription
    typestringThe profile id for the resource variant
    propsProperties to apply to the resource

    builders.encounter

    encounter(type, props)

    Create a FHIR Encounter resource.

    ParamTypeDescription
    typestringThe profile id for the resource variant
    propsProperties to apply to the resource

    builders.medication

    medication(type, props)

    Create a FHIR Medication resource.

    ParamTypeDescription
    typestringThe profile id for the resource variant
    propsProperties to apply to the resource

    builders.medicationAdministration

    medicationAdministration(type, props)

    Create a FHIR MedicationAdministration resource.

    ParamTypeDescription
    typestringThe profile id for the resource variant
    propsProperties to apply to the resource

    builders.medicationDispense

    medicationDispense(type, props)

    Create a FHIR MedicationDispense resource.

    ParamTypeDescription
    typestringThe profile id for the resource variant
    propsProperties to apply to the resource

    builders.medicationRequest

    medicationRequest(type, props)

    Create a FHIR MedicationRequest resource.

    ParamTypeDescription
    typestringThe profile id for the resource variant
    propsProperties to apply to the resource

    builders.observation

    observation(type, props)

    Create a FHIR Observation resource.

    ParamTypeDescription
    typestringThe profile id for the resource variant
    propsProperties to apply to the resource

    builders.patient

    patient(type, props)

    Create a FHIR Patient resource.

    ParamTypeDescription
    typestringThe profile id for the resource variant
    propsProperties to apply to the resource

    builders.relatedPerson

    relatedPerson(type, props)

    Create a FHIR RelatedPerson resource.

    ParamTypeDescription
    typestringThe profile id for the resource variant
    propsProperties to apply to the resource

    - + \ No newline at end of file diff --git a/adaptors/packages/fhir-ndr-et-readme.html b/adaptors/packages/fhir-ndr-et-readme.html index 32ab48ae118f..7b1571e47d6f 100644 --- a/adaptors/packages/fhir-ndr-et-readme.html +++ b/adaptors/packages/fhir-ndr-et-readme.html @@ -17,7 +17,7 @@ - + @@ -81,7 +81,7 @@ way less nice API).

    Once finished, generated files are written into src/, where they can be tested.

    Development

    Clone the adaptors monorepo. Follow the "Getting Started" guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To build only the docs run pnpm build docs.

    - + \ No newline at end of file diff --git a/adaptors/packages/fhir-readme.html b/adaptors/packages/fhir-readme.html index 77b24d54765e..6cc40d32c6c8 100644 --- a/adaptors/packages/fhir-readme.html +++ b/adaptors/packages/fhir-readme.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ configuration-schema definition.

    Creates a resource in a destination system using a POST request

    create('/endpoint', { foo: 'bar' });

    Creates a transactionBundle for HAPI FHIR

    createTransactionBundle({
    entry: [transactionBundle],
    });

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/ghana-bdr-changelog.html b/adaptors/packages/ghana-bdr-changelog.html index 5635194755b9..bfd954e8cad2 100644 --- a/adaptors/packages/ghana-bdr-changelog.html +++ b/adaptors/packages/ghana-bdr-changelog.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/ghana-bdr-configuration-schema.html b/adaptors/packages/ghana-bdr-configuration-schema.html index 564be006ebee..6ac9a156d117 100644 --- a/adaptors/packages/ghana-bdr-configuration-schema.html +++ b/adaptors/packages/ghana-bdr-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "password": "@some(!)Str0ngp4ss0w0rd",
    "username": "test@openfn.org",
    "baseUrl": "https://example.com"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "baseUrl": {
    "title": "Base URL",
    "type": "string",
    "description": "The base URL (http://www.example.com)",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://example.com"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "Username",
    "examples": [
    "test@openfn.org"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Password",
    "writeOnly": true,
    "examples": [
    "@some(!)Str0ngp4ss0w0rd"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "password",
    "username",
    "baseUrl"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/ghana-bdr-docs.html b/adaptors/packages/ghana-bdr-docs.html index ddc63f66c432..c22fbd9181c8 100644 --- a/adaptors/packages/ghana-bdr-docs.html +++ b/adaptors/packages/ghana-bdr-docs.html @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@
    Skip to main content

    ghana-bdr@0.1.3

    get(path, query)
    post(path, data)
    sendBirthNotification(data)

    This adaptor exports the following from common:

    cursor()
    dataPath()
    dataValue()
    dateFns
    each()
    field()
    fields()
    fn()
    fnIf()
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    get

    get(path, query) ⇒ Operation

    Make a GET request

    ParamTypeDescription
    pathstringPath to resource
    queryobjectAn object of query parameters to be encoded into the URL.

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example

    get("patient");

    post

    post(path, data) ⇒ Operation

    Make a POST request

    ParamTypeDescription
    pathstringPath to resource
    dataobjectbody data to append to the request. JSON will be converted to a string (but a content-type header will not be attached to the request).

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example

    post("patient", { "name":"Bukayo" });

    sendBirthNotification

    sendBirthNotification(data) ⇒ Operation

    Generate a birth certificate

    ParamTypeDescription
    dataobjectbody data to append to the request. JSON will be converted to a string (but a content-type header will not be attached to the request).

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example

    sendBirthNotification({
    registry_code: 'abc123',
    child: {},
    mother: {},
    father: {},
    })

    Interfaces

    HttpState

    /** State object

    Properties

    NameDescription
    datathe parsed response body
    responsethe response from the HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    - + \ No newline at end of file diff --git a/adaptors/packages/ghana-bdr-readme.html b/adaptors/packages/ghana-bdr-readme.html index 785c3233a59e..09780dada29e 100644 --- a/adaptors/packages/ghana-bdr-readme.html +++ b/adaptors/packages/ghana-bdr-readme.html @@ -17,7 +17,7 @@ - + @@ -31,7 +31,7 @@ configuration-schema for required and optional configuration properties.

    Development

    Clone the adaptors monorepo. Follow the "Getting Started" guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To build only the docs run pnpm build docs.

    - + \ No newline at end of file diff --git a/adaptors/packages/ghana-nia-changelog.html b/adaptors/packages/ghana-nia-changelog.html index ec5226af2d5c..abab8d31310d 100644 --- a/adaptors/packages/ghana-nia-changelog.html +++ b/adaptors/packages/ghana-nia-changelog.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/ghana-nia-configuration-schema.html b/adaptors/packages/ghana-nia-configuration-schema.html index 07e5bf65e4c4..b24df5117900 100644 --- a/adaptors/packages/ghana-nia-configuration-schema.html +++ b/adaptors/packages/ghana-nia-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "baseUrl": "https://example.com",
    "merchantKey": "abc-123-def"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "baseUrl": {
    "title": "Base URL",
    "type": "string",
    "description": "The base URL (http://www.example.com)",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://example.com"
    ]
    },
    "merchantKey": {
    "title": "NIA Merchant Key",
    "type": "string",
    "description": "NI Merchant Key",
    "examples": [
    "abc-123-def"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "baseUrl",
    "merchantKey"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/ghana-nia-docs.html b/adaptors/packages/ghana-nia-docs.html index 859c1e3bcd6b..466d5e7bc2c3 100644 --- a/adaptors/packages/ghana-nia-docs.html +++ b/adaptors/packages/ghana-nia-docs.html @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@
    Skip to main content

    ghana-nia@0.1.3

    get(path, query)
    post(path, data)
    registerChild(data)

    This adaptor exports the following from common:

    cursor()
    dataPath()
    dataValue()
    dateFns
    each()
    field()
    fields()
    fn()
    fnIf()
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    get

    get(path, query) ⇒ Operation

    Make a GET request

    ParamTypeDescription
    pathstringPath to resource
    queryobjectAn object of query parameters to be encoded into the URL.

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example

    get("patient");

    post

    post(path, data) ⇒ Operation

    Make a POST request

    ParamTypeDescription
    pathstringPath to resource
    dataobjectbody data to append to the request. JSON will be converted to a string (but a content-type header will not be attached to the request).

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example

    post("patient", { "name":"Bukayo" });

    registerChild

    registerChild(data) ⇒ Operation

    Generate a national ID

    ParamTypeDescription
    dataobjectbody data to append to the request. JSON will be converted to a string (but a content-type header will not be attached to the request).

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example

    registerChild({
    babyData: {
    dateOfBirth: "string",
    fatherName: "string",
    forenames: "string",
    gender: "string",
    lightwaveETrackerID: "string",
    motherName: "string",
    noSiblingsInDelivery: "string",
    placeOfBirth: "string",
    surname: "string",
    timeOfbirth: "string",
    weightAtBirth: "string",
    babyPicture: "string"
    },
    personVouching: {
    etrackerLightwaveID: "string",
    ghanaCardPIN: "string",
    relationToBaby: "string",
    relativePhone: "string",
    relativePicture: "string"
    }
    })

    Interfaces

    HttpState

    /** State object

    Properties

    NameDescription
    datathe parsed response body
    responsethe response from the HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    - + \ No newline at end of file diff --git a/adaptors/packages/ghana-nia-readme.html b/adaptors/packages/ghana-nia-readme.html index c141d51a6451..d8bc9be0b33e 100644 --- a/adaptors/packages/ghana-nia-readme.html +++ b/adaptors/packages/ghana-nia-readme.html @@ -17,7 +17,7 @@ - + @@ -31,7 +31,7 @@ configuration-schema for required and optional configuration properties.

    Development

    Clone the adaptors monorepo. Follow the "Getting Started" guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To build only the docs run pnpm build docs.

    - + \ No newline at end of file diff --git a/adaptors/packages/gmail-changelog.html b/adaptors/packages/gmail-changelog.html index 83f76157db97..7355eda5c725 100644 --- a/adaptors/packages/gmail-changelog.html +++ b/adaptors/packages/gmail-changelog.html @@ -17,7 +17,7 @@ - + @@ -29,7 +29,7 @@ adpator has only been released a couple of days we don't anticipate this affecting any users.

    1.0.0

    Initial release.

    - + \ No newline at end of file diff --git a/adaptors/packages/gmail-configuration-schema.html b/adaptors/packages/gmail-configuration-schema.html index 93f225bf1033..b7439fa04112 100644 --- a/adaptors/packages/gmail-configuration-schema.html +++ b/adaptors/packages/gmail-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjlGWERwYmhax0rZNRlQyU3ZRdVhoODQ2WVR3RUlCdyIsI"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$comment": "OAuth2",
    "properties": {
    "access_token": {
    "title": "Access Token",
    "type": "string",
    "description": "Your Gmail access token",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjlGWERwYmhax0rZNRlQyU3ZRdVhoODQ2WVR3RUlCdyIsI"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "access_token"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/gmail-docs.html b/adaptors/packages/gmail-docs.html index 0b6b4a0a4716..ac8129f9d082 100644 --- a/adaptors/packages/gmail-docs.html +++ b/adaptors/packages/gmail-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    gmail@1.1.1

    getContentsFromMessages(options)

    This adaptor exports the following from common:

    alterState()
    combine()
    cursor()
    dataPath()
    dataValue()
    each()
    field()
    fields()
    fn()
    fnIf()
    http
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    getContentsFromMessages

    getContentsFromMessages(options) ⇒ Operation

    Downloads contents from messages of a Gmail account.

    ParamTypeDescription
    optionsOptionsCustomized options including desired contents and query.

    This operation writes the following keys to state:

    State KeyDescription
    dataThe returned message objects, of the form { messageId, contents }
    processedIdsAn array of string ids processed by this request

    Example: Get a message with a specific subject

    getContentsFromMessages(
    {
    query: 'subject:my+test+message'
    }
    )

    Example: Get messages after a specific date, with subject and report.txt attachment

    getContentsFromMessages(
    {
    query: 'after:15/01/2025',
    contents: [
    'subject',
    { type: 'file', name: 'metadata', file: 'report.txt'}
    ]
    }
    )

    Interfaces

    MessageContent

    Used to isolate the type of content to retrieve from the message.

    Properties

    NameTypeDescription
    [type]stringMessage content type. Valid types: from, date, subject, body, archive, file.
    [name]stringA custom description for the content type.
    [archive]RegExp | stringIdentifier to isolate the desired attachment when type is 'archive'. Use a regular expression for pattern matching or a string for a literal match. Required if type is 'archive'.
    [file]RegExp | stringIdentifier to isolate the desired attachment when type is 'file' or 'archive'. Use a regular expression for pattern matching or a string for a literal match. Required if type is 'file' or 'archive'.
    [maxLength]numberMaximum number of characters to retrieve from the content.

    Options

    Configurable options provided to the Gmail adaptor.

    Properties

    NameTypeDefaultDescription
    [query]stringGmail search query string.
    [contents]Array.<(string|MessageContent)>['from', 'date', 'subject', 'body']An array of strings or MessageContent objects used to specify which parts of the message to retrieve.
    [processedIds]Array.<string>Ignore message ids which have already been processed.
    [email]stringThe user account to retrieve messages from. Defaults to the authenticated user.
    [maxResults]intMaximum number of messages to process per request. Default is 1000.

    - + \ No newline at end of file diff --git a/adaptors/packages/gmail-readme.html b/adaptors/packages/gmail-readme.html index c6cf877280ab..b4a6a3cb7945 100644 --- a/adaptors/packages/gmail-readme.html +++ b/adaptors/packages/gmail-readme.html @@ -17,7 +17,7 @@ - + @@ -28,7 +28,7 @@ https://support.google.com/googleapi/answer/6158849

    Use the Postman application to query the OAuth enpoint and retrieve an access token

    Initially, you'll need to configure an authentication request using Postman's built-in OAuth 2.0 implementation:

    Once the form is filled out, repeat these steps each hour to retrieve a new access token:

    Configure OpenFn CLI to find the access token

    The Gmail adaptor looks for the access token in the configuration section under access_token.

    Example configuration using a workflow:

    "workflow": {
    "steps": [
    {
    "id": "getGmailContent",
    "adaptors": [
    "gmail"
    ],
    "expression": "path/to/gmail.js",
    "configuration": {
    "access_token": "(access token acquired from Postman)"
    }
    }
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/godata-changelog.html b/adaptors/packages/godata-changelog.html index fef93fe5fe58..55ed514c1724 100644 --- a/adaptors/packages/godata-changelog.html +++ b/adaptors/packages/godata-changelog.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    3.2.4

    Patch Changes

    3.2.3

    Patch Changes

    3.2.2

    Patch Changes

    3.2.1

    Patch Changes

    3.2.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/godata-configuration-schema.html b/adaptors/packages/godata-configuration-schema.html index a7db2df6eb5f..b180fc478250 100644 --- a/adaptors/packages/godata-configuration-schema.html +++ b/adaptors/packages/godata-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "apiUrl": "https://www.who-godata.com/api",
    "email": "test@openfn.org",
    "password": "@some(!)Strongpassword"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "apiUrl": {
    "title": "API URL",
    "type": "string",
    "description": "Godata API URL",
    "default": "https://www.who-godata.com/api",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://www.who-godata.com/api"
    ]
    },
    "email": {
    "title": "Email",
    "type": "string",
    "description": "Your Godata login email",
    "format": "email",
    "minLength": 1,
    "examples": [
    "test@openfn.org"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Your Godata login password",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@some(!)Strongpassword"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "apiUrl",
    "email",
    "password"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/godata-docs.html b/adaptors/packages/godata-docs.html index 9774555d9e5f..d29f0b6ca22e 100644 --- a/adaptors/packages/godata-docs.html +++ b/adaptors/packages/godata-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    godata@3.5.4

    getCase(id, query, callback)
    getContact(id, query, callback)
    getLocation(query, callback)
    getOutbreak(query, callback)
    getReferenceData(query, callback)
    listCases(id, callback)
    listContacts(id, callback)
    listLocations(callback)
    listOutbreaks(callback)
    listReferenceData(callback)
    upsertCase(id, externalId, goDataCase, callback)
    upsertContact(id, externalId, goDataContact, callback)
    upsertLocation(externalId, goDataLocation, callback)
    upsertOutbreak(outbreak, callback)
    upsertReferenceData(externalId, goDataReferenceData, callback)

    This adaptor exports the following from common:

    alterState()
    dataPath()
    dataValue()
    each()
    field()
    fields()
    fn()
    fnIf()
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    getCase

    getCase(id, query, callback) ⇒ Operation

    Get one or multiple cases within an outbreak from a query filter

    ParamTypeDescription
    idstringOutbreak id
    queryobjectAn object with a query filter parameter
    callbackfunction(Optional) Callback function

    Example

    getCase(
    '3b55-cdf4',
    { 'where.relationship': { active: true }, where: { firstName: 'Luca'} },
    state => {
    console.log(state);
    return state;
    }
    );

    getContact

    getContact(id, query, callback) ⇒ Operation

    Get one or multiple contacts within an outbreak from a query filter

    ParamTypeDescription
    idstringOutbreak id
    queryobjectAn object with a query filter parameter
    callbackfunction(Optional) Callback function

    Example

    getContact("343d-dc3e", {"where":{"firstName": "Luca"}}, state => {
    console.log(state.data);
    return state;
    });

    getLocation

    getLocation(query, callback) ⇒ Operation

    Get one or multiple locations from a query filter

    ParamTypeDescription
    queryobjectAn object with a query filter parameter
    callbackfunction(Optional) Callback function

    Example

    getLocation({"where":{"name": "30 DE OCTUBRE"}}, state => {
    console.log(state.data);
    return state;
    });

    getOutbreak

    getOutbreak(query, callback) ⇒ Operation

    Get one or multiple outbreaks from a query filter

    ParamTypeDescription
    queryobjectAn object with a query filter parameter
    callbackfunction(Optional) Callback function

    Example

    getOutbreak({"where":{"name": "Outbreak demo"}}, state => {
    console.log(state.data);
    return state;
    });

    getReferenceData

    getReferenceData(query, callback) ⇒ Operation

    Get one or multiple reference data from a query filter

    ParamTypeDescription
    queryobjectAn object with a query filter parameter
    callbackfunction(Optional) Callback function

    Example

    getReferenceData({"where":{"categoryId": "LNG_REFERENCE_DATA_CATEGORY_CENTRE_NAME"}}, state => {
    console.log(state.data);
    return state;
    });

    listCases

    listCases(id, callback) ⇒ Operation

    Fetch the list of cases within a particular outbreak using its ID.

    ParamTypeDescription
    idstringOutbreak id
    callbackfunction(Optional) Callback function

    Example

    listCases("343d-dc3e", state => {
    console.log(state);
    return state;
    });

    listContacts

    listContacts(id, callback) ⇒ Operation

    Fetch the list of contacts within a particular outbreak using its ID.

    ParamTypeDescription
    idstringOutbreak id
    callbackfunction(Optional) Callback function

    Example

    listContacts("343d-dc3e", // Outbreak Id
    state => {
    console.log(state);
    return state;
    });

    listLocations

    listLocations(callback) ⇒ Operation

    Fetch the list of locations

    ParamTypeDescription
    callbackfunction(Optional) Callback function

    Example

    listLocations(state => {
    console.log(state.data);
    return state;
    });

    listOutbreaks

    listOutbreaks(callback) ⇒ Operation

    Fetch the list of outbreaks

    ParamTypeDescription
    callbackfunction(Optional) Callback function

    Example

    listOutbreaks(state => {
    console.log(state.data);
    return state;
    });

    listReferenceData

    listReferenceData(callback) ⇒ Operation

    Fetch the list of reference data

    ParamTypeDescription
    callbackfunction(Optional) Callback function

    Example

    listReferenceData(state => {
    console.log(state.data);
    return state;
    });

    upsertCase

    upsertCase(id, externalId, goDataCase, callback) ⇒ Operation

    Upsert case to godata using an external id to mach a specific record

    ParamTypeDescription
    idstringOutbreak id
    externalIdstringExternal Id to match
    goDataCaseobjectan object with some case data.
    callbackfunction(Optional) Callback function

    Example

    upsertCase("4dce-3eedce3-rd33", 'visualId',
    data: state => {
    const patient = state.data.body;
    return {
    firstName: patient.Patient_name.split(' ')[0],
    lastName: patient.Patient_name.split(' ')[1],
    visualId: patient.Case_ID,
    'age:years': patient.Age_in_year,
    gender: patient.Sex,
    };
    })

    upsertContact

    upsertContact(id, externalId, goDataContact, callback) ⇒ Operation

    Upsert contact to godata using an external id to match a specific record.

    ParamTypeDescription
    idstringOutbreak id
    externalIdstringExternal Id to match
    goDataContactobjectan object with some case data.
    callbackfunction(Optional) Callback function

    Example

    upsertContact("4dce-3eedce3-rd33", 'visualId',
    {
    firstName: 'Luca',
    gender: 'male',
    'age:years': '20'
    ...
    }
    )

    upsertLocation

    upsertLocation(externalId, goDataLocation, callback) ⇒ Operation

    Upsert location to godata

    ParamTypeDescription
    externalIdstringExternal Id to match
    goDataLocationobjectan object with some location data.
    callbackfunction(Optional) Callback function

    Example

    upsertLocation('name', {...})

    upsertOutbreak

    upsertOutbreak(outbreak, callback) ⇒ Operation

    Upsert outbreak to godata

    ParamTypeDescription
    outbreakobjectan object with an externalId and some outbreak data.
    callbackfunction(Optional) Callback function

    Example

    upsertOutbreak({externalId: "3dec33-ede3", data: {...}})

    upsertReferenceData

    upsertReferenceData(externalId, goDataReferenceData, callback) ⇒ Operation

    Upsert reference data to godata

    ParamTypeDescription
    externalIdstringExternal Id to match
    goDataReferenceDataobjectan object with some reference data.
    callbackfunction(Optional) Callback function

    Example

    upsertReferenceData('id', {...})

    - + \ No newline at end of file diff --git a/adaptors/packages/godata-readme.html b/adaptors/packages/godata-readme.html index d36de3b3559a..c7b3eb8fd078 100644 --- a/adaptors/packages/godata-readme.html +++ b/adaptors/packages/godata-readme.html @@ -17,7 +17,7 @@ - + @@ -51,7 +51,7 @@ mechanism can specify a criteria to match.

    getReferenceData(
    { where: { categoryId: 'LNG_REFERENCE_DATA_CATEGORY_CENTRE_NAME' } },
    state => {
    console.log(state.data);
    return state;
    }
    );

    Insert or Update a reference data using a unique id as a key

    This function is used to either update a location if matched or insert a new. A custom externalId can be provided.

    upsertReferenceData('id', {
    categoryId: 'CATEGORY',
    value: 'VALUE',
    readOnly: false,
    active: true,
    id: 'ID',
    createdAt: '2020-10-01T18:48:31.784Z',
    createdBy: '95d31ea9',
    updatedAt: '2020-10-01T18:48:31.784Z',
    updatedBy: '95d31ea9',
    createdOn: 'API',
    deleted: false,
    });

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/googlehealthcare-changelog.html b/adaptors/packages/googlehealthcare-changelog.html index 23db2517cff3..d7793066068a 100644 --- a/adaptors/packages/googlehealthcare-changelog.html +++ b/adaptors/packages/googlehealthcare-changelog.html @@ -17,7 +17,7 @@ - + @@ -31,7 +31,7 @@ information ({cloudRegion: string, projectId: string, datasetId: string, fhirStoreId: string}).

    0.1.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/googlehealthcare-configuration-schema.html b/adaptors/packages/googlehealthcare-configuration-schema.html index 4f906c845c0e..e3c8e7a4c58e 100644 --- a/adaptors/packages/googlehealthcare-configuration-schema.html +++ b/adaptors/packages/googlehealthcare-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjlGWERwYmZNRlQyU3ZRdVhoODQ2WVR3RUlCdyIsI"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$comment": "OAuth2",
    "type": "object",
    "properties": {
    "access_token": {
    "title": "Access Token",
    "type": "string",
    "description": "Your Google Cloud Healthcare access token",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjlGWERwYmZNRlQyU3ZRdVhoODQ2WVR3RUlCdyIsI"
    ]
    },
    "apiVersion": {
    "title": "API Version",
    "type": "string",
    "description": "The API version",
    "default": "v1",
    "examples": [
    "v1",
    "v1beta1"
    ]
    }
    },
    "required": [
    "access_token"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/googlehealthcare-docs.html b/adaptors/packages/googlehealthcare-docs.html index 9a79ee2e78fd..c791886a33f9 100644 --- a/adaptors/packages/googlehealthcare-docs.html +++ b/adaptors/packages/googlehealthcare-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    googlehealthcare@1.1.3

    createFhirResource([fhirStore], resource, callback)

    This adaptor exports the following from common:

    dataPath()
    dataValue()
    dateFns
    each()
    field()
    fields()
    fn()
    fnIf()
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    createFhirResource

    createFhirResource([fhirStore], resource, callback) ⇒ Operation

    Create some resource in Google Cloud Healthcare

    ParamTypeDescription
    [fhirStore]ObjectThe FHIR store information. - cloudRegion (string): The cloud region where the FHIR store is located. - projectId (string): The ID of the project that contains the FHIR store. - datasetId (string): The ID of the dataset that contains the FHIR store. - fhirStoreId (string): The ID of the FHIR store.
    resourceobjectThe FHIR resource data to be created
    callbackfunctionAn optional callback function

    Example

    createFhirResource(
    {
    cloudRegion: "us-central1",
    projectId: "adjective-noun-123",
    datasetId: "my-dataset",
    fhirStoreId: "my-fhir-store",
    },
    {
    resourceType: "Patient",
    name: [{ use: "official", family: "Smith", given: ["Darcy"] }],
    gender: "female",
    birthDate: "1970-01-01",
    }
    );

    Example

    createFhirResource(
    {
    cloudRegion: "us-central1",
    projectId: "adjective-noun-123",
    datasetId: "my-dataset",
    fhirStoreId: "my-fhir-store",
    },
    (state) => ({
    resourceType: "Encounter",
    status: "finished",
    class: {
    system: "http://hl7.org/fhir/v3/ActCode",
    code: "IMP",
    display: "inpatient encounter",
    },
    reasonCode: [
    {
    text: "The patient had an abnormal heart rate. She was concerned about this.",
    },
    ],
    subject: {
    reference: `Patient/${state.data.id}`,
    },
    })
    );

    - + \ No newline at end of file diff --git a/adaptors/packages/googlehealthcare-readme.html b/adaptors/packages/googlehealthcare-readme.html index ce8e2a5b8d48..c1d97530b65d 100644 --- a/adaptors/packages/googlehealthcare-readme.html +++ b/adaptors/packages/googlehealthcare-readme.html @@ -17,7 +17,7 @@ - + @@ -31,7 +31,7 @@ configuration-schema for required and optional configuration properties.

    Development

    Clone the adaptors monorepo. Follow the "Getting Started" guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To build only the docs run pnpm build docs.

    - + \ No newline at end of file diff --git a/adaptors/packages/googlesheets-changelog.html b/adaptors/packages/googlesheets-changelog.html index cb83037d8fd5..51238cb0c1d1 100644 --- a/adaptors/packages/googlesheets-changelog.html +++ b/adaptors/packages/googlesheets-changelog.html @@ -17,7 +17,7 @@ - + @@ -32,7 +32,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    2.1.6

    Patch Changes

    2.1.5

    Patch Changes

    2.1.4

    Patch Changes

    2.1.3

    Patch Changes

    2.1.2

    Patch Changes

    2.1.1

    Patch Changes

    2.1.0

    Minor Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/googlesheets-configuration-schema.html b/adaptors/packages/googlesheets-configuration-schema.html index 7931686acd95..c959c3130bc5 100644 --- a/adaptors/packages/googlesheets-configuration-schema.html +++ b/adaptors/packages/googlesheets-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjlGWERwYmZNRlQyU3ZRdVhoODQ2WVR3RUlCdyIsI"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$comment": "OAuth2",
    "properties": {
    "access_token": {
    "title": "Access Token",
    "type": "string",
    "description": "Your Google Sheets access token",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjlGWERwYmZNRlQyU3ZRdVhoODQ2WVR3RUlCdyIsI"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "access_token"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/googlesheets-docs.html b/adaptors/packages/googlesheets-docs.html index e9674df0c8a7..0ac6fff15b61 100644 --- a/adaptors/packages/googlesheets-docs.html +++ b/adaptors/packages/googlesheets-docs.html @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@
    Skip to main content

    googlesheets@3.0.9

    appendValues(params, callback)
    batchUpdateValues(params, callback)
    getValues(spreadsheetId, range, callback)

    This adaptor exports the following from common:

    alterState()
    combine()
    cursor()
    dataPath()
    dataValue()
    each()
    field()
    fields()
    fn()
    fnIf()
    http
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    appendValues

    appendValues(params, callback) ⇒ Operation

    Add an array of rows to the spreadsheet. https://developers.google.com/sheets/api/samples/writing#append_values

    ParamTypeDescription
    paramsObjectData object to add to the spreadsheet.
    [params.spreadsheetId]stringThe spreadsheet ID.
    [params.range]stringThe range of values to update.
    [params.values]arrayA 2d array of values to update.
    callbackfunction(Optional) Callback function

    Example

    appendValues({
    spreadsheetId: '1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos',
    range: 'Sheet1!A1:E1',
    values: [
    ['From expression', '$15', '2', '3/15/2016'],
    ['Really now!', '$100', '1', '3/20/2016'],
    ],
    })

    batchUpdateValues

    batchUpdateValues(params, callback) ⇒ Operation

    Batch update values in a Spreadsheet.

    Returns: Operation - spreadsheet information

    ParamTypeDescription
    paramsObjectData object to add to the spreadsheet.
    [params.spreadsheetId]stringThe spreadsheet ID.
    [params.range]stringThe range of values to update.
    [params.valueInputOption]string(Optional) Value update options. Defaults to 'USER_ENTERED'
    [params.values]arrayA 2d array of values to update.
    callbackfunction(Optional) callback function

    Example

    batchUpdateValues({
    spreadsheetId: '1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos',
    range: 'Sheet1!A1:E1',
    values: [
    ['From expression', '$15', '2', '3/15/2016'],
    ['Really now!', '$100', '1', '3/20/2016'],
    ],
    })

    getValues

    getValues(spreadsheetId, range, callback) ⇒ Operation

    Gets cell values from a Spreadsheet.

    Returns: Operation - spreadsheet information

    ParamTypeDescription
    spreadsheetIdstringThe spreadsheet ID.
    rangestringThe sheet range.
    callbackfunction(Optional) callback function

    Example

    getValues('1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos','Sheet1!A1:E1')

    - + \ No newline at end of file diff --git a/adaptors/packages/googlesheets-readme.html b/adaptors/packages/googlesheets-readme.html index 14efd632c019..d8f746588eb6 100644 --- a/adaptors/packages/googlesheets-readme.html +++ b/adaptors/packages/googlesheets-readme.html @@ -17,7 +17,7 @@ - + @@ -31,7 +31,7 @@ definition.

    appendValues()

    Add rows to an existing sheet: https://sheets.googleapis.com/v4/spreadsheets/spreadsheetId/values/Sheet1!A1:E1:append?valueInputOption=USER_ENTERED

    appendValues({
    spreadsheetId: '1O-a4_RgPF_p8W3I6b5M9wobA3-CBW8hLClZfUik5sos',
    range: 'Sheet1!A1:E1',
    values: [
    ['From expression', '$15', '2', '3/15/2016'],
    ['Really now!', '$100', '1', '3/20/2016'],
    ],
    });

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/hive-changelog.html b/adaptors/packages/hive-changelog.html index 86253b88bbd8..b3fc89379792 100644 --- a/adaptors/packages/hive-changelog.html +++ b/adaptors/packages/hive-changelog.html @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@
    Skip to main content

    Changelog for the hive adaptor

    @openfn/language-hive

    0.3.10

    Patch Changes

    • Updated dependencies [b3d7f59]
    • Updated dependencies [2d709ff]
    • Updated dependencies [41e8cc3]

    0.3.9

    Patch Changes

    0.3.8

    Patch Changes

    0.3.7

    Patch Changes

    0.3.6

    Patch Changes

    0.3.5

    Patch Changes

    0.3.4

    Patch Changes

    • e53b30f: Update hive-driver dependency

    0.3.3

    Patch Changes

    0.3.2

    Patch Changes

    0.3.1

    Patch Changes

    0.3.0

    Minor Changes

    • 73433c20: Add fnIf operation

    Patch Changes

    0.2.1

    Patch Changes

    • 02ab7a89: - Change host format from uri to string in configuration-schema.json
      • Update required list to include database

    0.2.0

    Minor Changes

    • a380347: Add query function
    - + \ No newline at end of file diff --git a/adaptors/packages/hive-configuration-schema.html b/adaptors/packages/hive-configuration-schema.html index e65549d1b3fc..a8358cd8df83 100644 --- a/adaptors/packages/hive-configuration-schema.html +++ b/adaptors/packages/hive-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "host": "some-host-url.compute-1.amazonaws.com",
    "database": "demo-db",
    "username": "admin-demo",
    "password": "@super(!)Secretpass"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "host": {
    "title": "Host URL",
    "type": "string",
    "description": "The database instance host URL",
    "format": "string",
    "minLength": 1,
    "examples": [
    "some-host-url.compute-1.amazonaws.com"
    ]
    },
    "port": {
    "title": "Port",
    "type": "integer",
    "default": 10001,
    "description": "Database instance port",
    "minLength": 1,
    "examples": [
    10001
    ]
    },
    "database": {
    "title": "Database",
    "type": "string",
    "description": "The database name",
    "minLength": 1,
    "examples": [
    "demo-db"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "The username to log in the database",
    "minLength": 1,
    "examples": [
    "admin-demo"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "The password to log in the database",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@super(!)Secretpass"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "host",
    "database",
    "username",
    "password"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/hive-docs.html b/adaptors/packages/hive-docs.html index 854c38bc887c..eee75515948b 100644 --- a/adaptors/packages/hive-docs.html +++ b/adaptors/packages/hive-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/hive-readme.html b/adaptors/packages/hive-readme.html index 1c286ab5919e..655f85413f85 100644 --- a/adaptors/packages/hive-readme.html +++ b/adaptors/packages/hive-readme.html @@ -17,7 +17,7 @@ - + @@ -29,7 +29,7 @@ configuration-schema for required and optional configuration properties.

    A example expression using the query function

    query('select count(*) from patient');

    Development

    Clone the adaptors monorepo. Follow the "Getting Started" guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To build only the docs run pnpm build docs.

    - + \ No newline at end of file diff --git a/adaptors/packages/http-changelog.html b/adaptors/packages/http-changelog.html index 1ed43bca839c..c489c3a1a2ed 100644 --- a/adaptors/packages/http-changelog.html +++ b/adaptors/packages/http-changelog.html @@ -17,7 +17,7 @@ - + @@ -41,7 +41,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    4.2.8

    Patch Changes

    4.2.7

    Patch Changes

    4.2.6

    Patch Changes

    4.2.5

    Patch Changes

    4.2.4

    Patch Changes

    4.2.3

    Patch Changes

    4.2.2

    Patch Changes

    4.2.1

    Patch Changes

    4.2.0

    Minor Changes

    4.1.0

    Minor Changes

    4.0.1

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/http-configuration-schema.html b/adaptors/packages/http-configuration-schema.html index 85b4322f9514..ad59c0181a9d 100644 --- a/adaptors/packages/http-configuration-schema.html +++ b/adaptors/packages/http-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "username": "test@openfn.org",
    "password": "@some(!)Password",
    "access_token": "00QCjAl4MlV-WPX",
    "baseUrl": "https://instance_name.surveycto.com"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "username": {
    "title": "Username",
    "type": "string",
    "description": "Username",
    "examples": [
    "test@openfn.org"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Password",
    "writeOnly": true,
    "examples": [
    "@some(!)Password"
    ]
    },
    "access_token": {
    "title": "Access Token",
    "type": "string",
    "description": "OAuth Access token, API key or other Bearer token",
    "writeOnly": true,
    "examples": [
    "00QCjAl4MlV-WPX"
    ]
    },
    "baseUrl": {
    "title": "Base URL",
    "anyOf": [
    {
    "type": "string"
    },
    {
    "type": "null"
    }
    ],
    "description": "The base URL (http://www.example.com)",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://instance_name.surveycto.com"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/http-docs.html b/adaptors/packages/http-docs.html index c595723f49de..8eaca90ab28b 100644 --- a/adaptors/packages/http-docs.html +++ b/adaptors/packages/http-docs.html @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@
    Skip to main content

    http@6.5.4

    del(path, params, callback)
    get(path, params, callback)
    parseXML(body, script, callback)
    patch(path, params, callback)
    post(path, params, callback)
    put(path, params, callback)
    request(method, path, params, callback)

    This adaptor exports the following namespaced functions:

    util.decode(base64Data)
    util.encode(data)
    util.uuid()

    This adaptor exports the following from common:

    alterState()
    arrayToString()
    chunk()
    combine()
    cursor()
    dataPath()
    dataValue()
    dateFns
    each()
    field()
    fields()
    fn()
    fnIf()
    group()
    humanProper()
    lastReferenceValue()
    merge()
    parseCsv()
    scrubEmojis()
    sourceValue()
    splitKeys()
    toArray()

    Functions

    del

    del(path, params, callback) ⇒ Operation

    Make a DELETE request. If configuration.baseUrl is set, paths must be relative.

    ParamTypeDescription
    pathstringPath to resource. Can be an absolute URL if baseURL is NOT set on state.configuration.
    paramsRequestOptionsBody, Query, Headers and Auth parameters
    callbackfunction(Optional) Callback function

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example

    del(`/myendpoint/${state => state.data.id}`, {
    headers: {'content-type': 'application/json'}
    })

    get

    get(path, params, callback) ⇒ Operation

    Make a GET request. If configuration.baseUrl is set, paths must be relative.

    ParamTypeDescription
    pathstringPath to resource. Can be an absolute URL if baseURL is NOT set on state.configuration.
    paramsRequestOptionsQuery, Headers and Authentication parameters
    callbackfunction(Optional) Callback function

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example

    get('/myEndpoint', {
    query: {foo: 'bar', a: 1},
    headers: {'content-type': 'application/json'},
    })

    parseXML

    parseXML(body, script, callback) ⇒ Operation

    Parse XML with the Cheerio parser

    ParamTypeDescription
    bodyStringdata string to be parsed
    scriptfunctionscript for extracting data
    callbackfunction(Optional) Callback function

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed XML as a JSON object
    referencesan array of all previous data objects used in the Job

    Example

    parseXML(
    (state) => state.response,
    ($) => {
    return $("table[class=your_table]").parsetable(true, true, true);
    }
    );

    Example: Using parseXML with a callback

     parseXML(
    (state) => state.response,
    ($) => {
    return $("table[class=your_table]").parsetable(true, true, true);
    },
    (next) => ({ ...next, results: next.data.body })
    );

    patch

    patch(path, params, callback) ⇒ Operation

    Make a PATCH request. If configuration.baseUrl is set, paths must be relative.

    ParamTypeDescription
    pathstringPath to resource. Can be an absolute URL if baseURL is NOT set on state.configuration.
    paramsRequestOptionsBody, Query, Headers and Auth parameters
    callbackfunction(Optional) Callback function

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example

    patch('/myEndpoint', {
    body: {'foo': 'bar'},
    headers: {'content-type': 'application/json'},
    })

    post

    post(path, params, callback) ⇒ operation

    Make a POST request. If configuration.baseUrl is set, paths must be relative.

    ParamTypeDescription
    pathstringPath to resource. Can be an absolute URL if baseURL is NOT set on state.configuration.
    paramsRequestOptionsBody, Query, Headers and Authentication parameters
    callbackfunction(Optional) Callback function

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example

    post('/myEndpoint', {
    body: {'foo': 'bar'},
    headers: {'content-type': 'application/json'},
    })

    put

    put(path, params, callback) ⇒ Operation

    Make a PUT request. If configuration.baseUrl is set, paths must be relative.

    ParamTypeDescription
    pathstringPath to resource. Can be an absolute URL if baseURL is NOT set on state.configuration.
    paramsRequestOptionsBody, Query, Headers and Auth parameters
    callbackfunction(Optional) Callback function

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example

    put('/myEndpoint', {
    body: {'foo': 'bar'},
    headers: {'content-type': 'application/json'},
    })

    request

    request(method, path, params, callback) ⇒ Operation

    Make a HTTP request. If configuration.baseUrl is set, paths must be relative.

    ParamTypeDescription
    methodstringThe HTTP method to use.
    pathstringPath to resource. Can be an absolute URL if baseURL is NOT set on state.configuration.
    paramsRequestOptionsQuery, Headers and Authentication parameters
    callbackfunction(Optional) Callback function

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example

    request(
    'GET',
    '/myEndpoint',
    {
    query: {foo: 'bar', a: 1},
    headers: {'content-type': 'application/json'},
    }
    )

    util

    These functions belong to the util namespace.

    util.decode

    decode(base64Data) ⇒ string

    Decodes a Base64 encoded string back to its original format.

    Returns: string - - The decoded string.

    ParamTypeDescription
    base64DatastringThe Base64 encoded string.

    Example: Decode a Base64 string

    const decoded = util.decode('SGVsbG8gV29ybGQ=');
    console.log(decoded); // Output: Hello World

    util.encode

    encode(data) ⇒ string

    Encodes a given string into Base64 format.

    Returns: string - - The Base64 encoded string.

    ParamTypeDescription
    datastringThe string to be encoded.

    Example: Encode a string

    const encoded = util.encode('Hello World');
    console.log(encoded); // Output: SGVsbG8gV29ybGQ=

    util.uuid

    uuid() ⇒ string

    Generates a UUID (Universally Unique Identifier).

    Returns: string - - A newly generated UUID.
    Example: Generate a UUID

    const id = util.uuid();
    console.log(id); // Output:'3f4e254e-8f6f-4f8b-9651-1c1c262cc83f'

    Interfaces

    HttpState

    State object

    Properties

    NameDescription
    datathe parsed response body
    responsethe response from the HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    RequestOptions

    Options provided to the HTTP request

    Properties

    NameTypeDescription
    bodyobject | stringbody data to append to the request. JSON will be converted to a string (but a content-type header will not be attached to the request).
    errorsobjectMap of errorCodes -> error messages, ie, { 404: 'Resource not found;' }. Pass false to suppress errors for this code.
    formobjectPass a JSON object to be serialised into a multipart HTML form (as FormData) in the body.
    queryobjectAn object of query parameters to be encoded into the URL.
    headersobjectAn object of headers to append to the request.
    parseAsstringParse the response body as json, text or stream. By default will use the response headers.
    timeoutnumberRequest timeout in ms. Default: 300 seconds.
    tlsobjectTLS/SSL authentication options. See https://nodejs.org/api/tls.html#tlscreatesecurecontextoptions

    - + \ No newline at end of file diff --git a/adaptors/packages/http-readme.html b/adaptors/packages/http-readme.html index c899c6e58a82..0b0778953038 100644 --- a/adaptors/packages/http-readme.html +++ b/adaptors/packages/http-readme.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ definition.

    Get data

    This helper function allows the use of a get method to fetch data. You can specify a query string for filter.

    get(
    '/myendpoint',
    {
    query: { foo: 'bar', a: 1 },
    headers: { 'content-type': 'application/json' },
    authentication: { username: 'taylor', password: 'somethingsecret' },
    },
    state => {
    return state;
    }
    );

    Post existing data

    Send some data to an existing endpoint.

    post('/endpoint', {
    body: state => {
    return {
    field_1: 'some_data',
    field_2: 'some_more_data',
    field_id: dataValue('Some.Json.Object.Id')(state),
    };
    },
    headers: {
    Authorization: 'AUTH_KEY',
    'Content-Type': 'application/json',
    },
    });

    Update existing data with PUT or PATCH

    put(
    '/myendpoint',
    {
    body: { firstname: 'taylor', lastname: 'downs' },
    headers: { 'content-type': 'application/json' },
    authentication: { username: 'user', password: 'pass' },
    },
    state => {
    return state;
    }
    );
    patch(
    '/myendpoint',
    {
    body: { firstname: 'taylor', lastname: 'downs' },
    headers: { 'content-type': 'application/json' },
    authentication: { username: 'user', password: 'pass' },
    },
    state => {
    return state;
    }
    );

    Delete data

    del(
    '/myendpoint',
    {
    query: { id: 'someId' },
    headers: { 'content-type': 'application/json' },
    authentication: { username: 'user', password: 'pass' },
    },
    state => {
    return state;
    }
    );

    Parse XML

    This function allows you to parse some xml data. A callback function can be use to store in a table.

    parseXML(body, function ($) {
    return $('table[class=your_table]').parsetable(true, true, true);
    });

    Parse CSV

    parseCSV('someData.csv', {
    quoteChar: '"',
    header: false,
    });

    Sample parse local CSV file

    parseCSV('PatientsJan2009.csv', {
    quoteChar: '"',
    header: false,
    columns: true,
    skip_empty_lines: true,
    trim: true,
    bom: true,
    });

    Development

    Clone the repo, run pnpm install.

    Run tests using pnpm run test or pnpm run test:watch.

    To build the docs for this repo, run pnpm build:docs.

    - + \ No newline at end of file diff --git a/adaptors/packages/hubtel-changelog.html b/adaptors/packages/hubtel-changelog.html index 4cd80a8bdb51..973e3dabc383 100644 --- a/adaptors/packages/hubtel-changelog.html +++ b/adaptors/packages/hubtel-changelog.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/hubtel-configuration-schema.html b/adaptors/packages/hubtel-configuration-schema.html index 3d34c112439f..d9f437eab555 100644 --- a/adaptors/packages/hubtel-configuration-schema.html +++ b/adaptors/packages/hubtel-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "baseUrl": "https://example.com",
    "clientId": "abc123def",
    "clientSecret": "ghi456jkl"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "baseUrl": {
    "title": "Base URL",
    "anyOf": [
    {
    "type": "string"
    },
    {
    "type": "null"
    }
    ],
    "description": "The base URL (http://www.example.com)",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://example.com"
    ]
    },
    "clientId": {
    "title": "Client ID",
    "type": "string",
    "description": "Client ID",
    "examples": [
    "abc123def"
    ]
    },
    "clientSecret": {
    "title": "Client Secret",
    "type": "string",
    "description": "Client Secret",
    "writeOnly": true,
    "examples": [
    "ghi456jkl"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "baseUrl",
    "clientId",
    "clientSecret"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/hubtel-docs.html b/adaptors/packages/hubtel-docs.html index 8db7b439a78e..e0b57706237f 100644 --- a/adaptors/packages/hubtel-docs.html +++ b/adaptors/packages/hubtel-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    hubtel@1.0.1

    request(method, path, body, options)
    sendSMS(data, options)

    This adaptor exports the following from common:

    cursor()
    dataPath()
    dataValue()
    dateFns
    each()
    field()
    fields()
    fn()
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    request

    request(method, path, body, options) ⇒ Operation

    Make a general HTTP request

    ParamTypeDescription
    methodstringHTTP method to use
    pathstringPath to resource
    bodyobjectObject which will be attached to the POST body
    optionsRequestOptionsOptional request options

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example

    request("POST", "patient", { "name": "Bukayo" });

    sendSMS

    sendSMS(data, options) ⇒ Operation

    Send an SMS

    ParamTypeDescription
    dataobjectAn object with from, to, and content attributes
    optionsRequestOptionsOptional hubtel options

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example

    sendSMS({
    from: 'OpenFn-Test-01',
    to: '233538675309',
    content: 'hi there, this is OpenFn using the new Hubtel adaptor',
    });

    Interfaces

    HttpState

    State object

    Properties

    NameDescription
    datathe parsed response body
    responsethe response from the HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    RequestOptions

    Options provided to the HTTP request

    Properties

    NameTypeDescription
    bodyobject | stringbody data to append to the request. JSON will be converted to a string (but a content-type header will not be attached to the request).
    errorsobjectMap of errorCodes -> error messages, ie, { 404: 'Resource not found;' }. Pass false to suppress errors for this code.
    formobjectPass a JSON object to be serialised into a multipart HTML form (as FormData) in the body.
    queryobjectAn object of query parameters to be encoded into the URL.
    headersobjectAn object of headers to append to the request.
    parseAsstringParse the response body as json, text or stream. By default will use the response headers.
    timeoutnumberRequest timeout in ms. Default: 300 seconds.
    tlsobjectTLS/SSL authentication options. See https://nodejs.org/api/tls.html#tlscreatesecurecontextoptions

    - + \ No newline at end of file diff --git a/adaptors/packages/hubtel-readme.html b/adaptors/packages/hubtel-readme.html index d01028d12d72..59ca72496a7e 100644 --- a/adaptors/packages/hubtel-readme.html +++ b/adaptors/packages/hubtel-readme.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ configuration-schema for required and optional configuration properties.

    A example expression using the create function

    sendSMS({
    from: 'OpenFn-Test-01',
    to: '233538675309',
    content: 'hi there, this is from OpenFn using the Hubtel adaptor',
    });

    Development

    Clone the adaptors monorepo. Follow the "Getting Started" guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To build only the docs run pnpm build docs.

    - + \ No newline at end of file diff --git a/adaptors/packages/intuit-changelog.html b/adaptors/packages/intuit-changelog.html index 442b8d913c71..eefd5c6b3695 100644 --- a/adaptors/packages/intuit-changelog.html +++ b/adaptors/packages/intuit-changelog.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/intuit-configuration-schema.html b/adaptors/packages/intuit-configuration-schema.html index fd1833e02a5f..14d41c9303f8 100644 --- a/adaptors/packages/intuit-configuration-schema.html +++ b/adaptors/packages/intuit-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjlGWERwYmZNRlQyU3ZRdVhoODQ2WVR3RUlCdyIsI",
    "baseUrl": "https://sandbox-quickbooks.api.intuit.com"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "baseUrl": {
    "title": "Base URL",
    "type": "string",
    "description": "The Quickbooks(intuit) base URL",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://sandbox-quickbooks.api.intuit.com"
    ]
    },
    "access_token": {
    "title": "Access Token",
    "type": "string",
    "description": "Your Quickbooks(intuit) access token",
    "examples": [
    "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjlGWERwYmZNRlQyU3ZRdVhoODQ2WVR3RUlCdyIsI"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "access_token",
    "baseUrl"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/intuit-docs.html b/adaptors/packages/intuit-docs.html index 3bcf3ed0f04a..6ec072c8ea80 100644 --- a/adaptors/packages/intuit-docs.html +++ b/adaptors/packages/intuit-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    intuit@1.0.0

    This adaptor exports the following namespaced functions:

    http.get(path, [options])
    http.post(path, data, [options])

    This adaptor exports the following from common:

    cursor()
    dataPath()
    dataValue()
    dateFns
    each()
    field()
    fields()
    fn()
    lastReferenceValue()
    merge()
    sourceValue()

    http

    These functions belong to the http namespace.

    http.get

    get(path, [options]) ⇒ Operation

    Make a GET request to any intuit endpoint

    ParamTypeDefaultDescription
    pathstringPath to resource
    [options]IntuitOptions{}An object containing query and headers for the request

    This operation writes the following keys to state:

    State KeyDescription
    dataThe response body (as JSON)
    responseThe HTTP response from the Quickbook(intuit) server (excluding the body)
    referencesAn array of all previous data objects used in the Job

    Example: Get intuit user company information.

    http.get("/v3/company/9341453908059456/companyinfo/9341453908059456");

    http.post

    post(path, data, [options]) ⇒ Operation

    Make a POST request to any Intuit endpoint

    ParamTypeDefaultDescription
    pathstringPath to resource
    dataobjectThe request body (as JSON)
    [options]IntuitOptions{}An object containing query, and headers for the request

    This operation writes the following keys to state:

    State KeyDescription
    dataThe response body (as JSON)
    responseThe HTTP response from the Quickbook(intuit) server (excluding the body)
    referencesAn array of all previous data objects used in the Job

    Example: Create an account on intuit.

    http.post("/v3/company/9341453908059456/account",
    {
    "Name": "MyJobs_testing",
    "AccountType": "Accounts Receivable"
    },
    {
    query: {
    minorversion: 40,
    },
    })

    Interfaces

    IntuitOptions

    Options object

    Properties

    NameTypeDefaultDescription
    queryobjectAn object of query parameters to be encoded into the URL
    headersobjectAn object of all request headers
    [parseAs]string"'json'"The response format to parse (e.g., 'json', 'text', or 'stream')

    IntuitState

    State object

    Properties

    NameDescription
    dataThe response body (as JSON)
    responseThe HTTP response from the Quickbook(intuit) server (excluding the body)
    referencesAn array of all previous data objects used in the Job

    - + \ No newline at end of file diff --git a/adaptors/packages/intuit-readme.html b/adaptors/packages/intuit-readme.html index fc3ff36324ce..60396105d7a6 100644 --- a/adaptors/packages/intuit-readme.html +++ b/adaptors/packages/intuit-readme.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ configuration-schema for required and optional configuration properties.

    A example expression using the create function

    http.post(
    '/v3/company/9341453908059321/account',
    {
    Name: 'MyJobs_testing',
    AccountType: 'Accounts Receivable',
    },
    {
    query: {
    minorversion: 40,
    },
    }
    );

    Development

    Clone the adaptors monorepo. Follow the "Getting Started" guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To build only the docs run pnpm build docs.

    - + \ No newline at end of file diff --git a/adaptors/packages/khanacademy-changelog.html b/adaptors/packages/khanacademy-changelog.html index f029c9c493b7..18f89db517fc 100644 --- a/adaptors/packages/khanacademy-changelog.html +++ b/adaptors/packages/khanacademy-changelog.html @@ -17,7 +17,7 @@ - + @@ -29,7 +29,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    0.3.4

    Patch Changes

    0.3.3

    Patch Changes

    0.3.2

    Patch Changes

    0.3.1

    Patch Changes

    0.3.0

    Minor Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/khanacademy-configuration-schema.html b/adaptors/packages/khanacademy-configuration-schema.html index 125f909ac9fe..75f31e8be00f 100644 --- a/adaptors/packages/khanacademy-configuration-schema.html +++ b/adaptors/packages/khanacademy-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "email": "test@openfn.org",
    "password": "@some(!)Strongpassword",
    "secretKey": "otherThiNGfSECret",
    "consumerKey": "somEThINGkeyish"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "email": {
    "title": "Email",
    "type": "string",
    "description": "Your Khanacademy login email",
    "format": "email",
    "minLength": 1,
    "examples": [
    "test@openfn.org"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Your Khanacademy login password",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@some(!)Strongpassword"
    ]
    },
    "consumerKey": {
    "title": "Consumer Key",
    "type": "string",
    "description": "Your Khanacademy consumer key",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "somEThINGkeyish"
    ]
    },
    "secretKey": {
    "title": "Secret Key",
    "type": "string",
    "description": "Your Khanacademy secret key",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "otherThiNGfSECret"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "email",
    "password",
    "secretKey",
    "consumerKey"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/khanacademy-docs.html b/adaptors/packages/khanacademy-docs.html index 9473d8b2546b..274b77207d84 100644 --- a/adaptors/packages/khanacademy-docs.html +++ b/adaptors/packages/khanacademy-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/khanacademy-readme.html b/adaptors/packages/khanacademy-readme.html index 6f4773ef5901..9cef1d33db59 100644 --- a/adaptors/packages/khanacademy-readme.html +++ b/adaptors/packages/khanacademy-readme.html @@ -17,7 +17,7 @@ - + @@ -29,7 +29,7 @@ configuration-schema definition.

    fetch

    sample usage

    fetch({
    getEndpoint: 'user',
    queryParams: {
    email: 'thisoneuser@something.org',
    },
    postUrl: 'https://www.openfn.org/inbox/your-uuid',
    });

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/kobotoolbox-changelog.html b/adaptors/packages/kobotoolbox-changelog.html index a1b33434aed1..01c60dd6ee9d 100644 --- a/adaptors/packages/kobotoolbox-changelog.html +++ b/adaptors/packages/kobotoolbox-changelog.html @@ -3,7 +3,7 @@ -kobotoolbox changelog | OpenFn/docs +kobotoolbox changelog | OpenFn/docs @@ -17,21 +17,26 @@ - +
    -
    Skip to main content

    Changelog for the kobotoolbox adaptor

    @openfn/language-kobotoolbox

    2.4.3

    Patch Changes

    • Security fix: update jsonpath-plus version

    2.4.2

    Patch Changes

    • 8146c23: Fix typings in package.json

    2.4.1

    Patch Changes

    • 73d0a02: Make documentation public
    • Updated dependencies [4c08444]
    • Updated dependencies [73d0a02]

    2.4.0

    Minor Changes

    • 5fb82f07: Export group operation from common

    Patch Changes

    2.3.0

    Minor Changes

    • 73433c20: Add fnIf operation

    Patch Changes

    2.2.0

    Minor Changes

    • bae5d3b6: Add the cursor() function from common. See the job writing guide for -more information.

    Patch Changes

    2.1.0

    Minor Changes

    • c85abf3: Removed the API version enum values in the credential configuration -json schema and added a placeholder

    2.0.1

    Patch Changes

    2.0.0

    Major Changes

    - +be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    1.3.3

    Patch Changes

    1.3.2

    Patch Changes

    • f7ebd3c: remove sample configuration

    1.3.1

    Patch Changes

    • f2aed32: add examples

    1.3.0

    Minor Changes

    • e48c30c: add getDeploymentInfo function

    Patch Changes

    • 6d8de03: change @constructor to @function and remove /* @module Adaptor /

    1.2.0

    Minor Changes

    • 7b5ca3e: add fn and fix adaptors export

    Patch Changes

    • 4067c28: build ast file
    • f2a91a4: Update package exports
    • Updated dependencies [f2a91a4]

    1.1.0

    Minor Changes

    • 7fc47d8: Migrate kobotoolbox

    Patch Changes

    • 8566b26: Fix typings
    • b3d45ff: Fix CJS export of npm package.
    • ecf5d30: remove sinon since it was not being used
    • Updated dependencies [8566b26]
    • Updated dependencies [b3d45ff]
    • Updated dependencies [b5eb665]
    • Updated dependencies [ecf5d30]
    + \ No newline at end of file diff --git a/adaptors/packages/kobotoolbox-configuration-schema.html b/adaptors/packages/kobotoolbox-configuration-schema.html index 6e18d7f7180c..94c968f05ede 100644 --- a/adaptors/packages/kobotoolbox-configuration-schema.html +++ b/adaptors/packages/kobotoolbox-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -28,9 +28,9 @@ "credential" for the kobotoolbox adaptor will follow the schema below. When using the CLI, you can set up your own state.configuration by using the sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and -modify the values to run jobs locally.

    {
    "username": "test@openfn.org",
    "baseURL": "https://kf.kobotoolbox.org",
    "password": "@some(!)Strongpassword",
    "apiVersion": "v2"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and -notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "baseURL": {
    "title": "Base URL",
    "type": "string",
    "default": "https://kf.kobotoolbox.org",
    "description": "Kobotoolbox URL",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://kf.kobotoolbox.org"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "Kobotoolbox username",
    "minLength": 1,
    "examples": [
    "test@openfn.org"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Kobotoolbox password",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@some(!)Strongpassword"
    ]
    },
    "apiVersion": {
    "title": "API Version",
    "type": "string",
    "placeholder": "v2",
    "description": "Kobotoolbox API version to use",
    "minLength": 1,
    "examples": [
    "v2"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "username",
    "baseURL",
    "password",
    "apiVersion"
    ]
    }
    - +modify the values to run jobs locally.

    {
    "username": "test@openfn.org",
    "baseUrl": "https://kf.kobotoolbox.org",
    "password": "@some(!)Strongpassword",
    "apiVersion": "v2"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and +notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "baseUrl": {
    "title": "Base Url",
    "type": "string",
    "default": "https://kf.kobotoolbox.org",
    "description": "Kobotoolbox URL",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://kf.kobotoolbox.org"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "Kobotoolbox username",
    "minLength": 1,
    "examples": [
    "test@openfn.org"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Kobotoolbox password",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@some(!)Strongpassword"
    ]
    },
    "apiVersion": {
    "title": "API Version",
    "type": "string",
    "placeholder": "v2",
    "description": "Kobotoolbox API version to use",
    "minLength": 1,
    "examples": [
    "v2"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "username",
    "baseUrl",
    "password",
    "apiVersion"
    ]
    }
    + \ No newline at end of file diff --git a/adaptors/packages/kobotoolbox-docs.html b/adaptors/packages/kobotoolbox-docs.html index c4f6b43ea05c..ccd6d7c93300 100644 --- a/adaptors/packages/kobotoolbox-docs.html +++ b/adaptors/packages/kobotoolbox-docs.html @@ -3,7 +3,7 @@ -kobotoolbox@2.4.3 | OpenFn/docs +kobotoolbox@3.0.0 | OpenFn/docs @@ -17,15 +17,15 @@ - +
    -
    Skip to main content

    kobotoolbox@2.4.3

    getDeploymentInfo(params, callback)
    getForms(params, callback)
    getSubmissions(params, callback)

    This adaptor exports the following from common:

    alterState()
    cursor()
    dataPath()
    dataValue()
    each()
    field()
    fields()
    fn()
    fnIf()
    group()
    http()
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    getDeploymentInfo

    getDeploymentInfo(params, callback) ⇒ Operation

    Get deployment information for a specific form

    ParamTypeDescription
    paramsobjectForm Id and data to make the fetch or filter
    callbackfunction(Optional) Callback function to execute after fetching form deployment information

    Example

    getDeploymentInfo({formId: 'aXecHjmbATuF6iGFmvBLBX'}, state => {
    console.log(state.data);
    return state;
    });

    getForms

    getForms(params, callback) ⇒ Operation

    Make a request to get the list of forms

    ParamTypeDescription
    paramsobjectQuery, Headers and Authentication parameters
    callbackfunction(Optional) Callback function to execute after fetching form list

    Example

    getForms({}, state => {
    console.log(state.data);
    return state;
    });

    getSubmissions

    getSubmissions(params, callback) ⇒ Operation

    Get submissions for a specific form

    ParamTypeDescription
    paramsobjectForm Id and data to make the fetch or filter
    callbackfunction(Optional) Callback function to execute after fetching form submissions

    Example

    getSubmissions({formId: 'aXecHjmbATuF6iGFmvBLBX'}, state => {
    console.log(state.data);
    return state;
    });

    - +
    Skip to main content

    kobotoolbox@3.0.0

    getDeploymentInfo(formId)
    getForms()
    getSubmissions(formId, [options])

    This adaptor exports the following namespaced functions:

    http.get(path, [options])
    http.post(path, data, [options])
    http.put(path, data, [options])

    This adaptor exports the following from common:

    alterState()
    cursor()
    dataPath()
    dataValue()
    each()
    field()
    fields()
    fn()
    fnIf()
    group()
    http
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    getDeploymentInfo

    getDeploymentInfo(formId) ⇒ Operation

    Get deployment information for a specific form. Calls /api/v2/assets/<id>/deployment/.

    ParamTypeDescription
    formIdstringForm Id to get the deployment information

    This operation writes the following keys to state:

    State KeyDescription
    dataan object containing deployment information

    Example

    getDeploymentInfo('aXecHjmbATuF6iGFmvBLBX');

    getForms

    getForms() ⇒ Operation

    Make a request to fetch all survey forms accessible to the authorized user. Calls /api/v2/assets/?asset_type=survey.

    This operation writes the following keys to state:

    State KeyDescription
    dataan array of form objects

    Example

    getForms();

    getSubmissions

    getSubmissions(formId, [options]) ⇒ Operation

    Get submissions for a specific form. Calls /api/v2/assets/<formId>/data/.

    ParamTypeDefaultDescription
    formIdstringForm Id to get the specific submissions
    [options]object{}Optional query params for the request

    This operation writes the following keys to state:

    State KeyDescription
    dataan array of submission objects

    Example: Get all submissions for a specific form

    getSubmissions('aXecHjmbATuF6iGFmvBLBX');

    Example: Get form submissions with a query

    getSubmissions('aXecHjmbATuF6iGFmvBLBX', { query: { _submission_time:{ $gte: "2022-06-12T21:54:20" } } });

    http

    These functions belong to the http namespace.

    http.get

    get(path, [options]) ⇒ operation

    Make a GET request to any KoboToolbox endpoint.

    ParamTypeDefaultDescription
    pathstringpath to resource
    [options]RequestOptions{}An object containing query params and headers for the request

    This operation writes the following keys to state:

    State KeyDescription
    dataThe response body (as JSON)
    responseThe HTTP response from the KoboToolbox server (excluding the body). Responses will be returned in JSON format
    referencesAn array of all previous data objects used in the Job

    Example: GET assets resource

    http.get(
    "/assets/",
    )

    http.post

    post(path, data, [options]) ⇒ operation

    Make a POST request to a KoboToolbox endpoint

    ParamTypeDefaultDescription
    pathstringpath to resource
    dataanythe body data in JSON format
    [options]RequestOptions{}An object containing query params and headers for the request

    This operation writes the following keys to state:

    State KeyDescription
    dataThe response body (as JSON)
    responseThe HTTP response from the KoboToolbox server (excluding the body). Responses will be returned in JSON format
    referencesAn array of all previous data objects used in the Job

    Example: Create an asset resource

    http.post(
    '/assets/',
    {
    name: 'Feedback Survey Test',
    asset_type: 'survey',
    },
    );

    http.put

    put(path, data, [options]) ⇒ operation

    Make a PUT request to a KoboToolbox endpoint

    ParamTypeDefaultDescription
    pathstringpath to resource
    dataanythe body data in JSON format
    [options]RequestOptions{}An object containing query params and headers for the request

    This operation writes the following keys to state:

    State KeyDescription
    dataThe response body (as JSON)
    responseThe HTTP response from the KoboToolbox server (excluding the body). Responses will be returned in JSON format
    referencesAn array of all previous data objects used in the Job

    Example: Update an asset resource

    http.put(
    'assets/a4jAWzoa8SZWzZGhx84sB5/deployment/',
    {
    name: 'Feedback Survey Test',
    asset_type: 'survey',
    },
    );

    Interfaces

    KoboToolboxHttpState

    State object

    Properties

    NameDescription
    dataThe response body (as JSON)
    responseThe HTTP response from the KoboToolbox server (excluding the body). Responses will be returned in JSON format
    referencesAn array of all previous data objects used in the Job

    RequestOptions

    Options object

    Properties

    NameTypeDefaultDescription
    queryobjectAn object of query parameters to be encoded into the URL
    headersobjectAn object of all request headers
    [parseAs]string"'json'"The response format to parse (e.g., 'json', 'text', or 'stream')

    RequestOptions

    Options object

    Properties

    NameTypeDefaultDescription
    queryobjectAn object of query parameters to be encoded into the URL
    headersobjectAn object of all request headers
    [parseAs]string"'json'"The response format to parse (e.g., 'json', 'text', or 'stream')

    + \ No newline at end of file diff --git a/adaptors/packages/kobotoolbox-readme.html b/adaptors/packages/kobotoolbox-readme.html index 768a7c7cdeb7..c70d3bf8c3e2 100644 --- a/adaptors/packages/kobotoolbox-readme.html +++ b/adaptors/packages/kobotoolbox-readme.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ configuration-schema definition.

    Get the list of forms

    getForms({}, state => {
    console.log(state.data);
    return state;
    });

    Get submissions for a specific form

    A query can be used to filter results.

    getSubmissions(
    { formId: 'aXecHjmbATuF6iGFmvBLBX', query: { end: { $gte: '2020-11-20' } } },
    state => {
    console.log(state.data);
    return state;
    }
    );

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/magpi-changelog.html b/adaptors/packages/magpi-changelog.html index fc71db06bcf4..876fa66f14bd 100644 --- a/adaptors/packages/magpi-changelog.html +++ b/adaptors/packages/magpi-changelog.html @@ -17,7 +17,7 @@ - + @@ -29,7 +29,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    1.0.5

    Patch Changes

    1.0.4

    Patch Changes

    1.0.3

    Patch Changes

    1.0.2

    Patch Changes

    1.0.1

    Patch Changes

    1.0.0

    Major Changes

    Minor Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/magpi-configuration-schema.html b/adaptors/packages/magpi-configuration-schema.html index 067ac8e700c2..1ce729dc593e 100644 --- a/adaptors/packages/magpi-configuration-schema.html +++ b/adaptors/packages/magpi-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "username": "test@openfn.org",
    "accessToken": "somEThINGkeyish"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "username": {
    "title": "username",
    "type": "string",
    "description": "Magpi username",
    "minLength": 1,
    "examples": [
    "test@openfn.org"
    ]
    },
    "accessToken": {
    "title": "Access Token",
    "type": "string",
    "description": "Magpi access token",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "somEThINGkeyish"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "username",
    "accessToken"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/magpi-docs.html b/adaptors/packages/magpi-docs.html index 11762862c090..f5cafae25e03 100644 --- a/adaptors/packages/magpi-docs.html +++ b/adaptors/packages/magpi-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    magpi@1.2.4

    fetchSurveyData(params)
    submitRecord(jsonData)

    This adaptor exports the following from common:

    alterState()
    dataPath()
    dataValue()
    each()
    field()
    fields()
    fn()
    fnIf()
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    fetchSurveyData

    fetchSurveyData(params) ⇒ Operation

    Make a POST request to fetch Magpi data and POST it somewhere else

    ParamTypeDescription
    paramsobjectdata to make the fetch

    Example

    fetchSurveyData({
    "surveyId": "37479",
    "afterDate": "2017-09-27",
    "postUrl": "https://www.openfn.org/inbox/your-inbox-url"
    })

    submitRecord

    submitRecord(jsonData) ⇒ Operation

    Submit a record for a form/survey which already exists in a Magpi user account

    ParamTypeDescription
    jsonDataobjectPayload data for the record

    Example

    submitRecord(jsonData)

    - + \ No newline at end of file diff --git a/adaptors/packages/magpi-readme.html b/adaptors/packages/magpi-readme.html index 7f55599385af..f4d01334142f 100644 --- a/adaptors/packages/magpi-readme.html +++ b/adaptors/packages/magpi-readme.html @@ -17,7 +17,7 @@ - + @@ -39,7 +39,7 @@ one on the data tab
  • enddate: End date of the data to be returned. Filtering is done based on the DateStamp and is inclusive.(Optional)
  • Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/mailchimp-changelog.html b/adaptors/packages/mailchimp-changelog.html index 4f103925ce18..0e7a343c8e0e 100644 --- a/adaptors/packages/mailchimp-changelog.html +++ b/adaptors/packages/mailchimp-changelog.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    0.3.5

    Patch Changes

    0.3.4

    Patch Changes

    0.3.3

    Patch Changes

    0.3.2

    Patch Changes

    0.3.1

    Patch Changes

    0.3.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/mailchimp-configuration-schema.html b/adaptors/packages/mailchimp-configuration-schema.html index 4bc2165f9ff8..d51d23126c3f 100644 --- a/adaptors/packages/mailchimp-configuration-schema.html +++ b/adaptors/packages/mailchimp-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "server": "us11",
    "apiKey": "0eb22c7b4a1c5bcd789379bf8a92902d-us13"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "server": {
    "title": "Data Center",
    "type": "string",
    "description": "Mailchimp Data Center for your account",
    "minLength": 1,
    "examples": [
    "us11",
    "uk8",
    "in10"
    ]
    },
    "apiKey": {
    "title": "API Key",
    "type": "string",
    "description": "Mailchimp API Key",
    "minLength": 1,
    "examples": [
    "0eb22c7b4a1c5bcd789379bf8a92902d-us13"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "server",
    "apiKey"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/mailchimp-docs.html b/adaptors/packages/mailchimp-docs.html index 4982e5ad50c4..5057800f9c66 100644 --- a/adaptors/packages/mailchimp-docs.html +++ b/adaptors/packages/mailchimp-docs.html @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@
    Skip to main content

    mailchimp@1.0.11

    addMember(params, [callback])
    archiveMember(params, [callback])
    deleteMember(params, [callback])
    get(path, query, [callback])
    listAudienceInfo(query, [callback])
    listAudiences(query, [callback])
    listBatches(params, [callback])
    listMembers(params, [callback])
    post(path, body, query, [callback])
    request(method, path, options, [callback])
    startBatch(params, [callback])
    tagMembers(params, [callback])
    updateMember(params, [callback])
    updateMemberTags(params, [callback])
    upsertMembers(params, [callback])

    This adaptor exports the following from common:

    alterState()
    chunk()
    dataPath()
    dataValue()
    each()
    field()
    fields()
    fn()
    fnIf()
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    addMember

    addMember(params, [callback]) ⇒ Operation

    addMember to a list

    ParamTypeDescription
    paramsobjecta listId, and options
    [callback]functionOptional callback to handle the response

    archiveMember

    archiveMember(params, [callback]) ⇒ Operation

    archiveMember in a list

    ParamTypeDescription
    paramsobjecta listId, and options
    [callback]functionOptional callback to handle the response

    deleteMember

    deleteMember(params, [callback]) ⇒ Operation

    Permanently delete a member from a list

    ParamTypeDescription
    paramsobjecta listId, and options
    [callback]functionOptional callback to handle the response

    get

    get(path, query, [callback]) ⇒ Operation

    The get function is used to make a GET request to the Mailchimp API.

    ParamTypeDescription
    pathstringThe endpoint of the api to which the request should be made
    queryobjectAn object containing query parameters to be included in the request
    [callback]function(Optional) callback to handle the response

    Example: Get a list of account exports for a given account

    get('/account-exports');

    listAudienceInfo

    listAudienceInfo(query, [callback]) ⇒ Operation

    Get information about a specific list in your Mailchimp account. Results include list members who have signed up but haven't confirmed their subscription yet and unsubscribed or cleaned.

    ParamTypeDescription
    queryobjectlistId and query parameters
    [callback]functionOptional callback to handle the response

    listAudiences

    listAudiences(query, [callback]) ⇒ Operation

    Get information about all lists in the account.

    ParamTypeDescription
    queryobjectQuery parameters
    [callback]functionOptional callback to handle the response

    listBatches

    listBatches(params, [callback]) ⇒ Operation

    listBatches

    ParamTypeDescription
    paramsobjecta listId, and options
    [callback]functionOptional callback to handle the response

    listMembers

    listMembers(params, [callback]) ⇒ Operation

    listMembers

    ParamTypeDescription
    paramsobjecta listId, and options
    [callback]functionOptional callback to handle the response

    post

    post(path, body, query, [callback]) ⇒ Operation

    The post function is used to make a POST request to the Mailchimp API.

    ParamTypeDescription
    pathstringThe endpoint of the api to which the request should be made.
    bodyobjectThe data to be sent in the body of the request
    queryobjectAn object containing query parameters to be included in the request
    [callback]function(Optional) callback to handle the response

    Example: Create a new account export in your Mailchimp account

    post('/accounts-export', {include_stages:[]});

    request

    request(method, path, options, [callback]) ⇒ Operation

    Make an HTTP request to Mailchimp API

    ParamTypeDescription
    methodstringThe HTTP method for the request (e.g., 'GET', 'POST', 'PUT', 'DELETE').
    pathstringThe endpoint of the api to which the request should be made.
    optionsObjectAdditional options for the request (query, body only).
    [callback]function(Optional) callback function to handle the response.

    Example: Get list to all other resources available in the API

    request('GET','/');

    Example: Create a new account export in your Mailchimp account

    request('POST','/accounts-export', {include_stages:[]});

    startBatch

    startBatch(params, [callback]) ⇒ Operation

    Start a batch with a list of operations.

    ParamTypeDescription
    paramsobjectoperations batch job
    [callback]functionOptional callback to handle the response

    Example

    startBatch(params)

    tagMembers

    tagMembers(params, [callback]) ⇒ Operation

    Tag members with a particular tag

    ParamTypeDescription
    paramsobjecta tagId, members, and a list
    [callback]functionOptional callback to handle the response

    Example

    tagMembers((state) => ({
    listId: "someId", // All Subscribers list
    tagId: "someTag", // User tag
    members: state.response.body.rows.map((u) => u.email),
    }));

    Example

    tagMembers((state) => ({
    listId: "someId",
    tagId: "someTag",
    members: state.response.body.rows
    .filter((u) => u.allow_other_emails)
    .map((u) => u.email),
    }));

    updateMember

    updateMember(params, [callback]) ⇒ Operation

    updateMember

    ParamTypeDescription
    paramsobjecta listId,subscriberHash and member
    [callback]functionOptional callback to handle the response

    updateMemberTags

    updateMemberTags(params, [callback]) ⇒ Operation

    updateMemberTags

    ParamTypeDescription
    paramsobjecta listId, and options
    [callback]functionOptional callback to handle the response

    upsertMembers

    upsertMembers(params, [callback]) ⇒ Operation

    Add or update a list members

    ParamTypeDescription
    paramsobjecta listId, users, and options
    [callback]functionOptional callback to handle the response

    Example

    upsertMembers((state) => ({
    listId: "someId",
    users: state.response.body.rows.map((u) => ({
    email: u.email,
    status: u.allow_other_emails ? "subscribed" : "unsubscribed",
    mergeFields: { FNAME: u.first_name, LNAME: u.last_name },
    })),
    }));

    - + \ No newline at end of file diff --git a/adaptors/packages/mailchimp-readme.html b/adaptors/packages/mailchimp-readme.html index 8f894bb76561..f461fdba3ffc 100644 --- a/adaptors/packages/mailchimp-readme.html +++ b/adaptors/packages/mailchimp-readme.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ configuration-schema definition.

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/mailgun-changelog.html b/adaptors/packages/mailgun-changelog.html index ffcfd88b5f1e..78e1a5a1c66f 100644 --- a/adaptors/packages/mailgun-changelog.html +++ b/adaptors/packages/mailgun-changelog.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    0.3.4

    Patch Changes

    0.3.3

    Patch Changes

    0.3.2

    Patch Changes

    0.3.1

    Patch Changes

    0.3.0

    Minor Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/mailgun-configuration-schema.html b/adaptors/packages/mailgun-configuration-schema.html index 66684a0d2c4a..5a7b6c384cd7 100644 --- a/adaptors/packages/mailgun-configuration-schema.html +++ b/adaptors/packages/mailgun-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "domain": "sandbox-123.mailgun.org",
    "apiKey": "otherThiNGfSECret"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "domain": {
    "title": "Domain Name",
    "type": "string",
    "description": "Mailgun API Domain Name",
    "format": "string",
    "minLength": 1,
    "examples": [
    "sandbox-123.mailgun.org"
    ]
    },
    "apiKey": {
    "title": "API Key",
    "type": "string",
    "description": "Mailgun API Key",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "otherThiNGfSECret"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "domain",
    "apiKey"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/mailgun-docs.html b/adaptors/packages/mailgun-docs.html index 4d7b3f7cb30c..fcfd35793ef6 100644 --- a/adaptors/packages/mailgun-docs.html +++ b/adaptors/packages/mailgun-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/mailgun-readme.html b/adaptors/packages/mailgun-readme.html index 8d4fe094ec6c..b9168e9a68f8 100644 --- a/adaptors/packages/mailgun-readme.html +++ b/adaptors/packages/mailgun-readme.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ configuration-schema definition.

    send

    send(
    fields(
    field('from', 'from_email'),
    field('to', 'to_email'),
    field('subject', 'Your Subject'),
    field('text', 'Your message goes here')
    )
    );

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/maximo-changelog.html b/adaptors/packages/maximo-changelog.html index eb5b6d3e5ae2..93092308b198 100644 --- a/adaptors/packages/maximo-changelog.html +++ b/adaptors/packages/maximo-changelog.html @@ -17,7 +17,7 @@ - + @@ -29,7 +29,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    0.3.5

    Patch Changes

    0.3.4

    Patch Changes

    0.3.3

    Patch Changes

    0.3.2

    Patch Changes

    0.3.1

    Patch Changes

    0.3.0

    Minor Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/maximo-configuration-schema.html b/adaptors/packages/maximo-configuration-schema.html index 7a67ad5a2ccd..b88a9a89c24c 100644 --- a/adaptors/packages/maximo-configuration-schema.html +++ b/adaptors/packages/maximo-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "baseUrl": "https://maximo-demo76.mro.com",
    "username": "test@openfn.org",
    "password": "@some(!)passowrd"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "baseUrl": {
    "title": "Base URL",
    "type": "string",
    "description": "Maximo instance base URL",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://maximo-demo76.mro.com"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "Maximo instance username",
    "minLength": 1,
    "examples": [
    "test@openfn.org"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Maximo instance password",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@some(!)passowrd"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "baseUrl",
    "username",
    "password"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/maximo-docs.html b/adaptors/packages/maximo-docs.html index cab06930c218..51523a88ba35 100644 --- a/adaptors/packages/maximo-docs.html +++ b/adaptors/packages/maximo-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    maximo@0.5.11

    fetch(params)
    update(params)
    update75(params)

    This adaptor exports the following from common:

    alterState()
    dataPath()
    dataValue()
    each()
    field()
    fields()
    fn()
    fnIf()
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    fetch

    fetch(params) ⇒ Operation

    Make a GET request and POST it somewhere else

    ParamTypeDescription
    paramsobjectdata to make the fetch

    Example

    fetch({
    endpoint: 'maxrest/rest/os/mxinventory',
    query: {
    ITEMNUM: '01226',
    _format: 'json',
    },
    postUrl: 'https://www.openfn.org/inbox/not-real',
    });

    update

    update(params) ⇒ Operation

    Make an update in Maximo 7.6 and beyond

    ParamTypeDescription
    paramsobjectdata to make the update

    Example

    execute(
    update(params)
    )(state)

    update75

    update75(params) ⇒ Operation

    Make an upadte in Maximo 7.5

    ParamTypeDescription
    paramsobjectdata to make the update

    Example

    execute(
    update75(params)
    )(state)

    - + \ No newline at end of file diff --git a/adaptors/packages/maximo-readme.html b/adaptors/packages/maximo-readme.html index a820e8e3013a..f523611060e0 100644 --- a/adaptors/packages/maximo-readme.html +++ b/adaptors/packages/maximo-readme.html @@ -17,7 +17,7 @@ - + @@ -29,7 +29,7 @@ configuration-schema definition.

    Fetch

    sample 'fetch' expression

    fetch({
    endpoint: 'maxrest/rest/os/mxinventory',
    query: {
    ITEMNUM: '01226',
    _format: 'json',
    },
    postUrl: 'https://www.openfn.org/inbox/not-real',
    });

    sample 'create' expression

    create({
    endpoint: 'maxrest/rest/os/mxinvbal/',
    body: function (state) {
    return {
    ITEMNUM: dataValue('form.ITEMNUM')(state),
    ITEMSETID: dataValue('form.ITEMSETID')(state),
    SITEID: dataValue('form.SITEID')(state),
    LOCATION: dataValue('form.LOCATION')(state),
    ISSUEUNIT: 'FOO',
    PHYSCNT: dataValue('PHYSCNT')(state),
    BINNUM: dataValue('form.BINNUM')(state),
    };
    },
    });

    sample 'update75' expression

    update75({
    endpoint: state => {
    return (
    'maxrest/rest/os/mxinvbal/' +
    dataValue('form.question1.INVBALANCESID')(state)
    );
    },
    body: state => {
    return {
    _action: 'AddChange', //this is required for the old Maximo API!
    ITEMNUM: dataValue('form.ITEMNUM')(state),
    ITEMSETID: dataValue('form.ITEMSETID')(state),
    SITEID: dataValue('form.SITEID')(state),
    LOCATION: dataValue('form.LOCATION')(state),
    PHYSCNT: dataValue('form.PHYSCNT')(state),
    BINNUM: dataValue('form.BINNUM')(state),
    };
    },
    });

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/medicmobile-changelog.html b/adaptors/packages/medicmobile-changelog.html index 6782b0bb7531..51c529ee16e5 100644 --- a/adaptors/packages/medicmobile-changelog.html +++ b/adaptors/packages/medicmobile-changelog.html @@ -17,7 +17,7 @@ - + @@ -29,7 +29,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    0.3.3

    Patch Changes

    0.3.2

    Patch Changes

    0.3.1

    Patch Changes

    0.3.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/medicmobile-configuration-schema.html b/adaptors/packages/medicmobile-configuration-schema.html index 1d43713f3445..db6447a20784 100644 --- a/adaptors/packages/medicmobile-configuration-schema.html +++ b/adaptors/packages/medicmobile-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "server": "https://standard.app.medicmobile.org",
    "username": "admin",
    "password": "@super(!)Secret",
    "db": "medic"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "server": {
    "title": "Server URL",
    "type": "string",
    "description": "Medic's CouchDB api URL",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://standard.app.medicmobile.org"
    ]
    },
    "db": {
    "title": "Database",
    "type": "string",
    "description": "Database name",
    "minLength": 1,
    "examples": [
    "medic"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "Medic instance username",
    "minLength": 1,
    "examples": [
    "admin"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Medic instance password",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@super(!)Secret"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "server",
    "username",
    "password",
    "db"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/medicmobile-docs.html b/adaptors/packages/medicmobile-docs.html index e9fe797c108e..d71086e96cb9 100644 --- a/adaptors/packages/medicmobile-docs.html +++ b/adaptors/packages/medicmobile-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    medicmobile@0.5.10

    changesApi(params, callback)
    fetchSubmissions(formId, params, postUrl)
    pickFormData(formId)

    This adaptor exports the following from common:

    alterState()
    dataPath()
    dataValue()
    each()
    field()
    fields()
    fn()
    fnIf()
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    changesApi

    changesApi(params, callback) ⇒ Operation

    Access the CouchDB Changes API

    ParamTypeDescription
    paramsobjectQuery parameters
    callbackfunction(Optional) Callback function

    Example

    changesApi(params, callback)

    fetchSubmissions

    fetchSubmissions(formId, params, postUrl) ⇒ Operation

    Access form submissions and post them as JSON.

    ParamTypeDescription
    formIdstringQuery parameters
    paramsobjectStarting sequence id
    postUrlstringInbox to post form data

    Example

    fetchSubmissions(
    "pregnancy", // formId
    { "last-event-id": 334 }, // params
    "http://localhost:4000/inbox/abc-123-xyz" // postUrl
    );

    pickFormData

    pickFormData(formId) ⇒ Operation

    Select submissions for a specific form

    ParamTypeDescription
    formIdstringThe form ID.

    Example

    pickFormData(formId)

    - + \ No newline at end of file diff --git a/adaptors/packages/medicmobile-readme.html b/adaptors/packages/medicmobile-readme.html index 1ca7234211cb..8b5dfaeb1d92 100644 --- a/adaptors/packages/medicmobile-readme.html +++ b/adaptors/packages/medicmobile-readme.html @@ -17,7 +17,7 @@ - + @@ -36,7 +36,7 @@ configuration-schema definition.

    sample fetchSubmissions expression

    fetchSubmissions(
    'pregnancy', // formId
    { 'last-event-id': 334 }, // params, last-event-id will be replaced by cursor
    'http://localhost:4000/inbox/abc-123-xyz' // postUrl
    );

    sample changesApi and pickFormData usage

    // get all the changes...
    changesApi({
    include_docs: true,
    // This only gets used the first time the job is run.
    // Subsequent runs take the lastSeq value as their cursor.
    // "last-event-id": 789,
    });

    // Picks out the field data for a given formId.
    pickFormData('pregnancy');

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/mogli-changelog.html b/adaptors/packages/mogli-changelog.html index fa4de730f685..00fa12ee83d4 100644 --- a/adaptors/packages/mogli-changelog.html +++ b/adaptors/packages/mogli-changelog.html @@ -17,7 +17,7 @@ - + @@ -31,7 +31,7 @@ be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    0.3.4

    Patch Changes

    0.3.3

    Patch Changes

    0.3.2

    Patch Changes

    0.3.1

    Patch Changes

    0.3.0

    Minor Changes

    v0.1.3

    - + \ No newline at end of file diff --git a/adaptors/packages/mogli-configuration-schema.html b/adaptors/packages/mogli-configuration-schema.html index daade2dd4af5..a176e24afca9 100644 --- a/adaptors/packages/mogli-configuration-schema.html +++ b/adaptors/packages/mogli-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "loginUrl": " https://www.orange-or-airtel-or-vodafone.com/api/",
    "username": "admin",
    "password": "@secret(!)Pass",
    "securityToken": "dGF5bG9yOnNlY3JldA==",
    "secret": "someotherThiNGfSECret"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "loginUrl": {
    "title": "Login URL",
    "type": "string",
    "description": "Mogli instance login URL",
    "format": "uri",
    "minLength": 1,
    "examples": [
    " https://www.orange-or-airtel-or-vodafone.com/api/"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "Mogli instance username",
    "minLength": 1,
    "examples": [
    "admin"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Mogli instance password",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@secret(!)Pass"
    ]
    },
    "securityToken": {
    "title": "Security Token",
    "type": "string",
    "description": "Mogli instance security token",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "dGF5bG9yOnNlY3JldA=="
    ]
    },
    "secret": {
    "title": "Secret",
    "type": "string",
    "description": "Mogli instance secret",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "someotherThiNGfSECret"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "loginUrl",
    "username",
    "password",
    "securityToken",
    "secret"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/mogli-docs.html b/adaptors/packages/mogli-docs.html index 8eab47f36299..bfd7491891bf 100644 --- a/adaptors/packages/mogli-docs.html +++ b/adaptors/packages/mogli-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    mogli@0.5.11

    This adaptor exports the following namespaced functions:

    sourceHelpers.lookup(relationshipName, externalID, path)
    sourceHelpers.relationship(relationshipName, externalID, dataSource)

    This adaptor exports the following from common:

    alterState()
    arrayToString()
    beta
    combine()
    dataPath()
    dataValue()
    each()
    field()
    fields()
    fn()
    fnIf()
    index()
    join()
    lastReferenceValue()
    map()
    merge()
    referencePath()
    source()
    sourceValue()
    toArray()

    sourceHelpers

    These functions belong to the sourceHelpers namespace.

    sourceHelpers.lookup

    lookup(relationshipName, externalID, path) ⇒ object

    Adds a lookup or 'dome insert' to a record.

    ParamTypeDescription
    relationshipNamestring__r relationship field on the record.
    externalIDstringSalesforce ExternalID field.
    pathstringJSONPath to data source.

    Example: Example

    lookup("relationship_name__r", "externalID on related object", "$.path")

    sourceHelpers.relationship

    relationship(relationshipName, externalID, dataSource) ⇒ object

    Adds a lookup or 'dome insert' to a record.

    ParamTypeDescription
    relationshipNamestring__r relationship field on the record.
    externalIDstringSalesforce ExternalID field.
    dataSourcestringresolvable source.

    Example: Data Sourced Value

    relationship("relationship_name__r", "externalID on related object", dataSource("path"))

    Example: Fixed Value

    relationship("relationship_name__r", "externalID on related object", "hello world")

    - + \ No newline at end of file diff --git a/adaptors/packages/mogli-readme.html b/adaptors/packages/mogli-readme.html index 72e6269a4ed0..fb501b6a0d48 100644 --- a/adaptors/packages/mogli-readme.html +++ b/adaptors/packages/mogli-readme.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ configuration-schema definition.

    Create inbound SMS

    createSMS(
    fields(
    field('sender', dataValue('from_number')),
    field('receivedAt', dataValue('timestamp')),
    field('message', dataValue('message'))
    )
    );

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/mojatax-changelog.html b/adaptors/packages/mojatax-changelog.html index 83a44ac62433..ae6bb88b3586 100644 --- a/adaptors/packages/mojatax-changelog.html +++ b/adaptors/packages/mojatax-changelog.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/mojatax-configuration-schema.html b/adaptors/packages/mojatax-configuration-schema.html index 811b356b9052..44775465e59f 100644 --- a/adaptors/packages/mojatax-configuration-schema.html +++ b/adaptors/packages/mojatax-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "baseUrl": "https://vfd-staging.mojatax.com",
    "password": "@some(!)Str0ngp4ss0w0rd",
    "clientId": "the-long-uuid-provided-by-mojatax"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "baseUrl": {
    "title": "Base URL",
    "type": "string",
    "description": "Mojatax base URL",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://vfd-staging.mojatax.com"
    ]
    },
    "clientId": {
    "title": "Client Id",
    "type": "string",
    "description": "Your Mojatax client id",
    "examples": [
    "the-long-uuid-provided-by-mojatax"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Your Mojatax password",
    "writeOnly": true,
    "examples": [
    "@some(!)Str0ngp4ss0w0rd"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "baseUrl",
    "password",
    "clientId"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/mojatax-docs.html b/adaptors/packages/mojatax-docs.html index 279a45822065..2e39b2dbcf0e 100644 --- a/adaptors/packages/mojatax-docs.html +++ b/adaptors/packages/mojatax-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    mojatax@1.0.5

    post(path, data, options, [callback])
    request(method, path, data, options, [callback])

    This adaptor exports the following from common:

    cursor()
    dataPath()
    dataValue()
    dateFns
    each()
    field()
    fields()
    fn()
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    post

    post(path, data, options, [callback]) ⇒ Operation

    Make a POST request to any Mojatax endpoint.

    ParamTypeDescription
    pathstringPath to resource
    dataobjectObject which will be attached to the request body
    optionsMojataxRequestOptionsOptional request options
    [callback]functionOptional callback to handle the response

    This operation writes the following keys to state:

    State KeyDescription
    dataThe response body (as JSON)
    responseThe HTTP response from the Mojatax server (excluding the body)
    referencesAn array of all previous data objects used in the Job

    Example: Make a POST request to create an invoice

    post("CreateInvoice", {
    invoice_id: 'PID092',
    customerId: '102',
    items: [],
    });

    request

    request(method, path, data, options, [callback]) ⇒ Operation

    Make a general HTTP request against the Mojatax server.

    ParamTypeDescription
    methodstringHTTP method to use
    pathstringPath to resource
    dataobjectObject which will be attached to the POST body
    optionsMojataxRequestOptionsOptional request options
    [callback]functionOptional callback to handle the response

    This operation writes the following keys to state:

    State KeyDescription
    dataThe response body (as JSON)
    responseThe HTTP response from the Mojatax server (excluding the body)
    referencesAn array of all previous data objects used in the Job

    Example: Make a POST request to create an invoice

    request("POST", "/client/CreateInvoice", {
    invoice_id: 'PID092',
    customerId: '102',
    items: [],
    });

    Interfaces

    MojataxHttpState

    State object

    Properties

    NameDescription
    dataThe response body (as JSON)
    responseThe HTTP response from the Mojatax server (excluding the body)
    referencesAn array of all previous data objects used in the Job

    MojataxRequestOptions

    Options provided to Mojatax HTTP request

    Properties

    NameTypeDescription
    bodyobject | stringbody data to append to the request. JSON will be converted to a string (but a content-type header will not be attached to the request).
    errorsobjectMap of errorCodes -> error messages, ie, { 404: 'Resource not found;' }. Pass false to suppress errors for this code.
    queryobjectAn object of query parameters to be encoded into the URL.
    headersobjectAn object of headers to append to the request.
    parseAsstringParse the response body as json, text or stream. By default will use the response headers.
    timeoutnumberRequest timeout in ms. Default: 300 seconds.
    tlsobjectTLS/SSL authentication options. See https://nodejs.org/api/tls.html#tlscreatesecurecontextoptions

    - + \ No newline at end of file diff --git a/adaptors/packages/mojatax-readme.html b/adaptors/packages/mojatax-readme.html index 2a09b2a5743b..396ce7f21cee 100644 --- a/adaptors/packages/mojatax-readme.html +++ b/adaptors/packages/mojatax-readme.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ configuration-schema for required and optional configuration properties.

    A example expression using the post function

    post('CreateInvoice', {
    customerId: '102',
    invoice_id: 'PID092',
    });

    Development

    Clone the adaptors monorepo. Follow the "Getting Started" guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To build only the docs run pnpm build docs.

    - + \ No newline at end of file diff --git a/adaptors/packages/mongodb-changelog.html b/adaptors/packages/mongodb-changelog.html index 873b3098afb3..86919b47a73c 100644 --- a/adaptors/packages/mongodb-changelog.html +++ b/adaptors/packages/mongodb-changelog.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    1.0.6

    Patch Changes

    1.0.5

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/mongodb-configuration-schema.html b/adaptors/packages/mongodb-configuration-schema.html index c603595d4bb9..bb70d06afdb0 100644 --- a/adaptors/packages/mongodb-configuration-schema.html +++ b/adaptors/packages/mongodb-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "clusterHostname": "yourCluster-xxxyzzz.mongodb.net",
    "username": "admin",
    "password": "@secret(!)Pass"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "clusterHostname": {
    "title": "Cluster Hostname",
    "type": "string",
    "description": "Your MongoDB cluster hostname",
    "format": "string",
    "minLength": 1,
    "examples": [
    "yourCluster-xxxyzzz.mongodb.net"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "Your MongoDB instance username",
    "minLength": 1,
    "examples": [
    "admin"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Your MongoDB instance password",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@secret(!)Pass"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "clusterHostname",
    "username",
    "password"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/mongodb-docs.html b/adaptors/packages/mongodb-docs.html index 06b5e360f664..26e0ea9b15cb 100644 --- a/adaptors/packages/mongodb-docs.html +++ b/adaptors/packages/mongodb-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    mongodb@2.1.10

    findDocuments(params)
    insertDocuments(params)
    updateDocument(params)

    This adaptor exports the following from common:

    alterState()
    dataPath()
    dataValue()
    each()
    field()
    fields()
    fn()
    fnIf()
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    findDocuments

    findDocuments(params) ⇒ State

    Find documents in a mongoDb collection

    ParamTypeDescription
    paramsobjectConfiguration for mongo

    Example

    findDocuments({
    database: 'str',
    collection: 'cases',
    query: {a:3}
    });

    insertDocuments

    insertDocuments(params) ⇒ State

    Inserts documents into a mongoDb collection

    ParamTypeDescription
    paramsobjectConfiguration for mongo

    Example

    insertDocuments({
    database: 'str',
    collection: 'kids',
    documents: [1,2,3]
    });

    updateDocument

    updateDocument(params) ⇒ State

    Updates document (optionally upserting) into a mongoDb collection

    ParamTypeDescription
    paramsobjectConfiguration for mongo

    Example

    updateDocuments({
    database: 'str',
    collection: 'animals',
    filter: { type: 'fuzzy' },
    changes: { kind: 'soft' },
    options: { upsert: true }
    });

    - + \ No newline at end of file diff --git a/adaptors/packages/mongodb-readme.html b/adaptors/packages/mongodb-readme.html index f5b27c36d3df..952cc168a38b 100644 --- a/adaptors/packages/mongodb-readme.html +++ b/adaptors/packages/mongodb-readme.html @@ -17,7 +17,7 @@ - + @@ -29,7 +29,7 @@ configuration-schema definition.

    insertDocuments

    insertDocuments({
    database: 'yourDb',
    collection: 'yourCollection',
    documents: state => {
    return state.data.map(item => {
    return { name: item.name, age: item.age };
    });
    },
    // callback: (state) => state, // optional
    });

    findDocuments

    findDocuments({
    database: 'yourDb',
    collection: 'yourCollection',
    query: state => {
    return { name: 'stu' };
    },
    // callback: (state) => state, // optional
    });

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/msgraph-changelog.html b/adaptors/packages/msgraph-changelog.html index 643ba7a27f22..a990c339836d 100644 --- a/adaptors/packages/msgraph-changelog.html +++ b/adaptors/packages/msgraph-changelog.html @@ -17,7 +17,7 @@ - + @@ -28,7 +28,7 @@ accessToken are now both supported (access_token is preferred)

    0.6.1

    Patch Changes

    0.6.0

    Minor Changes

    Patch Changes

    0.5.5

    Patch Changes

    0.5.4

    Patch Changes

    0.5.3

    Patch Changes

    0.5.2

    Patch Changes

    0.5.1

    Patch Changes

    0.5.0

    Minor Changes

    Patch Changes

    0.4.0

    Minor Changes

    Patch Changes

    0.3.5

    Patch Changes

    0.3.4

    Patch Changes

    0.3.3

    Patch Changes

    0.3.2

    Patch Changes

    0.3.1

    Patch Changes

    0.3.0

    Minor Changes

    0.2.0

    Minor Changes

    Patch Changes

    0.1.1

    Patch Changes

    0.1.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/msgraph-configuration-schema.html b/adaptors/packages/msgraph-configuration-schema.html index 14b1c41baf5b..ab193e95aef2 100644 --- a/adaptors/packages/msgraph-configuration-schema.html +++ b/adaptors/packages/msgraph-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjlGWERwYmZNRl"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$comment": "OAuth2",
    "properties": {
    "apiVersion": {
    "title": "API Version",
    "anyOf": [
    {
    "type": "string"
    },
    {
    "type": "null"
    }
    ],
    "placeholder": "v1.0",
    "description": "Microsoft Graph api version",
    "minLength": 1,
    "examples": [
    "v1.0",
    "beta"
    ]
    },
    "access_token": {
    "title": "Access Token",
    "type": "string",
    "description": "Your Microsoft Graph access token",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6IjlGWERwYmZNRl"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "access_token"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/msgraph-docs.html b/adaptors/packages/msgraph-docs.html index 24448218876a..b552c1c030ea 100644 --- a/adaptors/packages/msgraph-docs.html +++ b/adaptors/packages/msgraph-docs.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ some parent resource, like a group

    ParamTypeDefaultDescription
    specifierObjectA definition of the drive to retrieve - id {string} - The ID of the resource or owner. - owner {string} - The type of drive owner (e.g. sites, groups).
    namestringThe local name of the drive used to write to state.drives, ie, state.drives[name]
    [callback]functions => s(Optional) Callback function

    Example: Get a drive by ID

    getDrive({ id: "YXzpkoLwR06bxC8tNdg71m" })

    Example: Get the default drive for a site

    getDrive({ id: "openfn.sharepoint.com", owner: "sites" })

    getFile

    getFile(pathOrId, options, [callback]) ⇒ Operation

    Get file metadata or file content.

    ParamTypeDefaultDescription
    pathOrIdstringA path to a file or file id
    optionsobject(Optional) Query parameters
    [callback]functions => s(Optional) Callback function

    Example: Get a file by ID

    getFile('01LUM6XOGRONYNTZ26DBBJPTN5IFTQPBIW')

    Example: Get a file for a named drive by id

    getFile("01LUM6XOGRONYNTZ26DBBJPTN5IFTQPBIW",{ driveName: "mydrive"})

    getFolder

    getFolder(pathOrId, options, [callback]) ⇒ Operation

    Get the contents or metadata of a folder.

    ParamTypeDefaultDescription
    pathOrIdstringA path to a folder or folder id
    optionsobject(Optional) Query parameters
    [callback]functions => s(Optional) Callback function

    Example: Get a folder by ID

    getFolder('01LUM6XOCKDTZKQC7AVZF2VMHE2I3O6OY3')

    Example: Get a folder for a named drive by id

    getFolder("01LUM6XOCKDTZKQC7AVZF2VMHE2I3O6OY3",{ driveName: "mydrive"})

    uploadFile

    uploadFile(resource, data, callback) ⇒ Operation

    Upload a file to a drive

    ParamTypeDescription
    resourceObjectResource Object
    [resource.driveId]StringDrive Id
    [resource.driveId]StringSite Id
    [resource.folderId]StringParent folder id
    [resource.contentType]StringResource content-type
    [resource.onConflict]StringSpecify conflict behavior if file with the same name exists. Can be "rename
    dataObjectA buffer containing the file.
    callbackfunctionOptional callback function

    Example: Upload Excel file to a drive using driveId and parantItemId

    uploadFile(
    state => ({
    driveId: state.driveId,
    folderId: state.folderId,
    fileName: `Tracker.xlsx`,
    }),
    state => state.buffer
    );

    Example: Upload Excel file to a SharePoint drive using siteId and parantItemId

    uploadFile(
    state => ({
    siteId: state.siteId,
    folderId: state.folderId,
    fileName: `Report.xlsx`,
    }),
    state => state.buffer
    );

    Utils

    These functions belong to the Utils namespace.

    Utils.sheetToBuffer

    sheetToBuffer(rows, options) ⇒

    The function sheetToBuffer takes in rows, options and optional callback, It creates a workbook and worksheet using the rows, appends the worksheet to the workbook, and returns the workbook as a buffer.

    Returns: a buffer containing the Excel file in state.buffer.

    ParamTypeDescription
    rowsThe rows parameter is an array of objects representing the data to be written to the Excel sheet. Each object in the array represents a row in the sheet, and the keys of the object represent the column headers. The values of the object represent the data in each cell of the row.
    optionsThe options parameter is an object that contains additional configuration options
    [options.wsName]StringWorksheet name i.e 32 Characters
    [options.bookType]StringFile format of the exported file, Default is 'xlsx'. See here for the function. It can have the following properties:

    Example: Create a buffer containing excel file with xlsx output format

    sheetToBuffer('$.data[*]', {
    wsName: 'Invalid Grant Codes',
    bookType: 'xlsx',
    });

    - + \ No newline at end of file diff --git a/adaptors/packages/msgraph-readme.html b/adaptors/packages/msgraph-readme.html index 4dbb8348b8bc..de38c61b8b9d 100644 --- a/adaptors/packages/msgraph-readme.html +++ b/adaptors/packages/msgraph-readme.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ configuration-schema for required and optional configuration properties.

    Development

    Clone the adaptors monorepo. Follow the "Getting Started" guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To build only the docs run pnpm build docs.

    - + \ No newline at end of file diff --git a/adaptors/packages/mssql-changelog.html b/adaptors/packages/mssql-changelog.html index de3f7b106ed8..0a60f4b6345b 100644 --- a/adaptors/packages/mssql-changelog.html +++ b/adaptors/packages/mssql-changelog.html @@ -17,7 +17,7 @@ - + @@ -32,7 +32,7 @@ inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    4.0.8

    Patch Changes

    4.0.7

    Patch Changes

    4.0.6

    Patch Changes

    4.0.5

    Patch Changes

    4.0.4

    Patch Changes

    4.0.3

    Patch Changes

    4.0.2

    Patch Changes

    4.0.1

    Patch Changes

    4.0.0

    Major Changes

    Patch Changes

    3.1.1

    Patch Changes

    3.1.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/mssql-configuration-schema.html b/adaptors/packages/mssql-configuration-schema.html index f6964771e831..499a2523c51b 100644 --- a/adaptors/packages/mssql-configuration-schema.html +++ b/adaptors/packages/mssql-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "server": "something.database.windows.net",
    "database": "demo-db",
    "userName": "admin",
    "password": "@super(!)Password"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "https://json-schema.org/draft-07/schema#",
    "properties": {
    "server": {
    "title": "Server URL",
    "description": "The database instance server URL or IP address",
    "type": "string",
    "minLength": 1,
    "examples": [
    "something.database.windows.net",
    "192.168.12.10"
    ]
    },
    "database": {
    "title": "Database",
    "type": "string",
    "description": "The database name",
    "minLength": 1,
    "examples": [
    "demo-db"
    ]
    },
    "userName": {
    "title": "Username",
    "type": "string",
    "description": "Username",
    "minLength": 1,
    "examples": [
    "admin"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Password",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@super(!)Password"
    ]
    },
    "port": {
    "title": "Port",
    "description": "Database instance port",
    "type": "integer",
    "default": 1433,
    "examples": [
    1432
    ]
    },
    "encrypt": {
    "type": "boolean",
    "default": true,
    "examples": [
    false
    ]
    },
    "rowCollectionOnRequestCompletion": {
    "type": "boolean",
    "default": true,
    "examples": [
    false
    ]
    },
    "trustServerCertificate": {
    "type": "boolean",
    "default": true,
    "examples": [
    false
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "server",
    "database",
    "userName",
    "password"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/mssql-docs.html b/adaptors/packages/mssql-docs.html index d55cad6462fb..997118954002 100644 --- a/adaptors/packages/mssql-docs.html +++ b/adaptors/packages/mssql-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    mssql@5.0.10

    describeTable(tableName, options)
    findValue(filter)
    insert(table, record, options)
    insertMany(table, records, options)
    insertTable(tableName, columns, options)
    modifyTable(tableName, columns, options)
    sql(params)
    upsert(table, uuid, record, options)
    upsertIf(logical, table, uuid, record, options)
    upsertMany(table, uuid, records, options)

    This adaptor exports the following from common:

    alterState()
    combine()
    cursor()
    dataPath()
    dataValue()
    dateFns
    each()
    field()
    fields()
    fn()
    fnIf()
    http
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    describeTable

    describeTable(tableName, options) ⇒ Operation

    List the columns of a table in a database.

    ParamTypeDescription
    tableNamestringThe name of the table to describe
    optionsobjectOptional options argument

    Example

    describeTable('clinic_visits')

    findValue

    findValue(filter) ⇒ Operation

    Fetch a uuid key given a condition

    ParamTypeDescription
    filterobjectA filter object with the lookup table, a uuid and the condition

    Example

    findValue({
    uuid: 'id',
    relation: 'users',
    where: { first_name: 'Mama%', last_name: 'Cisse'},
    operator: { first_name: 'like', last_name: '='}
    })

    insert

    insert(table, record, options) ⇒ Operation

    Insert a record

    ParamTypeDescription
    tablestringThe target table
    recordobjectPayload data for the record as a JS object
    optionsobjectOptional options argument

    Example

    insert(table, record, {setNull: ["'undefined'", "''"], logValues: false})

    insertMany

    insertMany(table, records, options) ⇒ Operation

    Insert many records, using the keys of the first as the column template

    ParamTypeDescription
    tablestringThe target table
    recordsfunctionA function that takes state and returns an array of records
    optionsobjectOptional options argument

    Example

    insertMany(table, records, { setNull: false, writeSql: true, logValues: false })

    insertTable

    insertTable(tableName, columns, options) ⇒ Operation

    Create a table in database when given an array of columns and a table_name.

    ParamTypeDescription
    tableNamestringThe name of the table to create
    columnsarrayAn array of form columns
    optionsobjectOptional options argument

    Example

    insertTable('table_name', state => state.data.map(
    column => ({
    name: column.name,
    type: column.type,
    required: true, // optional
    unique: false, // optional - to be set to true for unique constraint
    })
    ));

    modifyTable

    modifyTable(tableName, columns, options) ⇒ Operation

    Alter an existing table in the database.

    ParamTypeDescription
    tableNamestringThe name of the table to alter
    columnsarrayAn array of form columns
    optionsobjectOptional options argument

    Example

    modifyTable('table_name', state => state.data.map(
    newColumn => ({
    name: newColumn.name,
    type: newColumn.type,
    required: true, // optional
    unique: false, // optional - to be set to true for unique constraint
    })
    ));

    sql

    sql(params) ⇒ Operation

    Execute an SQL statement

    ParamTypeDescription
    paramsobjectPayload data for the message

    Example

    sql({ query, options })

    upsert

    upsert(table, uuid, record, options) ⇒ Operation

    Insert or update a record using SQL MERGE

    ParamTypeDescription
    tablestringThe target table
    uuidstringThe uuid column to determine a matching/existing record
    recordobjectPayload data for the record as a JS object
    optionsobjectOptional options argument

    Example

    upsert(table, uuid, record, { setNull: "'undefined'", logValues: false})
    upsert(table, [uuid1, uuid2], record, { setNull: "'undefined'", logValues: false})

    upsertIf

    upsertIf(logical, table, uuid, record, options) ⇒ Operation

    Insert or update a record based on a logical condition using ON CONFLICT UPDATE

    ParamTypeDescription
    logicalstringa data to check existing value for.
    tablestringThe target table
    uuidstringThe uuid column to determine a matching/existing record
    recordobjectPayload data for the record as a JS object or function
    optionsobjectOptional options argument

    Example

    upsertIf(
    dataValue('name'),
    'users', // the DB table
    'uuid', // a DB column with a unique constraint
    { name: 'Elodie', id: 7 },
    { writeSql:true, execute: true, logValues: false }
    )

    upsertMany

    upsertMany(table, uuid, records, options) ⇒ Operation

    Insert or update multiple records using ON CONFLICT UPDATE and excluded

    ParamTypeDescription
    tablestringThe target table
    uuidstringThe uuid column to determine a matching/existing record
    recordsfunctionA function that takes state and returns an array of records
    optionsobjectOptional options argument

    Example

    upsertMany(
    'users', 'email', records, { logValues: false }
    )
    upsertMany(
    'users', ['email', 'phone'], records, { logValues: false }
    )

    - + \ No newline at end of file diff --git a/adaptors/packages/mssql-readme.html b/adaptors/packages/mssql-readme.html index 768c23c8779e..34e91041d6b8 100644 --- a/adaptors/packages/mssql-readme.html +++ b/adaptors/packages/mssql-readme.html @@ -17,7 +17,7 @@ - + @@ -39,7 +39,7 @@ columns. The key identity can be use for a column to auto-generate a value.

    insertTable('users', state =>
    state.data.map(column => ({
    name: column.name,
    type: column.type,
    required: true, // optional
    unique: false, // optional - set to true for unique constraint
    }))
    );

    Alter a table in the database

    This function allows to add new columns to a table. Beware of the fact that you cannot add new columns with names that already exist in the table.

    modifyTable(
    'users',
    state =>
    state.data.map(newColumn => ({
    name: newColumn.name,
    type: newColumn.type,
    required: true, // optional
    unique: false, // optional - set to true for unique constraint
    })),
    { writeSql: false, execute: true }
    );

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/mysql-changelog.html b/adaptors/packages/mysql-changelog.html index a2535120e0d0..05acae985c6b 100644 --- a/adaptors/packages/mysql-changelog.html +++ b/adaptors/packages/mysql-changelog.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    1.3.5

    Patch Changes

    1.3.4

    Patch Changes

    1.3.3

    Patch Changes

    1.3.2

    Patch Changes

    1.3.1

    Patch Changes

    1.3.0

    Minor Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/mysql-configuration-schema.html b/adaptors/packages/mysql-configuration-schema.html index e20003351586..8f6e03565d76 100644 --- a/adaptors/packages/mysql-configuration-schema.html +++ b/adaptors/packages/mysql-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "host": "some-host-url.compute-1.amazonaws.com",
    "database": "demo-db",
    "user": "admin-demo",
    "password": "@super(!)Secretpass"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "host": {
    "title": "Host URL",
    "type": "string",
    "description": "The database instance host URL",
    "format": "string",
    "minLength": 1,
    "examples": [
    "some-host-url.compute-1.amazonaws.com"
    ]
    },
    "port": {
    "title": "Port",
    "type": "integer",
    "default": 3306,
    "description": "Database instance port",
    "minLength": 1,
    "examples": [
    3306
    ]
    },
    "database": {
    "title": "Database",
    "type": "string",
    "description": "The database name",
    "minLength": 1,
    "examples": [
    "demo-db"
    ]
    },
    "user": {
    "title": "Username",
    "type": "string",
    "description": "The username to log in the database",
    "minLength": 1,
    "examples": [
    "admin-demo"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "The password to log in the database",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@super(!)Secretpass"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "host",
    "database",
    "user",
    "password"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/mysql-docs.html b/adaptors/packages/mysql-docs.html index d3544c005d9c..c91f49615692 100644 --- a/adaptors/packages/mysql-docs.html +++ b/adaptors/packages/mysql-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    mysql@2.0.8

    insert(table, fields)
    query(options)
    sqlString(queryString)
    upsert(table, fields)
    upsertMany(table, data)

    This adaptor exports the following from common:

    alterState()
    arrayToString()
    combine()
    dataPath()
    dataValue()
    each()
    field()
    fields()
    fn()
    fnIf()
    http
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    insert

    insert(table, fields) ⇒ Operation

    Insert a record

    ParamTypeDescription
    tablestringThe target table
    fieldsobjectA fields object

    Example

    execute(
    insert('table', fields(
    field('name', dataValue('name'))
    ))
    )(state)

    query

    query(options) ⇒ Operation

    Execute a SQL statement

    ParamTypeDescription
    optionsobjectPayload data for the message

    Example

    execute(
    query({ sql: 'select * from users;' })
    )(state)

    sqlString

    sqlString(queryString) ⇒ Operation

    Execute a SQL statement

    ParamTypeDescription
    queryStringStringA query string (or function which takes state and returns a string)

    Example

    execute(
    sqlString(state => "select * from items;")
    )(state)

    upsert

    upsert(table, fields) ⇒ Operation

    Insert or Update a record if matched

    ParamTypeDescription
    tablestringThe target table
    fieldsobjectA fields object

    Example

    execute(
    upsert('table', fields(
    field('name', dataValue('name'))
    ))
    )(state)

    upsertMany

    upsertMany(table, data) ⇒ Operation

    Insert or update multiple records using ON DUPLICATE KEY

    ParamTypeDescription
    tablestringThe target table
    dataarrayAn array of objects or a function that returns an array

    Example

    upsertMany(
    'users', // the DB table
    [
    { name: 'one', email: 'one@openfn.org' },
    { name: 'two', email: 'two@openfn.org' },
    ]
    )

    - + \ No newline at end of file diff --git a/adaptors/packages/mysql-readme.html b/adaptors/packages/mysql-readme.html index 09302460a16e..13118d699ad4 100644 --- a/adaptors/packages/mysql-readme.html +++ b/adaptors/packages/mysql-readme.html @@ -17,7 +17,7 @@ - + @@ -32,7 +32,7 @@ returns a string.

    sqlString(state => {
    return (
    `INSERT INTO untitled_table (name, the_geom) VALUES ('` +
    state.data.version +
    `', ` +
    dataValue('form.Choix_tache')(state) +
    `)`
    );
    });

    Insert a single record

    This function is used to insert a single record in a MySQL database.

    insert(
    'some_table',
    fields(
    field('firstname', dataValue('form.patient_firstname')),
    field('lastname', dataValue('form.patient_lastname'))
    )
    );

    Insert or update a single record

    This function is used to insert a single record in a MySQL database or update it if there is a match.

    upsert(
    'some_table',
    fields(
    field('firstname', dataValue('form.patient_firstname')),
    field('lastname', dataValue('form.patient_lastname'))
    )
    );

    Upsert many records

    This function allows the upsert of a set of records inside a table all at once.

    upsertMany(
    'users', // the DB table
    [
    { name: 'one', email: 'one@openfn.org' },
    { name: 'two', email: 'two@openfn.org' },
    ]
    );

    or

    upsertMany('users', state =>
    state.data.users.map(user => {
    name: user['name'],
    email: user['email']
    })
    );

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/nexmo-changelog.html b/adaptors/packages/nexmo-changelog.html index 26b58a96cc20..ebfee2b27927 100644 --- a/adaptors/packages/nexmo-changelog.html +++ b/adaptors/packages/nexmo-changelog.html @@ -17,7 +17,7 @@ - + @@ -29,7 +29,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    0.2.3

    Patch Changes

    0.2.2

    Patch Changes

    0.2.1

    Patch Changes

    0.2.0

    Minor Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/nexmo-configuration-schema.html b/adaptors/packages/nexmo-configuration-schema.html index 7e154e107775..922e97c740d4 100644 --- a/adaptors/packages/nexmo-configuration-schema.html +++ b/adaptors/packages/nexmo-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "apiKey": "mYaP1K3y",
    "apiSecret": "supersecret"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "apiKey": {
    "title": "API Key",
    "type": "string",
    "description": "Your Nexmo API Key",
    "minLength": 1,
    "examples": [
    "mYaP1K3y"
    ]
    },
    "apiSecret": {
    "title": "API Secret",
    "type": "string",
    "description": "Your Nexmo API Secret key",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "supersecret"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "apiKey",
    "apiSecret"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/nexmo-docs.html b/adaptors/packages/nexmo-docs.html index a238669cd666..ee59e7647761 100644 --- a/adaptors/packages/nexmo-docs.html +++ b/adaptors/packages/nexmo-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/nexmo-readme.html b/adaptors/packages/nexmo-readme.html index 9b700bdd1329..1e07e18e6c5f 100644 --- a/adaptors/packages/nexmo-readme.html +++ b/adaptors/packages/nexmo-readme.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ configuration-schema definition.

    sendSMS

    sample expression

    sendSMS('OpenFn', '0123456789', 'HelloWorld!');

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/ocl-changelog.html b/adaptors/packages/ocl-changelog.html index da56ed66e583..892a63a3f8a1 100644 --- a/adaptors/packages/ocl-changelog.html +++ b/adaptors/packages/ocl-changelog.html @@ -17,7 +17,7 @@ - + @@ -29,7 +29,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    0.3.0

    Minor Changes

    0.2.6

    Patch Changes

    0.2.5

    Patch Changes

    0.2.4

    Patch Changes

    0.2.3

    Patch Changes

    0.2.2

    Patch Changes

    0.2.1

    Patch Changes

    0.2.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/ocl-configuration-schema.html b/adaptors/packages/ocl-configuration-schema.html index 490ae089f6bc..64c8e8af20e9 100644 --- a/adaptors/packages/ocl-configuration-schema.html +++ b/adaptors/packages/ocl-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "hostUrl": "https://api.openconceptlab.org/",
    "username": "usernmame",
    "password": "supersecretpassword"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "hostUrl": {
    "title": "Host URL",
    "type": "string",
    "description": "The OCL API URL",
    "default": "https://api.openconceptlab.org/",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://api.openconceptlab.org/"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "The username to log in to OCL",
    "minLength": 1,
    "examples": [
    "usernmame"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "The password to log in to OCL",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "supersecretpassword"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "hostUrl",
    "username",
    "password"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/ocl-docs.html b/adaptors/packages/ocl-docs.html index 4754f60fd263..0557513e8cb9 100644 --- a/adaptors/packages/ocl-docs.html +++ b/adaptors/packages/ocl-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    ocl@1.2.11

    get(path, query, callback)
    getMappings(ownerId, repositoryId, [options], callback)

    This adaptor exports the following from common:

    alterState()
    dataPath()
    dataValue()
    each()
    field()
    fields()
    fn()
    fnIf()
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    get

    get(path, query, callback) ⇒ Operation

    Get a resource in OCL

    ParamTypeDescription
    pathstringPath to resource
    queryobjectA query object that will limit what resources are retrieved when converted into request params.
    callbackfunction(Optional) callback function

    Example

    get(
    "orgs/MSFOCG/collections/lime-demo/HEAD/mappings",
    {
    page: 1,
    exact_match: "off",
    limit: 200,
    verbose: false,
    sortDesc: "_score",
    },
    (state) => {
    // Add state oclMappings
    const oclMappings = state.data;
    return { ...state, data: {}, references: [], response: {}, oclMappings };
    }
    );

    getMappings

    getMappings(ownerId, repositoryId, [options], callback) ⇒ Operation

    Get a source repository in OCL

    ParamTypeDescription
    ownerIdstringAn OCL user or organization
    repositoryIdstringAn OCL collection id or source id
    [options]ObjectOptional. options which can be passed to See more on OCL swagger docs
    callbackfunction(Optional) callback function

    Example

    getMappings(
    "MSFOCG",
    "lime-demo",
    { page: 1, exact_match: "off", verbose: false },
    (state) => {
    // Add state oclMappings
    const oclMappings = state.data;
    return { ...state, data: {}, references: [], response: {}, oclMappings };
    }
    );

    - + \ No newline at end of file diff --git a/adaptors/packages/ocl-readme.html b/adaptors/packages/ocl-readme.html index 5e706a4af1cc..86bae159544b 100644 --- a/adaptors/packages/ocl-readme.html +++ b/adaptors/packages/ocl-readme.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ configuration-schema definition.

    Mapping source concepts to destination API

    Recieve form data from source application and convert data element keys to destination application.

    map(  "data": {
    "a": 1,
    "b": 2},
    {users:"haftamuk", sources: "eCHIS-CODES", concepts: "fp_new_at_10_to_14" }
    );

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/odk-changelog.html b/adaptors/packages/odk-changelog.html index affda603153a..23f919ad68c5 100644 --- a/adaptors/packages/odk-changelog.html +++ b/adaptors/packages/odk-changelog.html @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@
    Skip to main content

    Changelog for the odk adaptor

    @openfn/language-odk

    3.0.11

    Patch Changes

    • Updated dependencies [b3d7f59]
    • Updated dependencies [2d709ff]
    • Updated dependencies [41e8cc3]

    3.0.10

    Patch Changes

    3.0.9

    Patch Changes

    3.0.8

    Patch Changes

    • 6c9affd: Fix typo in error message

    3.0.7

    Patch Changes

    3.0.6

    Patch Changes

    3.0.5

    Patch Changes

    3.0.4

    Patch Changes

    3.0.3

    Patch Changes

    3.0.2

    Patch Changes

    • f51c5d0: Enforce that absolute urls must not be passed to HTTP functions
    • Updated dependencies [4fe527c]

    3.0.1

    Patch Changes

    3.0.0

    Major Changes

    • 0b81f06: - getSubmissions() now returns submission data (not metadata)
      • getSubmissions() arguments can be references (functions)
      • getSubmissions() supports query parameters
      • HTTP helper APIs have been slightly streamlined and fixed
      • Documentation overhaul
      • All callback functions have been removed (use an fn() block instead)

    2.0.0

    Major Changes

    • 9234f83: - configuration-schema: rename username to email
      • Improve logging when authentication fails
      • Improve error reporting when requests fail

    1.1.1

    Patch Changes

    1.1.0

    Minor Changes

    • 73433c20: Add fnIf operation

    Patch Changes

    1.0.1

    Patch Changes

    1.0.0

    Initial release for odk adaptor with get, post, getForms and getSubmissions

    - + \ No newline at end of file diff --git a/adaptors/packages/odk-configuration-schema.html b/adaptors/packages/odk-configuration-schema.html index c73d41cd42cb..d1d94af09026 100644 --- a/adaptors/packages/odk-configuration-schema.html +++ b/adaptors/packages/odk-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "password": "@some(!)Str0ngp4ss0w0rd",
    "email": "test@openfn.org",
    "baseUrl": "https://sandbox.getodk.cloud/"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "baseUrl": {
    "title": "Base URL",
    "type": "string",
    "description": "ODK base URL",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://sandbox.getodk.cloud/"
    ]
    },
    "email": {
    "title": "Email",
    "type": "string",
    "description": "Email",
    "examples": [
    "test@openfn.org"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Password",
    "writeOnly": true,
    "examples": [
    "@some(!)Str0ngp4ss0w0rd"
    ]
    },
    "access_token": {
    "title": "Access Token",
    "type": "string",
    "description": "Your ODK access token",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "the-long-access-token-from-your-auth"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "password",
    "email",
    "baseUrl"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/odk-docs.html b/adaptors/packages/odk-docs.html index c01308efe9f1..5afbec6b2975 100644 --- a/adaptors/packages/odk-docs.html +++ b/adaptors/packages/odk-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    odk@3.0.11

    get(path, options)
    getForms(projectId)
    getSubmissions(projectId, xmlFormId, query)
    post(path, body, options)
    request(method, path, body, options)

    This adaptor exports the following from common:

    cursor()
    dataPath()
    dataValue()
    dateFns
    each()
    field()
    fields()
    fn()
    fnIf()
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    get

    get(path, options) ⇒ Operation

    Make a GET request against the ODK server.

    ParamTypeDescription
    pathstringPath to resource
    optionsRequestOptionsOptions to configure the HTTP request

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the ODK HTTP server (with the body removed)
    referencesan array of all the previous data values

    Example: Get a list of available projects

    get("v1/projects");

    Example: Get projects with query parameters

    get("v1/projects", {
    query: { datasets: true }
    });

    getForms

    getForms(projectId) ⇒ Operation

    Fetch all forms for a project.

    ParamTypeDescription
    projectIdnumberId of the project

    This operation writes the following keys to state:

    State KeyDescription
    dataarray of form data objects
    responsethe response from the ODK HTTP server (with the body removed)
    referencesan array of all the previous data values

    Example: Fetch all forms for project with id 22

    getForms(22);

    getSubmissions

    getSubmissions(projectId, xmlFormId, query) ⇒ Operation

    Fetch all submissions to a given form.

    ParamTypeDescription
    projectIdnumberId of the project the form belongs to
    xmlFormIdstringId of the form to fetch submissions for
    querystringQuery parameters to append to the request, see https://docs.getodk.org/central-api-odata-endpoints/#data-document

    This operation writes the following keys to state:

    State KeyDescription
    dataarray of form submission objects
    responsethe response from the ODK HTTP server (with the body removed)
    referencesan array of all the previous data values

    Example: Get all submissions to a form called 'patient-follow-up'

    getSubmissions(22, 'patient-follow-up');

    Example: Filter submissions since a given date

    getSubmissions(22, 'patient-follow-up', { $filter: "$root/Submissions/__system/submissionDate gt 2020-01-31T23:59:59.999Z" });

    post

    post(path, body, options) ⇒ Operation

    Make a POST request against the ODK server.

    ParamTypeDescription
    pathstringPath to resource
    bodyobjectObject which will be attached to the POST body
    optionsRequestOptionsOptions to configure the HTTP request

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the ODK HTTP server (with the body removed)
    referencesan array of all the previous data values

    Example: Create a new project

    post('v1/projects', { name: 'Project Name' });

    request

    request(method, path, body, options) ⇒ Operation

    Make a general HTTP request against the ODK server.

    ParamTypeDescription
    methodstringHTTP method to use
    pathstringPath to resource
    bodyobjectObject which will be attached to the body
    optionsRequestOptionsOptional request params

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the ODK HTTP server (with the body removed)
    referencesan array of all the previous data values

    Example: Make a POST request to create a new project

    request("POST", 'v1/projects', { name: 'Project Name' });

    Interfaces

    ODKHttpState

    State object

    Properties

    NameDescription
    datathe parsed response body
    responsethe response from the ODK HTTP server (with the body removed)
    referencesan array of all the previous data values

    RequestOptions

    Options provided to the HTTP request

    Properties

    NameTypeDescription
    queryobjectAn object of query parameters to be encoded into the URL.
    headersobjectAn object of headers to append to the request.
    parseAsstringParse the response body as json, text or stream. By default will use the response headers.
    timeoutnumberRequest timeout in ms. Default: 300 seconds.

    - + \ No newline at end of file diff --git a/adaptors/packages/odk-readme.html b/adaptors/packages/odk-readme.html index 93b1c1141aa0..47e6876d2717 100644 --- a/adaptors/packages/odk-readme.html +++ b/adaptors/packages/odk-readme.html @@ -17,7 +17,7 @@ - + @@ -29,7 +29,7 @@ configuration-schema for required and optional configuration properties.

    A example expression using the post function

    post('v1/projects', { name: 'Project Name' });

    Development

    Clone the adaptors monorepo. Follow the "Getting Started" guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To build only the docs run pnpm build docs.

    - + \ No newline at end of file diff --git a/adaptors/packages/openfn-changelog.html b/adaptors/packages/openfn-changelog.html index 6bf29f36a81d..1e7afa2d9e90 100644 --- a/adaptors/packages/openfn-changelog.html +++ b/adaptors/packages/openfn-changelog.html @@ -17,7 +17,7 @@ - + @@ -29,7 +29,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    1.2.6

    Patch Changes

    1.2.5

    Patch Changes

    1.2.4

    Patch Changes

    1.2.3

    Patch Changes

    1.2.2

    Patch Changes

    1.2.1

    Patch Changes

    1.2.0

    Minor Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/openfn-configuration-schema.html b/adaptors/packages/openfn-configuration-schema.html index 12977e141238..d6b2571cdd81 100644 --- a/adaptors/packages/openfn-configuration-schema.html +++ b/adaptors/packages/openfn-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "host": "https://www.openfn.org",
    "username": "test@openfn.org",
    "password": "@super(!)Secretpass"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "host": {
    "title": "Host",
    "type": "string",
    "description": "The OpenFn host url",
    "format": "uri",
    "default": "https://www.openfn.org",
    "minLength": 1,
    "examples": [
    "https://www.openfn.org"
    ]
    },
    "projectId": {
    "title": "Project ID",
    "type": "string",
    "description": "Your OpenFn project ID",
    "minLength": 1,
    "examples": [
    "some-id"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "The username to log in to OpenFn",
    "minLength": 1,
    "examples": [
    "test@openfn.org"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "The password to log in to OpenFn",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@super(!)Secretpass"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "host",
    "username",
    "password"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/openfn-docs.html b/adaptors/packages/openfn-docs.html index bdfe24694a01..ab7845339c67 100644 --- a/adaptors/packages/openfn-docs.html +++ b/adaptors/packages/openfn-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/openfn-readme.html b/adaptors/packages/openfn-readme.html index 8e7cdfad35fc..db4b09676061 100644 --- a/adaptors/packages/openfn-readme.html +++ b/adaptors/packages/openfn-readme.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ configuration-schema definition.

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/openhim-changelog.html b/adaptors/packages/openhim-changelog.html index 6d151d7170ec..03fda473feb8 100644 --- a/adaptors/packages/openhim-changelog.html +++ b/adaptors/packages/openhim-changelog.html @@ -17,7 +17,7 @@ - + @@ -29,7 +29,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    0.1.4

    Patch Changes

    0.1.3

    Patch Changes

    0.1.2

    Patch Changes

    0.1.1

    Patch Changes

    0.1.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/openhim-configuration-schema.html b/adaptors/packages/openhim-configuration-schema.html index f1e22029ec94..b2613d43c2ff 100644 --- a/adaptors/packages/openhim-configuration-schema.html +++ b/adaptors/packages/openhim-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "apiUrl": "http://openhim.com/api"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "apiUrl": {
    "title": "API URL",
    "type": "string",
    "description": "The OpenHIM API url",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "http://openhim.com/api"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "The username to log in to OpenHIM",
    "minLength": 1,
    "examples": [
    "admin@openhim.org"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "The password to log in to OpenHIM",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@super(!)Secretpass"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "apiUrl"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/openhim-docs.html b/adaptors/packages/openhim-docs.html index 58b5acca624c..990adeda1f99 100644 --- a/adaptors/packages/openhim-docs.html +++ b/adaptors/packages/openhim-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/openhim-readme.html b/adaptors/packages/openhim-readme.html index 945c07a2c114..0758b0045baa 100644 --- a/adaptors/packages/openhim-readme.html +++ b/adaptors/packages/openhim-readme.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ configuration-schema definition.

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/openimis-changelog.html b/adaptors/packages/openimis-changelog.html index 3f91a4442b71..881ffec86b93 100644 --- a/adaptors/packages/openimis-changelog.html +++ b/adaptors/packages/openimis-changelog.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Changelog for the openimis adaptor

    @openfn/language-openimis

    2.0.8

    Patch Changes

    • Updated dependencies [b3d7f59]
    • Updated dependencies [2d709ff]
    • Updated dependencies [41e8cc3]

    2.0.7

    Patch Changes

    2.0.6

    Patch Changes

    2.0.5

    Patch Changes

    2.0.4

    Patch Changes

    2.0.3

    Patch Changes

    2.0.2

    Patch Changes

    2.0.1

    Patch Changes

    2.0.0

    Major Changes

    • Export new common http helpers (http namespace)

    1.1.3

    Patch Changes

    1.1.2

    Patch Changes

    1.1.1

    Patch Changes

    1.1.0

    Minor Changes

    • 73433c20: Add fnIf operation

    Patch Changes

    1.0.3

    Patch Changes

    1.0.2

    Patch Changes

    1.0.1

    Patch Changes

    • 6c588212: Fix configuration-schema and add baseUrl in required

    1.0.0

    Initial release.

    Includes a getFHIR() function and authorisation.

    - + \ No newline at end of file diff --git a/adaptors/packages/openimis-configuration-schema.html b/adaptors/packages/openimis-configuration-schema.html index 44a370b5c46c..8edef9978d4b 100644 --- a/adaptors/packages/openimis-configuration-schema.html +++ b/adaptors/packages/openimis-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "baseUrl": "https://demo.openimis.org",
    "username": "test@openfn.org",
    "password": "@some(!)Str0ngp4ss0w0rd"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "baseUrl": {
    "title": "Base URL",
    "anyOf": [
    {
    "type": "string"
    },
    {
    "type": "null"
    }
    ],
    "description": "The base URL (http://www.example.com)",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://demo.openimis.org"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "Username",
    "examples": [
    "test@openfn.org"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Password",
    "writeOnly": true,
    "examples": [
    "@some(!)Str0ngp4ss0w0rd"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "baseUrl",
    "username",
    "password"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/openimis-docs.html b/adaptors/packages/openimis-docs.html index b426faff016b..10555340a5e3 100644 --- a/adaptors/packages/openimis-docs.html +++ b/adaptors/packages/openimis-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/openimis-readme.html b/adaptors/packages/openimis-readme.html index dbac363f39a8..3c05b9a959d2 100644 --- a/adaptors/packages/openimis-readme.html +++ b/adaptors/packages/openimis-readme.html @@ -17,7 +17,7 @@ - + @@ -31,7 +31,7 @@ configuration-schema definition.

    sample expression using operation

    post({
    "url": "api/v1/forms/data/wide/json/formId",
    "body": {"a":1}
    "headers": {}
    })

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/openlmis-changelog.html b/adaptors/packages/openlmis-changelog.html index 1a10fd2de671..0832daa9756c 100644 --- a/adaptors/packages/openlmis-changelog.html +++ b/adaptors/packages/openlmis-changelog.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Changelog for the openlmis adaptor

    @openfn/language-openlmis

    1.0.10

    Patch Changes

    • Updated dependencies [b3d7f59]
    • Updated dependencies [2d709ff]
    • Updated dependencies [41e8cc3]

    1.0.9

    Patch Changes

    1.0.8

    Patch Changes

    1.0.7

    Patch Changes

    1.0.6

    Patch Changes

    1.0.5

    Patch Changes

    1.0.4

    Patch Changes

    1.0.3

    Patch Changes

    1.0.2

    Patch Changes

    • 940996b: Use common helper code to handle invalid absolute URLs
    • Updated dependencies [4fe527c]

    1.0.1

    Patch Changes

    1.0.0

    Add generic helpers. request(), post(), get() and put()

    - + \ No newline at end of file diff --git a/adaptors/packages/openlmis-configuration-schema.html b/adaptors/packages/openlmis-configuration-schema.html index 2deff115c1f3..26c8564afa86 100644 --- a/adaptors/packages/openlmis-configuration-schema.html +++ b/adaptors/packages/openlmis-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "password": "@some(!)Str0ngp4ss0w0rd",
    "username": "administrator",
    "baseUrl": "https://test.openlmis.org"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "baseUrl": {
    "title": "Base URL",
    "anyOf": [
    {
    "type": "string"
    },
    {
    "type": "null"
    }
    ],
    "description": "The base URL (https://test.openlmis.org)",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://test.openlmis.org"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "Username",
    "examples": [
    "administrator"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Password",
    "writeOnly": true,
    "examples": [
    "@some(!)Str0ngp4ss0w0rd"
    ]
    },
    "access_token": {
    "title": "Access Token",
    "type": "string",
    "description": "Your OpenLMIS API access token",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "4739f6c9-3b81-4176-98a1-bf001c8416ea"
    ]
    },
    "clientId": {
    "title": "Client ID",
    "type": "string",
    "description": "Your user based client id",
    "writeOnly": true,
    "minLength": 1,
    "default": "user-client"
    },
    "clientSecret": {
    "title": "Client Secret Token",
    "type": "string",
    "description": "Your user based client secret",
    "writeOnly": true,
    "minLength": 1,
    "default": "changeme"
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "password",
    "username",
    "baseUrl",
    "clientId",
    "clientSecret"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/openlmis-docs.html b/adaptors/packages/openlmis-docs.html index fc53ae9e7daa..b98b9ef37162 100644 --- a/adaptors/packages/openlmis-docs.html +++ b/adaptors/packages/openlmis-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    openlmis@1.0.10

    get(path, options, [callback])
    post(path, body, [callback])
    put(path, body, [callback])
    request(method, path, body, options, [callback])

    This adaptor exports the following from common:

    cursor()
    dataPath()
    dataValue()
    dateFns
    each()
    field()
    fields()
    fn()
    fnIf()
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    get

    get(path, options, [callback]) ⇒ Operation

    Send a GET request to OpenLMIS

    ParamTypeDescription
    pathstringPath to resource (relative to the base URL defined in configuration)
    optionsRequestOptionsOptional request options
    [callback]functionOptional callback to handle the response

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example: Get all supplyLines

    get("/supplyLines");

    post

    post(path, body, [callback]) ⇒ Operation

    Send a POST request to OpenLMIS

    ParamTypeDescription
    pathstringPath to resource (relative to the base URL defined in configuration)
    bodyobjectObject which will be attached to the POST body
    [callback]functionOptional callback to handle the response

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example: Creates new program

    post("/programs", { name: "Bukayo", code: "abc" });

    put

    put(path, body, [callback]) ⇒ Operation

    Send a PUT request to OpenLMIS

    ParamTypeDescription
    pathstringPath to resource (relative to the base URL defined in configuration)
    bodyobjectObject which will be attached to the PUT body
    [callback]functionOptional callback to handle the response

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example: Update existing program

    put("/programs/123", { name: "DigTalent", code: "123" });

    request

    request(method, path, body, options, [callback]) ⇒ Operation

    Send a HTTP request to OpenLMIS

    ParamTypeDescription
    methodstringHTTP method to use
    pathstringPath to resource (relative to the base URL defined in configuration)
    bodyobjectObject which will be attached to the POST body
    optionsRequestOptionsOptional request options
    [callback]functionOptional callback to handle the response

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body
    responsethe response from the HTTP server, including headers, statusCode, body, etc
    referencesan array of all previous data objects used in the Job

    Example

    request("POST", "/programs", { name: "WSH", code: "123" });

    Interfaces

    RequestOptions

    Options provided to the HTTP request

    Properties

    NameTypeDescription
    bodyobjectbody data to append to the request.
    queryobjectAn object of query parameters to be encoded into the URL.
    headersobjectAn object of headers to append to the request.

    - + \ No newline at end of file diff --git a/adaptors/packages/openlmis-readme.html b/adaptors/packages/openlmis-readme.html index 762ed1a5076e..9883dd4ba899 100644 --- a/adaptors/packages/openlmis-readme.html +++ b/adaptors/packages/openlmis-readme.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ configuration-schema for required and optional configuration properties.

    Development

    Clone the adaptors monorepo. Follow the "Getting Started" guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To build only the docs run pnpm build docs.

    - + \ No newline at end of file diff --git a/adaptors/packages/openmrs-changelog.html b/adaptors/packages/openmrs-changelog.html index 012f1c4994cf..7d4bac60aed0 100644 --- a/adaptors/packages/openmrs-changelog.html +++ b/adaptors/packages/openmrs-changelog.html @@ -17,7 +17,7 @@ - + @@ -32,7 +32,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    1.1.1

    Patch Changes

    1.1.0

    Minor Changes

    1.0.1

    Patch Changes

    1.0.0

    Major Changes

    0.10.5

    Patch Changes

    0.10.4

    Patch Changes

    0.10.3

    Patch Changes

    0.10.2

    Patch Changes

    0.10.1

    Patch Changes

    0.10.0

    Minor Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/openmrs-configuration-schema.html b/adaptors/packages/openmrs-configuration-schema.html index 538582035351..51789803a41b 100644 --- a/adaptors/packages/openmrs-configuration-schema.html +++ b/adaptors/packages/openmrs-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "instanceUrl": "http://openmrs.com/instance/url"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "instanceUrl": {
    "title": "Instance URL",
    "type": "string",
    "description": "The OpenMRS host url",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "http://openmrs.com/instance/url"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "The username to log in to OpenMRS",
    "minLength": 1,
    "examples": [
    "admin@openmrs.org"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "The password to log in to OpenMRS",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@super(!)Secretpass"
    ]
    },
    "fhirVersion": {
    "title": "FHIR Release Version",
    "type": "string",
    "placeholder": "R4",
    "default": "R4",
    "description": "FHIR Release Version",
    "minLength": 1,
    "examples": [
    "R5",
    "R4B",
    "R4",
    "R3",
    "R2"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "instanceUrl"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/openmrs-docs.html b/adaptors/packages/openmrs-docs.html index fd27862ce4be..f6a3f5cbb0b2 100644 --- a/adaptors/packages/openmrs-docs.html +++ b/adaptors/packages/openmrs-docs.html @@ -17,7 +17,7 @@ - + @@ -28,7 +28,7 @@ Updating an object requires to send all required fields or the full body

    ParamTypeDescription
    resourceTypestringThe type of resource to be updated. E.g. person, patient, etc.
    pathstringThe id or path to the object to be updated. E.g. e739808f-f166-42ae-aaf3-8b3e8fa13fda or e739808f-f166-42ae-aaf3-8b3e8fa13fda/{collection-name}/{object-id}
    dataObjectData to update. It requires to send all required fields or the full body. If you want partial updates, use patch operation.
    [callback]functionOptional callback to handle the response

    Example: a person

    update("person", '3cad37ad-984d-4c65-a019-3eb120c9c373',{"gender":"M","birthdate":"1997-01-13"})

    upsert

    upsert(resourceType, query, data, [callback]) ⇒ Operation

    Upsert a record. A generic helper function used to atomically either insert a row, or on the basis of the row already existing, UPDATE that existing row instead.

    Throws:

    ParamTypeDescription
    resourceTypestringThe type of a resource to upsert. E.g. trackedEntityInstances
    queryObjectA query object that allows to uniquely identify the resource to update. If no matches found, then the resource will be created.
    dataObjectThe data to use for update or create depending on the result of the query.
    [callback]functionOptional callback to handle the response

    Example: For an existing patient using upsert

    upsert('patient', { q: '10007JJ' }, { person: { age: 50 } });

    Example: For non existing patient creating a patient record using upsert

    upsert(
    "patient",
    { q: "1000EHE" },
    {
    identifiers: [
    {
    identifier: "1000EHE",
    identifierType: "05a29f94-c0ed-11e2-94be-8c13b969e334",
    location: "44c3efb0-2583-4c80-a79e-1f756a03c0a1",
    preferred: true,
    },
    ],
    person: {
    gender: "M",
    age: 42,
    },
    }
    );

    http

    These functions belong to the http namespace.

    http.delete

    delete(path, [options]) ⇒ operation

    Make a DELETE request to an OpenMRS endpoint

    ParamTypeDefaultDescription
    pathstringpath to resource
    [options]RequestOptions{}An object containing query params and headers for the request

    Example: Delete a resource

    http.delete(
    "/ws/rest/v1/patient/abc/"
    )

    http.get

    get(path, [options]) ⇒ operation

    Make a GET request to any OpenMRS endpoint. Unlike the main get(), this does not append anything to the path you provide.

    ParamTypeDefaultDescription
    pathstringpath to resource
    [options]RequestOptions{}An object containing query params and headers for the request

    Example: GET a resource with a query

    http.get(
    "/ws/rest/v1/patient",
    {
    query: {
    limit: 1
    }
    }
    )

    http.post

    post(path, data, [options]) ⇒ operation

    Make a POST request to an OpenMRS endpoint

    ParamTypeDefaultDescription
    pathstringpath to resource
    dataanythe payload
    [options]RequestOptions{}An object containing query params and headers for the request

    Example: Post with a JSON payload

    http.post(
    "/ws/rest/v1/patient",
    {
    "person": {
    "gender":"M",
    "age":47,
    "birthdate":"1970-01-01T00:00:00.000+0100",
    "names":[
    {
    "givenName":"Jon",
    "familyName":"Snow"
    }
    ],
    }
    }
    )

    http.request

    request(method, path, [options]) ⇒ Operation

    Make a HTTP request to any OpenMRS endpoint

    ParamTypeDefaultDescription
    methodstringHTTP method to use
    pathstringPath to resource
    [options]RequestOptions{}An object containing query, headers, and body for the request

    Example: GET request with a URL query

    http.request("GET",
    "/ws/rest/v1/patient/d3f7e1a8-0114-4de6-914b-41a11fc8a1a8", {
    query:{
    limit: 1,
    offset: 20
    },
    });

    fhir

    These functions belong to the fhir namespace.

    fhir.get

    get(path, query, [callback]) ⇒ Operation

    Make a get request to any FHIR endpoint in OpenMRS

    ParamTypeDescription
    pathstringPath to resource
    queryFhirParametersRequest parameters
    [callback]functionOptional callback to handle the response

    Example: Get encounters based on lastUpdated field

    fhir.get('Encounter', { count: 100, lastUpdated: 'ge2024-01-01T00:00:00Z' })

    Interfaces

    FhirParameters

    OpenMRS FHIR requests parameters options. This combines FHIR search parameters, resource-specific parameters, and pagination options.

    Properties

    NameTypeDescription
    countstringNumber of results to return (_count in FHIR)
    includestringResources to include in the response (_include in FHIR)
    revincludestringReverse includes to include in the response (_revinclude in FHIR)
    summarystringSummary mode for the response (_summary in FHIR)
    totalstringWhether to include a total count of matching resources (_total in FHIR)
    elementsstringList of elements to include in the response (_elements in FHIR)
    containedstringWhether to include contained resources (_contained in FHIR)
    containedTypestringType of contained resources (_containedType in FHIR)
    idstringLogical ID of the resource to filter on (_id in FHIR)
    lastUpdatedstringTimestamp to filter resources last updated after this date (_lastUpdated in FHIR)
    tagstringTag to filter resources by (_tag in FHIR)
    profilestringProfile URL to filter resources by (_profile in FHIR)
    securitystringSecurity labels to filter resources by (_security in FHIR)
    textstringText search on narrative content (_text in FHIR)
    contentstringFull-text search on resource content (_content in FHIR)
    liststringSearch resources included in a particular list (_list in FHIR)
    hasstringPerform search based on reference chains (_has in FHIR)
    getPagesOffsetstringOffset for pagination, used to skip a number of results (_getpagesoffset in OpenMRS)
    getPagesstringGet specific pages of resources (_getpages in OpenMRS)
    bundleTypestringType of bundle to return (e.g., searchset, batch, history) (_bundleType in FHIR)

    RequestOptions

    Options object

    Properties

    NameTypeDefaultDescription
    queryobjectAn object of query parameters to be encoded into the URL
    headersobjectAn object of all request headers
    bodyobjectThe request body (as JSON)
    [parseAs]string"'json'"The response format to parse (e.g., 'json', 'text', or 'stream')

    - + \ No newline at end of file diff --git a/adaptors/packages/openmrs-readme.html b/adaptors/packages/openmrs-readme.html index 9d4cce8a146f..7cfd537daf45 100644 --- a/adaptors/packages/openmrs-readme.html +++ b/adaptors/packages/openmrs-readme.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ configuration-schema definition.

    Get a patient by some criteria

    // getPatient({ uuid: '516af9aa-0402-4e11-ad79-e394fdec0c91' });
    // getPatient({ uuid: dataValue('patientId')(state) });
    getPatient({
    uuid: state => state.data[0].uuid,
    });

    Example of searching for patients based on their EMR Id

    getPatients(
    {
    identifier: state => state.data.emrId,
    v: 'full',
    },
    {
    exactlyOne: true,
    }
    );

    Create an Encounter

    createEncounter({
    encounterDatetime: dataValue('visit_date'), //dynamically fill with source app data
    patient: dataValue('uuid'),
    encounterType: dataValue('visit_type'),
    location: dataValue('location.uuid'),
    encounterProviders: [
    {
    provider: dataValue('provider_name'),
    encounterRole: '240b26f9-dd88-4172-823d-4a8bfeb7841f', //hardcoded value
    },
    ],
    });

    Make a request to any OpenMRS endpoint

    get('/ws/rest/v1/patient', { q: 'mohammed' }, state => {
    console.log(JSON.stringify(state, null, 2));
    return state;
    });

    Create new patient

    createPatient(
    fields(
    field('gender', 'M'),
    field('names', function (state) {
    return [
    {
    patient_id: dataValue('form.patientId')(state),
    creator: dataValue('form.user')(state),
    },
    ];
    })
    )
    );

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/openspp-changelog.html b/adaptors/packages/openspp-changelog.html index 4d0176b5a98b..32782ee03c8b 100644 --- a/adaptors/packages/openspp-changelog.html +++ b/adaptors/packages/openspp-changelog.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Changelog for the openspp adaptor

    @openfn/language-openspp

    2.0.8

    Patch Changes

    • Updated dependencies [b3d7f59]
    • Updated dependencies [2d709ff]
    • Updated dependencies [41e8cc3]

    2.0.7

    Patch Changes

    2.0.6

    Patch Changes

    2.0.5

    Patch Changes

    2.0.4

    Patch Changes

    2.0.3

    Patch Changes

    2.0.2

    Patch Changes

    2.0.1

    Patch Changes

    2.0.0

    Major Changes

    • Export new common http helpers (http namespace)

    1.3.1

    Patch Changes

    1.3.0

    Minor Changes

    • 73433c20: Add fnIf operation

    Patch Changes

    1.2.1

    Patch Changes

    1.2.0

    Changes

    • 05defd2: add new functions, correcting docstring and add more examples
      • correcting docstring input parameters type
      • changing getServicePoint() from get by name into get by unique id
      • add more examples in docstring
      • getArea(): get existing area by id
      • searchArea(): search existing area by domain
      • searchServicePoint(): search existing service point by domain

    1.1.1

    Patch Changes

    • 48b4e97: update spp date time now string format

    1.1.0

    • Create OpenSPP adaptor with these functions:
      • getGroup(): get existing group information
      • getIndividual(): get existing individual information
      • searchGroup(): search existing group by domain
      • searchIndividual(): search existing individual by domain
      • getGroupMembers(): get members from group
      • getServicePoint(): get service points by name
      • getPrograms(): get single program
      • getPrograms(): get program list
      • getEnrolledPrograms(): get list of enrolled program for each beneficiary
      • enroll(): enroll beneficiary to a program
      • unenroll(): unenroll beneficiary from program
      • createIndividual(): create new individual
      • updateIndividual(): update existing individual
      • createGroup(): create new group
      • updateGroup(): update existing group
      • addToGroup(): add individual to group with(out) role
      • removeFromGroup(): end membership of individual to group
    - + \ No newline at end of file diff --git a/adaptors/packages/openspp-configuration-schema.html b/adaptors/packages/openspp-configuration-schema.html index ffb5c8d0cfb8..6233d58b39f6 100644 --- a/adaptors/packages/openspp-configuration-schema.html +++ b/adaptors/packages/openspp-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "password": "@some(!)Str0ngp4ss0w0rd",
    "username": "test@openfn.org",
    "database": "devel",
    "baseUrl": "https://dev.newlogic-demo.com"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "baseUrl": {
    "title": "Base URL",
    "anyOf": [
    {
    "type": "string"
    },
    {
    "type": "null"
    }
    ],
    "description": "The base URL (http://www.example.com)",
    "format": "uri",
    "minLength": 1,
    "default": "http://localhost",
    "examples": [
    "https://dev.newlogic-demo.com"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "Username",
    "default": "admin",
    "examples": [
    "test@openfn.org"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Password",
    "default": "admin",
    "writeOnly": true,
    "examples": [
    "@some(!)Str0ngp4ss0w0rd"
    ]
    },
    "database": {
    "title": "Database Name",
    "type": "string",
    "default": "devel",
    "description": "Database Name",
    "examples": [
    "devel"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "password",
    "username",
    "database",
    "baseUrl"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/openspp-docs.html b/adaptors/packages/openspp-docs.html index b52ddd7af76c..dd0723e55d2c 100644 --- a/adaptors/packages/openspp-docs.html +++ b/adaptors/packages/openspp-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    openspp@2.0.8

    addToGroup(group_id, individual_id, role)
    createGroup(data, callback)
    createIndividual(data, callback)
    enroll(spp_id, program_id)
    getArea(spp_id, callback)
    getEnrolledPrograms(spp_id, callback)
    getGroup(spp_id, callback)
    getGroupMembers(spp_id, [options], callback)
    getIndividual(spp_id, callback)
    getProgram(program_id, callback)
    getPrograms([options], callback)
    getServicePoint(spp_id, callback)
    removeFromGroup(group_id, individual_id)
    searchArea(domain, [options], callback)
    searchGroup(domain, [options], callback)
    searchIndividual(domain, [options], callback)
    searchServicePoint(domain, [options], callback)
    unenroll(spp_id, program_id)
    updateGroup(group_id, data)
    updateIndividual(individual_id, data)

    This adaptor exports the following from common:

    dataPath()
    dataValue()
    dateFns
    each()
    field()
    fields()
    fn()
    fnIf()
    http
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    addToGroup

    addToGroup(group_id, individual_id, role) ⇒ Operation

    add individual to group in OpenSPP

    ParamTypeDescription
    group_idstringgroup registrant id
    individual_idstringindividual registrant id
    rolestringindividual role in group

    Example: create a new head for group

    addToGroup("GRP_B2BRHJN2", "IND_8DUQL4M4", "Head")

    Example: create a new ordinary member for group

    addToGroup("GRP_B2BRHJN2", "IND_8DUQL4M4")

    Example: create a new member with new role for group

    addToGroup("GRP_B2BRHJN2", "IND_8DUQL4M4", "new-role-name")

    createGroup

    createGroup(data, callback) ⇒ Operation

    create new group for OpenSPP

    ParamTypeDescription
    dataobjectregistrant create data
    callbackfunctionAn optional callback function

    Example

    createGroup({ name: "Group 1" })

    createIndividual

    createIndividual(data, callback) ⇒ Operation

    create new individual for OpenSPP

    ParamTypeDescription
    dataobjectregistrant create data
    callbackfunctionAn optional callback function

    Example

    createIndividual({ name: "Individual 1" })

    enroll

    enroll(spp_id, program_id)

    enroll registrant to program in OpenSPP

    ParamTypeDescription
    spp_idstringspp_id of group / individual wanted to enroll
    program_idstringprogram_id of program

    Example

    enroll("IND_Q4VGGZPF", "PROG_2023_00000001")

    getArea

    getArea(spp_id, callback) ⇒ Operation

    get area by id in OpenSPP

    ParamTypeDescription
    spp_idstringspp_id of area
    callbackfunctionAn optional callback function

    Example

    getArea("LOC_7M92NLDH")

    getEnrolledPrograms

    getEnrolledPrograms(spp_id, callback) ⇒ Operation

    get programs list for specific registrant from OpenSPP

    ParamTypeDescription
    spp_idstringspp_id of group / individual wanted to search
    callbackfunctionAn optional callback function

    Example

    getEnrolledPrograms("IND_Q4VGGZPF")

    getGroup

    getGroup(spp_id, callback) ⇒ Operation

    get group information from OpenSPP

    ParamTypeDescription
    spp_idstringThe spp_id of the group
    callbackfunctionAn optional callback function

    Example

    getGroup("GRP_Q4VGGZPF")

    getGroupMembers

    getGroupMembers(spp_id, [options], callback) ⇒ Operation

    get group members information from OpenSPP

    ParamTypeDefaultDescription
    spp_idstringThe name of the group
    [options]object{}Searching options, eg: limit for limiting number of records returning, order for searching order, offset for skipping records
    callbackfunctionAn optional callback function

    Example

    getGroupMembers("GRP_Q4VGGZPF")

    getIndividual

    getIndividual(spp_id, callback) ⇒ Operation

    get individual information from OpenSPP

    ParamTypeDescription
    spp_idstringThe spp_id of the individual
    callbackfunctionAn optional callback function

    Example

    getIndividual("IND_Q4VGGZPF")

    getProgram

    getProgram(program_id, callback) ⇒ Operation

    get program information from OpenSPP

    ParamTypeDescription
    program_idstringsearching domain
    callbackfunctionAn optional callback function

    Example

    getProgram("PROG_2023_00000001")

    getPrograms

    getPrograms([options], callback) ⇒ Operation

    get programs list from OpenSPP

    ParamTypeDefaultDescription
    [options]number{}offset from start
    callbackfunctionAn optional callback function

    Example

    getPrograms(100)

    getServicePoint

    getServicePoint(spp_id, callback) ⇒ Operation

    get service points information from OpenSPP

    ParamTypeDescription
    spp_idstringThe spp_id of the agent
    callbackfunctionAn optional callback function

    Example

    getServicePoint("SVP_8P4KP4RT")

    removeFromGroup

    removeFromGroup(group_id, individual_id) ⇒ Operation

    remove individual from group in OpenSPP

    ParamTypeDescription
    group_idstringgroup registrant id
    individual_idstringindividual registrant id

    Example

    removeFromGroup("GRP_B2BRHJN2", "IND_8DUQL4M4")

    searchArea

    searchArea(domain, [options], callback) ⇒ Operation

    searching for service point in OpenSPP

    ParamTypeDefaultDescription
    domainArraysearching domain
    [options]object{}Searching options, eg: limit for limiting number of records returning, order for searching order, offset for skipping records
    callbackfunctionAn optional callback function

    Example: search without offset

    searchArea([["code", "=", "10732"]])

    Example: search with offset

    searchArea([["kind", "=", 1]], { offset: 10 }})

    searchGroup

    searchGroup(domain, [options], callback) ⇒ Operation

    get groups from OpenSPP

    ParamTypeDefaultDescription
    domainArraysearching domain
    [options]object{}Searching options, eg: limit for limiting number of records returning, order for ordering search, offset for skipping records
    callbackfunctionAn optional callback function

    Example: search group by domain

    searchGroup([["spp_id", "=", "GRP_Q4VGGZPF"]])

    Example: search group by domain with offset

    searchGroup([["spp_id", "ilike", "GRP"]], { offset: 100 }})

    Example: search group by complex domain for more accuracy

    searchGroup([["address", "!=", false], ["phone", "!=", false]])

    searchIndividual

    searchIndividual(domain, [options], callback) ⇒ Operation

    get individuals from OpenSPP

    ParamTypeDefaultDescription
    domainArraysearching domain
    [options]object{}Searching options, eg: limit for limiting number of records returning, order for searching order, offset for skipping records
    callbackfunctionAn optional callback function

    Example: search individual by domain

    searchIndividual([["spp_id", "=", "IND_Q4VGGZPF"]])

    Example: search individual by domain with offset

    searchIndividual([["spp_id", "ilike", "IND"]], { offset: 100 })

    Example: search individual by complex domain for more accuracy

    searchIndividual([["address", "!=", false], ["birthdate", "=", false]])

    searchServicePoint

    searchServicePoint(domain, [options], callback) ⇒ Operation

    searching for service point in OpenSPP

    ParamTypeDefaultDescription
    domainArraysearching domain
    [options]object{}Searching options, eg: limit for limiting number of records returning, order for searching order, offset for skipping records
    callbackfunctionAn optional callback function

    Example: search without offset

    searchServicePoint([["name", "ilike", "agent 1"]])

    Example: search with offset

    searchServicePoint([["name", "ilike", "agent 1"]], { offset: 100 })

    unenroll

    unenroll(spp_id, program_id)

    unenroll registrant from program in OpenSPP

    ParamTypeDescription
    spp_idstringspp_id of group / individual wanted to unenroll
    program_idstringprogram_id of program

    Example

    unenroll("IND_Q4VGGZPF", "PROG_2023_00000001")

    updateGroup

    updateGroup(group_id, data) ⇒ Operation

    update group for OpenSPP

    ParamTypeDescription
    group_idstringgroup registrant id
    dataobjectregistrant update data

    Example

    updateGroup("GRP_B2BRHJN2", { name: "Group 1" })

    updateIndividual

    updateIndividual(individual_id, data) ⇒ Operation

    update individual for OpenSPP

    ParamTypeDescription
    individual_idstringindividual registrant id
    dataobjectregistrant update data

    Example

    updateIndividual("IND_8DUQL4M4", { name: "Individual 1" })

    - + \ No newline at end of file diff --git a/adaptors/packages/openspp-readme.html b/adaptors/packages/openspp-readme.html index b1930fa72867..31d35645de93 100644 --- a/adaptors/packages/openspp-readme.html +++ b/adaptors/packages/openspp-readme.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ configuration-schema for required and optional configuration properties.

    A example expression using the getServicePoint function

    getServicePoint("newagentflour");

    Development

    Clone the adaptors monorepo. Follow the "Getting Started" guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To build only the docs run pnpm build docs.

    - + \ No newline at end of file diff --git a/adaptors/packages/postgresql-changelog.html b/adaptors/packages/postgresql-changelog.html index 3b2f69f7e283..a3fa4b8dfdce 100644 --- a/adaptors/packages/postgresql-changelog.html +++ b/adaptors/packages/postgresql-changelog.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    4.0.0

    Major Changes

    3.4.6

    Patch Changes

    3.4.5

    Patch Changes

    3.4.4

    Patch Changes

    3.4.3

    Patch Changes

    3.4.2

    Patch Changes

    3.4.1

    Patch Changes

    3.4.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/postgresql-configuration-schema.html b/adaptors/packages/postgresql-configuration-schema.html index 71e2fdf00f26..e6935b1bc4f2 100644 --- a/adaptors/packages/postgresql-configuration-schema.html +++ b/adaptors/packages/postgresql-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "host": "some-host.compute-1.amazonaws.com",
    "user": "admin",
    "database": "demo-db",
    "password": "@super(!)Secretpass"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "host": {
    "title": "Host",
    "type": "string",
    "description": "Postgres instance host URL or IP address",
    "minLength": 1,
    "examples": [
    "some-host.compute-1.amazonaws.com",
    "201.220.61.246"
    ]
    },
    "port": {
    "title": "Port",
    "type": "integer",
    "default": 5432,
    "description": "Database instance port",
    "minLength": 1,
    "examples": [
    5432
    ]
    },
    "database": {
    "title": "Database",
    "type": "string",
    "description": "The database name",
    "minLength": 1,
    "examples": [
    "demo-db"
    ]
    },
    "user": {
    "title": "User",
    "type": "string",
    "description": "User name",
    "minLength": 1,
    "examples": [
    "admin"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Password",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@super(!)Secretpass"
    ]
    },
    "ssl": {
    "title": "Use SSL",
    "type": "boolean",
    "examples": [
    true
    ]
    },
    "allowSelfSignedCert": {
    "title": "Allow self-signed certificate",
    "type": "boolean",
    "examples": [
    true
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "host",
    "user",
    "database",
    "password"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/postgresql-docs.html b/adaptors/packages/postgresql-docs.html index 025bdb7f50d4..de0d1071be31 100644 --- a/adaptors/packages/postgresql-docs.html +++ b/adaptors/packages/postgresql-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    postgresql@6.0.8

    describeTable(tableName, [options], callback)
    findValue([filter])
    insert(table, record, [options], callback)
    insertMany(table, records, [options], callback)
    insertTable(tableName, columns, [options], callback)
    modifyTable(tableName, columns, [options], callback)
    sql(sqlQuery, [options], callback)
    upsert(table, uuid, record, [options], callback)
    upsertIf(logical, table, uuid, record, [options], callback)
    upsertMany(table, uuid, data, [options], callback)

    This adaptor exports the following from common:

    alterState()
    arrayToString()
    combine()
    dataPath()
    dataValue()
    dateFns
    each()
    field()
    fields()
    fn()
    fnIf()
    group()
    http
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    describeTable

    describeTable(tableName, [options], callback) ⇒ Operation

    List the columns of a table in a database.

    ParamTypeDescription
    tableNamestringThe name of the table to describe
    [options]objectOptional options argument
    [options.writeSql]booleanA boolean value that specifies whether to log the generated SQL statement. Defaults to false.
    [options.execute]booleanA boolean value that specifies whether to execute the generated SQL statement. Defaults to false.
    callbackfunction(Optional) callback function

    Example

    describeTable('clinic_visits')

    findValue

    findValue([filter]) ⇒ value

    Fetch a uuid key given a condition

    ParamTypeDescription
    [filter]objectA filter object with the lookup table, a uuid and the condition
    [filter.uuid]stringThe uuid value to search for in the specified relation.
    [filter.relation]stringThe name of the relation to search for the uuid value.
    [filter.where]objectAn object that contains key-value pairs to filter the search results.
    [filter.operator]objectAn object that contains key-value pairs to specify the type of comparison to perform on the where clause.

    Example

    findValue({
    uuid: 'id',
    relation: 'users',
    where: { first_name: 'Mamadou' },
    operator: { first_name: 'like' }
    })

    insert

    insert(table, record, [options], callback) ⇒ Operation

    Insert a record

    ParamTypeDescription
    tablestringThe target table
    recordobjectPayload data for the record as a JS object or function
    [options]objectOptional options argument
    [options.setNull]stringA string value that specifies the behavior for inserting null values.
    [options.logValues]booleanA boolean value that specifies whether to log the inserted values to the console. Defaults to false.
    [options.writeSql]booleanA boolean value that specifies whether to log the generated SQL statement. Defaults to false.
    [options.execute]booleanA boolean value that specifies whether to execute the generated SQL statement. Defaults to false.
    callbackfunction(Optional) callback function

    Example

    insert('users', { name: 'Elodie', id: 7 }, { setNull: "'NaN'", logValues: true });

    insertMany

    insertMany(table, records, [options], callback) ⇒ Operation

    Insert many records, using the keys of the first as the column template

    ParamTypeDescription
    tablestringThe target table
    recordsarrayAn array or a function that takes state and returns an array
    [options]objectOptional options argument
    [options.setNull]stringA string value that specifies the behavior for inserting null values.
    [options.logValues]booleanA boolean value that specifies whether to log the inserted values to the console. Defaults to false.
    [options.writeSql]booleanA boolean value that specifies whether to log the generated SQL statement. Defaults to false.
    [options.execute]booleanA boolean value that specifies whether to execute the generated SQL statement. Defaults to false.
    callbackfunction(Optional) callback function

    Example

    insertMany('users', state => state.data.recordArray, { setNull: "'undefined'", logValues: true });

    insertTable

    insertTable(tableName, columns, [options], callback) ⇒ Operation

    Create a table in database when given an array of columns and a table_name.

    ParamTypeDescription
    tableNamestringThe name of the table to create
    columnsarrayAn array of form columns
    [options]objectOptional options argument
    [options.writeSql]booleanA boolean value that specifies whether to log the generated SQL statement. Defaults to false.
    [options.execute]booleanA boolean value that specifies whether to execute the generated SQL statement. Defaults to false.
    callbackfunction(Optional) callback function

    Example

    insertTable('table_name', state => state.data.map(
    column => ({
    name: column.name,
    type: column.type,
    required: true, // optional
    unique: false, // optional - to be set to true for unique constraint
    })
    ));

    modifyTable

    modifyTable(tableName, columns, [options], callback) ⇒ Operation

    Alter an existing table in the database.

    ParamTypeDescription
    tableNamestringThe name of the table to alter
    columnsarrayAn array of form columns
    [options]objectOptional options argument
    [options.writeSql]booleanA boolean value that specifies whether to log the generated SQL statement. Defaults to false.
    [options.execute]booleanA boolean value that specifies whether to execute the generated SQL statement. Defaults to false.
    callbackfunction(Optional) callback function

    Example

    modifyTable('table_name', state => state.data.map(
    newColumn => ({
    name: newColumn.name,
    type: newColumn.type,
    required: true, // optional
    unique: false, // optional - to be set to true for unique constraint
    })
    ));

    sql

    sql(sqlQuery, [options], callback) ⇒ Operation

    Execute an SQL statement

    ParamTypeDescription
    sqlQuerystringThe SQL query as a string.
    [options]objectOptional options argument
    [options.writeSql]booleanA boolean value that specifies whether to log the generated SQL statement. Defaults to false.
    [options.execute]booleanA boolean value that specifies whether to execute the generated SQL statement. Defaults to false.
    callbackfunction(Optional) callback function

    Example

    sql(state => `select(*) from ${state.data.tableName};`, { writeSql: true })

    upsert

    upsert(table, uuid, record, [options], callback) ⇒ Operation

    Insert or update a record using ON CONFLICT UPDATE

    ParamTypeDescription
    tablestringThe target table
    uuidstringThe uuid column to determine a matching/existing record
    recordobjectPayload data for the record as a JS object or function
    [options]objectOptional options argument
    [options.setNull]stringA string value that specifies the behavior for inserting null values.
    [options.writeSql]booleanA boolean value that specifies whether to log the generated SQL statement. Defaults to false.
    [options.execute]booleanA boolean value that specifies whether to execute the generated SQL statement. Defaults to false.
    [options.logValues]booleanA boolean value that specifies whether to log the inserted values to the console. Defaults to false.
    callbackfunction(Optional) callback function

    Example

    upsert(
    'users', // the DB table
    'ON CONSTRAINT users_pkey', // a DB column with a unique constraint OR a CONSTRAINT NAME
    { name: 'Elodie', id: 7 },
    { setNull: ["''", "'undefined'"], writeSql:true, execute: true, logValues: true }
    )

    upsertIf

    upsertIf(logical, table, uuid, record, [options], callback) ⇒ Operation

    Insert or update a record based on a logical condition using ON CONFLICT UPDATE

    ParamTypeDescription
    logicalstringa data to check existing value for.
    tablestringThe target table
    uuidstringThe uuid column to determine a matching/existing record
    recordobjectPayload data for the record as a JS object or function
    [options]objectOptional options argument
    [options.setNull]stringA string value that specifies the behavior for inserting null values.
    [options.writeSql]booleanA boolean value that specifies whether to log the generated SQL statement. Defaults to false.
    [options.execute]booleanA boolean value that specifies whether to execute the generated SQL statement. Defaults to false.
    [options.logValues]booleanA boolean value that specifies whether to log the inserted values to the console. Defaults to false.
    callbackfunction(Optional) callback function

    Example

    upsertIf(
    dataValue('name'),
    'users', // the DB table
    'ON CONSTRAINT users_pkey', // a DB column with a unique constraint OR a CONSTRAINT NAME
    { name: 'Elodie', id: 7 },
    { writeSql:true, execute: true }
    )

    upsertMany

    upsertMany(table, uuid, data, [options], callback) ⇒ Operation

    Insert or update multiple records using ON CONFLICT UPDATE and excluded

    ParamTypeDescription
    tablestringThe target table
    uuidstringThe uuid column to determine a matching/existing record
    dataarrayAn array of objects or a function that returns an array
    [options]objectOptional options argument
    [options.setNull]stringA string value that specifies the behavior for inserting null values.
    [options.writeSql]booleanA boolean value that specifies whether to log the generated SQL statement. Defaults to false.
    [options.execute]booleanA boolean value that specifies whether to execute the generated SQL statement. Defaults to false.
    [options.logValues]booleanA boolean value that specifies whether to log the inserted values to the console. Defaults to false.
    callbackfunction(Optional) callback function

    Example

    upsertMany(
    'users', // the DB table
    'email', // a DB column with a unique constraint OR a CONSTRAINT NAME
    [
    { name: 'one', email: 'one@openfn.org' },
    { name: 'two', email: 'two@openfn.org' },
    ]
    { logValues: true }
    )

    - + \ No newline at end of file diff --git a/adaptors/packages/postgresql-readme.html b/adaptors/packages/postgresql-readme.html index f8302911a46e..b11525115bd2 100644 --- a/adaptors/packages/postgresql-readme.html +++ b/adaptors/packages/postgresql-readme.html @@ -17,7 +17,7 @@ - + @@ -36,7 +36,7 @@ columns. The key identity can be use for a column to auto-generate a value.

    insertTable('users', state =>
    state.data.map(column => ({
    name: column.name,
    type: column.type,
    required: true, // optional
    unique: false, // optional - set to true for unique constraint
    }))
    );

    Alter a table in the database

    This function allows to add new columns to a table. Beware of the fact that you cannot add new columns with names that already exist in the table.

    modifyTable(
    'users',
    state =>
    state.data.map(newColumn => ({
    name: newColumn.name,
    type: newColumn.type,
    required: true, // optional
    unique: false, // optional - set to true for unique constraint
    })),
    { writeSql: false, execute: true }
    );

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/primero-changelog.html b/adaptors/packages/primero-changelog.html index f8efde14bb93..58084dbeb9d8 100644 --- a/adaptors/packages/primero-changelog.html +++ b/adaptors/packages/primero-changelog.html @@ -17,7 +17,7 @@ - + @@ -32,7 +32,7 @@ argument: the metadata from Primero's response.

    getCases will now not only return an array of cases in state.data, but metadata related to pagination in state.metadata.

    Patch Changes

    2.9.2

    Patch Changes

    2.9.1

    Patch Changes

    2.9.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/primero-configuration-schema.html b/adaptors/packages/primero-configuration-schema.html index e36cdbf19e43..34e2bce37bd9 100644 --- a/adaptors/packages/primero-configuration-schema.html +++ b/adaptors/packages/primero-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "url": "https://primero.org/some-org"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "url": {
    "title": "URL",
    "type": "string",
    "description": "The Primero host url",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://primero.org/some-org"
    ]
    },
    "user": {
    "title": "User",
    "type": "string",
    "description": "The username",
    "minLength": 1,
    "examples": [
    "admin"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Password",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@super(!)Superpass"
    ]
    },
    "basicAuth": {
    "title": "Use Basic Auth",
    "type": "boolean",
    "examples": [
    true
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "url"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/primero-docs.html b/adaptors/packages/primero-docs.html index a2cbddbad5af..2fe608a34c69 100644 --- a/adaptors/packages/primero-docs.html +++ b/adaptors/packages/primero-docs.html @@ -17,7 +17,7 @@ - + @@ -41,7 +41,7 @@ keeping both the existing values and appending the new

    ParamTypeDescription
    idstringA case ID to use for the update.
    paramsobjectan object with some case data.
    callbackfunction(Optional) Callback function

    Example: Update case for a specific case id

    updateCase("6aeaa66a-5a92-4ff5-bf7a-e59cde07eaaz", {
    data: {
    age: 16,
    sex: "female",
    name: "Fiona Edgemont",
    },
    });

    updateReferral

    updateReferral(params, callback) ⇒ Operation

    Update a single referral for a specific case in Primero

    ParamTypeDescription
    paramsobjectan object with an caseExternalId value to use, the id and the referral id to update.
    callbackfunction(Optional) Callback function

    Example: Update referral by record id

    updateReferral({
    caseExternalId: "record_id",
    id: "749e9c6e-60db-45ec-8f5a-69da7c223a79",
    caseId: "dcea6052-07d9-4cfa-9abf-9a36987cdd25",
    data: (state) => state.data,
    });

    upsertCase

    upsertCase(params, callback) ⇒ Operation

    Upsert case to Primero

    Use this function to update an existing case from Primero or to create it otherwise. In this implementation, we first fetch the list of cases, then we check if the case exist before choosing the right operation to do.

    ParamTypeDescription
    paramsobjectan object with an externalIds and some case data.
    callbackfunction(Optional) Callback function

    Example: Upsert case for a specific case id

    upsertCase({
    externalIds: ["case_id"],
    data: state => ({
    age: 20,
    sex: "male",
    name: "Alex",
    status: "open",
    case_id: "6aeaa66a-5a92-4ff5-bf7a-e59cde07eaaz",
    }),
    });

    - + \ No newline at end of file diff --git a/adaptors/packages/primero-readme.html b/adaptors/packages/primero-readme.html index 68c42f4edd6c..7ff1288db95f 100644 --- a/adaptors/packages/primero-readme.html +++ b/adaptors/packages/primero-readme.html @@ -17,7 +17,7 @@ - + @@ -33,7 +33,7 @@ in our Microsoft Dynamics, Github, or Google Sheets adaptors, but we'll need to await final doucmentation for Primero's v2 API before making changes.

    Azure Active Directory B2C

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/progres-changelog.html b/adaptors/packages/progres-changelog.html index 95952edfb1c3..0111fedb1301 100644 --- a/adaptors/packages/progres-changelog.html +++ b/adaptors/packages/progres-changelog.html @@ -17,7 +17,7 @@ - + @@ -29,7 +29,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    1.2.5

    Patch Changes

    1.2.4

    Patch Changes

    1.2.3

    Patch Changes

    1.2.2

    Patch Changes

    1.2.1

    Patch Changes

    1.2.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/progres-configuration-schema.html b/adaptors/packages/progres-configuration-schema.html index 08a33ed236a4..e4d1172ce29d 100644 --- a/adaptors/packages/progres-configuration-schema.html +++ b/adaptors/packages/progres-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "url": "https://endpoint/To/DTP",
    "key": "-----BEGIN PRIVATE KEY-----SOMETYPEOFPRIVATEVALUE-----END PRIVATE KEY-----",
    "cert": "-----BEGIN CERTIFICATE-----SOMETYPEOFVALUE-----END CERTIFICATE-----",
    "token": "[REDACTED]"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "url": {
    "title": "URL",
    "type": "string",
    "description": "The Progres URL",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://endpoint/To/DTP"
    ]
    },
    "key": {
    "title": "Private Key",
    "type": "string",
    "description": "Your Progres private key",
    "minLength": 1,
    "examples": [
    "-----BEGIN PRIVATE KEY-----SOMETYPEOFPRIVATEVALUE-----END PRIVATE KEY-----"
    ]
    },
    "cert": {
    "title": "Certificate",
    "type": "string",
    "description": "Your Progres certificate",
    "minLength": 1,
    "examples": [
    "-----BEGIN CERTIFICATE-----SOMETYPEOFVALUE-----END CERTIFICATE-----"
    ]
    },
    "token": {
    "title": "Token",
    "type": "string",
    "description": "Your Progres token",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "[REDACTED]"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "url",
    "key",
    "cert",
    "token"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/progres-docs.html b/adaptors/packages/progres-docs.html index 02bcb75100e2..f3316484b280 100644 --- a/adaptors/packages/progres-docs.html +++ b/adaptors/packages/progres-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/progres-readme.html b/adaptors/packages/progres-readme.html index 0e191ab55879..938ea1779b2d 100644 --- a/adaptors/packages/progres-readme.html +++ b/adaptors/packages/progres-readme.html @@ -17,7 +17,7 @@ - + @@ -34,7 +34,7 @@ configuration-schema definition.

    Posting data to an endpoint with SSL cert authentication

    postData({
    url: urlDTP,
    body: { a: 1 },
    headers: {
    'Subscription-Key': configuration['token'],
    },
    agentOptions: {
    key,
    cert,
    },
    });

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/rapidpro-changelog.html b/adaptors/packages/rapidpro-changelog.html index 007f14c94aa3..74b6ed63bef2 100644 --- a/adaptors/packages/rapidpro-changelog.html +++ b/adaptors/packages/rapidpro-changelog.html @@ -17,7 +17,7 @@ - + @@ -29,7 +29,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    0.5.6

    Patch Changes

    0.5.5

    Patch Changes

    0.5.4

    Patch Changes

    0.5.3

    Patch Changes

    0.5.2

    Patch Changes

    0.5.1

    Patch Changes

    0.5.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/rapidpro-configuration-schema.html b/adaptors/packages/rapidpro-configuration-schema.html index 9f994fd88c1d..acdd5e4f1f1d 100644 --- a/adaptors/packages/rapidpro-configuration-schema.html +++ b/adaptors/packages/rapidpro-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "host": "https://app.rapidpro.io/",
    "token": "#Super-sSCrecrete-token"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "host": {
    "title": "Host",
    "type": "string",
    "default": "https://app.rapidpro.io/",
    "description": "instance host URL",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://app.rapidpro.io/"
    ]
    },
    "token": {
    "title": "Token",
    "type": "string",
    "description": "instance access token",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "#Super-sSCrecrete-token"
    ]
    },
    "apiVersion": {
    "title": "API Version",
    "type": "string",
    "description": "API version to use. Leave this empty to use the default v2",
    "minLength": 1,
    "examples": [
    "v2"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "host",
    "token"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/rapidpro-docs.html b/adaptors/packages/rapidpro-docs.html index 0e97eb29b0d4..e28fa113a345 100644 --- a/adaptors/packages/rapidpro-docs.html +++ b/adaptors/packages/rapidpro-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    rapidpro@1.1.5

    addContact(params, callback)
    sendBroadcast(params, callback)
    startFlow(params, callback)
    upsertContact(params, callback)

    This adaptor exports the following from common:

    alterState()
    dataPath()
    dataValue()
    each()
    field()
    fields()
    fn()
    fnIf()
    http()
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    addContact

    addContact(params, callback) ⇒ Operation

    Adds a new contact to RapidPro

    ParamTypeDescription
    paramsobjectdata to create the new resource
    callbackfunction(Optional) callback function

    Example

    addContact({
    name: "Mamadou",
    language: "ENG",
    urns: ["tel:+250788123123"]
    });

    sendBroadcast

    sendBroadcast(params, callback) ⇒ Operation

    Sends a message to a list of contacts and/or URNs

    ParamTypeDescription
    paramsobjectdata to create the new resource
    callbackfunction(Optional) callback function

    Example

    sendBroadcast({
    text: "Hello world",
    urns: ["twitter:sirmixalot"],
    contacts: ["a052b00c-15b3-48e6-9771-edbaa277a353"]
    });

    startFlow

    startFlow(params, callback) ⇒ Operation

    Start a RapidPro flow for a number of contacts

    ParamTypeDescription
    paramsobjectdata to create the new resource
    callbackfunction(Optional) callback function

    Example

    startFlow({
    flow: "f5901b62-ba76-4003-9c62-72fdacc1b7b7",
    restart_participants: false,
    contacts: ["a052b00c-15b3-48e6-9771-edbaa277a353"]
    });

    upsertContact

    upsertContact(params, callback) ⇒ Operation

    Upserts a contact to RapidPro by URN

    ParamTypeDescription
    paramsobjectdata to upsert a contact
    callbackfunction(Optional) callback function

    Example

    upsertContact({
    name: "Mamadou",
    language: "ENG",
    urns: ["tel:+250788123123"]
    });

    - + \ No newline at end of file diff --git a/adaptors/packages/rapidpro-readme.html b/adaptors/packages/rapidpro-readme.html index 3696b77bff5d..84aa030d2658 100644 --- a/adaptors/packages/rapidpro-readme.html +++ b/adaptors/packages/rapidpro-readme.html @@ -17,7 +17,7 @@ - + @@ -32,7 +32,7 @@ definition.

    sample job expression using operation

    sendBroadcast({
    "text": "Hello friends.",
    "urns": [],
    "contacts": [],
    "groups", [],
    });

    Key helper functions

    sendBroadcast(...) to send broadcast message to multiple contacts

    sendBroadcast({
    text: 'Hello world',
    urns: ['twitter:sirmixalot'],
    contacts: ['a052b00c-15b3-48e6-9771-edbaa277a353'],
    });

    startFlow(...) to trigger an automation flow in RapidPro

    startFlow({
    flow: 'f5901b62-ba76-4003-9c62-72fdacc1b7b7',
    restart_participants: false,
    contacts: ['a052b00c-15b3-48e6-9771-edbaa277a353'],
    });

    upsertContact(...) to update/insert a Contact (and check if exists using external identifiers)

    upsertContact({
    name: 'Mamadou',
    language: 'ENG',
    urns: ['tel:+250788123123'],
    });

    addContact(...) to insert a Contact

    addContact({
    name: 'Mamadou',
    language: 'ENG',
    urns: ['tel:+250788123123'],
    });

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/redis-changelog.html b/adaptors/packages/redis-changelog.html index 3ebe9b9aff90..89aa0925095d 100644 --- a/adaptors/packages/redis-changelog.html +++ b/adaptors/packages/redis-changelog.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Changelog for the redis adaptor

    @openfn/language-redis

    1.2.7

    Patch Changes

    • Updated dependencies [b3d7f59]
    • Updated dependencies [2d709ff]
    • Updated dependencies [41e8cc3]

    1.2.6

    Patch Changes

    1.2.5

    Patch Changes

    1.2.4

    Patch Changes

    1.2.3

    Patch Changes

    1.2.2

    Patch Changes

    1.2.1

    Patch Changes

    1.2.0

    Minor Changes

    • c1e3221: - Add mGet() function
      • Remove console.log in hget()
      • Add logging to scan()

    1.1.2

    Patch Changes

    1.1.1

    Patch Changes

    • 2b8ec34: - Update host type configuration-schema

    1.1.0

    Minor Changes

    • Add jGet() function
    • Add jSet() function
    • scan() now iterates the whole database
      • Removed cursor option from scan
      • Removed default value for type option
      • Mapped json data type to the redis internal type

    1.0.0

    First release. Designed as a low-level wrapper around npm redis client.

    • get(key)
    • hget(key, field)
    • hGetAll(key)
    • hset(key, value)
    • scan(pattern,options)
    • set(key, field)
    - + \ No newline at end of file diff --git a/adaptors/packages/redis-configuration-schema.html b/adaptors/packages/redis-configuration-schema.html index 8b2aab245000..491d476637cf 100644 --- a/adaptors/packages/redis-configuration-schema.html +++ b/adaptors/packages/redis-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "host": "redis.example.com",
    "password": "@some(!)Str0ngp4ss0w0rd",
    "username": "test@openfn.org"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "host": {
    "title": "Host",
    "type": "string",
    "minLength": 1,
    "description": "Redis server hostname",
    "format": "uri",
    "examples": [
    "redis.example.com"
    ]
    },
    "database": {
    "title": "Database Number",
    "type": "integer",
    "description": "Redis database number. New connections always use the database 0.",
    "examples": [
    0
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "Redis Access Control username",
    "examples": [
    "test@openfn.org"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Redis Access Control password",
    "writeOnly": true,
    "examples": [
    "@some(!)Str0ngp4ss0w0rd"
    ]
    },
    "port": {
    "title": "Port",
    "type": "string",
    "description": "Redis server port",
    "writeOnly": true,
    "default": "6379",
    "examples": [
    "16652"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "host",
    "password",
    "username"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/redis-docs.html b/adaptors/packages/redis-docs.html index f38e25f5d0f6..8732fd9197ce 100644 --- a/adaptors/packages/redis-docs.html +++ b/adaptors/packages/redis-docs.html @@ -17,7 +17,7 @@ - + @@ -32,7 +32,7 @@ existing value will be replaced by the new value.

    ParamTypeDescription
    keystringThe key to modify.
    valuestring | objectThe JSON object or string value to set.

    This operation writes the following keys to state:

    State KeyDescription
    referencesan array of all previous data objects used in the Job

    Example: Set a JSON object for the key patient

    jSet('patient', { name: 'victor', ihs_number: 12345  });

    mGet

    mGet(keys) ⇒ Operation

    Get the values at specified paths in JSON documents stored at multiple keys.

    ParamTypeDescription
    keysArray.<string>The keys at which the JSON documents are stored.

    This operation writes the following keys to state:

    State KeyDescription
    datathe result returned from Redis
    referencesan array of all previous data objects used in the Job

    Example: Get JSON document values of the patient and doctor keys

    mGet(["patient", "doctor"]);

    scan

    scan(pattern, options) ⇒ Operation

    Returns all keys which match the provided pattern. scan iterates the whole database to find the matching keys

    ParamTypeDescription
    patternstringA glob-style pattern
    optionsScanOptionsScan options

    This operation writes the following keys to state:

    State KeyDescription
    dataan array of keys which match the pattern
    referencesan array of all previous data objects used in the Job

    Example: Scan for matching keys

    scan('*:20240524T172736Z*');

    Example: Scan for keys and fetch the string values inside

    scan('*:20240524T172736Z*');
    each($.data, get($.data).then((state) => {
    state.results ??= [];
    state.results.push(state.data)
    return state;
    })

    set

    set(key, value) ⇒ Operation

    Set the string value of a key. If the key already exists, its value is updated. Otherwise, a new key-value pair is created.

    ParamTypeDescription
    keystringThe name of the key
    valuestringThe value to set

    This operation writes the following keys to state:

    State KeyDescription
    referencesan array of all previous data objects used in the Job

    Example: Set the "patient" key to value "mtuchi"

    set("patient", "mtuchi");

    Interfaces

    RedisState

    State object

    Properties

    NameDescription
    datathe result returned from Redis
    referencesan array of all previous data objects used in the Job

    ScanOptions

    Options provided to the scan function

    Properties

    NameTypeDescription
    typestringLimits the keys returned to those of a specified type (e.g., string, list, set, hash, json, zset or stream).
    countintegerA hint to the server about how many elements to return in the call (default is 10).

    - + \ No newline at end of file diff --git a/adaptors/packages/redis-readme.html b/adaptors/packages/redis-readme.html index cb44b2915fa7..5b06139992f4 100644 --- a/adaptors/packages/redis-readme.html +++ b/adaptors/packages/redis-readme.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ configuration-schema for required and optional configuration properties.

    A example expression using the hset function

    hset('patient', { name: 'Bukayo' });

    Development

    Clone the adaptors monorepo. Follow the "Getting Started" guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To build only the docs run pnpm build docs.

    - + \ No newline at end of file diff --git a/adaptors/packages/resourcemap-changelog.html b/adaptors/packages/resourcemap-changelog.html index df9774cc0b11..5cc6f76372a9 100644 --- a/adaptors/packages/resourcemap-changelog.html +++ b/adaptors/packages/resourcemap-changelog.html @@ -17,7 +17,7 @@ - + @@ -29,7 +29,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    0.2.3

    Patch Changes

    0.2.2

    Patch Changes

    0.2.1

    Patch Changes

    0.2.0

    Minor Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/resourcemap-configuration-schema.html b/adaptors/packages/resourcemap-configuration-schema.html index 5a5105f3aaa2..09c08689e3de 100644 --- a/adaptors/packages/resourcemap-configuration-schema.html +++ b/adaptors/packages/resourcemap-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "baseUrl": "http://some-site-of-yours.com:8080"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "baseUrl": {
    "title": "Base URL",
    "type": "string",
    "default": "http://some-site-of-yours.com:8080",
    "description": "ResourceMap base URL",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "http://some-site-of-yours.com:8080"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "Your ResourceMap username",
    "minLength": 1,
    "examples": [
    "admin"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Your ResourceMap password",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@super(!)Secret"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "baseUrl"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/resourcemap-docs.html b/adaptors/packages/resourcemap-docs.html index 38a014a8f50c..97977cc8f869 100644 --- a/adaptors/packages/resourcemap-docs.html +++ b/adaptors/packages/resourcemap-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/resourcemap-readme.html b/adaptors/packages/resourcemap-readme.html index f187e9d5afdf..915198bc43f9 100644 --- a/adaptors/packages/resourcemap-readme.html +++ b/adaptors/packages/resourcemap-readme.html @@ -17,7 +17,7 @@ - + @@ -31,7 +31,7 @@ configuration-schema definition.

    Expressions

    submitSite(collectionId, fields)

    submitSite(
    303,
    fields(
    field('name', dataValue('sampleText')),
    field('lat', 48.86),
    field('lon', 2.35),
    field('properties', function (state) {
    return {
    Comment: state.data.sampleText,
    phone: '85512345678',
    };
    })
    )
    );

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/salesforce-changelog.html b/adaptors/packages/salesforce-changelog.html index dbd463222010..db1a9a61e21c 100644 --- a/adaptors/packages/salesforce-changelog.html +++ b/adaptors/packages/salesforce-changelog.html @@ -17,7 +17,7 @@ - + @@ -53,7 +53,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    3.0.7

    Patch Changes

    3.0.6

    Patch Changes

    3.0.5

    Patch Changes

    3.0.4

    Patch Changes

    3.0.3

    Patch Changes

    3.0.2

    Patch Changes

    3.0.1

    Patch Changes

    3.0.0

    Major Changes

    2.12.3

    Patch Changes

    2.12.2

    Patch Changes

    2.12.1

    Patch Changes

    2.12.0

    Minor Changes

    Patch Changes

    2.11.1

    Patch Changes

    2.11.0

    Minor Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/salesforce-configuration-schema.html b/adaptors/packages/salesforce-configuration-schema.html index ee57eb9baa9a..4e5fa706af2e 100644 --- a/adaptors/packages/salesforce-configuration-schema.html +++ b/adaptors/packages/salesforce-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "loginUrl": "https://somesalesforcelogin.url",
    "username": "someusername",
    "password": "@super(!)SecretPass"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "loginUrl": {
    "title": "Login URL",
    "type": "string",
    "description": "The Salesforce instance login URL",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://somesalesforcelogin.url"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "The username to log in the Salesforce instance",
    "minLength": 1,
    "examples": [
    "someusername"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "The password to log in the Salesforce instance",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@super(!)SecretPass"
    ]
    },
    "securityToken": {
    "title": "Security Token",
    "type": "string",
    "description": "The security token to access the Salesforce instance",
    "minLength": 1,
    "examples": [
    "salesforcesecuritytoken"
    ]
    },
    "apiVersion": {
    "title": "API Version",
    "type": "string",
    "placeholder": "52.0",
    "description": "Salesforce API Version",
    "minLength": 1,
    "examples": [
    "59.0"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "loginUrl",
    "username",
    "password"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/salesforce-docs.html b/adaptors/packages/salesforce-docs.html index 5b79154b5e31..e69f3a85d615 100644 --- a/adaptors/packages/salesforce-docs.html +++ b/adaptors/packages/salesforce-docs.html @@ -17,7 +17,7 @@ - + @@ -33,7 +33,7 @@ If sObjectName is not specified, it will print the total number of all available sObjects and push the result to state.data.

    ParamTypeDescription
    sObjectNamestringThe API name of the sObject. If omitted, fetches metadata for all sObjects.

    This operation writes the following keys to state:

    State KeyDescription
    dataAPI response data. Can be either an object or array of objects
    referencesHistory of all previous states

    Example: Fetch metadata for all available sObjects

    describe()

    Example: Fetch metadata for Account sObject

    describe('Account')

    destroy

    destroy(sObjectName, ids, [options]) ⇒ Operation

    Delete records of an sObject.

    ParamTypeDefaultDescription
    sObjectNamestringAPI name of the sObject.
    idsstring | Array.<string>ID or array of IDs of records to delete
    [options]objectOptions for the destroy delete operation.
    [options.failOnError]booleanfalseIf true, the operation will fail if any record fails to delete.

    This operation writes the following keys to state:

    State KeyDescription
    dataSummary of the response from Salesforce
    data.successtrue if Salesforce reports no errors from the operation
    data.completedArray of ids for every successful completion
    data.errorsArray of errors reported by Salesforce
    referencesHistory of all previous states

    Example: Delete a single record

    destroy("Account", "001XXXXXXXXXXXXXXX");

    Example: Allow operation to fail if any record fails to delete

    destroy("Account", ["001XXXXXXXXXXXXXXX", "001YYYYYYYYYYYYYYY"], {
    failOnError: true,
    });

    Example: Using a state variable

     fn((state) => {
    state.data = ["001XXXXXXXXXXXXXXX", "001YYYYYYYYYYYYYYY"];
    return state;
    });
    destroy("Account", $.data);

    get

    get(path, [options]) ⇒ Operation

    Send a GET request on salesforce server configured in state.configuration.

    ParamTypeDescription
    pathstringThe Salesforce API endpoint.
    [options]SimpleRequestOptionsConfigure headers and query parameters for the request.

    This operation writes the following keys to state:

    State KeyDescription
    dataAPI response data. Can be either an object or array of objects
    referencesHistory of all previous states

    Example: Make a GET request to a custom Salesforce flow

    get('/actions/custom/flow/POC_OpenFN_Test_Flow');

    Example: Make a GET request to a custom Salesforce flow with query parameters

    get('/actions/custom/flow/POC_OpenFN_Test_Flow', { query: { Status: 'Active' } });

    Example: Make a GET request then map the response

    get('/jobs/query/v1/jobs/001XXXXXXXXXXXXXXX/results', (state) => {
    // Mapping the response
    state.mapping = state.data.map(d => ({ name: d.name, id: d.extId }));
    return state;
    });

    insert

    insert(sObjectName, records) ⇒ Operation

    Alias for "create(sObjectName, records)".

    ParamTypeDescription
    sObjectNamestringAPI name of the sObject.
    recordsObject | Array.<Object>Field attributes for the new record, or an array of field attributes.

    This operation writes the following keys to state:

    State KeyDescription
    dataAPI response data. Can be either an object or array of objects
    referencesHistory of all previous states

    Example: Single record creation

    insert("Account", { Name: "My Account #1" });

    Example: Multiple records creation

    insert("Account",[{ Name: "My Account #1" }, { Name: "My Account #2" }]);

    Example: Using a state variable

    fn((state) => {
    state.data = [{ Name: "My Account #1" }, { Name: "My Account #2" }];
    return state;
    });
    insert("Account", $.data);

    post

    post(path, data, [options]) ⇒ Operation

    Send a POST request to salesforce server configured in state.configuration.

    ParamTypeDescription
    pathstringThe Salesforce API endpoint.
    dataobjectA JSON Object request body.
    [options]SimpleRequestOptionsConfigure headers and query parameters for the request.

    This operation writes the following keys to state:

    State KeyDescription
    dataAPI response data. Can be either an object or array of objects
    referencesHistory of all previous states

    Example: Make a POST request to a custom Salesforce flow

    post("/actions/custom/flow/POC_OpenFN_Test_Flow", {
    body: {
    inputs: [
    {
    CommentCount: 6,
    FeedItemId: "0D5D0000000cfMY",
    },
    ],
    },
    });

    query

    query(query, [options]) ⇒ Operation

    Executes an SOQL (Salesforce Object Query Language) query to retrieve records from Salesforce. This operation uses for querying salesforce records using SOQL query and handles pagination. Note that in an event of a query error, error logs will be printed but the operation will not throw the error.

    The Salesforce query API is subject to rate limits, learn more here.

    ParamTypeDescription
    querystring | functionA SOQL query string or a function that returns a query string. Must be less than 4000 characters in WHERE clause
    [options]QueryOptionsOptional configuration for the query operation

    This operation writes the following keys to state:

    State KeyDescription
    dataAPI response data. Can be either an object or array of objects
    referencesHistory of all previous states

    Properties

    NameDescription
    dataArray of result objects of the form { done, totalSize, records }

    Example: Run a query and download all matching records

    query('SELECT Id FROM Patient__c', { autoFetch: true });

    Example: Query patients by Health ID

    query(state => `SELECT Id FROM Patient__c WHERE Health_ID__c = '${state.data.healthId}'`);

    Example: Query patients by Health ID using a lazy state reference

    query(`SELECT Id FROM Patient__c WHERE Health_ID__c = '${$.data.healthId}'`);

    request

    request(path, [options]) ⇒ Operation

    Send a request to salesforce server configured in state.configuration.

    ParamTypeDescription
    pathstringThe Salesforce API endpoint.
    [options]FullRequestOptionsConfigure headers, query and body parameters for the request.

    This operation writes the following keys to state:

    State KeyDescription
    dataAPI response data. Can be either an object or array of objects
    referencesHistory of all previous states

    Example: Make a POST request to a custom Salesforce flow

    request("/actions/custom/flow/POC_OpenFN_Test_Flow", {
    method: "POST",
    json: { inputs: [{}] },
    });

    retrieve

    retrieve(sObjectName, id) ⇒ Operation

    Retrieves a Salesforce sObject(s).

    ParamTypeDescription
    sObjectNamestringThe sObject to retrieve
    idstringThe id of the record

    This operation writes the following keys to state:

    State KeyDescription
    dataAPI response data. Can be either an object or array of objects
    referencesHistory of all previous states

    Example: Retrieve a specific ContentVersion record

    retrieve('ContentVersion', '0684K0000020Au7QAE/VersionData');

    update

    update(sObjectName, records) ⇒ Operation

    Update an sObject record or records. Relationships in the record should be nested and not use dot-notation syntax

    ParamTypeDescription
    sObjectNamestringAPI name of the sObject.
    recordsobject | Array.<object>Field attributes for the new object.

    This operation writes the following keys to state:

    State KeyDescription
    dataSummary of the response from Salesforce
    data.successtrue if Salesforce reports no errors from the operation
    data.completedArray of ids for every successful completion
    data.errorsArray of errors reported by Salesforce
    referencesHistory of all previous states

    Example: Single record update

    update("Account", {
    Id: "0010500000fxbcuAAA",
    Name: "Updated Account #1",
    });

    Example: Multiple records update

    update("Account", [
    { Id: "0010500000fxbcuAAA", Name: "Updated Account #1" },
    { Id: "0010500000fxbcvAAA", Name: "Updated Account #2" },
    ]);

    Example: Update a record with a relationship

    update("Account", {
    Id: "0010500000fxbcuAAA",
    "Project__r": {
    "Metrics_ID__c": "jfh5LAnxu1i4na"
    }
    });

    upsert

    upsert(sObjectName, externalId, records) ⇒ Operation

    Create a new sObject record, or updates it if it already exists. Relationships in the record should be nested and not use dot-notation syntax

    ParamTypeDescription
    sObjectNamestringAPI name of the sObject.
    externalIdstringThe external ID of the sObject.
    recordsObject | Array.<Object>Field attributes for the records to upsert, or an array of field attributes.

    This operation writes the following keys to state:

    State KeyDescription
    dataAPI response data. Can be either an object or array of objects
    referencesHistory of all previous states

    Example: Single record upsert

    upsert("UpsertTable__c", "ExtId__c", { Name: "Record #1", ExtId__c : 'ID-0000001' });

    Example: Multiple record upsert

    upsert("UpsertTable__c", "ExtId__c", [
    { Name: "Record #1", ExtId__c : 'ID-0000001' },
    { Name: "Record #2", ExtId__c : 'ID-0000002' },
    ]);

    Example: Update a record with a relationship

    upsert("UpsertTable__c", {
    Name: "Record #1",
    "Project__r": {
    "Metrics_ID__c": "jfh5LAnxu1i4na"
    }
    });

    util

    These functions belong to the util namespace.

    util.toUTF8

    toUTF8(input) ⇒ string

    Transliterates unicode characters to their best ASCII representation

    Returns: string - - ASCII representation of input string

    ParamTypeDescription
    inputstringA string with unicode characters

    Example: Transliterate άνθρωποι to anthropoi

    fn((state) => {
    const s = util.toUTF8("άνθρωποι");
    console.log(s); // anthropoi
    return state;
    });

    Interfaces

    BulkOptions

    Options provided to the Salesforce bulk API request

    Properties

    NameTypeDefaultDescription
    extIdFieldstringExternal id field. Required for upsert.
    [allowNoOp]booleanfalseSkipping bulk operation if no records.
    [failOnError]booleanfalseFail the operation on error.
    [pollTimeout]integer240000Polling timeout in milliseconds.
    [pollInterval]integer6000Polling interval in milliseconds.

    BulkQueryOptions

    Options provided to the Salesforce bulk query API request

    Properties

    NameTypeDefaultDescription
    [pollTimeout]integer90000Polling timeout in milliseconds.
    [pollInterval]integer3000Polling interval in milliseconds.

    FullRequestOptions

    Options provided to the Salesforce HTTP request

    Properties

    NameTypeDefaultDescription
    [method]string"GET"HTTP method to use.
    headersobjectObject of request headers.
    queryobjectObject request query.
    jsonobjectObject request body.
    bodystringA string request body.

    QueryOptions

    Properties

    NameTypeDefaultDescription
    [autoFetch]booleanfalseWhen true, automatically fetches next batch of records if available.

    SalesforceResultState

    State object

    Properties

    NameDescription
    dataSummary of the response from Salesforce
    data.successtrue if Salesforce reports no errors from the operation
    data.completedArray of ids for every successful completion
    data.errorsArray of errors reported by Salesforce
    referencesHistory of all previous states

    SalesforceState

    State object

    Properties

    NameDescription
    dataAPI response data. Can be either an object or array of objects
    referencesHistory of all previous states

    SimpleRequestOptions

    Properties

    NameTypeDescription
    headersobjectObject of request headers.
    queryobjectObject of request query.

    - + \ No newline at end of file diff --git a/adaptors/packages/salesforce-readme.html b/adaptors/packages/salesforce-readme.html index ef464d5cbaf5..15ca652dbfe6 100644 --- a/adaptors/packages/salesforce-readme.html +++ b/adaptors/packages/salesforce-readme.html @@ -17,7 +17,7 @@ - + @@ -36,7 +36,7 @@ credentials or runtime environment.

    It's the responsibility of the build process to provide a wrapper that will inject the functions in.

    For example:

    describe('vera__Test_Event__c'),
    create('vera__Test_Event__c', {
    vera__Test_Event_Name_Unique__c: 'hello from jsforce',
    }),
    create('vera__Boat__c', {
    Name: 'Catatafish redux!',
    vera__Test_Event__c: reference(0),
    });

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    ## Other

    Create SOAP session

    curl https://test.salesforce.com/services/Soap/u/47.0 -H "Content-Type: text/xml; charset=UTF-8" -H "SOAPAction: login" -d @tmp/login.txt | xmllint --format -

    Close jobs

    curl
    https://openfn.my.salesforce.com/services/async/47.0/job/some_id -H 'X-SFDC-Session: abc123sessionID456xyz' -H "Content-Type: application/xml; charset=UTF-8" -d @tmp/close_job.txt | xmllint --format -
    - + \ No newline at end of file diff --git a/adaptors/packages/satusehat-changelog.html b/adaptors/packages/satusehat-changelog.html index 2c89d6a77f02..cf30cc4cf6ab 100644 --- a/adaptors/packages/satusehat-changelog.html +++ b/adaptors/packages/satusehat-changelog.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Changelog for the satusehat adaptor

    @openfn/language-satusehat

    2.0.9

    Patch Changes

    • Updated dependencies [b3d7f59]
    • Updated dependencies [2d709ff]
    • Updated dependencies [41e8cc3]

    2.0.8

    Patch Changes

    2.0.7

    Patch Changes

    2.0.6

    Patch Changes

    • 7c528d3: Update docs with examples

    2.0.5

    Patch Changes

    2.0.4

    Patch Changes

    2.0.3

    Patch Changes

    2.0.2

    Patch Changes

    2.0.1

    Patch Changes

    2.0.0

    Major Changes

    • Export new common http helpers (http namespace)

    1.1.4

    Patch Changes

    • f51c5d0: Enforce that absolute urls must not be passed to HTTP functions
    • Updated dependencies [4fe527c]

    1.1.3

    Patch Changes

    • 73d0a02: Make documentation public
    • Updated dependencies [4c08444]
    • Updated dependencies [73d0a02]

    1.1.2

    Patch Changes

    • 218a582: Added extra logging around errors

    1.1.1

    Patch Changes

    1.1.0

    Minor Changes

    • 73433c20: Add fnIf operation

    Patch Changes

    1.0.1

    Patch Changes

    1.0.0

    Initial release.

    - + \ No newline at end of file diff --git a/adaptors/packages/satusehat-configuration-schema.html b/adaptors/packages/satusehat-configuration-schema.html index 6242f755efac..079582a9f208 100644 --- a/adaptors/packages/satusehat-configuration-schema.html +++ b/adaptors/packages/satusehat-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "baseUrl": "https://www.satusehat.com",
    "clientId": "the-long-uuid-provided-by-satusehat-for-your-organization",
    "clientSecret": "the-long-secret-key-provided-by-satusehat"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "baseUrl": {
    "title": "Base URL",
    "type": "string",
    "description": "Satusehat base URL",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://www.satusehat.com"
    ]
    },
    "clientId": {
    "title": "Client Id",
    "type": "string",
    "minLength": 1,
    "description": "Your Satusehat client id",
    "examples": [
    "the-long-uuid-provided-by-satusehat-for-your-organization"
    ]
    },
    "clientSecret": {
    "title": "Client Secret",
    "type": "string",
    "description": "Client Secret",
    "minLength": 1,
    "examples": [
    "the-long-secret-key-provided-by-satusehat"
    ]
    },
    "access_token": {
    "title": "Access Token",
    "type": "string",
    "description": "Your Satusehat access token",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "the-long-access-token-from-your-auth"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "baseUrl",
    "clientId",
    "clientSecret"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/satusehat-docs.html b/adaptors/packages/satusehat-docs.html index 86711b194d1b..4ea3494c2eaa 100644 --- a/adaptors/packages/satusehat-docs.html +++ b/adaptors/packages/satusehat-docs.html @@ -17,7 +17,7 @@ - + @@ -32,7 +32,7 @@ You can pass Satusehat body data as a JSON FHIR object.

    ParamTypeDescription
    pathstringPath to resource
    dataobjectJSON FHIR object to create a resource
    paramsObjectOptional object of query parameters to include in the request
    [callback]functionOptional callback to handle the response

    This operation writes the following keys to state:

    State KeyDescription
    dataThe response body (as JSON)
    responseThe HTTP response from the Satusehat server (excluding the body)
    referencesAn array of all previous data objects used in the Job

    Example: Create an encounter resource. Equivalent to POST <baseUrl>/Encounter

    post('Encounter', { resourceType: 'Encounter', ...state.data });

    put

    put(path, data, params, [callback]) ⇒ Operation

    Make a PUT request to Satusehat. Use this to directly update resources on Satusehat REST API. You can pass Satusehat body data as a JSON FHIR object. You can also pass Satusehat query parameters as an object of key value pairs, which will map to parameters in the URL.

    ParamTypeDescription
    pathstringPath to resource and exact item to be updated
    dataobjectJSON FHIR object to update the resource
    paramsObjectOptional object of query parameters to include in the request
    [callback]functionOptional callback to handle the response

    This operation writes the following keys to state:

    State KeyDescription
    dataThe response body (as JSON)
    responseThe HTTP response from the Satusehat server (excluding the body)
    referencesAn array of all previous data objects used in the Job

    Example: Update a resource. Equivalent to PUT <baseurl>/Organization/abcde

    put('Organization/abcde', { resourceType: 'Organization', active: false });

    Interfaces

    SatusehatHttpState

    State object

    Properties

    NameDescription
    dataThe response body (as JSON)
    responseThe HTTP response from the Satusehat server (excluding the body)
    referencesAn array of all previous data objects used in the Job

    - + \ No newline at end of file diff --git a/adaptors/packages/satusehat-readme.html b/adaptors/packages/satusehat-readme.html index 45d19c6271ea..c66bd27f1821 100644 --- a/adaptors/packages/satusehat-readme.html +++ b/adaptors/packages/satusehat-readme.html @@ -17,7 +17,7 @@ - + @@ -29,7 +29,7 @@ configuration-schema for required and optional configuration properties.

    A example expression using the post function

    post('Organization', {  "resourceType": "Organization" });

    Development

    Clone the adaptors monorepo. Follow the "Getting Started" guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To build only the docs run pnpm build docs.

    - + \ No newline at end of file diff --git a/adaptors/packages/sftp-changelog.html b/adaptors/packages/sftp-changelog.html index b4fe7c40a6bd..84fec1d2d7b6 100644 --- a/adaptors/packages/sftp-changelog.html +++ b/adaptors/packages/sftp-changelog.html @@ -17,7 +17,7 @@ - + @@ -29,7 +29,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    0.7.3

    Patch Changes

    0.7.2

    Patch Changes

    0.7.1

    Patch Changes

    0.7.0

    Minor Changes

    0.6.9

    Patch Changes

    0.6.8

    Patch Changes

    0.6.7

    Patch Changes

    0.6.6

    Patch Changes

    0.6.5

    Patch Changes

    0.6.4

    Patch Changes

    0.6.3

    Patch Changes

    0.6.2

    Patch Changes

    0.6.1

    Patch Changes

    0.6.0

    Minor Changes

    0.5.0

    Minor Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/sftp-configuration-schema.html b/adaptors/packages/sftp-configuration-schema.html index 0eab518cd9b8..259d5dfc7046 100644 --- a/adaptors/packages/sftp-configuration-schema.html +++ b/adaptors/packages/sftp-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "host": "191.173.128.88"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "host": {
    "title": "Host URL",
    "type": "string",
    "description": "The SFTP server host url or ip address",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "191.173.128.88"
    ]
    },
    "port": {
    "title": "Port",
    "type": "integer",
    "default": 21,
    "description": "The SFTP server port",
    "minLength": 1,
    "examples": [
    22
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "Username",
    "minLength": 1,
    "examples": [
    "admin"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Password",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@some(!)Strongpassword"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "host"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/sftp-docs.html b/adaptors/packages/sftp-docs.html index 36eec2b3cbe6..50a2fdd00836 100644 --- a/adaptors/packages/sftp-docs.html +++ b/adaptors/packages/sftp-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    sftp@2.0.8

    getCSV(filePath, [parsingOptions])
    getJSON(filePath, encoding)
    list(dirPath, filter, [callback])
    normalizeCSVarray(options, callback)
    putCSV(localFilePath, remoteFilePath, parsingOptions)

    This adaptor exports the following from common:

    alterState()
    chunk()
    dataPath()
    dataValue()
    each()
    field()
    fields()
    fn()
    fnIf()
    http
    lastReferenceValue()
    merge()
    parseCsv()
    sourceValue()

    Functions

    getCSV

    getCSV(filePath, [parsingOptions]) ⇒ Operation

    Get a CSV and return a JSON array of strings for each item separated by the delimiter

    ParamTypeDescription
    filePathstringPath to resource
    [parsingOptions]ObjectOptional. parsingOptions Parsing options which can be passed to convert csv to json See more on csvtojson docs

    Example

    getCSV(
    '/some/path/to_file.csv',
    {delimiter: ";", flatKeys: true }
    );

    getJSON

    getJSON(filePath, encoding) ⇒ Operation

    Fetch a json file from an FTP server

    ParamTypeDescription
    filePathstringPath to resource
    encodingstringCharacter encoding for the json

    Example

    getJSON(
    '/path/To/File',
    'utf8',
    );

    list

    list(dirPath, filter, [callback]) ⇒ Operation

    List files present in a directory

    ParamTypeDescription
    dirPathstringPath to remote directory
    filterfunctiona filter function used to select return entries
    [callback]functionOptional callback to handle the response

    Example: basic files listing

    list('/some/path/')

    Example: list files with filters

    list('/some/path/', file=> {
    return /foo.\.txt/.test(file.name);
    })

    Example: list files with filters and use callback

    list(
    "/some/path/",
    (file) => /foo.\.txt/.test(file.name),
    (state) => {
    const latestFile = state.data.filter(
    (file) => file.modifyTime <= new Date()
    );
    return { ...state, latestFile };
    }
    );

    normalizeCSVarray

    normalizeCSVarray(options, callback) ⇒ Operation

    Convert JSON array of strings into a normalized object

    ParamTypeDescription
    optionsoptionsOptions passed to csvtojson parser
    callbackcallbackOptions passed to csvtojson parser

    Example

    normalizeCSVarray({ delimiter: ';', noheader: true });

    putCSV

    putCSV(localFilePath, remoteFilePath, parsingOptions) ⇒ Operation

    Convert JSON to CSV and upload to an FTP server

    ParamTypeDescription
    localFilePathstringData source for data to copy to the remote server.
    remoteFilePathstringPath to the remote file to be created on the server.
    parsingOptionsobjectOptions which can be passed to adjust the read and write stream used in sending the data to the remote server

    Example

    putCSV(
    '/some/path/to_local_file.csv',
    '/some/path/to_remove_file.csv',
    { delimiter: ';', noheader: true }
    );

    - + \ No newline at end of file diff --git a/adaptors/packages/sftp-readme.html b/adaptors/packages/sftp-readme.html index 5f09fdc54832..c5b519026275 100644 --- a/adaptors/packages/sftp-readme.html +++ b/adaptors/packages/sftp-readme.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ definition.

    List the content of a directory

    alterState(state => {
    return list('/path/To/Directory')(state).then(response => {
    console.log(`There are ${response.data.length} files.`);
    return response;
    });
    });

    sample getCSV expression

    getCSV('path/to/file.csv', 'utf8', {
    quote: 'off',
    delimiter: ';',
    noheader: true,
    filter: {
    type: 'startsWith',
    key: 'field1',
    value: 'JO',
    },
    });

    A more complex example that breaks up the CSV file into multiple payloads for quicker processing.

    fn(state => {
    return list('/')(state).then(state => {
    const targetNames = [
    'exportContacts', //example fileName
    ];
    console.log(`Fetching files: ${targetNames}`);
    const files = state.data
    .filter(file => file.name.split('.')[1] === 'csv')
    .filter(file =>
    targetNames.some(targetName =>
    file.name.toLowerCase().includes(targetName)
    )
    );

    if (files.length === 0) console.log('No new CSV files found.');
    return { ...state, data: {}, files };
    });
    });

    each(
    '$.files[*]',
    fn(state => {
    const { configuration, data } = state;

    return getCSV(`/${data.name}`)(state).then(async state => {
    const headers = state.data
    .shift()
    .split(';')
    .map(h => (h = h.replace(/"/g, '')));

    function toObject(item) {
    const values = item.split(';');

    return Object.fromEntries(
    headers.map((k, i) => {
    return values[i]
    ? [k, values[i].replace(/"/g, '')]
    : [k, values[i]];
    })
    );
    }

    let countInbox = 0;

    //to post CSV data as individual Messages to OpenFn Inbox
    const postToInbox = async data => {
    countInbox++;

    console.log(`Sending request ${countInbox} to inbox`);

    await new Promise(resolve => setTimeout(resolve, 200));

    await http.post({
    url: configuration.openfnInboxUrl,
    data: data,
    maxContentLength: Infinity,
    maxBodyLength: Infinity,
    })(state);
    };

    //To split up into multiple, smaller payloads before send to OpenFn Inbox
    const chunkSize = 500;

    console.log(
    state.data.length,
    'rows will be sent in',
    Math.ceil(state.data.length / chunkSize),
    'requests of',
    chunkSize,
    'rows each.'
    );

    while (state.data.length > 0) {
    console.log('data.length', state.data.length);
    await postToInbox({
    fileName: data.name,
    fileType: data.name.split('-')[0],
    uploadDate: new Date(data.modifyTime).toISOString(),
    json: state.data.splice(0, chunkSize).map(toObject),
    });
    }

    return { configuration, references: [], data: {} };
    });
    })
    );

    sample putCSV expression

    This function converts JSON to CSV and post to a server

    putCSV('/some/path/to_file.csv', 'utf8', { delimiter: ';', noheader: true });

    Get JSON from FTP server

    getJSON('path/to/file.json', 'utf8');

    Custom request to an http endpoint

    This adaptor exports http from language-common. Here, we outline the usage in order to make custom requests to an endpoint. It returns a promise

    alterState(state => {
    return http
    .post({ url: 'yourURL', data: { name: 'Mamadou' } })(state)
    .then(response => {
    // do something with response;
    return response;
    });
    });

    Development

    Clone the repo, run pnpm install.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To build the docs for this repo, pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/surveycto-changelog.html b/adaptors/packages/surveycto-changelog.html index 4ac39657446c..343efc85d8dc 100644 --- a/adaptors/packages/surveycto-changelog.html +++ b/adaptors/packages/surveycto-changelog.html @@ -17,7 +17,7 @@ - + @@ -33,7 +33,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    1.1.4

    Patch Changes

    1.1.3

    Patch Changes

    1.1.2

    Patch Changes

    1.1.1

    Patch Changes

    1.1.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/surveycto-configuration-schema.html b/adaptors/packages/surveycto-configuration-schema.html index 27496a690b0f..d544a60dd846 100644 --- a/adaptors/packages/surveycto-configuration-schema.html +++ b/adaptors/packages/surveycto-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "servername": "openfn_test",
    "username": "someusername",
    "password": "@some(%)!Password"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "servername": {
    "title": "Server Name",
    "type": "string",
    "description": "Your Surveycto server name also known as instance name",
    "minLength": 1,
    "examples": [
    "openfn_test"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "Your Surveycto server username",
    "minLength": 1,
    "examples": [
    "someusername"
    ]
    },
    "password": {
    "title": "Password",
    "type": "string",
    "description": "Your Surveycto server password",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@some(%)!Password"
    ]
    },
    "apiVersion": {
    "title": "API Version",
    "type": "string",
    "description": "The API version",
    "default": "v1",
    "examples": [
    "v1",
    "v2"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "servername",
    "username",
    "password"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/surveycto-docs.html b/adaptors/packages/surveycto-docs.html index 44516e3ded57..0db9a22344c0 100644 --- a/adaptors/packages/surveycto-docs.html +++ b/adaptors/packages/surveycto-docs.html @@ -17,7 +17,7 @@ - + @@ -28,7 +28,7 @@ This supports natural language dates like now, today, yesterday, n hours ago, n days ago, and start, which will be converted into timestamp strings. See the usage guide at https://docs.openfn.org/documentation/jobs/job-writing-guide#using-cursors

    ParamTypeDescription
    valueanythe cursor value. Usually an ISO date, natural language date, or page number
    optionsobjectoptions to control the cursor.
    options.keystringset the cursor key. Will persist through the whole run.
    options.defaultValueanythe value to use if value is falsy
    options.formatfunctioncustom formatter for the final cursor value

    Example: Use a cursor from state if present, or else use the default value

    cursor('today')
    fetchSubmissions('test', { date: $.cursor });

    fetchSubmissions

    fetchSubmissions(formId, options, callback) ⇒ Operation

    Fetch form submissions.

    If a date filter is provided, it will be converted internally to the surveyCTO MMM dd, yyy h:mm:ss format (in UTC time).

    ParamTypeDescription
    formIdstringForm id
    optionsFetchSubmissionOptionsForm submission date, format, status parameters
    callbackfunction(Optional) Callback function

    Example: Fetch all form submissions

    fetchSubmissions('test');

    Example: With SurveyCTO date format (UTC)

    fetchSubmissions('test', { date: 'Apr 18, 2024 6:26:21 AM' });

    Example: Using a rolling cursor

    cursor((state) => state.cursor, { defaultValue: 'today' });
    fetchSubmissions('test', { date: (state) => state.cursor, format: 'csv' });
    cursor('now');

    Example: Formatting the results to CSV String

    fetchSubmissions('test', { format: 'csv' });

    Example: With reviewStatus filter

    fetchSubmissions('test', { status: 'approved|rejected' });

    Example: With a callback function

    fetchSubmissions(
    'test',
    {
    date: 'Apr 18, 2024 6:26:21 AM',
    },
    state => {
    console.log('Hello from the callback!');
    return state;
    }
    );

    request

    request(path, params, callback) ⇒ Operation

    Make a request in SurveyCTO API

    ParamTypeDescription
    pathstringPath to resource
    paramsRequestOptionsQuery, body and method parameters
    callbackfunction(Optional) Callback function

    Example

    request("/anEndpoint", {
    method: "POST",
    query: { foo: "bar", a: 1 },
    });

    Interfaces

    FetchSubmissionOptions

    Options provided to fetchSubmissions()

    Properties

    NameTypeDefaultDescription
    [date]string0Fetch only submissions from this timestamp. Acccepts SuvreyCTO date strings, unix and epoch timestamps, and ISO dates. By default, all submissions will be retrieved.
    [format]string"json"Format the submission data type as csv or json.
    [status]stringReview status. Can be either, approved, rejected, pending or combine eg `approved

    RequestOptions

    Options provided to request()

    Properties

    NameTypeDefaultDescription
    [headers]objectAn object of headers parameters.
    [body]objectBody data to append to the request.
    [query]objectAn object of query parameters to be encoded into the URL.
    [method]string"GET"The HTTP method to use.

    - + \ No newline at end of file diff --git a/adaptors/packages/surveycto-readme.html b/adaptors/packages/surveycto-readme.html index 4564546204a8..eed4c4eac2b7 100644 --- a/adaptors/packages/surveycto-readme.html +++ b/adaptors/packages/surveycto-readme.html @@ -17,7 +17,7 @@ - + @@ -33,7 +33,7 @@ the job, subsequent runs will only fetch NEW submissions.

  • the postUrl is where the wide-format JSON representation of each form submission should be sent. Note that a formId key will be added to each form submission for later filtering/routing.

  • sample fetchSubmissions expression

    fetchSubmissions(
    // formId on SurveyCTO server
    'household_survey',
    // initialAfterDate: this will only be accessed if "lastSubmissionDate" is empty in your job_state".
    // After the initial run of the job, OpenFn will only pull new submissions from SurveyCTO.
    'Aug 29, 2016 4:44:26 PM',
    // postUrl is where you want to send the JSON submissions, appended with a new "formId" key
    'https://www.openfn.org/inbox/secret-inbox-uuid'
    );

    Development

    Clone the repo, run npm install.

    Run tests using npm run test or npm run test:watch

    Build the project using make.

    - + \ No newline at end of file diff --git a/adaptors/packages/telerivet-changelog.html b/adaptors/packages/telerivet-changelog.html index 4febb6786273..b13b597eefa1 100644 --- a/adaptors/packages/telerivet-changelog.html +++ b/adaptors/packages/telerivet-changelog.html @@ -17,7 +17,7 @@ - + @@ -29,7 +29,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    0.1.4

    Patch Changes

    0.1.3

    Patch Changes

    0.1.2

    Patch Changes

    0.1.1

    Patch Changes

    0.1.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/telerivet-configuration-schema.html b/adaptors/packages/telerivet-configuration-schema.html index bcf5b91ad164..e02f86f2f380 100644 --- a/adaptors/packages/telerivet-configuration-schema.html +++ b/adaptors/packages/telerivet-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "projectId": "telerivet_project_id",
    "apiKey": "telerivet_api_key"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "projectId": {
    "title": "Project ID",
    "type": "string",
    "description": "Your Telerivet project id",
    "minLength": 1,
    "examples": [
    "telerivet_project_id"
    ]
    },
    "apiKey": {
    "title": "API Key",
    "type": "string",
    "description": "Your Telerivet API Key",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "telerivet_api_key"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "projectId",
    "apiKey"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/telerivet-docs.html b/adaptors/packages/telerivet-docs.html index 0911f9cb4fce..77510669ccf0 100644 --- a/adaptors/packages/telerivet-docs.html +++ b/adaptors/packages/telerivet-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/telerivet-readme.html b/adaptors/packages/telerivet-readme.html index 44960792eea3..adf39c403965 100644 --- a/adaptors/packages/telerivet-readme.html +++ b/adaptors/packages/telerivet-readme.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ configuration-schema definition.

    Send message

    Current send expression:

    send(
    fields(
    field('to_number', dataValue('recipient_number')),
    field('content', dataValue('recipient_text')),
    // Lots of optional parameters...
    field('message_type', 'sms'),
    field('route_id', dataValue('some_route'))
    )
    );

    sendBulk messages - WIP

    Current sendBulk expression:

    send(fields(
    field("content", dataValue("recipient_text")),
    field("to_numbers", [
    "+14155550123",
    "+14255550234",
    "+16505550345"
    ]
    // Lots of optional parameters...
    field("message_type", "sms"),
    field("route_id", dataValue("some_route"))
    ))

    Note that "recipient_text" may be a concatenation like this:

    field('content', function (state) {
    return dataValue('salutation')(state).concat(
    '. ',
    dataValue('last_name')(state),
    ', )'
    );
    });

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/testing-changelog.html b/adaptors/packages/testing-changelog.html index d0d99e8a0812..8fa4974c71c5 100644 --- a/adaptors/packages/testing-changelog.html +++ b/adaptors/packages/testing-changelog.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    Changelog for the testing adaptor

    @openfn/language-testing

    1.0.10

    Patch Changes

    • Updated dependencies [b3d7f59]
    • Updated dependencies [2d709ff]
    • Updated dependencies [41e8cc3]

    1.0.9

    Patch Changes

    1.0.8

    Patch Changes

    1.0.7

    Patch Changes

    1.0.6

    Patch Changes

    1.0.5

    Patch Changes

    1.0.4

    Patch Changes

    1.0.3

    Patch Changes

    1.0.2

    Patch Changes

    1.0.1

    Patch Changes

    .

    - + \ No newline at end of file diff --git a/adaptors/packages/testing-configuration-schema.html b/adaptors/packages/testing-configuration-schema.html index 7b3cdd3d5942..7bb2b18a1fe6 100644 --- a/adaptors/packages/testing-configuration-schema.html +++ b/adaptors/packages/testing-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {}

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {},
    "type": "object",
    "additionalProperties": true,
    "required": []
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/testing-docs.html b/adaptors/packages/testing-docs.html index abc27d0b4fc5..3df7eaacf8fd 100644 --- a/adaptors/packages/testing-docs.html +++ b/adaptors/packages/testing-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/testing-readme.html b/adaptors/packages/testing-readme.html index 124b30ee2fbd..7a62fe811b36 100644 --- a/adaptors/packages/testing-readme.html +++ b/adaptors/packages/testing-readme.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/twilio-changelog.html b/adaptors/packages/twilio-changelog.html index 54960cbf5db6..c417196cfc55 100644 --- a/adaptors/packages/twilio-changelog.html +++ b/adaptors/packages/twilio-changelog.html @@ -17,7 +17,7 @@ - + @@ -29,7 +29,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    0.3.4

    Patch Changes

    0.3.3

    Patch Changes

    0.3.2

    Patch Changes

    0.3.1

    Patch Changes

    0.3.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/twilio-configuration-schema.html b/adaptors/packages/twilio-configuration-schema.html index 6909d9ea6396..920a484f7d88 100644 --- a/adaptors/packages/twilio-configuration-schema.html +++ b/adaptors/packages/twilio-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "accountSid": "account_id",
    "authToken": "evenMoreSecret"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "accountSid": {
    "title": "Account ID",
    "type": "string",
    "description": "Your Twilio account id",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "account_id"
    ]
    },
    "authToken": {
    "title": "Auth Token",
    "type": "string",
    "description": "Your Twilio auth token",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "evenMoreSecret"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "accountSid",
    "authToken"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/twilio-docs.html b/adaptors/packages/twilio-docs.html index 6cd37b7093f3..219a6ed46c6f 100644 --- a/adaptors/packages/twilio-docs.html +++ b/adaptors/packages/twilio-docs.html @@ -17,15 +17,15 @@ - +
    -
    Skip to main content
    - +
    Skip to main content
    + \ No newline at end of file diff --git a/adaptors/packages/twilio-readme.html b/adaptors/packages/twilio-readme.html index 14070781d433..8102d0d9ca3c 100644 --- a/adaptors/packages/twilio-readme.html +++ b/adaptors/packages/twilio-readme.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ configuration-schema definition.

    sendSMS

    sample expression, sending an sms

    sendSMS({
    body: dataValue('text'),
    from: '+15005550006',
    to: dataValue('recipient'),
    });

    local usage

    ~/devtools/core/bin/core execute \
    -l ~/devtools/adaptors/language-twilio \
    -s ./tmp/state.json \
    -o ./tmp/output.json \
    -e ./tmp/expression.js

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/vtiger-changelog.html b/adaptors/packages/vtiger-changelog.html index aadc84624a48..4cc3b67ed60e 100644 --- a/adaptors/packages/vtiger-changelog.html +++ b/adaptors/packages/vtiger-changelog.html @@ -17,7 +17,7 @@ - + @@ -29,7 +29,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    1.1.3

    Patch Changes

    1.1.2

    Patch Changes

    1.1.1

    Patch Changes

    1.1.0

    Minor Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/vtiger-configuration-schema.html b/adaptors/packages/vtiger-configuration-schema.html index a92f856b3edf..9ef091a46471 100644 --- a/adaptors/packages/vtiger-configuration-schema.html +++ b/adaptors/packages/vtiger-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "hostUrl": "https://openfunction.od2.vtiger.com",
    "username": "test@openfn.org",
    "accessToken": "@some()!veryHugeToke"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "hostUrl": {
    "title": "Host URL",
    "type": "string",
    "description": "VTiger instance host URL",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://openfunction.od2.vtiger.com"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "VTiger instance username",
    "minLength": 1,
    "examples": [
    "test@openfn.org"
    ]
    },
    "accessToken": {
    "title": "Access Token",
    "type": "string",
    "description": "VTiger instance access token",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "@some()!veryHugeToke"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "hostUrl",
    "username",
    "accessToken"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/vtiger-docs.html b/adaptors/packages/vtiger-docs.html index 1b0b39d9b10e..ea7585500b0e 100644 --- a/adaptors/packages/vtiger-docs.html +++ b/adaptors/packages/vtiger-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/vtiger-readme.html b/adaptors/packages/vtiger-readme.html index 72de9ca910f6..02e814a80708 100644 --- a/adaptors/packages/vtiger-readme.html +++ b/adaptors/packages/vtiger-readme.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ configuration-schema definition.

    sample listTypes expression

    listTypes();

    sample postElement expression

    postElement({
    operation: "create"
    elementType: "leads",
    element: {
    "name": dataValue("name")(state),
    "surname": dataValue("surname")(state),
    "email": dataValue("email")(state)
    }
    });


    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/packages/wigal-sms-changelog.html b/adaptors/packages/wigal-sms-changelog.html index b569eba37e41..ae4501fcef67 100644 --- a/adaptors/packages/wigal-sms-changelog.html +++ b/adaptors/packages/wigal-sms-changelog.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/wigal-sms-configuration-schema.html b/adaptors/packages/wigal-sms-configuration-schema.html index a4f483a7d3ec..2a1a6dcef41f 100644 --- a/adaptors/packages/wigal-sms-configuration-schema.html +++ b/adaptors/packages/wigal-sms-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "apiKey": "@some(!)apikey",
    "username": "test@openfn.org"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "baseUrl": {
    "title": "Base URL",
    "anyOf": [
    {
    "type": "string"
    },
    {
    "type": "null"
    }
    ],
    "description": "The base URL (https://frogapi.wigal.com.gh)",
    "format": "uri",
    "minLength": 1,
    "examples": [
    "https://frogapi.wigal.com.gh"
    ]
    },
    "username": {
    "title": "Username",
    "type": "string",
    "description": "Username",
    "examples": [
    "test@openfn.org"
    ]
    },
    "apiKey": {
    "title": "API-KEY",
    "type": "string",
    "description": "API-KEY",
    "writeOnly": true,
    "examples": [
    "@some(!)apikey"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "apiKey",
    "username"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/wigal-sms-docs.html b/adaptors/packages/wigal-sms-docs.html index 4f5ad7840325..de908e11acff 100644 --- a/adaptors/packages/wigal-sms-docs.html +++ b/adaptors/packages/wigal-sms-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    wigal-sms@0.1.3

    sendSms(data)

    This adaptor exports the following from common:

    cursor()
    dataPath()
    dataValue()
    dateFns
    each()
    field()
    fields()
    fn()
    fnIf()
    lastReferenceValue()
    merge()
    sourceValue()

    Functions

    sendSms

    sendSms(data) ⇒ Operation

    Send SMS using Wigal SMS Gateway API

    ParamTypeDescription
    dataSMSRequestObjectSMS payload to push to Wigal. This includes the message, phone number, etc

    This operation writes the following keys to state:

    State KeyDescription
    datathe parsed response body. containt status and message response
    responsethe response from the Wigal SMS server, including headers, statusCode etc
    referencesan array of all previous data objects used in the Job

    Example: Send General SMS message

    sendSms({
    senderid: "Stevkky",
    destinations: [{ destination: "0552825710" }],
    message: "This is a sample message for SMS sending via Wigal FROG API.",
    smstype: "text",
    });

    Example: Send Personalized SMS message

    sendSms({
    senderid: "Stevkky",
    destinations: [
    {
    destination: "0542709440",
    message: "Hello Joe your order is ready",
    msgid: "MGS1010101",
    smstype: "text",
    },
    ],
    });

    Interfaces

    SendSMSState

    State object

    Properties

    NameDescription
    datathe parsed response body. containt status and message response
    responsethe response from the Wigal SMS server, including headers, statusCode etc
    referencesan array of all previous data objects used in the Job

    SMSRequestObject

    SMS Request Object

    Properties

    NameTypeDescription
    senderidstringThe senderID used for sending message. Approved SenderIDs only
    destinationsarrayAn array of objects containing the destination phone number and message to be sent
    messagestringThe message to be sent to the destinations
    smstypestringThe type of message to be sent. Default is 'text'

    - + \ No newline at end of file diff --git a/adaptors/packages/wigal-sms-readme.html b/adaptors/packages/wigal-sms-readme.html index 3756c6043807..606786445b86 100644 --- a/adaptors/packages/wigal-sms-readme.html +++ b/adaptors/packages/wigal-sms-readme.html @@ -17,7 +17,7 @@ - + @@ -31,7 +31,7 @@ configuration-schema for required and optional configuration properties.

    Development

    Clone the adaptors monorepo. Follow the "Getting Started" guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To build only the docs run pnpm build docs.


    - + \ No newline at end of file diff --git a/adaptors/packages/zoho-changelog.html b/adaptors/packages/zoho-changelog.html index aba622a6637c..411a0dd58615 100644 --- a/adaptors/packages/zoho-changelog.html +++ b/adaptors/packages/zoho-changelog.html @@ -17,7 +17,7 @@ - + @@ -29,7 +29,7 @@ expected inside each blocks. Users were previously wrapping these functions inside their own custom fn blocks, and this change will ensure that they can be used inside a standard each.

    See https://github.com/OpenFn/adaptors/issues/275 for more details.

    Patch Changes

    0.2.3

    Patch Changes

    0.2.2

    Patch Changes

    0.2.1

    Patch Changes

    0.2.0

    Minor Changes

    Patch Changes

    - + \ No newline at end of file diff --git a/adaptors/packages/zoho-configuration-schema.html b/adaptors/packages/zoho-configuration-schema.html index 64d2a15576dc..3b5e14c06bcc 100644 --- a/adaptors/packages/zoho-configuration-schema.html +++ b/adaptors/packages/zoho-configuration-schema.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ sample below.

    Sample Configuration

    Paste this into the configuration key of your state.json file and modify the values to run jobs locally.

    {
    "account": "yourzohoaccount",
    "authToken": "secreauthtoken",
    "apiVersion": "v2"
    }

    Full Schema

    The full configuration schema describes each attribute of the credential and notes those that are required.

    {
    "$schema": "http://json-schema.org/draft-07/schema#",
    "properties": {
    "account": {
    "title": "Account",
    "type": "string",
    "description": "Your Zoho account",
    "minLength": 1,
    "examples": [
    "yourzohoaccount"
    ]
    },
    "authToken": {
    "title": "Auth Token",
    "type": "string",
    "description": "Your Zoho authentication token",
    "writeOnly": true,
    "minLength": 1,
    "examples": [
    "secreauthtoken"
    ]
    },
    "apiVersion": {
    "title": "API Version",
    "type": "string",
    "default": "v2",
    "enum": [
    "v1",
    "v2"
    ],
    "description": "Zoho API version",
    "minLength": 1,
    "examples": [
    "v2",
    "v1"
    ]
    }
    },
    "type": "object",
    "additionalProperties": true,
    "required": [
    "account",
    "authToken",
    "apiVersion"
    ]
    }
    - + \ No newline at end of file diff --git a/adaptors/packages/zoho-docs.html b/adaptors/packages/zoho-docs.html index 15b2cc879989..b678445a38ff 100644 --- a/adaptors/packages/zoho-docs.html +++ b/adaptors/packages/zoho-docs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/adaptors/packages/zoho-readme.html b/adaptors/packages/zoho-readme.html index a1988bfd0e96..d92d38695ec6 100644 --- a/adaptors/packages/zoho-readme.html +++ b/adaptors/packages/zoho-readme.html @@ -17,7 +17,7 @@ - + @@ -31,7 +31,7 @@ following addRow function.

    addRow(
    'testing_openfn',
    'Customers',
    fields(field('Subject', dataValue('formId')), field('Status', 'Closed'))
    );

    updateRow

    Coming soon. Want to help? https://zohoreportsapi.wiki.zoho.com/Updating-Data.html

    Development

    Clone the adaptors monorepo. Follow the Getting Started guide inside to get set up.

    Run tests using pnpm run test or pnpm run test:watch

    Build the project using pnpm build.

    To just build the docs run pnpm build docs

    - + \ No newline at end of file diff --git a/adaptors/postgresql.html b/adaptors/postgresql.html index 543dd5e400b8..ca4918db0029 100644 --- a/adaptors/postgresql.html +++ b/adaptors/postgresql.html @@ -17,7 +17,7 @@ - + @@ -54,7 +54,7 @@ PostgreSQL adaptor.

    Implementation Examples

    1. Wildlife Conservation Society Kobo < > Database: https://github.com/OpenFn/consosci
    2. Cambodia Primero < > ONA Database: https://github.com/OpenFn/primero-ona-dashboard
    - + \ No newline at end of file diff --git a/adaptors/powerbi.html b/adaptors/powerbi.html index ed372af3d9f9..cd787152f0ef 100644 --- a/adaptors/powerbi.html +++ b/adaptors/powerbi.html @@ -17,7 +17,7 @@ - + @@ -37,7 +37,7 @@ structured database from it using MySQL. Once the structured database is established, OpenFn assists the iNGO with connecting this data to Power BI.

    Refer to the diagram below for a visualization of the data flow cited in the above use case.

    Tableau Data Flow Visualization

    - + \ No newline at end of file diff --git a/adaptors/primero.html b/adaptors/primero.html index 932324f6d60b..0956d018f6f7 100644 --- a/adaptors/primero.html +++ b/adaptors/primero.html @@ -17,7 +17,7 @@ - + @@ -60,7 +60,7 @@ https://github.com/OpenFn/primero-ona-dashboard/
  • Gambella: UNICEF Primero < > UNHCR Progres: https://github.com/OpenFn/primero-progres
  • Thailand: UNICEF Primero < > MoPH HIS: https://github.com/OpenFn/primero-thailand
  • - + \ No newline at end of file diff --git a/adaptors/rapidpro.html b/adaptors/rapidpro.html index 8230f69c6a84..9fbe186bd51d 100644 --- a/adaptors/rapidpro.html +++ b/adaptors/rapidpro.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    RapidPro Adaptor

    About RapidPro

    RapidPro is an open-source platform for building scalable, automated messaging workflows. It is widely used in development and humanitarian contexts for managing communication via SMS, social media, and other messaging channels.

    Integration Options

    RapidPro supports two primary integration options:

    1. Rest API: RapidPro has an available REST API that enables external services like OpenFn to pull data RapidPro, or push data from external apps to RapidPro. This option suits scheduled, bulk syncs or workflows that must update data in RapidPro with external information. See functions for more on how to use this adaptor to work with the API.

    2. Webhook: RapidPro also has a Webhook or Data Forwarding to push data from Rapidpro to external systems. This option is suited for real-time, event-based data integration. Check out the RapidPro developer documentation to learn how to set up a webhook to push data to OpenFn.

    Authentication

    When integrating with RapidPro via OpenFn, one primary authentication method is supported: Personal Access Token (PAT). See this adaptor's Configuration docs for more on required authentication parameters.

    See platform docs on managing credentials for how to configure a credential in OpenFn. If working locally or if using a Raw JSON credential type, then your configuration will look something like this:

    {
    "host": "https://app.rapidpro.io/",
    "token": "#Super-sSCrecrete-token"
    }
    1. RapidPro API documentation
    2. RapidPro Community

    Implementation Examples

    1. Sample RapidPro -> DHIS2 sync: https://github.com/OpenFn/rapidpro-dhis2
    - + \ No newline at end of file diff --git a/adaptors/salesforce.html b/adaptors/salesforce.html index 03ab679e4bb1..e9d2f81597c8 100644 --- a/adaptors/salesforce.html +++ b/adaptors/salesforce.html @@ -17,7 +17,7 @@ - + @@ -168,7 +168,7 @@ with a range of helper functions for common CRUD & upsert operations, and for accessing the Salesforce bulk API.

    Example Implementations

    - + \ No newline at end of file diff --git a/adaptors/satusehat.html b/adaptors/satusehat.html index 7e867784fa19..3034551e51a0 100644 --- a/adaptors/satusehat.html +++ b/adaptors/satusehat.html @@ -17,7 +17,7 @@ - + @@ -60,7 +60,7 @@ how to configure a credential in OpenFn and see the below Satusehat credential example.

    Satusehat Cred

    If you're using the Raw JSON credential type, your configuration may look like this:

    {
    "clientId": "your-client-id", // e.g 12345678
    "clientSecret": "your-client-secret-key", // e.g abcd123456
    "baseUrl": "your-base-url", // e.g https://api-satusehat-stg.dto.kemkes.go.id
    "accessToken": "your-access-token" // Don't add accessToken if you're using client secret and client id
    }
    - + \ No newline at end of file diff --git a/adaptors/sftp.html b/adaptors/sftp.html index b179e1e4d51a..f582de985dc1 100644 --- a/adaptors/sftp.html +++ b/adaptors/sftp.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content

    SFTP Adaptor

    About SFTP

    SFTP (Secure File Transfer Protocol) is a secure method for transferring files between systems over an encrypted SSH connection. It is widely used for securely uploading, downloading, and managing files on remote servers.

    Using this adaptor, you can read and write files (e.g., csv, xls, json files) saved on a SFTP server.

    Integration Options

    Direct File Transfers: SFTP allows users to manually or programmatically transfer files between a local and remote system. See functions for more on how to use this adaptor to work with an SFTP server.

    Authentication

    When integrating with a SFTP server via OpenFn, you can provide a username and password for an authorized user to authenticate. See this adaptor's Configuration docs for more on the required authentication parameters.

    See platform docs on managing credentials for how to configure a credential in OpenFn. If working locally or if using a Raw JSON credential type, then your configuration will look something like this:

    {
    "host": "191.173.128.88",
    "username": "name",
    "password": "pwd"
    }
    1. Best Practices for SFTP

    Implementation Examples

    1. Women for Women International - SFTP -> Salesforce sync: https://github.com/OpenFn/women-for-women
    - + \ No newline at end of file diff --git a/adaptors/surveycto.html b/adaptors/surveycto.html index 6298b089564b..e53220505b46 100644 --- a/adaptors/surveycto.html +++ b/adaptors/surveycto.html @@ -17,7 +17,7 @@ - + @@ -69,7 +69,7 @@ forms and data from the server. See SurveyCTO docs on managing user roles.

    - + \ No newline at end of file diff --git a/adaptors/tableau.html b/adaptors/tableau.html index 3a5e3cbddbdb..43b73db7fa86 100644 --- a/adaptors/tableau.html +++ b/adaptors/tableau.html @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ structured database from it using MySQL. Once the structured database is established, OpenFn assists the iNGO with connecting this data to Tableau.

    Refer to the diagram below for a visualization of the data flow cited in the above use case.

    Tableau Data Flow Visualization

    - + \ No newline at end of file diff --git a/articles.html b/articles.html index b878da26226f..13c81427d9bb 100644 --- a/articles.html +++ b/articles.html @@ -17,7 +17,7 @@ - + @@ -70,7 +70,7 @@ someone else’s servers (SaaS), or on her organization’s own servers (deployed locally). Before making a decision she outlines the basic, non-technical considerations for both options.

    - + \ No newline at end of file diff --git a/articles/2020/06/16/how-information-is-organized.html b/articles/2020/06/16/how-information-is-organized.html index ac8a2340c269..8218c791bcfa 100644 --- a/articles/2020/06/16/how-information-is-organized.html +++ b/articles/2020/06/16/how-information-is-organized.html @@ -17,7 +17,7 @@ - + @@ -99,7 +99,7 @@ might be better off than those operating a well defined assembly-line with interchangeable parts. Alas, the middle way is probably the best.

    That’s all for now. More soon.

    Need help organizing or scaling your organization's information or process flows? Contact our team of ICT4D specialists at support@openfn.org.

    - + \ No newline at end of file diff --git a/articles/2020/06/24/three-questions-to-ask.html b/articles/2020/06/24/three-questions-to-ask.html index 9cdd65150d85..2bb13ab0a308 100644 --- a/articles/2020/06/24/three-questions-to-ask.html +++ b/articles/2020/06/24/three-questions-to-ask.html @@ -17,7 +17,7 @@ - + @@ -60,7 +60,7 @@ admin@openfn.org for support. Our team is always happy to assist and help you evaluate the total cost of ownership of automation solutions.

    - + \ No newline at end of file diff --git a/articles/2020/07/02/allow-yourself-to-fail.html b/articles/2020/07/02/allow-yourself-to-fail.html index a52e9f3c7b8c..2743e59a8223 100644 --- a/articles/2020/07/02/allow-yourself-to-fail.html +++ b/articles/2020/07/02/allow-yourself-to-fail.html @@ -17,7 +17,7 @@ - + @@ -49,7 +49,7 @@ design for idempotence. It's common sense when you're passing messages between two different systems that are bound to evolve, go offline, have a bad day, etc

    — Taylor

    Sign up{: .btn} to set up a project today, absolutely free.

    Reach out{: .btn} for more information.

    - + \ No newline at end of file diff --git a/articles/2020/07/14/cron-is-better-than-a-timer.html b/articles/2020/07/14/cron-is-better-than-a-timer.html index 0a2d7e6674ca..9d37be3454e2 100644 --- a/articles/2020/07/14/cron-is-better-than-a-timer.html +++ b/articles/2020/07/14/cron-is-better-than-a-timer.html @@ -17,7 +17,7 @@ - + @@ -46,7 +46,7 @@ sign up for free or mess around with cron expressions at crontab.guru, a brilliant site to quickly build complex cron expressions.

    That's all from product for today. Speak soon.

    Taylor

    - + \ No newline at end of file diff --git a/articles/2020/12/09/upsert-in-dhis2.html b/articles/2020/12/09/upsert-in-dhis2.html index d10354cbd6f7..b328b0ae283c 100644 --- a/articles/2020/12/09/upsert-in-dhis2.html +++ b/articles/2020/12/09/upsert-in-dhis2.html @@ -17,7 +17,7 @@ - + @@ -48,7 +48,7 @@ about it over here.

    Please don’t hesitate to reach out to one of OpenFn’s implementation specialists if you’d like to learn more.

    — Taylor

    Sign up{: .btn} to set up a project today, absolutely free.

    Reach out{: .btn} for more information.

    - + \ No newline at end of file diff --git a/articles/2021/02/03/hosted-or-local-deployment.html b/articles/2021/02/03/hosted-or-local-deployment.html index 45a36ba6a19a..1a1f2a39c526 100644 --- a/articles/2021/02/03/hosted-or-local-deployment.html +++ b/articles/2021/02/03/hosted-or-local-deployment.html @@ -17,7 +17,7 @@ - + @@ -84,7 +84,7 @@ likely be in a better position to know if you want to continue using the software for 5-10 years.

    Should you need any help with your decision though please do not hesitate to contact OpenFn.

    - + \ No newline at end of file diff --git a/articles/2021/02/17/syncing-options.html b/articles/2021/02/17/syncing-options.html index e64c8cd40097..64a07262bc4c 100644 --- a/articles/2021/02/17/syncing-options.html +++ b/articles/2021/02/17/syncing-options.html @@ -17,7 +17,7 @@ - + @@ -73,7 +73,7 @@ eventual syncing was more important than having real-time syncing.

    Both Sync Options Have Their Pros and Cons

    Both options definitely have their use-cases and OpenFn's platform versatility enables your team to decide which type of sync is right for your project.

    As always, we are here to help with any questions as you think through which sync option makes the most sense for your project.

    - + \ No newline at end of file diff --git a/articles/2021/05/24/commcare-events.html b/articles/2021/05/24/commcare-events.html index 6bc9226fff23..11bc14fa60fa 100644 --- a/articles/2021/05/24/commcare-events.html +++ b/articles/2021/05/24/commcare-events.html @@ -17,7 +17,7 @@ - + @@ -113,7 +113,7 @@ head directly to the Job Library to see how other OpenFn users are creating their jobs.

    Either way, keep the community posted on your progress in the forum—you'll find lots of helpful folks willing to lend you a hand in your integration journey.

    - + \ No newline at end of file diff --git a/articles/2021/07/05/wrapping-my-head-around-jobs.html b/articles/2021/07/05/wrapping-my-head-around-jobs.html index ed25cc0d8199..d6eb17357e75 100644 --- a/articles/2021/07/05/wrapping-my-head-around-jobs.html +++ b/articles/2021/07/05/wrapping-my-head-around-jobs.html @@ -17,7 +17,7 @@ - + @@ -101,7 +101,7 @@ complex, and are pushing our new documentation regularly, so please do get in touch if you think there are ways we could improve this type of walk-through/helper article.

    Happy integrating,

    Taylor

    - + \ No newline at end of file diff --git a/articles/2021/10/08/improving-multistage-docker-builds-using-buildx.html b/articles/2021/10/08/improving-multistage-docker-builds-using-buildx.html index 9ca73a209cc2..fa8dfacba3c0 100644 --- a/articles/2021/10/08/improving-multistage-docker-builds-using-buildx.html +++ b/articles/2021/10/08/improving-multistage-docker-builds-using-buildx.html @@ -17,7 +17,7 @@ - + @@ -94,7 +94,7 @@ hey!

    Buildx has given me what I 'expected' with docker multi-stage builds, and having the cache in a repository completely side-steps having to attach a shared volume or copying from a storage bucket.

    Resources

    - + \ No newline at end of file diff --git a/articles/2021/10/15/webpack-to-esbuild-part1.html b/articles/2021/10/15/webpack-to-esbuild-part1.html index eb14d098dabf..e5246b4668a3 100644 --- a/articles/2021/10/15/webpack-to-esbuild-part1.html +++ b/articles/2021/10/15/webpack-to-esbuild-part1.html @@ -17,7 +17,7 @@ - + @@ -77,7 +77,7 @@ minified and split production build takes about 34s with webpack and that's on my i7 desktop machine, and 197s (3+ mins) on CI/CD.

    What's next?

    So our 'can we actually do this' seems to have gone pretty well so far. I'm really excited about what this will give us in the end.

    But a shell command doth not a replacement for webpack make. We still need to:

    1. Get Phoenix to use esbuild and watch our files as we work.
    2. Ensure that our html templates serve the correct files in dev & production.
      Including our CSS that is no longer injected into the DOM.
    3. Split at least our vendored modules into their own bundle.
    4. Make sure sourcemaps generate correctly for when we upload them to Sentry.
    5. Have some kind of cache-busting naming scheme for production builds.

    Resources

    - + \ No newline at end of file diff --git a/articles/2021/10/22/testing-react-app-with-jest-hound.html b/articles/2021/10/22/testing-react-app-with-jest-hound.html index a5ccd69a1700..7f39674f4a54 100644 --- a/articles/2021/10/22/testing-react-app-with-jest-hound.html +++ b/articles/2021/10/22/testing-react-app-with-jest-hound.html @@ -17,7 +17,7 @@ - + @@ -112,7 +112,7 @@ guarantee a maintainable codebase and a progressive software application.
    Still looking for the legend's advice?

    Gotcha, here you go...

    1. Swallow your pride and be humble: always do manual testing!
    2. Click test your way through the manual test cases for every new deployment, catching regressions.
    3. Lock in your fixes and new features as unit tests, integration tests, and end-to-end tests.

    Happy testing,

    Chaiwa

    - + \ No newline at end of file diff --git a/articles/2021/10/29/how-learning-javascript-helped-me-better-understand-jobs.html b/articles/2021/10/29/how-learning-javascript-helped-me-better-understand-jobs.html index ffe273d404f0..f84606169646 100644 --- a/articles/2021/10/29/how-learning-javascript-helped-me-better-understand-jobs.html +++ b/articles/2021/10/29/how-learning-javascript-helped-me-better-understand-jobs.html @@ -17,7 +17,7 @@ - + @@ -112,7 +112,7 @@ to store various keyed collections and more complex entities."

    Next steps

    I'm well on my way to becoming a better job reader and writer. Here are some next steps:

    1. Understand fn(state) and how state can be manipulated in OpenFn jobs.

    2. Explore what's available on the JavaScript docs site.

    3. Sign up for the next level JavaScript course.

    - + \ No newline at end of file diff --git a/articles/2022/06/07/workflow-automation.html b/articles/2022/06/07/workflow-automation.html index d4d812742102..a2671fe05720 100644 --- a/articles/2022/06/07/workflow-automation.html +++ b/articles/2022/06/07/workflow-automation.html @@ -17,7 +17,7 @@ - + @@ -110,7 +110,7 @@ DPG, OpenFn’s core technology is free and open-source. If you want more information about the Toolkit or to sign up for a free plan on our associated SaaS application, visit https://www.openfn.org/.

    - + \ No newline at end of file diff --git a/articles/2022/09/19/auth-security.html b/articles/2022/09/19/auth-security.html index a995a609918b..41346f06c6c3 100644 --- a/articles/2022/09/19/auth-security.html +++ b/articles/2022/09/19/auth-security.html @@ -17,7 +17,7 @@ - + @@ -72,7 +72,7 @@ security experts and international standards, including GovStack, OpenHIE, OWASP, NIST, and more.

    The resource can be found here.

    - + \ No newline at end of file diff --git a/articles/archive.html b/articles/archive.html index ea7f45bb543a..4777252a7ec5 100644 --- a/articles/archive.html +++ b/articles/archive.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/articles/page/2.html b/articles/page/2.html index 9368e6a4c4bc..efa7dd32e2fd 100644 --- a/articles/page/2.html +++ b/articles/page/2.html @@ -17,7 +17,7 @@ - + @@ -42,7 +42,7 @@ a non-profit is organized. I thought I was getting into a technical discussion—I’ve been doing system architecture discussions for years—but what we ended up talking about was how this NGO thinks.

    - + \ No newline at end of file diff --git a/articles/tags.html b/articles/tags.html index a507d70b2eb3..05d7dd193390 100644 --- a/articles/tags.html +++ b/articles/tags.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/articles/tags/annoucement.html b/articles/tags/annoucement.html index 929c15ea2c1e..38592af69a7c 100644 --- a/articles/tags/annoucement.html +++ b/articles/tags/annoucement.html @@ -17,7 +17,7 @@ - + @@ -27,7 +27,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/articles/tags/authentication.html b/articles/tags/authentication.html index f9ef7b20183a..371d707cc464 100644 --- a/articles/tags/authentication.html +++ b/articles/tags/authentication.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ Goods achieve just this. You can view and comment on the resource here, or read on to learn why.

    - + \ No newline at end of file diff --git a/articles/tags/authorization.html b/articles/tags/authorization.html index cb8c6a363559..0ae220bf9843 100644 --- a/articles/tags/authorization.html +++ b/articles/tags/authorization.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ Goods achieve just this. You can view and comment on the resource here, or read on to learn why.

    - + \ No newline at end of file diff --git a/articles/tags/automation.html b/articles/tags/automation.html index 253d5f8c2b95..b2979018f9e9 100644 --- a/articles/tags/automation.html +++ b/articles/tags/automation.html @@ -17,7 +17,7 @@ - + @@ -33,7 +33,7 @@ supply chain systems, tracking clinical visits, and helping plan vaccine rollouts. We support our partners’ work by lifting the burden of manual data transfers between platforms.

    - + \ No newline at end of file diff --git a/articles/tags/browser-testing.html b/articles/tags/browser-testing.html index 769e482291dc..b981b41eb645 100644 --- a/articles/tags/browser-testing.html +++ b/articles/tags/browser-testing.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ React/Redux app with a Phoenix/Elixir backend.

    - + \ No newline at end of file diff --git a/articles/tags/build.html b/articles/tags/build.html index b11dfb37fd27..968ffc055a8f 100644 --- a/articles/tags/build.html +++ b/articles/tags/build.html @@ -17,7 +17,7 @@ - + @@ -28,7 +28,7 @@ using it continuously for about 6 years - upgrades and all. Our front-end toolchain, albeit far from out of date (Webpack 5.52.1 today) has left some room for improvement.

    - + \ No newline at end of file diff --git a/articles/tags/ci-cd.html b/articles/tags/ci-cd.html index 2a6a795cb7c3..2cc2f636037f 100644 --- a/articles/tags/ci-cd.html +++ b/articles/tags/ci-cd.html @@ -17,7 +17,7 @@ - + @@ -29,7 +29,7 @@ toolchain, albeit far from out of date (Webpack 5.52.1 today) has left some room for improvement.

    · 6 min read

    So you're using docker's multi-stage builds and noticed that your build times aren't nearly as quick as you expected?

    - + \ No newline at end of file diff --git a/articles/tags/docker.html b/articles/tags/docker.html index ceb455d2ff43..0918c88c77e3 100644 --- a/articles/tags/docker.html +++ b/articles/tags/docker.html @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@
    Skip to main content
    - + \ No newline at end of file diff --git a/articles/tags/elixir.html b/articles/tags/elixir.html index 588c775472a5..aa7f23d32f48 100644 --- a/articles/tags/elixir.html +++ b/articles/tags/elixir.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ React/Redux app with a Phoenix/Elixir backend.

    - + \ No newline at end of file diff --git a/articles/tags/how-to.html b/articles/tags/how-to.html index c6c9d3eb3d23..21b21ac90b47 100644 --- a/articles/tags/how-to.html +++ b/articles/tags/how-to.html @@ -17,7 +17,7 @@ - + @@ -64,7 +64,7 @@ a non-profit is organized. I thought I was getting into a technical discussion—I’ve been doing system architecture discussions for years—but what we ended up talking about was how this NGO thinks.

    - + \ No newline at end of file diff --git a/articles/tags/javascript.html b/articles/tags/javascript.html index 4859599ca917..6f3c1f68b797 100644 --- a/articles/tags/javascript.html +++ b/articles/tags/javascript.html @@ -17,7 +17,7 @@ - + @@ -31,7 +31,7 @@ your job writing on OpenFn to the next level. To improve my limited knowledge of JavaScript, I have been taking Codecademy's Introduction to JavaScript Course.

    - + \ No newline at end of file diff --git a/articles/tags/jobs.html b/articles/tags/jobs.html index 4d9956620908..5e04b1755f16 100644 --- a/articles/tags/jobs.html +++ b/articles/tags/jobs.html @@ -17,7 +17,7 @@ - + @@ -32,7 +32,7 @@ JavaScript, I have been taking Codecademy's Introduction to JavaScript Course.

    · 9 min read

    Jobs are business processes turned into functional-style scripts. What does that mean, how should you approach writing jobs?

    - + \ No newline at end of file diff --git a/articles/tags/js.html b/articles/tags/js.html index 3dd548b4978b..828d0b418443 100644 --- a/articles/tags/js.html +++ b/articles/tags/js.html @@ -17,7 +17,7 @@ - + @@ -28,7 +28,7 @@ using it continuously for about 6 years - upgrades and all. Our front-end toolchain, albeit far from out of date (Webpack 5.52.1 today) has left some room for improvement.

    - + \ No newline at end of file diff --git a/articles/tags/learning.html b/articles/tags/learning.html index b12a74c24afd..e9525f9aca57 100644 --- a/articles/tags/learning.html +++ b/articles/tags/learning.html @@ -17,7 +17,7 @@ - + @@ -31,7 +31,7 @@ your job writing on OpenFn to the next level. To improve my limited knowledge of JavaScript, I have been taking Codecademy's Introduction to JavaScript Course.

    - + \ No newline at end of file diff --git a/articles/tags/phoenix.html b/articles/tags/phoenix.html index 059077414ff6..5f2adc3269ef 100644 --- a/articles/tags/phoenix.html +++ b/articles/tags/phoenix.html @@ -17,7 +17,7 @@ - + @@ -28,7 +28,7 @@ using it continuously for about 6 years - upgrades and all. Our front-end toolchain, albeit far from out of date (Webpack 5.52.1 today) has left some room for improvement.

    - + \ No newline at end of file diff --git a/articles/tags/react.html b/articles/tags/react.html index 942ca0f453e2..3ecf47f61b2a 100644 --- a/articles/tags/react.html +++ b/articles/tags/react.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ React/Redux app with a Phoenix/Elixir backend.

    - + \ No newline at end of file diff --git a/articles/tags/security.html b/articles/tags/security.html index 5e5e5262f8d0..3b46992fd76e 100644 --- a/articles/tags/security.html +++ b/articles/tags/security.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ Goods achieve just this. You can view and comment on the resource here, or read on to learn why.

    - + \ No newline at end of file diff --git a/articles/tags/solution.html b/articles/tags/solution.html index 7f68069c7cdd..b2e07b2e1438 100644 --- a/articles/tags/solution.html +++ b/articles/tags/solution.html @@ -17,7 +17,7 @@ - + @@ -33,7 +33,7 @@ supply chain systems, tracking clinical visits, and helping plan vaccine rollouts. We support our partners’ work by lifting the burden of manual data transfers between platforms.

    - + \ No newline at end of file diff --git a/articles/tags/testing.html b/articles/tags/testing.html index 0a41c8d09a3f..ef36cd15e9cf 100644 --- a/articles/tags/testing.html +++ b/articles/tags/testing.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ React/Redux app with a Phoenix/Elixir backend.

    - + \ No newline at end of file diff --git a/articles/tags/tips.html b/articles/tags/tips.html index f6c769e0b37c..6cb3910f7f05 100644 --- a/articles/tags/tips.html +++ b/articles/tags/tips.html @@ -17,7 +17,7 @@ - + @@ -65,7 +65,7 @@ "idempotence."

    · 3 min read

    Automation can save time, unlock critical resources, and enable scale–but it typically requires investment to set up. Wondering whether you should automate your processes? Ask yourself these 3 questions.

    - + \ No newline at end of file diff --git a/articles/tags/tips/page/2.html b/articles/tags/tips/page/2.html index 68d229fdae7d..0a476eebf1c2 100644 --- a/articles/tags/tips/page/2.html +++ b/articles/tags/tips/page/2.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ a non-profit is organized. I thought I was getting into a technical discussion—I’ve been doing system architecture discussions for years—but what we ended up talking about was how this NGO thinks.

    - + \ No newline at end of file diff --git a/articles/tags/webpack.html b/articles/tags/webpack.html index cf9440d08565..4987b5b07e28 100644 --- a/articles/tags/webpack.html +++ b/articles/tags/webpack.html @@ -17,7 +17,7 @@ - + @@ -28,7 +28,7 @@ using it continuously for about 6 years - upgrades and all. Our front-end toolchain, albeit far from out of date (Webpack 5.52.1 today) has left some room for improvement.

    - + \ No newline at end of file diff --git a/assets/js/4224ef00.6430cd01.js b/assets/js/4224ef00.f1e27166.js similarity index 99% rename from assets/js/4224ef00.6430cd01.js rename to assets/js/4224ef00.f1e27166.js index 2f6f97cd8036..21404afa38f0 100644 --- a/assets/js/4224ef00.6430cd01.js +++ b/assets/js/4224ef00.f1e27166.js @@ -1 +1 @@ -"use strict";(self.webpackChunk_openfn_docs=self.webpackChunk_openfn_docs||[]).push([[71494],{44663:(e,o,n)=>{n.r(o),n.d(o,{assets:()=>l,contentTitle:()=>r,default:()=>m,frontMatter:()=>i,metadata:()=>s,toc:()=>p});var t=n(58168),a=(n(96540),n(15680));const i={title:"Kobo Toolbox"},r=void 0,s={unversionedId:"kobotoolbox",id:"kobotoolbox",title:"Kobo Toolbox",description:"App Overview",source:"@site/adaptors/kobotoolbox.md",sourceDirName:".",slug:"/kobotoolbox",permalink:"/adaptors/kobotoolbox",draft:!1,tags:[],version:"current",frontMatter:{title:"Kobo Toolbox"},sidebar:"adaptors",previous:{title:"khanacademy developer readme",permalink:"/adaptors/packages/khanacademy-readme"},next:{title:"kobotoolbox@2.4.3",permalink:"/adaptors/packages/kobotoolbox-docs"}},l={},p=[{value:"App Overview",id:"app-overview",level:2},{value:"Data Model",id:"data-model",level:2},{value:"Integration Use Cases",id:"integration-use-cases",level:2},{value:"APIs & Integration Options",id:"apis--integration-options",level:2},{value:"Webhook: Forward forms in real-time from Kobo using REST service",id:"webhook-forward-forms-in-real-time-from-kobo-using-rest-service",level:3},{value:"Web APIs",id:"web-apis",level:3},{value:"Using OpenFn to access the Kobo Web API",id:"using-openfn-to-access-the-kobo-web-api",level:4},{value:"App Setup & Integration Tips",id:"app-setup--integration-tips",level:2},{value:"App installation and configuration",id:"app-installation-and-configuration",level:3},{value:"Hidden Values & Tagging Submissions",id:"hidden-values--tagging-submissions",level:3},{value:"Unique Identifiers",id:"unique-identifiers",level:3},{value:"Exporting form metadata and submission data",id:"exporting-form-metadata-and-submission-data",level:3},{value:"OpenFn Adaptor",id:"openfn-adaptor",level:2},{value:"Integration Examples",id:"integration-examples",level:2}],u={toc:p},d="wrapper";function m(e){let{components:o,...n}=e;return(0,a.yg)(d,(0,t.A)({},u,n,{components:o,mdxType:"MDXLayout"}),(0,a.yg)("h2",{id:"app-overview"},"App Overview"),(0,a.yg)("p",null,(0,a.yg)("a",{parentName:"p",href:"https://www.kobotoolbox.org/"},"Kobo Toolbox")," is a suite of open source tools for\nfield data collection for use in challenging environments. If you've worked on\nODK or ONA, the underlying tech is very similar. They offer free accounts and\nhosting for humanitarian projects, and the app provides a nice interface for\nmanaging (and cleaning!) form submissions."),(0,a.yg)("admonition",{type:"note"},(0,a.yg)("p",{parentName:"admonition"},"Tool docs are (1) to ensure all OpenFn can more quickly and easily integrate\nwith common tools, and (2) to educate any OpenFn user/the wider sector.")),(0,a.yg)("h2",{id:"data-model"},"Data Model"),(0,a.yg)("p",null,"Kobo data is collected using ",(0,a.yg)("inlineCode",{parentName:"p"},"projects")," or ",(0,a.yg)("inlineCode",{parentName:"p"},"forms")," which are the actual surveys/\nquestions being adminsitered. Form responses are collected as individual\n",(0,a.yg)("inlineCode",{parentName:"p"},"form submissions")," (1 row for every form submitted is logged in the Kobo web\napp, viewable via the ",(0,a.yg)("inlineCode",{parentName:"p"},"Data")," menu option)."),(0,a.yg)("h2",{id:"integration-use-cases"},"Integration Use Cases"),(0,a.yg)("p",null,"Example user stories:"),(0,a.yg)("ul",null,(0,a.yg)("li",{parentName:"ul"},"As a M&E manager, I want to monitor Kobo Toolbox survey responses in real-time\nin a central database, so that I can better understand data collection\nactivities and program performance across my partner sites.")),(0,a.yg)("h2",{id:"apis--integration-options"},"APIs & Integration Options"),(0,a.yg)("h3",{id:"webhook-forward-forms-in-real-time-from-kobo-using-rest-service"},"Webhook: Forward forms in real-time from Kobo using REST service"),(0,a.yg)("p",null,"Webhook or \u201cREST Service\u201d that will forward data to OpenFn (or any designated\nendpoint URL). ",(0,a.yg)("strong",{parentName:"p"},"Note: Kobo not forward any form submissions cleaned via the\nKobo web app. Only form submissions submitted via mobile are forwarded via the\nwebhook.")),(0,a.yg)("p",null,"To set this up, follow the\n",(0,a.yg)("a",{parentName:"p",href:"https://support.kobotoolbox.org/rest_services.html"},"Kobo REST service guide")),(0,a.yg)("p",null,"See below for OpenFn-specific configuration instructions:"),(0,a.yg)("ol",null,(0,a.yg)("li",{parentName:"ol"},"To push data from Kobo, users must click the projects icon on their left-side\nnav bar. It's in the shape of a globe."),(0,a.yg)("li",{parentName:"ol"},"Once selecting a project, the ",(0,a.yg)("inlineCode",{parentName:"li"},"Project Settings")," link will appear at the top\nleft side of the screen. Click it to open the Project Settings page."),(0,a.yg)("li",{parentName:"ol"},"In the bottom left pane of the project settings page, users must paste their\n",(0,a.yg)("inlineCode",{parentName:"li"},"inbox URL")," from OpenFn into the ",(0,a.yg)("inlineCode",{parentName:"li"},"Rest Services")," ",(0,a.yg)("inlineCode",{parentName:"li"},"Service URL")," input area and\nselect ",(0,a.yg)("inlineCode",{parentName:"li"},"JSON Post")," as the ",(0,a.yg)("inlineCode",{parentName:"li"},"Service Name"),"."),(0,a.yg)("li",{parentName:"ol"},"It's helpful to add a wrapper to your form data if you will be publishing\nmultiple forms to OpenFn. You could use\n",(0,a.yg)("inlineCode",{parentName:"li"},'{"form":"my_form", "body": %SUBMISSION%}'),"."),(0,a.yg)("li",{parentName:"ol"},"Click ",(0,a.yg)("inlineCode",{parentName:"li"},"Add Service")," to start forwarding new Kobo submissions to OpenFn.org.")),(0,a.yg)("p",null,"To test to integration with OpenFn, add a submission manually using the\n",(0,a.yg)("inlineCode",{parentName:"p"},"enter data in browser")," button. Head back to your history page at OpenFn to view\nthe newly submitted data and write a new ",(0,a.yg)("inlineCode",{parentName:"p"},"filter")," and ",(0,a.yg)("inlineCode",{parentName:"p"},"job")," to map your Kobo\ndata to any destination system on OpenFn."),(0,a.yg)("p",null,"Here's a sample post from Kobo REST service. Note that questions inside groups\nare prefixed with ",(0,a.yg)("inlineCode",{parentName:"p"},"groupname/")," rather than sitting inside a group object like\nODK:"),(0,a.yg)("pre",null,(0,a.yg)("code",{parentName:"pre",className:"language-json"},'{\n "meta/instanceID": "uuid:19d72997-8316-4e02-8016-4a8ddf6a2aa4",\n "group1/name": "twenty",\n "group1/age": "19",\n "formhub/uuid": "6f5773a110b046cb97e3d71f6c04e7a6",\n "first_q": "hello",\n "final_q": "why not?",\n "_xform_id_string": "groups",\n "_uuid": "19d72997-8316-4e02-8016-4a8ddf6a2aa4",\n "_userform_id": "taylordowns2000_groups",\n "_tags": [],\n "_submitted_by": null,\n "_submission_time": "2016-04-22T06:38:20",\n "_status": "submitted_via_web",\n "_notes": [],\n "_id": 889409,\n "_geolocation": [null, null],\n "_bamboo_dataset_id": "",\n "_attachments": []\n}\n')),(0,a.yg)("h3",{id:"web-apis"},"Web APIs"),(0,a.yg)("p",null,"Kobo APIs support both data and metadata integration. Check out:"),(0,a.yg)("ul",null,(0,a.yg)("li",{parentName:"ul"},"Kobo API docs: ",(0,a.yg)("a",{parentName:"li",href:"https://support.kobotoolbox.org/api.html"},"https://support.kobotoolbox.org/api.html")),(0,a.yg)("li",{parentName:"ul"},"Kobo Community: ",(0,a.yg)("a",{parentName:"li",href:"https://support.kobotoolbox.org/rest_services.html"},"https://support.kobotoolbox.org/rest_services.html")),(0,a.yg)("li",{parentName:"ul"},"Kobo API v2 explorer: ",(0,a.yg)("a",{parentName:"li",href:"https://kf.kobotoolbox.org/api/v2/assets/"},"https://kf.kobotoolbox.org/api/v2/assets/"))),(0,a.yg)("h4",{id:"using-openfn-to-access-the-kobo-web-api"},"Using OpenFn to access the Kobo Web API"),(0,a.yg)("p",null,"Timer OpenFn jobs that run on cron schedule can be configured to \u201cGET\u201d data from\nKobo API. If you are cleaning data in Kobo, we recommend this option as it will\nfetch cleaned submissions as well."),(0,a.yg)("p",null,"In order to fetch data from a form, use the Kobo API endpoint of the form. The\nbase URL is that of your Kobo server, in this example it's\n",(0,a.yg)("inlineCode",{parentName:"p"},"https://kf.kobotoolbox.org"),":\n",(0,a.yg)("inlineCode",{parentName:"p"},"https://kf.kobotoolbox.org/api/v2/assets/${survey.id}/data/?format=json"),"."),(0,a.yg)("p",null,"With this OpenFn job snippet we fetch submission data from a list of surveys,\nindicated by their IDs."),(0,a.yg)("pre",null,(0,a.yg)("code",{parentName:"pre",className:"language-js"},"fn(state => {\n console.log('Current cursor value:', state.lastEnd);\n // Set a manual cursor if you'd like to only fetch data after this date.\n const manualCursor = '2020-11-20T14:32:43.325+01:00';\n state.data = {\n surveys: [\n //** Specify new forms to fetch here **//\n {\n id: 'aVdh90L9979L945lb02',\n name: 'Initial Data Collection',\n },\n {\n id: 'bkgIF96fK7v9n7Hfj2',\n name: 'Follow-up',\n },\n ].map(survey => ({\n formId: survey.id,\n name: survey.name,\n url: `https://kf.kobotoolbox.org/api/v2/assets/${survey.id}/data/?format=json`,\n query: `&query={\"end\":{\"$gte\":\"${state.lastEnd || manualCursor}\"}}`,\n })),\n };\n return state;\n});\n\neach(dataPath('surveys[*]'), state => {\n const { url, query, formId, name } = state.data;\n return get(`${url}${query}`, {}, state => {\n state.data.submissions = state.data.results.map((submission, i) => {\n return {\n i,\n // Here we append the names defined above to the Kobo form submission data\n formName: name,\n };\n });\n });\n});\n")),(0,a.yg)("p",null,"Check out some of our\n",(0,a.yg)("a",{parentName:"p",href:"https://docs.google.com/presentation/d/1Q9YKKiaTg3ty4BC6f7PMsnXcrT6WaF0w_Eo4yOh8fQw/edit#slide=id.gcf42eece58_0_1080"},"training slides"),"\nfor an overview of Kobo integration options."),(0,a.yg)("h2",{id:"app-setup--integration-tips"},"App Setup & Integration Tips"),(0,a.yg)("h3",{id:"app-installation-and-configuration"},"App installation and configuration"),(0,a.yg)("p",null,"The ",(0,a.yg)("a",{parentName:"p",href:"https://support.kobotoolbox.org/"},"Kobo documentation")," offers detailed\nguidance on setting up forms and managing data collection."),(0,a.yg)("p",null,"You can find some of our training materials on Kobo form management\n",(0,a.yg)("a",{parentName:"p",href:"https://docs.google.com/presentation/d/16ZenDRq3zmX6LgrH4_g3O9lISTve42ZDJgjm7RThbTY/edit#slide=id.gc90ebee775_0_242"},"here"),"."),(0,a.yg)("h3",{id:"hidden-values--tagging-submissions"},"Hidden Values & Tagging Submissions"),(0,a.yg)("p",null,'A small useful trick we learned is if you want to add a hidden value to your\nforms to "inject" data or tag your form (for example a tag to mark a form as\n"test"), you can add it to the form as a\n',(0,a.yg)("a",{parentName:"p",href:"https://support.kobotoolbox.org/calculate_questions.html"},"calculated field"),"."),(0,a.yg)("h3",{id:"unique-identifiers"},"Unique Identifiers"),(0,a.yg)("p",null,"You can use the following Kobo-generated unique identifiers for forms and\nsubmissions:"),(0,a.yg)("ol",null,(0,a.yg)("li",{parentName:"ol"},(0,a.yg)("inlineCode",{parentName:"li"},'"formId": "adiNTJXFtpKEDGGZFMUtgQ"'),": This is a unique form instance ID, it\nwill be different for every copy/clone of the same form."),(0,a.yg)("li",{parentName:"ol"},(0,a.yg)("inlineCode",{parentName:"li"},'"_id": 85252496'),": This is the form submission, it's unique within the same\nKobo server"),(0,a.yg)("li",{parentName:"ol"},(0,a.yg)("inlineCode",{parentName:"li"},'"uuid" : bfcda81622a94de3a85f69aed29790af'),": This changes every time a\nsubmission is cleaned; if you'd still like to use it as unique ID, you can\ncreate a ",(0,a.yg)("inlineCode",{parentName:"li"},"calculate")," question in your form with the calculation\n",(0,a.yg)("inlineCode",{parentName:"li"},"once(uuid())"),". This will prevent the ",(0,a.yg)("inlineCode",{parentName:"li"},"uuid")," from updating with each\nsubmission edit.")),(0,a.yg)("p",null,"To uniquely identify the questions, you can use the ",(0,a.yg)("inlineCode",{parentName:"p"},"Data Column Name")," under\nquestion options. This is unique within a form and it's different from what is\ndisplayed in the survey as the question itself. You can find more info on it in\nthe ",(0,a.yg)("a",{parentName:"p",href:"https://support.kobotoolbox.org/question_options.html"},"Kobo docs"),"."),(0,a.yg)("p",null,"Similarly, if you have multiple choice question (called ",(0,a.yg)("inlineCode",{parentName:"p"},"Select Many")," question\ntype in Kobo),you can specify the underlying identifier (called ",(0,a.yg)("inlineCode",{parentName:"p"},"XML value"),") for\neach option. This is the value that you'll see when you export the collected\ndata."),(0,a.yg)("h3",{id:"exporting-form-metadata-and-submission-data"},"Exporting form metadata and submission data"),(0,a.yg)("p",null,"You can manually download your form metadata, such as question names and labels,\nquestion types, in XLS or XML format from the project's Form section on the web\ninterface, see more detail\n",(0,a.yg)("a",{parentName:"p",href:"https://support.kobotoolbox.org/new_form.html"},"here"),"."),(0,a.yg)("p",null,"To export submission data in XLS or CSV format, follow\n",(0,a.yg)("a",{parentName:"p",href:"https://support.kobotoolbox.org/export_download.html"},"these steps"),"."),(0,a.yg)("h2",{id:"openfn-adaptor"},"OpenFn Adaptor"),(0,a.yg)("p",null,"Check out\n",(0,a.yg)("a",{parentName:"p",href:"https://www.github.com/openfn/language-kobotoolbox"},"OpenFn/language-kobotoolbox"),'\nfor some helper functions for extracting or "getting" data in bulk from Kobo\nToolbox.'),(0,a.yg)("p",null,"If ",(0,a.yg)("inlineCode",{parentName:"p"},"language-kobotoolbox")," does not provide functions to support your integration\nrequirements, ",(0,a.yg)("a",{parentName:"p",href:"https://www.github.com/openfn/language-http"},(0,a.yg)("inlineCode",{parentName:"a"},"language-http"))," may\nalso be implemented to send GET/POST/PUT requests to the Kobo APIs."),(0,a.yg)("h2",{id:"integration-examples"},"Integration Examples"),(0,a.yg)("p",null,"See the ",(0,a.yg)("inlineCode",{parentName:"p"},"ConSoSci")," GitHub repo for several example Kobo-to-database jobs:\n",(0,a.yg)("a",{parentName:"p",href:"https://github.com/OpenFn/consosci"},"https://github.com/OpenFn/consosci")))}m.isMDXComponent=!0},15680:(e,o,n)=>{n.d(o,{xA:()=>u,yg:()=>c});var t=n(96540);function a(e,o,n){return o in e?Object.defineProperty(e,o,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[o]=n,e}function i(e,o){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);o&&(t=t.filter((function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.push.apply(n,t)}return n}function r(e){for(var o=1;o=0||(a[n]=e[n]);return a}(e,o);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var l=t.createContext({}),p=function(e){var o=t.useContext(l),n=o;return e&&(n="function"==typeof e?e(o):r(r({},o),e)),n},u=function(e){var o=p(e.components);return t.createElement(l.Provider,{value:o},e.children)},d="mdxType",m={inlineCode:"code",wrapper:function(e){var o=e.children;return t.createElement(t.Fragment,{},o)}},g=t.forwardRef((function(e,o){var n=e.components,a=e.mdxType,i=e.originalType,l=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),d=p(n),g=a,c=d["".concat(l,".").concat(g)]||d[g]||m[g]||i;return n?t.createElement(c,r(r({ref:o},u),{},{components:n})):t.createElement(c,r({ref:o},u))}));function c(e,o){var n=arguments,a=o&&o.mdxType;if("string"==typeof e||a){var i=n.length,r=new Array(i);r[0]=g;var s={};for(var l in o)hasOwnProperty.call(o,l)&&(s[l]=o[l]);s.originalType=e,s[d]="string"==typeof e?e:a,r[1]=s;for(var p=2;p{n.r(o),n.d(o,{assets:()=>l,contentTitle:()=>r,default:()=>m,frontMatter:()=>i,metadata:()=>s,toc:()=>p});var t=n(58168),a=(n(96540),n(15680));const i={title:"Kobo Toolbox"},r=void 0,s={unversionedId:"kobotoolbox",id:"kobotoolbox",title:"Kobo Toolbox",description:"App Overview",source:"@site/adaptors/kobotoolbox.md",sourceDirName:".",slug:"/kobotoolbox",permalink:"/adaptors/kobotoolbox",draft:!1,tags:[],version:"current",frontMatter:{title:"Kobo Toolbox"},sidebar:"adaptors",previous:{title:"khanacademy developer readme",permalink:"/adaptors/packages/khanacademy-readme"},next:{title:"kobotoolbox@3.0.0",permalink:"/adaptors/packages/kobotoolbox-docs"}},l={},p=[{value:"App Overview",id:"app-overview",level:2},{value:"Data Model",id:"data-model",level:2},{value:"Integration Use Cases",id:"integration-use-cases",level:2},{value:"APIs & Integration Options",id:"apis--integration-options",level:2},{value:"Webhook: Forward forms in real-time from Kobo using REST service",id:"webhook-forward-forms-in-real-time-from-kobo-using-rest-service",level:3},{value:"Web APIs",id:"web-apis",level:3},{value:"Using OpenFn to access the Kobo Web API",id:"using-openfn-to-access-the-kobo-web-api",level:4},{value:"App Setup & Integration Tips",id:"app-setup--integration-tips",level:2},{value:"App installation and configuration",id:"app-installation-and-configuration",level:3},{value:"Hidden Values & Tagging Submissions",id:"hidden-values--tagging-submissions",level:3},{value:"Unique Identifiers",id:"unique-identifiers",level:3},{value:"Exporting form metadata and submission data",id:"exporting-form-metadata-and-submission-data",level:3},{value:"OpenFn Adaptor",id:"openfn-adaptor",level:2},{value:"Integration Examples",id:"integration-examples",level:2}],u={toc:p},d="wrapper";function m(e){let{components:o,...n}=e;return(0,a.yg)(d,(0,t.A)({},u,n,{components:o,mdxType:"MDXLayout"}),(0,a.yg)("h2",{id:"app-overview"},"App Overview"),(0,a.yg)("p",null,(0,a.yg)("a",{parentName:"p",href:"https://www.kobotoolbox.org/"},"Kobo Toolbox")," is a suite of open source tools for\nfield data collection for use in challenging environments. If you've worked on\nODK or ONA, the underlying tech is very similar. They offer free accounts and\nhosting for humanitarian projects, and the app provides a nice interface for\nmanaging (and cleaning!) form submissions."),(0,a.yg)("admonition",{type:"note"},(0,a.yg)("p",{parentName:"admonition"},"Tool docs are (1) to ensure all OpenFn can more quickly and easily integrate\nwith common tools, and (2) to educate any OpenFn user/the wider sector.")),(0,a.yg)("h2",{id:"data-model"},"Data Model"),(0,a.yg)("p",null,"Kobo data is collected using ",(0,a.yg)("inlineCode",{parentName:"p"},"projects")," or ",(0,a.yg)("inlineCode",{parentName:"p"},"forms")," which are the actual surveys/\nquestions being adminsitered. Form responses are collected as individual\n",(0,a.yg)("inlineCode",{parentName:"p"},"form submissions")," (1 row for every form submitted is logged in the Kobo web\napp, viewable via the ",(0,a.yg)("inlineCode",{parentName:"p"},"Data")," menu option)."),(0,a.yg)("h2",{id:"integration-use-cases"},"Integration Use Cases"),(0,a.yg)("p",null,"Example user stories:"),(0,a.yg)("ul",null,(0,a.yg)("li",{parentName:"ul"},"As a M&E manager, I want to monitor Kobo Toolbox survey responses in real-time\nin a central database, so that I can better understand data collection\nactivities and program performance across my partner sites.")),(0,a.yg)("h2",{id:"apis--integration-options"},"APIs & Integration Options"),(0,a.yg)("h3",{id:"webhook-forward-forms-in-real-time-from-kobo-using-rest-service"},"Webhook: Forward forms in real-time from Kobo using REST service"),(0,a.yg)("p",null,"Webhook or \u201cREST Service\u201d that will forward data to OpenFn (or any designated\nendpoint URL). ",(0,a.yg)("strong",{parentName:"p"},"Note: Kobo not forward any form submissions cleaned via the\nKobo web app. Only form submissions submitted via mobile are forwarded via the\nwebhook.")),(0,a.yg)("p",null,"To set this up, follow the\n",(0,a.yg)("a",{parentName:"p",href:"https://support.kobotoolbox.org/rest_services.html"},"Kobo REST service guide")),(0,a.yg)("p",null,"See below for OpenFn-specific configuration instructions:"),(0,a.yg)("ol",null,(0,a.yg)("li",{parentName:"ol"},"To push data from Kobo, users must click the projects icon on their left-side\nnav bar. It's in the shape of a globe."),(0,a.yg)("li",{parentName:"ol"},"Once selecting a project, the ",(0,a.yg)("inlineCode",{parentName:"li"},"Project Settings")," link will appear at the top\nleft side of the screen. Click it to open the Project Settings page."),(0,a.yg)("li",{parentName:"ol"},"In the bottom left pane of the project settings page, users must paste their\n",(0,a.yg)("inlineCode",{parentName:"li"},"inbox URL")," from OpenFn into the ",(0,a.yg)("inlineCode",{parentName:"li"},"Rest Services")," ",(0,a.yg)("inlineCode",{parentName:"li"},"Service URL")," input area and\nselect ",(0,a.yg)("inlineCode",{parentName:"li"},"JSON Post")," as the ",(0,a.yg)("inlineCode",{parentName:"li"},"Service Name"),"."),(0,a.yg)("li",{parentName:"ol"},"It's helpful to add a wrapper to your form data if you will be publishing\nmultiple forms to OpenFn. You could use\n",(0,a.yg)("inlineCode",{parentName:"li"},'{"form":"my_form", "body": %SUBMISSION%}'),"."),(0,a.yg)("li",{parentName:"ol"},"Click ",(0,a.yg)("inlineCode",{parentName:"li"},"Add Service")," to start forwarding new Kobo submissions to OpenFn.org.")),(0,a.yg)("p",null,"To test to integration with OpenFn, add a submission manually using the\n",(0,a.yg)("inlineCode",{parentName:"p"},"enter data in browser")," button. Head back to your history page at OpenFn to view\nthe newly submitted data and write a new ",(0,a.yg)("inlineCode",{parentName:"p"},"filter")," and ",(0,a.yg)("inlineCode",{parentName:"p"},"job")," to map your Kobo\ndata to any destination system on OpenFn."),(0,a.yg)("p",null,"Here's a sample post from Kobo REST service. Note that questions inside groups\nare prefixed with ",(0,a.yg)("inlineCode",{parentName:"p"},"groupname/")," rather than sitting inside a group object like\nODK:"),(0,a.yg)("pre",null,(0,a.yg)("code",{parentName:"pre",className:"language-json"},'{\n "meta/instanceID": "uuid:19d72997-8316-4e02-8016-4a8ddf6a2aa4",\n "group1/name": "twenty",\n "group1/age": "19",\n "formhub/uuid": "6f5773a110b046cb97e3d71f6c04e7a6",\n "first_q": "hello",\n "final_q": "why not?",\n "_xform_id_string": "groups",\n "_uuid": "19d72997-8316-4e02-8016-4a8ddf6a2aa4",\n "_userform_id": "taylordowns2000_groups",\n "_tags": [],\n "_submitted_by": null,\n "_submission_time": "2016-04-22T06:38:20",\n "_status": "submitted_via_web",\n "_notes": [],\n "_id": 889409,\n "_geolocation": [null, null],\n "_bamboo_dataset_id": "",\n "_attachments": []\n}\n')),(0,a.yg)("h3",{id:"web-apis"},"Web APIs"),(0,a.yg)("p",null,"Kobo APIs support both data and metadata integration. Check out:"),(0,a.yg)("ul",null,(0,a.yg)("li",{parentName:"ul"},"Kobo API docs: ",(0,a.yg)("a",{parentName:"li",href:"https://support.kobotoolbox.org/api.html"},"https://support.kobotoolbox.org/api.html")),(0,a.yg)("li",{parentName:"ul"},"Kobo Community: ",(0,a.yg)("a",{parentName:"li",href:"https://support.kobotoolbox.org/rest_services.html"},"https://support.kobotoolbox.org/rest_services.html")),(0,a.yg)("li",{parentName:"ul"},"Kobo API v2 explorer: ",(0,a.yg)("a",{parentName:"li",href:"https://kf.kobotoolbox.org/api/v2/assets/"},"https://kf.kobotoolbox.org/api/v2/assets/"))),(0,a.yg)("h4",{id:"using-openfn-to-access-the-kobo-web-api"},"Using OpenFn to access the Kobo Web API"),(0,a.yg)("p",null,"Timer OpenFn jobs that run on cron schedule can be configured to \u201cGET\u201d data from\nKobo API. If you are cleaning data in Kobo, we recommend this option as it will\nfetch cleaned submissions as well."),(0,a.yg)("p",null,"In order to fetch data from a form, use the Kobo API endpoint of the form. The\nbase URL is that of your Kobo server, in this example it's\n",(0,a.yg)("inlineCode",{parentName:"p"},"https://kf.kobotoolbox.org"),":\n",(0,a.yg)("inlineCode",{parentName:"p"},"https://kf.kobotoolbox.org/api/v2/assets/${survey.id}/data/?format=json"),"."),(0,a.yg)("p",null,"With this OpenFn job snippet we fetch submission data from a list of surveys,\nindicated by their IDs."),(0,a.yg)("pre",null,(0,a.yg)("code",{parentName:"pre",className:"language-js"},"fn(state => {\n console.log('Current cursor value:', state.lastEnd);\n // Set a manual cursor if you'd like to only fetch data after this date.\n const manualCursor = '2020-11-20T14:32:43.325+01:00';\n state.data = {\n surveys: [\n //** Specify new forms to fetch here **//\n {\n id: 'aVdh90L9979L945lb02',\n name: 'Initial Data Collection',\n },\n {\n id: 'bkgIF96fK7v9n7Hfj2',\n name: 'Follow-up',\n },\n ].map(survey => ({\n formId: survey.id,\n name: survey.name,\n url: `https://kf.kobotoolbox.org/api/v2/assets/${survey.id}/data/?format=json`,\n query: `&query={\"end\":{\"$gte\":\"${state.lastEnd || manualCursor}\"}}`,\n })),\n };\n return state;\n});\n\neach(dataPath('surveys[*]'), state => {\n const { url, query, formId, name } = state.data;\n return get(`${url}${query}`, {}, state => {\n state.data.submissions = state.data.results.map((submission, i) => {\n return {\n i,\n // Here we append the names defined above to the Kobo form submission data\n formName: name,\n };\n });\n });\n});\n")),(0,a.yg)("p",null,"Check out some of our\n",(0,a.yg)("a",{parentName:"p",href:"https://docs.google.com/presentation/d/1Q9YKKiaTg3ty4BC6f7PMsnXcrT6WaF0w_Eo4yOh8fQw/edit#slide=id.gcf42eece58_0_1080"},"training slides"),"\nfor an overview of Kobo integration options."),(0,a.yg)("h2",{id:"app-setup--integration-tips"},"App Setup & Integration Tips"),(0,a.yg)("h3",{id:"app-installation-and-configuration"},"App installation and configuration"),(0,a.yg)("p",null,"The ",(0,a.yg)("a",{parentName:"p",href:"https://support.kobotoolbox.org/"},"Kobo documentation")," offers detailed\nguidance on setting up forms and managing data collection."),(0,a.yg)("p",null,"You can find some of our training materials on Kobo form management\n",(0,a.yg)("a",{parentName:"p",href:"https://docs.google.com/presentation/d/16ZenDRq3zmX6LgrH4_g3O9lISTve42ZDJgjm7RThbTY/edit#slide=id.gc90ebee775_0_242"},"here"),"."),(0,a.yg)("h3",{id:"hidden-values--tagging-submissions"},"Hidden Values & Tagging Submissions"),(0,a.yg)("p",null,'A small useful trick we learned is if you want to add a hidden value to your\nforms to "inject" data or tag your form (for example a tag to mark a form as\n"test"), you can add it to the form as a\n',(0,a.yg)("a",{parentName:"p",href:"https://support.kobotoolbox.org/calculate_questions.html"},"calculated field"),"."),(0,a.yg)("h3",{id:"unique-identifiers"},"Unique Identifiers"),(0,a.yg)("p",null,"You can use the following Kobo-generated unique identifiers for forms and\nsubmissions:"),(0,a.yg)("ol",null,(0,a.yg)("li",{parentName:"ol"},(0,a.yg)("inlineCode",{parentName:"li"},'"formId": "adiNTJXFtpKEDGGZFMUtgQ"'),": This is a unique form instance ID, it\nwill be different for every copy/clone of the same form."),(0,a.yg)("li",{parentName:"ol"},(0,a.yg)("inlineCode",{parentName:"li"},'"_id": 85252496'),": This is the form submission, it's unique within the same\nKobo server"),(0,a.yg)("li",{parentName:"ol"},(0,a.yg)("inlineCode",{parentName:"li"},'"uuid" : bfcda81622a94de3a85f69aed29790af'),": This changes every time a\nsubmission is cleaned; if you'd still like to use it as unique ID, you can\ncreate a ",(0,a.yg)("inlineCode",{parentName:"li"},"calculate")," question in your form with the calculation\n",(0,a.yg)("inlineCode",{parentName:"li"},"once(uuid())"),". This will prevent the ",(0,a.yg)("inlineCode",{parentName:"li"},"uuid")," from updating with each\nsubmission edit.")),(0,a.yg)("p",null,"To uniquely identify the questions, you can use the ",(0,a.yg)("inlineCode",{parentName:"p"},"Data Column Name")," under\nquestion options. This is unique within a form and it's different from what is\ndisplayed in the survey as the question itself. You can find more info on it in\nthe ",(0,a.yg)("a",{parentName:"p",href:"https://support.kobotoolbox.org/question_options.html"},"Kobo docs"),"."),(0,a.yg)("p",null,"Similarly, if you have multiple choice question (called ",(0,a.yg)("inlineCode",{parentName:"p"},"Select Many")," question\ntype in Kobo),you can specify the underlying identifier (called ",(0,a.yg)("inlineCode",{parentName:"p"},"XML value"),") for\neach option. This is the value that you'll see when you export the collected\ndata."),(0,a.yg)("h3",{id:"exporting-form-metadata-and-submission-data"},"Exporting form metadata and submission data"),(0,a.yg)("p",null,"You can manually download your form metadata, such as question names and labels,\nquestion types, in XLS or XML format from the project's Form section on the web\ninterface, see more detail\n",(0,a.yg)("a",{parentName:"p",href:"https://support.kobotoolbox.org/new_form.html"},"here"),"."),(0,a.yg)("p",null,"To export submission data in XLS or CSV format, follow\n",(0,a.yg)("a",{parentName:"p",href:"https://support.kobotoolbox.org/export_download.html"},"these steps"),"."),(0,a.yg)("h2",{id:"openfn-adaptor"},"OpenFn Adaptor"),(0,a.yg)("p",null,"Check out\n",(0,a.yg)("a",{parentName:"p",href:"https://www.github.com/openfn/language-kobotoolbox"},"OpenFn/language-kobotoolbox"),'\nfor some helper functions for extracting or "getting" data in bulk from Kobo\nToolbox.'),(0,a.yg)("p",null,"If ",(0,a.yg)("inlineCode",{parentName:"p"},"language-kobotoolbox")," does not provide functions to support your integration\nrequirements, ",(0,a.yg)("a",{parentName:"p",href:"https://www.github.com/openfn/language-http"},(0,a.yg)("inlineCode",{parentName:"a"},"language-http"))," may\nalso be implemented to send GET/POST/PUT requests to the Kobo APIs."),(0,a.yg)("h2",{id:"integration-examples"},"Integration Examples"),(0,a.yg)("p",null,"See the ",(0,a.yg)("inlineCode",{parentName:"p"},"ConSoSci")," GitHub repo for several example Kobo-to-database jobs:\n",(0,a.yg)("a",{parentName:"p",href:"https://github.com/OpenFn/consosci"},"https://github.com/OpenFn/consosci")))}m.isMDXComponent=!0},15680:(e,o,n)=>{n.d(o,{xA:()=>u,yg:()=>c});var t=n(96540);function a(e,o,n){return o in e?Object.defineProperty(e,o,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[o]=n,e}function i(e,o){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);o&&(t=t.filter((function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.push.apply(n,t)}return n}function r(e){for(var o=1;o=0||(a[n]=e[n]);return a}(e,o);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var l=t.createContext({}),p=function(e){var o=t.useContext(l),n=o;return e&&(n="function"==typeof e?e(o):r(r({},o),e)),n},u=function(e){var o=p(e.components);return t.createElement(l.Provider,{value:o},e.children)},d="mdxType",m={inlineCode:"code",wrapper:function(e){var o=e.children;return t.createElement(t.Fragment,{},o)}},g=t.forwardRef((function(e,o){var n=e.components,a=e.mdxType,i=e.originalType,l=e.parentName,u=s(e,["components","mdxType","originalType","parentName"]),d=p(n),g=a,c=d["".concat(l,".").concat(g)]||d[g]||m[g]||i;return n?t.createElement(c,r(r({ref:o},u),{},{components:n})):t.createElement(c,r({ref:o},u))}));function c(e,o){var n=arguments,a=o&&o.mdxType;if("string"==typeof e||a){var i=n.length,r=new Array(i);r[0]=g;var s={};for(var l in o)hasOwnProperty.call(o,l)&&(s[l]=o[l]);s.originalType=e,s[d]="string"==typeof e?e:a,r[1]=s;for(var p=2;p{a.r(t),a.d(t,{assets:()=>c,contentTitle:()=>l,default:()=>g,frontMatter:()=>o,metadata:()=>s,toc:()=>p});var n=a(58168),r=(a(96540),a(15680));const o={title:"twilio@0.5.2",id:"twilio-docs",keywords:["adaptor","twilio","sendSMS"]},l=void 0,s={unversionedId:"packages/twilio-docs",id:"packages/twilio-docs",title:"twilio@0.5.2",description:"sendSMS(params)",source:"@site/adaptors/packages/twilio-docs.md",sourceDirName:"packages",slug:"/packages/twilio-docs",permalink:"/adaptors/packages/twilio-docs",draft:!1,tags:[],version:"current",frontMatter:{title:"twilio@0.5.2",id:"twilio-docs",keywords:["adaptor","twilio","sendSMS"]},sidebar:"adaptors",previous:{title:"testing developer readme",permalink:"/adaptors/packages/testing-readme"},next:{title:"Config for twilio",permalink:"/adaptors/packages/twilio-configuration-schema"}},c={},p=[{value:"Functions",id:"functions",level:2},{value:"sendSMS",id:"sendsms",level:3}],i={toc:p},d="wrapper";function g(e){let{components:t,...a}=e;return(0,r.yg)(d,(0,n.A)({},i,a,{components:t,mdxType:"MDXLayout"}),(0,r.yg)("dl",null,(0,r.yg)("dt",null,(0,r.yg)("a",{href:"#sendsms"},"sendSMS(params)"))),(0,r.yg)("p",null,"This adaptor exports the following from common:"),(0,r.yg)("dl",null,(0,r.yg)("dt",null,(0,r.yg)("a",{href:"/adaptors/packages/common-docs#alterstate"},"alterState()")),(0,r.yg)("dt",null,(0,r.yg)("a",{href:"/adaptors/packages/common-docs#datapath"},"dataPath()")),(0,r.yg)("dt",null,(0,r.yg)("a",{href:"/adaptors/packages/common-docs#datavalue"},"dataValue()")),(0,r.yg)("dt",null,(0,r.yg)("a",{href:"/adaptors/packages/common-docs#each"},"each()")),(0,r.yg)("dt",null,(0,r.yg)("a",{href:"/adaptors/packages/common-docs#field"},"field()")),(0,r.yg)("dt",null,(0,r.yg)("a",{href:"/adaptors/packages/common-docs#fields"},"fields()")),(0,r.yg)("dt",null,(0,r.yg)("a",{href:"/adaptors/packages/common-docs#fn"},"fn()")),(0,r.yg)("dt",null,(0,r.yg)("a",{href:"/adaptors/packages/common-docs#fnif"},"fnIf()")),(0,r.yg)("dt",null,(0,r.yg)("a",{href:"/adaptors/packages/common-docs#http"},"http()")),(0,r.yg)("dt",null,(0,r.yg)("a",{href:"/adaptors/packages/common-docs#lastreferencevalue"},"lastReferenceValue()")),(0,r.yg)("dt",null,(0,r.yg)("a",{href:"/adaptors/packages/common-docs#merge"},"merge()")),(0,r.yg)("dt",null,(0,r.yg)("a",{href:"/adaptors/packages/common-docs#sourcevalue"},"sourceValue()"))),(0,r.yg)("h2",{id:"functions"},"Functions"),(0,r.yg)("h3",{id:"sendsms"},"sendSMS"),(0,r.yg)("p",null,(0,r.yg)("code",null,"sendSMS(params) \u21d2 Operation")),(0,r.yg)("p",null,"Sends an SMS message to a specific phone number"),(0,r.yg)("table",null,(0,r.yg)("thead",{parentName:"table"},(0,r.yg)("tr",{parentName:"thead"},(0,r.yg)("th",{parentName:"tr",align:null},"Param"),(0,r.yg)("th",{parentName:"tr",align:null},"Type"),(0,r.yg)("th",{parentName:"tr",align:null},"Description"))),(0,r.yg)("tbody",{parentName:"table"},(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:null},"params"),(0,r.yg)("td",{parentName:"tr",align:null},(0,r.yg)("code",null,"Object")),(0,r.yg)("td",{parentName:"tr",align:null},"an object containing 'body', 'from', and 'to' keys.")))),(0,r.yg)("p",null,(0,r.yg)("strong",{parentName:"p"},"Example")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-js"},"sendSMS({\n body: dataValue('sampleText'),\n from: dataValue('myFromNumber'),\n to: dataValue('ukMobile'),\n});\n")),(0,r.yg)("hr",null))}g.isMDXComponent=!0},15680:(e,t,a)=>{a.d(t,{xA:()=>i,yg:()=>m});var n=a(96540);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function o(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function l(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var c=n.createContext({}),p=function(e){var t=n.useContext(c),a=t;return e&&(a="function"==typeof e?e(t):l(l({},t),e)),a},i=function(e){var t=p(e.components);return n.createElement(c.Provider,{value:t},e.children)},d="mdxType",g={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},u=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,o=e.originalType,c=e.parentName,i=s(e,["components","mdxType","originalType","parentName"]),d=p(a),u=r,m=d["".concat(c,".").concat(u)]||d[u]||g[u]||o;return a?n.createElement(m,l(l({ref:t},i),{},{components:a})):n.createElement(m,l({ref:t},i))}));function m(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=a.length,l=new Array(o);l[0]=u;var s={};for(var c in t)hasOwnProperty.call(t,c)&&(s[c]=t[c]);s.originalType=e,s[d]="string"==typeof e?e:r,l[1]=s;for(var p=2;p{a.r(t),a.d(t,{assets:()=>c,contentTitle:()=>l,default:()=>g,frontMatter:()=>o,metadata:()=>s,toc:()=>p});var n=a(58168),r=(a(96540),a(15680));const o={title:"twilio@0.5.2",id:"twilio-docs",keywords:["adaptor","twilio","sendSMS"]},l=void 0,s={unversionedId:"packages/twilio-docs",id:"packages/twilio-docs",title:"twilio@0.5.2",description:"sendSMS(params)",source:"@site/adaptors/packages/twilio-docs.md",sourceDirName:"packages",slug:"/packages/twilio-docs",permalink:"/adaptors/packages/twilio-docs",draft:!1,tags:[],version:"current",frontMatter:{title:"twilio@0.5.2",id:"twilio-docs",keywords:["adaptor","twilio","sendSMS"]},sidebar:"adaptors",previous:{title:"testing developer readme",permalink:"/adaptors/packages/testing-readme"},next:{title:"Config for twilio",permalink:"/adaptors/packages/twilio-configuration-schema"}},c={},p=[{value:"Functions",id:"functions",level:2},{value:"sendSMS",id:"sendsms",level:3}],i={toc:p},d="wrapper";function g(e){let{components:t,...a}=e;return(0,r.yg)(d,(0,n.A)({},i,a,{components:t,mdxType:"MDXLayout"}),(0,r.yg)("dl",null,(0,r.yg)("dt",null,(0,r.yg)("a",{href:"#sendsms"},"sendSMS(params)"))),(0,r.yg)("p",null,"This adaptor exports the following from common:"),(0,r.yg)("dl",null,(0,r.yg)("dt",null,(0,r.yg)("a",{href:"/adaptors/packages/common-docs#alterstate"},"alterState()")),(0,r.yg)("dt",null,(0,r.yg)("a",{href:"/adaptors/packages/common-docs#datapath"},"dataPath()")),(0,r.yg)("dt",null,(0,r.yg)("a",{href:"/adaptors/packages/common-docs#datavalue"},"dataValue()")),(0,r.yg)("dt",null,(0,r.yg)("a",{href:"/adaptors/packages/common-docs#each"},"each()")),(0,r.yg)("dt",null,(0,r.yg)("a",{href:"/adaptors/packages/common-docs#field"},"field()")),(0,r.yg)("dt",null,(0,r.yg)("a",{href:"/adaptors/packages/common-docs#fields"},"fields()")),(0,r.yg)("dt",null,(0,r.yg)("a",{href:"/adaptors/packages/common-docs#fn"},"fn()")),(0,r.yg)("dt",null,(0,r.yg)("a",{href:"/adaptors/packages/common-docs#fnif"},"fnIf()")),(0,r.yg)("dt",null,(0,r.yg)("a",{href:"/adaptors/packages/common-docs#http"},"http")),(0,r.yg)("dt",null,(0,r.yg)("a",{href:"/adaptors/packages/common-docs#lastreferencevalue"},"lastReferenceValue()")),(0,r.yg)("dt",null,(0,r.yg)("a",{href:"/adaptors/packages/common-docs#merge"},"merge()")),(0,r.yg)("dt",null,(0,r.yg)("a",{href:"/adaptors/packages/common-docs#sourcevalue"},"sourceValue()"))),(0,r.yg)("h2",{id:"functions"},"Functions"),(0,r.yg)("h3",{id:"sendsms"},"sendSMS"),(0,r.yg)("p",null,(0,r.yg)("code",null,"sendSMS(params) \u21d2 Operation")),(0,r.yg)("p",null,"Sends an SMS message to a specific phone number"),(0,r.yg)("table",null,(0,r.yg)("thead",{parentName:"table"},(0,r.yg)("tr",{parentName:"thead"},(0,r.yg)("th",{parentName:"tr",align:null},"Param"),(0,r.yg)("th",{parentName:"tr",align:null},"Type"),(0,r.yg)("th",{parentName:"tr",align:null},"Description"))),(0,r.yg)("tbody",{parentName:"table"},(0,r.yg)("tr",{parentName:"tbody"},(0,r.yg)("td",{parentName:"tr",align:null},"params"),(0,r.yg)("td",{parentName:"tr",align:null},(0,r.yg)("code",null,"Object")),(0,r.yg)("td",{parentName:"tr",align:null},"an object containing 'body', 'from', and 'to' keys.")))),(0,r.yg)("p",null,(0,r.yg)("strong",{parentName:"p"},"Example")),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-js"},"sendSMS({\n body: dataValue('sampleText'),\n from: dataValue('myFromNumber'),\n to: dataValue('ukMobile'),\n});\n")),(0,r.yg)("hr",null))}g.isMDXComponent=!0},15680:(e,t,a)=>{a.d(t,{xA:()=>i,yg:()=>m});var n=a(96540);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function o(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function l(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var c=n.createContext({}),p=function(e){var t=n.useContext(c),a=t;return e&&(a="function"==typeof e?e(t):l(l({},t),e)),a},i=function(e){var t=p(e.components);return n.createElement(c.Provider,{value:t},e.children)},d="mdxType",g={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},u=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,o=e.originalType,c=e.parentName,i=s(e,["components","mdxType","originalType","parentName"]),d=p(a),u=r,m=d["".concat(c,".").concat(u)]||d[u]||g[u]||o;return a?n.createElement(m,l(l({ref:t},i),{},{components:a})):n.createElement(m,l({ref:t},i))}));function m(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var o=a.length,l=new Array(o);l[0]=u;var s={};for(var c in t)hasOwnProperty.call(t,c)&&(s[c]=t[c]);s.originalType=e,s[d]="string"==typeof e?e:r,l[1]=s;for(var p=2;p{n.r(a),n.d(a,{assets:()=>r,contentTitle:()=>i,default:()=>u,frontMatter:()=>o,metadata:()=>g,toc:()=>c});var l=n(58168),t=(n(96540),n(15680));const o={title:"kobotoolbox changelog",id:"kobotoolbox-changelog",keywords:["adaptor","changelog","kobotoolbox"]},i="Changelog for the kobotoolbox adaptor",g={unversionedId:"packages/kobotoolbox-changelog",id:"packages/kobotoolbox-changelog",title:"kobotoolbox changelog",description:"3.0.0",source:"@site/adaptors/packages/kobotoolbox-changelog.md",sourceDirName:"packages",slug:"/packages/kobotoolbox-changelog",permalink:"/adaptors/packages/kobotoolbox-changelog",draft:!1,tags:[],version:"current",frontMatter:{title:"kobotoolbox changelog",id:"kobotoolbox-changelog",keywords:["adaptor","changelog","kobotoolbox"]},sidebar:"adaptors",previous:{title:"Config for kobotoolbox",permalink:"/adaptors/packages/kobotoolbox-configuration-schema"},next:{title:"kobotoolbox developer readme",permalink:"/adaptors/packages/kobotoolbox-readme"}},r={},c=[{value:"3.0.0",id:"300",level:2},{value:"Major Changes",id:"major-changes",level:3},{value:"Minor Changes",id:"minor-changes",level:3},{value:"Migration guide",id:"migration-guide",level:2},{value:"2.4.3",id:"243",level:2},{value:"Patch Changes",id:"patch-changes",level:3},{value:"2.4.2",id:"242",level:2},{value:"Patch Changes",id:"patch-changes-1",level:3},{value:"2.4.1",id:"241",level:2},{value:"Patch Changes",id:"patch-changes-2",level:3},{value:"2.4.0",id:"240",level:2},{value:"Minor Changes",id:"minor-changes-1",level:3},{value:"Patch Changes",id:"patch-changes-3",level:3},{value:"2.3.0",id:"230",level:2},{value:"Minor Changes",id:"minor-changes-2",level:3},{value:"Patch Changes",id:"patch-changes-4",level:3},{value:"2.2.0",id:"220",level:2},{value:"Minor Changes",id:"minor-changes-3",level:3},{value:"Patch Changes",id:"patch-changes-5",level:3},{value:"2.1.0",id:"210",level:2},{value:"Minor Changes",id:"minor-changes-4",level:3},{value:"2.0.1",id:"201",level:2},{value:"Patch Changes",id:"patch-changes-6",level:3},{value:"2.0.0",id:"200",level:2},{value:"Major Changes",id:"major-changes-1",level:3},{value:"Patch Changes",id:"patch-changes-7",level:3},{value:"1.3.3",id:"133",level:2},{value:"Patch Changes",id:"patch-changes-8",level:3},{value:"1.3.2",id:"132",level:2},{value:"Patch Changes",id:"patch-changes-9",level:3},{value:"1.3.1",id:"131",level:2},{value:"Patch Changes",id:"patch-changes-10",level:3},{value:"1.3.0",id:"130",level:2},{value:"Minor Changes",id:"minor-changes-5",level:3},{value:"Patch Changes",id:"patch-changes-11",level:3},{value:"1.2.0",id:"120",level:2},{value:"Minor Changes",id:"minor-changes-6",level:3},{value:"Patch Changes",id:"patch-changes-12",level:3},{value:"1.1.0",id:"110",level:2},{value:"Minor Changes",id:"minor-changes-7",level:3},{value:"Patch Changes",id:"patch-changes-13",level:3}],p={toc:c},d="wrapper";function u(e){let{components:a,...n}=e;return(0,t.yg)(d,(0,l.A)({},p,n,{components:a,mdxType:"MDXLayout"}),(0,t.yg)("h1",{id:"changelog-for-the-kobotoolbox-adaptor"},"Changelog for the kobotoolbox adaptor"),(0,t.yg)("h1",{id:"openfnlanguage-kobotoolbox"},"@openfn/language-kobotoolbox"),(0,t.yg)("h2",{id:"300"},"3.0.0"),(0,t.yg)("h3",{id:"major-changes"},"Major Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"b01d4f0: Update all functions in the main API (remove callbacks and clean up\nsignatures, see the Migration Guide)"),(0,t.yg)("li",{parentName:"ul"},"882ce29: Rewrite onto common http helpers (using undici)")),(0,t.yg)("h3",{id:"minor-changes"},"Minor Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"6d536b2: Renaming ",(0,t.yg)("inlineCode",{parentName:"li"},"baseURL")," to ",(0,t.yg)("inlineCode",{parentName:"li"},"baseUrl")," to match all other adaptors, and\nlogging a warning if ",(0,t.yg)("inlineCode",{parentName:"li"},"baseURL")," is used"),(0,t.yg)("li",{parentName:"ul"},"311d3b2: Add http namespace with ",(0,t.yg)("inlineCode",{parentName:"li"},"get()"),", ",(0,t.yg)("inlineCode",{parentName:"li"},"post()"),", ",(0,t.yg)("inlineCode",{parentName:"li"},"put()"))),(0,t.yg)("h2",{id:"migration-guide"},"Migration guide"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"callbacks have removed from all functions. You can use ",(0,t.yg)("inlineCode",{parentName:"li"},".then()")," or ",(0,t.yg)("inlineCode",{parentName:"li"},"fn()")," to\naccess the data returned by a function, ie, ",(0,t.yg)("inlineCode",{parentName:"li"},"getForms().then(state => state)")),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"getForms(params, callback)")," is now ",(0,t.yg)("inlineCode",{parentName:"li"},"getForms()"),", and will now only download\nassets of type survey. Use ",(0,t.yg)("inlineCode",{parentName:"li"},"http.get('assets/')")," to retrieve other assets (and\nadd query parameters)"),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"getSubmissions(params, callback)")," is now ",(0,t.yg)("inlineCode",{parentName:"li"},"getSubmissions(formId, { query })"),"."),(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("inlineCode",{parentName:"li"},"getDeploymentInfo(params, callback)")," is now ",(0,t.yg)("inlineCode",{parentName:"li"},"getDeploymentInfo(formId)"))),(0,t.yg)("h2",{id:"243"},"2.4.3"),(0,t.yg)("h3",{id:"patch-changes"},"Patch Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"Security fix: update jsonpath-plus version")),(0,t.yg)("h2",{id:"242"},"2.4.2"),(0,t.yg)("h3",{id:"patch-changes-1"},"Patch Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"8146c23: Fix typings in package.json")),(0,t.yg)("h2",{id:"241"},"2.4.1"),(0,t.yg)("h3",{id:"patch-changes-2"},"Patch Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"73d0a02: Make documentation public"),(0,t.yg)("li",{parentName:"ul"},"Updated dependencies ","[4c08444]"),(0,t.yg)("li",{parentName:"ul"},"Updated dependencies ","[73d0a02]",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},"@openfn/",(0,t.yg)("a",{parentName:"li",href:"mailto:language-common@1.15.1"},"language-common@1.15.1"))))),(0,t.yg)("h2",{id:"240"},"2.4.0"),(0,t.yg)("h3",{id:"minor-changes-1"},"Minor Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"5fb82f07: Export ",(0,t.yg)("inlineCode",{parentName:"li"},"group")," operation from common")),(0,t.yg)("h3",{id:"patch-changes-3"},"Patch Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"Updated dependencies ","[5fb82f07]",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},"@openfn/",(0,t.yg)("a",{parentName:"li",href:"mailto:language-common@1.15.0"},"language-common@1.15.0"))))),(0,t.yg)("h2",{id:"230"},"2.3.0"),(0,t.yg)("h3",{id:"minor-changes-2"},"Minor Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"73433c20: Add ",(0,t.yg)("inlineCode",{parentName:"li"},"fnIf")," operation")),(0,t.yg)("h3",{id:"patch-changes-4"},"Patch Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"Updated dependencies ","[106ecf6d]",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},"@openfn/",(0,t.yg)("a",{parentName:"li",href:"mailto:language-common@1.14.0"},"language-common@1.14.0"))))),(0,t.yg)("h2",{id:"220"},"2.2.0"),(0,t.yg)("h3",{id:"minor-changes-3"},"Minor Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"bae5d3b6: Add the cursor() function from common. See the job writing guide for\nmore information.")),(0,t.yg)("h3",{id:"patch-changes-5"},"Patch Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"Updated dependencies ","[1ad86651]",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},"@openfn/",(0,t.yg)("a",{parentName:"li",href:"mailto:language-common@1.13.0"},"language-common@1.13.0"))))),(0,t.yg)("h2",{id:"210"},"2.1.0"),(0,t.yg)("h3",{id:"minor-changes-4"},"Minor Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"c85abf3: Removed the API version enum values in the credential configuration\njson schema and added a placeholder")),(0,t.yg)("h2",{id:"201"},"2.0.1"),(0,t.yg)("h3",{id:"patch-changes-6"},"Patch Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"Update lock files"),(0,t.yg)("li",{parentName:"ul"},"Updated dependencies",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},"@openfn/",(0,t.yg)("a",{parentName:"li",href:"mailto:language-common@1.8.1"},"language-common@1.8.1"))))),(0,t.yg)("h2",{id:"200"},"2.0.0"),(0,t.yg)("h3",{id:"major-changes-1"},"Major Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},"2c1d603: Remove parameter reassignment to ensure proper functioning inside an\n",(0,t.yg)("inlineCode",{parentName:"p"},"each")," block; add eslint"),(0,t.yg)("p",{parentName:"li"},"The packages receiving a major bump here exposed functions that didn't work as\nexpected inside ",(0,t.yg)("inlineCode",{parentName:"p"},"each")," blocks. Users were previously wrapping these functions\ninside their own custom ",(0,t.yg)("inlineCode",{parentName:"p"},"fn")," blocks, and this change will ensure that they can\nbe used inside a standard each."),(0,t.yg)("p",{parentName:"li"},"See ",(0,t.yg)("a",{parentName:"p",href:"https://github.com/OpenFn/adaptors/issues/275"},"https://github.com/OpenFn/adaptors/issues/275")," for more details."))),(0,t.yg)("h3",{id:"patch-changes-7"},"Patch Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"Updated dependencies ","[2c1d603]",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},"@openfn/",(0,t.yg)("a",{parentName:"li",href:"mailto:language-common@1.8.0"},"language-common@1.8.0"))))),(0,t.yg)("h2",{id:"133"},"1.3.3"),(0,t.yg)("h3",{id:"patch-changes-8"},"Patch Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"14f481e: mark execute as private"),(0,t.yg)("li",{parentName:"ul"},"Updated dependencies ","[2b4c61a]",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},"@openfn/",(0,t.yg)("a",{parentName:"li",href:"mailto:language-common@1.7.6"},"language-common@1.7.6"))))),(0,t.yg)("h2",{id:"132"},"1.3.2"),(0,t.yg)("h3",{id:"patch-changes-9"},"Patch Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"f7ebd3c: remove sample configuration")),(0,t.yg)("h2",{id:"131"},"1.3.1"),(0,t.yg)("h3",{id:"patch-changes-10"},"Patch Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"f2aed32: add examples")),(0,t.yg)("h2",{id:"130"},"1.3.0"),(0,t.yg)("h3",{id:"minor-changes-5"},"Minor Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"e48c30c: add getDeploymentInfo function")),(0,t.yg)("h3",{id:"patch-changes-11"},"Patch Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"6d8de03: change @constructor to @function and remove /","*",(0,t.yg)("em",{parentName:"li"}," @module Adaptor "),"/")),(0,t.yg)("h2",{id:"120"},"1.2.0"),(0,t.yg)("h3",{id:"minor-changes-6"},"Minor Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"7b5ca3e: add fn and fix adaptors export")),(0,t.yg)("h3",{id:"patch-changes-12"},"Patch Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"4067c28: build ast file"),(0,t.yg)("li",{parentName:"ul"},"f2a91a4: Update package exports"),(0,t.yg)("li",{parentName:"ul"},"Updated dependencies ","[f2a91a4]",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},"@openfn/",(0,t.yg)("a",{parentName:"li",href:"mailto:language-common@1.7.5"},"language-common@1.7.5"))))),(0,t.yg)("h2",{id:"110"},"1.1.0"),(0,t.yg)("h3",{id:"minor-changes-7"},"Minor Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"7fc47d8: Migrate kobotoolbox")),(0,t.yg)("h3",{id:"patch-changes-13"},"Patch Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"8566b26: Fix typings"),(0,t.yg)("li",{parentName:"ul"},"b3d45ff: Fix CJS export of npm package."),(0,t.yg)("li",{parentName:"ul"},"ecf5d30: remove sinon since it was not being used"),(0,t.yg)("li",{parentName:"ul"},"Updated dependencies ","[8566b26]"),(0,t.yg)("li",{parentName:"ul"},"Updated dependencies ","[b3d45ff]"),(0,t.yg)("li",{parentName:"ul"},"Updated dependencies ","[b5eb665]"),(0,t.yg)("li",{parentName:"ul"},"Updated dependencies ","[ecf5d30]",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},"@openfn/",(0,t.yg)("a",{parentName:"li",href:"mailto:language-common@1.7.4"},"language-common@1.7.4"))))))}u.isMDXComponent=!0},15680:(e,a,n)=>{n.d(a,{xA:()=>p,yg:()=>h});var l=n(96540);function t(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function o(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);a&&(l=l.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,l)}return n}function i(e){for(var a=1;a=0||(t[n]=e[n]);return t}(e,a);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(l=0;l=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}var r=l.createContext({}),c=function(e){var a=l.useContext(r),n=a;return e&&(n="function"==typeof e?e(a):i(i({},a),e)),n},p=function(e){var a=c(e.components);return l.createElement(r.Provider,{value:a},e.children)},d="mdxType",u={inlineCode:"code",wrapper:function(e){var a=e.children;return l.createElement(l.Fragment,{},a)}},s=l.forwardRef((function(e,a){var n=e.components,t=e.mdxType,o=e.originalType,r=e.parentName,p=g(e,["components","mdxType","originalType","parentName"]),d=c(n),s=t,h=d["".concat(r,".").concat(s)]||d[s]||u[s]||o;return n?l.createElement(h,i(i({ref:a},p),{},{components:n})):l.createElement(h,i({ref:a},p))}));function h(e,a){var n=arguments,t=a&&a.mdxType;if("string"==typeof e||t){var o=n.length,i=new Array(o);i[0]=s;var g={};for(var r in a)hasOwnProperty.call(a,r)&&(g[r]=a[r]);g.originalType=e,g[d]="string"==typeof e?e:t,i[1]=g;for(var c=2;c{n.r(a),n.d(a,{assets:()=>r,contentTitle:()=>g,default:()=>d,frontMatter:()=>o,metadata:()=>i,toc:()=>c});var l=n(58168),t=(n(96540),n(15680));const o={title:"kobotoolbox changelog",id:"kobotoolbox-changelog",keywords:["adaptor","changelog","kobotoolbox"]},g="Changelog for the kobotoolbox adaptor",i={unversionedId:"packages/kobotoolbox-changelog",id:"packages/kobotoolbox-changelog",title:"kobotoolbox changelog",description:"2.4.3",source:"@site/adaptors/packages/kobotoolbox-changelog.md",sourceDirName:"packages",slug:"/packages/kobotoolbox-changelog",permalink:"/adaptors/packages/kobotoolbox-changelog",draft:!1,tags:[],version:"current",frontMatter:{title:"kobotoolbox changelog",id:"kobotoolbox-changelog",keywords:["adaptor","changelog","kobotoolbox"]},sidebar:"adaptors",previous:{title:"Config for kobotoolbox",permalink:"/adaptors/packages/kobotoolbox-configuration-schema"},next:{title:"kobotoolbox developer readme",permalink:"/adaptors/packages/kobotoolbox-readme"}},r={},c=[{value:"2.4.3",id:"243",level:2},{value:"Patch Changes",id:"patch-changes",level:3},{value:"2.4.2",id:"242",level:2},{value:"Patch Changes",id:"patch-changes-1",level:3},{value:"2.4.1",id:"241",level:2},{value:"Patch Changes",id:"patch-changes-2",level:3},{value:"2.4.0",id:"240",level:2},{value:"Minor Changes",id:"minor-changes",level:3},{value:"Patch Changes",id:"patch-changes-3",level:3},{value:"2.3.0",id:"230",level:2},{value:"Minor Changes",id:"minor-changes-1",level:3},{value:"Patch Changes",id:"patch-changes-4",level:3},{value:"2.2.0",id:"220",level:2},{value:"Minor Changes",id:"minor-changes-2",level:3},{value:"Patch Changes",id:"patch-changes-5",level:3},{value:"2.1.0",id:"210",level:2},{value:"Minor Changes",id:"minor-changes-3",level:3},{value:"2.0.1",id:"201",level:2},{value:"Patch Changes",id:"patch-changes-6",level:3},{value:"2.0.0",id:"200",level:2},{value:"Major Changes",id:"major-changes",level:3},{value:"Patch Changes",id:"patch-changes-7",level:3},{value:"1.3.3",id:"133",level:2},{value:"Patch Changes",id:"patch-changes-8",level:3},{value:"1.3.2",id:"132",level:2},{value:"Patch Changes",id:"patch-changes-9",level:3},{value:"1.3.1",id:"131",level:2},{value:"Patch Changes",id:"patch-changes-10",level:3},{value:"1.3.0",id:"130",level:2},{value:"Minor Changes",id:"minor-changes-4",level:3},{value:"Patch Changes",id:"patch-changes-11",level:3},{value:"1.2.0",id:"120",level:2},{value:"Minor Changes",id:"minor-changes-5",level:3},{value:"Patch Changes",id:"patch-changes-12",level:3},{value:"1.1.0",id:"110",level:2},{value:"Minor Changes",id:"minor-changes-6",level:3},{value:"Patch Changes",id:"patch-changes-13",level:3}],p={toc:c},h="wrapper";function d(e){let{components:a,...n}=e;return(0,t.yg)(h,(0,l.A)({},p,n,{components:a,mdxType:"MDXLayout"}),(0,t.yg)("h1",{id:"changelog-for-the-kobotoolbox-adaptor"},"Changelog for the kobotoolbox adaptor"),(0,t.yg)("h1",{id:"openfnlanguage-kobotoolbox"},"@openfn/language-kobotoolbox"),(0,t.yg)("h2",{id:"243"},"2.4.3"),(0,t.yg)("h3",{id:"patch-changes"},"Patch Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"Security fix: update jsonpath-plus version")),(0,t.yg)("h2",{id:"242"},"2.4.2"),(0,t.yg)("h3",{id:"patch-changes-1"},"Patch Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"8146c23: Fix typings in package.json")),(0,t.yg)("h2",{id:"241"},"2.4.1"),(0,t.yg)("h3",{id:"patch-changes-2"},"Patch Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"73d0a02: Make documentation public"),(0,t.yg)("li",{parentName:"ul"},"Updated dependencies ","[4c08444]"),(0,t.yg)("li",{parentName:"ul"},"Updated dependencies ","[73d0a02]",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},"@openfn/",(0,t.yg)("a",{parentName:"li",href:"mailto:language-common@1.15.1"},"language-common@1.15.1"))))),(0,t.yg)("h2",{id:"240"},"2.4.0"),(0,t.yg)("h3",{id:"minor-changes"},"Minor Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"5fb82f07: Export ",(0,t.yg)("inlineCode",{parentName:"li"},"group")," operation from common")),(0,t.yg)("h3",{id:"patch-changes-3"},"Patch Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"Updated dependencies ","[5fb82f07]",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},"@openfn/",(0,t.yg)("a",{parentName:"li",href:"mailto:language-common@1.15.0"},"language-common@1.15.0"))))),(0,t.yg)("h2",{id:"230"},"2.3.0"),(0,t.yg)("h3",{id:"minor-changes-1"},"Minor Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"73433c20: Add ",(0,t.yg)("inlineCode",{parentName:"li"},"fnIf")," operation")),(0,t.yg)("h3",{id:"patch-changes-4"},"Patch Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"Updated dependencies ","[106ecf6d]",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},"@openfn/",(0,t.yg)("a",{parentName:"li",href:"mailto:language-common@1.14.0"},"language-common@1.14.0"))))),(0,t.yg)("h2",{id:"220"},"2.2.0"),(0,t.yg)("h3",{id:"minor-changes-2"},"Minor Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"bae5d3b6: Add the cursor() function from common. See the job writing guide for\nmore information.")),(0,t.yg)("h3",{id:"patch-changes-5"},"Patch Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"Updated dependencies ","[1ad86651]",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},"@openfn/",(0,t.yg)("a",{parentName:"li",href:"mailto:language-common@1.13.0"},"language-common@1.13.0"))))),(0,t.yg)("h2",{id:"210"},"2.1.0"),(0,t.yg)("h3",{id:"minor-changes-3"},"Minor Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"c85abf3: Removed the API version enum values in the credential configuration\njson schema and added a placeholder")),(0,t.yg)("h2",{id:"201"},"2.0.1"),(0,t.yg)("h3",{id:"patch-changes-6"},"Patch Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"Update lock files"),(0,t.yg)("li",{parentName:"ul"},"Updated dependencies",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},"@openfn/",(0,t.yg)("a",{parentName:"li",href:"mailto:language-common@1.8.1"},"language-common@1.8.1"))))),(0,t.yg)("h2",{id:"200"},"2.0.0"),(0,t.yg)("h3",{id:"major-changes"},"Major Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},(0,t.yg)("p",{parentName:"li"},"2c1d603: Remove parameter reassignment to ensure proper functioning inside an\n",(0,t.yg)("inlineCode",{parentName:"p"},"each")," block; add eslint"),(0,t.yg)("p",{parentName:"li"},"The packages receiving a major bump here exposed functions that didn't work as\nexpected inside ",(0,t.yg)("inlineCode",{parentName:"p"},"each")," blocks. Users were previously wrapping these functions\ninside their own custom ",(0,t.yg)("inlineCode",{parentName:"p"},"fn")," blocks, and this change will ensure that they can\nbe used inside a standard each."),(0,t.yg)("p",{parentName:"li"},"See ",(0,t.yg)("a",{parentName:"p",href:"https://github.com/OpenFn/adaptors/issues/275"},"https://github.com/OpenFn/adaptors/issues/275")," for more details."))),(0,t.yg)("h3",{id:"patch-changes-7"},"Patch Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"Updated dependencies ","[2c1d603]",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},"@openfn/",(0,t.yg)("a",{parentName:"li",href:"mailto:language-common@1.8.0"},"language-common@1.8.0"))))),(0,t.yg)("h2",{id:"133"},"1.3.3"),(0,t.yg)("h3",{id:"patch-changes-8"},"Patch Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"14f481e: mark execute as private"),(0,t.yg)("li",{parentName:"ul"},"Updated dependencies ","[2b4c61a]",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},"@openfn/",(0,t.yg)("a",{parentName:"li",href:"mailto:language-common@1.7.6"},"language-common@1.7.6"))))),(0,t.yg)("h2",{id:"132"},"1.3.2"),(0,t.yg)("h3",{id:"patch-changes-9"},"Patch Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"f7ebd3c: remove sample configuration")),(0,t.yg)("h2",{id:"131"},"1.3.1"),(0,t.yg)("h3",{id:"patch-changes-10"},"Patch Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"f2aed32: add examples")),(0,t.yg)("h2",{id:"130"},"1.3.0"),(0,t.yg)("h3",{id:"minor-changes-4"},"Minor Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"e48c30c: add getDeploymentInfo function")),(0,t.yg)("h3",{id:"patch-changes-11"},"Patch Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"6d8de03: change @constructor to @function and remove /","*",(0,t.yg)("em",{parentName:"li"}," @module Adaptor "),"/")),(0,t.yg)("h2",{id:"120"},"1.2.0"),(0,t.yg)("h3",{id:"minor-changes-5"},"Minor Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"7b5ca3e: add fn and fix adaptors export")),(0,t.yg)("h3",{id:"patch-changes-12"},"Patch Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"4067c28: build ast file"),(0,t.yg)("li",{parentName:"ul"},"f2a91a4: Update package exports"),(0,t.yg)("li",{parentName:"ul"},"Updated dependencies ","[f2a91a4]",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},"@openfn/",(0,t.yg)("a",{parentName:"li",href:"mailto:language-common@1.7.5"},"language-common@1.7.5"))))),(0,t.yg)("h2",{id:"110"},"1.1.0"),(0,t.yg)("h3",{id:"minor-changes-6"},"Minor Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"7fc47d8: Migrate kobotoolbox")),(0,t.yg)("h3",{id:"patch-changes-13"},"Patch Changes"),(0,t.yg)("ul",null,(0,t.yg)("li",{parentName:"ul"},"8566b26: Fix typings"),(0,t.yg)("li",{parentName:"ul"},"b3d45ff: Fix CJS export of npm package."),(0,t.yg)("li",{parentName:"ul"},"ecf5d30: remove sinon since it was not being used"),(0,t.yg)("li",{parentName:"ul"},"Updated dependencies ","[8566b26]"),(0,t.yg)("li",{parentName:"ul"},"Updated dependencies ","[b3d45ff]"),(0,t.yg)("li",{parentName:"ul"},"Updated dependencies ","[b5eb665]"),(0,t.yg)("li",{parentName:"ul"},"Updated dependencies ","[ecf5d30]",(0,t.yg)("ul",{parentName:"li"},(0,t.yg)("li",{parentName:"ul"},"@openfn/",(0,t.yg)("a",{parentName:"li",href:"mailto:language-common@1.7.4"},"language-common@1.7.4"))))))}d.isMDXComponent=!0},15680:(e,a,n)=>{n.d(a,{xA:()=>p,yg:()=>s});var l=n(96540);function t(e,a,n){return a in e?Object.defineProperty(e,a,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[a]=n,e}function o(e,a){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);a&&(l=l.filter((function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable}))),n.push.apply(n,l)}return n}function g(e){for(var a=1;a=0||(t[n]=e[n]);return t}(e,a);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(l=0;l=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}var r=l.createContext({}),c=function(e){var a=l.useContext(r),n=a;return e&&(n="function"==typeof e?e(a):g(g({},a),e)),n},p=function(e){var a=c(e.components);return l.createElement(r.Provider,{value:a},e.children)},h="mdxType",d={inlineCode:"code",wrapper:function(e){var a=e.children;return l.createElement(l.Fragment,{},a)}},u=l.forwardRef((function(e,a){var n=e.components,t=e.mdxType,o=e.originalType,r=e.parentName,p=i(e,["components","mdxType","originalType","parentName"]),h=c(n),u=t,s=h["".concat(r,".").concat(u)]||h[u]||d[u]||o;return n?l.createElement(s,g(g({ref:a},p),{},{components:n})):l.createElement(s,g({ref:a},p))}));function s(e,a){var n=arguments,t=a&&a.mdxType;if("string"==typeof e||t){var o=n.length,g=new Array(o);g[0]=u;var i={};for(var r in a)hasOwnProperty.call(a,r)&&(i[r]=a[r]);i.originalType=e,i[h]="string"==typeof e?e:t,g[1]=i;for(var c=2;c{a.r(t),a.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>_,frontMatter:()=>i,metadata:()=>s,toc:()=>c});var n=a(58168),r=(a(96540),a(15680));const i={title:"Upsert Register Participant",sidebar_label:"Upsert Register Participant",id:"Upsert-Register-Participant-2021-04-28",keywords:["library","job","expression","salesforce","dataPath","dataValue","each","field","fields","lastReferenceValue","map","merge","query","relationship","upsert","Array"]},o=void 0,s={unversionedId:"library/jobs/auto/Upsert-Register-Participant-2021-04-28",id:"library/jobs/auto/Upsert-Register-Participant-2021-04-28",title:"Upsert Register Participant",description:"This job was provided by an OpenFn.org user via the job library API.",source:"@site/adaptors/library/jobs/auto/Upsert-Register-Participant-2021-04-28.md",sourceDirName:"library/jobs/auto",slug:"/library/jobs/auto/Upsert-Register-Participant-2021-04-28",permalink:"/adaptors/library/jobs/auto/Upsert-Register-Participant-2021-04-28",draft:!1,tags:[],version:"current",frontMatter:{title:"Upsert Register Participant",sidebar_label:"Upsert Register Participant",id:"Upsert-Register-Participant-2021-04-28",keywords:["library","job","expression","salesforce","dataPath","dataValue","each","field","fields","lastReferenceValue","map","merge","query","relationship","upsert","Array"]},sidebar:"adaptors",previous:{title:"Upsert Register Participant Skillz",permalink:"/adaptors/library/jobs/auto/Upsert-Register-Participant-Skillz-2021-08-30"},next:{title:"Upsert Register Event",permalink:"/adaptors/library/jobs/auto/Upsert-Register-Event-2021-04-30"}},l={},c=[{value:"Metadata",id:"metadata",level:2},{value:"Key Functions",id:"key-functions",level:2},{value:"Expression",id:"expression",level:2}],p={toc:c},d="wrapper";function _(e){let{components:t,...a}=e;return(0,r.yg)(d,(0,n.A)({},p,a,{components:t,mdxType:"MDXLayout"}),(0,r.yg)("em",null,"This job was provided by an OpenFn.org user via the job library API."),(0,r.yg)("h2",{id:"metadata"},"Metadata"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},"Name: Upsert Register Participant"),(0,r.yg)("li",{parentName:"ul"},"Adaptor: ",(0,r.yg)("a",{parentName:"li",href:"https://www.github.com/openfn/language-salesforce"},(0,r.yg)("inlineCode",{parentName:"a"},"@openfn/language-salesforce"))),(0,r.yg)("li",{parentName:"ul"},"Adaptor Version: ",(0,r.yg)("a",{parentName:"li",href:"https://www.github.com/openfn/language-salesforce/releases/tag/v4.3.0"},(0,r.yg)("inlineCode",{parentName:"a"},"v4.3.0"))),(0,r.yg)("li",{parentName:"ul"},"Created almost 4 years ago"),(0,r.yg)("li",{parentName:"ul"},"Updated 15 days ago"),(0,r.yg)("li",{parentName:"ul"},"Score: ",(0,r.yg)("b",null,"72")," (an ",(0,r.yg)("a",{parentName:"li",href:"/adaptors/library/#library-scores"},"indicator")," of how useful this job may be)")),(0,r.yg)("h2",{id:"key-functions"},"Key Functions"),(0,r.yg)("p",null,(0,r.yg)("inlineCode",{parentName:"p"},"dataPath"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"dataValue"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"each"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"field"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"fields"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"lastReferenceValue"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"map"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"merge"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"query"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"relationship"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"upsert"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"Array")),(0,r.yg)("h2",{id:"expression"},"Expression"),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-js"},"query(\n `SELECT Id, Name, CommCare_Ext_ID__c FROM Event__c WHERE CommCare_Case_ID__c = '${state.data.form.case['@case_id']}'`\n);\n\nfn(state => {\n // Note: lastReferenceValue selects the first item in the references array.\n state.data.eventName = lastReferenceValue('records[0].CommCare_Ext_ID__c')(state);\n state.data.eventCase = dataValue('form.case.@case_id')(state);\n\n function objectToArray(object) {\n return !Array.isArray(object) ? [object] : object;\n }\n\n const { form } = state.data;\n if (form.question1) {\n console.log('Ensuring that \"question1\" is an array.');\n form.question1 = objectToArray(form.question1);\n } else if (!form.new_participants) {\n console.log('Nothing to upsert. No participants were registered');\n } else {\n console.log('Shifting \"new_participants\" to \"question1\" array.');\n form.question1 = objectToArray(form.new_participants);\n console.log('Creating a \"case\" object inside each item in that array.');\n form.question1 = form.question1.map(item => ({\n ...item,\n case: item.create_skillz_plus_participant.case,\n }));\n }\n\n console.log('Done with initial data manipulation.');\n const persons = merge(\n dataPath('form.question1[*]'),\n fields(field('intervention_notes_to_save', dataValue('form.intervention_notes_to_save')))\n )(state);\n\n const attendances = merge(\n dataPath('form.question1[*]'),\n fields(\n field('intervention_name', dataValue('form.intervention_name')),\n field('eventCase', dataValue('eventCase')),\n field('eventName', dataValue('eventName'))\n )\n )(state);\n\n return { ...state, persons, attendances };\n});\n\neach(\n 'persons[*]',\n upsert(\n 'Person__c',\n 'Participant_Identification_Number_PID__c',\n fields(\n field('Notes__c', dataValue('intervention_notes_to_save')),\n field('First_Name__c', dataValue('participant_first_name')),\n field('Surname__c', dataValue('participant_surname')),\n relationship('RecordType', 'Name', 'Participant'),\n relationship('Site__r', 'CommCare_Ext_ID__c', dataValue('grp_location.site_id')),\n field('Participant_Identification_Number_PID__c', state => state.data.case['@case_id']),\n field('Sex__c', dataValue('gender')),\n field('Mobile_Number_1__c', dataValue('mobile_number')), //QUESTION: In CommCare, phone doesn't look like it's saving?\n field('School_name_person__c', dataValue('school_name')),\n field('Date_of_Birth__c', dataValue('date_of_birth')),\n field('School_name_person__c', dataValue('school_name')),\n field('Physical_Address__c', dataValue('participants_home_address')),\n field('Age_1_0__c', dataValue('participants_age_to_save'))\n )\n )\n);\n\neach(\n 'attendances[*]',\n upsert(\n 'Attendance__c',\n 'CommCare_Ext_ID__c',\n fields(\n field('CommCare_Ext_ID__c', state => {\n const eventid = toUTF8(`${state.data.intervention_name}` || `${state.data.eventName}`); //dataValue('intervention_name')(state) || `${state.data.eventName}`;\n const personid = state.data.case['@case_id'];\n const value = personid + '-' + eventid.replace(/\\//gi, '');\n return scrubEmojis(value, '');\n }),\n relationship(\n //Attendance looks up to Persn via the case_id\n 'Person_Attendance__r',\n 'Participant_Identification_Number_PID__c',\n state => state.data.case['@case_id']\n ),\n relationship(\n //Attendance looks up to Event via the Event case_id\n 'Event__r',\n 'CommCare_Case_ID__c',\n state => `${state.data.eventCase}`\n ),\n // relationship(\n // //Attendance looks up to Event via the intervention_name\n // 'Event__r',\n // 'CommCare_Ext_ID__c',\n // state => `${state.data.intervention_name}` || `${state.data.eventName}`\n // ),\n field('Date_of_Birth__c', dataValue('date_of_birth'))\n )\n )\n);\n\n//First we insert Person record\n// fn(state => {\n// return upsert(\n// 'Person__c',\n// 'Participant_Identification_Number_PID__c',\n// fields(\n// field('Notes__c', dataValue('form.intervention_notes_to_save')),\n// field('First_Name__c', dataValue('form.question1.participant_first_name')),\n// field('Surname__c', dataValue('form.question1.participant_surname')),\n// relationship('RecordType', 'Name', 'Participant'),\n// field('Participant_Identification_Number_PID__c', state => state.data.case['@case_id']),\n// field('Sex__c', dataValue('form.question1.gender')),\n// //field('Age__c', dataValue('form.question1.age_in_years')), //This is a SF formula field, cannot map\n// field('Mobile_Number_1__c', dataValue('form.question1.mobile_number')),\n// field('School_name_person__c', dataValue('form.question1.school_name'))\n// )\n// )(state);\n// });\n\n// fn(state => {\n// //Then we upsert related Attendance records\n// return upsert(\n// 'Attendance__c',\n// 'CommCare_Ext_ID__c',\n// fields(\n// field('CommCare_Ext_ID__c', state => {\n// var eventid = dataValue('form.intervention_name')(state);\n// var personid = dataValue('form.case.@case_id')(state);\n// return personid + '-' + eventid;\n// }),\n// relationship(\n// //Attendance looks up to Persn via the case_id\n// 'Person_Attendance__r',\n// 'Participant_Identification_Number_PID__c',\n// dataValue('form.case.@case_id')\n// ),\n// relationship(\n// //Attendance looks up to Event via the intervention_name\n// 'Event__r',\n// 'Name',\n// dataValue('form.intervention_name')\n// ),\n// field('Date_of_Birth__c', dataValue('form.question1.date_of_birth'))\n// )\n// )(state);\n// });\n\n")))}_.isMDXComponent=!0},15680:(e,t,a)=>{a.d(t,{xA:()=>p,yg:()=>m});var n=a(96540);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function i(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function o(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var l=n.createContext({}),c=function(e){var t=n.useContext(l),a=t;return e&&(a="function"==typeof e?e(t):o(o({},t),e)),a},p=function(e){var t=c(e.components);return n.createElement(l.Provider,{value:t},e.children)},d="mdxType",_={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},u=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,i=e.originalType,l=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),d=c(a),u=r,m=d["".concat(l,".").concat(u)]||d[u]||_[u]||i;return a?n.createElement(m,o(o({ref:t},p),{},{components:a})):n.createElement(m,o({ref:t},p))}));function m(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=a.length,o=new Array(i);o[0]=u;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[d]="string"==typeof e?e:r,o[1]=s;for(var c=2;c{a.r(t),a.d(t,{assets:()=>l,contentTitle:()=>o,default:()=>_,frontMatter:()=>i,metadata:()=>s,toc:()=>c});var n=a(58168),r=(a(96540),a(15680));const i={title:"Upsert Register Participant",sidebar_label:"Upsert Register Participant",id:"Upsert-Register-Participant-2021-04-28",keywords:["library","job","expression","salesforce","dataPath","dataValue","each","field","fields","lastReferenceValue","map","merge","query","relationship","upsert","Array"]},o=void 0,s={unversionedId:"library/jobs/auto/Upsert-Register-Participant-2021-04-28",id:"library/jobs/auto/Upsert-Register-Participant-2021-04-28",title:"Upsert Register Participant",description:"This job was provided by an OpenFn.org user via the job library API.",source:"@site/adaptors/library/jobs/auto/Upsert-Register-Participant-2021-04-28.md",sourceDirName:"library/jobs/auto",slug:"/library/jobs/auto/Upsert-Register-Participant-2021-04-28",permalink:"/adaptors/library/jobs/auto/Upsert-Register-Participant-2021-04-28",draft:!1,tags:[],version:"current",frontMatter:{title:"Upsert Register Participant",sidebar_label:"Upsert Register Participant",id:"Upsert-Register-Participant-2021-04-28",keywords:["library","job","expression","salesforce","dataPath","dataValue","each","field","fields","lastReferenceValue","map","merge","query","relationship","upsert","Array"]},sidebar:"adaptors",previous:{title:"Upsert Register Participant Skillz",permalink:"/adaptors/library/jobs/auto/Upsert-Register-Participant-Skillz-2021-08-30"},next:{title:"Upsert Register Event",permalink:"/adaptors/library/jobs/auto/Upsert-Register-Event-2021-04-30"}},l={},c=[{value:"Metadata",id:"metadata",level:2},{value:"Key Functions",id:"key-functions",level:2},{value:"Expression",id:"expression",level:2}],p={toc:c},d="wrapper";function _(e){let{components:t,...a}=e;return(0,r.yg)(d,(0,n.A)({},p,a,{components:t,mdxType:"MDXLayout"}),(0,r.yg)("em",null,"This job was provided by an OpenFn.org user via the job library API."),(0,r.yg)("h2",{id:"metadata"},"Metadata"),(0,r.yg)("ul",null,(0,r.yg)("li",{parentName:"ul"},"Name: Upsert Register Participant"),(0,r.yg)("li",{parentName:"ul"},"Adaptor: ",(0,r.yg)("a",{parentName:"li",href:"https://www.github.com/openfn/language-salesforce"},(0,r.yg)("inlineCode",{parentName:"a"},"@openfn/language-salesforce"))),(0,r.yg)("li",{parentName:"ul"},"Adaptor Version: ",(0,r.yg)("a",{parentName:"li",href:"https://www.github.com/openfn/language-salesforce/releases/tag/v4.3.0"},(0,r.yg)("inlineCode",{parentName:"a"},"v4.3.0"))),(0,r.yg)("li",{parentName:"ul"},"Created almost 4 years ago"),(0,r.yg)("li",{parentName:"ul"},"Updated 15 days ago"),(0,r.yg)("li",{parentName:"ul"},"Score: ",(0,r.yg)("b",null,"73")," (an ",(0,r.yg)("a",{parentName:"li",href:"/adaptors/library/#library-scores"},"indicator")," of how useful this job may be)")),(0,r.yg)("h2",{id:"key-functions"},"Key Functions"),(0,r.yg)("p",null,(0,r.yg)("inlineCode",{parentName:"p"},"dataPath"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"dataValue"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"each"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"field"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"fields"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"lastReferenceValue"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"map"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"merge"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"query"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"relationship"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"upsert"),", ",(0,r.yg)("inlineCode",{parentName:"p"},"Array")),(0,r.yg)("h2",{id:"expression"},"Expression"),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-js"},"query(\n `SELECT Id, Name, CommCare_Ext_ID__c FROM Event__c WHERE CommCare_Case_ID__c = '${state.data.form.case['@case_id']}'`\n);\n\nfn(state => {\n // Note: lastReferenceValue selects the first item in the references array.\n state.data.eventName = lastReferenceValue('records[0].CommCare_Ext_ID__c')(state);\n state.data.eventCase = dataValue('form.case.@case_id')(state);\n\n function objectToArray(object) {\n return !Array.isArray(object) ? [object] : object;\n }\n\n const { form } = state.data;\n if (form.question1) {\n console.log('Ensuring that \"question1\" is an array.');\n form.question1 = objectToArray(form.question1);\n } else if (!form.new_participants) {\n console.log('Nothing to upsert. No participants were registered');\n } else {\n console.log('Shifting \"new_participants\" to \"question1\" array.');\n form.question1 = objectToArray(form.new_participants);\n console.log('Creating a \"case\" object inside each item in that array.');\n form.question1 = form.question1.map(item => ({\n ...item,\n case: item.create_skillz_plus_participant.case,\n }));\n }\n\n console.log('Done with initial data manipulation.');\n const persons = merge(\n dataPath('form.question1[*]'),\n fields(field('intervention_notes_to_save', dataValue('form.intervention_notes_to_save')))\n )(state);\n\n const attendances = merge(\n dataPath('form.question1[*]'),\n fields(\n field('intervention_name', dataValue('form.intervention_name')),\n field('eventCase', dataValue('eventCase')),\n field('eventName', dataValue('eventName'))\n )\n )(state);\n\n return { ...state, persons, attendances };\n});\n\neach(\n 'persons[*]',\n upsert(\n 'Person__c',\n 'Participant_Identification_Number_PID__c',\n fields(\n field('Notes__c', dataValue('intervention_notes_to_save')),\n field('First_Name__c', dataValue('participant_first_name')),\n field('Surname__c', dataValue('participant_surname')),\n relationship('RecordType', 'Name', 'Participant'),\n relationship('Site__r', 'CommCare_Ext_ID__c', dataValue('grp_location.site_id')),\n field('Participant_Identification_Number_PID__c', state => state.data.case['@case_id']),\n field('Sex__c', dataValue('gender')),\n field('Mobile_Number_1__c', dataValue('mobile_number')), //QUESTION: In CommCare, phone doesn't look like it's saving?\n field('School_name_person__c', dataValue('school_name')),\n field('Date_of_Birth__c', dataValue('date_of_birth')),\n field('School_name_person__c', dataValue('school_name')),\n field('Physical_Address__c', dataValue('participants_home_address')),\n field('Age_1_0__c', dataValue('participants_age_to_save'))\n )\n )\n);\n\neach(\n 'attendances[*]',\n upsert(\n 'Attendance__c',\n 'CommCare_Ext_ID__c',\n fields(\n field('CommCare_Ext_ID__c', state => {\n const eventid = toUTF8(`${state.data.intervention_name}` || `${state.data.eventName}`); //dataValue('intervention_name')(state) || `${state.data.eventName}`;\n const personid = state.data.case['@case_id'];\n const value = personid + '-' + eventid.replace(/\\//gi, '');\n return scrubEmojis(value, '');\n }),\n relationship(\n //Attendance looks up to Persn via the case_id\n 'Person_Attendance__r',\n 'Participant_Identification_Number_PID__c',\n state => state.data.case['@case_id']\n ),\n relationship(\n //Attendance looks up to Event via the Event case_id\n 'Event__r',\n 'CommCare_Case_ID__c',\n state => `${state.data.eventCase}`\n ),\n // relationship(\n // //Attendance looks up to Event via the intervention_name\n // 'Event__r',\n // 'CommCare_Ext_ID__c',\n // state => `${state.data.intervention_name}` || `${state.data.eventName}`\n // ),\n field('Date_of_Birth__c', dataValue('date_of_birth'))\n )\n )\n);\n\n//First we insert Person record\n// fn(state => {\n// return upsert(\n// 'Person__c',\n// 'Participant_Identification_Number_PID__c',\n// fields(\n// field('Notes__c', dataValue('form.intervention_notes_to_save')),\n// field('First_Name__c', dataValue('form.question1.participant_first_name')),\n// field('Surname__c', dataValue('form.question1.participant_surname')),\n// relationship('RecordType', 'Name', 'Participant'),\n// field('Participant_Identification_Number_PID__c', state => state.data.case['@case_id']),\n// field('Sex__c', dataValue('form.question1.gender')),\n// //field('Age__c', dataValue('form.question1.age_in_years')), //This is a SF formula field, cannot map\n// field('Mobile_Number_1__c', dataValue('form.question1.mobile_number')),\n// field('School_name_person__c', dataValue('form.question1.school_name'))\n// )\n// )(state);\n// });\n\n// fn(state => {\n// //Then we upsert related Attendance records\n// return upsert(\n// 'Attendance__c',\n// 'CommCare_Ext_ID__c',\n// fields(\n// field('CommCare_Ext_ID__c', state => {\n// var eventid = dataValue('form.intervention_name')(state);\n// var personid = dataValue('form.case.@case_id')(state);\n// return personid + '-' + eventid;\n// }),\n// relationship(\n// //Attendance looks up to Persn via the case_id\n// 'Person_Attendance__r',\n// 'Participant_Identification_Number_PID__c',\n// dataValue('form.case.@case_id')\n// ),\n// relationship(\n// //Attendance looks up to Event via the intervention_name\n// 'Event__r',\n// 'Name',\n// dataValue('form.intervention_name')\n// ),\n// field('Date_of_Birth__c', dataValue('form.question1.date_of_birth'))\n// )\n// )(state);\n// });\n\n")))}_.isMDXComponent=!0},15680:(e,t,a)=>{a.d(t,{xA:()=>p,yg:()=>m});var n=a(96540);function r(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function i(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function o(e){for(var t=1;t=0||(r[a]=e[a]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(r[a]=e[a])}return r}var l=n.createContext({}),c=function(e){var t=n.useContext(l),a=t;return e&&(a="function"==typeof e?e(t):o(o({},t),e)),a},p=function(e){var t=c(e.components);return n.createElement(l.Provider,{value:t},e.children)},d="mdxType",_={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},u=n.forwardRef((function(e,t){var a=e.components,r=e.mdxType,i=e.originalType,l=e.parentName,p=s(e,["components","mdxType","originalType","parentName"]),d=c(a),u=r,m=d["".concat(l,".").concat(u)]||d[u]||_[u]||i;return a?n.createElement(m,o(o({ref:t},p),{},{components:a})):n.createElement(m,o({ref:t},p))}));function m(e,t){var a=arguments,r=t&&t.mdxType;if("string"==typeof e||r){var i=a.length,o=new Array(i);o[0]=u;var s={};for(var l in t)hasOwnProperty.call(t,l)&&(s[l]=t[l]);s.originalType=e,s[d]="string"==typeof e?e:r,o[1]=s;for(var c=2;c{a.r(t),a.d(t,{assets:()=>p,contentTitle:()=>o,default:()=>u,frontMatter:()=>r,metadata:()=>g,toc:()=>y});var n=a(58168),l=(a(96540),a(15680));const r={title:"kobotoolbox@3.0.0",id:"kobotoolbox-docs",keywords:["adaptor","kobotoolbox","getDeploymentInfo","getForms","getSubmissions"]},o=void 0,g={unversionedId:"packages/kobotoolbox-docs",id:"packages/kobotoolbox-docs",title:"kobotoolbox@3.0.0",description:"getDeploymentInfo(formId)",source:"@site/adaptors/packages/kobotoolbox-docs.md",sourceDirName:"packages",slug:"/packages/kobotoolbox-docs",permalink:"/adaptors/packages/kobotoolbox-docs",draft:!1,tags:[],version:"current",frontMatter:{title:"kobotoolbox@3.0.0",id:"kobotoolbox-docs",keywords:["adaptor","kobotoolbox","getDeploymentInfo","getForms","getSubmissions"]},sidebar:"adaptors",previous:{title:"Kobo Toolbox",permalink:"/adaptors/kobotoolbox"},next:{title:"Config for kobotoolbox",permalink:"/adaptors/packages/kobotoolbox-configuration-schema"}},p={},y=[{value:"Functions",id:"functions",level:2},{value:"getDeploymentInfo",id:"getdeploymentinfo",level:3},{value:"getForms",id:"getforms",level:3},{value:"getSubmissions",id:"getsubmissions",level:3},{value:"http",id:"http",level:2},{value:"http.get",id:"http_get",level:3},{value:"http.post",id:"http_post",level:3},{value:"http.put",id:"http_put",level:3},{value:"Interfaces",id:"interfaces",level:2},{value:"KoboToolboxHttpState",id:"kobotoolboxhttpstate",level:3},{value:"RequestOptions",id:"requestoptions",level:3},{value:"RequestOptions",id:"requestoptions-1",level:3}],s={toc:y},i="wrapper";function u(e){let{components:t,...a}=e;return(0,l.yg)(i,(0,n.A)({},s,a,{components:t,mdxType:"MDXLayout"}),(0,l.yg)("dl",null,(0,l.yg)("dt",null,(0,l.yg)("a",{href:"#getdeploymentinfo"},"getDeploymentInfo(formId)")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"#getforms"},"getForms()")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"#getsubmissions"},"getSubmissions(formId, [options])"))),(0,l.yg)("p",null,"This adaptor exports the following namespaced functions:"),(0,l.yg)("dl",null,(0,l.yg)("dt",null,(0,l.yg)("a",{href:"#http_get"},"http.get(path, [options])")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"#http_post"},"http.post(path, data, [options])")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"#http_put"},"http.put(path, data, [options])"))),(0,l.yg)("p",null,"This adaptor exports the following from common:"),(0,l.yg)("dl",null,(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#alterstate"},"alterState()")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#cursor"},"cursor()")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#datapath"},"dataPath()")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#datavalue"},"dataValue()")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#each"},"each()")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#field"},"field()")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#fields"},"fields()")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#fn"},"fn()")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#fnif"},"fnIf()")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#group"},"group()")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#http"},"http")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#lastreferencevalue"},"lastReferenceValue()")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#merge"},"merge()")),(0,l.yg)("dt",null,(0,l.yg)("a",{href:"/adaptors/packages/common-docs#sourcevalue"},"sourceValue()"))),(0,l.yg)("h2",{id:"functions"},"Functions"),(0,l.yg)("h3",{id:"getdeploymentinfo"},"getDeploymentInfo"),(0,l.yg)("p",null,(0,l.yg)("code",null,"getDeploymentInfo(formId) \u21d2 Operation")),(0,l.yg)("p",null,"Get deployment information for a specific form. Calls ",(0,l.yg)("inlineCode",{parentName:"p"},"/api/v2/assets//deployment/"),"."),(0,l.yg)("table",null,(0,l.yg)("thead",{parentName:"table"},(0,l.yg)("tr",{parentName:"thead"},(0,l.yg)("th",{parentName:"tr",align:null},"Param"),(0,l.yg)("th",{parentName:"tr",align:null},"Type"),(0,l.yg)("th",{parentName:"tr",align:null},"Description"))),(0,l.yg)("tbody",{parentName:"table"},(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"formId"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"string")),(0,l.yg)("td",{parentName:"tr",align:null},"Form Id to get the deployment information")))),(0,l.yg)("p",null,"This operation writes the following keys to state:"),(0,l.yg)("table",null,(0,l.yg)("thead",{parentName:"table"},(0,l.yg)("tr",{parentName:"thead"},(0,l.yg)("th",{parentName:"tr",align:null},"State Key"),(0,l.yg)("th",{parentName:"tr",align:null},"Description"))),(0,l.yg)("tbody",{parentName:"table"},(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"data"),(0,l.yg)("td",{parentName:"tr",align:null},"an object containing deployment information")))),(0,l.yg)("p",null,(0,l.yg)("strong",{parentName:"p"},"Example")),(0,l.yg)("pre",null,(0,l.yg)("code",{parentName:"pre",className:"language-js"},"getDeploymentInfo('aXecHjmbATuF6iGFmvBLBX');\n")),(0,l.yg)("hr",null),(0,l.yg)("h3",{id:"getforms"},"getForms"),(0,l.yg)("p",null,(0,l.yg)("code",null,"getForms() \u21d2 Operation")),(0,l.yg)("p",null,"Make a request to fetch all survey forms accessible to the authorized user. Calls ",(0,l.yg)("inlineCode",{parentName:"p"},"/api/v2/assets/?asset_type=survey"),"."),(0,l.yg)("p",null,"This operation writes the following keys to state:"),(0,l.yg)("table",null,(0,l.yg)("thead",{parentName:"table"},(0,l.yg)("tr",{parentName:"thead"},(0,l.yg)("th",{parentName:"tr",align:null},"State Key"),(0,l.yg)("th",{parentName:"tr",align:null},"Description"))),(0,l.yg)("tbody",{parentName:"table"},(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"data"),(0,l.yg)("td",{parentName:"tr",align:null},"an array of form objects")))),(0,l.yg)("p",null,(0,l.yg)("strong",{parentName:"p"},"Example")),(0,l.yg)("pre",null,(0,l.yg)("code",{parentName:"pre",className:"language-js"},"getForms();\n")),(0,l.yg)("hr",null),(0,l.yg)("h3",{id:"getsubmissions"},"getSubmissions"),(0,l.yg)("p",null,(0,l.yg)("code",null,"getSubmissions(formId, [options]) \u21d2 Operation")),(0,l.yg)("p",null,"Get submissions for a specific form. Calls ",(0,l.yg)("inlineCode",{parentName:"p"},"/api/v2/assets//data/"),"."),(0,l.yg)("table",null,(0,l.yg)("thead",{parentName:"table"},(0,l.yg)("tr",{parentName:"thead"},(0,l.yg)("th",{parentName:"tr",align:null},"Param"),(0,l.yg)("th",{parentName:"tr",align:null},"Type"),(0,l.yg)("th",{parentName:"tr",align:null},"Default"),(0,l.yg)("th",{parentName:"tr",align:null},"Description"))),(0,l.yg)("tbody",{parentName:"table"},(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"formId"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"string")),(0,l.yg)("td",{parentName:"tr",align:null}),(0,l.yg)("td",{parentName:"tr",align:null},"Form Id to get the specific submissions")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"[options]"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"object")),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"{}")),(0,l.yg)("td",{parentName:"tr",align:null},"Optional query params for the request")))),(0,l.yg)("p",null,"This operation writes the following keys to state:"),(0,l.yg)("table",null,(0,l.yg)("thead",{parentName:"table"},(0,l.yg)("tr",{parentName:"thead"},(0,l.yg)("th",{parentName:"tr",align:null},"State Key"),(0,l.yg)("th",{parentName:"tr",align:null},"Description"))),(0,l.yg)("tbody",{parentName:"table"},(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"data"),(0,l.yg)("td",{parentName:"tr",align:null},"an array of submission objects")))),(0,l.yg)("p",null,(0,l.yg)("strong",{parentName:"p"},"Example:")," Get all submissions for a specific form"),(0,l.yg)("pre",null,(0,l.yg)("code",{parentName:"pre",className:"language-js"},"getSubmissions('aXecHjmbATuF6iGFmvBLBX');\n")),(0,l.yg)("p",null,(0,l.yg)("strong",{parentName:"p"},"Example:")," Get form submissions with a query"),(0,l.yg)("pre",null,(0,l.yg)("code",{parentName:"pre",className:"language-js"},"getSubmissions('aXecHjmbATuF6iGFmvBLBX', { query: { _submission_time:{ $gte: \"2022-06-12T21:54:20\" } } });\n")),(0,l.yg)("hr",null),(0,l.yg)("h2",{id:"http"},"http"),(0,l.yg)("p",null,"These functions belong to the http namespace."),(0,l.yg)("h3",{id:"http_get"},"http.get"),(0,l.yg)("p",null,(0,l.yg)("code",null,"get(path, [options]) \u21d2 operation")),(0,l.yg)("p",null,"Make a GET request to any KoboToolbox endpoint."),(0,l.yg)("table",null,(0,l.yg)("thead",{parentName:"table"},(0,l.yg)("tr",{parentName:"thead"},(0,l.yg)("th",{parentName:"tr",align:null},"Param"),(0,l.yg)("th",{parentName:"tr",align:null},"Type"),(0,l.yg)("th",{parentName:"tr",align:null},"Default"),(0,l.yg)("th",{parentName:"tr",align:null},"Description"))),(0,l.yg)("tbody",{parentName:"table"},(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"path"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"string")),(0,l.yg)("td",{parentName:"tr",align:null}),(0,l.yg)("td",{parentName:"tr",align:null},"path to resource")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"[options]"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("a",{parentName:"td",href:"#requestoptions"},(0,l.yg)("code",null,"RequestOptions"))),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"{}")),(0,l.yg)("td",{parentName:"tr",align:null},"An object containing query params and headers for the request")))),(0,l.yg)("p",null,"This operation writes the following keys to state:"),(0,l.yg)("table",null,(0,l.yg)("thead",{parentName:"table"},(0,l.yg)("tr",{parentName:"thead"},(0,l.yg)("th",{parentName:"tr",align:null},"State Key"),(0,l.yg)("th",{parentName:"tr",align:null},"Description"))),(0,l.yg)("tbody",{parentName:"table"},(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"data"),(0,l.yg)("td",{parentName:"tr",align:null},"The response body (as JSON)")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"response"),(0,l.yg)("td",{parentName:"tr",align:null},"The HTTP response from the KoboToolbox server (excluding the body). Responses will be returned in JSON format")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"references"),(0,l.yg)("td",{parentName:"tr",align:null},"An array of all previous data objects used in the Job")))),(0,l.yg)("p",null,(0,l.yg)("strong",{parentName:"p"},"Example:")," GET assets resource"),(0,l.yg)("pre",null,(0,l.yg)("code",{parentName:"pre",className:"language-js"},'http.get(\n "/assets/",\n )\n')),(0,l.yg)("hr",null),(0,l.yg)("h3",{id:"http_post"},"http.post"),(0,l.yg)("p",null,(0,l.yg)("code",null,"post(path, data, [options]) \u21d2 operation")),(0,l.yg)("p",null,"Make a POST request to a KoboToolbox endpoint"),(0,l.yg)("table",null,(0,l.yg)("thead",{parentName:"table"},(0,l.yg)("tr",{parentName:"thead"},(0,l.yg)("th",{parentName:"tr",align:null},"Param"),(0,l.yg)("th",{parentName:"tr",align:null},"Type"),(0,l.yg)("th",{parentName:"tr",align:null},"Default"),(0,l.yg)("th",{parentName:"tr",align:null},"Description"))),(0,l.yg)("tbody",{parentName:"table"},(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"path"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"string")),(0,l.yg)("td",{parentName:"tr",align:null}),(0,l.yg)("td",{parentName:"tr",align:null},"path to resource")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"data"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"any")),(0,l.yg)("td",{parentName:"tr",align:null}),(0,l.yg)("td",{parentName:"tr",align:null},"the body data in JSON format")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"[options]"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("a",{parentName:"td",href:"#requestoptions"},(0,l.yg)("code",null,"RequestOptions"))),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"{}")),(0,l.yg)("td",{parentName:"tr",align:null},"An object containing query params and headers for the request")))),(0,l.yg)("p",null,"This operation writes the following keys to state:"),(0,l.yg)("table",null,(0,l.yg)("thead",{parentName:"table"},(0,l.yg)("tr",{parentName:"thead"},(0,l.yg)("th",{parentName:"tr",align:null},"State Key"),(0,l.yg)("th",{parentName:"tr",align:null},"Description"))),(0,l.yg)("tbody",{parentName:"table"},(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"data"),(0,l.yg)("td",{parentName:"tr",align:null},"The response body (as JSON)")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"response"),(0,l.yg)("td",{parentName:"tr",align:null},"The HTTP response from the KoboToolbox server (excluding the body). Responses will be returned in JSON format")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"references"),(0,l.yg)("td",{parentName:"tr",align:null},"An array of all previous data objects used in the Job")))),(0,l.yg)("p",null,(0,l.yg)("strong",{parentName:"p"},"Example:")," Create an asset resource"),(0,l.yg)("pre",null,(0,l.yg)("code",{parentName:"pre",className:"language-js"},"http.post(\n '/assets/',\n {\n name: 'Feedback Survey Test',\n asset_type: 'survey',\n },\n );\n")),(0,l.yg)("hr",null),(0,l.yg)("h3",{id:"http_put"},"http.put"),(0,l.yg)("p",null,(0,l.yg)("code",null,"put(path, data, [options]) \u21d2 operation")),(0,l.yg)("p",null,"Make a PUT request to a KoboToolbox endpoint"),(0,l.yg)("table",null,(0,l.yg)("thead",{parentName:"table"},(0,l.yg)("tr",{parentName:"thead"},(0,l.yg)("th",{parentName:"tr",align:null},"Param"),(0,l.yg)("th",{parentName:"tr",align:null},"Type"),(0,l.yg)("th",{parentName:"tr",align:null},"Default"),(0,l.yg)("th",{parentName:"tr",align:null},"Description"))),(0,l.yg)("tbody",{parentName:"table"},(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"path"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"string")),(0,l.yg)("td",{parentName:"tr",align:null}),(0,l.yg)("td",{parentName:"tr",align:null},"path to resource")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"data"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"any")),(0,l.yg)("td",{parentName:"tr",align:null}),(0,l.yg)("td",{parentName:"tr",align:null},"the body data in JSON format")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"[options]"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("a",{parentName:"td",href:"#requestoptions"},(0,l.yg)("code",null,"RequestOptions"))),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"{}")),(0,l.yg)("td",{parentName:"tr",align:null},"An object containing query params and headers for the request")))),(0,l.yg)("p",null,"This operation writes the following keys to state:"),(0,l.yg)("table",null,(0,l.yg)("thead",{parentName:"table"},(0,l.yg)("tr",{parentName:"thead"},(0,l.yg)("th",{parentName:"tr",align:null},"State Key"),(0,l.yg)("th",{parentName:"tr",align:null},"Description"))),(0,l.yg)("tbody",{parentName:"table"},(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"data"),(0,l.yg)("td",{parentName:"tr",align:null},"The response body (as JSON)")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"response"),(0,l.yg)("td",{parentName:"tr",align:null},"The HTTP response from the KoboToolbox server (excluding the body). Responses will be returned in JSON format")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"references"),(0,l.yg)("td",{parentName:"tr",align:null},"An array of all previous data objects used in the Job")))),(0,l.yg)("p",null,(0,l.yg)("strong",{parentName:"p"},"Example:")," Update an asset resource"),(0,l.yg)("pre",null,(0,l.yg)("code",{parentName:"pre",className:"language-js"},"http.put(\n 'assets/a4jAWzoa8SZWzZGhx84sB5/deployment/',\n {\n name: 'Feedback Survey Test',\n asset_type: 'survey',\n },\n );\n")),(0,l.yg)("hr",null),(0,l.yg)("h2",{id:"interfaces"},"Interfaces"),(0,l.yg)("h3",{id:"kobotoolboxhttpstate"},"KoboToolboxHttpState"),(0,l.yg)("p",null,"State object"),(0,l.yg)("p",null,(0,l.yg)("strong",{parentName:"p"},"Properties")),(0,l.yg)("table",null,(0,l.yg)("thead",{parentName:"table"},(0,l.yg)("tr",{parentName:"thead"},(0,l.yg)("th",{parentName:"tr",align:null},"Name"),(0,l.yg)("th",{parentName:"tr",align:null},"Description"))),(0,l.yg)("tbody",{parentName:"table"},(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"data"),(0,l.yg)("td",{parentName:"tr",align:null},"The response body (as JSON)")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"response"),(0,l.yg)("td",{parentName:"tr",align:null},"The HTTP response from the KoboToolbox server (excluding the body). Responses will be returned in JSON format")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"references"),(0,l.yg)("td",{parentName:"tr",align:null},"An array of all previous data objects used in the Job")))),(0,l.yg)("hr",null),(0,l.yg)("h3",{id:"requestoptions"},"RequestOptions"),(0,l.yg)("p",null,"Options object"),(0,l.yg)("p",null,(0,l.yg)("strong",{parentName:"p"},"Properties")),(0,l.yg)("table",null,(0,l.yg)("thead",{parentName:"table"},(0,l.yg)("tr",{parentName:"thead"},(0,l.yg)("th",{parentName:"tr",align:null},"Name"),(0,l.yg)("th",{parentName:"tr",align:null},"Type"),(0,l.yg)("th",{parentName:"tr",align:null},"Default"),(0,l.yg)("th",{parentName:"tr",align:null},"Description"))),(0,l.yg)("tbody",{parentName:"table"},(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"query"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"object")),(0,l.yg)("td",{parentName:"tr",align:null}),(0,l.yg)("td",{parentName:"tr",align:null},"An object of query parameters to be encoded into the URL")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"headers"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"object")),(0,l.yg)("td",{parentName:"tr",align:null}),(0,l.yg)("td",{parentName:"tr",align:null},"An object of all request headers")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"[parseAs]"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"string")),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,'"',"'","json","'",'"')),(0,l.yg)("td",{parentName:"tr",align:null},"The response format to parse (e.g., 'json', 'text', or 'stream')")))),(0,l.yg)("hr",null),(0,l.yg)("h3",{id:"requestoptions-1"},"RequestOptions"),(0,l.yg)("p",null,"Options object"),(0,l.yg)("p",null,(0,l.yg)("strong",{parentName:"p"},"Properties")),(0,l.yg)("table",null,(0,l.yg)("thead",{parentName:"table"},(0,l.yg)("tr",{parentName:"thead"},(0,l.yg)("th",{parentName:"tr",align:null},"Name"),(0,l.yg)("th",{parentName:"tr",align:null},"Type"),(0,l.yg)("th",{parentName:"tr",align:null},"Default"),(0,l.yg)("th",{parentName:"tr",align:null},"Description"))),(0,l.yg)("tbody",{parentName:"table"},(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"query"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"object")),(0,l.yg)("td",{parentName:"tr",align:null}),(0,l.yg)("td",{parentName:"tr",align:null},"An object of query parameters to be encoded into the URL")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"headers"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"object")),(0,l.yg)("td",{parentName:"tr",align:null}),(0,l.yg)("td",{parentName:"tr",align:null},"An object of all request headers")),(0,l.yg)("tr",{parentName:"tbody"},(0,l.yg)("td",{parentName:"tr",align:null},"[parseAs]"),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,"string")),(0,l.yg)("td",{parentName:"tr",align:null},(0,l.yg)("code",null,'"',"'","json","'",'"')),(0,l.yg)("td",{parentName:"tr",align:null},"The response format to parse (e.g., 'json', 'text', or 'stream')")))),(0,l.yg)("hr",null))}u.isMDXComponent=!0},15680:(e,t,a)=>{a.d(t,{xA:()=>s,yg:()=>m});var n=a(96540);function l(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function r(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function o(e){for(var t=1;t=0||(l[a]=e[a]);return l}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(l[a]=e[a])}return l}var p=n.createContext({}),y=function(e){var t=n.useContext(p),a=t;return e&&(a="function"==typeof e?e(t):o(o({},t),e)),a},s=function(e){var t=y(e.components);return n.createElement(p.Provider,{value:t},e.children)},i="mdxType",u={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},d=n.forwardRef((function(e,t){var a=e.components,l=e.mdxType,r=e.originalType,p=e.parentName,s=g(e,["components","mdxType","originalType","parentName"]),i=y(a),d=l,m=i["".concat(p,".").concat(d)]||i[d]||u[d]||r;return a?n.createElement(m,o(o({ref:t},s),{},{components:a})):n.createElement(m,o({ref:t},s))}));function m(e,t){var a=arguments,l=t&&t.mdxType;if("string"==typeof e||l){var r=a.length,o=new Array(r);o[0]=d;var g={};for(var p in t)hasOwnProperty.call(t,p)&&(g[p]=t[p]);g.originalType=e,g[i]="string"==typeof e?e:l,o[1]=g;for(var y=2;y{a.r(t),a.d(t,{assets:()=>s,contentTitle:()=>l,default:()=>i,frontMatter:()=>r,metadata:()=>g,toc:()=>p});var n=a(58168),o=(a(96540),a(15680));const r={title:"kobotoolbox@2.4.3",id:"kobotoolbox-docs",keywords:["adaptor","kobotoolbox","getDeploymentInfo","getForms","getSubmissions"]},l=void 0,g={unversionedId:"packages/kobotoolbox-docs",id:"packages/kobotoolbox-docs",title:"kobotoolbox@2.4.3",description:"getDeploymentInfo(params, callback)",source:"@site/adaptors/packages/kobotoolbox-docs.md",sourceDirName:"packages",slug:"/packages/kobotoolbox-docs",permalink:"/adaptors/packages/kobotoolbox-docs",draft:!1,tags:[],version:"current",frontMatter:{title:"kobotoolbox@2.4.3",id:"kobotoolbox-docs",keywords:["adaptor","kobotoolbox","getDeploymentInfo","getForms","getSubmissions"]},sidebar:"adaptors",previous:{title:"Kobo Toolbox",permalink:"/adaptors/kobotoolbox"},next:{title:"Config for kobotoolbox",permalink:"/adaptors/packages/kobotoolbox-configuration-schema"}},s={},p=[{value:"Functions",id:"functions",level:2},{value:"getDeploymentInfo",id:"getdeploymentinfo",level:3},{value:"getForms",id:"getforms",level:3},{value:"getSubmissions",id:"getsubmissions",level:3}],c={toc:p},m="wrapper";function i(e){let{components:t,...a}=e;return(0,o.yg)(m,(0,n.A)({},c,a,{components:t,mdxType:"MDXLayout"}),(0,o.yg)("dl",null,(0,o.yg)("dt",null,(0,o.yg)("a",{href:"#getdeploymentinfo"},"getDeploymentInfo(params, callback)")),(0,o.yg)("dt",null,(0,o.yg)("a",{href:"#getforms"},"getForms(params, callback)")),(0,o.yg)("dt",null,(0,o.yg)("a",{href:"#getsubmissions"},"getSubmissions(params, callback)"))),(0,o.yg)("p",null,"This adaptor exports the following from common:"),(0,o.yg)("dl",null,(0,o.yg)("dt",null,(0,o.yg)("a",{href:"/adaptors/packages/common-docs#alterstate"},"alterState()")),(0,o.yg)("dt",null,(0,o.yg)("a",{href:"/adaptors/packages/common-docs#cursor"},"cursor()")),(0,o.yg)("dt",null,(0,o.yg)("a",{href:"/adaptors/packages/common-docs#datapath"},"dataPath()")),(0,o.yg)("dt",null,(0,o.yg)("a",{href:"/adaptors/packages/common-docs#datavalue"},"dataValue()")),(0,o.yg)("dt",null,(0,o.yg)("a",{href:"/adaptors/packages/common-docs#each"},"each()")),(0,o.yg)("dt",null,(0,o.yg)("a",{href:"/adaptors/packages/common-docs#field"},"field()")),(0,o.yg)("dt",null,(0,o.yg)("a",{href:"/adaptors/packages/common-docs#fields"},"fields()")),(0,o.yg)("dt",null,(0,o.yg)("a",{href:"/adaptors/packages/common-docs#fn"},"fn()")),(0,o.yg)("dt",null,(0,o.yg)("a",{href:"/adaptors/packages/common-docs#fnif"},"fnIf()")),(0,o.yg)("dt",null,(0,o.yg)("a",{href:"/adaptors/packages/common-docs#group"},"group()")),(0,o.yg)("dt",null,(0,o.yg)("a",{href:"/adaptors/packages/common-docs#http"},"http()")),(0,o.yg)("dt",null,(0,o.yg)("a",{href:"/adaptors/packages/common-docs#lastreferencevalue"},"lastReferenceValue()")),(0,o.yg)("dt",null,(0,o.yg)("a",{href:"/adaptors/packages/common-docs#merge"},"merge()")),(0,o.yg)("dt",null,(0,o.yg)("a",{href:"/adaptors/packages/common-docs#sourcevalue"},"sourceValue()"))),(0,o.yg)("h2",{id:"functions"},"Functions"),(0,o.yg)("h3",{id:"getdeploymentinfo"},"getDeploymentInfo"),(0,o.yg)("p",null,(0,o.yg)("code",null,"getDeploymentInfo(params, callback) \u21d2 Operation")),(0,o.yg)("p",null,"Get deployment information for a specific form"),(0,o.yg)("table",null,(0,o.yg)("thead",{parentName:"table"},(0,o.yg)("tr",{parentName:"thead"},(0,o.yg)("th",{parentName:"tr",align:null},"Param"),(0,o.yg)("th",{parentName:"tr",align:null},"Type"),(0,o.yg)("th",{parentName:"tr",align:null},"Description"))),(0,o.yg)("tbody",{parentName:"table"},(0,o.yg)("tr",{parentName:"tbody"},(0,o.yg)("td",{parentName:"tr",align:null},"params"),(0,o.yg)("td",{parentName:"tr",align:null},(0,o.yg)("code",null,"object")),(0,o.yg)("td",{parentName:"tr",align:null},"Form Id and data to make the fetch or filter")),(0,o.yg)("tr",{parentName:"tbody"},(0,o.yg)("td",{parentName:"tr",align:null},"callback"),(0,o.yg)("td",{parentName:"tr",align:null},(0,o.yg)("code",null,"function")),(0,o.yg)("td",{parentName:"tr",align:null},"(Optional) Callback function to execute after fetching form deployment information")))),(0,o.yg)("p",null,(0,o.yg)("strong",{parentName:"p"},"Example")),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-js"},"getDeploymentInfo({formId: 'aXecHjmbATuF6iGFmvBLBX'}, state => {\n console.log(state.data);\n return state;\n});\n")),(0,o.yg)("hr",null),(0,o.yg)("h3",{id:"getforms"},"getForms"),(0,o.yg)("p",null,(0,o.yg)("code",null,"getForms(params, callback) \u21d2 Operation")),(0,o.yg)("p",null,"Make a request to get the list of forms"),(0,o.yg)("table",null,(0,o.yg)("thead",{parentName:"table"},(0,o.yg)("tr",{parentName:"thead"},(0,o.yg)("th",{parentName:"tr",align:null},"Param"),(0,o.yg)("th",{parentName:"tr",align:null},"Type"),(0,o.yg)("th",{parentName:"tr",align:null},"Description"))),(0,o.yg)("tbody",{parentName:"table"},(0,o.yg)("tr",{parentName:"tbody"},(0,o.yg)("td",{parentName:"tr",align:null},"params"),(0,o.yg)("td",{parentName:"tr",align:null},(0,o.yg)("code",null,"object")),(0,o.yg)("td",{parentName:"tr",align:null},"Query, Headers and Authentication parameters")),(0,o.yg)("tr",{parentName:"tbody"},(0,o.yg)("td",{parentName:"tr",align:null},"callback"),(0,o.yg)("td",{parentName:"tr",align:null},(0,o.yg)("code",null,"function")),(0,o.yg)("td",{parentName:"tr",align:null},"(Optional) Callback function to execute after fetching form list")))),(0,o.yg)("p",null,(0,o.yg)("strong",{parentName:"p"},"Example")),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-js"},"getForms({}, state => {\n console.log(state.data);\n return state;\n});\n")),(0,o.yg)("hr",null),(0,o.yg)("h3",{id:"getsubmissions"},"getSubmissions"),(0,o.yg)("p",null,(0,o.yg)("code",null,"getSubmissions(params, callback) \u21d2 Operation")),(0,o.yg)("p",null,"Get submissions for a specific form"),(0,o.yg)("table",null,(0,o.yg)("thead",{parentName:"table"},(0,o.yg)("tr",{parentName:"thead"},(0,o.yg)("th",{parentName:"tr",align:null},"Param"),(0,o.yg)("th",{parentName:"tr",align:null},"Type"),(0,o.yg)("th",{parentName:"tr",align:null},"Description"))),(0,o.yg)("tbody",{parentName:"table"},(0,o.yg)("tr",{parentName:"tbody"},(0,o.yg)("td",{parentName:"tr",align:null},"params"),(0,o.yg)("td",{parentName:"tr",align:null},(0,o.yg)("code",null,"object")),(0,o.yg)("td",{parentName:"tr",align:null},"Form Id and data to make the fetch or filter")),(0,o.yg)("tr",{parentName:"tbody"},(0,o.yg)("td",{parentName:"tr",align:null},"callback"),(0,o.yg)("td",{parentName:"tr",align:null},(0,o.yg)("code",null,"function")),(0,o.yg)("td",{parentName:"tr",align:null},"(Optional) Callback function to execute after fetching form submissions")))),(0,o.yg)("p",null,(0,o.yg)("strong",{parentName:"p"},"Example")),(0,o.yg)("pre",null,(0,o.yg)("code",{parentName:"pre",className:"language-js"},"getSubmissions({formId: 'aXecHjmbATuF6iGFmvBLBX'}, state => {\n console.log(state.data);\n return state;\n});\n")),(0,o.yg)("hr",null))}i.isMDXComponent=!0},15680:(e,t,a)=>{a.d(t,{xA:()=>c,yg:()=>y});var n=a(96540);function o(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}function r(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function l(e){for(var t=1;t=0||(o[a]=e[a]);return o}(e,t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,a)&&(o[a]=e[a])}return o}var s=n.createContext({}),p=function(e){var t=n.useContext(s),a=t;return e&&(a="function"==typeof e?e(t):l(l({},t),e)),a},c=function(e){var t=p(e.components);return n.createElement(s.Provider,{value:t},e.children)},m="mdxType",i={inlineCode:"code",wrapper:function(e){var t=e.children;return n.createElement(n.Fragment,{},t)}},u=n.forwardRef((function(e,t){var a=e.components,o=e.mdxType,r=e.originalType,s=e.parentName,c=g(e,["components","mdxType","originalType","parentName"]),m=p(a),u=o,y=m["".concat(s,".").concat(u)]||m[u]||i[u]||r;return a?n.createElement(y,l(l({ref:t},c),{},{components:a})):n.createElement(y,l({ref:t},c))}));function y(e,t){var a=arguments,o=t&&t.mdxType;if("string"==typeof e||o){var r=a.length,l=new Array(r);l[0]=u;var g={};for(var s in t)hasOwnProperty.call(t,s)&&(g[s]=t[s]);g.originalType=e,g[m]="string"==typeof e?e:o,l[1]=g;for(var p=2;p{n.r(o),n.d(o,{assets:()=>l,contentTitle:()=>i,default:()=>b,frontMatter:()=>a,metadata:()=>s,toc:()=>p});var t=n(58168),r=(n(96540),n(15680));const a={title:"Config for kobotoolbox",id:"kobotoolbox-configuration-schema",keywords:["adaptor","configuration-schema","kobotoolbox"]},i=void 0,s={unversionedId:"packages/kobotoolbox-configuration-schema",id:"packages/kobotoolbox-configuration-schema",title:"Config for kobotoolbox",description:"Jobs that use the kobotoolbox adaptor may require authentication. A",source:"@site/adaptors/packages/kobotoolbox-configuration-schema.md",sourceDirName:"packages",slug:"/packages/kobotoolbox-configuration-schema",permalink:"/adaptors/packages/kobotoolbox-configuration-schema",draft:!1,tags:[],version:"current",frontMatter:{title:"Config for kobotoolbox",id:"kobotoolbox-configuration-schema",keywords:["adaptor","configuration-schema","kobotoolbox"]},sidebar:"adaptors",previous:{title:"kobotoolbox@2.4.3",permalink:"/adaptors/packages/kobotoolbox-docs"},next:{title:"kobotoolbox changelog",permalink:"/adaptors/packages/kobotoolbox-changelog"}},l={},p=[{value:"Sample Configuration",id:"sample-configuration",level:2},{value:"Full Schema",id:"full-schema",level:2}],c={toc:p},u="wrapper";function b(e){let{components:o,...n}=e;return(0,r.yg)(u,(0,t.A)({},c,n,{components:o,mdxType:"MDXLayout"}),(0,r.yg)("p",null,"Jobs that use the ",(0,r.yg)("inlineCode",{parentName:"p"},"kobotoolbox"),' adaptor may require authentication. A\n"credential" for the ',(0,r.yg)("inlineCode",{parentName:"p"},"kobotoolbox")," adaptor will follow the schema below. When\nusing the CLI, you can set up your own ",(0,r.yg)("inlineCode",{parentName:"p"},"state.configuration")," by using the\nsample below."),(0,r.yg)("h2",{id:"sample-configuration"},"Sample Configuration"),(0,r.yg)("p",null," Paste this into the ",(0,r.yg)("inlineCode",{parentName:"p"},"configuration")," key of your ",(0,r.yg)("inlineCode",{parentName:"p"},"state.json")," file and\nmodify the values to run jobs locally."),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-json"},'{\n "username": "test@openfn.org",\n "baseURL": "https://kf.kobotoolbox.org",\n "password": "@some(!)Strongpassword",\n "apiVersion": "v2"\n}\n')),(0,r.yg)("h2",{id:"full-schema"},"Full Schema"),(0,r.yg)("p",null," The full configuration schema describes each attribute of the credential and\nnotes those that are required."),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-json"},'{\n "$schema": "http://json-schema.org/draft-07/schema#",\n "properties": {\n "baseURL": {\n "title": "Base URL",\n "type": "string",\n "default": "https://kf.kobotoolbox.org",\n "description": "Kobotoolbox URL",\n "format": "uri",\n "minLength": 1,\n "examples": [\n "https://kf.kobotoolbox.org"\n ]\n },\n "username": {\n "title": "Username",\n "type": "string",\n "description": "Kobotoolbox username",\n "minLength": 1,\n "examples": [\n "test@openfn.org"\n ]\n },\n "password": {\n "title": "Password",\n "type": "string",\n "description": "Kobotoolbox password",\n "writeOnly": true,\n "minLength": 1,\n "examples": [\n "@some(!)Strongpassword"\n ]\n },\n "apiVersion": {\n "title": "API Version",\n "type": "string",\n "placeholder": "v2",\n "description": "Kobotoolbox API version to use",\n "minLength": 1,\n "examples": [\n "v2"\n ]\n }\n },\n "type": "object",\n "additionalProperties": true,\n "required": [\n "username",\n "baseURL",\n "password",\n "apiVersion"\n ]\n}\n')))}b.isMDXComponent=!0},15680:(e,o,n)=>{n.d(o,{xA:()=>c,yg:()=>f});var t=n(96540);function r(e,o,n){return o in e?Object.defineProperty(e,o,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[o]=n,e}function a(e,o){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);o&&(t=t.filter((function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.push.apply(n,t)}return n}function i(e){for(var o=1;o=0||(r[n]=e[n]);return r}(e,o);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var l=t.createContext({}),p=function(e){var o=t.useContext(l),n=o;return e&&(n="function"==typeof e?e(o):i(i({},o),e)),n},c=function(e){var o=p(e.components);return t.createElement(l.Provider,{value:o},e.children)},u="mdxType",b={inlineCode:"code",wrapper:function(e){var o=e.children;return t.createElement(t.Fragment,{},o)}},g=t.forwardRef((function(e,o){var n=e.components,r=e.mdxType,a=e.originalType,l=e.parentName,c=s(e,["components","mdxType","originalType","parentName"]),u=p(n),g=r,f=u["".concat(l,".").concat(g)]||u[g]||b[g]||a;return n?t.createElement(f,i(i({ref:o},c),{},{components:n})):t.createElement(f,i({ref:o},c))}));function f(e,o){var n=arguments,r=o&&o.mdxType;if("string"==typeof e||r){var a=n.length,i=new Array(a);i[0]=g;var s={};for(var l in o)hasOwnProperty.call(o,l)&&(s[l]=o[l]);s.originalType=e,s[u]="string"==typeof e?e:r,i[1]=s;for(var p=2;p{n.r(o),n.d(o,{assets:()=>s,contentTitle:()=>i,default:()=>b,frontMatter:()=>a,metadata:()=>l,toc:()=>p});var t=n(58168),r=(n(96540),n(15680));const a={title:"Config for kobotoolbox",id:"kobotoolbox-configuration-schema",keywords:["adaptor","configuration-schema","kobotoolbox"]},i=void 0,l={unversionedId:"packages/kobotoolbox-configuration-schema",id:"packages/kobotoolbox-configuration-schema",title:"Config for kobotoolbox",description:"Jobs that use the kobotoolbox adaptor may require authentication. A",source:"@site/adaptors/packages/kobotoolbox-configuration-schema.md",sourceDirName:"packages",slug:"/packages/kobotoolbox-configuration-schema",permalink:"/adaptors/packages/kobotoolbox-configuration-schema",draft:!1,tags:[],version:"current",frontMatter:{title:"Config for kobotoolbox",id:"kobotoolbox-configuration-schema",keywords:["adaptor","configuration-schema","kobotoolbox"]},sidebar:"adaptors",previous:{title:"kobotoolbox@3.0.0",permalink:"/adaptors/packages/kobotoolbox-docs"},next:{title:"kobotoolbox changelog",permalink:"/adaptors/packages/kobotoolbox-changelog"}},s={},p=[{value:"Sample Configuration",id:"sample-configuration",level:2},{value:"Full Schema",id:"full-schema",level:2}],c={toc:p},u="wrapper";function b(e){let{components:o,...n}=e;return(0,r.yg)(u,(0,t.A)({},c,n,{components:o,mdxType:"MDXLayout"}),(0,r.yg)("p",null,"Jobs that use the ",(0,r.yg)("inlineCode",{parentName:"p"},"kobotoolbox"),' adaptor may require authentication. A\n"credential" for the ',(0,r.yg)("inlineCode",{parentName:"p"},"kobotoolbox")," adaptor will follow the schema below. When\nusing the CLI, you can set up your own ",(0,r.yg)("inlineCode",{parentName:"p"},"state.configuration")," by using the\nsample below."),(0,r.yg)("h2",{id:"sample-configuration"},"Sample Configuration"),(0,r.yg)("p",null," Paste this into the ",(0,r.yg)("inlineCode",{parentName:"p"},"configuration")," key of your ",(0,r.yg)("inlineCode",{parentName:"p"},"state.json")," file and\nmodify the values to run jobs locally."),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-json"},'{\n "username": "test@openfn.org",\n "baseUrl": "https://kf.kobotoolbox.org",\n "password": "@some(!)Strongpassword",\n "apiVersion": "v2"\n}\n')),(0,r.yg)("h2",{id:"full-schema"},"Full Schema"),(0,r.yg)("p",null," The full configuration schema describes each attribute of the credential and\nnotes those that are required."),(0,r.yg)("pre",null,(0,r.yg)("code",{parentName:"pre",className:"language-json"},'{\n "$schema": "http://json-schema.org/draft-07/schema#",\n "properties": {\n "baseUrl": {\n "title": "Base Url",\n "type": "string",\n "default": "https://kf.kobotoolbox.org",\n "description": "Kobotoolbox URL",\n "format": "uri",\n "minLength": 1,\n "examples": [\n "https://kf.kobotoolbox.org"\n ]\n },\n "username": {\n "title": "Username",\n "type": "string",\n "description": "Kobotoolbox username",\n "minLength": 1,\n "examples": [\n "test@openfn.org"\n ]\n },\n "password": {\n "title": "Password",\n "type": "string",\n "description": "Kobotoolbox password",\n "writeOnly": true,\n "minLength": 1,\n "examples": [\n "@some(!)Strongpassword"\n ]\n },\n "apiVersion": {\n "title": "API Version",\n "type": "string",\n "placeholder": "v2",\n "description": "Kobotoolbox API version to use",\n "minLength": 1,\n "examples": [\n "v2"\n ]\n }\n },\n "type": "object",\n "additionalProperties": true,\n "required": [\n "username",\n "baseUrl",\n "password",\n "apiVersion"\n ]\n}\n')))}b.isMDXComponent=!0},15680:(e,o,n)=>{n.d(o,{xA:()=>c,yg:()=>f});var t=n(96540);function r(e,o,n){return o in e?Object.defineProperty(e,o,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[o]=n,e}function a(e,o){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);o&&(t=t.filter((function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable}))),n.push.apply(n,t)}return n}function i(e){for(var o=1;o=0||(r[n]=e[n]);return r}(e,o);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(t=0;t=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}var s=t.createContext({}),p=function(e){var o=t.useContext(s),n=o;return e&&(n="function"==typeof e?e(o):i(i({},o),e)),n},c=function(e){var o=p(e.components);return t.createElement(s.Provider,{value:o},e.children)},u="mdxType",b={inlineCode:"code",wrapper:function(e){var o=e.children;return t.createElement(t.Fragment,{},o)}},g=t.forwardRef((function(e,o){var n=e.components,r=e.mdxType,a=e.originalType,s=e.parentName,c=l(e,["components","mdxType","originalType","parentName"]),u=p(n),g=r,f=u["".concat(s,".").concat(g)]||u[g]||b[g]||a;return n?t.createElement(f,i(i({ref:o},c),{},{components:n})):t.createElement(f,i({ref:o},c))}));function f(e,o){var n=arguments,r=o&&o.mdxType;if("string"==typeof e||r){var a=n.length,i=new Array(a);i[0]=g;var l={};for(var s in o)hasOwnProperty.call(o,s)&&(l[s]=o[s]);l.originalType=e,l[u]="string"==typeof e?e:r,i[1]=l;for(var p=2;p{a.exports=JSON.parse('{"pluginId":"adaptors","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"adaptors":[{"type":"link","label":"Introduction","href":"/adaptors/","docId":"adaptors-intro"},{"type":"link","label":"Library Examples","href":"/adaptors/library","docId":"library-intro"},{"type":"category","label":"asana","items":[{"type":"link","label":"Overview","href":"/adaptors/asana","docId":"asana"},{"type":"link","label":"Functions","href":"/adaptors/packages/asana-docs","docId":"packages/asana-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/asana-configuration-schema","docId":"packages/asana-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"Asana-test","href":"/adaptors/library/jobs/auto/Asana-test-2024-07-29","docId":"library/jobs/auto/Asana-test-2024-07-29"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/asana-changelog","docId":"packages/asana-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/asana-readme","docId":"packages/asana-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"azure-storage","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/azure-storage-docs","docId":"packages/azure-storage-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/azure-storage-configuration-schema","docId":"packages/azure-storage-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/azure-storage-changelog","docId":"packages/azure-storage-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/azure-storage-readme","docId":"packages/azure-storage-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"beyonic","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/beyonic-docs","docId":"packages/beyonic-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/beyonic-configuration-schema","docId":"packages/beyonic-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"Pay CHW","href":"/adaptors/library/jobs/auto/Pay-CHW-2021-04-23","docId":"library/jobs/auto/Pay-CHW-2021-04-23"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/beyonic-changelog","docId":"packages/beyonic-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/beyonic-readme","docId":"packages/beyonic-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"bigquery","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/bigquery-docs","docId":"packages/bigquery-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/bigquery-configuration-schema","docId":"packages/bigquery-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/bigquery-changelog","docId":"packages/bigquery-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/bigquery-readme","docId":"packages/bigquery-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"cartodb","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/cartodb-docs","docId":"packages/cartodb-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/cartodb-configuration-schema","docId":"packages/cartodb-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/cartodb-changelog","docId":"packages/cartodb-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/cartodb-readme","docId":"packages/cartodb-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"cht","items":[{"type":"link","label":"Overview","href":"/adaptors/cht","docId":"cht"},{"type":"link","label":"Functions","href":"/adaptors/packages/cht-docs","docId":"packages/cht-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/cht-configuration-schema","docId":"packages/cht-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/cht-changelog","docId":"packages/cht-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/cht-readme","docId":"packages/cht-readme"}],"collapsed":true,"collapsible":true},{"type":"link","label":"ckan","href":"/adaptors/ckan","docId":"ckan"},{"type":"category","label":"collections","items":[{"type":"link","label":"Overview","href":"/adaptors/collections","docId":"collections"},{"type":"link","label":"Functions","href":"/adaptors/packages/collections-docs","docId":"packages/collections-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/collections-configuration-schema","docId":"packages/collections-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/collections-changelog","docId":"packages/collections-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/collections-readme","docId":"packages/collections-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"commcare","items":[{"type":"link","label":"Overview","href":"/adaptors/commcare","docId":"commcare"},{"type":"link","label":"Functions","href":"/adaptors/packages/commcare-docs","docId":"packages/commcare-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/commcare-configuration-schema","docId":"packages/commcare-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"\ud83d\udcdc Bulk upload obat lookup-table","href":"/adaptors/library/jobs/auto/commcare-asri-bulk-upload","docId":"library/jobs/auto/commcare-asri-bulk-upload"},{"type":"link","label":"Q3 2022 Update HH Name in CommCare","href":"/adaptors/library/jobs/auto/Q3-2022-Update-HH-Name-in-CommCare-2021-09-27","docId":"library/jobs/auto/Q3-2022-Update-HH-Name-in-CommCare-2021-09-27"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/commcare-changelog","docId":"packages/commcare-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/commcare-readme","docId":"packages/commcare-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"common","items":[{"type":"link","label":"Overview","href":"/adaptors/common","docId":"common"},{"type":"link","label":"Functions","href":"/adaptors/packages/common-docs","docId":"packages/common-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/common-configuration-schema","docId":"packages/common-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/common-changelog","docId":"packages/common-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/common-readme","docId":"packages/common-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"dhis2","items":[{"type":"link","label":"Overview","href":"/adaptors/dhis2","docId":"dhis2"},{"type":"link","label":"Functions","href":"/adaptors/packages/dhis2-docs","docId":"packages/dhis2-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/dhis2-configuration-schema","docId":"packages/dhis2-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"\ud83d\udcdc Create data values","href":"/adaptors/library/jobs/auto/DHIS2-DataValues-API","docId":"library/jobs/auto/DHIS2-DataValues-API"},{"type":"link","label":"\ud83d\udcdc Create new events","href":"/adaptors/library/jobs/auto/DHIS2-Events-API","docId":"library/jobs/auto/DHIS2-Events-API"},{"type":"link","label":"Load to DHIS2","href":"/adaptors/library/jobs/auto/Load-to-DHIS2-2023-07-17","docId":"library/jobs/auto/Load-to-DHIS2-2023-07-17"},{"type":"link","label":"DHIS2 Events","href":"/adaptors/library/jobs/auto/DHIS2-Events-2016-01-27","docId":"library/jobs/auto/DHIS2-Events-2016-01-27"},{"type":"link","label":"Create TEI (dhis2)","href":"/adaptors/library/jobs/auto/Create-TEI-dhis2-2021-03-22","docId":"library/jobs/auto/Create-TEI-dhis2-2021-03-22"},{"type":"link","label":"CHW case to DHIS2","href":"/adaptors/library/jobs/auto/CHW-case-to-DHIS2-2023-04-27","docId":"library/jobs/auto/CHW-case-to-DHIS2-2023-04-27"},{"type":"link","label":"0 - Get TEI data","href":"/adaptors/library/jobs/auto/0-Get-TEI-data-2021-06-02","docId":"library/jobs/auto/0-Get-TEI-data-2021-06-02"},{"type":"link","label":"Add DHIS2 Data Value Sets","href":"/adaptors/library/jobs/auto/Add-DHIS2-Data-Value-Sets-2016-03-28","docId":"library/jobs/auto/Add-DHIS2-Data-Value-Sets-2016-03-28"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/dhis2-changelog","docId":"packages/dhis2-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/dhis2-readme","docId":"packages/dhis2-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"dynamics","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/dynamics-docs","docId":"packages/dynamics-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/dynamics-configuration-schema","docId":"packages/dynamics-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/dynamics-changelog","docId":"packages/dynamics-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/dynamics-readme","docId":"packages/dynamics-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"facebook","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/facebook-docs","docId":"packages/facebook-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/facebook-configuration-schema","docId":"packages/facebook-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/facebook-changelog","docId":"packages/facebook-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/facebook-readme","docId":"packages/facebook-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"fhir","items":[{"type":"link","label":"Overview","href":"/adaptors/fhir","docId":"fhir"},{"type":"link","label":"Functions","href":"/adaptors/packages/fhir-docs","docId":"packages/fhir-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/fhir-configuration-schema","docId":"packages/fhir-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/fhir-changelog","docId":"packages/fhir-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/fhir-readme","docId":"packages/fhir-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"fhir-fr","items":[{"type":"link","label":"Overview","href":"/adaptors/fhir-fr","docId":"fhir-fr"},{"type":"link","label":"Functions","href":"/adaptors/packages/fhir-fr-docs","docId":"packages/fhir-fr-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/fhir-fr-configuration-schema","docId":"packages/fhir-fr-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/fhir-fr-changelog","docId":"packages/fhir-fr-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/fhir-fr-readme","docId":"packages/fhir-fr-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"fhir-ndr-et","items":[{"type":"link","label":"Overview","href":"/adaptors/fhir-ndr-et","docId":"fhir-ndr-et"},{"type":"link","label":"Functions","href":"/adaptors/packages/fhir-ndr-et-docs","docId":"packages/fhir-ndr-et-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/fhir-ndr-et-configuration-schema","docId":"packages/fhir-ndr-et-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/fhir-ndr-et-changelog","docId":"packages/fhir-ndr-et-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/fhir-ndr-et-readme","docId":"packages/fhir-ndr-et-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"ghana-bdr","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/ghana-bdr-docs","docId":"packages/ghana-bdr-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/ghana-bdr-configuration-schema","docId":"packages/ghana-bdr-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/ghana-bdr-changelog","docId":"packages/ghana-bdr-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/ghana-bdr-readme","docId":"packages/ghana-bdr-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"ghana-nia","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/ghana-nia-docs","docId":"packages/ghana-nia-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/ghana-nia-configuration-schema","docId":"packages/ghana-nia-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/ghana-nia-changelog","docId":"packages/ghana-nia-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/ghana-nia-readme","docId":"packages/ghana-nia-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"gmail","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/gmail-docs","docId":"packages/gmail-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/gmail-configuration-schema","docId":"packages/gmail-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/gmail-changelog","docId":"packages/gmail-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/gmail-readme","docId":"packages/gmail-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"godata","items":[{"type":"link","label":"Overview","href":"/adaptors/godata","docId":"godata"},{"type":"link","label":"Functions","href":"/adaptors/packages/godata-docs","docId":"packages/godata-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/godata-configuration-schema","docId":"packages/godata-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/godata-changelog","docId":"packages/godata-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/godata-readme","docId":"packages/godata-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"googlehealthcare","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/googlehealthcare-docs","docId":"packages/googlehealthcare-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/googlehealthcare-configuration-schema","docId":"packages/googlehealthcare-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/googlehealthcare-changelog","docId":"packages/googlehealthcare-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/googlehealthcare-readme","docId":"packages/googlehealthcare-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"googlesheets","items":[{"type":"link","label":"Overview","href":"/adaptors/googlesheets","docId":"googlesheets"},{"type":"link","label":"Functions","href":"/adaptors/packages/googlesheets-docs","docId":"packages/googlesheets-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/googlesheets-configuration-schema","docId":"packages/googlesheets-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"google oauth test","href":"/adaptors/library/jobs/auto/google-oauth-test-2024-12-20","docId":"library/jobs/auto/google-oauth-test-2024-12-20"},{"type":"link","label":"Kobo to sheets","href":"/adaptors/library/jobs/auto/Kobo-to-sheets-2023-10-13","docId":"library/jobs/auto/Kobo-to-sheets-2023-10-13"},{"type":"link","label":"Register Patient","href":"/adaptors/library/jobs/auto/Register-Patient-2021-03-02","docId":"library/jobs/auto/Register-Patient-2021-03-02"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/googlesheets-changelog","docId":"packages/googlesheets-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/googlesheets-readme","docId":"packages/googlesheets-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"hive","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/hive-docs","docId":"packages/hive-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/hive-configuration-schema","docId":"packages/hive-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/hive-changelog","docId":"packages/hive-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/hive-readme","docId":"packages/hive-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"http","items":[{"type":"link","label":"Overview","href":"/adaptors/http","docId":"http"},{"type":"link","label":"Functions","href":"/adaptors/packages/http-docs","docId":"packages/http-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/http-configuration-schema","docId":"packages/http-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"\ud83d\udcdc Extract Kobo data from API to send to OpenFn Inbox","href":"/adaptors/library/jobs/auto/getKoboData","docId":"library/jobs/auto/getKoboData"},{"type":"link","label":"\ud83d\udcdc Using async and array.map","href":"/adaptors/library/jobs/auto/async-and-array-dot-map","docId":"library/jobs/auto/async-and-array-dot-map"},{"type":"link","label":"\ud83d\udcdc Chaining HTTP Requests","href":"/adaptors/library/jobs/auto/complex-http-request-chains","docId":"library/jobs/auto/complex-http-request-chains"},{"type":"link","label":"\ud83d\udcdc Promises and nested requests","href":"/adaptors/library/jobs/auto/promise-all-nested-requests","docId":"library/jobs/auto/promise-all-nested-requests"},{"type":"link","label":"\ud83d\udcdc Timeout to create a delay","href":"/adaptors/library/jobs/auto/timeout","docId":"library/jobs/auto/timeout"},{"type":"link","label":"\ud83d\udcdc Chaining synchronous http requests","href":"/adaptors/library/jobs/auto/synchronous-http-request","docId":"library/jobs/auto/synchronous-http-request"},{"type":"link","label":"WF4-1 Bulk get Referral Cases","href":"/adaptors/library/jobs/auto/WF4-1-Bulk-get-Referral-Cases-2023-05-19","docId":"library/jobs/auto/WF4-1-Bulk-get-Referral-Cases-2023-05-19"},{"type":"link","label":"WF3-1 Bulk get Person Visit cases","href":"/adaptors/library/jobs/auto/WF3-1-Bulk-get-Person-Visit-cases-2023-05-19","docId":"library/jobs/auto/WF3-1-Bulk-get-Person-Visit-cases-2023-05-19"},{"type":"link","label":"WF2-1 Bulk get Person cases","href":"/adaptors/library/jobs/auto/WF2-1-Bulk-get-Person-cases-2023-05-19","docId":"library/jobs/auto/WF2-1-Bulk-get-Person-cases-2023-05-19"},{"type":"link","label":"WF1-1 Bulk get HH cases","href":"/adaptors/library/jobs/auto/WF1-1-Bulk-get-HH-cases-2023-05-19","docId":"library/jobs/auto/WF1-1-Bulk-get-HH-cases-2023-05-19"},{"type":"link","label":"1 Get CommCare Forms Bulk Extract","href":"/adaptors/library/jobs/auto/1-Get-CommCare-Forms-Bulk-Extract-2021-04-08","docId":"library/jobs/auto/1-Get-CommCare-Forms-Bulk-Extract-2021-04-08"},{"type":"link","label":"Fetch Claims","href":"/adaptors/library/jobs/auto/Fetch-Claims-2023-07-17","docId":"library/jobs/auto/Fetch-Claims-2023-07-17"},{"type":"link","label":"no return","href":"/adaptors/library/jobs/auto/no-return-2023-01-06","docId":"library/jobs/auto/no-return-2023-01-06"},{"type":"link","label":"Catch Error in HTTP Request","href":"/adaptors/library/jobs/auto/Catch-Error-in-HTTP-Request-2016-08-26","docId":"library/jobs/auto/Catch-Error-in-HTTP-Request-2016-08-26"},{"type":"link","label":"Get CommCare Forms (Bulk Extract)","href":"/adaptors/library/jobs/auto/Get-CommCare-Forms-Bulk-Extract-2022-05-16","docId":"library/jobs/auto/Get-CommCare-Forms-Bulk-Extract-2022-05-16"},{"type":"link","label":"aleksa cron","href":"/adaptors/library/jobs/auto/aleksa-cron-2022-04-29","docId":"library/jobs/auto/aleksa-cron-2022-04-29"},{"type":"link","label":"Request Vitas Sync","href":"/adaptors/library/jobs/auto/Request-Vitas-Sync-2021-05-11","docId":"library/jobs/auto/Request-Vitas-Sync-2021-05-11"},{"type":"link","label":"Failed Payment Notification","href":"/adaptors/library/jobs/auto/Failed-Payment-Notification-2021-04-23","docId":"library/jobs/auto/Failed-Payment-Notification-2021-04-23"},{"type":"link","label":"02b/ Initiate Payments","href":"/adaptors/library/jobs/auto/02b-Initiate-Payments-2019-11-19","docId":"library/jobs/auto/02b-Initiate-Payments-2019-11-19"},{"type":"link","label":"01c/ Create person_position record","href":"/adaptors/library/jobs/auto/01c-Create-person_position-record-2019-12-13","docId":"library/jobs/auto/01c-Create-person_position-record-2019-12-13"},{"type":"link","label":"01a/ Create Registrants","href":"/adaptors/library/jobs/auto/01a-Create-Registrants-2019-11-19","docId":"library/jobs/auto/01a-Create-Registrants-2019-11-19"},{"type":"link","label":"05b/Update ODK eval form","href":"/adaptors/library/jobs/auto/05b-Update-ODK-eval-form-2019-12-19","docId":"library/jobs/auto/05b-Update-ODK-eval-form-2019-12-19"},{"type":"link","label":"05/ Submit employee evaluation","href":"/adaptors/library/jobs/auto/05-Submit-employee-evaluation-2019-12-03","docId":"library/jobs/auto/05-Submit-employee-evaluation-2019-12-03"},{"type":"link","label":"04b/ Update ODK form","href":"/adaptors/library/jobs/auto/04b-Update-ODK-form-2019-12-03","docId":"library/jobs/auto/04b-Update-ODK-form-2019-12-03"},{"type":"link","label":"commcare reports api","href":"/adaptors/library/jobs/auto/commcare-reports-api-2016-08-29","docId":"library/jobs/auto/commcare-reports-api-2016-08-29"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/http-changelog","docId":"packages/http-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/http-readme","docId":"packages/http-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"hubtel","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/hubtel-docs","docId":"packages/hubtel-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/hubtel-configuration-schema","docId":"packages/hubtel-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/hubtel-changelog","docId":"packages/hubtel-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/hubtel-readme","docId":"packages/hubtel-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"intuit","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/intuit-docs","docId":"packages/intuit-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/intuit-configuration-schema","docId":"packages/intuit-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/intuit-changelog","docId":"packages/intuit-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/intuit-readme","docId":"packages/intuit-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"khanacademy","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/khanacademy-docs","docId":"packages/khanacademy-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/khanacademy-configuration-schema","docId":"packages/khanacademy-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/khanacademy-changelog","docId":"packages/khanacademy-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/khanacademy-readme","docId":"packages/khanacademy-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"kobotoolbox","items":[{"type":"link","label":"Overview","href":"/adaptors/kobotoolbox","docId":"kobotoolbox"},{"type":"link","label":"Functions","href":"/adaptors/packages/kobotoolbox-docs","docId":"packages/kobotoolbox-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/kobotoolbox-configuration-schema","docId":"packages/kobotoolbox-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/kobotoolbox-changelog","docId":"packages/kobotoolbox-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/kobotoolbox-readme","docId":"packages/kobotoolbox-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"magpi","items":[{"type":"link","label":"Overview","href":"/adaptors/magpi","docId":"magpi"},{"type":"link","label":"Functions","href":"/adaptors/packages/magpi-docs","docId":"packages/magpi-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/magpi-configuration-schema","docId":"packages/magpi-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/magpi-changelog","docId":"packages/magpi-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/magpi-readme","docId":"packages/magpi-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"mailchimp","items":[{"type":"link","label":"Overview","href":"/adaptors/mailchimp","docId":"mailchimp"},{"type":"link","label":"Functions","href":"/adaptors/packages/mailchimp-docs","docId":"packages/mailchimp-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/mailchimp-configuration-schema","docId":"packages/mailchimp-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/mailchimp-changelog","docId":"packages/mailchimp-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/mailchimp-readme","docId":"packages/mailchimp-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"mailgun","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/mailgun-docs","docId":"packages/mailgun-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/mailgun-configuration-schema","docId":"packages/mailgun-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"\ud83d\udcdc send email","href":"/adaptors/library/jobs/auto/send-mail-in-mailgun","docId":"library/jobs/auto/send-mail-in-mailgun"},{"type":"link","label":"01 send mailgun email","href":"/adaptors/library/jobs/auto/01-send-mailgun-email-2018-12-04","docId":"library/jobs/auto/01-send-mailgun-email-2018-12-04"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/mailgun-changelog","docId":"packages/mailgun-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/mailgun-readme","docId":"packages/mailgun-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"maximo","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/maximo-docs","docId":"packages/maximo-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/maximo-configuration-schema","docId":"packages/maximo-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/maximo-changelog","docId":"packages/maximo-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/maximo-readme","docId":"packages/maximo-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"medicmobile","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/medicmobile-docs","docId":"packages/medicmobile-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/medicmobile-configuration-schema","docId":"packages/medicmobile-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/medicmobile-changelog","docId":"packages/medicmobile-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/medicmobile-readme","docId":"packages/medicmobile-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"mogli","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/mogli-docs","docId":"packages/mogli-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/mogli-configuration-schema","docId":"packages/mogli-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/mogli-changelog","docId":"packages/mogli-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/mogli-readme","docId":"packages/mogli-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"mojatax","items":[{"type":"link","label":"Overview","href":"/adaptors/mojatax","docId":"mojatax"},{"type":"link","label":"Functions","href":"/adaptors/packages/mojatax-docs","docId":"packages/mojatax-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/mojatax-configuration-schema","docId":"packages/mojatax-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/mojatax-changelog","docId":"packages/mojatax-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/mojatax-readme","docId":"packages/mojatax-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"mongodb","items":[{"type":"link","label":"Overview","href":"/adaptors/mongodb","docId":"mongodb"},{"type":"link","label":"Functions","href":"/adaptors/packages/mongodb-docs","docId":"packages/mongodb-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/mongodb-configuration-schema","docId":"packages/mongodb-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/mongodb-changelog","docId":"packages/mongodb-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/mongodb-readme","docId":"packages/mongodb-readme"}],"collapsed":true,"collapsible":true},{"type":"link","label":"moodle","href":"/adaptors/moodle","docId":"moodle"},{"type":"category","label":"msgraph","items":[{"type":"link","label":"Overview","href":"/adaptors/msgraph","docId":"msgraph"},{"type":"link","label":"Functions","href":"/adaptors/packages/msgraph-docs","docId":"packages/msgraph-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/msgraph-configuration-schema","docId":"packages/msgraph-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/msgraph-changelog","docId":"packages/msgraph-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/msgraph-readme","docId":"packages/msgraph-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"mssql","items":[{"type":"link","label":"Overview","href":"/adaptors/mssql","docId":"mssql"},{"type":"link","label":"Functions","href":"/adaptors/packages/mssql-docs","docId":"packages/mssql-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/mssql-configuration-schema","docId":"packages/mssql-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"Extract Vitas Data","href":"/adaptors/library/jobs/auto/Extract-Vitas-Data-2021-05-11","docId":"library/jobs/auto/Extract-Vitas-Data-2021-05-11"},{"type":"link","label":"CommCare to Azure Sql","href":"/adaptors/library/jobs/auto/CommCare-to-Azure-Sql-2020-01-27","docId":"library/jobs/auto/CommCare-to-Azure-Sql-2020-01-27"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/mssql-changelog","docId":"packages/mssql-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/mssql-readme","docId":"packages/mssql-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"mysql","items":[{"type":"link","label":"Overview","href":"/adaptors/mysql","docId":"mysql"},{"type":"link","label":"Functions","href":"/adaptors/packages/mysql-docs","docId":"packages/mysql-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/mysql-configuration-schema","docId":"packages/mysql-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"01b/ Query new person record","href":"/adaptors/library/jobs/auto/01b-Query-new-person-record-2019-12-13","docId":"library/jobs/auto/01b-Query-new-person-record-2019-12-13"},{"type":"link","label":"03/ Update Payment Status","href":"/adaptors/library/jobs/auto/03-Update-Payment-Status-2019-11-19","docId":"library/jobs/auto/03-Update-Payment-Status-2019-11-19"},{"type":"link","label":"05a/Query for new employees","href":"/adaptors/library/jobs/auto/05a-Query-for-new-employees-2019-12-19","docId":"library/jobs/auto/05a-Query-for-new-employees-2019-12-19"},{"type":"link","label":"04a/Query for job changes","href":"/adaptors/library/jobs/auto/04a-Query-for-job-changes-2019-12-12","docId":"library/jobs/auto/04a-Query-for-job-changes-2019-12-12"},{"type":"link","label":"02a/ Query DB for people to pay","href":"/adaptors/library/jobs/auto/02a-Query-DB-for-people-to-pay-2019-12-11","docId":"library/jobs/auto/02a-Query-DB-for-people-to-pay-2019-12-11"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/mysql-changelog","docId":"packages/mysql-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/mysql-readme","docId":"packages/mysql-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"nexmo","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/nexmo-docs","docId":"packages/nexmo-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/nexmo-configuration-schema","docId":"packages/nexmo-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/nexmo-changelog","docId":"packages/nexmo-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/nexmo-readme","docId":"packages/nexmo-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"ocl","items":[{"type":"link","label":"Overview","href":"/adaptors/ocl","docId":"ocl"},{"type":"link","label":"Functions","href":"/adaptors/packages/ocl-docs","docId":"packages/ocl-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/ocl-configuration-schema","docId":"packages/ocl-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/ocl-changelog","docId":"packages/ocl-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/ocl-readme","docId":"packages/ocl-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"odk","items":[{"type":"link","label":"Overview","href":"/adaptors/odk","docId":"odk"},{"type":"link","label":"Functions","href":"/adaptors/packages/odk-docs","docId":"packages/odk-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/odk-configuration-schema","docId":"packages/odk-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/odk-changelog","docId":"packages/odk-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/odk-readme","docId":"packages/odk-readme"}],"collapsed":true,"collapsible":true},{"type":"link","label":"ona","href":"/adaptors/ona","docId":"ona"},{"type":"category","label":"openfn","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/openfn-docs","docId":"packages/openfn-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/openfn-configuration-schema","docId":"packages/openfn-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/openfn-changelog","docId":"packages/openfn-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/openfn-readme","docId":"packages/openfn-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"openhim","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/openhim-docs","docId":"packages/openhim-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/openhim-configuration-schema","docId":"packages/openhim-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"\ud83d\udcdc Create encounter in OpenHIM","href":"/adaptors/library/jobs/auto/CommCare-FHIR","docId":"library/jobs/auto/CommCare-FHIR"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/openhim-changelog","docId":"packages/openhim-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/openhim-readme","docId":"packages/openhim-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"openimis","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/openimis-docs","docId":"packages/openimis-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/openimis-configuration-schema","docId":"packages/openimis-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/openimis-changelog","docId":"packages/openimis-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/openimis-readme","docId":"packages/openimis-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"openlmis","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/openlmis-docs","docId":"packages/openlmis-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/openlmis-configuration-schema","docId":"packages/openlmis-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/openlmis-changelog","docId":"packages/openlmis-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/openlmis-readme","docId":"packages/openlmis-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"openmrs","items":[{"type":"link","label":"Overview","href":"/adaptors/openmrs","docId":"openmrs"},{"type":"link","label":"Functions","href":"/adaptors/packages/openmrs-docs","docId":"packages/openmrs-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/openmrs-configuration-schema","docId":"packages/openmrs-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"Create Person in OpenMRS","href":"/adaptors/library/jobs/auto/Create-Person-in-OpenMRS-2016-02-12","docId":"library/jobs/auto/Create-Person-in-OpenMRS-2016-02-12"},{"type":"link","label":"Create Patient in OpenMRS","href":"/adaptors/library/jobs/auto/Create-Patient-in-OpenMRS-2019-10-24","docId":"library/jobs/auto/Create-Patient-in-OpenMRS-2019-10-24"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/openmrs-changelog","docId":"packages/openmrs-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/openmrs-readme","docId":"packages/openmrs-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"openspp","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/openspp-docs","docId":"packages/openspp-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/openspp-configuration-schema","docId":"packages/openspp-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/openspp-changelog","docId":"packages/openspp-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/openspp-readme","docId":"packages/openspp-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"postgresql","items":[{"type":"link","label":"Overview","href":"/adaptors/postgresql","docId":"postgresql"},{"type":"link","label":"Functions","href":"/adaptors/packages/postgresql-docs","docId":"packages/postgresql-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/postgresql-configuration-schema","docId":"packages/postgresql-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"\ud83d\udcdc Using findValue with an array of data","href":"/adaptors/library/jobs/auto/async-findValue","docId":"library/jobs/auto/async-findValue"},{"type":"link","label":"1. Get data from SLUHIS","href":"/adaptors/library/jobs/auto/1-Get-data-from-SLUHIS-2023-03-08","docId":"library/jobs/auto/1-Get-data-from-SLUHIS-2023-03-08"},{"type":"link","label":"Load to DB","href":"/adaptors/library/jobs/auto/Load-to-DB-2022-05-16","docId":"library/jobs/auto/Load-to-DB-2022-05-16"},{"type":"link","label":"Upsert to mBrana","href":"/adaptors/library/jobs/auto/Upsert-to-mBrana-2021-05-11","docId":"library/jobs/auto/Upsert-to-mBrana-2021-05-11"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/postgresql-changelog","docId":"packages/postgresql-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/postgresql-readme","docId":"packages/postgresql-readme"}],"collapsed":true,"collapsible":true},{"type":"link","label":"powerbi","href":"/adaptors/powerbi","docId":"powerbi"},{"type":"category","label":"primero","items":[{"type":"link","label":"Overview","href":"/adaptors/primero","docId":"primero"},{"type":"link","label":"Functions","href":"/adaptors/packages/primero-docs","docId":"packages/primero-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/primero-configuration-schema","docId":"packages/primero-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"Get cases from Primero","href":"/adaptors/library/jobs/auto/Get-cases-from-Primero-2021-09-23","docId":"library/jobs/auto/Get-cases-from-Primero-2021-09-23"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/primero-changelog","docId":"packages/primero-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/primero-readme","docId":"packages/primero-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"progres","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/progres-docs","docId":"packages/progres-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/progres-configuration-schema","docId":"packages/progres-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/progres-changelog","docId":"packages/progres-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/progres-readme","docId":"packages/progres-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"rapidpro","items":[{"type":"link","label":"Overview","href":"/adaptors/rapidpro","docId":"rapidpro"},{"type":"link","label":"Functions","href":"/adaptors/packages/rapidpro-docs","docId":"packages/rapidpro-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/rapidpro-configuration-schema","docId":"packages/rapidpro-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/rapidpro-changelog","docId":"packages/rapidpro-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/rapidpro-readme","docId":"packages/rapidpro-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"redis","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/redis-docs","docId":"packages/redis-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/redis-configuration-schema","docId":"packages/redis-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/redis-changelog","docId":"packages/redis-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/redis-readme","docId":"packages/redis-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"resourcemap","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/resourcemap-docs","docId":"packages/resourcemap-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/resourcemap-configuration-schema","docId":"packages/resourcemap-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/resourcemap-changelog","docId":"packages/resourcemap-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/resourcemap-readme","docId":"packages/resourcemap-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"salesforce","items":[{"type":"link","label":"Overview","href":"/adaptors/salesforce","docId":"salesforce"},{"type":"link","label":"Functions","href":"/adaptors/packages/salesforce-docs","docId":"packages/salesforce-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/salesforce-configuration-schema","docId":"packages/salesforce-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"\ud83d\udcdc Pre-processing data","href":"/adaptors/library/jobs/auto/alter-state-before-operations","docId":"library/jobs/auto/alter-state-before-operations"},{"type":"link","label":"\ud83d\udcdc Using merge and each","href":"/adaptors/library/jobs/auto/bring-formId-into-data-array-then-create-parent-and-children-in-salesforce","docId":"library/jobs/auto/bring-formId-into-data-array-then-create-parent-and-children-in-salesforce"},{"type":"link","label":"\ud83d\udcdc Using promises","href":"/adaptors/library/jobs/auto/complex-state-control","docId":"library/jobs/auto/complex-state-control"},{"type":"link","label":"\ud83d\udcdc Concat fields with nulls","href":"/adaptors/library/jobs/auto/concatenate-many-fields-with-nulls","docId":"library/jobs/auto/concatenate-many-fields-with-nulls"},{"type":"link","label":"\ud83d\udcdc Create/update records if...","href":"/adaptors/library/jobs/auto/create-if-proposal","docId":"library/jobs/auto/create-if-proposal"},{"type":"link","label":"\ud83d\udcdc Create SMS linked to contact","href":"/adaptors/library/jobs/auto/Create-SMS-Linked-to-Contact-in-SF","docId":"library/jobs/auto/Create-SMS-Linked-to-Contact-in-SF"},{"type":"link","label":"\ud83d\udcdc Handling multiple ODK repeat groups","href":"/adaptors/library/jobs/auto/ODK-Create-Many-Records-Moving-In-And-Out-Of-Repeat-Blocks","docId":"library/jobs/auto/ODK-Create-Many-Records-Moving-In-And-Out-Of-Repeat-Blocks"},{"type":"link","label":"\ud83d\udcdc Merge data into child array then upsert","href":"/adaptors/library/jobs/auto/upsert-many-items-in-array-with-value-outside-array","docId":"library/jobs/auto/upsert-many-items-in-array-with-value-outside-array"},{"type":"link","label":"WF4-2 Bulk upsert Services","href":"/adaptors/library/jobs/auto/WF4-2-Bulk-upsert-Services-2023-05-19","docId":"library/jobs/auto/WF4-2-Bulk-upsert-Services-2023-05-19"},{"type":"link","label":"WF3-2 Bulk upsert Person Visits","href":"/adaptors/library/jobs/auto/WF3-2-Bulk-upsert-Person-Visits-2023-05-19","docId":"library/jobs/auto/WF3-2-Bulk-upsert-Person-Visits-2023-05-19"},{"type":"link","label":"WF2-2 Bulk upsert Persons","href":"/adaptors/library/jobs/auto/WF2-2-Bulk-upsert-Persons-2023-05-19","docId":"library/jobs/auto/WF2-2-Bulk-upsert-Persons-2023-05-19"},{"type":"link","label":"WF1-2 Bulk upsert HHs and HH Visits","href":"/adaptors/library/jobs/auto/WF1-2-Bulk-upsert-HHs-and-HH-Visits-2023-05-19","docId":"library/jobs/auto/WF1-2-Bulk-upsert-HHs-and-HH-Visits-2023-05-19"},{"type":"link","label":"Q3 2022 Upsert Person Visit","href":"/adaptors/library/jobs/auto/Q3-2022-Upsert-Person-Visit-2022-06-28","docId":"library/jobs/auto/Q3-2022-Upsert-Person-Visit-2022-06-28"},{"type":"link","label":"Q4 2022 Upsert Supervision - Feedback","href":"/adaptors/library/jobs/auto/Q4-2022-Upsert-Supervision-Feedback-2022-08-19","docId":"library/jobs/auto/Q4-2022-Upsert-Supervision-Feedback-2022-08-19"},{"type":"link","label":"Q4 2022 Upsert Supervision - Household Spot Check","href":"/adaptors/library/jobs/auto/Q4-2022-Upsert-Supervision-Household-Spot-Check-2022-08-24","docId":"library/jobs/auto/Q4-2022-Upsert-Supervision-Household-Spot-Check-2022-08-24"},{"type":"link","label":"Q4 2022 Upsert Supervision - Accompaniment","href":"/adaptors/library/jobs/auto/Q4-2022-Upsert-Supervision-Accompaniment-2022-08-22","docId":"library/jobs/auto/Q4-2022-Upsert-Supervision-Accompaniment-2022-08-22"},{"type":"link","label":"Q3 2022 Create Distribution & Referral in SF","href":"/adaptors/library/jobs/auto/Q3-2022-Create-Distribution-Referral-in-SF-2020-06-19","docId":"library/jobs/auto/Q3-2022-Create-Distribution-Referral-in-SF-2020-06-19"},{"type":"link","label":"Upsert Team or Group Name","href":"/adaptors/library/jobs/auto/Upsert-Team-or-Group-Name-2021-04-28","docId":"library/jobs/auto/Upsert-Team-or-Group-Name-2021-04-28"},{"type":"link","label":"Upsert Service Referral Followup","href":"/adaptors/library/jobs/auto/Upsert-Service-Referral-Followup-2021-04-30","docId":"library/jobs/auto/Upsert-Service-Referral-Followup-2021-04-30"},{"type":"link","label":"Upsert Service Referral","href":"/adaptors/library/jobs/auto/Upsert-Service-Referral-2021-04-30","docId":"library/jobs/auto/Upsert-Service-Referral-2021-04-30"},{"type":"link","label":"Upsert Service Referral 2","href":"/adaptors/library/jobs/auto/Upsert-Service-Referral-2-2021-06-14","docId":"library/jobs/auto/Upsert-Service-Referral-2-2021-06-14"},{"type":"link","label":"Upsert Risk and Vulnerability Assessment - Service Referral","href":"/adaptors/library/jobs/auto/Upsert-Risk-and-Vulnerability-Assessment-Service-Referral-2021-05-25","docId":"library/jobs/auto/Upsert-Risk-and-Vulnerability-Assessment-Service-Referral-2021-05-25"},{"type":"link","label":"Upsert Register Skills plus Club","href":"/adaptors/library/jobs/auto/Upsert-Register-Skills-plus-Club-2021-04-30","docId":"library/jobs/auto/Upsert-Register-Skills-plus-Club-2021-04-30"},{"type":"link","label":"Upsert Register Participant Skillz","href":"/adaptors/library/jobs/auto/Upsert-Register-Participant-Skillz-2021-08-30","docId":"library/jobs/auto/Upsert-Register-Participant-Skillz-2021-08-30"},{"type":"link","label":"Upsert Register Participant","href":"/adaptors/library/jobs/auto/Upsert-Register-Participant-2021-04-28","docId":"library/jobs/auto/Upsert-Register-Participant-2021-04-28"},{"type":"link","label":"Upsert Register Event","href":"/adaptors/library/jobs/auto/Upsert-Register-Event-2021-04-30","docId":"library/jobs/auto/Upsert-Register-Event-2021-04-30"},{"type":"link","label":"Upsert Pre Challenges","href":"/adaptors/library/jobs/auto/Upsert-Pre-Challenges-2021-04-30","docId":"library/jobs/auto/Upsert-Pre-Challenges-2021-04-30"},{"type":"link","label":"Upsert Post Challenges","href":"/adaptors/library/jobs/auto/Upsert-Post-Challenges-2021-04-30","docId":"library/jobs/auto/Upsert-Post-Challenges-2021-04-30"},{"type":"link","label":"Upsert Intervention Notes","href":"/adaptors/library/jobs/auto/Upsert-Intervention-Notes-2021-04-28","docId":"library/jobs/auto/Upsert-Intervention-Notes-2021-04-28"},{"type":"link","label":"Upsert Home Visit Log Form","href":"/adaptors/library/jobs/auto/Upsert-Home-Visit-Log-Form-2021-05-03","docId":"library/jobs/auto/Upsert-Home-Visit-Log-Form-2021-05-03"},{"type":"link","label":"Upsert Confirm Services Received","href":"/adaptors/library/jobs/auto/Upsert-Confirm-Services-Received-2021-06-14","docId":"library/jobs/auto/Upsert-Confirm-Services-Received-2021-06-14"},{"type":"link","label":"Upsert Coach Support Visit CSV","href":"/adaptors/library/jobs/auto/Upsert-Coach-Support-Visit-CSV-2021-04-28","docId":"library/jobs/auto/Upsert-Coach-Support-Visit-CSV-2021-04-28"},{"type":"link","label":"Upsert Attendance Skillz Plus Club","href":"/adaptors/library/jobs/auto/Upsert-Attendance-Skillz-Plus-Club-2021-05-24","docId":"library/jobs/auto/Upsert-Attendance-Skillz-Plus-Club-2021-05-24"},{"type":"link","label":"Upsert ART Adherence Self-Reporting Tool","href":"/adaptors/library/jobs/auto/Upsert-ART-Adherence-Self-Reporting-Tool-2021-04-30","docId":"library/jobs/auto/Upsert-ART-Adherence-Self-Reporting-Tool-2021-04-30"},{"type":"link","label":"Risk and Vulnerability Assessment","href":"/adaptors/library/jobs/auto/Risk-and-Vulnerability-Assessment-2021-05-27","docId":"library/jobs/auto/Risk-and-Vulnerability-Assessment-2021-05-27"},{"type":"link","label":"Upsert Aggregate Service Referrals","href":"/adaptors/library/jobs/auto/Upsert-Aggregate-Service-Referrals-2021-04-30","docId":"library/jobs/auto/Upsert-Aggregate-Service-Referrals-2021-04-30"},{"type":"link","label":"Register Participant - V2 Skillz","href":"/adaptors/library/jobs/auto/Register-Participant-V2-Skillz-2021-06-02","docId":"library/jobs/auto/Register-Participant-V2-Skillz-2021-06-02"},{"type":"link","label":"PHQ9","href":"/adaptors/library/jobs/auto/PHQ9-2021-05-03","docId":"library/jobs/auto/PHQ9-2021-05-03"},{"type":"link","label":"Outcome Survey","href":"/adaptors/library/jobs/auto/Outcome-Survey-2024-07-16","docId":"library/jobs/auto/Outcome-Survey-2024-07-16"},{"type":"link","label":"HIV Testing Event Snapshot","href":"/adaptors/library/jobs/auto/HIV-Testing-Event-Snapshot-2021-05-03","docId":"library/jobs/auto/HIV-Testing-Event-Snapshot-2021-05-03"},{"type":"link","label":"Malaria Testing Event Snapshot","href":"/adaptors/library/jobs/auto/Malaria-Testing-Event-Snapshot-2021-05-03","docId":"library/jobs/auto/Malaria-Testing-Event-Snapshot-2021-05-03"},{"type":"link","label":"Create Intervention","href":"/adaptors/library/jobs/auto/Create-Intervention-2021-04-08","docId":"library/jobs/auto/Create-Intervention-2021-04-08"},{"type":"link","label":"Coach Session Register","href":"/adaptors/library/jobs/auto/Coach-Session-Register-2021-05-03","docId":"library/jobs/auto/Coach-Session-Register-2021-05-03"},{"type":"link","label":"Attendance Non Skillz","href":"/adaptors/library/jobs/auto/Attendance-Non-Skillz-2021-06-14","docId":"library/jobs/auto/Attendance-Non-Skillz-2021-06-14"},{"type":"link","label":"Malaria Testing Event Statistics","href":"/adaptors/library/jobs/auto/Malaria-Testing-Event-Statistics-2021-05-03","docId":"library/jobs/auto/Malaria-Testing-Event-Statistics-2021-05-03"},{"type":"link","label":"HIV Testing Event Statistics","href":"/adaptors/library/jobs/auto/HIV-Testing-Event-Statistics-2021-05-03","docId":"library/jobs/auto/HIV-Testing-Event-Statistics-2021-05-03"},{"type":"link","label":"Upsert User in Salesforce","href":"/adaptors/library/jobs/auto/Upsert-User-in-Salesforce-2021-04-16","docId":"library/jobs/auto/Upsert-User-in-Salesforce-2021-04-16"},{"type":"link","label":"WF3-2a Repeat Failed Person Visits","href":"/adaptors/library/jobs/auto/WF3-2a-Repeat-Failed-Person-Visits-2023-05-31","docId":"library/jobs/auto/WF3-2a-Repeat-Failed-Person-Visits-2023-05-31"},{"type":"link","label":"Q3 2022 Upsert Household & Household Visit in SF","href":"/adaptors/library/jobs/auto/Q3-2022-Upsert-Household-Household-Visit-in-SF-2022-06-28","docId":"library/jobs/auto/Q3-2022-Upsert-Household-Household-Visit-in-SF-2022-06-28"},{"type":"link","label":"Q3 2022 Upsert Person","href":"/adaptors/library/jobs/auto/Q3-2022-Upsert-Person-2022-04-21","docId":"library/jobs/auto/Q3-2022-Upsert-Person-2022-04-21"},{"type":"link","label":"Create contact","href":"/adaptors/library/jobs/auto/Create-contact-2021-03-01","docId":"library/jobs/auto/Create-contact-2021-03-01"},{"type":"link","label":"Create Person in SF","href":"/adaptors/library/jobs/auto/Create-Person-in-SF-2019-02-25","docId":"library/jobs/auto/Create-Person-in-SF-2019-02-25"},{"type":"link","label":"1. Create Payment in SF","href":"/adaptors/library/jobs/auto/1-Create-Payment-in-SF-2018-09-03","docId":"library/jobs/auto/1-Create-Payment-in-SF-2018-09-03"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/salesforce-changelog","docId":"packages/salesforce-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/salesforce-readme","docId":"packages/salesforce-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"satusehat","items":[{"type":"link","label":"Overview","href":"/adaptors/satusehat","docId":"satusehat"},{"type":"link","label":"Functions","href":"/adaptors/packages/satusehat-docs","docId":"packages/satusehat-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/satusehat-configuration-schema","docId":"packages/satusehat-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/satusehat-changelog","docId":"packages/satusehat-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/satusehat-readme","docId":"packages/satusehat-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"sftp","items":[{"type":"link","label":"Overview","href":"/adaptors/sftp","docId":"sftp"},{"type":"link","label":"Functions","href":"/adaptors/packages/sftp-docs","docId":"packages/sftp-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/sftp-configuration-schema","docId":"packages/sftp-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/sftp-changelog","docId":"packages/sftp-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/sftp-readme","docId":"packages/sftp-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"surveycto","items":[{"type":"link","label":"Overview","href":"/adaptors/surveycto","docId":"surveycto"},{"type":"link","label":"Functions","href":"/adaptors/packages/surveycto-docs","docId":"packages/surveycto-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/surveycto-configuration-schema","docId":"packages/surveycto-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/surveycto-changelog","docId":"packages/surveycto-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/surveycto-readme","docId":"packages/surveycto-readme"}],"collapsed":true,"collapsible":true},{"type":"link","label":"tableau","href":"/adaptors/tableau","docId":"tableau"},{"type":"category","label":"telerivet","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/telerivet-docs","docId":"packages/telerivet-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/telerivet-configuration-schema","docId":"packages/telerivet-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"\ud83d\udcdc Send sms from Salesforce workflow action","href":"/adaptors/library/jobs/auto/send-sms-from-salesforce-workflow","docId":"library/jobs/auto/send-sms-from-salesforce-workflow"},{"type":"link","label":"2. SMS Balance Update to Customer","href":"/adaptors/library/jobs/auto/2-SMS-Balance-Update-to-Customer-2018-12-14","docId":"library/jobs/auto/2-SMS-Balance-Update-to-Customer-2018-12-14"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/telerivet-changelog","docId":"packages/telerivet-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/telerivet-readme","docId":"packages/telerivet-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"testing","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/testing-docs","docId":"packages/testing-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/testing-configuration-schema","docId":"packages/testing-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/testing-changelog","docId":"packages/testing-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/testing-readme","docId":"packages/testing-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"twilio","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/twilio-docs","docId":"packages/twilio-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/twilio-configuration-schema","docId":"packages/twilio-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/twilio-changelog","docId":"packages/twilio-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/twilio-readme","docId":"packages/twilio-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"vtiger","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/vtiger-docs","docId":"packages/vtiger-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/vtiger-configuration-schema","docId":"packages/vtiger-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/vtiger-changelog","docId":"packages/vtiger-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/vtiger-readme","docId":"packages/vtiger-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"wigal-sms","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/wigal-sms-docs","docId":"packages/wigal-sms-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/wigal-sms-configuration-schema","docId":"packages/wigal-sms-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/wigal-sms-changelog","docId":"packages/wigal-sms-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/wigal-sms-readme","docId":"packages/wigal-sms-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"zoho","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/zoho-docs","docId":"packages/zoho-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/zoho-configuration-schema","docId":"packages/zoho-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/zoho-changelog","docId":"packages/zoho-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/zoho-readme","docId":"packages/zoho-readme"}],"collapsed":true,"collapsible":true}]},"docs":{"adaptors-intro":{"id":"adaptors-intro","title":"Adaptors","description":"Connect Anything.","sidebar":"adaptors"},"asana":{"id":"asana","title":"Asana Adaptor","description":"About Asana","sidebar":"adaptors"},"cht":{"id":"cht","title":"Community Health Toolkit (CHT)","description":"About Community Health Toolkit (CHT)","sidebar":"adaptors"},"ckan":{"id":"ckan","title":"CKAN","description":"App Overview","sidebar":"adaptors"},"collections":{"id":"collections","title":"Collections Adaptor","description":"Collections Overview","sidebar":"adaptors"},"commcare":{"id":"commcare","title":"CommCare Adaptor","description":"About CommCare","sidebar":"adaptors"},"common":{"id":"common","title":"Common Adaptor","description":"About OpenFn \\"Common\\" Language","sidebar":"adaptors"},"dhis2":{"id":"dhis2","title":"DHIS2","description":"App Overview","sidebar":"adaptors"},"fhir":{"id":"fhir","title":"FHIR Adaptor","description":"About FHIR","sidebar":"adaptors"},"fhir-fr":{"id":"fhir-fr","title":"FHIR-FR IG Adaptor","description":"Custom FHIR Adaptor: fhir-fr","sidebar":"adaptors"},"fhir-ndr-et":{"id":"fhir-ndr-et","title":"FHIR-NDR-ET IG Adaptor","description":"Custom FHIR Adaptor: fhir-ndr-et","sidebar":"adaptors"},"godata":{"id":"godata","title":"Go.Data","description":"Overview","sidebar":"adaptors"},"googlesheets":{"id":"googlesheets","title":"Google Forms/Google Sheets","description":"Google Sheets Adaptor Overview","sidebar":"adaptors"},"http":{"id":"http","title":"HTTP Adaptor","description":"About the HTTP \\"universal\\" adaptor","sidebar":"adaptors"},"kobotoolbox":{"id":"kobotoolbox","title":"Kobo Toolbox","description":"App Overview","sidebar":"adaptors"},"library-intro":{"id":"library-intro","title":"The Community Job Library","description":"A growing knowledge base","sidebar":"adaptors"},"library/jobs/auto/0-Get-TEI-data-2021-06-02":{"id":"library/jobs/auto/0-Get-TEI-data-2021-06-02","title":"0 - Get TEI data","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/01-send-mailgun-email-2018-12-04":{"id":"library/jobs/auto/01-send-mailgun-email-2018-12-04","title":"01 send mailgun email","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/01a-Create-Registrants-2019-11-19":{"id":"library/jobs/auto/01a-Create-Registrants-2019-11-19","title":"01a/ Create Registrants","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/01b-Query-new-person-record-2019-12-13":{"id":"library/jobs/auto/01b-Query-new-person-record-2019-12-13","title":"01b/ Query new person record","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/01c-Create-person_position-record-2019-12-13":{"id":"library/jobs/auto/01c-Create-person_position-record-2019-12-13","title":"01c/ Create person_position record","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/02a-Query-DB-for-people-to-pay-2019-12-11":{"id":"library/jobs/auto/02a-Query-DB-for-people-to-pay-2019-12-11","title":"02a/ Query DB for people to pay","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/02b-Initiate-Payments-2019-11-19":{"id":"library/jobs/auto/02b-Initiate-Payments-2019-11-19","title":"02b/ Initiate Payments","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/03-Update-Payment-Status-2019-11-19":{"id":"library/jobs/auto/03-Update-Payment-Status-2019-11-19","title":"03/ Update Payment Status","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/04a-Query-for-job-changes-2019-12-12":{"id":"library/jobs/auto/04a-Query-for-job-changes-2019-12-12","title":"04a/Query for job changes","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/04b-Update-ODK-form-2019-12-03":{"id":"library/jobs/auto/04b-Update-ODK-form-2019-12-03","title":"04b/ Update ODK form","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/05-Submit-employee-evaluation-2019-12-03":{"id":"library/jobs/auto/05-Submit-employee-evaluation-2019-12-03","title":"05/ Submit employee evaluation","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/05a-Query-for-new-employees-2019-12-19":{"id":"library/jobs/auto/05a-Query-for-new-employees-2019-12-19","title":"05a/Query for new employees","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/05b-Update-ODK-eval-form-2019-12-19":{"id":"library/jobs/auto/05b-Update-ODK-eval-form-2019-12-19","title":"05b/Update ODK eval form","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/1-Create-Payment-in-SF-2018-09-03":{"id":"library/jobs/auto/1-Create-Payment-in-SF-2018-09-03","title":"1. Create Payment in SF","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/1-Get-CommCare-Forms-Bulk-Extract-2021-04-08":{"id":"library/jobs/auto/1-Get-CommCare-Forms-Bulk-Extract-2021-04-08","title":"1 Get CommCare Forms Bulk Extract","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/1-Get-data-from-SLUHIS-2023-03-08":{"id":"library/jobs/auto/1-Get-data-from-SLUHIS-2023-03-08","title":"1. Get data from SLUHIS","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/2-SMS-Balance-Update-to-Customer-2018-12-14":{"id":"library/jobs/auto/2-SMS-Balance-Update-to-Customer-2018-12-14","title":"2. SMS Balance Update to Customer","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Add-DHIS2-Data-Value-Sets-2016-03-28":{"id":"library/jobs/auto/Add-DHIS2-Data-Value-Sets-2016-03-28","title":"Add DHIS2 Data Value Sets","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/aleksa-cron-2022-04-29":{"id":"library/jobs/auto/aleksa-cron-2022-04-29","title":"aleksa cron","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/alter-state-before-operations":{"id":"library/jobs/auto/alter-state-before-operations","title":"Pre-processing data","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Asana-test-2024-07-29":{"id":"library/jobs/auto/Asana-test-2024-07-29","title":"Asana-test","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/async-and-array-dot-map":{"id":"library/jobs/auto/async-and-array-dot-map","title":"Using async and array.map","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/async-findValue":{"id":"library/jobs/auto/async-findValue","title":"Using findValue with an array of data","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Attendance-Non-Skillz-2021-06-14":{"id":"library/jobs/auto/Attendance-Non-Skillz-2021-06-14","title":"Attendance Non Skillz","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/bring-formId-into-data-array-then-create-parent-and-children-in-salesforce":{"id":"library/jobs/auto/bring-formId-into-data-array-then-create-parent-and-children-in-salesforce","title":"Using merge and each","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Catch-Error-in-HTTP-Request-2016-08-26":{"id":"library/jobs/auto/Catch-Error-in-HTTP-Request-2016-08-26","title":"Catch Error in HTTP Request","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/CHW-case-to-DHIS2-2023-04-27":{"id":"library/jobs/auto/CHW-case-to-DHIS2-2023-04-27","title":"CHW case to DHIS2","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Coach-Session-Register-2021-05-03":{"id":"library/jobs/auto/Coach-Session-Register-2021-05-03","title":"Coach Session Register","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/commcare-asri-bulk-upload":{"id":"library/jobs/auto/commcare-asri-bulk-upload","title":"Bulk upload obat lookup-table","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/CommCare-FHIR":{"id":"library/jobs/auto/CommCare-FHIR","title":"Create encounter in OpenHIM","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/commcare-reports-api-2016-08-29":{"id":"library/jobs/auto/commcare-reports-api-2016-08-29","title":"commcare reports api","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/CommCare-to-Azure-Sql-2020-01-27":{"id":"library/jobs/auto/CommCare-to-Azure-Sql-2020-01-27","title":"CommCare to Azure Sql","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/complex-http-request-chains":{"id":"library/jobs/auto/complex-http-request-chains","title":"Chaining HTTP Requests","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/complex-state-control":{"id":"library/jobs/auto/complex-state-control","title":"Using promises","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/concatenate-many-fields-with-nulls":{"id":"library/jobs/auto/concatenate-many-fields-with-nulls","title":"Concat fields with nulls","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Create-contact-2021-03-01":{"id":"library/jobs/auto/Create-contact-2021-03-01","title":"Create contact","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/create-if-proposal":{"id":"library/jobs/auto/create-if-proposal","title":"Create/update records if...","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Create-Intervention-2021-04-08":{"id":"library/jobs/auto/Create-Intervention-2021-04-08","title":"Create Intervention","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Create-Patient-in-OpenMRS-2019-10-24":{"id":"library/jobs/auto/Create-Patient-in-OpenMRS-2019-10-24","title":"Create Patient in OpenMRS","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Create-Person-in-OpenMRS-2016-02-12":{"id":"library/jobs/auto/Create-Person-in-OpenMRS-2016-02-12","title":"Create Person in OpenMRS","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Create-Person-in-SF-2019-02-25":{"id":"library/jobs/auto/Create-Person-in-SF-2019-02-25","title":"Create Person in SF","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Create-SMS-Linked-to-Contact-in-SF":{"id":"library/jobs/auto/Create-SMS-Linked-to-Contact-in-SF","title":"Create SMS linked to contact","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Create-TEI-dhis2-2021-03-22":{"id":"library/jobs/auto/Create-TEI-dhis2-2021-03-22","title":"Create TEI (dhis2)","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/DHIS2-DataValues-API":{"id":"library/jobs/auto/DHIS2-DataValues-API","title":"Create data values","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/DHIS2-Events-2016-01-27":{"id":"library/jobs/auto/DHIS2-Events-2016-01-27","title":"DHIS2 Events","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/DHIS2-Events-API":{"id":"library/jobs/auto/DHIS2-Events-API","title":"Create new events","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Extract-Vitas-Data-2021-05-11":{"id":"library/jobs/auto/Extract-Vitas-Data-2021-05-11","title":"Extract Vitas Data","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Failed-Payment-Notification-2021-04-23":{"id":"library/jobs/auto/Failed-Payment-Notification-2021-04-23","title":"Failed Payment Notification","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Fetch-Claims-2023-07-17":{"id":"library/jobs/auto/Fetch-Claims-2023-07-17","title":"Fetch Claims","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Get-cases-from-Primero-2021-09-23":{"id":"library/jobs/auto/Get-cases-from-Primero-2021-09-23","title":"Get cases from Primero","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Get-CommCare-Forms-Bulk-Extract-2022-05-16":{"id":"library/jobs/auto/Get-CommCare-Forms-Bulk-Extract-2022-05-16","title":"Get CommCare Forms (Bulk Extract)","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/getKoboData":{"id":"library/jobs/auto/getKoboData","title":"Extract Kobo data from API to send to OpenFn Inbox","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/google-oauth-test-2024-12-20":{"id":"library/jobs/auto/google-oauth-test-2024-12-20","title":"google oauth test","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/HIV-Testing-Event-Snapshot-2021-05-03":{"id":"library/jobs/auto/HIV-Testing-Event-Snapshot-2021-05-03","title":"HIV Testing Event Snapshot","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/HIV-Testing-Event-Statistics-2021-05-03":{"id":"library/jobs/auto/HIV-Testing-Event-Statistics-2021-05-03","title":"HIV Testing Event Statistics","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Kobo-to-sheets-2023-10-13":{"id":"library/jobs/auto/Kobo-to-sheets-2023-10-13","title":"Kobo to sheets","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Load-to-DB-2022-05-16":{"id":"library/jobs/auto/Load-to-DB-2022-05-16","title":"Load to DB","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Load-to-DHIS2-2023-07-17":{"id":"library/jobs/auto/Load-to-DHIS2-2023-07-17","title":"Load to DHIS2","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Malaria-Testing-Event-Snapshot-2021-05-03":{"id":"library/jobs/auto/Malaria-Testing-Event-Snapshot-2021-05-03","title":"Malaria Testing Event Snapshot","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Malaria-Testing-Event-Statistics-2021-05-03":{"id":"library/jobs/auto/Malaria-Testing-Event-Statistics-2021-05-03","title":"Malaria Testing Event Statistics","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/no-return-2023-01-06":{"id":"library/jobs/auto/no-return-2023-01-06","title":"no return","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/ODK-Create-Many-Records-Moving-In-And-Out-Of-Repeat-Blocks":{"id":"library/jobs/auto/ODK-Create-Many-Records-Moving-In-And-Out-Of-Repeat-Blocks","title":"Handling multiple ODK repeat groups","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Outcome-Survey-2024-07-16":{"id":"library/jobs/auto/Outcome-Survey-2024-07-16","title":"Outcome Survey","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Pay-CHW-2021-04-23":{"id":"library/jobs/auto/Pay-CHW-2021-04-23","title":"Pay CHW","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/PHQ9-2021-05-03":{"id":"library/jobs/auto/PHQ9-2021-05-03","title":"PHQ9","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/promise-all-nested-requests":{"id":"library/jobs/auto/promise-all-nested-requests","title":"Promises and nested requests","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Q3-2022-Create-Distribution-Referral-in-SF-2020-06-19":{"id":"library/jobs/auto/Q3-2022-Create-Distribution-Referral-in-SF-2020-06-19","title":"Q3 2022 Create Distribution & Referral in SF","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Q3-2022-Update-HH-Name-in-CommCare-2021-09-27":{"id":"library/jobs/auto/Q3-2022-Update-HH-Name-in-CommCare-2021-09-27","title":"Q3 2022 Update HH Name in CommCare","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Q3-2022-Upsert-Household-Household-Visit-in-SF-2022-06-28":{"id":"library/jobs/auto/Q3-2022-Upsert-Household-Household-Visit-in-SF-2022-06-28","title":"Q3 2022 Upsert Household & Household Visit in SF","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Q3-2022-Upsert-Person-2022-04-21":{"id":"library/jobs/auto/Q3-2022-Upsert-Person-2022-04-21","title":"Q3 2022 Upsert Person","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Q3-2022-Upsert-Person-Visit-2022-06-28":{"id":"library/jobs/auto/Q3-2022-Upsert-Person-Visit-2022-06-28","title":"Q3 2022 Upsert Person Visit","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Q4-2022-Upsert-Supervision-Accompaniment-2022-08-22":{"id":"library/jobs/auto/Q4-2022-Upsert-Supervision-Accompaniment-2022-08-22","title":"Q4 2022 Upsert Supervision - Accompaniment","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Q4-2022-Upsert-Supervision-Feedback-2022-08-19":{"id":"library/jobs/auto/Q4-2022-Upsert-Supervision-Feedback-2022-08-19","title":"Q4 2022 Upsert Supervision - Feedback","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Q4-2022-Upsert-Supervision-Household-Spot-Check-2022-08-24":{"id":"library/jobs/auto/Q4-2022-Upsert-Supervision-Household-Spot-Check-2022-08-24","title":"Q4 2022 Upsert Supervision - Household Spot Check","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Register-Participant-V2-Skillz-2021-06-02":{"id":"library/jobs/auto/Register-Participant-V2-Skillz-2021-06-02","title":"Register Participant - V2 Skillz","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Register-Patient-2021-03-02":{"id":"library/jobs/auto/Register-Patient-2021-03-02","title":"Register Patient","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Request-Vitas-Sync-2021-05-11":{"id":"library/jobs/auto/Request-Vitas-Sync-2021-05-11","title":"Request Vitas Sync","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Risk-and-Vulnerability-Assessment-2021-05-27":{"id":"library/jobs/auto/Risk-and-Vulnerability-Assessment-2021-05-27","title":"Risk and Vulnerability Assessment","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/send-mail-in-mailgun":{"id":"library/jobs/auto/send-mail-in-mailgun","title":"send email","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/send-sms-from-salesforce-workflow":{"id":"library/jobs/auto/send-sms-from-salesforce-workflow","title":"Send sms from Salesforce workflow action","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/synchronous-http-request":{"id":"library/jobs/auto/synchronous-http-request","title":"Chaining synchronous http requests","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/timeout":{"id":"library/jobs/auto/timeout","title":"Timeout to create a delay","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Aggregate-Service-Referrals-2021-04-30":{"id":"library/jobs/auto/Upsert-Aggregate-Service-Referrals-2021-04-30","title":"Upsert Aggregate Service Referrals","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-ART-Adherence-Self-Reporting-Tool-2021-04-30":{"id":"library/jobs/auto/Upsert-ART-Adherence-Self-Reporting-Tool-2021-04-30","title":"Upsert ART Adherence Self-Reporting Tool","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Attendance-Skillz-Plus-Club-2021-05-24":{"id":"library/jobs/auto/Upsert-Attendance-Skillz-Plus-Club-2021-05-24","title":"Upsert Attendance Skillz Plus Club","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Coach-Support-Visit-CSV-2021-04-28":{"id":"library/jobs/auto/Upsert-Coach-Support-Visit-CSV-2021-04-28","title":"Upsert Coach Support Visit CSV","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Confirm-Services-Received-2021-06-14":{"id":"library/jobs/auto/Upsert-Confirm-Services-Received-2021-06-14","title":"Upsert Confirm Services Received","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Home-Visit-Log-Form-2021-05-03":{"id":"library/jobs/auto/Upsert-Home-Visit-Log-Form-2021-05-03","title":"Upsert Home Visit Log Form","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Intervention-Notes-2021-04-28":{"id":"library/jobs/auto/Upsert-Intervention-Notes-2021-04-28","title":"Upsert Intervention Notes","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/upsert-many-items-in-array-with-value-outside-array":{"id":"library/jobs/auto/upsert-many-items-in-array-with-value-outside-array","title":"Merge data into child array then upsert","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Post-Challenges-2021-04-30":{"id":"library/jobs/auto/Upsert-Post-Challenges-2021-04-30","title":"Upsert Post Challenges","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Pre-Challenges-2021-04-30":{"id":"library/jobs/auto/Upsert-Pre-Challenges-2021-04-30","title":"Upsert Pre Challenges","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Register-Event-2021-04-30":{"id":"library/jobs/auto/Upsert-Register-Event-2021-04-30","title":"Upsert Register Event","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Register-Participant-2021-04-28":{"id":"library/jobs/auto/Upsert-Register-Participant-2021-04-28","title":"Upsert Register Participant","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Register-Participant-Skillz-2021-08-30":{"id":"library/jobs/auto/Upsert-Register-Participant-Skillz-2021-08-30","title":"Upsert Register Participant Skillz","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Register-Skills-plus-Club-2021-04-30":{"id":"library/jobs/auto/Upsert-Register-Skills-plus-Club-2021-04-30","title":"Upsert Register Skills plus Club","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Risk-and-Vulnerability-Assessment-Service-Referral-2021-05-25":{"id":"library/jobs/auto/Upsert-Risk-and-Vulnerability-Assessment-Service-Referral-2021-05-25","title":"Upsert Risk and Vulnerability Assessment - Service Referral","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Service-Referral-2-2021-06-14":{"id":"library/jobs/auto/Upsert-Service-Referral-2-2021-06-14","title":"Upsert Service Referral 2","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Service-Referral-2021-04-30":{"id":"library/jobs/auto/Upsert-Service-Referral-2021-04-30","title":"Upsert Service Referral","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Service-Referral-Followup-2021-04-30":{"id":"library/jobs/auto/Upsert-Service-Referral-Followup-2021-04-30","title":"Upsert Service Referral Followup","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Team-or-Group-Name-2021-04-28":{"id":"library/jobs/auto/Upsert-Team-or-Group-Name-2021-04-28","title":"Upsert Team or Group Name","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-to-mBrana-2021-05-11":{"id":"library/jobs/auto/Upsert-to-mBrana-2021-05-11","title":"Upsert to mBrana","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-User-in-Salesforce-2021-04-16":{"id":"library/jobs/auto/Upsert-User-in-Salesforce-2021-04-16","title":"Upsert User in Salesforce","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/WF1-1-Bulk-get-HH-cases-2023-05-19":{"id":"library/jobs/auto/WF1-1-Bulk-get-HH-cases-2023-05-19","title":"WF1-1 Bulk get HH cases","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/WF1-2-Bulk-upsert-HHs-and-HH-Visits-2023-05-19":{"id":"library/jobs/auto/WF1-2-Bulk-upsert-HHs-and-HH-Visits-2023-05-19","title":"WF1-2 Bulk upsert HHs and HH Visits","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/WF2-1-Bulk-get-Person-cases-2023-05-19":{"id":"library/jobs/auto/WF2-1-Bulk-get-Person-cases-2023-05-19","title":"WF2-1 Bulk get Person cases","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/WF2-2-Bulk-upsert-Persons-2023-05-19":{"id":"library/jobs/auto/WF2-2-Bulk-upsert-Persons-2023-05-19","title":"WF2-2 Bulk upsert Persons","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/WF3-1-Bulk-get-Person-Visit-cases-2023-05-19":{"id":"library/jobs/auto/WF3-1-Bulk-get-Person-Visit-cases-2023-05-19","title":"WF3-1 Bulk get Person Visit cases","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/WF3-2-Bulk-upsert-Person-Visits-2023-05-19":{"id":"library/jobs/auto/WF3-2-Bulk-upsert-Person-Visits-2023-05-19","title":"WF3-2 Bulk upsert Person Visits","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/WF3-2a-Repeat-Failed-Person-Visits-2023-05-31":{"id":"library/jobs/auto/WF3-2a-Repeat-Failed-Person-Visits-2023-05-31","title":"WF3-2a Repeat Failed Person Visits","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/WF4-1-Bulk-get-Referral-Cases-2023-05-19":{"id":"library/jobs/auto/WF4-1-Bulk-get-Referral-Cases-2023-05-19","title":"WF4-1 Bulk get Referral Cases","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/WF4-2-Bulk-upsert-Services-2023-05-19":{"id":"library/jobs/auto/WF4-2-Bulk-upsert-Services-2023-05-19","title":"WF4-2 Bulk upsert Services","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/triggers/xmlns":{"id":"library/triggers/xmlns","title":"Match a message with a fragment inside another object called `form`","description":""},"magpi":{"id":"magpi","title":"Magpi","description":"Magpi is not able to push data to external URLs. In order to fetch data from","sidebar":"adaptors"},"mailchimp":{"id":"mailchimp","title":"MailChimp Adaptor","description":"About Mailchimp","sidebar":"adaptors"},"mojatax":{"id":"mojatax","title":"Mojatax Adaptor","description":"About Mojatax","sidebar":"adaptors"},"mongodb":{"id":"mongodb","title":"MongoDB Adaptor","description":"About MongoDB","sidebar":"adaptors"},"moodle":{"id":"moodle","title":"Moodle","description":"Overview","sidebar":"adaptors"},"msgraph":{"id":"msgraph","title":"Microsoft Graph","description":"Overview","sidebar":"adaptors"},"mssql":{"id":"mssql","title":"MSSQL Adaptor","description":"About MSSQL","sidebar":"adaptors"},"mysql":{"id":"mysql","title":"MySQL Adaptor","description":"About MySQL","sidebar":"adaptors"},"ocl":{"id":"ocl","title":"OCL Adaptor","description":"About OCL","sidebar":"adaptors"},"odk":{"id":"odk","title":"ODK","description":"ODK is a data collection platform used by researchers,","sidebar":"adaptors"},"ona":{"id":"ona","title":"Ona.io","description":"Webhooks to push form data to OpenFn","sidebar":"adaptors"},"openmrs":{"id":"openmrs","title":"OpenMRS Adaptor","description":"About OpenMRS","sidebar":"adaptors"},"packages/asana-changelog":{"id":"packages/asana-changelog","title":"asana changelog","description":"4.0.8","sidebar":"adaptors"},"packages/asana-configuration-schema":{"id":"packages/asana-configuration-schema","title":"Config for asana","description":"Jobs that use the asana adaptor may require authentication. A","sidebar":"adaptors"},"packages/asana-docs":{"id":"packages/asana-docs","title":"asana@4.0.8","description":"createTask(params, callback)","sidebar":"adaptors"},"packages/asana-readme":{"id":"packages/asana-readme","title":"asana developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/asana","sidebar":"adaptors"},"packages/azure-storage-changelog":{"id":"packages/azure-storage-changelog","title":"azure-storage changelog","description":"2.0.8","sidebar":"adaptors"},"packages/azure-storage-configuration-schema":{"id":"packages/azure-storage-configuration-schema","title":"Config for azure-storage","description":"Jobs that use the azure-storage adaptor may require authentication. A","sidebar":"adaptors"},"packages/azure-storage-docs":{"id":"packages/azure-storage-docs","title":"azure-storage@2.0.8","description":"downloadBlob(blobName, [options])","sidebar":"adaptors"},"packages/azure-storage-readme":{"id":"packages/azure-storage-readme","title":"azure-storage developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/azure-storage","sidebar":"adaptors"},"packages/beyonic-changelog":{"id":"packages/beyonic-changelog","title":"beyonic changelog","description":"0.3.9","sidebar":"adaptors"},"packages/beyonic-configuration-schema":{"id":"packages/beyonic-configuration-schema","title":"Config for beyonic","description":"Jobs that use the beyonic adaptor may require authentication. A","sidebar":"adaptors"},"packages/beyonic-docs":{"id":"packages/beyonic-docs","title":"beyonic@0.3.9","description":"createCollectionRequest(data)","sidebar":"adaptors"},"packages/beyonic-readme":{"id":"packages/beyonic-readme","title":"beyonic developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/beyonic","sidebar":"adaptors"},"packages/bigquery-changelog":{"id":"packages/bigquery-changelog","title":"bigquery changelog","description":"3.0.9","sidebar":"adaptors"},"packages/bigquery-configuration-schema":{"id":"packages/bigquery-configuration-schema","title":"Config for bigquery","description":"Jobs that use the bigquery adaptor may require authentication. A","sidebar":"adaptors"},"packages/bigquery-docs":{"id":"packages/bigquery-docs","title":"bigquery@3.0.9","description":"load(dirPath, projectId, datasetId, tableId, loadOptions, callback)","sidebar":"adaptors"},"packages/bigquery-readme":{"id":"packages/bigquery-readme","title":"bigquery developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/bigquery","sidebar":"adaptors"},"packages/cartodb-changelog":{"id":"packages/cartodb-changelog","title":"cartodb changelog","description":"0.4.10","sidebar":"adaptors"},"packages/cartodb-configuration-schema":{"id":"packages/cartodb-configuration-schema","title":"Config for cartodb","description":"Jobs that use the cartodb adaptor may require authentication. A","sidebar":"adaptors"},"packages/cartodb-docs":{"id":"packages/cartodb-docs","title":"cartodb@0.4.10","description":"addRow(table, rowData)","sidebar":"adaptors"},"packages/cartodb-readme":{"id":"packages/cartodb-readme","title":"cartodb developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/cartodb","sidebar":"adaptors"},"packages/cht-changelog":{"id":"packages/cht-changelog","title":"cht changelog","description":"1.0.8","sidebar":"adaptors"},"packages/cht-configuration-schema":{"id":"packages/cht-configuration-schema","title":"Config for cht","description":"Jobs that use the cht adaptor may require authentication. A","sidebar":"adaptors"},"packages/cht-docs":{"id":"packages/cht-docs","title":"cht@1.0.8","description":"get(path, options, [callback])","sidebar":"adaptors"},"packages/cht-readme":{"id":"packages/cht-readme","title":"cht developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/cht","sidebar":"adaptors"},"packages/collections-changelog":{"id":"packages/collections-changelog","title":"collections changelog","description":"0.7.4","sidebar":"adaptors"},"packages/collections-configuration-schema":{"id":"packages/collections-configuration-schema","title":"Config for collections","description":"Jobs that use the collections adaptor may require authentication. A","sidebar":"adaptors"},"packages/collections-docs":{"id":"packages/collections-docs","title":"collections@0.7.4","description":"This adaptor exports the following namespaced functions:","sidebar":"adaptors"},"packages/collections-readme":{"id":"packages/collections-readme","title":"collections developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/collections","sidebar":"adaptors"},"packages/commcare-changelog":{"id":"packages/commcare-changelog","title":"commcare changelog","description":"3.2.9","sidebar":"adaptors"},"packages/commcare-configuration-schema":{"id":"packages/commcare-configuration-schema","title":"Config for commcare","description":"Jobs that use the commcare adaptor may require authentication. A","sidebar":"adaptors"},"packages/commcare-docs":{"id":"packages/commcare-docs","title":"commcare@3.2.9","description":"bulk(type, data, params)","sidebar":"adaptors"},"packages/commcare-readme":{"id":"packages/commcare-readme","title":"commcare developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/commcare","sidebar":"adaptors"},"packages/common-changelog":{"id":"packages/common-changelog","title":"common changelog","description":"2.3.0","sidebar":"adaptors"},"packages/common-configuration-schema":{"id":"packages/common-configuration-schema","title":"Config for common","description":"No configuration schema has been defined for the common adaptor.","sidebar":"adaptors"},"packages/common-docs":{"id":"packages/common-docs","title":"common@2.3.0","description":"arrayToString(arr, separator)","sidebar":"adaptors"},"packages/common-readme":{"id":"packages/common-readme","title":"common developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/common","sidebar":"adaptors"},"packages/dhis2-changelog":{"id":"packages/dhis2-changelog","title":"dhis2 changelog","description":"6.3.0","sidebar":"adaptors"},"packages/dhis2-configuration-schema":{"id":"packages/dhis2-configuration-schema","title":"Config for dhis2","description":"Jobs that use the dhis2 adaptor may require authentication. A","sidebar":"adaptors"},"packages/dhis2-docs":{"id":"packages/dhis2-docs","title":"dhis2@6.3.0","description":"attr(attribute, value)","sidebar":"adaptors"},"packages/dhis2-readme":{"id":"packages/dhis2-readme","title":"dhis2 developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/dhis2","sidebar":"adaptors"},"packages/dynamics-changelog":{"id":"packages/dynamics-changelog","title":"dynamics changelog","description":"0.5.12","sidebar":"adaptors"},"packages/dynamics-configuration-schema":{"id":"packages/dynamics-configuration-schema","title":"Config for dynamics","description":"Jobs that use the dynamics adaptor may require authentication. A","sidebar":"adaptors"},"packages/dynamics-docs":{"id":"packages/dynamics-docs","title":"dynamics@0.5.12","description":"This adaptor exports the following from common:","sidebar":"adaptors"},"packages/dynamics-readme":{"id":"packages/dynamics-readme","title":"dynamics developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/dynamics","sidebar":"adaptors"},"packages/facebook-changelog":{"id":"packages/facebook-changelog","title":"facebook changelog","description":"0.4.10","sidebar":"adaptors"},"packages/facebook-configuration-schema":{"id":"packages/facebook-configuration-schema","title":"Config for facebook","description":"Jobs that use the facebook adaptor may require authentication. A","sidebar":"adaptors"},"packages/facebook-docs":{"id":"packages/facebook-docs","title":"facebook@0.4.10","description":"postMessage(params)","sidebar":"adaptors"},"packages/facebook-readme":{"id":"packages/facebook-readme","title":"facebook developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/facebook","sidebar":"adaptors"},"packages/fhir-changelog":{"id":"packages/fhir-changelog","title":"fhir changelog","description":"5.0.3","sidebar":"adaptors"},"packages/fhir-configuration-schema":{"id":"packages/fhir-configuration-schema","title":"Config for fhir","description":"Jobs that use the fhir adaptor may require authentication. A","sidebar":"adaptors"},"packages/fhir-docs":{"id":"packages/fhir-docs","title":"fhir@5.0.3","description":"create(resourceType, resource, params, callback)","sidebar":"adaptors"},"packages/fhir-fr-changelog":{"id":"packages/fhir-fr-changelog","title":"fhir-fr changelog","description":"1.0.7","sidebar":"adaptors"},"packages/fhir-fr-configuration-schema":{"id":"packages/fhir-fr-configuration-schema","title":"Config for fhir-fr","description":"Jobs that use the fhir-fr adaptor may require authentication. A","sidebar":"adaptors"},"packages/fhir-fr-docs":{"id":"packages/fhir-fr-docs","title":"fhir-fr@1.0.7","description":"This adaptor exports the following namespaced functions:","sidebar":"adaptors"},"packages/fhir-fr-readme":{"id":"packages/fhir-fr-readme","title":"fhir-fr developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/fhir-fr","sidebar":"adaptors"},"packages/fhir-ndr-et-changelog":{"id":"packages/fhir-ndr-et-changelog","title":"fhir-ndr-et changelog","description":"0.1.10","sidebar":"adaptors"},"packages/fhir-ndr-et-configuration-schema":{"id":"packages/fhir-ndr-et-configuration-schema","title":"Config for fhir-ndr-et","description":"Jobs that use the fhir-ndr-et adaptor may require authentication. A","sidebar":"adaptors"},"packages/fhir-ndr-et-docs":{"id":"packages/fhir-ndr-et-docs","title":"fhir-ndr-et@0.1.10","description":"create(resourceType, resource, params, callback)","sidebar":"adaptors"},"packages/fhir-ndr-et-readme":{"id":"packages/fhir-ndr-et-readme","title":"fhir-ndr-et developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/fhir-ndr-et","sidebar":"adaptors"},"packages/fhir-readme":{"id":"packages/fhir-readme","title":"fhir developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/fhir","sidebar":"adaptors"},"packages/ghana-bdr-changelog":{"id":"packages/ghana-bdr-changelog","title":"ghana-bdr changelog","description":"0.1.3","sidebar":"adaptors"},"packages/ghana-bdr-configuration-schema":{"id":"packages/ghana-bdr-configuration-schema","title":"Config for ghana-bdr","description":"Jobs that use the ghana-bdr adaptor may require authentication. A","sidebar":"adaptors"},"packages/ghana-bdr-docs":{"id":"packages/ghana-bdr-docs","title":"ghana-bdr@0.1.3","description":"get(path, query)","sidebar":"adaptors"},"packages/ghana-bdr-readme":{"id":"packages/ghana-bdr-readme","title":"ghana-bdr developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/ghana-bdr","sidebar":"adaptors"},"packages/ghana-nia-changelog":{"id":"packages/ghana-nia-changelog","title":"ghana-nia changelog","description":"0.1.3","sidebar":"adaptors"},"packages/ghana-nia-configuration-schema":{"id":"packages/ghana-nia-configuration-schema","title":"Config for ghana-nia","description":"Jobs that use the ghana-nia adaptor may require authentication. A","sidebar":"adaptors"},"packages/ghana-nia-docs":{"id":"packages/ghana-nia-docs","title":"ghana-nia@0.1.3","description":"get(path, query)","sidebar":"adaptors"},"packages/ghana-nia-readme":{"id":"packages/ghana-nia-readme","title":"ghana-nia developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/ghana-nia","sidebar":"adaptors"},"packages/gmail-changelog":{"id":"packages/gmail-changelog","title":"gmail changelog","description":"1.1.1","sidebar":"adaptors"},"packages/gmail-configuration-schema":{"id":"packages/gmail-configuration-schema","title":"Config for gmail","description":"Jobs that use the gmail adaptor may require authentication. A","sidebar":"adaptors"},"packages/gmail-docs":{"id":"packages/gmail-docs","title":"gmail@1.1.1","description":"getContentsFromMessages(options)","sidebar":"adaptors"},"packages/gmail-readme":{"id":"packages/gmail-readme","title":"gmail developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/gmail","sidebar":"adaptors"},"packages/godata-changelog":{"id":"packages/godata-changelog","title":"godata changelog","description":"3.5.4","sidebar":"adaptors"},"packages/godata-configuration-schema":{"id":"packages/godata-configuration-schema","title":"Config for godata","description":"Jobs that use the godata adaptor may require authentication. A","sidebar":"adaptors"},"packages/godata-docs":{"id":"packages/godata-docs","title":"godata@3.5.4","description":"getCase(id, query, callback)","sidebar":"adaptors"},"packages/godata-readme":{"id":"packages/godata-readme","title":"godata developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/godata","sidebar":"adaptors"},"packages/googlehealthcare-changelog":{"id":"packages/googlehealthcare-changelog","title":"googlehealthcare changelog","description":"1.1.3","sidebar":"adaptors"},"packages/googlehealthcare-configuration-schema":{"id":"packages/googlehealthcare-configuration-schema","title":"Config for googlehealthcare","description":"Jobs that use the googlehealthcare adaptor may require authentication. A","sidebar":"adaptors"},"packages/googlehealthcare-docs":{"id":"packages/googlehealthcare-docs","title":"googlehealthcare@1.1.3","description":"createFhirResource([fhirStore], resource, callback)","sidebar":"adaptors"},"packages/googlehealthcare-readme":{"id":"packages/googlehealthcare-readme","title":"googlehealthcare developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/googlehealthcare","sidebar":"adaptors"},"packages/googlesheets-changelog":{"id":"packages/googlesheets-changelog","title":"googlesheets changelog","description":"3.0.9","sidebar":"adaptors"},"packages/googlesheets-configuration-schema":{"id":"packages/googlesheets-configuration-schema","title":"Config for googlesheets","description":"Jobs that use the googlesheets adaptor may require authentication. A","sidebar":"adaptors"},"packages/googlesheets-docs":{"id":"packages/googlesheets-docs","title":"googlesheets@3.0.9","description":"appendValues(params, callback)","sidebar":"adaptors"},"packages/googlesheets-readme":{"id":"packages/googlesheets-readme","title":"googlesheets developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/googlesheets","sidebar":"adaptors"},"packages/hive-changelog":{"id":"packages/hive-changelog","title":"hive changelog","description":"0.3.10","sidebar":"adaptors"},"packages/hive-configuration-schema":{"id":"packages/hive-configuration-schema","title":"Config for hive","description":"Jobs that use the hive adaptor may require authentication. A","sidebar":"adaptors"},"packages/hive-docs":{"id":"packages/hive-docs","title":"hive@0.3.10","description":"query(qs, options, callback)","sidebar":"adaptors"},"packages/hive-readme":{"id":"packages/hive-readme","title":"hive developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/hive","sidebar":"adaptors"},"packages/http-changelog":{"id":"packages/http-changelog","title":"http changelog","description":"6.5.4","sidebar":"adaptors"},"packages/http-configuration-schema":{"id":"packages/http-configuration-schema","title":"Config for http","description":"Jobs that use the http adaptor may require authentication. A","sidebar":"adaptors"},"packages/http-docs":{"id":"packages/http-docs","title":"http@6.5.4","description":"del(path, params, callback)","sidebar":"adaptors"},"packages/http-readme":{"id":"packages/http-readme","title":"http developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/http","sidebar":"adaptors"},"packages/hubtel-changelog":{"id":"packages/hubtel-changelog","title":"hubtel changelog","description":"1.0.1","sidebar":"adaptors"},"packages/hubtel-configuration-schema":{"id":"packages/hubtel-configuration-schema","title":"Config for hubtel","description":"Jobs that use the hubtel adaptor may require authentication. A","sidebar":"adaptors"},"packages/hubtel-docs":{"id":"packages/hubtel-docs","title":"hubtel@1.0.1","description":"request(method, path, body, options)","sidebar":"adaptors"},"packages/hubtel-readme":{"id":"packages/hubtel-readme","title":"hubtel developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/hubtel","sidebar":"adaptors"},"packages/intuit-changelog":{"id":"packages/intuit-changelog","title":"intuit changelog","description":"1.0.0","sidebar":"adaptors"},"packages/intuit-configuration-schema":{"id":"packages/intuit-configuration-schema","title":"Config for intuit","description":"Jobs that use the intuit adaptor may require authentication. A","sidebar":"adaptors"},"packages/intuit-docs":{"id":"packages/intuit-docs","title":"intuit@1.0.0","description":"This adaptor exports the following namespaced functions:","sidebar":"adaptors"},"packages/intuit-readme":{"id":"packages/intuit-readme","title":"intuit developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/intuit","sidebar":"adaptors"},"packages/khanacademy-changelog":{"id":"packages/khanacademy-changelog","title":"khanacademy changelog","description":"0.5.9","sidebar":"adaptors"},"packages/khanacademy-configuration-schema":{"id":"packages/khanacademy-configuration-schema","title":"Config for khanacademy","description":"Jobs that use the khanacademy adaptor may require authentication. A","sidebar":"adaptors"},"packages/khanacademy-docs":{"id":"packages/khanacademy-docs","title":"khanacademy@0.5.9","description":"This adaptor exports the following from common:","sidebar":"adaptors"},"packages/khanacademy-readme":{"id":"packages/khanacademy-readme","title":"khanacademy developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/khanacademy","sidebar":"adaptors"},"packages/kobotoolbox-changelog":{"id":"packages/kobotoolbox-changelog","title":"kobotoolbox changelog","description":"2.4.3","sidebar":"adaptors"},"packages/kobotoolbox-configuration-schema":{"id":"packages/kobotoolbox-configuration-schema","title":"Config for kobotoolbox","description":"Jobs that use the kobotoolbox adaptor may require authentication. A","sidebar":"adaptors"},"packages/kobotoolbox-docs":{"id":"packages/kobotoolbox-docs","title":"kobotoolbox@2.4.3","description":"getDeploymentInfo(params, callback)","sidebar":"adaptors"},"packages/kobotoolbox-readme":{"id":"packages/kobotoolbox-readme","title":"kobotoolbox developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/kobotoolbox","sidebar":"adaptors"},"packages/magpi-changelog":{"id":"packages/magpi-changelog","title":"magpi changelog","description":"1.2.4","sidebar":"adaptors"},"packages/magpi-configuration-schema":{"id":"packages/magpi-configuration-schema","title":"Config for magpi","description":"Jobs that use the magpi adaptor may require authentication. A","sidebar":"adaptors"},"packages/magpi-docs":{"id":"packages/magpi-docs","title":"magpi@1.2.4","description":"fetchSurveyData(params)","sidebar":"adaptors"},"packages/magpi-readme":{"id":"packages/magpi-readme","title":"magpi developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/magpi","sidebar":"adaptors"},"packages/mailchimp-changelog":{"id":"packages/mailchimp-changelog","title":"mailchimp changelog","description":"1.0.11","sidebar":"adaptors"},"packages/mailchimp-configuration-schema":{"id":"packages/mailchimp-configuration-schema","title":"Config for mailchimp","description":"Jobs that use the mailchimp adaptor may require authentication. A","sidebar":"adaptors"},"packages/mailchimp-docs":{"id":"packages/mailchimp-docs","title":"mailchimp@1.0.11","description":"addMember(params, [callback])","sidebar":"adaptors"},"packages/mailchimp-readme":{"id":"packages/mailchimp-readme","title":"mailchimp developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/mailchimp","sidebar":"adaptors"},"packages/mailgun-changelog":{"id":"packages/mailgun-changelog","title":"mailgun changelog","description":"0.5.9","sidebar":"adaptors"},"packages/mailgun-configuration-schema":{"id":"packages/mailgun-configuration-schema","title":"Config for mailgun","description":"Jobs that use the mailgun adaptor may require authentication. A","sidebar":"adaptors"},"packages/mailgun-docs":{"id":"packages/mailgun-docs","title":"mailgun@0.5.9","description":"send(params)","sidebar":"adaptors"},"packages/mailgun-readme":{"id":"packages/mailgun-readme","title":"mailgun developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/mailgun","sidebar":"adaptors"},"packages/maximo-changelog":{"id":"packages/maximo-changelog","title":"maximo changelog","description":"0.5.11","sidebar":"adaptors"},"packages/maximo-configuration-schema":{"id":"packages/maximo-configuration-schema","title":"Config for maximo","description":"Jobs that use the maximo adaptor may require authentication. A","sidebar":"adaptors"},"packages/maximo-docs":{"id":"packages/maximo-docs","title":"maximo@0.5.11","description":"fetch(params)","sidebar":"adaptors"},"packages/maximo-readme":{"id":"packages/maximo-readme","title":"maximo developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/maximo","sidebar":"adaptors"},"packages/medicmobile-changelog":{"id":"packages/medicmobile-changelog","title":"medicmobile changelog","description":"0.5.10","sidebar":"adaptors"},"packages/medicmobile-configuration-schema":{"id":"packages/medicmobile-configuration-schema","title":"Config for medicmobile","description":"Jobs that use the medicmobile adaptor may require authentication. A","sidebar":"adaptors"},"packages/medicmobile-docs":{"id":"packages/medicmobile-docs","title":"medicmobile@0.5.10","description":"changesApi(params, callback)","sidebar":"adaptors"},"packages/medicmobile-readme":{"id":"packages/medicmobile-readme","title":"medicmobile developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/medicmobile","sidebar":"adaptors"},"packages/mogli-changelog":{"id":"packages/mogli-changelog","title":"mogli changelog","description":"v0.1.6","sidebar":"adaptors"},"packages/mogli-configuration-schema":{"id":"packages/mogli-configuration-schema","title":"Config for mogli","description":"Jobs that use the mogli adaptor may require authentication. A","sidebar":"adaptors"},"packages/mogli-docs":{"id":"packages/mogli-docs","title":"mogli@0.5.11","description":"This adaptor exports the following namespaced functions:","sidebar":"adaptors"},"packages/mogli-readme":{"id":"packages/mogli-readme","title":"mogli developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/mogli","sidebar":"adaptors"},"packages/mojatax-changelog":{"id":"packages/mojatax-changelog","title":"mojatax changelog","description":"1.0.5","sidebar":"adaptors"},"packages/mojatax-configuration-schema":{"id":"packages/mojatax-configuration-schema","title":"Config for mojatax","description":"Jobs that use the mojatax adaptor may require authentication. A","sidebar":"adaptors"},"packages/mojatax-docs":{"id":"packages/mojatax-docs","title":"mojatax@1.0.5","description":"post(path, data, options, [callback])","sidebar":"adaptors"},"packages/mojatax-readme":{"id":"packages/mojatax-readme","title":"mojatax developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/mojatax","sidebar":"adaptors"},"packages/mongodb-changelog":{"id":"packages/mongodb-changelog","title":"mongodb changelog","description":"2.1.10","sidebar":"adaptors"},"packages/mongodb-configuration-schema":{"id":"packages/mongodb-configuration-schema","title":"Config for mongodb","description":"Jobs that use the mongodb adaptor may require authentication. A","sidebar":"adaptors"},"packages/mongodb-docs":{"id":"packages/mongodb-docs","title":"mongodb@2.1.10","description":"findDocuments(params)","sidebar":"adaptors"},"packages/mongodb-readme":{"id":"packages/mongodb-readme","title":"mongodb developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/mongodb","sidebar":"adaptors"},"packages/msgraph-changelog":{"id":"packages/msgraph-changelog","title":"msgraph changelog","description":"0.7.10","sidebar":"adaptors"},"packages/msgraph-configuration-schema":{"id":"packages/msgraph-configuration-schema","title":"Config for msgraph","description":"Jobs that use the msgraph adaptor may require authentication. A","sidebar":"adaptors"},"packages/msgraph-docs":{"id":"packages/msgraph-docs","title":"msgraph@0.7.10","description":"create(resource, data, callback)","sidebar":"adaptors"},"packages/msgraph-readme":{"id":"packages/msgraph-readme","title":"msgraph developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/msgraph","sidebar":"adaptors"},"packages/mssql-changelog":{"id":"packages/mssql-changelog","title":"mssql changelog","description":"5.0.10","sidebar":"adaptors"},"packages/mssql-configuration-schema":{"id":"packages/mssql-configuration-schema","title":"Config for mssql","description":"Jobs that use the mssql adaptor may require authentication. A","sidebar":"adaptors"},"packages/mssql-docs":{"id":"packages/mssql-docs","title":"mssql@5.0.10","description":"describeTable(tableName, options)","sidebar":"adaptors"},"packages/mssql-readme":{"id":"packages/mssql-readme","title":"mssql developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/mssql","sidebar":"adaptors"},"packages/mysql-changelog":{"id":"packages/mysql-changelog","title":"mysql changelog","description":"2.0.8","sidebar":"adaptors"},"packages/mysql-configuration-schema":{"id":"packages/mysql-configuration-schema","title":"Config for mysql","description":"Jobs that use the mysql adaptor may require authentication. A","sidebar":"adaptors"},"packages/mysql-docs":{"id":"packages/mysql-docs","title":"mysql@2.0.8","description":"insert(table, fields)","sidebar":"adaptors"},"packages/mysql-readme":{"id":"packages/mysql-readme","title":"mysql developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/mysql","sidebar":"adaptors"},"packages/nexmo-changelog":{"id":"packages/nexmo-changelog","title":"nexmo changelog","description":"0.5.12","sidebar":"adaptors"},"packages/nexmo-configuration-schema":{"id":"packages/nexmo-configuration-schema","title":"Config for nexmo","description":"Jobs that use the nexmo adaptor may require authentication. A","sidebar":"adaptors"},"packages/nexmo-docs":{"id":"packages/nexmo-docs","title":"nexmo@0.5.12","description":"sendSMS(from, toNumber, message)","sidebar":"adaptors"},"packages/nexmo-readme":{"id":"packages/nexmo-readme","title":"nexmo developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/nexmo","sidebar":"adaptors"},"packages/ocl-changelog":{"id":"packages/ocl-changelog","title":"ocl changelog","description":"1.2.11","sidebar":"adaptors"},"packages/ocl-configuration-schema":{"id":"packages/ocl-configuration-schema","title":"Config for ocl","description":"Jobs that use the ocl adaptor may require authentication. A","sidebar":"adaptors"},"packages/ocl-docs":{"id":"packages/ocl-docs","title":"ocl@1.2.11","description":"get(path, query, callback)","sidebar":"adaptors"},"packages/ocl-readme":{"id":"packages/ocl-readme","title":"ocl developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/ocl","sidebar":"adaptors"},"packages/odk-changelog":{"id":"packages/odk-changelog","title":"odk changelog","description":"3.0.11","sidebar":"adaptors"},"packages/odk-configuration-schema":{"id":"packages/odk-configuration-schema","title":"Config for odk","description":"Jobs that use the odk adaptor may require authentication. A","sidebar":"adaptors"},"packages/odk-docs":{"id":"packages/odk-docs","title":"odk@3.0.11","description":"get(path, options)","sidebar":"adaptors"},"packages/odk-readme":{"id":"packages/odk-readme","title":"odk developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/odk","sidebar":"adaptors"},"packages/openfn-changelog":{"id":"packages/openfn-changelog","title":"openfn changelog","description":"2.0.9","sidebar":"adaptors"},"packages/openfn-configuration-schema":{"id":"packages/openfn-configuration-schema","title":"Config for openfn","description":"Jobs that use the openfn adaptor may require authentication. A","sidebar":"adaptors"},"packages/openfn-docs":{"id":"packages/openfn-docs","title":"openfn@2.0.9","description":"request(options, callback)","sidebar":"adaptors"},"packages/openfn-readme":{"id":"packages/openfn-readme","title":"openfn developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/openfn","sidebar":"adaptors"},"packages/openhim-changelog":{"id":"packages/openhim-changelog","title":"openhim changelog","description":"0.3.8","sidebar":"adaptors"},"packages/openhim-configuration-schema":{"id":"packages/openhim-configuration-schema","title":"Config for openhim","description":"Jobs that use the openhim adaptor may require authentication. A","sidebar":"adaptors"},"packages/openhim-docs":{"id":"packages/openhim-docs","title":"openhim@0.3.8","description":"This adaptor exports the following from common:","sidebar":"adaptors"},"packages/openhim-readme":{"id":"packages/openhim-readme","title":"openhim developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/openhim","sidebar":"adaptors"},"packages/openimis-changelog":{"id":"packages/openimis-changelog","title":"openimis changelog","description":"2.0.8","sidebar":"adaptors"},"packages/openimis-configuration-schema":{"id":"packages/openimis-configuration-schema","title":"Config for openimis","description":"Jobs that use the openimis adaptor may require authentication. A","sidebar":"adaptors"},"packages/openimis-docs":{"id":"packages/openimis-docs","title":"openimis@2.0.8","description":"getFHIR(path, params, callback)","sidebar":"adaptors"},"packages/openimis-readme":{"id":"packages/openimis-readme","title":"openimis developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/openimis","sidebar":"adaptors"},"packages/openlmis-changelog":{"id":"packages/openlmis-changelog","title":"openlmis changelog","description":"1.0.10","sidebar":"adaptors"},"packages/openlmis-configuration-schema":{"id":"packages/openlmis-configuration-schema","title":"Config for openlmis","description":"Jobs that use the openlmis adaptor may require authentication. A","sidebar":"adaptors"},"packages/openlmis-docs":{"id":"packages/openlmis-docs","title":"openlmis@1.0.10","description":"get(path, options, [callback])","sidebar":"adaptors"},"packages/openlmis-readme":{"id":"packages/openlmis-readme","title":"openlmis developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/openlmis","sidebar":"adaptors"},"packages/openmrs-changelog":{"id":"packages/openmrs-changelog","title":"openmrs changelog","description":"4.3.0","sidebar":"adaptors"},"packages/openmrs-configuration-schema":{"id":"packages/openmrs-configuration-schema","title":"Config for openmrs","description":"Jobs that use the openmrs adaptor may require authentication. A","sidebar":"adaptors"},"packages/openmrs-docs":{"id":"packages/openmrs-docs","title":"openmrs@4.3.0","description":"create(resourceType, data, [callback])","sidebar":"adaptors"},"packages/openmrs-readme":{"id":"packages/openmrs-readme","title":"openmrs developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/openmrs","sidebar":"adaptors"},"packages/openspp-changelog":{"id":"packages/openspp-changelog","title":"openspp changelog","description":"2.0.8","sidebar":"adaptors"},"packages/openspp-configuration-schema":{"id":"packages/openspp-configuration-schema","title":"Config for openspp","description":"Jobs that use the openspp adaptor may require authentication. A","sidebar":"adaptors"},"packages/openspp-docs":{"id":"packages/openspp-docs","title":"openspp@2.0.8","description":"addToGroup(groupid, individualid, role)","sidebar":"adaptors"},"packages/openspp-readme":{"id":"packages/openspp-readme","title":"openspp developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/openspp","sidebar":"adaptors"},"packages/postgresql-changelog":{"id":"packages/postgresql-changelog","title":"postgresql changelog","description":"6.0.8","sidebar":"adaptors"},"packages/postgresql-configuration-schema":{"id":"packages/postgresql-configuration-schema","title":"Config for postgresql","description":"Jobs that use the postgresql adaptor may require authentication. A","sidebar":"adaptors"},"packages/postgresql-docs":{"id":"packages/postgresql-docs","title":"postgresql@6.0.8","description":"describeTable(tableName, [options], callback)","sidebar":"adaptors"},"packages/postgresql-readme":{"id":"packages/postgresql-readme","title":"postgresql developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/postgresql","sidebar":"adaptors"},"packages/primero-changelog":{"id":"packages/primero-changelog","title":"primero changelog","description":"3.0.9","sidebar":"adaptors"},"packages/primero-configuration-schema":{"id":"packages/primero-configuration-schema","title":"Config for primero","description":"Jobs that use the primero adaptor may require authentication. A","sidebar":"adaptors"},"packages/primero-docs":{"id":"packages/primero-docs","title":"primero@3.0.9","description":"createCase(params, callback)","sidebar":"adaptors"},"packages/primero-readme":{"id":"packages/primero-readme","title":"primero developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/primero","sidebar":"adaptors"},"packages/progres-changelog":{"id":"packages/progres-changelog","title":"progres changelog","description":"1.4.6","sidebar":"adaptors"},"packages/progres-configuration-schema":{"id":"packages/progres-configuration-schema","title":"Config for progres","description":"Jobs that use the progres adaptor may require authentication. A","sidebar":"adaptors"},"packages/progres-docs":{"id":"packages/progres-docs","title":"progres@1.4.6","description":"postData(params, callback)","sidebar":"adaptors"},"packages/progres-readme":{"id":"packages/progres-readme","title":"progres developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/progres","sidebar":"adaptors"},"packages/rapidpro-changelog":{"id":"packages/rapidpro-changelog","title":"rapidpro changelog","description":"1.1.5","sidebar":"adaptors"},"packages/rapidpro-configuration-schema":{"id":"packages/rapidpro-configuration-schema","title":"Config for rapidpro","description":"Jobs that use the rapidpro adaptor may require authentication. A","sidebar":"adaptors"},"packages/rapidpro-docs":{"id":"packages/rapidpro-docs","title":"rapidpro@1.1.5","description":"addContact(params, callback)","sidebar":"adaptors"},"packages/rapidpro-readme":{"id":"packages/rapidpro-readme","title":"rapidpro developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/rapidpro","sidebar":"adaptors"},"packages/redis-changelog":{"id":"packages/redis-changelog","title":"redis changelog","description":"1.2.7","sidebar":"adaptors"},"packages/redis-configuration-schema":{"id":"packages/redis-configuration-schema","title":"Config for redis","description":"Jobs that use the redis adaptor may require authentication. A","sidebar":"adaptors"},"packages/redis-docs":{"id":"packages/redis-docs","title":"redis@1.2.7","description":"get(key)","sidebar":"adaptors"},"packages/redis-readme":{"id":"packages/redis-readme","title":"redis developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/redis","sidebar":"adaptors"},"packages/resourcemap-changelog":{"id":"packages/resourcemap-changelog","title":"resourcemap changelog","description":"0.4.10","sidebar":"adaptors"},"packages/resourcemap-configuration-schema":{"id":"packages/resourcemap-configuration-schema","title":"Config for resourcemap","description":"Jobs that use the resourcemap adaptor may require authentication. A","sidebar":"adaptors"},"packages/resourcemap-docs":{"id":"packages/resourcemap-docs","title":"resourcemap@0.4.10","description":"This adaptor exports the following from common:","sidebar":"adaptors"},"packages/resourcemap-readme":{"id":"packages/resourcemap-readme","title":"resourcemap developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/resourcemap","sidebar":"adaptors"},"packages/salesforce-changelog":{"id":"packages/salesforce-changelog","title":"salesforce changelog","description":"5.0.4","sidebar":"adaptors"},"packages/salesforce-configuration-schema":{"id":"packages/salesforce-configuration-schema","title":"Config for salesforce","description":"Jobs that use the salesforce adaptor may require authentication. A","sidebar":"adaptors"},"packages/salesforce-docs":{"id":"packages/salesforce-docs","title":"salesforce@5.0.4","description":"bulk(sObjectName, operation, records, [options])","sidebar":"adaptors"},"packages/salesforce-readme":{"id":"packages/salesforce-readme","title":"salesforce developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/salesforce","sidebar":"adaptors"},"packages/satusehat-changelog":{"id":"packages/satusehat-changelog","title":"satusehat changelog","description":"2.0.9","sidebar":"adaptors"},"packages/satusehat-configuration-schema":{"id":"packages/satusehat-configuration-schema","title":"Config for satusehat","description":"Jobs that use the satusehat adaptor may require authentication. A","sidebar":"adaptors"},"packages/satusehat-docs":{"id":"packages/satusehat-docs","title":"satusehat@2.0.9","description":"get(path, params, callback)","sidebar":"adaptors"},"packages/satusehat-readme":{"id":"packages/satusehat-readme","title":"satusehat developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/satusehat","sidebar":"adaptors"},"packages/sftp-changelog":{"id":"packages/sftp-changelog","title":"sftp changelog","description":"2.0.8","sidebar":"adaptors"},"packages/sftp-configuration-schema":{"id":"packages/sftp-configuration-schema","title":"Config for sftp","description":"Jobs that use the sftp adaptor may require authentication. A","sidebar":"adaptors"},"packages/sftp-docs":{"id":"packages/sftp-docs","title":"sftp@2.0.8","description":"getCSV(filePath, [parsingOptions])","sidebar":"adaptors"},"packages/sftp-readme":{"id":"packages/sftp-readme","title":"sftp developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/sftp","sidebar":"adaptors"},"packages/surveycto-changelog":{"id":"packages/surveycto-changelog","title":"surveycto changelog","description":"2.2.3","sidebar":"adaptors"},"packages/surveycto-configuration-schema":{"id":"packages/surveycto-configuration-schema","title":"Config for surveycto","description":"Jobs that use the surveycto adaptor may require authentication. A","sidebar":"adaptors"},"packages/surveycto-docs":{"id":"packages/surveycto-docs","title":"surveycto@2.2.3","description":"cursor(value, options)","sidebar":"adaptors"},"packages/surveycto-readme":{"id":"packages/surveycto-readme","title":"surveycto developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/surveycto","sidebar":"adaptors"},"packages/telerivet-changelog":{"id":"packages/telerivet-changelog","title":"telerivet changelog","description":"0.3.8","sidebar":"adaptors"},"packages/telerivet-configuration-schema":{"id":"packages/telerivet-configuration-schema","title":"Config for telerivet","description":"Jobs that use the telerivet adaptor may require authentication. A","sidebar":"adaptors"},"packages/telerivet-docs":{"id":"packages/telerivet-docs","title":"telerivet@0.3.8","description":"This adaptor exports the following from common:","sidebar":"adaptors"},"packages/telerivet-readme":{"id":"packages/telerivet-readme","title":"telerivet developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/telerivet","sidebar":"adaptors"},"packages/testing-changelog":{"id":"packages/testing-changelog","title":"testing changelog","description":"1.0.10","sidebar":"adaptors"},"packages/testing-configuration-schema":{"id":"packages/testing-configuration-schema","title":"Config for testing","description":"Jobs that use the testing adaptor may require authentication. A","sidebar":"adaptors"},"packages/testing-docs":{"id":"packages/testing-docs","title":"testing@1.0.10","description":"This adaptor exports the following from common:","sidebar":"adaptors"},"packages/testing-readme":{"id":"packages/testing-readme","title":"testing developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/testing","sidebar":"adaptors"},"packages/twilio-changelog":{"id":"packages/twilio-changelog","title":"twilio changelog","description":"0.5.2","sidebar":"adaptors"},"packages/twilio-configuration-schema":{"id":"packages/twilio-configuration-schema","title":"Config for twilio","description":"Jobs that use the twilio adaptor may require authentication. A","sidebar":"adaptors"},"packages/twilio-docs":{"id":"packages/twilio-docs","title":"twilio@0.5.2","description":"sendSMS(params)","sidebar":"adaptors"},"packages/twilio-readme":{"id":"packages/twilio-readme","title":"twilio developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/twilio","sidebar":"adaptors"},"packages/vtiger-changelog":{"id":"packages/vtiger-changelog","title":"vtiger changelog","description":"1.3.10","sidebar":"adaptors"},"packages/vtiger-configuration-schema":{"id":"packages/vtiger-configuration-schema","title":"Config for vtiger","description":"Jobs that use the vtiger adaptor may require authentication. A","sidebar":"adaptors"},"packages/vtiger-docs":{"id":"packages/vtiger-docs","title":"vtiger@1.3.10","description":"This adaptor exports the following from common:","sidebar":"adaptors"},"packages/vtiger-readme":{"id":"packages/vtiger-readme","title":"vtiger developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/vtiger","sidebar":"adaptors"},"packages/wigal-sms-changelog":{"id":"packages/wigal-sms-changelog","title":"wigal-sms changelog","description":"0.1.3","sidebar":"adaptors"},"packages/wigal-sms-configuration-schema":{"id":"packages/wigal-sms-configuration-schema","title":"Config for wigal-sms","description":"Jobs that use the wigal-sms adaptor may require authentication. A","sidebar":"adaptors"},"packages/wigal-sms-docs":{"id":"packages/wigal-sms-docs","title":"wigal-sms@0.1.3","description":"sendSms(data)","sidebar":"adaptors"},"packages/wigal-sms-readme":{"id":"packages/wigal-sms-readme","title":"wigal-sms developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/wigal-sms","sidebar":"adaptors"},"packages/zoho-changelog":{"id":"packages/zoho-changelog","title":"zoho changelog","description":"0.4.9","sidebar":"adaptors"},"packages/zoho-configuration-schema":{"id":"packages/zoho-configuration-schema","title":"Config for zoho","description":"Jobs that use the zoho adaptor may require authentication. A","sidebar":"adaptors"},"packages/zoho-docs":{"id":"packages/zoho-docs","title":"zoho@0.4.9","description":"This adaptor exports the following from common:","sidebar":"adaptors"},"packages/zoho-readme":{"id":"packages/zoho-readme","title":"zoho developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/zoho","sidebar":"adaptors"},"postgresql":{"id":"postgresql","title":"PostgreSQL","description":"Overview","sidebar":"adaptors"},"powerbi":{"id":"powerbi","title":"Power BI","description":"(Work in progress)","sidebar":"adaptors"},"primero":{"id":"primero","title":"Primero","description":"Overview","sidebar":"adaptors"},"rapidpro":{"id":"rapidpro","title":"RapidPro Adaptor","description":"About RapidPro","sidebar":"adaptors"},"salesforce":{"id":"salesforce","title":"Salesforce","description":"App Overview","sidebar":"adaptors"},"satusehat":{"id":"satusehat","title":"Satusehat Adaptor","description":"About Satusehat","sidebar":"adaptors"},"sftp":{"id":"sftp","title":"SFTP Adaptor","description":"About SFTP","sidebar":"adaptors"},"surveycto":{"id":"surveycto","title":"SurveyCTO","description":"App Overview","sidebar":"adaptors"},"tableau":{"id":"tableau","title":"Tableau","description":"(Work in progress)","sidebar":"adaptors"}}}')}}]); \ No newline at end of file +"use strict";(self.webpackChunk_openfn_docs=self.webpackChunk_openfn_docs||[]).push([[34270],{58673:a=>{a.exports=JSON.parse('{"pluginId":"adaptors","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"adaptors":[{"type":"link","label":"Introduction","href":"/adaptors/","docId":"adaptors-intro"},{"type":"link","label":"Library Examples","href":"/adaptors/library","docId":"library-intro"},{"type":"category","label":"asana","items":[{"type":"link","label":"Overview","href":"/adaptors/asana","docId":"asana"},{"type":"link","label":"Functions","href":"/adaptors/packages/asana-docs","docId":"packages/asana-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/asana-configuration-schema","docId":"packages/asana-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"Asana-test","href":"/adaptors/library/jobs/auto/Asana-test-2024-07-29","docId":"library/jobs/auto/Asana-test-2024-07-29"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/asana-changelog","docId":"packages/asana-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/asana-readme","docId":"packages/asana-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"azure-storage","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/azure-storage-docs","docId":"packages/azure-storage-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/azure-storage-configuration-schema","docId":"packages/azure-storage-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/azure-storage-changelog","docId":"packages/azure-storage-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/azure-storage-readme","docId":"packages/azure-storage-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"beyonic","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/beyonic-docs","docId":"packages/beyonic-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/beyonic-configuration-schema","docId":"packages/beyonic-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"Pay CHW","href":"/adaptors/library/jobs/auto/Pay-CHW-2021-04-23","docId":"library/jobs/auto/Pay-CHW-2021-04-23"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/beyonic-changelog","docId":"packages/beyonic-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/beyonic-readme","docId":"packages/beyonic-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"bigquery","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/bigquery-docs","docId":"packages/bigquery-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/bigquery-configuration-schema","docId":"packages/bigquery-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/bigquery-changelog","docId":"packages/bigquery-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/bigquery-readme","docId":"packages/bigquery-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"cartodb","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/cartodb-docs","docId":"packages/cartodb-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/cartodb-configuration-schema","docId":"packages/cartodb-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/cartodb-changelog","docId":"packages/cartodb-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/cartodb-readme","docId":"packages/cartodb-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"cht","items":[{"type":"link","label":"Overview","href":"/adaptors/cht","docId":"cht"},{"type":"link","label":"Functions","href":"/adaptors/packages/cht-docs","docId":"packages/cht-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/cht-configuration-schema","docId":"packages/cht-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/cht-changelog","docId":"packages/cht-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/cht-readme","docId":"packages/cht-readme"}],"collapsed":true,"collapsible":true},{"type":"link","label":"ckan","href":"/adaptors/ckan","docId":"ckan"},{"type":"category","label":"collections","items":[{"type":"link","label":"Overview","href":"/adaptors/collections","docId":"collections"},{"type":"link","label":"Functions","href":"/adaptors/packages/collections-docs","docId":"packages/collections-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/collections-configuration-schema","docId":"packages/collections-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/collections-changelog","docId":"packages/collections-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/collections-readme","docId":"packages/collections-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"commcare","items":[{"type":"link","label":"Overview","href":"/adaptors/commcare","docId":"commcare"},{"type":"link","label":"Functions","href":"/adaptors/packages/commcare-docs","docId":"packages/commcare-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/commcare-configuration-schema","docId":"packages/commcare-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"\ud83d\udcdc Bulk upload obat lookup-table","href":"/adaptors/library/jobs/auto/commcare-asri-bulk-upload","docId":"library/jobs/auto/commcare-asri-bulk-upload"},{"type":"link","label":"Q3 2022 Update HH Name in CommCare","href":"/adaptors/library/jobs/auto/Q3-2022-Update-HH-Name-in-CommCare-2021-09-27","docId":"library/jobs/auto/Q3-2022-Update-HH-Name-in-CommCare-2021-09-27"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/commcare-changelog","docId":"packages/commcare-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/commcare-readme","docId":"packages/commcare-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"common","items":[{"type":"link","label":"Overview","href":"/adaptors/common","docId":"common"},{"type":"link","label":"Functions","href":"/adaptors/packages/common-docs","docId":"packages/common-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/common-configuration-schema","docId":"packages/common-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/common-changelog","docId":"packages/common-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/common-readme","docId":"packages/common-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"dhis2","items":[{"type":"link","label":"Overview","href":"/adaptors/dhis2","docId":"dhis2"},{"type":"link","label":"Functions","href":"/adaptors/packages/dhis2-docs","docId":"packages/dhis2-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/dhis2-configuration-schema","docId":"packages/dhis2-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"\ud83d\udcdc Create data values","href":"/adaptors/library/jobs/auto/DHIS2-DataValues-API","docId":"library/jobs/auto/DHIS2-DataValues-API"},{"type":"link","label":"\ud83d\udcdc Create new events","href":"/adaptors/library/jobs/auto/DHIS2-Events-API","docId":"library/jobs/auto/DHIS2-Events-API"},{"type":"link","label":"Load to DHIS2","href":"/adaptors/library/jobs/auto/Load-to-DHIS2-2023-07-17","docId":"library/jobs/auto/Load-to-DHIS2-2023-07-17"},{"type":"link","label":"DHIS2 Events","href":"/adaptors/library/jobs/auto/DHIS2-Events-2016-01-27","docId":"library/jobs/auto/DHIS2-Events-2016-01-27"},{"type":"link","label":"Create TEI (dhis2)","href":"/adaptors/library/jobs/auto/Create-TEI-dhis2-2021-03-22","docId":"library/jobs/auto/Create-TEI-dhis2-2021-03-22"},{"type":"link","label":"CHW case to DHIS2","href":"/adaptors/library/jobs/auto/CHW-case-to-DHIS2-2023-04-27","docId":"library/jobs/auto/CHW-case-to-DHIS2-2023-04-27"},{"type":"link","label":"0 - Get TEI data","href":"/adaptors/library/jobs/auto/0-Get-TEI-data-2021-06-02","docId":"library/jobs/auto/0-Get-TEI-data-2021-06-02"},{"type":"link","label":"Add DHIS2 Data Value Sets","href":"/adaptors/library/jobs/auto/Add-DHIS2-Data-Value-Sets-2016-03-28","docId":"library/jobs/auto/Add-DHIS2-Data-Value-Sets-2016-03-28"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/dhis2-changelog","docId":"packages/dhis2-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/dhis2-readme","docId":"packages/dhis2-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"dynamics","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/dynamics-docs","docId":"packages/dynamics-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/dynamics-configuration-schema","docId":"packages/dynamics-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/dynamics-changelog","docId":"packages/dynamics-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/dynamics-readme","docId":"packages/dynamics-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"facebook","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/facebook-docs","docId":"packages/facebook-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/facebook-configuration-schema","docId":"packages/facebook-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/facebook-changelog","docId":"packages/facebook-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/facebook-readme","docId":"packages/facebook-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"fhir","items":[{"type":"link","label":"Overview","href":"/adaptors/fhir","docId":"fhir"},{"type":"link","label":"Functions","href":"/adaptors/packages/fhir-docs","docId":"packages/fhir-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/fhir-configuration-schema","docId":"packages/fhir-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/fhir-changelog","docId":"packages/fhir-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/fhir-readme","docId":"packages/fhir-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"fhir-fr","items":[{"type":"link","label":"Overview","href":"/adaptors/fhir-fr","docId":"fhir-fr"},{"type":"link","label":"Functions","href":"/adaptors/packages/fhir-fr-docs","docId":"packages/fhir-fr-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/fhir-fr-configuration-schema","docId":"packages/fhir-fr-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/fhir-fr-changelog","docId":"packages/fhir-fr-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/fhir-fr-readme","docId":"packages/fhir-fr-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"fhir-ndr-et","items":[{"type":"link","label":"Overview","href":"/adaptors/fhir-ndr-et","docId":"fhir-ndr-et"},{"type":"link","label":"Functions","href":"/adaptors/packages/fhir-ndr-et-docs","docId":"packages/fhir-ndr-et-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/fhir-ndr-et-configuration-schema","docId":"packages/fhir-ndr-et-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/fhir-ndr-et-changelog","docId":"packages/fhir-ndr-et-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/fhir-ndr-et-readme","docId":"packages/fhir-ndr-et-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"ghana-bdr","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/ghana-bdr-docs","docId":"packages/ghana-bdr-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/ghana-bdr-configuration-schema","docId":"packages/ghana-bdr-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/ghana-bdr-changelog","docId":"packages/ghana-bdr-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/ghana-bdr-readme","docId":"packages/ghana-bdr-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"ghana-nia","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/ghana-nia-docs","docId":"packages/ghana-nia-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/ghana-nia-configuration-schema","docId":"packages/ghana-nia-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/ghana-nia-changelog","docId":"packages/ghana-nia-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/ghana-nia-readme","docId":"packages/ghana-nia-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"gmail","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/gmail-docs","docId":"packages/gmail-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/gmail-configuration-schema","docId":"packages/gmail-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/gmail-changelog","docId":"packages/gmail-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/gmail-readme","docId":"packages/gmail-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"godata","items":[{"type":"link","label":"Overview","href":"/adaptors/godata","docId":"godata"},{"type":"link","label":"Functions","href":"/adaptors/packages/godata-docs","docId":"packages/godata-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/godata-configuration-schema","docId":"packages/godata-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/godata-changelog","docId":"packages/godata-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/godata-readme","docId":"packages/godata-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"googlehealthcare","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/googlehealthcare-docs","docId":"packages/googlehealthcare-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/googlehealthcare-configuration-schema","docId":"packages/googlehealthcare-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/googlehealthcare-changelog","docId":"packages/googlehealthcare-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/googlehealthcare-readme","docId":"packages/googlehealthcare-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"googlesheets","items":[{"type":"link","label":"Overview","href":"/adaptors/googlesheets","docId":"googlesheets"},{"type":"link","label":"Functions","href":"/adaptors/packages/googlesheets-docs","docId":"packages/googlesheets-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/googlesheets-configuration-schema","docId":"packages/googlesheets-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"google oauth test","href":"/adaptors/library/jobs/auto/google-oauth-test-2024-12-20","docId":"library/jobs/auto/google-oauth-test-2024-12-20"},{"type":"link","label":"Kobo to sheets","href":"/adaptors/library/jobs/auto/Kobo-to-sheets-2023-10-13","docId":"library/jobs/auto/Kobo-to-sheets-2023-10-13"},{"type":"link","label":"Register Patient","href":"/adaptors/library/jobs/auto/Register-Patient-2021-03-02","docId":"library/jobs/auto/Register-Patient-2021-03-02"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/googlesheets-changelog","docId":"packages/googlesheets-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/googlesheets-readme","docId":"packages/googlesheets-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"hive","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/hive-docs","docId":"packages/hive-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/hive-configuration-schema","docId":"packages/hive-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/hive-changelog","docId":"packages/hive-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/hive-readme","docId":"packages/hive-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"http","items":[{"type":"link","label":"Overview","href":"/adaptors/http","docId":"http"},{"type":"link","label":"Functions","href":"/adaptors/packages/http-docs","docId":"packages/http-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/http-configuration-schema","docId":"packages/http-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"\ud83d\udcdc Extract Kobo data from API to send to OpenFn Inbox","href":"/adaptors/library/jobs/auto/getKoboData","docId":"library/jobs/auto/getKoboData"},{"type":"link","label":"\ud83d\udcdc Using async and array.map","href":"/adaptors/library/jobs/auto/async-and-array-dot-map","docId":"library/jobs/auto/async-and-array-dot-map"},{"type":"link","label":"\ud83d\udcdc Chaining HTTP Requests","href":"/adaptors/library/jobs/auto/complex-http-request-chains","docId":"library/jobs/auto/complex-http-request-chains"},{"type":"link","label":"\ud83d\udcdc Promises and nested requests","href":"/adaptors/library/jobs/auto/promise-all-nested-requests","docId":"library/jobs/auto/promise-all-nested-requests"},{"type":"link","label":"\ud83d\udcdc Timeout to create a delay","href":"/adaptors/library/jobs/auto/timeout","docId":"library/jobs/auto/timeout"},{"type":"link","label":"\ud83d\udcdc Chaining synchronous http requests","href":"/adaptors/library/jobs/auto/synchronous-http-request","docId":"library/jobs/auto/synchronous-http-request"},{"type":"link","label":"WF4-1 Bulk get Referral Cases","href":"/adaptors/library/jobs/auto/WF4-1-Bulk-get-Referral-Cases-2023-05-19","docId":"library/jobs/auto/WF4-1-Bulk-get-Referral-Cases-2023-05-19"},{"type":"link","label":"WF3-1 Bulk get Person Visit cases","href":"/adaptors/library/jobs/auto/WF3-1-Bulk-get-Person-Visit-cases-2023-05-19","docId":"library/jobs/auto/WF3-1-Bulk-get-Person-Visit-cases-2023-05-19"},{"type":"link","label":"WF2-1 Bulk get Person cases","href":"/adaptors/library/jobs/auto/WF2-1-Bulk-get-Person-cases-2023-05-19","docId":"library/jobs/auto/WF2-1-Bulk-get-Person-cases-2023-05-19"},{"type":"link","label":"WF1-1 Bulk get HH cases","href":"/adaptors/library/jobs/auto/WF1-1-Bulk-get-HH-cases-2023-05-19","docId":"library/jobs/auto/WF1-1-Bulk-get-HH-cases-2023-05-19"},{"type":"link","label":"1 Get CommCare Forms Bulk Extract","href":"/adaptors/library/jobs/auto/1-Get-CommCare-Forms-Bulk-Extract-2021-04-08","docId":"library/jobs/auto/1-Get-CommCare-Forms-Bulk-Extract-2021-04-08"},{"type":"link","label":"Fetch Claims","href":"/adaptors/library/jobs/auto/Fetch-Claims-2023-07-17","docId":"library/jobs/auto/Fetch-Claims-2023-07-17"},{"type":"link","label":"no return","href":"/adaptors/library/jobs/auto/no-return-2023-01-06","docId":"library/jobs/auto/no-return-2023-01-06"},{"type":"link","label":"Catch Error in HTTP Request","href":"/adaptors/library/jobs/auto/Catch-Error-in-HTTP-Request-2016-08-26","docId":"library/jobs/auto/Catch-Error-in-HTTP-Request-2016-08-26"},{"type":"link","label":"Get CommCare Forms (Bulk Extract)","href":"/adaptors/library/jobs/auto/Get-CommCare-Forms-Bulk-Extract-2022-05-16","docId":"library/jobs/auto/Get-CommCare-Forms-Bulk-Extract-2022-05-16"},{"type":"link","label":"aleksa cron","href":"/adaptors/library/jobs/auto/aleksa-cron-2022-04-29","docId":"library/jobs/auto/aleksa-cron-2022-04-29"},{"type":"link","label":"Request Vitas Sync","href":"/adaptors/library/jobs/auto/Request-Vitas-Sync-2021-05-11","docId":"library/jobs/auto/Request-Vitas-Sync-2021-05-11"},{"type":"link","label":"Failed Payment Notification","href":"/adaptors/library/jobs/auto/Failed-Payment-Notification-2021-04-23","docId":"library/jobs/auto/Failed-Payment-Notification-2021-04-23"},{"type":"link","label":"02b/ Initiate Payments","href":"/adaptors/library/jobs/auto/02b-Initiate-Payments-2019-11-19","docId":"library/jobs/auto/02b-Initiate-Payments-2019-11-19"},{"type":"link","label":"01c/ Create person_position record","href":"/adaptors/library/jobs/auto/01c-Create-person_position-record-2019-12-13","docId":"library/jobs/auto/01c-Create-person_position-record-2019-12-13"},{"type":"link","label":"01a/ Create Registrants","href":"/adaptors/library/jobs/auto/01a-Create-Registrants-2019-11-19","docId":"library/jobs/auto/01a-Create-Registrants-2019-11-19"},{"type":"link","label":"05b/Update ODK eval form","href":"/adaptors/library/jobs/auto/05b-Update-ODK-eval-form-2019-12-19","docId":"library/jobs/auto/05b-Update-ODK-eval-form-2019-12-19"},{"type":"link","label":"05/ Submit employee evaluation","href":"/adaptors/library/jobs/auto/05-Submit-employee-evaluation-2019-12-03","docId":"library/jobs/auto/05-Submit-employee-evaluation-2019-12-03"},{"type":"link","label":"04b/ Update ODK form","href":"/adaptors/library/jobs/auto/04b-Update-ODK-form-2019-12-03","docId":"library/jobs/auto/04b-Update-ODK-form-2019-12-03"},{"type":"link","label":"commcare reports api","href":"/adaptors/library/jobs/auto/commcare-reports-api-2016-08-29","docId":"library/jobs/auto/commcare-reports-api-2016-08-29"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/http-changelog","docId":"packages/http-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/http-readme","docId":"packages/http-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"hubtel","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/hubtel-docs","docId":"packages/hubtel-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/hubtel-configuration-schema","docId":"packages/hubtel-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/hubtel-changelog","docId":"packages/hubtel-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/hubtel-readme","docId":"packages/hubtel-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"intuit","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/intuit-docs","docId":"packages/intuit-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/intuit-configuration-schema","docId":"packages/intuit-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/intuit-changelog","docId":"packages/intuit-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/intuit-readme","docId":"packages/intuit-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"khanacademy","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/khanacademy-docs","docId":"packages/khanacademy-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/khanacademy-configuration-schema","docId":"packages/khanacademy-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/khanacademy-changelog","docId":"packages/khanacademy-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/khanacademy-readme","docId":"packages/khanacademy-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"kobotoolbox","items":[{"type":"link","label":"Overview","href":"/adaptors/kobotoolbox","docId":"kobotoolbox"},{"type":"link","label":"Functions","href":"/adaptors/packages/kobotoolbox-docs","docId":"packages/kobotoolbox-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/kobotoolbox-configuration-schema","docId":"packages/kobotoolbox-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/kobotoolbox-changelog","docId":"packages/kobotoolbox-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/kobotoolbox-readme","docId":"packages/kobotoolbox-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"magpi","items":[{"type":"link","label":"Overview","href":"/adaptors/magpi","docId":"magpi"},{"type":"link","label":"Functions","href":"/adaptors/packages/magpi-docs","docId":"packages/magpi-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/magpi-configuration-schema","docId":"packages/magpi-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/magpi-changelog","docId":"packages/magpi-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/magpi-readme","docId":"packages/magpi-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"mailchimp","items":[{"type":"link","label":"Overview","href":"/adaptors/mailchimp","docId":"mailchimp"},{"type":"link","label":"Functions","href":"/adaptors/packages/mailchimp-docs","docId":"packages/mailchimp-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/mailchimp-configuration-schema","docId":"packages/mailchimp-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/mailchimp-changelog","docId":"packages/mailchimp-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/mailchimp-readme","docId":"packages/mailchimp-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"mailgun","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/mailgun-docs","docId":"packages/mailgun-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/mailgun-configuration-schema","docId":"packages/mailgun-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"\ud83d\udcdc send email","href":"/adaptors/library/jobs/auto/send-mail-in-mailgun","docId":"library/jobs/auto/send-mail-in-mailgun"},{"type":"link","label":"01 send mailgun email","href":"/adaptors/library/jobs/auto/01-send-mailgun-email-2018-12-04","docId":"library/jobs/auto/01-send-mailgun-email-2018-12-04"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/mailgun-changelog","docId":"packages/mailgun-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/mailgun-readme","docId":"packages/mailgun-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"maximo","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/maximo-docs","docId":"packages/maximo-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/maximo-configuration-schema","docId":"packages/maximo-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/maximo-changelog","docId":"packages/maximo-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/maximo-readme","docId":"packages/maximo-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"medicmobile","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/medicmobile-docs","docId":"packages/medicmobile-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/medicmobile-configuration-schema","docId":"packages/medicmobile-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/medicmobile-changelog","docId":"packages/medicmobile-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/medicmobile-readme","docId":"packages/medicmobile-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"mogli","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/mogli-docs","docId":"packages/mogli-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/mogli-configuration-schema","docId":"packages/mogli-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/mogli-changelog","docId":"packages/mogli-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/mogli-readme","docId":"packages/mogli-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"mojatax","items":[{"type":"link","label":"Overview","href":"/adaptors/mojatax","docId":"mojatax"},{"type":"link","label":"Functions","href":"/adaptors/packages/mojatax-docs","docId":"packages/mojatax-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/mojatax-configuration-schema","docId":"packages/mojatax-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/mojatax-changelog","docId":"packages/mojatax-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/mojatax-readme","docId":"packages/mojatax-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"mongodb","items":[{"type":"link","label":"Overview","href":"/adaptors/mongodb","docId":"mongodb"},{"type":"link","label":"Functions","href":"/adaptors/packages/mongodb-docs","docId":"packages/mongodb-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/mongodb-configuration-schema","docId":"packages/mongodb-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/mongodb-changelog","docId":"packages/mongodb-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/mongodb-readme","docId":"packages/mongodb-readme"}],"collapsed":true,"collapsible":true},{"type":"link","label":"moodle","href":"/adaptors/moodle","docId":"moodle"},{"type":"category","label":"msgraph","items":[{"type":"link","label":"Overview","href":"/adaptors/msgraph","docId":"msgraph"},{"type":"link","label":"Functions","href":"/adaptors/packages/msgraph-docs","docId":"packages/msgraph-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/msgraph-configuration-schema","docId":"packages/msgraph-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/msgraph-changelog","docId":"packages/msgraph-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/msgraph-readme","docId":"packages/msgraph-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"mssql","items":[{"type":"link","label":"Overview","href":"/adaptors/mssql","docId":"mssql"},{"type":"link","label":"Functions","href":"/adaptors/packages/mssql-docs","docId":"packages/mssql-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/mssql-configuration-schema","docId":"packages/mssql-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"Extract Vitas Data","href":"/adaptors/library/jobs/auto/Extract-Vitas-Data-2021-05-11","docId":"library/jobs/auto/Extract-Vitas-Data-2021-05-11"},{"type":"link","label":"CommCare to Azure Sql","href":"/adaptors/library/jobs/auto/CommCare-to-Azure-Sql-2020-01-27","docId":"library/jobs/auto/CommCare-to-Azure-Sql-2020-01-27"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/mssql-changelog","docId":"packages/mssql-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/mssql-readme","docId":"packages/mssql-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"mysql","items":[{"type":"link","label":"Overview","href":"/adaptors/mysql","docId":"mysql"},{"type":"link","label":"Functions","href":"/adaptors/packages/mysql-docs","docId":"packages/mysql-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/mysql-configuration-schema","docId":"packages/mysql-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"01b/ Query new person record","href":"/adaptors/library/jobs/auto/01b-Query-new-person-record-2019-12-13","docId":"library/jobs/auto/01b-Query-new-person-record-2019-12-13"},{"type":"link","label":"03/ Update Payment Status","href":"/adaptors/library/jobs/auto/03-Update-Payment-Status-2019-11-19","docId":"library/jobs/auto/03-Update-Payment-Status-2019-11-19"},{"type":"link","label":"05a/Query for new employees","href":"/adaptors/library/jobs/auto/05a-Query-for-new-employees-2019-12-19","docId":"library/jobs/auto/05a-Query-for-new-employees-2019-12-19"},{"type":"link","label":"04a/Query for job changes","href":"/adaptors/library/jobs/auto/04a-Query-for-job-changes-2019-12-12","docId":"library/jobs/auto/04a-Query-for-job-changes-2019-12-12"},{"type":"link","label":"02a/ Query DB for people to pay","href":"/adaptors/library/jobs/auto/02a-Query-DB-for-people-to-pay-2019-12-11","docId":"library/jobs/auto/02a-Query-DB-for-people-to-pay-2019-12-11"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/mysql-changelog","docId":"packages/mysql-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/mysql-readme","docId":"packages/mysql-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"nexmo","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/nexmo-docs","docId":"packages/nexmo-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/nexmo-configuration-schema","docId":"packages/nexmo-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/nexmo-changelog","docId":"packages/nexmo-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/nexmo-readme","docId":"packages/nexmo-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"ocl","items":[{"type":"link","label":"Overview","href":"/adaptors/ocl","docId":"ocl"},{"type":"link","label":"Functions","href":"/adaptors/packages/ocl-docs","docId":"packages/ocl-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/ocl-configuration-schema","docId":"packages/ocl-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/ocl-changelog","docId":"packages/ocl-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/ocl-readme","docId":"packages/ocl-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"odk","items":[{"type":"link","label":"Overview","href":"/adaptors/odk","docId":"odk"},{"type":"link","label":"Functions","href":"/adaptors/packages/odk-docs","docId":"packages/odk-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/odk-configuration-schema","docId":"packages/odk-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/odk-changelog","docId":"packages/odk-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/odk-readme","docId":"packages/odk-readme"}],"collapsed":true,"collapsible":true},{"type":"link","label":"ona","href":"/adaptors/ona","docId":"ona"},{"type":"category","label":"openfn","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/openfn-docs","docId":"packages/openfn-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/openfn-configuration-schema","docId":"packages/openfn-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/openfn-changelog","docId":"packages/openfn-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/openfn-readme","docId":"packages/openfn-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"openhim","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/openhim-docs","docId":"packages/openhim-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/openhim-configuration-schema","docId":"packages/openhim-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"\ud83d\udcdc Create encounter in OpenHIM","href":"/adaptors/library/jobs/auto/CommCare-FHIR","docId":"library/jobs/auto/CommCare-FHIR"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/openhim-changelog","docId":"packages/openhim-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/openhim-readme","docId":"packages/openhim-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"openimis","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/openimis-docs","docId":"packages/openimis-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/openimis-configuration-schema","docId":"packages/openimis-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/openimis-changelog","docId":"packages/openimis-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/openimis-readme","docId":"packages/openimis-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"openlmis","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/openlmis-docs","docId":"packages/openlmis-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/openlmis-configuration-schema","docId":"packages/openlmis-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/openlmis-changelog","docId":"packages/openlmis-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/openlmis-readme","docId":"packages/openlmis-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"openmrs","items":[{"type":"link","label":"Overview","href":"/adaptors/openmrs","docId":"openmrs"},{"type":"link","label":"Functions","href":"/adaptors/packages/openmrs-docs","docId":"packages/openmrs-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/openmrs-configuration-schema","docId":"packages/openmrs-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"Create Person in OpenMRS","href":"/adaptors/library/jobs/auto/Create-Person-in-OpenMRS-2016-02-12","docId":"library/jobs/auto/Create-Person-in-OpenMRS-2016-02-12"},{"type":"link","label":"Create Patient in OpenMRS","href":"/adaptors/library/jobs/auto/Create-Patient-in-OpenMRS-2019-10-24","docId":"library/jobs/auto/Create-Patient-in-OpenMRS-2019-10-24"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/openmrs-changelog","docId":"packages/openmrs-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/openmrs-readme","docId":"packages/openmrs-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"openspp","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/openspp-docs","docId":"packages/openspp-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/openspp-configuration-schema","docId":"packages/openspp-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/openspp-changelog","docId":"packages/openspp-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/openspp-readme","docId":"packages/openspp-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"postgresql","items":[{"type":"link","label":"Overview","href":"/adaptors/postgresql","docId":"postgresql"},{"type":"link","label":"Functions","href":"/adaptors/packages/postgresql-docs","docId":"packages/postgresql-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/postgresql-configuration-schema","docId":"packages/postgresql-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"\ud83d\udcdc Using findValue with an array of data","href":"/adaptors/library/jobs/auto/async-findValue","docId":"library/jobs/auto/async-findValue"},{"type":"link","label":"1. Get data from SLUHIS","href":"/adaptors/library/jobs/auto/1-Get-data-from-SLUHIS-2023-03-08","docId":"library/jobs/auto/1-Get-data-from-SLUHIS-2023-03-08"},{"type":"link","label":"Load to DB","href":"/adaptors/library/jobs/auto/Load-to-DB-2022-05-16","docId":"library/jobs/auto/Load-to-DB-2022-05-16"},{"type":"link","label":"Upsert to mBrana","href":"/adaptors/library/jobs/auto/Upsert-to-mBrana-2021-05-11","docId":"library/jobs/auto/Upsert-to-mBrana-2021-05-11"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/postgresql-changelog","docId":"packages/postgresql-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/postgresql-readme","docId":"packages/postgresql-readme"}],"collapsed":true,"collapsible":true},{"type":"link","label":"powerbi","href":"/adaptors/powerbi","docId":"powerbi"},{"type":"category","label":"primero","items":[{"type":"link","label":"Overview","href":"/adaptors/primero","docId":"primero"},{"type":"link","label":"Functions","href":"/adaptors/packages/primero-docs","docId":"packages/primero-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/primero-configuration-schema","docId":"packages/primero-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"Get cases from Primero","href":"/adaptors/library/jobs/auto/Get-cases-from-Primero-2021-09-23","docId":"library/jobs/auto/Get-cases-from-Primero-2021-09-23"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/primero-changelog","docId":"packages/primero-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/primero-readme","docId":"packages/primero-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"progres","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/progres-docs","docId":"packages/progres-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/progres-configuration-schema","docId":"packages/progres-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/progres-changelog","docId":"packages/progres-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/progres-readme","docId":"packages/progres-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"rapidpro","items":[{"type":"link","label":"Overview","href":"/adaptors/rapidpro","docId":"rapidpro"},{"type":"link","label":"Functions","href":"/adaptors/packages/rapidpro-docs","docId":"packages/rapidpro-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/rapidpro-configuration-schema","docId":"packages/rapidpro-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/rapidpro-changelog","docId":"packages/rapidpro-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/rapidpro-readme","docId":"packages/rapidpro-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"redis","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/redis-docs","docId":"packages/redis-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/redis-configuration-schema","docId":"packages/redis-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/redis-changelog","docId":"packages/redis-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/redis-readme","docId":"packages/redis-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"resourcemap","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/resourcemap-docs","docId":"packages/resourcemap-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/resourcemap-configuration-schema","docId":"packages/resourcemap-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/resourcemap-changelog","docId":"packages/resourcemap-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/resourcemap-readme","docId":"packages/resourcemap-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"salesforce","items":[{"type":"link","label":"Overview","href":"/adaptors/salesforce","docId":"salesforce"},{"type":"link","label":"Functions","href":"/adaptors/packages/salesforce-docs","docId":"packages/salesforce-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/salesforce-configuration-schema","docId":"packages/salesforce-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"\ud83d\udcdc Pre-processing data","href":"/adaptors/library/jobs/auto/alter-state-before-operations","docId":"library/jobs/auto/alter-state-before-operations"},{"type":"link","label":"\ud83d\udcdc Using merge and each","href":"/adaptors/library/jobs/auto/bring-formId-into-data-array-then-create-parent-and-children-in-salesforce","docId":"library/jobs/auto/bring-formId-into-data-array-then-create-parent-and-children-in-salesforce"},{"type":"link","label":"\ud83d\udcdc Using promises","href":"/adaptors/library/jobs/auto/complex-state-control","docId":"library/jobs/auto/complex-state-control"},{"type":"link","label":"\ud83d\udcdc Concat fields with nulls","href":"/adaptors/library/jobs/auto/concatenate-many-fields-with-nulls","docId":"library/jobs/auto/concatenate-many-fields-with-nulls"},{"type":"link","label":"\ud83d\udcdc Create/update records if...","href":"/adaptors/library/jobs/auto/create-if-proposal","docId":"library/jobs/auto/create-if-proposal"},{"type":"link","label":"\ud83d\udcdc Create SMS linked to contact","href":"/adaptors/library/jobs/auto/Create-SMS-Linked-to-Contact-in-SF","docId":"library/jobs/auto/Create-SMS-Linked-to-Contact-in-SF"},{"type":"link","label":"\ud83d\udcdc Handling multiple ODK repeat groups","href":"/adaptors/library/jobs/auto/ODK-Create-Many-Records-Moving-In-And-Out-Of-Repeat-Blocks","docId":"library/jobs/auto/ODK-Create-Many-Records-Moving-In-And-Out-Of-Repeat-Blocks"},{"type":"link","label":"\ud83d\udcdc Merge data into child array then upsert","href":"/adaptors/library/jobs/auto/upsert-many-items-in-array-with-value-outside-array","docId":"library/jobs/auto/upsert-many-items-in-array-with-value-outside-array"},{"type":"link","label":"WF4-2 Bulk upsert Services","href":"/adaptors/library/jobs/auto/WF4-2-Bulk-upsert-Services-2023-05-19","docId":"library/jobs/auto/WF4-2-Bulk-upsert-Services-2023-05-19"},{"type":"link","label":"WF3-2 Bulk upsert Person Visits","href":"/adaptors/library/jobs/auto/WF3-2-Bulk-upsert-Person-Visits-2023-05-19","docId":"library/jobs/auto/WF3-2-Bulk-upsert-Person-Visits-2023-05-19"},{"type":"link","label":"WF2-2 Bulk upsert Persons","href":"/adaptors/library/jobs/auto/WF2-2-Bulk-upsert-Persons-2023-05-19","docId":"library/jobs/auto/WF2-2-Bulk-upsert-Persons-2023-05-19"},{"type":"link","label":"WF1-2 Bulk upsert HHs and HH Visits","href":"/adaptors/library/jobs/auto/WF1-2-Bulk-upsert-HHs-and-HH-Visits-2023-05-19","docId":"library/jobs/auto/WF1-2-Bulk-upsert-HHs-and-HH-Visits-2023-05-19"},{"type":"link","label":"Q3 2022 Upsert Person Visit","href":"/adaptors/library/jobs/auto/Q3-2022-Upsert-Person-Visit-2022-06-28","docId":"library/jobs/auto/Q3-2022-Upsert-Person-Visit-2022-06-28"},{"type":"link","label":"Q4 2022 Upsert Supervision - Feedback","href":"/adaptors/library/jobs/auto/Q4-2022-Upsert-Supervision-Feedback-2022-08-19","docId":"library/jobs/auto/Q4-2022-Upsert-Supervision-Feedback-2022-08-19"},{"type":"link","label":"Q4 2022 Upsert Supervision - Household Spot Check","href":"/adaptors/library/jobs/auto/Q4-2022-Upsert-Supervision-Household-Spot-Check-2022-08-24","docId":"library/jobs/auto/Q4-2022-Upsert-Supervision-Household-Spot-Check-2022-08-24"},{"type":"link","label":"Q4 2022 Upsert Supervision - Accompaniment","href":"/adaptors/library/jobs/auto/Q4-2022-Upsert-Supervision-Accompaniment-2022-08-22","docId":"library/jobs/auto/Q4-2022-Upsert-Supervision-Accompaniment-2022-08-22"},{"type":"link","label":"Q3 2022 Create Distribution & Referral in SF","href":"/adaptors/library/jobs/auto/Q3-2022-Create-Distribution-Referral-in-SF-2020-06-19","docId":"library/jobs/auto/Q3-2022-Create-Distribution-Referral-in-SF-2020-06-19"},{"type":"link","label":"Upsert Team or Group Name","href":"/adaptors/library/jobs/auto/Upsert-Team-or-Group-Name-2021-04-28","docId":"library/jobs/auto/Upsert-Team-or-Group-Name-2021-04-28"},{"type":"link","label":"Upsert Service Referral Followup","href":"/adaptors/library/jobs/auto/Upsert-Service-Referral-Followup-2021-04-30","docId":"library/jobs/auto/Upsert-Service-Referral-Followup-2021-04-30"},{"type":"link","label":"Upsert Service Referral","href":"/adaptors/library/jobs/auto/Upsert-Service-Referral-2021-04-30","docId":"library/jobs/auto/Upsert-Service-Referral-2021-04-30"},{"type":"link","label":"Upsert Service Referral 2","href":"/adaptors/library/jobs/auto/Upsert-Service-Referral-2-2021-06-14","docId":"library/jobs/auto/Upsert-Service-Referral-2-2021-06-14"},{"type":"link","label":"Upsert Risk and Vulnerability Assessment - Service Referral","href":"/adaptors/library/jobs/auto/Upsert-Risk-and-Vulnerability-Assessment-Service-Referral-2021-05-25","docId":"library/jobs/auto/Upsert-Risk-and-Vulnerability-Assessment-Service-Referral-2021-05-25"},{"type":"link","label":"Upsert Register Skills plus Club","href":"/adaptors/library/jobs/auto/Upsert-Register-Skills-plus-Club-2021-04-30","docId":"library/jobs/auto/Upsert-Register-Skills-plus-Club-2021-04-30"},{"type":"link","label":"Upsert Register Participant Skillz","href":"/adaptors/library/jobs/auto/Upsert-Register-Participant-Skillz-2021-08-30","docId":"library/jobs/auto/Upsert-Register-Participant-Skillz-2021-08-30"},{"type":"link","label":"Upsert Register Participant","href":"/adaptors/library/jobs/auto/Upsert-Register-Participant-2021-04-28","docId":"library/jobs/auto/Upsert-Register-Participant-2021-04-28"},{"type":"link","label":"Upsert Register Event","href":"/adaptors/library/jobs/auto/Upsert-Register-Event-2021-04-30","docId":"library/jobs/auto/Upsert-Register-Event-2021-04-30"},{"type":"link","label":"Upsert Pre Challenges","href":"/adaptors/library/jobs/auto/Upsert-Pre-Challenges-2021-04-30","docId":"library/jobs/auto/Upsert-Pre-Challenges-2021-04-30"},{"type":"link","label":"Upsert Post Challenges","href":"/adaptors/library/jobs/auto/Upsert-Post-Challenges-2021-04-30","docId":"library/jobs/auto/Upsert-Post-Challenges-2021-04-30"},{"type":"link","label":"Upsert Intervention Notes","href":"/adaptors/library/jobs/auto/Upsert-Intervention-Notes-2021-04-28","docId":"library/jobs/auto/Upsert-Intervention-Notes-2021-04-28"},{"type":"link","label":"Upsert Home Visit Log Form","href":"/adaptors/library/jobs/auto/Upsert-Home-Visit-Log-Form-2021-05-03","docId":"library/jobs/auto/Upsert-Home-Visit-Log-Form-2021-05-03"},{"type":"link","label":"Upsert Confirm Services Received","href":"/adaptors/library/jobs/auto/Upsert-Confirm-Services-Received-2021-06-14","docId":"library/jobs/auto/Upsert-Confirm-Services-Received-2021-06-14"},{"type":"link","label":"Upsert Coach Support Visit CSV","href":"/adaptors/library/jobs/auto/Upsert-Coach-Support-Visit-CSV-2021-04-28","docId":"library/jobs/auto/Upsert-Coach-Support-Visit-CSV-2021-04-28"},{"type":"link","label":"Upsert Attendance Skillz Plus Club","href":"/adaptors/library/jobs/auto/Upsert-Attendance-Skillz-Plus-Club-2021-05-24","docId":"library/jobs/auto/Upsert-Attendance-Skillz-Plus-Club-2021-05-24"},{"type":"link","label":"Upsert ART Adherence Self-Reporting Tool","href":"/adaptors/library/jobs/auto/Upsert-ART-Adherence-Self-Reporting-Tool-2021-04-30","docId":"library/jobs/auto/Upsert-ART-Adherence-Self-Reporting-Tool-2021-04-30"},{"type":"link","label":"Risk and Vulnerability Assessment","href":"/adaptors/library/jobs/auto/Risk-and-Vulnerability-Assessment-2021-05-27","docId":"library/jobs/auto/Risk-and-Vulnerability-Assessment-2021-05-27"},{"type":"link","label":"Upsert Aggregate Service Referrals","href":"/adaptors/library/jobs/auto/Upsert-Aggregate-Service-Referrals-2021-04-30","docId":"library/jobs/auto/Upsert-Aggregate-Service-Referrals-2021-04-30"},{"type":"link","label":"Register Participant - V2 Skillz","href":"/adaptors/library/jobs/auto/Register-Participant-V2-Skillz-2021-06-02","docId":"library/jobs/auto/Register-Participant-V2-Skillz-2021-06-02"},{"type":"link","label":"PHQ9","href":"/adaptors/library/jobs/auto/PHQ9-2021-05-03","docId":"library/jobs/auto/PHQ9-2021-05-03"},{"type":"link","label":"Outcome Survey","href":"/adaptors/library/jobs/auto/Outcome-Survey-2024-07-16","docId":"library/jobs/auto/Outcome-Survey-2024-07-16"},{"type":"link","label":"HIV Testing Event Snapshot","href":"/adaptors/library/jobs/auto/HIV-Testing-Event-Snapshot-2021-05-03","docId":"library/jobs/auto/HIV-Testing-Event-Snapshot-2021-05-03"},{"type":"link","label":"Malaria Testing Event Snapshot","href":"/adaptors/library/jobs/auto/Malaria-Testing-Event-Snapshot-2021-05-03","docId":"library/jobs/auto/Malaria-Testing-Event-Snapshot-2021-05-03"},{"type":"link","label":"Create Intervention","href":"/adaptors/library/jobs/auto/Create-Intervention-2021-04-08","docId":"library/jobs/auto/Create-Intervention-2021-04-08"},{"type":"link","label":"Coach Session Register","href":"/adaptors/library/jobs/auto/Coach-Session-Register-2021-05-03","docId":"library/jobs/auto/Coach-Session-Register-2021-05-03"},{"type":"link","label":"Attendance Non Skillz","href":"/adaptors/library/jobs/auto/Attendance-Non-Skillz-2021-06-14","docId":"library/jobs/auto/Attendance-Non-Skillz-2021-06-14"},{"type":"link","label":"Malaria Testing Event Statistics","href":"/adaptors/library/jobs/auto/Malaria-Testing-Event-Statistics-2021-05-03","docId":"library/jobs/auto/Malaria-Testing-Event-Statistics-2021-05-03"},{"type":"link","label":"HIV Testing Event Statistics","href":"/adaptors/library/jobs/auto/HIV-Testing-Event-Statistics-2021-05-03","docId":"library/jobs/auto/HIV-Testing-Event-Statistics-2021-05-03"},{"type":"link","label":"Upsert User in Salesforce","href":"/adaptors/library/jobs/auto/Upsert-User-in-Salesforce-2021-04-16","docId":"library/jobs/auto/Upsert-User-in-Salesforce-2021-04-16"},{"type":"link","label":"WF3-2a Repeat Failed Person Visits","href":"/adaptors/library/jobs/auto/WF3-2a-Repeat-Failed-Person-Visits-2023-05-31","docId":"library/jobs/auto/WF3-2a-Repeat-Failed-Person-Visits-2023-05-31"},{"type":"link","label":"Q3 2022 Upsert Household & Household Visit in SF","href":"/adaptors/library/jobs/auto/Q3-2022-Upsert-Household-Household-Visit-in-SF-2022-06-28","docId":"library/jobs/auto/Q3-2022-Upsert-Household-Household-Visit-in-SF-2022-06-28"},{"type":"link","label":"Q3 2022 Upsert Person","href":"/adaptors/library/jobs/auto/Q3-2022-Upsert-Person-2022-04-21","docId":"library/jobs/auto/Q3-2022-Upsert-Person-2022-04-21"},{"type":"link","label":"Create contact","href":"/adaptors/library/jobs/auto/Create-contact-2021-03-01","docId":"library/jobs/auto/Create-contact-2021-03-01"},{"type":"link","label":"Create Person in SF","href":"/adaptors/library/jobs/auto/Create-Person-in-SF-2019-02-25","docId":"library/jobs/auto/Create-Person-in-SF-2019-02-25"},{"type":"link","label":"1. Create Payment in SF","href":"/adaptors/library/jobs/auto/1-Create-Payment-in-SF-2018-09-03","docId":"library/jobs/auto/1-Create-Payment-in-SF-2018-09-03"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/salesforce-changelog","docId":"packages/salesforce-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/salesforce-readme","docId":"packages/salesforce-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"satusehat","items":[{"type":"link","label":"Overview","href":"/adaptors/satusehat","docId":"satusehat"},{"type":"link","label":"Functions","href":"/adaptors/packages/satusehat-docs","docId":"packages/satusehat-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/satusehat-configuration-schema","docId":"packages/satusehat-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/satusehat-changelog","docId":"packages/satusehat-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/satusehat-readme","docId":"packages/satusehat-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"sftp","items":[{"type":"link","label":"Overview","href":"/adaptors/sftp","docId":"sftp"},{"type":"link","label":"Functions","href":"/adaptors/packages/sftp-docs","docId":"packages/sftp-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/sftp-configuration-schema","docId":"packages/sftp-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/sftp-changelog","docId":"packages/sftp-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/sftp-readme","docId":"packages/sftp-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"surveycto","items":[{"type":"link","label":"Overview","href":"/adaptors/surveycto","docId":"surveycto"},{"type":"link","label":"Functions","href":"/adaptors/packages/surveycto-docs","docId":"packages/surveycto-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/surveycto-configuration-schema","docId":"packages/surveycto-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/surveycto-changelog","docId":"packages/surveycto-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/surveycto-readme","docId":"packages/surveycto-readme"}],"collapsed":true,"collapsible":true},{"type":"link","label":"tableau","href":"/adaptors/tableau","docId":"tableau"},{"type":"category","label":"telerivet","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/telerivet-docs","docId":"packages/telerivet-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/telerivet-configuration-schema","docId":"packages/telerivet-configuration-schema"},{"type":"category","label":"Examples","items":[{"type":"link","label":"\ud83d\udcdc Send sms from Salesforce workflow action","href":"/adaptors/library/jobs/auto/send-sms-from-salesforce-workflow","docId":"library/jobs/auto/send-sms-from-salesforce-workflow"},{"type":"link","label":"2. SMS Balance Update to Customer","href":"/adaptors/library/jobs/auto/2-SMS-Balance-Update-to-Customer-2018-12-14","docId":"library/jobs/auto/2-SMS-Balance-Update-to-Customer-2018-12-14"}],"collapsed":true,"collapsible":true},{"type":"link","label":"Changelog","href":"/adaptors/packages/telerivet-changelog","docId":"packages/telerivet-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/telerivet-readme","docId":"packages/telerivet-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"testing","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/testing-docs","docId":"packages/testing-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/testing-configuration-schema","docId":"packages/testing-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/testing-changelog","docId":"packages/testing-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/testing-readme","docId":"packages/testing-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"twilio","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/twilio-docs","docId":"packages/twilio-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/twilio-configuration-schema","docId":"packages/twilio-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/twilio-changelog","docId":"packages/twilio-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/twilio-readme","docId":"packages/twilio-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"vtiger","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/vtiger-docs","docId":"packages/vtiger-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/vtiger-configuration-schema","docId":"packages/vtiger-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/vtiger-changelog","docId":"packages/vtiger-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/vtiger-readme","docId":"packages/vtiger-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"wigal-sms","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/wigal-sms-docs","docId":"packages/wigal-sms-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/wigal-sms-configuration-schema","docId":"packages/wigal-sms-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/wigal-sms-changelog","docId":"packages/wigal-sms-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/wigal-sms-readme","docId":"packages/wigal-sms-readme"}],"collapsed":true,"collapsible":true},{"type":"category","label":"zoho","items":[{"type":"link","label":"Functions","href":"/adaptors/packages/zoho-docs","docId":"packages/zoho-docs"},{"type":"link","label":"Configuration","href":"/adaptors/packages/zoho-configuration-schema","docId":"packages/zoho-configuration-schema"},{"type":"link","label":"Changelog","href":"/adaptors/packages/zoho-changelog","docId":"packages/zoho-changelog"},{"type":"link","label":"README.md","href":"/adaptors/packages/zoho-readme","docId":"packages/zoho-readme"}],"collapsed":true,"collapsible":true}]},"docs":{"adaptors-intro":{"id":"adaptors-intro","title":"Adaptors","description":"Connect Anything.","sidebar":"adaptors"},"asana":{"id":"asana","title":"Asana Adaptor","description":"About Asana","sidebar":"adaptors"},"cht":{"id":"cht","title":"Community Health Toolkit (CHT)","description":"About Community Health Toolkit (CHT)","sidebar":"adaptors"},"ckan":{"id":"ckan","title":"CKAN","description":"App Overview","sidebar":"adaptors"},"collections":{"id":"collections","title":"Collections Adaptor","description":"Collections Overview","sidebar":"adaptors"},"commcare":{"id":"commcare","title":"CommCare Adaptor","description":"About CommCare","sidebar":"adaptors"},"common":{"id":"common","title":"Common Adaptor","description":"About OpenFn \\"Common\\" Language","sidebar":"adaptors"},"dhis2":{"id":"dhis2","title":"DHIS2","description":"App Overview","sidebar":"adaptors"},"fhir":{"id":"fhir","title":"FHIR Adaptor","description":"About FHIR","sidebar":"adaptors"},"fhir-fr":{"id":"fhir-fr","title":"FHIR-FR IG Adaptor","description":"Custom FHIR Adaptor: fhir-fr","sidebar":"adaptors"},"fhir-ndr-et":{"id":"fhir-ndr-et","title":"FHIR-NDR-ET IG Adaptor","description":"Custom FHIR Adaptor: fhir-ndr-et","sidebar":"adaptors"},"godata":{"id":"godata","title":"Go.Data","description":"Overview","sidebar":"adaptors"},"googlesheets":{"id":"googlesheets","title":"Google Forms/Google Sheets","description":"Google Sheets Adaptor Overview","sidebar":"adaptors"},"http":{"id":"http","title":"HTTP Adaptor","description":"About the HTTP \\"universal\\" adaptor","sidebar":"adaptors"},"kobotoolbox":{"id":"kobotoolbox","title":"Kobo Toolbox","description":"App Overview","sidebar":"adaptors"},"library-intro":{"id":"library-intro","title":"The Community Job Library","description":"A growing knowledge base","sidebar":"adaptors"},"library/jobs/auto/0-Get-TEI-data-2021-06-02":{"id":"library/jobs/auto/0-Get-TEI-data-2021-06-02","title":"0 - Get TEI data","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/01-send-mailgun-email-2018-12-04":{"id":"library/jobs/auto/01-send-mailgun-email-2018-12-04","title":"01 send mailgun email","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/01a-Create-Registrants-2019-11-19":{"id":"library/jobs/auto/01a-Create-Registrants-2019-11-19","title":"01a/ Create Registrants","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/01b-Query-new-person-record-2019-12-13":{"id":"library/jobs/auto/01b-Query-new-person-record-2019-12-13","title":"01b/ Query new person record","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/01c-Create-person_position-record-2019-12-13":{"id":"library/jobs/auto/01c-Create-person_position-record-2019-12-13","title":"01c/ Create person_position record","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/02a-Query-DB-for-people-to-pay-2019-12-11":{"id":"library/jobs/auto/02a-Query-DB-for-people-to-pay-2019-12-11","title":"02a/ Query DB for people to pay","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/02b-Initiate-Payments-2019-11-19":{"id":"library/jobs/auto/02b-Initiate-Payments-2019-11-19","title":"02b/ Initiate Payments","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/03-Update-Payment-Status-2019-11-19":{"id":"library/jobs/auto/03-Update-Payment-Status-2019-11-19","title":"03/ Update Payment Status","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/04a-Query-for-job-changes-2019-12-12":{"id":"library/jobs/auto/04a-Query-for-job-changes-2019-12-12","title":"04a/Query for job changes","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/04b-Update-ODK-form-2019-12-03":{"id":"library/jobs/auto/04b-Update-ODK-form-2019-12-03","title":"04b/ Update ODK form","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/05-Submit-employee-evaluation-2019-12-03":{"id":"library/jobs/auto/05-Submit-employee-evaluation-2019-12-03","title":"05/ Submit employee evaluation","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/05a-Query-for-new-employees-2019-12-19":{"id":"library/jobs/auto/05a-Query-for-new-employees-2019-12-19","title":"05a/Query for new employees","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/05b-Update-ODK-eval-form-2019-12-19":{"id":"library/jobs/auto/05b-Update-ODK-eval-form-2019-12-19","title":"05b/Update ODK eval form","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/1-Create-Payment-in-SF-2018-09-03":{"id":"library/jobs/auto/1-Create-Payment-in-SF-2018-09-03","title":"1. Create Payment in SF","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/1-Get-CommCare-Forms-Bulk-Extract-2021-04-08":{"id":"library/jobs/auto/1-Get-CommCare-Forms-Bulk-Extract-2021-04-08","title":"1 Get CommCare Forms Bulk Extract","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/1-Get-data-from-SLUHIS-2023-03-08":{"id":"library/jobs/auto/1-Get-data-from-SLUHIS-2023-03-08","title":"1. Get data from SLUHIS","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/2-SMS-Balance-Update-to-Customer-2018-12-14":{"id":"library/jobs/auto/2-SMS-Balance-Update-to-Customer-2018-12-14","title":"2. SMS Balance Update to Customer","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Add-DHIS2-Data-Value-Sets-2016-03-28":{"id":"library/jobs/auto/Add-DHIS2-Data-Value-Sets-2016-03-28","title":"Add DHIS2 Data Value Sets","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/aleksa-cron-2022-04-29":{"id":"library/jobs/auto/aleksa-cron-2022-04-29","title":"aleksa cron","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/alter-state-before-operations":{"id":"library/jobs/auto/alter-state-before-operations","title":"Pre-processing data","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Asana-test-2024-07-29":{"id":"library/jobs/auto/Asana-test-2024-07-29","title":"Asana-test","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/async-and-array-dot-map":{"id":"library/jobs/auto/async-and-array-dot-map","title":"Using async and array.map","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/async-findValue":{"id":"library/jobs/auto/async-findValue","title":"Using findValue with an array of data","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Attendance-Non-Skillz-2021-06-14":{"id":"library/jobs/auto/Attendance-Non-Skillz-2021-06-14","title":"Attendance Non Skillz","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/bring-formId-into-data-array-then-create-parent-and-children-in-salesforce":{"id":"library/jobs/auto/bring-formId-into-data-array-then-create-parent-and-children-in-salesforce","title":"Using merge and each","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Catch-Error-in-HTTP-Request-2016-08-26":{"id":"library/jobs/auto/Catch-Error-in-HTTP-Request-2016-08-26","title":"Catch Error in HTTP Request","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/CHW-case-to-DHIS2-2023-04-27":{"id":"library/jobs/auto/CHW-case-to-DHIS2-2023-04-27","title":"CHW case to DHIS2","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Coach-Session-Register-2021-05-03":{"id":"library/jobs/auto/Coach-Session-Register-2021-05-03","title":"Coach Session Register","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/commcare-asri-bulk-upload":{"id":"library/jobs/auto/commcare-asri-bulk-upload","title":"Bulk upload obat lookup-table","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/CommCare-FHIR":{"id":"library/jobs/auto/CommCare-FHIR","title":"Create encounter in OpenHIM","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/commcare-reports-api-2016-08-29":{"id":"library/jobs/auto/commcare-reports-api-2016-08-29","title":"commcare reports api","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/CommCare-to-Azure-Sql-2020-01-27":{"id":"library/jobs/auto/CommCare-to-Azure-Sql-2020-01-27","title":"CommCare to Azure Sql","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/complex-http-request-chains":{"id":"library/jobs/auto/complex-http-request-chains","title":"Chaining HTTP Requests","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/complex-state-control":{"id":"library/jobs/auto/complex-state-control","title":"Using promises","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/concatenate-many-fields-with-nulls":{"id":"library/jobs/auto/concatenate-many-fields-with-nulls","title":"Concat fields with nulls","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Create-contact-2021-03-01":{"id":"library/jobs/auto/Create-contact-2021-03-01","title":"Create contact","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/create-if-proposal":{"id":"library/jobs/auto/create-if-proposal","title":"Create/update records if...","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Create-Intervention-2021-04-08":{"id":"library/jobs/auto/Create-Intervention-2021-04-08","title":"Create Intervention","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Create-Patient-in-OpenMRS-2019-10-24":{"id":"library/jobs/auto/Create-Patient-in-OpenMRS-2019-10-24","title":"Create Patient in OpenMRS","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Create-Person-in-OpenMRS-2016-02-12":{"id":"library/jobs/auto/Create-Person-in-OpenMRS-2016-02-12","title":"Create Person in OpenMRS","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Create-Person-in-SF-2019-02-25":{"id":"library/jobs/auto/Create-Person-in-SF-2019-02-25","title":"Create Person in SF","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Create-SMS-Linked-to-Contact-in-SF":{"id":"library/jobs/auto/Create-SMS-Linked-to-Contact-in-SF","title":"Create SMS linked to contact","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Create-TEI-dhis2-2021-03-22":{"id":"library/jobs/auto/Create-TEI-dhis2-2021-03-22","title":"Create TEI (dhis2)","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/DHIS2-DataValues-API":{"id":"library/jobs/auto/DHIS2-DataValues-API","title":"Create data values","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/DHIS2-Events-2016-01-27":{"id":"library/jobs/auto/DHIS2-Events-2016-01-27","title":"DHIS2 Events","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/DHIS2-Events-API":{"id":"library/jobs/auto/DHIS2-Events-API","title":"Create new events","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Extract-Vitas-Data-2021-05-11":{"id":"library/jobs/auto/Extract-Vitas-Data-2021-05-11","title":"Extract Vitas Data","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Failed-Payment-Notification-2021-04-23":{"id":"library/jobs/auto/Failed-Payment-Notification-2021-04-23","title":"Failed Payment Notification","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Fetch-Claims-2023-07-17":{"id":"library/jobs/auto/Fetch-Claims-2023-07-17","title":"Fetch Claims","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Get-cases-from-Primero-2021-09-23":{"id":"library/jobs/auto/Get-cases-from-Primero-2021-09-23","title":"Get cases from Primero","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Get-CommCare-Forms-Bulk-Extract-2022-05-16":{"id":"library/jobs/auto/Get-CommCare-Forms-Bulk-Extract-2022-05-16","title":"Get CommCare Forms (Bulk Extract)","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/getKoboData":{"id":"library/jobs/auto/getKoboData","title":"Extract Kobo data from API to send to OpenFn Inbox","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/google-oauth-test-2024-12-20":{"id":"library/jobs/auto/google-oauth-test-2024-12-20","title":"google oauth test","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/HIV-Testing-Event-Snapshot-2021-05-03":{"id":"library/jobs/auto/HIV-Testing-Event-Snapshot-2021-05-03","title":"HIV Testing Event Snapshot","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/HIV-Testing-Event-Statistics-2021-05-03":{"id":"library/jobs/auto/HIV-Testing-Event-Statistics-2021-05-03","title":"HIV Testing Event Statistics","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Kobo-to-sheets-2023-10-13":{"id":"library/jobs/auto/Kobo-to-sheets-2023-10-13","title":"Kobo to sheets","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Load-to-DB-2022-05-16":{"id":"library/jobs/auto/Load-to-DB-2022-05-16","title":"Load to DB","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Load-to-DHIS2-2023-07-17":{"id":"library/jobs/auto/Load-to-DHIS2-2023-07-17","title":"Load to DHIS2","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Malaria-Testing-Event-Snapshot-2021-05-03":{"id":"library/jobs/auto/Malaria-Testing-Event-Snapshot-2021-05-03","title":"Malaria Testing Event Snapshot","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Malaria-Testing-Event-Statistics-2021-05-03":{"id":"library/jobs/auto/Malaria-Testing-Event-Statistics-2021-05-03","title":"Malaria Testing Event Statistics","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/no-return-2023-01-06":{"id":"library/jobs/auto/no-return-2023-01-06","title":"no return","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/ODK-Create-Many-Records-Moving-In-And-Out-Of-Repeat-Blocks":{"id":"library/jobs/auto/ODK-Create-Many-Records-Moving-In-And-Out-Of-Repeat-Blocks","title":"Handling multiple ODK repeat groups","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Outcome-Survey-2024-07-16":{"id":"library/jobs/auto/Outcome-Survey-2024-07-16","title":"Outcome Survey","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Pay-CHW-2021-04-23":{"id":"library/jobs/auto/Pay-CHW-2021-04-23","title":"Pay CHW","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/PHQ9-2021-05-03":{"id":"library/jobs/auto/PHQ9-2021-05-03","title":"PHQ9","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/promise-all-nested-requests":{"id":"library/jobs/auto/promise-all-nested-requests","title":"Promises and nested requests","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Q3-2022-Create-Distribution-Referral-in-SF-2020-06-19":{"id":"library/jobs/auto/Q3-2022-Create-Distribution-Referral-in-SF-2020-06-19","title":"Q3 2022 Create Distribution & Referral in SF","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Q3-2022-Update-HH-Name-in-CommCare-2021-09-27":{"id":"library/jobs/auto/Q3-2022-Update-HH-Name-in-CommCare-2021-09-27","title":"Q3 2022 Update HH Name in CommCare","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Q3-2022-Upsert-Household-Household-Visit-in-SF-2022-06-28":{"id":"library/jobs/auto/Q3-2022-Upsert-Household-Household-Visit-in-SF-2022-06-28","title":"Q3 2022 Upsert Household & Household Visit in SF","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Q3-2022-Upsert-Person-2022-04-21":{"id":"library/jobs/auto/Q3-2022-Upsert-Person-2022-04-21","title":"Q3 2022 Upsert Person","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Q3-2022-Upsert-Person-Visit-2022-06-28":{"id":"library/jobs/auto/Q3-2022-Upsert-Person-Visit-2022-06-28","title":"Q3 2022 Upsert Person Visit","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Q4-2022-Upsert-Supervision-Accompaniment-2022-08-22":{"id":"library/jobs/auto/Q4-2022-Upsert-Supervision-Accompaniment-2022-08-22","title":"Q4 2022 Upsert Supervision - Accompaniment","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Q4-2022-Upsert-Supervision-Feedback-2022-08-19":{"id":"library/jobs/auto/Q4-2022-Upsert-Supervision-Feedback-2022-08-19","title":"Q4 2022 Upsert Supervision - Feedback","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Q4-2022-Upsert-Supervision-Household-Spot-Check-2022-08-24":{"id":"library/jobs/auto/Q4-2022-Upsert-Supervision-Household-Spot-Check-2022-08-24","title":"Q4 2022 Upsert Supervision - Household Spot Check","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Register-Participant-V2-Skillz-2021-06-02":{"id":"library/jobs/auto/Register-Participant-V2-Skillz-2021-06-02","title":"Register Participant - V2 Skillz","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Register-Patient-2021-03-02":{"id":"library/jobs/auto/Register-Patient-2021-03-02","title":"Register Patient","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Request-Vitas-Sync-2021-05-11":{"id":"library/jobs/auto/Request-Vitas-Sync-2021-05-11","title":"Request Vitas Sync","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Risk-and-Vulnerability-Assessment-2021-05-27":{"id":"library/jobs/auto/Risk-and-Vulnerability-Assessment-2021-05-27","title":"Risk and Vulnerability Assessment","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/send-mail-in-mailgun":{"id":"library/jobs/auto/send-mail-in-mailgun","title":"send email","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/send-sms-from-salesforce-workflow":{"id":"library/jobs/auto/send-sms-from-salesforce-workflow","title":"Send sms from Salesforce workflow action","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/synchronous-http-request":{"id":"library/jobs/auto/synchronous-http-request","title":"Chaining synchronous http requests","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/timeout":{"id":"library/jobs/auto/timeout","title":"Timeout to create a delay","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Aggregate-Service-Referrals-2021-04-30":{"id":"library/jobs/auto/Upsert-Aggregate-Service-Referrals-2021-04-30","title":"Upsert Aggregate Service Referrals","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-ART-Adherence-Self-Reporting-Tool-2021-04-30":{"id":"library/jobs/auto/Upsert-ART-Adherence-Self-Reporting-Tool-2021-04-30","title":"Upsert ART Adherence Self-Reporting Tool","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Attendance-Skillz-Plus-Club-2021-05-24":{"id":"library/jobs/auto/Upsert-Attendance-Skillz-Plus-Club-2021-05-24","title":"Upsert Attendance Skillz Plus Club","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Coach-Support-Visit-CSV-2021-04-28":{"id":"library/jobs/auto/Upsert-Coach-Support-Visit-CSV-2021-04-28","title":"Upsert Coach Support Visit CSV","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Confirm-Services-Received-2021-06-14":{"id":"library/jobs/auto/Upsert-Confirm-Services-Received-2021-06-14","title":"Upsert Confirm Services Received","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Home-Visit-Log-Form-2021-05-03":{"id":"library/jobs/auto/Upsert-Home-Visit-Log-Form-2021-05-03","title":"Upsert Home Visit Log Form","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Intervention-Notes-2021-04-28":{"id":"library/jobs/auto/Upsert-Intervention-Notes-2021-04-28","title":"Upsert Intervention Notes","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/upsert-many-items-in-array-with-value-outside-array":{"id":"library/jobs/auto/upsert-many-items-in-array-with-value-outside-array","title":"Merge data into child array then upsert","description":"\ud83d\udcdc This job is an official example from OpenFn.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Post-Challenges-2021-04-30":{"id":"library/jobs/auto/Upsert-Post-Challenges-2021-04-30","title":"Upsert Post Challenges","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Pre-Challenges-2021-04-30":{"id":"library/jobs/auto/Upsert-Pre-Challenges-2021-04-30","title":"Upsert Pre Challenges","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Register-Event-2021-04-30":{"id":"library/jobs/auto/Upsert-Register-Event-2021-04-30","title":"Upsert Register Event","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Register-Participant-2021-04-28":{"id":"library/jobs/auto/Upsert-Register-Participant-2021-04-28","title":"Upsert Register Participant","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Register-Participant-Skillz-2021-08-30":{"id":"library/jobs/auto/Upsert-Register-Participant-Skillz-2021-08-30","title":"Upsert Register Participant Skillz","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Register-Skills-plus-Club-2021-04-30":{"id":"library/jobs/auto/Upsert-Register-Skills-plus-Club-2021-04-30","title":"Upsert Register Skills plus Club","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Risk-and-Vulnerability-Assessment-Service-Referral-2021-05-25":{"id":"library/jobs/auto/Upsert-Risk-and-Vulnerability-Assessment-Service-Referral-2021-05-25","title":"Upsert Risk and Vulnerability Assessment - Service Referral","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Service-Referral-2-2021-06-14":{"id":"library/jobs/auto/Upsert-Service-Referral-2-2021-06-14","title":"Upsert Service Referral 2","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Service-Referral-2021-04-30":{"id":"library/jobs/auto/Upsert-Service-Referral-2021-04-30","title":"Upsert Service Referral","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Service-Referral-Followup-2021-04-30":{"id":"library/jobs/auto/Upsert-Service-Referral-Followup-2021-04-30","title":"Upsert Service Referral Followup","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-Team-or-Group-Name-2021-04-28":{"id":"library/jobs/auto/Upsert-Team-or-Group-Name-2021-04-28","title":"Upsert Team or Group Name","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-to-mBrana-2021-05-11":{"id":"library/jobs/auto/Upsert-to-mBrana-2021-05-11","title":"Upsert to mBrana","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/Upsert-User-in-Salesforce-2021-04-16":{"id":"library/jobs/auto/Upsert-User-in-Salesforce-2021-04-16","title":"Upsert User in Salesforce","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/WF1-1-Bulk-get-HH-cases-2023-05-19":{"id":"library/jobs/auto/WF1-1-Bulk-get-HH-cases-2023-05-19","title":"WF1-1 Bulk get HH cases","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/WF1-2-Bulk-upsert-HHs-and-HH-Visits-2023-05-19":{"id":"library/jobs/auto/WF1-2-Bulk-upsert-HHs-and-HH-Visits-2023-05-19","title":"WF1-2 Bulk upsert HHs and HH Visits","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/WF2-1-Bulk-get-Person-cases-2023-05-19":{"id":"library/jobs/auto/WF2-1-Bulk-get-Person-cases-2023-05-19","title":"WF2-1 Bulk get Person cases","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/WF2-2-Bulk-upsert-Persons-2023-05-19":{"id":"library/jobs/auto/WF2-2-Bulk-upsert-Persons-2023-05-19","title":"WF2-2 Bulk upsert Persons","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/WF3-1-Bulk-get-Person-Visit-cases-2023-05-19":{"id":"library/jobs/auto/WF3-1-Bulk-get-Person-Visit-cases-2023-05-19","title":"WF3-1 Bulk get Person Visit cases","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/WF3-2-Bulk-upsert-Person-Visits-2023-05-19":{"id":"library/jobs/auto/WF3-2-Bulk-upsert-Person-Visits-2023-05-19","title":"WF3-2 Bulk upsert Person Visits","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/WF3-2a-Repeat-Failed-Person-Visits-2023-05-31":{"id":"library/jobs/auto/WF3-2a-Repeat-Failed-Person-Visits-2023-05-31","title":"WF3-2a Repeat Failed Person Visits","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/WF4-1-Bulk-get-Referral-Cases-2023-05-19":{"id":"library/jobs/auto/WF4-1-Bulk-get-Referral-Cases-2023-05-19","title":"WF4-1 Bulk get Referral Cases","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/jobs/auto/WF4-2-Bulk-upsert-Services-2023-05-19":{"id":"library/jobs/auto/WF4-2-Bulk-upsert-Services-2023-05-19","title":"WF4-2 Bulk upsert Services","description":"This job was provided by an OpenFn.org user via the job library API.","sidebar":"adaptors"},"library/triggers/xmlns":{"id":"library/triggers/xmlns","title":"Match a message with a fragment inside another object called `form`","description":""},"magpi":{"id":"magpi","title":"Magpi","description":"Magpi is not able to push data to external URLs. In order to fetch data from","sidebar":"adaptors"},"mailchimp":{"id":"mailchimp","title":"MailChimp Adaptor","description":"About Mailchimp","sidebar":"adaptors"},"mojatax":{"id":"mojatax","title":"Mojatax Adaptor","description":"About Mojatax","sidebar":"adaptors"},"mongodb":{"id":"mongodb","title":"MongoDB Adaptor","description":"About MongoDB","sidebar":"adaptors"},"moodle":{"id":"moodle","title":"Moodle","description":"Overview","sidebar":"adaptors"},"msgraph":{"id":"msgraph","title":"Microsoft Graph","description":"Overview","sidebar":"adaptors"},"mssql":{"id":"mssql","title":"MSSQL Adaptor","description":"About MSSQL","sidebar":"adaptors"},"mysql":{"id":"mysql","title":"MySQL Adaptor","description":"About MySQL","sidebar":"adaptors"},"ocl":{"id":"ocl","title":"OCL Adaptor","description":"About OCL","sidebar":"adaptors"},"odk":{"id":"odk","title":"ODK","description":"ODK is a data collection platform used by researchers,","sidebar":"adaptors"},"ona":{"id":"ona","title":"Ona.io","description":"Webhooks to push form data to OpenFn","sidebar":"adaptors"},"openmrs":{"id":"openmrs","title":"OpenMRS Adaptor","description":"About OpenMRS","sidebar":"adaptors"},"packages/asana-changelog":{"id":"packages/asana-changelog","title":"asana changelog","description":"4.0.8","sidebar":"adaptors"},"packages/asana-configuration-schema":{"id":"packages/asana-configuration-schema","title":"Config for asana","description":"Jobs that use the asana adaptor may require authentication. A","sidebar":"adaptors"},"packages/asana-docs":{"id":"packages/asana-docs","title":"asana@4.0.8","description":"createTask(params, callback)","sidebar":"adaptors"},"packages/asana-readme":{"id":"packages/asana-readme","title":"asana developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/asana","sidebar":"adaptors"},"packages/azure-storage-changelog":{"id":"packages/azure-storage-changelog","title":"azure-storage changelog","description":"2.0.8","sidebar":"adaptors"},"packages/azure-storage-configuration-schema":{"id":"packages/azure-storage-configuration-schema","title":"Config for azure-storage","description":"Jobs that use the azure-storage adaptor may require authentication. A","sidebar":"adaptors"},"packages/azure-storage-docs":{"id":"packages/azure-storage-docs","title":"azure-storage@2.0.8","description":"downloadBlob(blobName, [options])","sidebar":"adaptors"},"packages/azure-storage-readme":{"id":"packages/azure-storage-readme","title":"azure-storage developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/azure-storage","sidebar":"adaptors"},"packages/beyonic-changelog":{"id":"packages/beyonic-changelog","title":"beyonic changelog","description":"0.3.9","sidebar":"adaptors"},"packages/beyonic-configuration-schema":{"id":"packages/beyonic-configuration-schema","title":"Config for beyonic","description":"Jobs that use the beyonic adaptor may require authentication. A","sidebar":"adaptors"},"packages/beyonic-docs":{"id":"packages/beyonic-docs","title":"beyonic@0.3.9","description":"createCollectionRequest(data)","sidebar":"adaptors"},"packages/beyonic-readme":{"id":"packages/beyonic-readme","title":"beyonic developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/beyonic","sidebar":"adaptors"},"packages/bigquery-changelog":{"id":"packages/bigquery-changelog","title":"bigquery changelog","description":"3.0.9","sidebar":"adaptors"},"packages/bigquery-configuration-schema":{"id":"packages/bigquery-configuration-schema","title":"Config for bigquery","description":"Jobs that use the bigquery adaptor may require authentication. A","sidebar":"adaptors"},"packages/bigquery-docs":{"id":"packages/bigquery-docs","title":"bigquery@3.0.9","description":"load(dirPath, projectId, datasetId, tableId, loadOptions, callback)","sidebar":"adaptors"},"packages/bigquery-readme":{"id":"packages/bigquery-readme","title":"bigquery developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/bigquery","sidebar":"adaptors"},"packages/cartodb-changelog":{"id":"packages/cartodb-changelog","title":"cartodb changelog","description":"0.4.10","sidebar":"adaptors"},"packages/cartodb-configuration-schema":{"id":"packages/cartodb-configuration-schema","title":"Config for cartodb","description":"Jobs that use the cartodb adaptor may require authentication. A","sidebar":"adaptors"},"packages/cartodb-docs":{"id":"packages/cartodb-docs","title":"cartodb@0.4.10","description":"addRow(table, rowData)","sidebar":"adaptors"},"packages/cartodb-readme":{"id":"packages/cartodb-readme","title":"cartodb developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/cartodb","sidebar":"adaptors"},"packages/cht-changelog":{"id":"packages/cht-changelog","title":"cht changelog","description":"1.0.8","sidebar":"adaptors"},"packages/cht-configuration-schema":{"id":"packages/cht-configuration-schema","title":"Config for cht","description":"Jobs that use the cht adaptor may require authentication. A","sidebar":"adaptors"},"packages/cht-docs":{"id":"packages/cht-docs","title":"cht@1.0.8","description":"get(path, options, [callback])","sidebar":"adaptors"},"packages/cht-readme":{"id":"packages/cht-readme","title":"cht developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/cht","sidebar":"adaptors"},"packages/collections-changelog":{"id":"packages/collections-changelog","title":"collections changelog","description":"0.7.4","sidebar":"adaptors"},"packages/collections-configuration-schema":{"id":"packages/collections-configuration-schema","title":"Config for collections","description":"Jobs that use the collections adaptor may require authentication. A","sidebar":"adaptors"},"packages/collections-docs":{"id":"packages/collections-docs","title":"collections@0.7.4","description":"This adaptor exports the following namespaced functions:","sidebar":"adaptors"},"packages/collections-readme":{"id":"packages/collections-readme","title":"collections developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/collections","sidebar":"adaptors"},"packages/commcare-changelog":{"id":"packages/commcare-changelog","title":"commcare changelog","description":"3.2.9","sidebar":"adaptors"},"packages/commcare-configuration-schema":{"id":"packages/commcare-configuration-schema","title":"Config for commcare","description":"Jobs that use the commcare adaptor may require authentication. A","sidebar":"adaptors"},"packages/commcare-docs":{"id":"packages/commcare-docs","title":"commcare@3.2.9","description":"bulk(type, data, params)","sidebar":"adaptors"},"packages/commcare-readme":{"id":"packages/commcare-readme","title":"commcare developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/commcare","sidebar":"adaptors"},"packages/common-changelog":{"id":"packages/common-changelog","title":"common changelog","description":"2.3.0","sidebar":"adaptors"},"packages/common-configuration-schema":{"id":"packages/common-configuration-schema","title":"Config for common","description":"No configuration schema has been defined for the common adaptor.","sidebar":"adaptors"},"packages/common-docs":{"id":"packages/common-docs","title":"common@2.3.0","description":"arrayToString(arr, separator)","sidebar":"adaptors"},"packages/common-readme":{"id":"packages/common-readme","title":"common developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/common","sidebar":"adaptors"},"packages/dhis2-changelog":{"id":"packages/dhis2-changelog","title":"dhis2 changelog","description":"6.3.0","sidebar":"adaptors"},"packages/dhis2-configuration-schema":{"id":"packages/dhis2-configuration-schema","title":"Config for dhis2","description":"Jobs that use the dhis2 adaptor may require authentication. A","sidebar":"adaptors"},"packages/dhis2-docs":{"id":"packages/dhis2-docs","title":"dhis2@6.3.0","description":"attr(attribute, value)","sidebar":"adaptors"},"packages/dhis2-readme":{"id":"packages/dhis2-readme","title":"dhis2 developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/dhis2","sidebar":"adaptors"},"packages/dynamics-changelog":{"id":"packages/dynamics-changelog","title":"dynamics changelog","description":"0.5.12","sidebar":"adaptors"},"packages/dynamics-configuration-schema":{"id":"packages/dynamics-configuration-schema","title":"Config for dynamics","description":"Jobs that use the dynamics adaptor may require authentication. A","sidebar":"adaptors"},"packages/dynamics-docs":{"id":"packages/dynamics-docs","title":"dynamics@0.5.12","description":"This adaptor exports the following from common:","sidebar":"adaptors"},"packages/dynamics-readme":{"id":"packages/dynamics-readme","title":"dynamics developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/dynamics","sidebar":"adaptors"},"packages/facebook-changelog":{"id":"packages/facebook-changelog","title":"facebook changelog","description":"0.4.10","sidebar":"adaptors"},"packages/facebook-configuration-schema":{"id":"packages/facebook-configuration-schema","title":"Config for facebook","description":"Jobs that use the facebook adaptor may require authentication. A","sidebar":"adaptors"},"packages/facebook-docs":{"id":"packages/facebook-docs","title":"facebook@0.4.10","description":"postMessage(params)","sidebar":"adaptors"},"packages/facebook-readme":{"id":"packages/facebook-readme","title":"facebook developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/facebook","sidebar":"adaptors"},"packages/fhir-changelog":{"id":"packages/fhir-changelog","title":"fhir changelog","description":"5.0.3","sidebar":"adaptors"},"packages/fhir-configuration-schema":{"id":"packages/fhir-configuration-schema","title":"Config for fhir","description":"Jobs that use the fhir adaptor may require authentication. A","sidebar":"adaptors"},"packages/fhir-docs":{"id":"packages/fhir-docs","title":"fhir@5.0.3","description":"create(resourceType, resource, params, callback)","sidebar":"adaptors"},"packages/fhir-fr-changelog":{"id":"packages/fhir-fr-changelog","title":"fhir-fr changelog","description":"1.0.7","sidebar":"adaptors"},"packages/fhir-fr-configuration-schema":{"id":"packages/fhir-fr-configuration-schema","title":"Config for fhir-fr","description":"Jobs that use the fhir-fr adaptor may require authentication. A","sidebar":"adaptors"},"packages/fhir-fr-docs":{"id":"packages/fhir-fr-docs","title":"fhir-fr@1.0.7","description":"This adaptor exports the following namespaced functions:","sidebar":"adaptors"},"packages/fhir-fr-readme":{"id":"packages/fhir-fr-readme","title":"fhir-fr developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/fhir-fr","sidebar":"adaptors"},"packages/fhir-ndr-et-changelog":{"id":"packages/fhir-ndr-et-changelog","title":"fhir-ndr-et changelog","description":"0.1.10","sidebar":"adaptors"},"packages/fhir-ndr-et-configuration-schema":{"id":"packages/fhir-ndr-et-configuration-schema","title":"Config for fhir-ndr-et","description":"Jobs that use the fhir-ndr-et adaptor may require authentication. A","sidebar":"adaptors"},"packages/fhir-ndr-et-docs":{"id":"packages/fhir-ndr-et-docs","title":"fhir-ndr-et@0.1.10","description":"create(resourceType, resource, params, callback)","sidebar":"adaptors"},"packages/fhir-ndr-et-readme":{"id":"packages/fhir-ndr-et-readme","title":"fhir-ndr-et developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/fhir-ndr-et","sidebar":"adaptors"},"packages/fhir-readme":{"id":"packages/fhir-readme","title":"fhir developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/fhir","sidebar":"adaptors"},"packages/ghana-bdr-changelog":{"id":"packages/ghana-bdr-changelog","title":"ghana-bdr changelog","description":"0.1.3","sidebar":"adaptors"},"packages/ghana-bdr-configuration-schema":{"id":"packages/ghana-bdr-configuration-schema","title":"Config for ghana-bdr","description":"Jobs that use the ghana-bdr adaptor may require authentication. A","sidebar":"adaptors"},"packages/ghana-bdr-docs":{"id":"packages/ghana-bdr-docs","title":"ghana-bdr@0.1.3","description":"get(path, query)","sidebar":"adaptors"},"packages/ghana-bdr-readme":{"id":"packages/ghana-bdr-readme","title":"ghana-bdr developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/ghana-bdr","sidebar":"adaptors"},"packages/ghana-nia-changelog":{"id":"packages/ghana-nia-changelog","title":"ghana-nia changelog","description":"0.1.3","sidebar":"adaptors"},"packages/ghana-nia-configuration-schema":{"id":"packages/ghana-nia-configuration-schema","title":"Config for ghana-nia","description":"Jobs that use the ghana-nia adaptor may require authentication. A","sidebar":"adaptors"},"packages/ghana-nia-docs":{"id":"packages/ghana-nia-docs","title":"ghana-nia@0.1.3","description":"get(path, query)","sidebar":"adaptors"},"packages/ghana-nia-readme":{"id":"packages/ghana-nia-readme","title":"ghana-nia developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/ghana-nia","sidebar":"adaptors"},"packages/gmail-changelog":{"id":"packages/gmail-changelog","title":"gmail changelog","description":"1.1.1","sidebar":"adaptors"},"packages/gmail-configuration-schema":{"id":"packages/gmail-configuration-schema","title":"Config for gmail","description":"Jobs that use the gmail adaptor may require authentication. A","sidebar":"adaptors"},"packages/gmail-docs":{"id":"packages/gmail-docs","title":"gmail@1.1.1","description":"getContentsFromMessages(options)","sidebar":"adaptors"},"packages/gmail-readme":{"id":"packages/gmail-readme","title":"gmail developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/gmail","sidebar":"adaptors"},"packages/godata-changelog":{"id":"packages/godata-changelog","title":"godata changelog","description":"3.5.4","sidebar":"adaptors"},"packages/godata-configuration-schema":{"id":"packages/godata-configuration-schema","title":"Config for godata","description":"Jobs that use the godata adaptor may require authentication. A","sidebar":"adaptors"},"packages/godata-docs":{"id":"packages/godata-docs","title":"godata@3.5.4","description":"getCase(id, query, callback)","sidebar":"adaptors"},"packages/godata-readme":{"id":"packages/godata-readme","title":"godata developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/godata","sidebar":"adaptors"},"packages/googlehealthcare-changelog":{"id":"packages/googlehealthcare-changelog","title":"googlehealthcare changelog","description":"1.1.3","sidebar":"adaptors"},"packages/googlehealthcare-configuration-schema":{"id":"packages/googlehealthcare-configuration-schema","title":"Config for googlehealthcare","description":"Jobs that use the googlehealthcare adaptor may require authentication. A","sidebar":"adaptors"},"packages/googlehealthcare-docs":{"id":"packages/googlehealthcare-docs","title":"googlehealthcare@1.1.3","description":"createFhirResource([fhirStore], resource, callback)","sidebar":"adaptors"},"packages/googlehealthcare-readme":{"id":"packages/googlehealthcare-readme","title":"googlehealthcare developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/googlehealthcare","sidebar":"adaptors"},"packages/googlesheets-changelog":{"id":"packages/googlesheets-changelog","title":"googlesheets changelog","description":"3.0.9","sidebar":"adaptors"},"packages/googlesheets-configuration-schema":{"id":"packages/googlesheets-configuration-schema","title":"Config for googlesheets","description":"Jobs that use the googlesheets adaptor may require authentication. A","sidebar":"adaptors"},"packages/googlesheets-docs":{"id":"packages/googlesheets-docs","title":"googlesheets@3.0.9","description":"appendValues(params, callback)","sidebar":"adaptors"},"packages/googlesheets-readme":{"id":"packages/googlesheets-readme","title":"googlesheets developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/googlesheets","sidebar":"adaptors"},"packages/hive-changelog":{"id":"packages/hive-changelog","title":"hive changelog","description":"0.3.10","sidebar":"adaptors"},"packages/hive-configuration-schema":{"id":"packages/hive-configuration-schema","title":"Config for hive","description":"Jobs that use the hive adaptor may require authentication. A","sidebar":"adaptors"},"packages/hive-docs":{"id":"packages/hive-docs","title":"hive@0.3.10","description":"query(qs, options, callback)","sidebar":"adaptors"},"packages/hive-readme":{"id":"packages/hive-readme","title":"hive developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/hive","sidebar":"adaptors"},"packages/http-changelog":{"id":"packages/http-changelog","title":"http changelog","description":"6.5.4","sidebar":"adaptors"},"packages/http-configuration-schema":{"id":"packages/http-configuration-schema","title":"Config for http","description":"Jobs that use the http adaptor may require authentication. A","sidebar":"adaptors"},"packages/http-docs":{"id":"packages/http-docs","title":"http@6.5.4","description":"del(path, params, callback)","sidebar":"adaptors"},"packages/http-readme":{"id":"packages/http-readme","title":"http developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/http","sidebar":"adaptors"},"packages/hubtel-changelog":{"id":"packages/hubtel-changelog","title":"hubtel changelog","description":"1.0.1","sidebar":"adaptors"},"packages/hubtel-configuration-schema":{"id":"packages/hubtel-configuration-schema","title":"Config for hubtel","description":"Jobs that use the hubtel adaptor may require authentication. A","sidebar":"adaptors"},"packages/hubtel-docs":{"id":"packages/hubtel-docs","title":"hubtel@1.0.1","description":"request(method, path, body, options)","sidebar":"adaptors"},"packages/hubtel-readme":{"id":"packages/hubtel-readme","title":"hubtel developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/hubtel","sidebar":"adaptors"},"packages/intuit-changelog":{"id":"packages/intuit-changelog","title":"intuit changelog","description":"1.0.0","sidebar":"adaptors"},"packages/intuit-configuration-schema":{"id":"packages/intuit-configuration-schema","title":"Config for intuit","description":"Jobs that use the intuit adaptor may require authentication. A","sidebar":"adaptors"},"packages/intuit-docs":{"id":"packages/intuit-docs","title":"intuit@1.0.0","description":"This adaptor exports the following namespaced functions:","sidebar":"adaptors"},"packages/intuit-readme":{"id":"packages/intuit-readme","title":"intuit developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/intuit","sidebar":"adaptors"},"packages/khanacademy-changelog":{"id":"packages/khanacademy-changelog","title":"khanacademy changelog","description":"0.5.9","sidebar":"adaptors"},"packages/khanacademy-configuration-schema":{"id":"packages/khanacademy-configuration-schema","title":"Config for khanacademy","description":"Jobs that use the khanacademy adaptor may require authentication. A","sidebar":"adaptors"},"packages/khanacademy-docs":{"id":"packages/khanacademy-docs","title":"khanacademy@0.5.9","description":"This adaptor exports the following from common:","sidebar":"adaptors"},"packages/khanacademy-readme":{"id":"packages/khanacademy-readme","title":"khanacademy developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/khanacademy","sidebar":"adaptors"},"packages/kobotoolbox-changelog":{"id":"packages/kobotoolbox-changelog","title":"kobotoolbox changelog","description":"3.0.0","sidebar":"adaptors"},"packages/kobotoolbox-configuration-schema":{"id":"packages/kobotoolbox-configuration-schema","title":"Config for kobotoolbox","description":"Jobs that use the kobotoolbox adaptor may require authentication. A","sidebar":"adaptors"},"packages/kobotoolbox-docs":{"id":"packages/kobotoolbox-docs","title":"kobotoolbox@3.0.0","description":"getDeploymentInfo(formId)","sidebar":"adaptors"},"packages/kobotoolbox-readme":{"id":"packages/kobotoolbox-readme","title":"kobotoolbox developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/kobotoolbox","sidebar":"adaptors"},"packages/magpi-changelog":{"id":"packages/magpi-changelog","title":"magpi changelog","description":"1.2.4","sidebar":"adaptors"},"packages/magpi-configuration-schema":{"id":"packages/magpi-configuration-schema","title":"Config for magpi","description":"Jobs that use the magpi adaptor may require authentication. A","sidebar":"adaptors"},"packages/magpi-docs":{"id":"packages/magpi-docs","title":"magpi@1.2.4","description":"fetchSurveyData(params)","sidebar":"adaptors"},"packages/magpi-readme":{"id":"packages/magpi-readme","title":"magpi developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/magpi","sidebar":"adaptors"},"packages/mailchimp-changelog":{"id":"packages/mailchimp-changelog","title":"mailchimp changelog","description":"1.0.11","sidebar":"adaptors"},"packages/mailchimp-configuration-schema":{"id":"packages/mailchimp-configuration-schema","title":"Config for mailchimp","description":"Jobs that use the mailchimp adaptor may require authentication. A","sidebar":"adaptors"},"packages/mailchimp-docs":{"id":"packages/mailchimp-docs","title":"mailchimp@1.0.11","description":"addMember(params, [callback])","sidebar":"adaptors"},"packages/mailchimp-readme":{"id":"packages/mailchimp-readme","title":"mailchimp developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/mailchimp","sidebar":"adaptors"},"packages/mailgun-changelog":{"id":"packages/mailgun-changelog","title":"mailgun changelog","description":"0.5.9","sidebar":"adaptors"},"packages/mailgun-configuration-schema":{"id":"packages/mailgun-configuration-schema","title":"Config for mailgun","description":"Jobs that use the mailgun adaptor may require authentication. A","sidebar":"adaptors"},"packages/mailgun-docs":{"id":"packages/mailgun-docs","title":"mailgun@0.5.9","description":"send(params)","sidebar":"adaptors"},"packages/mailgun-readme":{"id":"packages/mailgun-readme","title":"mailgun developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/mailgun","sidebar":"adaptors"},"packages/maximo-changelog":{"id":"packages/maximo-changelog","title":"maximo changelog","description":"0.5.11","sidebar":"adaptors"},"packages/maximo-configuration-schema":{"id":"packages/maximo-configuration-schema","title":"Config for maximo","description":"Jobs that use the maximo adaptor may require authentication. A","sidebar":"adaptors"},"packages/maximo-docs":{"id":"packages/maximo-docs","title":"maximo@0.5.11","description":"fetch(params)","sidebar":"adaptors"},"packages/maximo-readme":{"id":"packages/maximo-readme","title":"maximo developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/maximo","sidebar":"adaptors"},"packages/medicmobile-changelog":{"id":"packages/medicmobile-changelog","title":"medicmobile changelog","description":"0.5.10","sidebar":"adaptors"},"packages/medicmobile-configuration-schema":{"id":"packages/medicmobile-configuration-schema","title":"Config for medicmobile","description":"Jobs that use the medicmobile adaptor may require authentication. A","sidebar":"adaptors"},"packages/medicmobile-docs":{"id":"packages/medicmobile-docs","title":"medicmobile@0.5.10","description":"changesApi(params, callback)","sidebar":"adaptors"},"packages/medicmobile-readme":{"id":"packages/medicmobile-readme","title":"medicmobile developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/medicmobile","sidebar":"adaptors"},"packages/mogli-changelog":{"id":"packages/mogli-changelog","title":"mogli changelog","description":"v0.1.6","sidebar":"adaptors"},"packages/mogli-configuration-schema":{"id":"packages/mogli-configuration-schema","title":"Config for mogli","description":"Jobs that use the mogli adaptor may require authentication. A","sidebar":"adaptors"},"packages/mogli-docs":{"id":"packages/mogli-docs","title":"mogli@0.5.11","description":"This adaptor exports the following namespaced functions:","sidebar":"adaptors"},"packages/mogli-readme":{"id":"packages/mogli-readme","title":"mogli developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/mogli","sidebar":"adaptors"},"packages/mojatax-changelog":{"id":"packages/mojatax-changelog","title":"mojatax changelog","description":"1.0.5","sidebar":"adaptors"},"packages/mojatax-configuration-schema":{"id":"packages/mojatax-configuration-schema","title":"Config for mojatax","description":"Jobs that use the mojatax adaptor may require authentication. A","sidebar":"adaptors"},"packages/mojatax-docs":{"id":"packages/mojatax-docs","title":"mojatax@1.0.5","description":"post(path, data, options, [callback])","sidebar":"adaptors"},"packages/mojatax-readme":{"id":"packages/mojatax-readme","title":"mojatax developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/mojatax","sidebar":"adaptors"},"packages/mongodb-changelog":{"id":"packages/mongodb-changelog","title":"mongodb changelog","description":"2.1.10","sidebar":"adaptors"},"packages/mongodb-configuration-schema":{"id":"packages/mongodb-configuration-schema","title":"Config for mongodb","description":"Jobs that use the mongodb adaptor may require authentication. A","sidebar":"adaptors"},"packages/mongodb-docs":{"id":"packages/mongodb-docs","title":"mongodb@2.1.10","description":"findDocuments(params)","sidebar":"adaptors"},"packages/mongodb-readme":{"id":"packages/mongodb-readme","title":"mongodb developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/mongodb","sidebar":"adaptors"},"packages/msgraph-changelog":{"id":"packages/msgraph-changelog","title":"msgraph changelog","description":"0.7.10","sidebar":"adaptors"},"packages/msgraph-configuration-schema":{"id":"packages/msgraph-configuration-schema","title":"Config for msgraph","description":"Jobs that use the msgraph adaptor may require authentication. A","sidebar":"adaptors"},"packages/msgraph-docs":{"id":"packages/msgraph-docs","title":"msgraph@0.7.10","description":"create(resource, data, callback)","sidebar":"adaptors"},"packages/msgraph-readme":{"id":"packages/msgraph-readme","title":"msgraph developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/msgraph","sidebar":"adaptors"},"packages/mssql-changelog":{"id":"packages/mssql-changelog","title":"mssql changelog","description":"5.0.10","sidebar":"adaptors"},"packages/mssql-configuration-schema":{"id":"packages/mssql-configuration-schema","title":"Config for mssql","description":"Jobs that use the mssql adaptor may require authentication. A","sidebar":"adaptors"},"packages/mssql-docs":{"id":"packages/mssql-docs","title":"mssql@5.0.10","description":"describeTable(tableName, options)","sidebar":"adaptors"},"packages/mssql-readme":{"id":"packages/mssql-readme","title":"mssql developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/mssql","sidebar":"adaptors"},"packages/mysql-changelog":{"id":"packages/mysql-changelog","title":"mysql changelog","description":"2.0.8","sidebar":"adaptors"},"packages/mysql-configuration-schema":{"id":"packages/mysql-configuration-schema","title":"Config for mysql","description":"Jobs that use the mysql adaptor may require authentication. A","sidebar":"adaptors"},"packages/mysql-docs":{"id":"packages/mysql-docs","title":"mysql@2.0.8","description":"insert(table, fields)","sidebar":"adaptors"},"packages/mysql-readme":{"id":"packages/mysql-readme","title":"mysql developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/mysql","sidebar":"adaptors"},"packages/nexmo-changelog":{"id":"packages/nexmo-changelog","title":"nexmo changelog","description":"0.5.12","sidebar":"adaptors"},"packages/nexmo-configuration-schema":{"id":"packages/nexmo-configuration-schema","title":"Config for nexmo","description":"Jobs that use the nexmo adaptor may require authentication. A","sidebar":"adaptors"},"packages/nexmo-docs":{"id":"packages/nexmo-docs","title":"nexmo@0.5.12","description":"sendSMS(from, toNumber, message)","sidebar":"adaptors"},"packages/nexmo-readme":{"id":"packages/nexmo-readme","title":"nexmo developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/nexmo","sidebar":"adaptors"},"packages/ocl-changelog":{"id":"packages/ocl-changelog","title":"ocl changelog","description":"1.2.11","sidebar":"adaptors"},"packages/ocl-configuration-schema":{"id":"packages/ocl-configuration-schema","title":"Config for ocl","description":"Jobs that use the ocl adaptor may require authentication. A","sidebar":"adaptors"},"packages/ocl-docs":{"id":"packages/ocl-docs","title":"ocl@1.2.11","description":"get(path, query, callback)","sidebar":"adaptors"},"packages/ocl-readme":{"id":"packages/ocl-readme","title":"ocl developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/ocl","sidebar":"adaptors"},"packages/odk-changelog":{"id":"packages/odk-changelog","title":"odk changelog","description":"3.0.11","sidebar":"adaptors"},"packages/odk-configuration-schema":{"id":"packages/odk-configuration-schema","title":"Config for odk","description":"Jobs that use the odk adaptor may require authentication. A","sidebar":"adaptors"},"packages/odk-docs":{"id":"packages/odk-docs","title":"odk@3.0.11","description":"get(path, options)","sidebar":"adaptors"},"packages/odk-readme":{"id":"packages/odk-readme","title":"odk developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/odk","sidebar":"adaptors"},"packages/openfn-changelog":{"id":"packages/openfn-changelog","title":"openfn changelog","description":"2.0.9","sidebar":"adaptors"},"packages/openfn-configuration-schema":{"id":"packages/openfn-configuration-schema","title":"Config for openfn","description":"Jobs that use the openfn adaptor may require authentication. A","sidebar":"adaptors"},"packages/openfn-docs":{"id":"packages/openfn-docs","title":"openfn@2.0.9","description":"request(options, callback)","sidebar":"adaptors"},"packages/openfn-readme":{"id":"packages/openfn-readme","title":"openfn developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/openfn","sidebar":"adaptors"},"packages/openhim-changelog":{"id":"packages/openhim-changelog","title":"openhim changelog","description":"0.3.8","sidebar":"adaptors"},"packages/openhim-configuration-schema":{"id":"packages/openhim-configuration-schema","title":"Config for openhim","description":"Jobs that use the openhim adaptor may require authentication. A","sidebar":"adaptors"},"packages/openhim-docs":{"id":"packages/openhim-docs","title":"openhim@0.3.8","description":"This adaptor exports the following from common:","sidebar":"adaptors"},"packages/openhim-readme":{"id":"packages/openhim-readme","title":"openhim developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/openhim","sidebar":"adaptors"},"packages/openimis-changelog":{"id":"packages/openimis-changelog","title":"openimis changelog","description":"2.0.8","sidebar":"adaptors"},"packages/openimis-configuration-schema":{"id":"packages/openimis-configuration-schema","title":"Config for openimis","description":"Jobs that use the openimis adaptor may require authentication. A","sidebar":"adaptors"},"packages/openimis-docs":{"id":"packages/openimis-docs","title":"openimis@2.0.8","description":"getFHIR(path, params, callback)","sidebar":"adaptors"},"packages/openimis-readme":{"id":"packages/openimis-readme","title":"openimis developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/openimis","sidebar":"adaptors"},"packages/openlmis-changelog":{"id":"packages/openlmis-changelog","title":"openlmis changelog","description":"1.0.10","sidebar":"adaptors"},"packages/openlmis-configuration-schema":{"id":"packages/openlmis-configuration-schema","title":"Config for openlmis","description":"Jobs that use the openlmis adaptor may require authentication. A","sidebar":"adaptors"},"packages/openlmis-docs":{"id":"packages/openlmis-docs","title":"openlmis@1.0.10","description":"get(path, options, [callback])","sidebar":"adaptors"},"packages/openlmis-readme":{"id":"packages/openlmis-readme","title":"openlmis developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/openlmis","sidebar":"adaptors"},"packages/openmrs-changelog":{"id":"packages/openmrs-changelog","title":"openmrs changelog","description":"4.3.0","sidebar":"adaptors"},"packages/openmrs-configuration-schema":{"id":"packages/openmrs-configuration-schema","title":"Config for openmrs","description":"Jobs that use the openmrs adaptor may require authentication. A","sidebar":"adaptors"},"packages/openmrs-docs":{"id":"packages/openmrs-docs","title":"openmrs@4.3.0","description":"create(resourceType, data, [callback])","sidebar":"adaptors"},"packages/openmrs-readme":{"id":"packages/openmrs-readme","title":"openmrs developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/openmrs","sidebar":"adaptors"},"packages/openspp-changelog":{"id":"packages/openspp-changelog","title":"openspp changelog","description":"2.0.8","sidebar":"adaptors"},"packages/openspp-configuration-schema":{"id":"packages/openspp-configuration-schema","title":"Config for openspp","description":"Jobs that use the openspp adaptor may require authentication. A","sidebar":"adaptors"},"packages/openspp-docs":{"id":"packages/openspp-docs","title":"openspp@2.0.8","description":"addToGroup(groupid, individualid, role)","sidebar":"adaptors"},"packages/openspp-readme":{"id":"packages/openspp-readme","title":"openspp developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/openspp","sidebar":"adaptors"},"packages/postgresql-changelog":{"id":"packages/postgresql-changelog","title":"postgresql changelog","description":"6.0.8","sidebar":"adaptors"},"packages/postgresql-configuration-schema":{"id":"packages/postgresql-configuration-schema","title":"Config for postgresql","description":"Jobs that use the postgresql adaptor may require authentication. A","sidebar":"adaptors"},"packages/postgresql-docs":{"id":"packages/postgresql-docs","title":"postgresql@6.0.8","description":"describeTable(tableName, [options], callback)","sidebar":"adaptors"},"packages/postgresql-readme":{"id":"packages/postgresql-readme","title":"postgresql developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/postgresql","sidebar":"adaptors"},"packages/primero-changelog":{"id":"packages/primero-changelog","title":"primero changelog","description":"3.0.9","sidebar":"adaptors"},"packages/primero-configuration-schema":{"id":"packages/primero-configuration-schema","title":"Config for primero","description":"Jobs that use the primero adaptor may require authentication. A","sidebar":"adaptors"},"packages/primero-docs":{"id":"packages/primero-docs","title":"primero@3.0.9","description":"createCase(params, callback)","sidebar":"adaptors"},"packages/primero-readme":{"id":"packages/primero-readme","title":"primero developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/primero","sidebar":"adaptors"},"packages/progres-changelog":{"id":"packages/progres-changelog","title":"progres changelog","description":"1.4.6","sidebar":"adaptors"},"packages/progres-configuration-schema":{"id":"packages/progres-configuration-schema","title":"Config for progres","description":"Jobs that use the progres adaptor may require authentication. A","sidebar":"adaptors"},"packages/progres-docs":{"id":"packages/progres-docs","title":"progres@1.4.6","description":"postData(params, callback)","sidebar":"adaptors"},"packages/progres-readme":{"id":"packages/progres-readme","title":"progres developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/progres","sidebar":"adaptors"},"packages/rapidpro-changelog":{"id":"packages/rapidpro-changelog","title":"rapidpro changelog","description":"1.1.5","sidebar":"adaptors"},"packages/rapidpro-configuration-schema":{"id":"packages/rapidpro-configuration-schema","title":"Config for rapidpro","description":"Jobs that use the rapidpro adaptor may require authentication. A","sidebar":"adaptors"},"packages/rapidpro-docs":{"id":"packages/rapidpro-docs","title":"rapidpro@1.1.5","description":"addContact(params, callback)","sidebar":"adaptors"},"packages/rapidpro-readme":{"id":"packages/rapidpro-readme","title":"rapidpro developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/rapidpro","sidebar":"adaptors"},"packages/redis-changelog":{"id":"packages/redis-changelog","title":"redis changelog","description":"1.2.7","sidebar":"adaptors"},"packages/redis-configuration-schema":{"id":"packages/redis-configuration-schema","title":"Config for redis","description":"Jobs that use the redis adaptor may require authentication. A","sidebar":"adaptors"},"packages/redis-docs":{"id":"packages/redis-docs","title":"redis@1.2.7","description":"get(key)","sidebar":"adaptors"},"packages/redis-readme":{"id":"packages/redis-readme","title":"redis developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/redis","sidebar":"adaptors"},"packages/resourcemap-changelog":{"id":"packages/resourcemap-changelog","title":"resourcemap changelog","description":"0.4.10","sidebar":"adaptors"},"packages/resourcemap-configuration-schema":{"id":"packages/resourcemap-configuration-schema","title":"Config for resourcemap","description":"Jobs that use the resourcemap adaptor may require authentication. A","sidebar":"adaptors"},"packages/resourcemap-docs":{"id":"packages/resourcemap-docs","title":"resourcemap@0.4.10","description":"This adaptor exports the following from common:","sidebar":"adaptors"},"packages/resourcemap-readme":{"id":"packages/resourcemap-readme","title":"resourcemap developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/resourcemap","sidebar":"adaptors"},"packages/salesforce-changelog":{"id":"packages/salesforce-changelog","title":"salesforce changelog","description":"5.0.4","sidebar":"adaptors"},"packages/salesforce-configuration-schema":{"id":"packages/salesforce-configuration-schema","title":"Config for salesforce","description":"Jobs that use the salesforce adaptor may require authentication. A","sidebar":"adaptors"},"packages/salesforce-docs":{"id":"packages/salesforce-docs","title":"salesforce@5.0.4","description":"bulk(sObjectName, operation, records, [options])","sidebar":"adaptors"},"packages/salesforce-readme":{"id":"packages/salesforce-readme","title":"salesforce developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/salesforce","sidebar":"adaptors"},"packages/satusehat-changelog":{"id":"packages/satusehat-changelog","title":"satusehat changelog","description":"2.0.9","sidebar":"adaptors"},"packages/satusehat-configuration-schema":{"id":"packages/satusehat-configuration-schema","title":"Config for satusehat","description":"Jobs that use the satusehat adaptor may require authentication. A","sidebar":"adaptors"},"packages/satusehat-docs":{"id":"packages/satusehat-docs","title":"satusehat@2.0.9","description":"get(path, params, callback)","sidebar":"adaptors"},"packages/satusehat-readme":{"id":"packages/satusehat-readme","title":"satusehat developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/satusehat","sidebar":"adaptors"},"packages/sftp-changelog":{"id":"packages/sftp-changelog","title":"sftp changelog","description":"2.0.8","sidebar":"adaptors"},"packages/sftp-configuration-schema":{"id":"packages/sftp-configuration-schema","title":"Config for sftp","description":"Jobs that use the sftp adaptor may require authentication. A","sidebar":"adaptors"},"packages/sftp-docs":{"id":"packages/sftp-docs","title":"sftp@2.0.8","description":"getCSV(filePath, [parsingOptions])","sidebar":"adaptors"},"packages/sftp-readme":{"id":"packages/sftp-readme","title":"sftp developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/sftp","sidebar":"adaptors"},"packages/surveycto-changelog":{"id":"packages/surveycto-changelog","title":"surveycto changelog","description":"2.2.3","sidebar":"adaptors"},"packages/surveycto-configuration-schema":{"id":"packages/surveycto-configuration-schema","title":"Config for surveycto","description":"Jobs that use the surveycto adaptor may require authentication. A","sidebar":"adaptors"},"packages/surveycto-docs":{"id":"packages/surveycto-docs","title":"surveycto@2.2.3","description":"cursor(value, options)","sidebar":"adaptors"},"packages/surveycto-readme":{"id":"packages/surveycto-readme","title":"surveycto developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/surveycto","sidebar":"adaptors"},"packages/telerivet-changelog":{"id":"packages/telerivet-changelog","title":"telerivet changelog","description":"0.3.8","sidebar":"adaptors"},"packages/telerivet-configuration-schema":{"id":"packages/telerivet-configuration-schema","title":"Config for telerivet","description":"Jobs that use the telerivet adaptor may require authentication. A","sidebar":"adaptors"},"packages/telerivet-docs":{"id":"packages/telerivet-docs","title":"telerivet@0.3.8","description":"This adaptor exports the following from common:","sidebar":"adaptors"},"packages/telerivet-readme":{"id":"packages/telerivet-readme","title":"telerivet developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/telerivet","sidebar":"adaptors"},"packages/testing-changelog":{"id":"packages/testing-changelog","title":"testing changelog","description":"1.0.10","sidebar":"adaptors"},"packages/testing-configuration-schema":{"id":"packages/testing-configuration-schema","title":"Config for testing","description":"Jobs that use the testing adaptor may require authentication. A","sidebar":"adaptors"},"packages/testing-docs":{"id":"packages/testing-docs","title":"testing@1.0.10","description":"This adaptor exports the following from common:","sidebar":"adaptors"},"packages/testing-readme":{"id":"packages/testing-readme","title":"testing developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/testing","sidebar":"adaptors"},"packages/twilio-changelog":{"id":"packages/twilio-changelog","title":"twilio changelog","description":"0.5.2","sidebar":"adaptors"},"packages/twilio-configuration-schema":{"id":"packages/twilio-configuration-schema","title":"Config for twilio","description":"Jobs that use the twilio adaptor may require authentication. A","sidebar":"adaptors"},"packages/twilio-docs":{"id":"packages/twilio-docs","title":"twilio@0.5.2","description":"sendSMS(params)","sidebar":"adaptors"},"packages/twilio-readme":{"id":"packages/twilio-readme","title":"twilio developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/twilio","sidebar":"adaptors"},"packages/vtiger-changelog":{"id":"packages/vtiger-changelog","title":"vtiger changelog","description":"1.3.10","sidebar":"adaptors"},"packages/vtiger-configuration-schema":{"id":"packages/vtiger-configuration-schema","title":"Config for vtiger","description":"Jobs that use the vtiger adaptor may require authentication. A","sidebar":"adaptors"},"packages/vtiger-docs":{"id":"packages/vtiger-docs","title":"vtiger@1.3.10","description":"This adaptor exports the following from common:","sidebar":"adaptors"},"packages/vtiger-readme":{"id":"packages/vtiger-readme","title":"vtiger developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/vtiger","sidebar":"adaptors"},"packages/wigal-sms-changelog":{"id":"packages/wigal-sms-changelog","title":"wigal-sms changelog","description":"0.1.3","sidebar":"adaptors"},"packages/wigal-sms-configuration-schema":{"id":"packages/wigal-sms-configuration-schema","title":"Config for wigal-sms","description":"Jobs that use the wigal-sms adaptor may require authentication. A","sidebar":"adaptors"},"packages/wigal-sms-docs":{"id":"packages/wigal-sms-docs","title":"wigal-sms@0.1.3","description":"sendSms(data)","sidebar":"adaptors"},"packages/wigal-sms-readme":{"id":"packages/wigal-sms-readme","title":"wigal-sms developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/wigal-sms","sidebar":"adaptors"},"packages/zoho-changelog":{"id":"packages/zoho-changelog","title":"zoho changelog","description":"0.4.9","sidebar":"adaptors"},"packages/zoho-configuration-schema":{"id":"packages/zoho-configuration-schema","title":"Config for zoho","description":"Jobs that use the zoho adaptor may require authentication. A","sidebar":"adaptors"},"packages/zoho-docs":{"id":"packages/zoho-docs","title":"zoho@0.4.9","description":"This adaptor exports the following from common:","sidebar":"adaptors"},"packages/zoho-readme":{"id":"packages/zoho-readme","title":"zoho developer readme","description":"Source//github.com/OpenFn/adaptors/tree/main/packages/zoho","sidebar":"adaptors"},"postgresql":{"id":"postgresql","title":"PostgreSQL","description":"Overview","sidebar":"adaptors"},"powerbi":{"id":"powerbi","title":"Power BI","description":"(Work in progress)","sidebar":"adaptors"},"primero":{"id":"primero","title":"Primero","description":"Overview","sidebar":"adaptors"},"rapidpro":{"id":"rapidpro","title":"RapidPro Adaptor","description":"About RapidPro","sidebar":"adaptors"},"salesforce":{"id":"salesforce","title":"Salesforce","description":"App Overview","sidebar":"adaptors"},"satusehat":{"id":"satusehat","title":"Satusehat Adaptor","description":"About Satusehat","sidebar":"adaptors"},"sftp":{"id":"sftp","title":"SFTP Adaptor","description":"About SFTP","sidebar":"adaptors"},"surveycto":{"id":"surveycto","title":"SurveyCTO","description":"App Overview","sidebar":"adaptors"},"tableau":{"id":"tableau","title":"Tableau","description":"(Work in progress)","sidebar":"adaptors"}}}')}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.20cc3d5a.js b/assets/js/runtime~main.21fc3b25.js similarity index 98% rename from assets/js/runtime~main.20cc3d5a.js rename to assets/js/runtime~main.21fc3b25.js index 48e04cf29bc7..3559cc36d61d 100644 --- a/assets/js/runtime~main.20cc3d5a.js +++ b/assets/js/runtime~main.21fc3b25.js @@ -1 +1 @@ -(()=>{"use strict";var e,f,a,c,b,d={},r={};function t(e){var f=r[e];if(void 0!==f)return f.exports;var a=r[e]={id:e,loaded:!1,exports:{}};return d[e].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}t.m=d,t.c=r,e=[],t.O=(f,a,c,b)=>{if(!a){var d=1/0;for(n=0;n=b)&&Object.keys(t.O).every((e=>t.O[e](a[o])))?a.splice(o--,1):(r=!1,b0&&e[n-1][2]>b;n--)e[n]=e[n-1];e[n]=[a,c,b]},t.n=e=>{var f=e&&e.__esModule?()=>e.default:()=>e;return t.d(f,{a:f}),f},a=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,t.t=function(e,c){if(1&c&&(e=this(e)),8&c)return e;if("object"==typeof e&&e){if(4&c&&e.__esModule)return e;if(16&c&&"function"==typeof e.then)return e}var b=Object.create(null);t.r(b);var d={};f=f||[null,a({}),a([]),a(a)];for(var r=2&c&&e;"object"==typeof r&&!~f.indexOf(r);r=a(r))Object.getOwnPropertyNames(r).forEach((f=>d[f]=()=>e[f]));return d.default=()=>e,t.d(b,d),b},t.d=(e,f)=>{for(var a in f)t.o(f,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:f[a]})},t.f={},t.e=e=>Promise.all(Object.keys(t.f).reduce(((f,a)=>(t.f[a](e,f),f)),[])),t.u=e=>"assets/js/"+({182:"d1e2a1e4",185:"56b2a431",414:"6af54863",535:"5153790b",1100:"fec351f2",1102:"1ef0096b",1212:"734563d5",1281:"dc62dd6c",1356:"e967512d",1372:"e480871d",1427:"cb9e1ec6",1511:"b1be30d1",1705:"cd8c9fbc",1905:"9d4548fb",2280:"e51254c6",2782:"0e04b402",2928:"125cb29e",2959:"33fb6ca4",3181:"a9d16e82",3296:"a555a233",3336:"f98b80b4",3392:"reactPlayerVidyard",3430:"cee49d1f",3663:"def6dfb9",3704:"d9a6c9f9",3778:"87024a1a",3970:"133b4df0",4501:"8dc27084",4669:"c599f569",4711:"81e594d4",5452:"530f6d6e",5661:"5d42a18a",5731:"5610898c",5843:"e6102057",5931:"998a3ebe",5933:"fe66a3bc",6014:"babb54f3",6308:"af1b4014",6379:"cd910537",6463:"reactPlayerKaltura",6615:"e3a6d1ec",6914:"2c828998",6947:"898d2911",7031:"ffa0c411",7284:"0918a7cd",7408:"b31fa192",7658:"bb8cf488",7684:"193bf152",7727:"92e661e4",8041:"d44f5d69",8063:"ea0d3e91",8132:"c4429c79",8209:"01a85c17",8275:"e2548c92",8364:"a1c67955",8580:"f7d07906",8945:"4ba520f6",9246:"9bb632fa",9455:"6e9a1c5f",9531:"8bc1d424",9604:"3035a8de",10037:"14ee1fe9",10211:"524c9166",10278:"5385774b",10390:"7356945f",10543:"cd9d51a3",10588:"f93f95da",10711:"85f847a7",10909:"60ab92b2",11084:"75270caf",11133:"a20e070a",11145:"069eb5a6",11430:"0564f87a",11662:"2bf9c0b5",11681:"74ea6b63",11840:"5fb0ec3e",11841:"fe1d477d",11845:"da184dc1",12042:"reactPlayerTwitch",12095:"9e96f049",12236:"f50ed874",12287:"acfb9a5e",12384:"22ef07eb",12417:"c6fe0741",12693:"c333ed9f",12865:"3f2ad086",12893:"e4a50065",13131:"90cc8a3a",13278:"a2e81b6d",13298:"504718d6",13388:"5f6910fd",13446:"d015beca",13657:"05c152cc",13708:"09b23959",13755:"a3efb982",13949:"eb4eb408",14167:"aacecf0a",14340:"2dcd28d2",14382:"5f87d652",14690:"44ea6f94",14712:"db759789",14833:"46bd2088",15045:"14ad7d65",15407:"9f1f88f2",15476:"14709bd0",15478:"5b2fe656",15548:"247783bb",15913:"ec383e18",16055:"7b9ab678",16145:"58cbfb5a",16328:"reactPlayerDailyMotion",16458:"a14a2602",16476:"3a03215d",16677:"3826cb97",16680:"2bb14bf0",16808:"1ebe758b",17051:"6738a51a",17150:"6cb21577",17357:"1140a058",17363:"6310fd48",17434:"9e1f7384",17464:"7fdc0c84",17572:"3947b16e",17794:"f5ff4ddf",18042:"36ded102",18401:"17896441",18446:"reactPlayerYouTube",18583:"60b808f2",18756:"1ee9c635",19290:"9afa6cde",19520:"f2ca2c55",19672:"203262b0",19702:"8f8e3a33",19724:"b1f7255a",19782:"95348a14",19873:"aa1b4e53",20041:"81c93763",20097:"e7b8679f",20118:"90377122",20212:"5f16d91a",20341:"11e6d144",20363:"63eaaafc",20420:"e2c3bc5f",20446:"5e1dea11",20562:"853ddb5d",20574:"126d2d8d",20774:"fc5ff77a",21058:"ea369cdd",21157:"abb76970",21300:"2e5976f3",21528:"6556faa5",22362:"5e95c167",22598:"1f86786a",22708:"8d1ec4c5",22805:"e310b146",22869:"374427da",22874:"d8d13bad",23060:"7a801707",23475:"0a6f29e5",23476:"239ea6cd",23558:"68cedfd5",23597:"1a848321",23673:"5f1113d5",23717:"3a06bd86",24029:"11451be3",24066:"2f4b7a65",24165:"07e96687",24285:"507e1a4c",24406:"28092509",24490:"06b1e92d",24613:"c5d1867d",24724:"823f7700",24785:"853164ef",24880:"20f8de15",24981:"db6367fb",24998:"dfd4abb8",25275:"cb128a98",25474:"4aa43dae",25596:"122cd6da",25789:"ef4e0518",25908:"9ee43f4e",25948:"febd0338",26173:"reactPlayerVimeo",26529:"30ddeb5e",26933:"89594773",27098:"3874af3e",27431:"0a61bc2e",27570:"070789e7",27572:"207ee67a",27721:"c0daf1e6",28089:"5b18cf50",28109:"e0c8a1d6",28125:"9da1bb58",28505:"d879ea04",28968:"59b068d1",29214:"f3954950",29263:"36a143db",29286:"20a7d97c",29632:"7ee80f24",29664:"60a00565",29891:"45b3f811",30044:"e1d93203",30556:"bced66ab",30650:"d6bd25e1",31136:"960d9980",31472:"fa811662",31586:"8e97cc15",31805:"5e450bcf",31863:"caaf01d4",31883:"421999d2",32349:"a1b695db",32450:"c302b7f6",32452:"bd83a8c8",32498:"0c947b8b",32734:"5417e0ef",32736:"3bc428dc",32840:"3cf47477",32909:"c6cf652c",32946:"4aaa0f44",32976:"b7523662",33015:"5575e2a8",33188:"bfb1735a",33656:"31d20e13",34037:"f6525c87",34149:"b69843a1",34270:"cc826739",34290:"a6a264d3",34446:"b1212599",34465:"fcdeb347",34483:"b5efef1d",34533:"d6247adb",34720:"0452e1bb",34857:"c091e626",35491:"a7ce3f25",35510:"82337808",35575:"76175211",35580:"d4c834e8",35632:"dff30c03",35635:"ecfe8209",35739:"f2f7c8b6",36138:"bebb13e1",36192:"85c49f6d",36353:"reactPlayerPreview",36480:"2ae30a74",36496:"12ebab0f",36659:"e0ecd9df",36732:"3cc638e0",36904:"ffecbc46",36949:"ab0b43f0",37068:"4ef2e3ea",37109:"8ee77415",37119:"bd6858b9",37146:"22885a83",37507:"e4608243",37510:"38743361",37555:"e202e776",37643:"a6aa9e1f",37762:"89f741ca",37878:"845a8f5b",37943:"512d8cfa",38012:"274548c6",38368:"b3022338",38389:"50711b5c",38440:"27e17dc0",38456:"c4643d70",38588:"f9dcbd56",38991:"2db499ae",38992:"903c4f6f",39311:"b85e9339",39646:"c7bf2a3a",39928:"9b770ac0",39954:"8f102ef9",40069:"70b40441",40200:"d40361ad",40810:"0475f9cc",40817:"c0908e63",40953:"5b5d0fd6",40960:"bd8e6ec6",41015:"eec2ee36",41288:"1a472eda",41738:"28411ba4",41811:"e7db057b",41838:"d98b9f83",41857:"37c880e2",42007:"4b75119c",42068:"9997aecf",42518:"c968f1a3",42795:"cc8c6322",42919:"09a69b27",43067:"1e5c0d86",43318:"554f4bd3",43478:"3f85e7e0",43506:"98e407cc",43514:"dc72610b",43895:"073713d1",44416:"8ee24aa1",44502:"069211c5",44552:"f4aab56f",44596:"8256726e",45197:"6f69b847",45501:"da6f85e6",45612:"62b71d38",45747:"1ddde2c7",45894:"61428574",45966:"5426ac11",46050:"0d3bf974",46084:"e5e83212",46105:"7778b814",46244:"771488fd",46666:"c08d79e7",46708:"32723a2e",46878:"56d56511",46930:"f81f234c",46985:"fcfb247d",46995:"c831614b",47627:"reactPlayerStreamable",47826:"eda7f530",47946:"e3450ac4",48035:"708cde07",48061:"009142c3",48131:"4cff7ce2",48155:"ced1473c",48402:"097f4186",48543:"34bbb05d",48612:"cce9ad1c",48721:"1074bb26",48806:"479e2d15",48965:"6d0c6131",49183:"256aaf6c",49195:"1a98f2d5",49440:"f30a3d1e",49456:"cf342098",49534:"d2227473",49724:"a9bffa51",49942:"bae79ca1",49945:"459956dd",50074:"5dfb628f",50213:"2158648d",50370:"1d48afb9",50685:"c2367e06",50739:"aa9c90f7",50816:"b198cec2",51093:"2f48bebc",51341:"fb73061a",51725:"890759ea",52074:"33844ff3",52165:"94c68899",52634:"c4f5d8e4",52711:"9e4087bc",52723:"reactPlayerMux",52761:"28a6a789",53434:"90d535c2",53440:"5efe417b",53446:"1bf956b0",54374:"bab68f7e",54422:"ec576a8b",54708:"2f989304",54785:"3c41cfdf",54829:"444d5ed4",54880:"1e26ddab",54986:"6a3a4a87",55580:"665c23b8",55603:"7d5cf9fd",55621:"d5e8cc91",55662:"bc4d6fc9",55673:"9d36e504",55939:"2e7fdd6f",56188:"a12f1ef9",56444:"f76e6047",56683:"82453b48",56787:"c2d7f837",56918:"10eaf6bf",57436:"c85c4b26",57532:"8e0ad159",58236:"55ac83aa",58290:"e4f4dec4",58319:"45a8dc52",58382:"3e1cef53",58424:"6bf3b56c",58475:"bba051af",58564:"bc3fdc28",58581:"b3198ac5",58700:"6fa39f86",59154:"6a6b8e69",59289:"eae3fa10",59569:"10915d97",59612:"c3c79e6c",59644:"677d6777",59783:"450c527f",59919:"b973dcfd",60383:"2fd22369",60439:"acf97486",60473:"c1a814bd",60830:"9915a91d",61153:"08e43170",61316:"92bdb8f4",61321:"d3b3aab8",61377:"7a8aa347",61517:"5c7af219",61556:"39e9cb37",61611:"a6748c3f",61806:"3d5c28b0",61990:"f13ea377",62071:"1af9c7d3",62138:"1a4e3797",62224:"cce23dfc",62318:"24a5cb68",62590:"6ee59393",62630:"271f7228",62684:"f615a51d",62864:"60194cf2",62959:"3685f909",63267:"2127c55a",63380:"4f989fdc",63493:"608d3bbe",63720:"291e387f",63761:"500fb0e6",63817:"ede583c5",63924:"fe36bf36",63993:"cfc8229c",64078:"aea1a378",64293:"b0055554",64455:"861bd1f8",64534:"7d8e4827",64542:"97bb0f58",64678:"99d25280",64922:"e19908fc",64972:"d5bc6e48",65250:"6479f562",65527:"e1d5ae70",65541:"f5d5b73d",65664:"12f94a3a",65856:"15d749b5",66227:"8977ff65",66248:"4549cb79",66290:"0018b769",66351:"25eb6242",66352:"89c724a9",66435:"34298da9",66455:"964386c1",66578:"342f32a4",66703:"5644a66f",66769:"623b8140",66814:"8660c4b6",66939:"4f8f7d74",67496:"f02ecc75",67570:"reactPlayerMixcloud",67796:"afbc2852",67882:"8d6bb331",68063:"e2c66a78",68074:"13a2a5ae",68371:"29bb06c8",68495:"747a690f",68670:"b6379448",68749:"c2be96f9",68795:"b083e7a6",68831:"7f2f79c2",68951:"1ff7f4b8",69445:"6de65b44",69693:"1385f2e4",69738:"acd02317",69979:"reactPlayerSoundCloud",69987:"dbbfaad4",70001:"723d2f26",70092:"afd0cb1b",70612:"4980c4fa",70804:"03cd8e1c",70806:"ef9227ec",71317:"6d30ac0a",71333:"94b64e1c",71494:"4224ef00",71500:"1e9ef283",71623:"83cfd970",71659:"f2b4d23e",71753:"57fbf2bd",71760:"0d1eeea0",71886:"0f427d40",72211:"30995fb4",72482:"5ffd6909",72637:"b37711b1",72700:"869c9c27",72795:"4bff3e73",72825:"31b72ec5",72844:"dd13b434",72920:"a22153eb",72969:"385718d4",73156:"7e968a29",73309:"9206c4f6",73715:"c1a5f9af",73718:"fb5b11b0",73765:"5bcd0da1",73936:"7f6bbd73",74030:"47dbeff7",74067:"191ccfef",74276:"fd5d515c",74307:"8b77e1a5",74391:"352bf367",74661:"c942fcda",74944:"006fd865",75055:"c3a5a911",75120:"f77d5673",75132:"4256eaf4",76023:"cb759659",76073:"a5fe4d7b",76152:"78469ba2",76186:"901425d2",76206:"9da9a498",76777:"4649e1c2",76829:"8328e7f1",76903:"cabfe087",76939:"05e78500",77759:"e802237a",77800:"68987ad2",77849:"4b2ec4d2",78131:"3062d10d",78207:"f9ed4079",78417:"cc135780",78682:"916b8fda",78695:"051ebc95",78959:"f13d29f3",78997:"de387681",79234:"1954649e",79566:"b2b9b866",79709:"4a487c7d",79957:"f5fdaecd",79985:"d776f897",80096:"4a82f29c",80218:"bb40a730",80495:"ed48b979",80614:"73578edf",80665:"3124230e",80722:"fa9fb131",80771:"2e501212",80878:"c76eb7d5",81057:"f5466782",81084:"16aa9458",81202:"c3b63204",81271:"84810683",81397:"75d9ae63",81470:"199fcd36",81471:"02371d76",81678:"a7434565",81707:"4ef508e9",81784:"97feb4e9",81820:"31c4e4e2",81844:"bfbf9dff",81886:"9eb4e0db",81930:"8310c4f6",81948:"dc14f0c4",82214:"f64a2f66",82230:"2f06f2be",82277:"0b31129f",82402:"c275b7b1",82646:"4cbb880b",82925:"78b226dc",83071:"a817f8e6",83249:"ccc49370",83391:"7bfa07ad",83556:"7b81a468",84190:"1d01589c",84398:"1cd349ba",84482:"b71b77d7",84813:"6875c492",84877:"833f2ec0",85159:"4be7e5d0",85186:"5653e10f",85647:"bd7f6eb8",85732:"60f1bcf9",85864:"3d8bf3ab",86398:"0c6d1616",86537:"d9cb599e",86757:"326c0af7",86887:"reactPlayerFacebook",86963:"d523bad7",87118:"c541efc4",87733:"6aa8733e",87791:"cfba059f",88007:"d1c7c525",88021:"9bf3c520",88318:"b6997bf2",88462:"fca34444",88501:"d40de319",88572:"43f8b4ce",88714:"1be78505",88963:"f5f1347d",89588:"376ff700",89729:"c0f0637e",89737:"87d0342b",89831:"919ee986",89915:"f7c12f45",90776:"64ec14d2",90826:"cc6caa93",90866:"a7a00099",91045:"192eff61",91288:"6536e94a",92058:"8446e86b",92273:"65e8e75e",92282:"7cb85c78",92440:"3830e8bf",92648:"d88d25ac",92894:"370bc5de",93040:"60e9e07a",93133:"6680323d",93488:"b5bd7f9b",93639:"f3f3787d",93963:"8e40e0a9",94183:"54e91ab5",94248:"07987921",94328:"9c1835bf",94381:"26c54994",94395:"c98ac358",94617:"a9d6ad8a",95182:"92009f0a",95406:"d80cee7e",95638:"96ecf107",95919:"87a2f1fc",95924:"9f0412f1",96092:"bd16d6fd",96095:"f259cf74",96431:"dc819e53",96752:"f7f75c2e",96886:"a0799a2b",96998:"21b56577",97026:"285ad496",97061:"ea642db2",97202:"a9808524",97215:"80a6599d",97342:"ceb3f8e5",97450:"c260b9a0",97458:"reactPlayerFilePlayer",97543:"c5495231",97788:"38eccbde",97823:"2d52fc42",97902:"d0ac1c30",98196:"bcf9457e",98197:"2d68e16b",98230:"13c3e084",98581:"935f2afb",98632:"84c1f0c8",98952:"c1dc13d0",98982:"0f438a70",99017:"0a451647",99340:"reactPlayerWistia",99426:"d61e8580",99493:"4d27cb4d",99687:"5ad12221",99762:"a69ebe5f",99924:"c4816122",99965:"1280552c"}[e]||e)+"."+{182:"0b700572",185:"ada65323",414:"ee5fde64",535:"c1b6a2c2",1100:"d17a544d",1102:"df8651a8",1212:"5c7f0c40",1281:"beb2e8b7",1356:"b1f2ae06",1372:"afac1084",1427:"a0f60989",1468:"f679e342",1511:"968319a4",1705:"68cbc15a",1905:"eb073c85",2280:"5f787583",2782:"fc41a90a",2928:"249cc0f2",2959:"96e1a6c0",3181:"0b13f711",3296:"f106e1ad",3336:"d8c46893",3392:"090f5cb6",3430:"5bf153f1",3663:"fb3a8aa4",3704:"de6a3b67",3778:"d43c755a",3970:"426b97b4",4501:"7f8b5ca1",4669:"bc5ece4e",4711:"18790895",5452:"be750607",5661:"cb663b51",5731:"d86813b9",5843:"ea6fbf59",5931:"2f753b36",5933:"d3ce1ef1",6014:"280eb338",6308:"0371c308",6379:"320c80d6",6463:"600fc725",6615:"959436a5",6914:"db848b6a",6947:"e239b458",7031:"fcec0565",7284:"1cbb865d",7408:"b27b86a0",7658:"566bc905",7684:"c3c3a068",7727:"8f5a6fc2",7996:"d3ea57ae",8041:"88220dec",8063:"ae462a39",8132:"9b5f7c95",8209:"78a1e894",8275:"ea58a23c",8364:"3de6436f",8580:"0e33ef3c",8945:"4806a4d1",9246:"e16b150b",9455:"b53c8935",9462:"ed135407",9531:"94bf9a7b",9604:"56339883",10037:"b52c4990",10211:"fd03a0c0",10278:"3d3d8e45",10390:"bed52d1a",10543:"0802c995",10588:"0701f71e",10711:"4009d048",10909:"67d6828f",11084:"5888a519",11133:"77eae211",11145:"aa1e2bc6",11430:"01352692",11662:"f046426e",11681:"ab1994e7",11840:"fc6c490a",11841:"8c44669d",11845:"e026f204",12042:"40a52000",12095:"fe86f6d0",12236:"7601beeb",12287:"6b46bf75",12384:"0b2264aa",12417:"f6b99e2c",12693:"b80e1610",12865:"428fc5c7",12893:"a65aefe2",13131:"838cfbdc",13278:"13b2a1c6",13298:"65b7505b",13388:"f6781097",13446:"7fc32915",13554:"8de4bc13",13657:"916b2f49",13708:"1fcb96a2",13755:"72a8ec76",13949:"7de635ae",14167:"eda1f048",14340:"c2e44155",14382:"a6804168",14690:"9fa7696a",14712:"a9de602d",14833:"c08040e2",15045:"49f743d5",15407:"b7eeb30b",15476:"9a110be1",15478:"a58e0687",15548:"e6e9b142",15913:"f9bdb200",16055:"14b10527",16145:"76ff302b",16328:"ace8180a",16458:"b9057219",16476:"2467b336",16677:"d3c4dde8",16680:"2a816570",16808:"47f2b07e",17051:"b63b3f75",17150:"75bb2961",17357:"b87705c1",17363:"e2f3525a",17434:"83a32858",17464:"7812b09f",17572:"0e70974c",17794:"a7dc3b22",18042:"ae379aee",18401:"09ef5d0b",18446:"c190a89e",18583:"6a786408",18756:"9caa1f28",19290:"68e5b2cf",19520:"8f20efe5",19672:"71ae5d57",19702:"c8619971",19724:"bc6f4b20",19782:"0c381dd0",19873:"13e39441",20041:"016016b2",20097:"37e09a85",20118:"1b1f67b0",20212:"bcd3ef4b",20341:"39e9fbd3",20363:"5d212773",20420:"bb8588cc",20446:"e5a6a5b0",20562:"63166999",20574:"a848397f",20774:"61e0df28",21058:"8012b015",21157:"27af1036",21300:"44e728ae",21528:"be9c6b61",22362:"9a0e9f9a",22598:"5b89e810",22708:"bd55640b",22805:"152b8c81",22869:"1d7b6624",22874:"3f758048",23060:"1ea17c38",23475:"febbdbe8",23476:"152acddc",23558:"f2b10d23",23597:"0b1138ce",23673:"00c61f3d",23717:"e082fa62",24029:"d26dd771",24066:"83b35c1a",24165:"7c55ae5b",24285:"1c8fdf7f",24406:"da13930a",24490:"3e590d51",24613:"1fea4ebd",24724:"14c8490e",24785:"a1efa451",24880:"b5196068",24981:"3f1d4f26",24998:"548b6ad5",25275:"f23efe47",25474:"10b1d6f3",25596:"f4af5570",25789:"dc3a6ded",25908:"4e250dcf",25948:"8645d680",26173:"9f478156",26529:"7d07ce63",26933:"d30ca425",27098:"d027fdb9",27431:"d43a197b",27570:"e5d48ccd",27572:"a51a0ed8",27721:"69343b82",28089:"986361b3",28109:"2196ae74",28125:"b0462c2f",28505:"405077cc",28968:"bf2c88db",29214:"c89a0975",29263:"330945ac",29286:"48d0f148",29632:"b894c373",29664:"54c248d2",29891:"fcf56b73",30044:"900e44df",30556:"5c591300",30650:"bcddaf59",31136:"87f98d83",31472:"73831806",31586:"883aca9c",31805:"28e73fec",31863:"b4c9b668",31883:"f5f387b6",32349:"cfd6d2bd",32450:"f8b5177a",32452:"67edf930",32498:"9f04323b",32734:"c34cddd9",32736:"62e7e9f1",32840:"65d70be2",32909:"f517fcc0",32946:"71c1f881",32976:"e626b416",33015:"cba5bdce",33188:"d4f06d9d",33656:"7cefb728",34037:"ffb62ba0",34149:"e8908e28",34270:"7e516213",34290:"5f9d84bb",34446:"2079f13d",34465:"775c9259",34483:"17a766a6",34533:"51e4e2f0",34720:"853bbaf1",34857:"b8c961f7",35491:"28b24450",35510:"513de1fd",35575:"a90aa3b6",35580:"7b743866",35632:"07156903",35635:"76aeee8b",35739:"d1bef04c",36138:"b6991b6e",36192:"478676d1",36353:"8391fcd4",36480:"d822268d",36496:"0055ece0",36659:"492e09c8",36732:"5d47f1ee",36904:"a7c98595",36949:"920de44c",37068:"39844a38",37109:"fb359b6e",37119:"9bc1f8e6",37146:"653d480e",37507:"694c9141",37510:"7a7a111d",37555:"129cfc78",37643:"8e023d46",37762:"cca92fc3",37878:"d2f56ed9",37943:"e0ef4754",38012:"72d977ed",38368:"c3b3faf9",38389:"2ce3483c",38440:"501913ea",38456:"621a7950",38588:"c25d28a7",38991:"bcd10c38",38992:"7c26fead",39311:"aad4b13d",39646:"c40bc534",39928:"80665e85",39954:"9daccfff",40069:"7ed52e05",40200:"a0ac1446",40810:"061c37d4",40817:"a7596d33",40953:"7e11a802",40960:"85047d36",41015:"b3596dfe",41288:"934e7faa",41738:"70016ec5",41811:"f5879823",41838:"c78e3d82",41857:"68880f11",42007:"cb317052",42068:"5b090c02",42518:"86a08b41",42795:"4d366836",42919:"31b11c0a",43067:"a61ef09b",43318:"bf48cdb9",43478:"68b3dcfb",43506:"fcf5e35c",43514:"7eb0583f",43895:"68160b04",44416:"e9a9fe90",44502:"1d4ae577",44552:"bbed02cc",44596:"a6d39f88",44839:"9ce9935a",45197:"3ec21f78",45501:"3556c6bd",45612:"37d3537a",45747:"09f47874",45894:"06047c8c",45966:"53075fe5",46050:"00c13a67",46084:"1c4682ef",46105:"71fdae27",46244:"d85bd7fd",46666:"a0bcfb0b",46708:"4dc9772f",46878:"b509f7f7",46930:"b5d0c65f",46985:"a8cfbd6f",46995:"91c5de14",47113:"65880b18",47627:"61fd1f01",47826:"eedca7e3",47946:"89bf6a7b",48035:"e67de98d",48061:"bfb6a2e5",48131:"75035205",48155:"ea384a7b",48402:"b676ed59",48543:"19308aea",48612:"23f2d930",48721:"9f5ee2c4",48806:"bd148f5a",48965:"eb3d14fa",49183:"571afa4e",49195:"d2b9ed36",49440:"0721c498",49456:"7667330f",49534:"3369fb09",49724:"34fc7746",49942:"4cae2a11",49945:"b7753dbd",50074:"694e6646",50213:"a5a4fea6",50370:"e8e09d25",50685:"90c425f7",50739:"7212b433",50816:"d27e472e",51093:"171f5f14",51341:"41a43636",51725:"b3b484c8",52074:"9cdf105b",52165:"01e7b340",52634:"c1a2556f",52711:"d34e3f47",52723:"303ed67a",52761:"ea708a59",53434:"69463ac1",53440:"ffbc7a5c",53446:"1d1ebe65",54374:"3d98ba7f",54422:"a91b7973",54708:"da2c9c90",54785:"7ca9e7d9",54829:"b0b8141b",54880:"a18ee39e",54986:"c6725001",55580:"d5137a2f",55603:"2c5aa5fb",55621:"3f9a5c5f",55662:"0637450d",55673:"ce2531b3",55939:"2b5ab75a",56188:"454cb07b",56444:"8fdf39e0",56683:"47111ae5",56787:"f53a9c77",56918:"c9463b4b",57436:"adac6207",57532:"a359b0fd",58236:"a8d3be3b",58290:"88af57aa",58319:"ac13a8de",58382:"aaf21fad",58424:"c78f2ff2",58475:"5c619dbb",58564:"03424844",58581:"b9907956",58700:"bbdcba74",58913:"ad6fc8d2",59154:"8ccd37ed",59289:"31da36c5",59569:"2539b54e",59612:"b7c57060",59644:"7f762924",59783:"d72a4a2c",59919:"a70acaca",60383:"d5723a92",60439:"0fb59c60",60473:"bfa3c720",60830:"22590b94",61153:"cfb80aad",61316:"9865a851",61321:"ea3eafd1",61377:"48db1f76",61517:"f4f7271e",61556:"c78122d0",61611:"e718cd36",61806:"96422c96",61990:"0a3e34ef",62071:"be28dd60",62138:"4fc12286",62224:"eae39005",62318:"4803301d",62590:"6d68c8f8",62630:"5af768c2",62684:"4d2cb99d",62864:"7a9d7aaa",62959:"2b6e92c3",63267:"6a0d5507",63380:"79a4373a",63493:"6275ef97",63720:"70f50862",63761:"cb37fc49",63817:"33aa1df6",63924:"3c1c8eb2",63993:"5e24dc5b",64078:"6f8b52e8",64293:"002f5ba8",64455:"7b73a381",64534:"b6acaf66",64542:"7bbc5a42",64678:"5502d8aa",64922:"b6a9c9a2",64972:"2b5579a6",65250:"0ec5845a",65527:"339745ae",65541:"84de84ff",65664:"0e35d982",65856:"918827ad",66227:"28932fc0",66248:"b738dbdd",66290:"d49802c3",66351:"e90c46f5",66352:"631b03f2",66435:"dded8441",66455:"75cdc19b",66578:"f55f5147",66703:"17fd2573",66769:"7b9421b1",66814:"494afa23",66939:"82200580",67496:"d2c8d87f",67570:"4ce54898",67796:"a00adc38",67882:"83407aa9",68063:"254796f8",68074:"45d44976",68371:"c5024786",68495:"af9c659d",68670:"a8fd2c4c",68749:"32739393",68795:"19d1051f",68831:"f2b75a8e",68951:"b530ac8f",69445:"5691666d",69693:"b555b1f7",69738:"47aeefea",69979:"0b5349be",69987:"ae3d4421",70001:"da92a905",70092:"ee6cd0ab",70612:"6d32dad4",70804:"025e7aca",70806:"b5d96fe8",71317:"ec407eb8",71333:"ee41a11d",71494:"6430cd01",71500:"65367a96",71623:"d8d8ee9f",71659:"b2622aa0",71753:"f816f9c0",71760:"0fa0856d",71866:"6f58dc76",71886:"bc09dd50",72211:"fae06709",72482:"36cbd19d",72637:"ebdb0ccb",72700:"e34c3be7",72795:"a1b7b87c",72825:"ba2dfc97",72844:"d5587f71",72920:"90acf23b",72969:"f9a198b0",73156:"48f79e19",73309:"76a1e060",73715:"ed7c4a72",73718:"cee23dbc",73765:"04a6bcc0",73936:"7b557567",74030:"8da934db",74067:"17abe7e8",74276:"adf39695",74307:"3983a3ff",74391:"f7c9192f",74661:"eaa43db6",74944:"7d683ad2",75055:"9848b7da",75120:"6b9380f4",75132:"08ca476f",76023:"ed14281b",76073:"23dd006f",76152:"199b2ad0",76186:"f7bba5b1",76206:"8c6fdd84",76777:"eee3eed7",76829:"651b9c7e",76903:"c8dcb15b",76939:"0e253952",77759:"e6459ef7",77800:"2ecf1b78",77849:"fb9ad6b4",78131:"bf90d51e",78207:"1c55526c",78417:"229c70ff",78682:"afe73a87",78695:"aa2c560e",78959:"28282f8c",78997:"d130b4b6",79234:"87b75812",79566:"33ed3463",79709:"bdbb5ac0",79957:"ac52bf16",79985:"fe7f033e",80096:"b533a18d",80218:"97f50a58",80495:"712fd7c1",80614:"ca68902f",80665:"0ae1c229",80722:"8aefd0fe",80771:"9be34a80",80878:"511a50c4",81057:"5762965a",81084:"db7e93e0",81202:"4d39c9ca",81271:"83498f64",81397:"5f111be5",81470:"891008c7",81471:"90350247",81678:"a16fd3c0",81707:"bec09aac",81784:"38ebf00f",81820:"adbfa883",81844:"3c03d2af",81886:"9442f2fb",81930:"4611a56c",81948:"05a3a5dc",82214:"1c069500",82230:"50a899ba",82277:"294672c7",82402:"7644e779",82646:"96e2f9c7",82925:"82fd2365",83071:"92bc7783",83249:"ae142aec",83391:"6317a6d1",83556:"12aaf92a",84190:"acfc0816",84398:"ac65f829",84482:"036a3677",84813:"92b08a79",84877:"878585c9",85159:"d777a50f",85186:"9211d9ef",85647:"c8814749",85732:"479ee02a",85864:"8e07301a",86398:"cf39cb54",86537:"4847b0d7",86757:"8558f5f6",86887:"9c552f79",86963:"2d7e53b1",87118:"0c8e8700",87733:"0650cf69",87791:"2f61c6dd",88007:"089421a7",88021:"b780e14d",88318:"8b318a2f",88462:"4775e794",88501:"ce0052bd",88572:"9ef5a9ac",88714:"4a261334",88963:"60c4d987",89588:"dafadf7b",89729:"42e3cecf",89737:"221b96aa",89831:"2f10e678",89915:"7c367d61",90329:"097040f5",90416:"ba76a62b",90776:"3f8963d1",90826:"65475832",90866:"eea880e3",91045:"ab2a1b77",91288:"6e5dd106",92058:"20a1c1fd",92273:"02ef889c",92282:"a1e9b3c3",92440:"1e097ebe",92648:"8f4ff553",92894:"745b45bc",93040:"dc33c940",93133:"10e86767",93488:"b9b88839",93639:"5a61d02f",93963:"d7176885",94183:"3605368c",94248:"4592e5cb",94328:"9eea0742",94381:"fb078950",94395:"0b668ca9",94617:"adb09b70",95182:"c8dc5f51",95406:"d053099d",95638:"85d617da",95919:"a96189a6",95924:"0e4a38a2",96092:"8ad9b59b",96095:"76c37447",96431:"f744cccd",96752:"a56226a7",96886:"ec0521ad",96998:"59d07b35",97026:"01d209f6",97061:"51307200",97202:"5ea55056",97215:"9fb5a9d9",97342:"c308da85",97450:"b2dff9e4",97458:"8795f2db",97543:"bad94ef7",97788:"c76099ee",97823:"b678434f",97902:"97ca5b7e",98055:"131b4810",98196:"143d8e20",98197:"c51cf587",98230:"7bda2e41",98581:"d71e2b6c",98632:"950740b9",98952:"6c583f50",98982:"3ee1b77e",99017:"f4e480a8",99340:"101b7b13",99426:"c9334111",99493:"04843dd0",99687:"4555de3a",99740:"9355cb55",99762:"ffbd4711",99831:"8f1df9f6",99924:"776187ce",99965:"358b28d0"}[e]+".js",t.miniCssF=e=>{},t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),t.o=(e,f)=>Object.prototype.hasOwnProperty.call(e,f),c={},b="@openfn/docs:",t.l=(e,f,a,d)=>{if(c[e])c[e].push(f);else{var r,o;if(void 0!==a)for(var l=document.getElementsByTagName("script"),n=0;n{r.onerror=r.onload=null,clearTimeout(s);var b=c[e];if(delete c[e],r.parentNode&&r.parentNode.removeChild(r),b&&b.forEach((e=>e(a))),f)return f(a)},s=setTimeout(u.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=u.bind(null,r.onerror),r.onload=u.bind(null,r.onload),o&&document.head.appendChild(r)}},t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.p="/",t.gca=function(e){return e={17896441:"18401",28092509:"24406",38743361:"37510",61428574:"45894",76175211:"35575",82337808:"35510",84810683:"81271",89594773:"26933",90377122:"20118",d1e2a1e4:"182","56b2a431":"185","6af54863":"414","5153790b":"535",fec351f2:"1100","1ef0096b":"1102","734563d5":"1212",dc62dd6c:"1281",e967512d:"1356",e480871d:"1372",cb9e1ec6:"1427",b1be30d1:"1511",cd8c9fbc:"1705","9d4548fb":"1905",e51254c6:"2280","0e04b402":"2782","125cb29e":"2928","33fb6ca4":"2959",a9d16e82:"3181",a555a233:"3296",f98b80b4:"3336",reactPlayerVidyard:"3392",cee49d1f:"3430",def6dfb9:"3663",d9a6c9f9:"3704","87024a1a":"3778","133b4df0":"3970","8dc27084":"4501",c599f569:"4669","81e594d4":"4711","530f6d6e":"5452","5d42a18a":"5661","5610898c":"5731",e6102057:"5843","998a3ebe":"5931",fe66a3bc:"5933",babb54f3:"6014",af1b4014:"6308",cd910537:"6379",reactPlayerKaltura:"6463",e3a6d1ec:"6615","2c828998":"6914","898d2911":"6947",ffa0c411:"7031","0918a7cd":"7284",b31fa192:"7408",bb8cf488:"7658","193bf152":"7684","92e661e4":"7727",d44f5d69:"8041",ea0d3e91:"8063",c4429c79:"8132","01a85c17":"8209",e2548c92:"8275",a1c67955:"8364",f7d07906:"8580","4ba520f6":"8945","9bb632fa":"9246","6e9a1c5f":"9455","8bc1d424":"9531","3035a8de":"9604","14ee1fe9":"10037","524c9166":"10211","5385774b":"10278","7356945f":"10390",cd9d51a3:"10543",f93f95da:"10588","85f847a7":"10711","60ab92b2":"10909","75270caf":"11084",a20e070a:"11133","069eb5a6":"11145","0564f87a":"11430","2bf9c0b5":"11662","74ea6b63":"11681","5fb0ec3e":"11840",fe1d477d:"11841",da184dc1:"11845",reactPlayerTwitch:"12042","9e96f049":"12095",f50ed874:"12236",acfb9a5e:"12287","22ef07eb":"12384",c6fe0741:"12417",c333ed9f:"12693","3f2ad086":"12865",e4a50065:"12893","90cc8a3a":"13131",a2e81b6d:"13278","504718d6":"13298","5f6910fd":"13388",d015beca:"13446","05c152cc":"13657","09b23959":"13708",a3efb982:"13755",eb4eb408:"13949",aacecf0a:"14167","2dcd28d2":"14340","5f87d652":"14382","44ea6f94":"14690",db759789:"14712","46bd2088":"14833","14ad7d65":"15045","9f1f88f2":"15407","14709bd0":"15476","5b2fe656":"15478","247783bb":"15548",ec383e18:"15913","7b9ab678":"16055","58cbfb5a":"16145",reactPlayerDailyMotion:"16328",a14a2602:"16458","3a03215d":"16476","3826cb97":"16677","2bb14bf0":"16680","1ebe758b":"16808","6738a51a":"17051","6cb21577":"17150","1140a058":"17357","6310fd48":"17363","9e1f7384":"17434","7fdc0c84":"17464","3947b16e":"17572",f5ff4ddf:"17794","36ded102":"18042",reactPlayerYouTube:"18446","60b808f2":"18583","1ee9c635":"18756","9afa6cde":"19290",f2ca2c55:"19520","203262b0":"19672","8f8e3a33":"19702",b1f7255a:"19724","95348a14":"19782",aa1b4e53:"19873","81c93763":"20041",e7b8679f:"20097","5f16d91a":"20212","11e6d144":"20341","63eaaafc":"20363",e2c3bc5f:"20420","5e1dea11":"20446","853ddb5d":"20562","126d2d8d":"20574",fc5ff77a:"20774",ea369cdd:"21058",abb76970:"21157","2e5976f3":"21300","6556faa5":"21528","5e95c167":"22362","1f86786a":"22598","8d1ec4c5":"22708",e310b146:"22805","374427da":"22869",d8d13bad:"22874","7a801707":"23060","0a6f29e5":"23475","239ea6cd":"23476","68cedfd5":"23558","1a848321":"23597","5f1113d5":"23673","3a06bd86":"23717","11451be3":"24029","2f4b7a65":"24066","07e96687":"24165","507e1a4c":"24285","06b1e92d":"24490",c5d1867d:"24613","823f7700":"24724","853164ef":"24785","20f8de15":"24880",db6367fb:"24981",dfd4abb8:"24998",cb128a98:"25275","4aa43dae":"25474","122cd6da":"25596",ef4e0518:"25789","9ee43f4e":"25908",febd0338:"25948",reactPlayerVimeo:"26173","30ddeb5e":"26529","3874af3e":"27098","0a61bc2e":"27431","070789e7":"27570","207ee67a":"27572",c0daf1e6:"27721","5b18cf50":"28089",e0c8a1d6:"28109","9da1bb58":"28125",d879ea04:"28505","59b068d1":"28968",f3954950:"29214","36a143db":"29263","20a7d97c":"29286","7ee80f24":"29632","60a00565":"29664","45b3f811":"29891",e1d93203:"30044",bced66ab:"30556",d6bd25e1:"30650","960d9980":"31136",fa811662:"31472","8e97cc15":"31586","5e450bcf":"31805",caaf01d4:"31863","421999d2":"31883",a1b695db:"32349",c302b7f6:"32450",bd83a8c8:"32452","0c947b8b":"32498","5417e0ef":"32734","3bc428dc":"32736","3cf47477":"32840",c6cf652c:"32909","4aaa0f44":"32946",b7523662:"32976","5575e2a8":"33015",bfb1735a:"33188","31d20e13":"33656",f6525c87:"34037",b69843a1:"34149",cc826739:"34270",a6a264d3:"34290",b1212599:"34446",fcdeb347:"34465",b5efef1d:"34483",d6247adb:"34533","0452e1bb":"34720",c091e626:"34857",a7ce3f25:"35491",d4c834e8:"35580",dff30c03:"35632",ecfe8209:"35635",f2f7c8b6:"35739",bebb13e1:"36138","85c49f6d":"36192",reactPlayerPreview:"36353","2ae30a74":"36480","12ebab0f":"36496",e0ecd9df:"36659","3cc638e0":"36732",ffecbc46:"36904",ab0b43f0:"36949","4ef2e3ea":"37068","8ee77415":"37109",bd6858b9:"37119","22885a83":"37146",e4608243:"37507",e202e776:"37555",a6aa9e1f:"37643","89f741ca":"37762","845a8f5b":"37878","512d8cfa":"37943","274548c6":"38012",b3022338:"38368","50711b5c":"38389","27e17dc0":"38440",c4643d70:"38456",f9dcbd56:"38588","2db499ae":"38991","903c4f6f":"38992",b85e9339:"39311",c7bf2a3a:"39646","9b770ac0":"39928","8f102ef9":"39954","70b40441":"40069",d40361ad:"40200","0475f9cc":"40810",c0908e63:"40817","5b5d0fd6":"40953",bd8e6ec6:"40960",eec2ee36:"41015","1a472eda":"41288","28411ba4":"41738",e7db057b:"41811",d98b9f83:"41838","37c880e2":"41857","4b75119c":"42007","9997aecf":"42068",c968f1a3:"42518",cc8c6322:"42795","09a69b27":"42919","1e5c0d86":"43067","554f4bd3":"43318","3f85e7e0":"43478","98e407cc":"43506",dc72610b:"43514","073713d1":"43895","8ee24aa1":"44416","069211c5":"44502",f4aab56f:"44552","8256726e":"44596","6f69b847":"45197",da6f85e6:"45501","62b71d38":"45612","1ddde2c7":"45747","5426ac11":"45966","0d3bf974":"46050",e5e83212:"46084","7778b814":"46105","771488fd":"46244",c08d79e7:"46666","32723a2e":"46708","56d56511":"46878",f81f234c:"46930",fcfb247d:"46985",c831614b:"46995",reactPlayerStreamable:"47627",eda7f530:"47826",e3450ac4:"47946","708cde07":"48035","009142c3":"48061","4cff7ce2":"48131",ced1473c:"48155","097f4186":"48402","34bbb05d":"48543",cce9ad1c:"48612","1074bb26":"48721","479e2d15":"48806","6d0c6131":"48965","256aaf6c":"49183","1a98f2d5":"49195",f30a3d1e:"49440",cf342098:"49456",d2227473:"49534",a9bffa51:"49724",bae79ca1:"49942","459956dd":"49945","5dfb628f":"50074","2158648d":"50213","1d48afb9":"50370",c2367e06:"50685",aa9c90f7:"50739",b198cec2:"50816","2f48bebc":"51093",fb73061a:"51341","890759ea":"51725","33844ff3":"52074","94c68899":"52165",c4f5d8e4:"52634","9e4087bc":"52711",reactPlayerMux:"52723","28a6a789":"52761","90d535c2":"53434","5efe417b":"53440","1bf956b0":"53446",bab68f7e:"54374",ec576a8b:"54422","2f989304":"54708","3c41cfdf":"54785","444d5ed4":"54829","1e26ddab":"54880","6a3a4a87":"54986","665c23b8":"55580","7d5cf9fd":"55603",d5e8cc91:"55621",bc4d6fc9:"55662","9d36e504":"55673","2e7fdd6f":"55939",a12f1ef9:"56188",f76e6047:"56444","82453b48":"56683",c2d7f837:"56787","10eaf6bf":"56918",c85c4b26:"57436","8e0ad159":"57532","55ac83aa":"58236",e4f4dec4:"58290","45a8dc52":"58319","3e1cef53":"58382","6bf3b56c":"58424",bba051af:"58475",bc3fdc28:"58564",b3198ac5:"58581","6fa39f86":"58700","6a6b8e69":"59154",eae3fa10:"59289","10915d97":"59569",c3c79e6c:"59612","677d6777":"59644","450c527f":"59783",b973dcfd:"59919","2fd22369":"60383",acf97486:"60439",c1a814bd:"60473","9915a91d":"60830","08e43170":"61153","92bdb8f4":"61316",d3b3aab8:"61321","7a8aa347":"61377","5c7af219":"61517","39e9cb37":"61556",a6748c3f:"61611","3d5c28b0":"61806",f13ea377:"61990","1af9c7d3":"62071","1a4e3797":"62138",cce23dfc:"62224","24a5cb68":"62318","6ee59393":"62590","271f7228":"62630",f615a51d:"62684","60194cf2":"62864","3685f909":"62959","2127c55a":"63267","4f989fdc":"63380","608d3bbe":"63493","291e387f":"63720","500fb0e6":"63761",ede583c5:"63817",fe36bf36:"63924",cfc8229c:"63993",aea1a378:"64078",b0055554:"64293","861bd1f8":"64455","7d8e4827":"64534","97bb0f58":"64542","99d25280":"64678",e19908fc:"64922",d5bc6e48:"64972","6479f562":"65250",e1d5ae70:"65527",f5d5b73d:"65541","12f94a3a":"65664","15d749b5":"65856","8977ff65":"66227","4549cb79":"66248","0018b769":"66290","25eb6242":"66351","89c724a9":"66352","34298da9":"66435","964386c1":"66455","342f32a4":"66578","5644a66f":"66703","623b8140":"66769","8660c4b6":"66814","4f8f7d74":"66939",f02ecc75:"67496",reactPlayerMixcloud:"67570",afbc2852:"67796","8d6bb331":"67882",e2c66a78:"68063","13a2a5ae":"68074","29bb06c8":"68371","747a690f":"68495",b6379448:"68670",c2be96f9:"68749",b083e7a6:"68795","7f2f79c2":"68831","1ff7f4b8":"68951","6de65b44":"69445","1385f2e4":"69693",acd02317:"69738",reactPlayerSoundCloud:"69979",dbbfaad4:"69987","723d2f26":"70001",afd0cb1b:"70092","4980c4fa":"70612","03cd8e1c":"70804",ef9227ec:"70806","6d30ac0a":"71317","94b64e1c":"71333","4224ef00":"71494","1e9ef283":"71500","83cfd970":"71623",f2b4d23e:"71659","57fbf2bd":"71753","0d1eeea0":"71760","0f427d40":"71886","30995fb4":"72211","5ffd6909":"72482",b37711b1:"72637","869c9c27":"72700","4bff3e73":"72795","31b72ec5":"72825",dd13b434:"72844",a22153eb:"72920","385718d4":"72969","7e968a29":"73156","9206c4f6":"73309",c1a5f9af:"73715",fb5b11b0:"73718","5bcd0da1":"73765","7f6bbd73":"73936","47dbeff7":"74030","191ccfef":"74067",fd5d515c:"74276","8b77e1a5":"74307","352bf367":"74391",c942fcda:"74661","006fd865":"74944",c3a5a911:"75055",f77d5673:"75120","4256eaf4":"75132",cb759659:"76023",a5fe4d7b:"76073","78469ba2":"76152","901425d2":"76186","9da9a498":"76206","4649e1c2":"76777","8328e7f1":"76829",cabfe087:"76903","05e78500":"76939",e802237a:"77759","68987ad2":"77800","4b2ec4d2":"77849","3062d10d":"78131",f9ed4079:"78207",cc135780:"78417","916b8fda":"78682","051ebc95":"78695",f13d29f3:"78959",de387681:"78997","1954649e":"79234",b2b9b866:"79566","4a487c7d":"79709",f5fdaecd:"79957",d776f897:"79985","4a82f29c":"80096",bb40a730:"80218",ed48b979:"80495","73578edf":"80614","3124230e":"80665",fa9fb131:"80722","2e501212":"80771",c76eb7d5:"80878",f5466782:"81057","16aa9458":"81084",c3b63204:"81202","75d9ae63":"81397","199fcd36":"81470","02371d76":"81471",a7434565:"81678","4ef508e9":"81707","97feb4e9":"81784","31c4e4e2":"81820",bfbf9dff:"81844","9eb4e0db":"81886","8310c4f6":"81930",dc14f0c4:"81948",f64a2f66:"82214","2f06f2be":"82230","0b31129f":"82277",c275b7b1:"82402","4cbb880b":"82646","78b226dc":"82925",a817f8e6:"83071",ccc49370:"83249","7bfa07ad":"83391","7b81a468":"83556","1d01589c":"84190","1cd349ba":"84398",b71b77d7:"84482","6875c492":"84813","833f2ec0":"84877","4be7e5d0":"85159","5653e10f":"85186",bd7f6eb8:"85647","60f1bcf9":"85732","3d8bf3ab":"85864","0c6d1616":"86398",d9cb599e:"86537","326c0af7":"86757",reactPlayerFacebook:"86887",d523bad7:"86963",c541efc4:"87118","6aa8733e":"87733",cfba059f:"87791",d1c7c525:"88007","9bf3c520":"88021",b6997bf2:"88318",fca34444:"88462",d40de319:"88501","43f8b4ce":"88572","1be78505":"88714",f5f1347d:"88963","376ff700":"89588",c0f0637e:"89729","87d0342b":"89737","919ee986":"89831",f7c12f45:"89915","64ec14d2":"90776",cc6caa93:"90826",a7a00099:"90866","192eff61":"91045","6536e94a":"91288","8446e86b":"92058","65e8e75e":"92273","7cb85c78":"92282","3830e8bf":"92440",d88d25ac:"92648","370bc5de":"92894","60e9e07a":"93040","6680323d":"93133",b5bd7f9b:"93488",f3f3787d:"93639","8e40e0a9":"93963","54e91ab5":"94183","07987921":"94248","9c1835bf":"94328","26c54994":"94381",c98ac358:"94395",a9d6ad8a:"94617","92009f0a":"95182",d80cee7e:"95406","96ecf107":"95638","87a2f1fc":"95919","9f0412f1":"95924",bd16d6fd:"96092",f259cf74:"96095",dc819e53:"96431",f7f75c2e:"96752",a0799a2b:"96886","21b56577":"96998","285ad496":"97026",ea642db2:"97061",a9808524:"97202","80a6599d":"97215",ceb3f8e5:"97342",c260b9a0:"97450",reactPlayerFilePlayer:"97458",c5495231:"97543","38eccbde":"97788","2d52fc42":"97823",d0ac1c30:"97902",bcf9457e:"98196","2d68e16b":"98197","13c3e084":"98230","935f2afb":"98581","84c1f0c8":"98632",c1dc13d0:"98952","0f438a70":"98982","0a451647":"99017",reactPlayerWistia:"99340",d61e8580:"99426","4d27cb4d":"99493","5ad12221":"99687",a69ebe5f:"99762",c4816122:"99924","1280552c":"99965"}[e]||e,t.p+t.u(e)},(()=>{var e={45354:0,71869:0};t.f.j=(f,a)=>{var c=t.o(e,f)?e[f]:void 0;if(0!==c)if(c)a.push(c[2]);else if(/^(45354|71869)$/.test(f))e[f]=0;else{var b=new Promise(((a,b)=>c=e[f]=[a,b]));a.push(c[2]=b);var d=t.p+t.u(f),r=new Error;t.l(d,(a=>{if(t.o(e,f)&&(0!==(c=e[f])&&(e[f]=void 0),c)){var b=a&&("load"===a.type?"missing":a.type),d=a&&a.target&&a.target.src;r.message="Loading chunk "+f+" failed.\n("+b+": "+d+")",r.name="ChunkLoadError",r.type=b,r.request=d,c[1](r)}}),"chunk-"+f,f)}},t.O.j=f=>0===e[f];var f=(f,a)=>{var c,b,d=a[0],r=a[1],o=a[2],l=0;if(d.some((f=>0!==e[f]))){for(c in r)t.o(r,c)&&(t.m[c]=r[c]);if(o)var n=o(t)}for(f&&f(a);l{"use strict";var e,f,a,c,b,d={},r={};function t(e){var f=r[e];if(void 0!==f)return f.exports;var a=r[e]={id:e,loaded:!1,exports:{}};return d[e].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}t.m=d,t.c=r,e=[],t.O=(f,a,c,b)=>{if(!a){var d=1/0;for(n=0;n=b)&&Object.keys(t.O).every((e=>t.O[e](a[o])))?a.splice(o--,1):(r=!1,b0&&e[n-1][2]>b;n--)e[n]=e[n-1];e[n]=[a,c,b]},t.n=e=>{var f=e&&e.__esModule?()=>e.default:()=>e;return t.d(f,{a:f}),f},a=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,t.t=function(e,c){if(1&c&&(e=this(e)),8&c)return e;if("object"==typeof e&&e){if(4&c&&e.__esModule)return e;if(16&c&&"function"==typeof e.then)return e}var b=Object.create(null);t.r(b);var d={};f=f||[null,a({}),a([]),a(a)];for(var r=2&c&&e;"object"==typeof r&&!~f.indexOf(r);r=a(r))Object.getOwnPropertyNames(r).forEach((f=>d[f]=()=>e[f]));return d.default=()=>e,t.d(b,d),b},t.d=(e,f)=>{for(var a in f)t.o(f,a)&&!t.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:f[a]})},t.f={},t.e=e=>Promise.all(Object.keys(t.f).reduce(((f,a)=>(t.f[a](e,f),f)),[])),t.u=e=>"assets/js/"+({182:"d1e2a1e4",185:"56b2a431",414:"6af54863",535:"5153790b",1100:"fec351f2",1102:"1ef0096b",1212:"734563d5",1281:"dc62dd6c",1356:"e967512d",1372:"e480871d",1427:"cb9e1ec6",1511:"b1be30d1",1705:"cd8c9fbc",1905:"9d4548fb",2280:"e51254c6",2782:"0e04b402",2928:"125cb29e",2959:"33fb6ca4",3181:"a9d16e82",3296:"a555a233",3336:"f98b80b4",3392:"reactPlayerVidyard",3430:"cee49d1f",3663:"def6dfb9",3704:"d9a6c9f9",3778:"87024a1a",3970:"133b4df0",4501:"8dc27084",4669:"c599f569",4711:"81e594d4",5452:"530f6d6e",5661:"5d42a18a",5731:"5610898c",5843:"e6102057",5931:"998a3ebe",5933:"fe66a3bc",6014:"babb54f3",6308:"af1b4014",6379:"cd910537",6463:"reactPlayerKaltura",6615:"e3a6d1ec",6914:"2c828998",6947:"898d2911",7031:"ffa0c411",7284:"0918a7cd",7408:"b31fa192",7658:"bb8cf488",7684:"193bf152",7727:"92e661e4",8041:"d44f5d69",8063:"ea0d3e91",8132:"c4429c79",8209:"01a85c17",8275:"e2548c92",8364:"a1c67955",8580:"f7d07906",8945:"4ba520f6",9246:"9bb632fa",9455:"6e9a1c5f",9531:"8bc1d424",9604:"3035a8de",10037:"14ee1fe9",10211:"524c9166",10278:"5385774b",10390:"7356945f",10543:"cd9d51a3",10588:"f93f95da",10711:"85f847a7",10909:"60ab92b2",11084:"75270caf",11133:"a20e070a",11145:"069eb5a6",11430:"0564f87a",11662:"2bf9c0b5",11681:"74ea6b63",11840:"5fb0ec3e",11841:"fe1d477d",11845:"da184dc1",12042:"reactPlayerTwitch",12095:"9e96f049",12236:"f50ed874",12287:"acfb9a5e",12384:"22ef07eb",12417:"c6fe0741",12693:"c333ed9f",12865:"3f2ad086",12893:"e4a50065",13131:"90cc8a3a",13278:"a2e81b6d",13298:"504718d6",13388:"5f6910fd",13446:"d015beca",13657:"05c152cc",13708:"09b23959",13755:"a3efb982",13949:"eb4eb408",14167:"aacecf0a",14340:"2dcd28d2",14382:"5f87d652",14690:"44ea6f94",14712:"db759789",14833:"46bd2088",15045:"14ad7d65",15407:"9f1f88f2",15476:"14709bd0",15478:"5b2fe656",15548:"247783bb",15913:"ec383e18",16055:"7b9ab678",16145:"58cbfb5a",16328:"reactPlayerDailyMotion",16458:"a14a2602",16476:"3a03215d",16677:"3826cb97",16680:"2bb14bf0",16808:"1ebe758b",17051:"6738a51a",17150:"6cb21577",17357:"1140a058",17363:"6310fd48",17434:"9e1f7384",17464:"7fdc0c84",17572:"3947b16e",17794:"f5ff4ddf",18042:"36ded102",18401:"17896441",18446:"reactPlayerYouTube",18583:"60b808f2",18756:"1ee9c635",19290:"9afa6cde",19520:"f2ca2c55",19672:"203262b0",19702:"8f8e3a33",19724:"b1f7255a",19782:"95348a14",19873:"aa1b4e53",20041:"81c93763",20097:"e7b8679f",20118:"90377122",20212:"5f16d91a",20341:"11e6d144",20363:"63eaaafc",20420:"e2c3bc5f",20446:"5e1dea11",20562:"853ddb5d",20574:"126d2d8d",20774:"fc5ff77a",21058:"ea369cdd",21157:"abb76970",21300:"2e5976f3",21528:"6556faa5",22362:"5e95c167",22598:"1f86786a",22708:"8d1ec4c5",22805:"e310b146",22869:"374427da",22874:"d8d13bad",23060:"7a801707",23475:"0a6f29e5",23476:"239ea6cd",23558:"68cedfd5",23597:"1a848321",23673:"5f1113d5",23717:"3a06bd86",24029:"11451be3",24066:"2f4b7a65",24165:"07e96687",24285:"507e1a4c",24406:"28092509",24490:"06b1e92d",24613:"c5d1867d",24724:"823f7700",24785:"853164ef",24880:"20f8de15",24981:"db6367fb",24998:"dfd4abb8",25275:"cb128a98",25474:"4aa43dae",25596:"122cd6da",25789:"ef4e0518",25908:"9ee43f4e",25948:"febd0338",26173:"reactPlayerVimeo",26529:"30ddeb5e",26933:"89594773",27098:"3874af3e",27431:"0a61bc2e",27570:"070789e7",27572:"207ee67a",27721:"c0daf1e6",28089:"5b18cf50",28109:"e0c8a1d6",28125:"9da1bb58",28505:"d879ea04",28968:"59b068d1",29214:"f3954950",29263:"36a143db",29286:"20a7d97c",29632:"7ee80f24",29664:"60a00565",29891:"45b3f811",30044:"e1d93203",30556:"bced66ab",30650:"d6bd25e1",31136:"960d9980",31472:"fa811662",31586:"8e97cc15",31805:"5e450bcf",31863:"caaf01d4",31883:"421999d2",32349:"a1b695db",32450:"c302b7f6",32452:"bd83a8c8",32498:"0c947b8b",32734:"5417e0ef",32736:"3bc428dc",32840:"3cf47477",32909:"c6cf652c",32946:"4aaa0f44",32976:"b7523662",33015:"5575e2a8",33188:"bfb1735a",33656:"31d20e13",34037:"f6525c87",34149:"b69843a1",34270:"cc826739",34290:"a6a264d3",34446:"b1212599",34465:"fcdeb347",34483:"b5efef1d",34533:"d6247adb",34720:"0452e1bb",34857:"c091e626",35491:"a7ce3f25",35510:"82337808",35575:"76175211",35580:"d4c834e8",35632:"dff30c03",35635:"ecfe8209",35739:"f2f7c8b6",36138:"bebb13e1",36192:"85c49f6d",36353:"reactPlayerPreview",36480:"2ae30a74",36496:"12ebab0f",36659:"e0ecd9df",36732:"3cc638e0",36904:"ffecbc46",36949:"ab0b43f0",37068:"4ef2e3ea",37109:"8ee77415",37119:"bd6858b9",37146:"22885a83",37507:"e4608243",37510:"38743361",37555:"e202e776",37643:"a6aa9e1f",37762:"89f741ca",37878:"845a8f5b",37943:"512d8cfa",38012:"274548c6",38368:"b3022338",38389:"50711b5c",38440:"27e17dc0",38456:"c4643d70",38588:"f9dcbd56",38991:"2db499ae",38992:"903c4f6f",39311:"b85e9339",39646:"c7bf2a3a",39928:"9b770ac0",39954:"8f102ef9",40069:"70b40441",40200:"d40361ad",40810:"0475f9cc",40817:"c0908e63",40953:"5b5d0fd6",40960:"bd8e6ec6",41015:"eec2ee36",41288:"1a472eda",41738:"28411ba4",41811:"e7db057b",41838:"d98b9f83",41857:"37c880e2",42007:"4b75119c",42068:"9997aecf",42518:"c968f1a3",42795:"cc8c6322",42919:"09a69b27",43067:"1e5c0d86",43318:"554f4bd3",43478:"3f85e7e0",43506:"98e407cc",43514:"dc72610b",43895:"073713d1",44416:"8ee24aa1",44502:"069211c5",44552:"f4aab56f",44596:"8256726e",45197:"6f69b847",45501:"da6f85e6",45612:"62b71d38",45747:"1ddde2c7",45894:"61428574",45966:"5426ac11",46050:"0d3bf974",46084:"e5e83212",46105:"7778b814",46244:"771488fd",46666:"c08d79e7",46708:"32723a2e",46878:"56d56511",46930:"f81f234c",46985:"fcfb247d",46995:"c831614b",47627:"reactPlayerStreamable",47826:"eda7f530",47946:"e3450ac4",48035:"708cde07",48061:"009142c3",48131:"4cff7ce2",48155:"ced1473c",48402:"097f4186",48543:"34bbb05d",48612:"cce9ad1c",48721:"1074bb26",48806:"479e2d15",48965:"6d0c6131",49183:"256aaf6c",49195:"1a98f2d5",49440:"f30a3d1e",49456:"cf342098",49534:"d2227473",49724:"a9bffa51",49942:"bae79ca1",49945:"459956dd",50074:"5dfb628f",50213:"2158648d",50370:"1d48afb9",50685:"c2367e06",50739:"aa9c90f7",50816:"b198cec2",51093:"2f48bebc",51341:"fb73061a",51725:"890759ea",52074:"33844ff3",52165:"94c68899",52634:"c4f5d8e4",52711:"9e4087bc",52723:"reactPlayerMux",52761:"28a6a789",53434:"90d535c2",53440:"5efe417b",53446:"1bf956b0",54374:"bab68f7e",54422:"ec576a8b",54708:"2f989304",54785:"3c41cfdf",54829:"444d5ed4",54880:"1e26ddab",54986:"6a3a4a87",55580:"665c23b8",55603:"7d5cf9fd",55621:"d5e8cc91",55662:"bc4d6fc9",55673:"9d36e504",55939:"2e7fdd6f",56188:"a12f1ef9",56444:"f76e6047",56683:"82453b48",56787:"c2d7f837",56918:"10eaf6bf",57436:"c85c4b26",57532:"8e0ad159",58236:"55ac83aa",58290:"e4f4dec4",58319:"45a8dc52",58382:"3e1cef53",58424:"6bf3b56c",58475:"bba051af",58564:"bc3fdc28",58581:"b3198ac5",58700:"6fa39f86",59154:"6a6b8e69",59289:"eae3fa10",59569:"10915d97",59612:"c3c79e6c",59644:"677d6777",59783:"450c527f",59919:"b973dcfd",60383:"2fd22369",60439:"acf97486",60473:"c1a814bd",60830:"9915a91d",61153:"08e43170",61316:"92bdb8f4",61321:"d3b3aab8",61377:"7a8aa347",61517:"5c7af219",61556:"39e9cb37",61611:"a6748c3f",61806:"3d5c28b0",61990:"f13ea377",62071:"1af9c7d3",62138:"1a4e3797",62224:"cce23dfc",62318:"24a5cb68",62590:"6ee59393",62630:"271f7228",62684:"f615a51d",62864:"60194cf2",62959:"3685f909",63267:"2127c55a",63380:"4f989fdc",63493:"608d3bbe",63720:"291e387f",63761:"500fb0e6",63817:"ede583c5",63924:"fe36bf36",63993:"cfc8229c",64078:"aea1a378",64293:"b0055554",64455:"861bd1f8",64534:"7d8e4827",64542:"97bb0f58",64678:"99d25280",64922:"e19908fc",64972:"d5bc6e48",65250:"6479f562",65527:"e1d5ae70",65541:"f5d5b73d",65664:"12f94a3a",65856:"15d749b5",66227:"8977ff65",66248:"4549cb79",66290:"0018b769",66351:"25eb6242",66352:"89c724a9",66435:"34298da9",66455:"964386c1",66578:"342f32a4",66703:"5644a66f",66769:"623b8140",66814:"8660c4b6",66939:"4f8f7d74",67496:"f02ecc75",67570:"reactPlayerMixcloud",67796:"afbc2852",67882:"8d6bb331",68063:"e2c66a78",68074:"13a2a5ae",68371:"29bb06c8",68495:"747a690f",68670:"b6379448",68749:"c2be96f9",68795:"b083e7a6",68831:"7f2f79c2",68951:"1ff7f4b8",69445:"6de65b44",69693:"1385f2e4",69738:"acd02317",69979:"reactPlayerSoundCloud",69987:"dbbfaad4",70001:"723d2f26",70092:"afd0cb1b",70612:"4980c4fa",70804:"03cd8e1c",70806:"ef9227ec",71317:"6d30ac0a",71333:"94b64e1c",71494:"4224ef00",71500:"1e9ef283",71623:"83cfd970",71659:"f2b4d23e",71753:"57fbf2bd",71760:"0d1eeea0",71886:"0f427d40",72211:"30995fb4",72482:"5ffd6909",72637:"b37711b1",72700:"869c9c27",72795:"4bff3e73",72825:"31b72ec5",72844:"dd13b434",72920:"a22153eb",72969:"385718d4",73156:"7e968a29",73309:"9206c4f6",73715:"c1a5f9af",73718:"fb5b11b0",73765:"5bcd0da1",73936:"7f6bbd73",74030:"47dbeff7",74067:"191ccfef",74276:"fd5d515c",74307:"8b77e1a5",74391:"352bf367",74661:"c942fcda",74944:"006fd865",75055:"c3a5a911",75120:"f77d5673",75132:"4256eaf4",76023:"cb759659",76073:"a5fe4d7b",76152:"78469ba2",76186:"901425d2",76206:"9da9a498",76777:"4649e1c2",76829:"8328e7f1",76903:"cabfe087",76939:"05e78500",77759:"e802237a",77800:"68987ad2",77849:"4b2ec4d2",78131:"3062d10d",78207:"f9ed4079",78417:"cc135780",78682:"916b8fda",78695:"051ebc95",78959:"f13d29f3",78997:"de387681",79234:"1954649e",79566:"b2b9b866",79709:"4a487c7d",79957:"f5fdaecd",79985:"d776f897",80096:"4a82f29c",80218:"bb40a730",80495:"ed48b979",80614:"73578edf",80665:"3124230e",80722:"fa9fb131",80771:"2e501212",80878:"c76eb7d5",81057:"f5466782",81084:"16aa9458",81202:"c3b63204",81271:"84810683",81397:"75d9ae63",81470:"199fcd36",81471:"02371d76",81678:"a7434565",81707:"4ef508e9",81784:"97feb4e9",81820:"31c4e4e2",81844:"bfbf9dff",81886:"9eb4e0db",81930:"8310c4f6",81948:"dc14f0c4",82214:"f64a2f66",82230:"2f06f2be",82277:"0b31129f",82402:"c275b7b1",82646:"4cbb880b",82925:"78b226dc",83071:"a817f8e6",83249:"ccc49370",83391:"7bfa07ad",83556:"7b81a468",84190:"1d01589c",84398:"1cd349ba",84482:"b71b77d7",84813:"6875c492",84877:"833f2ec0",85159:"4be7e5d0",85186:"5653e10f",85647:"bd7f6eb8",85732:"60f1bcf9",85864:"3d8bf3ab",86398:"0c6d1616",86537:"d9cb599e",86757:"326c0af7",86887:"reactPlayerFacebook",86963:"d523bad7",87118:"c541efc4",87733:"6aa8733e",87791:"cfba059f",88007:"d1c7c525",88021:"9bf3c520",88318:"b6997bf2",88462:"fca34444",88501:"d40de319",88572:"43f8b4ce",88714:"1be78505",88963:"f5f1347d",89588:"376ff700",89729:"c0f0637e",89737:"87d0342b",89831:"919ee986",89915:"f7c12f45",90776:"64ec14d2",90826:"cc6caa93",90866:"a7a00099",91045:"192eff61",91288:"6536e94a",92058:"8446e86b",92273:"65e8e75e",92282:"7cb85c78",92440:"3830e8bf",92648:"d88d25ac",92894:"370bc5de",93040:"60e9e07a",93133:"6680323d",93488:"b5bd7f9b",93639:"f3f3787d",93963:"8e40e0a9",94183:"54e91ab5",94248:"07987921",94328:"9c1835bf",94381:"26c54994",94395:"c98ac358",94617:"a9d6ad8a",95182:"92009f0a",95406:"d80cee7e",95638:"96ecf107",95919:"87a2f1fc",95924:"9f0412f1",96092:"bd16d6fd",96095:"f259cf74",96431:"dc819e53",96752:"f7f75c2e",96886:"a0799a2b",96998:"21b56577",97026:"285ad496",97061:"ea642db2",97202:"a9808524",97215:"80a6599d",97342:"ceb3f8e5",97450:"c260b9a0",97458:"reactPlayerFilePlayer",97543:"c5495231",97788:"38eccbde",97823:"2d52fc42",97902:"d0ac1c30",98196:"bcf9457e",98197:"2d68e16b",98230:"13c3e084",98581:"935f2afb",98632:"84c1f0c8",98952:"c1dc13d0",98982:"0f438a70",99017:"0a451647",99340:"reactPlayerWistia",99426:"d61e8580",99493:"4d27cb4d",99687:"5ad12221",99762:"a69ebe5f",99924:"c4816122",99965:"1280552c"}[e]||e)+"."+{182:"0b700572",185:"ada65323",414:"ee5fde64",535:"c1b6a2c2",1100:"d17a544d",1102:"df8651a8",1212:"5c7f0c40",1281:"beb2e8b7",1356:"b1f2ae06",1372:"afac1084",1427:"a0f60989",1468:"f679e342",1511:"968319a4",1705:"68cbc15a",1905:"eb073c85",2280:"5f787583",2782:"fc41a90a",2928:"249cc0f2",2959:"96e1a6c0",3181:"0b13f711",3296:"f106e1ad",3336:"d8c46893",3392:"090f5cb6",3430:"5bf153f1",3663:"fb3a8aa4",3704:"de6a3b67",3778:"d43c755a",3970:"426b97b4",4501:"7f8b5ca1",4669:"bc5ece4e",4711:"18790895",5452:"be750607",5661:"cb663b51",5731:"d86813b9",5843:"ea6fbf59",5931:"2f753b36",5933:"d3ce1ef1",6014:"280eb338",6308:"0371c308",6379:"320c80d6",6463:"600fc725",6615:"959436a5",6914:"db848b6a",6947:"e239b458",7031:"fcec0565",7284:"1cbb865d",7408:"b27b86a0",7658:"566bc905",7684:"c3c3a068",7727:"8f5a6fc2",7996:"d3ea57ae",8041:"88220dec",8063:"ae462a39",8132:"9b5f7c95",8209:"78a1e894",8275:"ea58a23c",8364:"3de6436f",8580:"0e33ef3c",8945:"4806a4d1",9246:"e16b150b",9455:"b53c8935",9462:"ed135407",9531:"94bf9a7b",9604:"56339883",10037:"b52c4990",10211:"fd03a0c0",10278:"3d3d8e45",10390:"bed52d1a",10543:"0802c995",10588:"0701f71e",10711:"4009d048",10909:"67d6828f",11084:"5888a519",11133:"77eae211",11145:"aa1e2bc6",11430:"01352692",11662:"f046426e",11681:"ab1994e7",11840:"fc6c490a",11841:"8c44669d",11845:"e026f204",12042:"40a52000",12095:"fe86f6d0",12236:"7601beeb",12287:"6b46bf75",12384:"0b2264aa",12417:"f6b99e2c",12693:"b80e1610",12865:"428fc5c7",12893:"a65aefe2",13131:"838cfbdc",13278:"13b2a1c6",13298:"65b7505b",13388:"f6781097",13446:"7fc32915",13554:"8de4bc13",13657:"916b2f49",13708:"1fcb96a2",13755:"72a8ec76",13949:"7de635ae",14167:"eda1f048",14340:"c2e44155",14382:"0818bc2b",14690:"9fa7696a",14712:"a9de602d",14833:"c08040e2",15045:"49f743d5",15407:"b7eeb30b",15476:"9a110be1",15478:"a58e0687",15548:"e6e9b142",15913:"f9bdb200",16055:"14b10527",16145:"76ff302b",16328:"ace8180a",16458:"b9057219",16476:"2467b336",16677:"d3c4dde8",16680:"2a816570",16808:"47f2b07e",17051:"b63b3f75",17150:"75bb2961",17357:"b87705c1",17363:"e2f3525a",17434:"83a32858",17464:"7812b09f",17572:"0e70974c",17794:"a7dc3b22",18042:"ae379aee",18401:"09ef5d0b",18446:"c190a89e",18583:"6a786408",18756:"9caa1f28",19290:"68e5b2cf",19520:"8f20efe5",19672:"71ae5d57",19702:"c8619971",19724:"bc6f4b20",19782:"0c381dd0",19873:"13e39441",20041:"016016b2",20097:"37e09a85",20118:"1b1f67b0",20212:"bcd3ef4b",20341:"39e9fbd3",20363:"5d212773",20420:"bb8588cc",20446:"e5a6a5b0",20562:"63166999",20574:"a848397f",20774:"61e0df28",21058:"8012b015",21157:"27af1036",21300:"44e728ae",21528:"be9c6b61",22362:"9a0e9f9a",22598:"5b89e810",22708:"bd55640b",22805:"152b8c81",22869:"1d7b6624",22874:"3f758048",23060:"1ea17c38",23475:"febbdbe8",23476:"152acddc",23558:"f2b10d23",23597:"0b1138ce",23673:"00c61f3d",23717:"e082fa62",24029:"d26dd771",24066:"83b35c1a",24165:"7c55ae5b",24285:"1c8fdf7f",24406:"da13930a",24490:"3e590d51",24613:"1fea4ebd",24724:"14c8490e",24785:"a1efa451",24880:"b5196068",24981:"3f1d4f26",24998:"548b6ad5",25275:"bd1bfccf",25474:"10b1d6f3",25596:"f4af5570",25789:"dc3a6ded",25908:"4e250dcf",25948:"8645d680",26173:"9f478156",26529:"7d07ce63",26933:"d30ca425",27098:"d027fdb9",27431:"d43a197b",27570:"e5d48ccd",27572:"a51a0ed8",27721:"69343b82",28089:"986361b3",28109:"2196ae74",28125:"b0462c2f",28505:"405077cc",28968:"bf2c88db",29214:"c89a0975",29263:"330945ac",29286:"48d0f148",29632:"b894c373",29664:"cef97319",29891:"fcf56b73",30044:"900e44df",30556:"5c591300",30650:"bcddaf59",31136:"87f98d83",31472:"73831806",31586:"883aca9c",31805:"28e73fec",31863:"b4c9b668",31883:"f5f387b6",32349:"cfd6d2bd",32450:"f8b5177a",32452:"67edf930",32498:"9f04323b",32734:"c34cddd9",32736:"62e7e9f1",32840:"65d70be2",32909:"f517fcc0",32946:"5936c877",32976:"e626b416",33015:"cba5bdce",33188:"d4f06d9d",33656:"7cefb728",34037:"ffb62ba0",34149:"e8908e28",34270:"cd753fb9",34290:"5f9d84bb",34446:"2079f13d",34465:"775c9259",34483:"17a766a6",34533:"51e4e2f0",34720:"853bbaf1",34857:"b8c961f7",35491:"28b24450",35510:"513de1fd",35575:"a90aa3b6",35580:"7b743866",35632:"07156903",35635:"76aeee8b",35739:"d1bef04c",36138:"b6991b6e",36192:"478676d1",36353:"8391fcd4",36480:"d822268d",36496:"0055ece0",36659:"492e09c8",36732:"5d47f1ee",36904:"a7c98595",36949:"920de44c",37068:"39844a38",37109:"fb359b6e",37119:"9bc1f8e6",37146:"653d480e",37507:"694c9141",37510:"7a7a111d",37555:"129cfc78",37643:"8e023d46",37762:"cca92fc3",37878:"d2f56ed9",37943:"e0ef4754",38012:"72d977ed",38368:"c3b3faf9",38389:"2ce3483c",38440:"501913ea",38456:"621a7950",38588:"c25d28a7",38991:"bcd10c38",38992:"7c26fead",39311:"aad4b13d",39646:"c40bc534",39928:"80665e85",39954:"9daccfff",40069:"7ed52e05",40200:"a0ac1446",40810:"061c37d4",40817:"a7596d33",40953:"7e11a802",40960:"85047d36",41015:"b3596dfe",41288:"934e7faa",41738:"70016ec5",41811:"f5879823",41838:"c78e3d82",41857:"68880f11",42007:"cb317052",42068:"5b090c02",42518:"86a08b41",42795:"4d366836",42919:"31b11c0a",43067:"a61ef09b",43318:"bf48cdb9",43478:"68b3dcfb",43506:"fcf5e35c",43514:"7eb0583f",43895:"68160b04",44416:"e9a9fe90",44502:"1d4ae577",44552:"bbed02cc",44596:"a6d39f88",44839:"9ce9935a",45197:"3ec21f78",45501:"3556c6bd",45612:"37d3537a",45747:"09f47874",45894:"06047c8c",45966:"53075fe5",46050:"00c13a67",46084:"1c4682ef",46105:"71fdae27",46244:"d85bd7fd",46666:"a0bcfb0b",46708:"4dc9772f",46878:"b509f7f7",46930:"b5d0c65f",46985:"a8cfbd6f",46995:"91c5de14",47113:"65880b18",47627:"61fd1f01",47826:"eedca7e3",47946:"89bf6a7b",48035:"e67de98d",48061:"bfb6a2e5",48131:"75035205",48155:"ea384a7b",48402:"b676ed59",48543:"19308aea",48612:"23f2d930",48721:"9f5ee2c4",48806:"bd148f5a",48965:"eb3d14fa",49183:"571afa4e",49195:"d2b9ed36",49440:"0721c498",49456:"7667330f",49534:"3369fb09",49724:"34fc7746",49942:"4cae2a11",49945:"b7753dbd",50074:"694e6646",50213:"a5a4fea6",50370:"e8e09d25",50685:"90c425f7",50739:"7212b433",50816:"d27e472e",51093:"171f5f14",51341:"41a43636",51725:"b3b484c8",52074:"9cdf105b",52165:"01e7b340",52634:"c1a2556f",52711:"d34e3f47",52723:"303ed67a",52761:"ea708a59",53434:"69463ac1",53440:"ffbc7a5c",53446:"1d1ebe65",54374:"3d98ba7f",54422:"a91b7973",54708:"da2c9c90",54785:"7ca9e7d9",54829:"b0b8141b",54880:"a18ee39e",54986:"c6725001",55580:"d5137a2f",55603:"2c5aa5fb",55621:"3f9a5c5f",55662:"0637450d",55673:"ce2531b3",55939:"2b5ab75a",56188:"454cb07b",56444:"8fdf39e0",56683:"47111ae5",56787:"f53a9c77",56918:"c9463b4b",57436:"adac6207",57532:"a359b0fd",58236:"a8d3be3b",58290:"88af57aa",58319:"ac13a8de",58382:"aaf21fad",58424:"c78f2ff2",58475:"5c619dbb",58564:"03424844",58581:"b9907956",58700:"bbdcba74",58913:"ad6fc8d2",59154:"8ccd37ed",59289:"31da36c5",59569:"2539b54e",59612:"b7c57060",59644:"7f762924",59783:"d72a4a2c",59919:"a70acaca",60383:"d5723a92",60439:"0fb59c60",60473:"bfa3c720",60830:"22590b94",61153:"cfb80aad",61316:"9865a851",61321:"ea3eafd1",61377:"48db1f76",61517:"f4f7271e",61556:"c78122d0",61611:"e718cd36",61806:"96422c96",61990:"0a3e34ef",62071:"be28dd60",62138:"4fc12286",62224:"eae39005",62318:"4803301d",62590:"6d68c8f8",62630:"5af768c2",62684:"4d2cb99d",62864:"7a9d7aaa",62959:"2b6e92c3",63267:"6a0d5507",63380:"79a4373a",63493:"6275ef97",63720:"70f50862",63761:"cb37fc49",63817:"33aa1df6",63924:"3c1c8eb2",63993:"5e24dc5b",64078:"6f8b52e8",64293:"002f5ba8",64455:"7b73a381",64534:"b6acaf66",64542:"7bbc5a42",64678:"5502d8aa",64922:"b6a9c9a2",64972:"2b5579a6",65250:"0ec5845a",65527:"339745ae",65541:"84de84ff",65664:"0e35d982",65856:"918827ad",66227:"28932fc0",66248:"b738dbdd",66290:"d49802c3",66351:"e90c46f5",66352:"631b03f2",66435:"dded8441",66455:"75cdc19b",66578:"f55f5147",66703:"17fd2573",66769:"7b9421b1",66814:"494afa23",66939:"82200580",67496:"d2c8d87f",67570:"4ce54898",67796:"a00adc38",67882:"83407aa9",68063:"254796f8",68074:"45d44976",68371:"c5024786",68495:"af9c659d",68670:"a8fd2c4c",68749:"32739393",68795:"19d1051f",68831:"f2b75a8e",68951:"b530ac8f",69445:"5691666d",69693:"b555b1f7",69738:"47aeefea",69979:"0b5349be",69987:"ae3d4421",70001:"da92a905",70092:"ee6cd0ab",70612:"6d32dad4",70804:"025e7aca",70806:"b5d96fe8",71317:"ec407eb8",71333:"ee41a11d",71494:"f1e27166",71500:"65367a96",71623:"d8d8ee9f",71659:"b2622aa0",71753:"f816f9c0",71760:"0fa0856d",71866:"6f58dc76",71886:"bc09dd50",72211:"fae06709",72482:"36cbd19d",72637:"ebdb0ccb",72700:"e34c3be7",72795:"a1b7b87c",72825:"ba2dfc97",72844:"d5587f71",72920:"90acf23b",72969:"f9a198b0",73156:"48f79e19",73309:"76a1e060",73715:"ed7c4a72",73718:"cee23dbc",73765:"04a6bcc0",73936:"7b557567",74030:"8da934db",74067:"17abe7e8",74276:"adf39695",74307:"3983a3ff",74391:"f7c9192f",74661:"eaa43db6",74944:"7d683ad2",75055:"9848b7da",75120:"6b9380f4",75132:"08ca476f",76023:"ed14281b",76073:"23dd006f",76152:"199b2ad0",76186:"f7bba5b1",76206:"8c6fdd84",76777:"eee3eed7",76829:"651b9c7e",76903:"c8dcb15b",76939:"0e253952",77759:"e6459ef7",77800:"2ecf1b78",77849:"fb9ad6b4",78131:"bf90d51e",78207:"1c55526c",78417:"229c70ff",78682:"afe73a87",78695:"aa2c560e",78959:"28282f8c",78997:"d130b4b6",79234:"87b75812",79566:"33ed3463",79709:"bdbb5ac0",79957:"ac52bf16",79985:"fe7f033e",80096:"b533a18d",80218:"97f50a58",80495:"712fd7c1",80614:"ca68902f",80665:"0ae1c229",80722:"8aefd0fe",80771:"9be34a80",80878:"511a50c4",81057:"5762965a",81084:"db7e93e0",81202:"4d39c9ca",81271:"83498f64",81397:"5f111be5",81470:"891008c7",81471:"90350247",81678:"a16fd3c0",81707:"bec09aac",81784:"38ebf00f",81820:"adbfa883",81844:"3c03d2af",81886:"9442f2fb",81930:"4611a56c",81948:"05a3a5dc",82214:"1c069500",82230:"50a899ba",82277:"294672c7",82402:"7644e779",82646:"96e2f9c7",82925:"82fd2365",83071:"92bc7783",83249:"ae142aec",83391:"6317a6d1",83556:"12aaf92a",84190:"acfc0816",84398:"ac65f829",84482:"036a3677",84813:"92b08a79",84877:"878585c9",85159:"d777a50f",85186:"9211d9ef",85647:"c8814749",85732:"2f872ef7",85864:"8e07301a",86398:"cf39cb54",86537:"4847b0d7",86757:"8558f5f6",86887:"9c552f79",86963:"2d7e53b1",87118:"0c8e8700",87733:"0650cf69",87791:"2f61c6dd",88007:"089421a7",88021:"b780e14d",88318:"8b318a2f",88462:"4775e794",88501:"ce0052bd",88572:"9ef5a9ac",88714:"4a261334",88963:"60c4d987",89588:"dafadf7b",89729:"42e3cecf",89737:"221b96aa",89831:"2f10e678",89915:"7c367d61",90329:"097040f5",90416:"ba76a62b",90776:"3f8963d1",90826:"65475832",90866:"eea880e3",91045:"ab2a1b77",91288:"6e5dd106",92058:"20a1c1fd",92273:"02ef889c",92282:"a1e9b3c3",92440:"1e097ebe",92648:"8f4ff553",92894:"745b45bc",93040:"dc33c940",93133:"10e86767",93488:"b9b88839",93639:"5a61d02f",93963:"d7176885",94183:"3605368c",94248:"4592e5cb",94328:"9eea0742",94381:"fb078950",94395:"0b668ca9",94617:"adb09b70",95182:"c8dc5f51",95406:"d053099d",95638:"85d617da",95919:"a96189a6",95924:"0e4a38a2",96092:"8ad9b59b",96095:"76c37447",96431:"f744cccd",96752:"a56226a7",96886:"ec0521ad",96998:"59d07b35",97026:"01d209f6",97061:"51307200",97202:"5ea55056",97215:"9fb5a9d9",97342:"c308da85",97450:"b2dff9e4",97458:"8795f2db",97543:"bad94ef7",97788:"c76099ee",97823:"b678434f",97902:"97ca5b7e",98055:"131b4810",98196:"143d8e20",98197:"c51cf587",98230:"7bda2e41",98581:"d71e2b6c",98632:"950740b9",98952:"6c583f50",98982:"3ee1b77e",99017:"f4e480a8",99340:"101b7b13",99426:"c9334111",99493:"04843dd0",99687:"4555de3a",99740:"9355cb55",99762:"ffbd4711",99831:"8f1df9f6",99924:"776187ce",99965:"358b28d0"}[e]+".js",t.miniCssF=e=>{},t.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),t.o=(e,f)=>Object.prototype.hasOwnProperty.call(e,f),c={},b="@openfn/docs:",t.l=(e,f,a,d)=>{if(c[e])c[e].push(f);else{var r,o;if(void 0!==a)for(var l=document.getElementsByTagName("script"),n=0;n{r.onerror=r.onload=null,clearTimeout(s);var b=c[e];if(delete c[e],r.parentNode&&r.parentNode.removeChild(r),b&&b.forEach((e=>e(a))),f)return f(a)},s=setTimeout(u.bind(null,void 0,{type:"timeout",target:r}),12e4);r.onerror=u.bind(null,r.onerror),r.onload=u.bind(null,r.onload),o&&document.head.appendChild(r)}},t.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.p="/",t.gca=function(e){return e={17896441:"18401",28092509:"24406",38743361:"37510",61428574:"45894",76175211:"35575",82337808:"35510",84810683:"81271",89594773:"26933",90377122:"20118",d1e2a1e4:"182","56b2a431":"185","6af54863":"414","5153790b":"535",fec351f2:"1100","1ef0096b":"1102","734563d5":"1212",dc62dd6c:"1281",e967512d:"1356",e480871d:"1372",cb9e1ec6:"1427",b1be30d1:"1511",cd8c9fbc:"1705","9d4548fb":"1905",e51254c6:"2280","0e04b402":"2782","125cb29e":"2928","33fb6ca4":"2959",a9d16e82:"3181",a555a233:"3296",f98b80b4:"3336",reactPlayerVidyard:"3392",cee49d1f:"3430",def6dfb9:"3663",d9a6c9f9:"3704","87024a1a":"3778","133b4df0":"3970","8dc27084":"4501",c599f569:"4669","81e594d4":"4711","530f6d6e":"5452","5d42a18a":"5661","5610898c":"5731",e6102057:"5843","998a3ebe":"5931",fe66a3bc:"5933",babb54f3:"6014",af1b4014:"6308",cd910537:"6379",reactPlayerKaltura:"6463",e3a6d1ec:"6615","2c828998":"6914","898d2911":"6947",ffa0c411:"7031","0918a7cd":"7284",b31fa192:"7408",bb8cf488:"7658","193bf152":"7684","92e661e4":"7727",d44f5d69:"8041",ea0d3e91:"8063",c4429c79:"8132","01a85c17":"8209",e2548c92:"8275",a1c67955:"8364",f7d07906:"8580","4ba520f6":"8945","9bb632fa":"9246","6e9a1c5f":"9455","8bc1d424":"9531","3035a8de":"9604","14ee1fe9":"10037","524c9166":"10211","5385774b":"10278","7356945f":"10390",cd9d51a3:"10543",f93f95da:"10588","85f847a7":"10711","60ab92b2":"10909","75270caf":"11084",a20e070a:"11133","069eb5a6":"11145","0564f87a":"11430","2bf9c0b5":"11662","74ea6b63":"11681","5fb0ec3e":"11840",fe1d477d:"11841",da184dc1:"11845",reactPlayerTwitch:"12042","9e96f049":"12095",f50ed874:"12236",acfb9a5e:"12287","22ef07eb":"12384",c6fe0741:"12417",c333ed9f:"12693","3f2ad086":"12865",e4a50065:"12893","90cc8a3a":"13131",a2e81b6d:"13278","504718d6":"13298","5f6910fd":"13388",d015beca:"13446","05c152cc":"13657","09b23959":"13708",a3efb982:"13755",eb4eb408:"13949",aacecf0a:"14167","2dcd28d2":"14340","5f87d652":"14382","44ea6f94":"14690",db759789:"14712","46bd2088":"14833","14ad7d65":"15045","9f1f88f2":"15407","14709bd0":"15476","5b2fe656":"15478","247783bb":"15548",ec383e18:"15913","7b9ab678":"16055","58cbfb5a":"16145",reactPlayerDailyMotion:"16328",a14a2602:"16458","3a03215d":"16476","3826cb97":"16677","2bb14bf0":"16680","1ebe758b":"16808","6738a51a":"17051","6cb21577":"17150","1140a058":"17357","6310fd48":"17363","9e1f7384":"17434","7fdc0c84":"17464","3947b16e":"17572",f5ff4ddf:"17794","36ded102":"18042",reactPlayerYouTube:"18446","60b808f2":"18583","1ee9c635":"18756","9afa6cde":"19290",f2ca2c55:"19520","203262b0":"19672","8f8e3a33":"19702",b1f7255a:"19724","95348a14":"19782",aa1b4e53:"19873","81c93763":"20041",e7b8679f:"20097","5f16d91a":"20212","11e6d144":"20341","63eaaafc":"20363",e2c3bc5f:"20420","5e1dea11":"20446","853ddb5d":"20562","126d2d8d":"20574",fc5ff77a:"20774",ea369cdd:"21058",abb76970:"21157","2e5976f3":"21300","6556faa5":"21528","5e95c167":"22362","1f86786a":"22598","8d1ec4c5":"22708",e310b146:"22805","374427da":"22869",d8d13bad:"22874","7a801707":"23060","0a6f29e5":"23475","239ea6cd":"23476","68cedfd5":"23558","1a848321":"23597","5f1113d5":"23673","3a06bd86":"23717","11451be3":"24029","2f4b7a65":"24066","07e96687":"24165","507e1a4c":"24285","06b1e92d":"24490",c5d1867d:"24613","823f7700":"24724","853164ef":"24785","20f8de15":"24880",db6367fb:"24981",dfd4abb8:"24998",cb128a98:"25275","4aa43dae":"25474","122cd6da":"25596",ef4e0518:"25789","9ee43f4e":"25908",febd0338:"25948",reactPlayerVimeo:"26173","30ddeb5e":"26529","3874af3e":"27098","0a61bc2e":"27431","070789e7":"27570","207ee67a":"27572",c0daf1e6:"27721","5b18cf50":"28089",e0c8a1d6:"28109","9da1bb58":"28125",d879ea04:"28505","59b068d1":"28968",f3954950:"29214","36a143db":"29263","20a7d97c":"29286","7ee80f24":"29632","60a00565":"29664","45b3f811":"29891",e1d93203:"30044",bced66ab:"30556",d6bd25e1:"30650","960d9980":"31136",fa811662:"31472","8e97cc15":"31586","5e450bcf":"31805",caaf01d4:"31863","421999d2":"31883",a1b695db:"32349",c302b7f6:"32450",bd83a8c8:"32452","0c947b8b":"32498","5417e0ef":"32734","3bc428dc":"32736","3cf47477":"32840",c6cf652c:"32909","4aaa0f44":"32946",b7523662:"32976","5575e2a8":"33015",bfb1735a:"33188","31d20e13":"33656",f6525c87:"34037",b69843a1:"34149",cc826739:"34270",a6a264d3:"34290",b1212599:"34446",fcdeb347:"34465",b5efef1d:"34483",d6247adb:"34533","0452e1bb":"34720",c091e626:"34857",a7ce3f25:"35491",d4c834e8:"35580",dff30c03:"35632",ecfe8209:"35635",f2f7c8b6:"35739",bebb13e1:"36138","85c49f6d":"36192",reactPlayerPreview:"36353","2ae30a74":"36480","12ebab0f":"36496",e0ecd9df:"36659","3cc638e0":"36732",ffecbc46:"36904",ab0b43f0:"36949","4ef2e3ea":"37068","8ee77415":"37109",bd6858b9:"37119","22885a83":"37146",e4608243:"37507",e202e776:"37555",a6aa9e1f:"37643","89f741ca":"37762","845a8f5b":"37878","512d8cfa":"37943","274548c6":"38012",b3022338:"38368","50711b5c":"38389","27e17dc0":"38440",c4643d70:"38456",f9dcbd56:"38588","2db499ae":"38991","903c4f6f":"38992",b85e9339:"39311",c7bf2a3a:"39646","9b770ac0":"39928","8f102ef9":"39954","70b40441":"40069",d40361ad:"40200","0475f9cc":"40810",c0908e63:"40817","5b5d0fd6":"40953",bd8e6ec6:"40960",eec2ee36:"41015","1a472eda":"41288","28411ba4":"41738",e7db057b:"41811",d98b9f83:"41838","37c880e2":"41857","4b75119c":"42007","9997aecf":"42068",c968f1a3:"42518",cc8c6322:"42795","09a69b27":"42919","1e5c0d86":"43067","554f4bd3":"43318","3f85e7e0":"43478","98e407cc":"43506",dc72610b:"43514","073713d1":"43895","8ee24aa1":"44416","069211c5":"44502",f4aab56f:"44552","8256726e":"44596","6f69b847":"45197",da6f85e6:"45501","62b71d38":"45612","1ddde2c7":"45747","5426ac11":"45966","0d3bf974":"46050",e5e83212:"46084","7778b814":"46105","771488fd":"46244",c08d79e7:"46666","32723a2e":"46708","56d56511":"46878",f81f234c:"46930",fcfb247d:"46985",c831614b:"46995",reactPlayerStreamable:"47627",eda7f530:"47826",e3450ac4:"47946","708cde07":"48035","009142c3":"48061","4cff7ce2":"48131",ced1473c:"48155","097f4186":"48402","34bbb05d":"48543",cce9ad1c:"48612","1074bb26":"48721","479e2d15":"48806","6d0c6131":"48965","256aaf6c":"49183","1a98f2d5":"49195",f30a3d1e:"49440",cf342098:"49456",d2227473:"49534",a9bffa51:"49724",bae79ca1:"49942","459956dd":"49945","5dfb628f":"50074","2158648d":"50213","1d48afb9":"50370",c2367e06:"50685",aa9c90f7:"50739",b198cec2:"50816","2f48bebc":"51093",fb73061a:"51341","890759ea":"51725","33844ff3":"52074","94c68899":"52165",c4f5d8e4:"52634","9e4087bc":"52711",reactPlayerMux:"52723","28a6a789":"52761","90d535c2":"53434","5efe417b":"53440","1bf956b0":"53446",bab68f7e:"54374",ec576a8b:"54422","2f989304":"54708","3c41cfdf":"54785","444d5ed4":"54829","1e26ddab":"54880","6a3a4a87":"54986","665c23b8":"55580","7d5cf9fd":"55603",d5e8cc91:"55621",bc4d6fc9:"55662","9d36e504":"55673","2e7fdd6f":"55939",a12f1ef9:"56188",f76e6047:"56444","82453b48":"56683",c2d7f837:"56787","10eaf6bf":"56918",c85c4b26:"57436","8e0ad159":"57532","55ac83aa":"58236",e4f4dec4:"58290","45a8dc52":"58319","3e1cef53":"58382","6bf3b56c":"58424",bba051af:"58475",bc3fdc28:"58564",b3198ac5:"58581","6fa39f86":"58700","6a6b8e69":"59154",eae3fa10:"59289","10915d97":"59569",c3c79e6c:"59612","677d6777":"59644","450c527f":"59783",b973dcfd:"59919","2fd22369":"60383",acf97486:"60439",c1a814bd:"60473","9915a91d":"60830","08e43170":"61153","92bdb8f4":"61316",d3b3aab8:"61321","7a8aa347":"61377","5c7af219":"61517","39e9cb37":"61556",a6748c3f:"61611","3d5c28b0":"61806",f13ea377:"61990","1af9c7d3":"62071","1a4e3797":"62138",cce23dfc:"62224","24a5cb68":"62318","6ee59393":"62590","271f7228":"62630",f615a51d:"62684","60194cf2":"62864","3685f909":"62959","2127c55a":"63267","4f989fdc":"63380","608d3bbe":"63493","291e387f":"63720","500fb0e6":"63761",ede583c5:"63817",fe36bf36:"63924",cfc8229c:"63993",aea1a378:"64078",b0055554:"64293","861bd1f8":"64455","7d8e4827":"64534","97bb0f58":"64542","99d25280":"64678",e19908fc:"64922",d5bc6e48:"64972","6479f562":"65250",e1d5ae70:"65527",f5d5b73d:"65541","12f94a3a":"65664","15d749b5":"65856","8977ff65":"66227","4549cb79":"66248","0018b769":"66290","25eb6242":"66351","89c724a9":"66352","34298da9":"66435","964386c1":"66455","342f32a4":"66578","5644a66f":"66703","623b8140":"66769","8660c4b6":"66814","4f8f7d74":"66939",f02ecc75:"67496",reactPlayerMixcloud:"67570",afbc2852:"67796","8d6bb331":"67882",e2c66a78:"68063","13a2a5ae":"68074","29bb06c8":"68371","747a690f":"68495",b6379448:"68670",c2be96f9:"68749",b083e7a6:"68795","7f2f79c2":"68831","1ff7f4b8":"68951","6de65b44":"69445","1385f2e4":"69693",acd02317:"69738",reactPlayerSoundCloud:"69979",dbbfaad4:"69987","723d2f26":"70001",afd0cb1b:"70092","4980c4fa":"70612","03cd8e1c":"70804",ef9227ec:"70806","6d30ac0a":"71317","94b64e1c":"71333","4224ef00":"71494","1e9ef283":"71500","83cfd970":"71623",f2b4d23e:"71659","57fbf2bd":"71753","0d1eeea0":"71760","0f427d40":"71886","30995fb4":"72211","5ffd6909":"72482",b37711b1:"72637","869c9c27":"72700","4bff3e73":"72795","31b72ec5":"72825",dd13b434:"72844",a22153eb:"72920","385718d4":"72969","7e968a29":"73156","9206c4f6":"73309",c1a5f9af:"73715",fb5b11b0:"73718","5bcd0da1":"73765","7f6bbd73":"73936","47dbeff7":"74030","191ccfef":"74067",fd5d515c:"74276","8b77e1a5":"74307","352bf367":"74391",c942fcda:"74661","006fd865":"74944",c3a5a911:"75055",f77d5673:"75120","4256eaf4":"75132",cb759659:"76023",a5fe4d7b:"76073","78469ba2":"76152","901425d2":"76186","9da9a498":"76206","4649e1c2":"76777","8328e7f1":"76829",cabfe087:"76903","05e78500":"76939",e802237a:"77759","68987ad2":"77800","4b2ec4d2":"77849","3062d10d":"78131",f9ed4079:"78207",cc135780:"78417","916b8fda":"78682","051ebc95":"78695",f13d29f3:"78959",de387681:"78997","1954649e":"79234",b2b9b866:"79566","4a487c7d":"79709",f5fdaecd:"79957",d776f897:"79985","4a82f29c":"80096",bb40a730:"80218",ed48b979:"80495","73578edf":"80614","3124230e":"80665",fa9fb131:"80722","2e501212":"80771",c76eb7d5:"80878",f5466782:"81057","16aa9458":"81084",c3b63204:"81202","75d9ae63":"81397","199fcd36":"81470","02371d76":"81471",a7434565:"81678","4ef508e9":"81707","97feb4e9":"81784","31c4e4e2":"81820",bfbf9dff:"81844","9eb4e0db":"81886","8310c4f6":"81930",dc14f0c4:"81948",f64a2f66:"82214","2f06f2be":"82230","0b31129f":"82277",c275b7b1:"82402","4cbb880b":"82646","78b226dc":"82925",a817f8e6:"83071",ccc49370:"83249","7bfa07ad":"83391","7b81a468":"83556","1d01589c":"84190","1cd349ba":"84398",b71b77d7:"84482","6875c492":"84813","833f2ec0":"84877","4be7e5d0":"85159","5653e10f":"85186",bd7f6eb8:"85647","60f1bcf9":"85732","3d8bf3ab":"85864","0c6d1616":"86398",d9cb599e:"86537","326c0af7":"86757",reactPlayerFacebook:"86887",d523bad7:"86963",c541efc4:"87118","6aa8733e":"87733",cfba059f:"87791",d1c7c525:"88007","9bf3c520":"88021",b6997bf2:"88318",fca34444:"88462",d40de319:"88501","43f8b4ce":"88572","1be78505":"88714",f5f1347d:"88963","376ff700":"89588",c0f0637e:"89729","87d0342b":"89737","919ee986":"89831",f7c12f45:"89915","64ec14d2":"90776",cc6caa93:"90826",a7a00099:"90866","192eff61":"91045","6536e94a":"91288","8446e86b":"92058","65e8e75e":"92273","7cb85c78":"92282","3830e8bf":"92440",d88d25ac:"92648","370bc5de":"92894","60e9e07a":"93040","6680323d":"93133",b5bd7f9b:"93488",f3f3787d:"93639","8e40e0a9":"93963","54e91ab5":"94183","07987921":"94248","9c1835bf":"94328","26c54994":"94381",c98ac358:"94395",a9d6ad8a:"94617","92009f0a":"95182",d80cee7e:"95406","96ecf107":"95638","87a2f1fc":"95919","9f0412f1":"95924",bd16d6fd:"96092",f259cf74:"96095",dc819e53:"96431",f7f75c2e:"96752",a0799a2b:"96886","21b56577":"96998","285ad496":"97026",ea642db2:"97061",a9808524:"97202","80a6599d":"97215",ceb3f8e5:"97342",c260b9a0:"97450",reactPlayerFilePlayer:"97458",c5495231:"97543","38eccbde":"97788","2d52fc42":"97823",d0ac1c30:"97902",bcf9457e:"98196","2d68e16b":"98197","13c3e084":"98230","935f2afb":"98581","84c1f0c8":"98632",c1dc13d0:"98952","0f438a70":"98982","0a451647":"99017",reactPlayerWistia:"99340",d61e8580:"99426","4d27cb4d":"99493","5ad12221":"99687",a69ebe5f:"99762",c4816122:"99924","1280552c":"99965"}[e]||e,t.p+t.u(e)},(()=>{var e={45354:0,71869:0};t.f.j=(f,a)=>{var c=t.o(e,f)?e[f]:void 0;if(0!==c)if(c)a.push(c[2]);else if(/^(45354|71869)$/.test(f))e[f]=0;else{var b=new Promise(((a,b)=>c=e[f]=[a,b]));a.push(c[2]=b);var d=t.p+t.u(f),r=new Error;t.l(d,(a=>{if(t.o(e,f)&&(0!==(c=e[f])&&(e[f]=void 0),c)){var b=a&&("load"===a.type?"missing":a.type),d=a&&a.target&&a.target.src;r.message="Loading chunk "+f+" failed.\n("+b+": "+d+")",r.name="ChunkLoadError",r.type=b,r.request=d,c[1](r)}}),"chunk-"+f,f)}},t.O.j=f=>0===e[f];var f=(f,a)=>{var c,b,d=a[0],r=a[1],o=a[2],l=0;if(d.some((f=>0!==e[f]))){for(c in r)t.o(r,c)&&(t.m[c]=r[c]);if(o)var n=o(t)}for(f&&f(a);l - + @@ -83,7 +83,7 @@ been built by and for the growing community of NGOs, governments, "tech-for-good" partners, and open-source contributors working on the health and humanitarian interventions in Low- and Middle-income Countries (LMICs).

    - + \ No newline at end of file diff --git a/documentation/api-tokens.html b/documentation/api-tokens.html index 5ef84215078c..819bf4fd9a35 100644 --- a/documentation/api-tokens.html +++ b/documentation/api-tokens.html @@ -17,7 +17,7 @@ - + @@ -33,7 +33,7 @@ on OpenFn (for example, if your profile has Admin level access, your API user will also have Admin permissions).

    Creating an API token

    You can manage your tokens in your User Profile.

    API Tokens Profile

    API Tokens

    1. Click Generate New Token to create a new one.

    New Token

    1. Make sure you copy your new token right away. You won't be able to view or copy it later.
    - + \ No newline at end of file diff --git a/documentation/build-for-developers/build-compliant-apps.html b/documentation/build-for-developers/build-compliant-apps.html index 47c3cc2c5ebe..6b04947d33ac 100644 --- a/documentation/build-for-developers/build-compliant-apps.html +++ b/documentation/build-for-developers/build-compliant-apps.html @@ -17,7 +17,7 @@ - + @@ -66,7 +66,7 @@ must allow either basic, token, or digest authenticated POST, PUT, or GET requests. (Though it is not advisable to create an API that requires GET requests to create or update data.)

    - + \ No newline at end of file diff --git a/documentation/build-with-api.html b/documentation/build-with-api.html index 456e9b0599fb..9a60137ac8d7 100644 --- a/documentation/build-with-api.html +++ b/documentation/build-with-api.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Version: v2 ⚡

    Build Projects via the OpenFn API

    OpenFn offers the ability to configure projects via HTTP requests sent to the REST API. See the OpenFn/Lightning GitHub repo for detailed developer documentation.

    - + \ No newline at end of file diff --git a/documentation/build/ai-assistant.html b/documentation/build/ai-assistant.html index 286331aeb13e..e5b1bfa89936 100644 --- a/documentation/build/ai-assistant.html +++ b/documentation/build/ai-assistant.html @@ -17,7 +17,7 @@ - + @@ -49,7 +49,7 @@ the chat interface, which will take you back to the list of sessions for this step.

    Feedback or Questions about the Assistant?

    We welcome your questions or feedback on community.openfn.org, or contact support@openfn.org with private queries.

    - + \ No newline at end of file diff --git a/documentation/build/collections.html b/documentation/build/collections.html index 48fdf45e4542..5abb39b18ae4 100644 --- a/documentation/build/collections.html +++ b/documentation/build/collections.html @@ -17,7 +17,7 @@ - + @@ -67,7 +67,7 @@ uploads values to a collection.
  • collections.remove() will remove values by key or key pattern.
  • The Collection API is backed by a special adaptor: see the Collections Adaptor API for more details.

    - + \ No newline at end of file diff --git a/documentation/build/credentials.html b/documentation/build/credentials.html index d12b8afdf260..8551eda93292 100644 --- a/documentation/build/credentials.html +++ b/documentation/build/credentials.html @@ -17,7 +17,7 @@ - + @@ -70,7 +70,7 @@ limiting attack vectors.

  • Ensuring the principle of least privilege: Each integration user need only have access to the subset of data supporting its specific use case.

  • Check out the docs on Security Best Practices to learn more.

    - + \ No newline at end of file diff --git a/documentation/build/editing-locally.html b/documentation/build/editing-locally.html index a3730968c358..19254ac192cd 100644 --- a/documentation/build/editing-locally.html +++ b/documentation/build/editing-locally.html @@ -17,7 +17,7 @@ - + @@ -51,7 +51,7 @@ git docs).

    From there, the version control integration will update changed steps in your OpenFn Project and you can test those changes on the platform.

    Once you're ready to start running steps and testing your changes locally, head over to the The CLI docs for guidance.

    - + \ No newline at end of file diff --git a/documentation/build/limits.html b/documentation/build/limits.html index 18c5efb04d16..c6b3ac0ba462 100644 --- a/documentation/build/limits.html +++ b/documentation/build/limits.html @@ -17,7 +17,7 @@ - + @@ -44,7 +44,7 @@ dataclips. You will see an ERROR: DataClip too large for storage error in your attempt logs.

    Instance superusers can control this limit via the MAX_DATACLIP_SIZE environment variable.

    - + \ No newline at end of file diff --git a/documentation/build/paths.html b/documentation/build/paths.html index bc529a12a7a0..59860e122e05 100644 --- a/documentation/build/paths.html +++ b/documentation/build/paths.html @@ -17,7 +17,7 @@ - + @@ -37,7 +37,7 @@ Step will be executed.

    Custom Conditions

    Examples of valid conditions include:

    • Run if there are no errors: !state.errors
    • Run if some value exists on state: state.has_valid_email_address
    • Run if a data array contains any items: state.data.length > 0
    • Run if data includes one item which matches criteria: state.data.includes(item => item.age > 18)
    • Run if the last Step received a HTTP error: state.response.statusCode >= 400

    In a custom expression you cannot do any of the following:

    • Use adaptor functions
    • Use Lazy State references ($).
    • Use control statements like if, while, for, etc

    Disabling Paths

    Disabling a path will prevent any of the downstream Steps from running, regardless of the condition or state.

    This can be a useful way of temporarily deactivating part of your workflow.

    To disable a path:

    1. Click on the Path you want to deactive
    2. Select the Disable this path checkbox
    - + \ No newline at end of file diff --git a/documentation/build/steps.html b/documentation/build/steps.html index d2dc425f5809..ddc0b3569807 100644 --- a/documentation/build/steps.html +++ b/documentation/build/steps.html @@ -17,7 +17,7 @@ - + @@ -76,7 +76,7 @@ edit a Job expression to define the "rules" or the specific tasks to be completed by your Step. See the pages on the Inspector and writing Jobs to learn more.

    - + \ No newline at end of file diff --git a/documentation/build/steps/step-design-intro.html b/documentation/build/steps/step-design-intro.html index b52dacd96b19..ce026f0189c4 100644 --- a/documentation/build/steps/step-design-intro.html +++ b/documentation/build/steps/step-design-intro.html @@ -17,7 +17,7 @@ - + @@ -46,7 +46,7 @@ Instances (TEI)
  • updateTEI(...)
  • upsertTEI(...)
  • See the below example Job expression for a Step that will "upsert" (update or insert) records in a SQL database.

    upsert('mainDataTable', 'AnswerId', {
      AnswerId: dataValue('\_id'), //external Id for upsert
      column: dataValue('firstQuestion)'),
      LastUpdate: new Date().toISOString(),
      Participant: dataValue('participant'),
      Surveyor: dataValue('surveyor'),
      ...
    });

    See Job Writing Guide for further information.

    - + \ No newline at end of file diff --git a/documentation/build/steps/step-editor.html b/documentation/build/steps/step-editor.html index bed2520cd397..a037040f28cb 100644 --- a/documentation/build/steps/step-editor.html +++ b/documentation/build/steps/step-editor.html @@ -17,7 +17,7 @@ - + @@ -44,7 +44,7 @@ on the concept of "state" when writing Jobs and building OpenFn Workflows.

    Keyboard Shortcuts

    From the inspector you can perform certain common actions (e.g., save, run, sync to github) using keystrokes. Check out the full list of keyboard shortcuts here.

    - + \ No newline at end of file diff --git a/documentation/build/triggers.html b/documentation/build/triggers.html index a61efe74e4d8..4c0ad51af6ed 100644 --- a/documentation/build/triggers.html +++ b/documentation/build/triggers.html @@ -17,7 +17,7 @@ - + @@ -82,7 +82,7 @@ messages, check the Disable this trigger checkbox at the bottom of the trigger configuration modal.

    Learn how the initial state (and Input) for Kafka-triggered Workflows gets built here.

    - + \ No newline at end of file diff --git a/documentation/build/troubleshooting.html b/documentation/build/troubleshooting.html index 1c02be90c96e..eeeb76087f31 100644 --- a/documentation/build/troubleshooting.html +++ b/documentation/build/troubleshooting.html @@ -17,7 +17,7 @@ - + @@ -76,7 +76,7 @@ and enable a better "OK, how should we solve this given the current chronological and commercial constraints" conversation between the Implementation Team and the Engineering Team.

    - + \ No newline at end of file diff --git a/documentation/build/workflows-api.html b/documentation/build/workflows-api.html index 2fbb0702276e..341215b2a1e4 100644 --- a/documentation/build/workflows-api.html +++ b/documentation/build/workflows-api.html @@ -17,7 +17,7 @@ - + @@ -42,7 +42,7 @@ Access Token (PAT) and baseUrl set to your OpenFn instance (ie, "https://app.openfn.org")

    Create new Workflow:

    post(`/api/projects/${$.projectId}/workflows`, {
    body: {
    name: 'My Workflow',
    edges: [
    {
    source_trigger_id: 'trigger-1',
    target_job_id: 'job-1',
    condition_type: 'always',
    },
    ],
    jobs: [
    {
    id: 'job-1',
    name: 'My Job',
    body: '/* job code goes here */',
    adaptor: '@openfn/language-common@latest',
    },
    ],
    triggers: [
    {
    id: 'trigger-1',
    type: 'webhook',
    enabled: true,
    },
    ],
    },
    headers: { 'content-type': 'application/json' },
    });

    The resulting workflow with updated UUIDs and metadata will be written to state.data.workflow.

    Add a new step and edge to an existing Workflow:

    fn(state => {
    const jobId = util.uuid();
    state.diff = {
    edges: [
    {
    id: util.uuid(),
    source_job_id: 'c79ce46c-ab0f-4f5b-bf2d-fed52aef2a41',
    target_job_id: jobId,
    condition_type: 'always',
    },
    ],
    jobs: [
    {
    id: jobId,
    body: '/* job code goes here */',
    adaptor: '@openfn/language-common@latest',
    },
    ],
    };
    return state;
    });
    patch(`/api/projects/${$.projectId}/workflows/${$.workflowId}`, {
    body: $.diff,
    headers: { 'content-type': 'application/json' },
    });

    The resulting workflow will be written to state.data.workflow.

    - + \ No newline at end of file diff --git a/documentation/build/workflows.html b/documentation/build/workflows.html index 00f69e66093f..f1221b025002 100644 --- a/documentation/build/workflows.html +++ b/documentation/build/workflows.html @@ -17,7 +17,7 @@ - + @@ -57,7 +57,7 @@ the workflow settings
  • In the modal, enter the maximum concurrency limit
  • Click save.
  • Configuring Concurrency

    Keyboard Shortcuts

    From the canvas you can perform certain common actions (e.g., save) using keystrokes. Check out the full list of keyboard shortcuts here.

    - + \ No newline at end of file diff --git a/documentation/build/working-with-branches.html b/documentation/build/working-with-branches.html index e60603a2e4d8..3e416d1f01de 100644 --- a/documentation/build/working-with-branches.html +++ b/documentation/build/working-with-branches.html @@ -17,7 +17,7 @@ - + @@ -47,7 +47,7 @@ updated remotely and want integrate the remote changes, use git checkout main, then git pull, then git checkout {working_branch_name} followed by git merge main to merge changes from main into your working branch.

    - + \ No newline at end of file diff --git a/documentation/cli-challenges.html b/documentation/cli-challenges.html index 7ef60ea9f94b..6384dece56ca 100644 --- a/documentation/cli-challenges.html +++ b/documentation/cli-challenges.html @@ -17,7 +17,7 @@ - + @@ -51,7 +51,7 @@ that fetch and filter posts by user ID.

    Objective:

    Write a job that retrieves posts by a specified user ID 1

    Requirements:

    1. Utilize JSONPlaceholder API https://jsonplaceholder.typicode.com.
    2. Install the latest version of http adaptor.
    openfn repo install @openfn/language-http

    Tasks:

    1. Create File:

      • Create a file named getPosts.js for your job.
    2. Get All Posts:

      • Add the first operation to fetch all posts. Use the provided API or any other source of your choice that provides a list of posts.
    3. Filter Posts by ID:

      • Add a second operation with a function that filters posts by user ID. You can use Array.filter or any other suitable method for this task.
    4. Fetch Posts for User ID 1:

      • Use the function from the second operation to filter posts for user ID 1.

    Review Checklist:

    • Created getPosts.js file.
    • Successfully fetched all posts.
    • Implemented a function to filter posts by user ID.
    • Retrieved posts for user ID 1.
    - + \ No newline at end of file diff --git a/documentation/cli-usage.html b/documentation/cli-usage.html index 2dc84bce8928..73abf9e3d0c9 100644 --- a/documentation/cli-usage.html +++ b/documentation/cli-usage.html @@ -17,7 +17,7 @@ - + @@ -39,7 +39,7 @@ running workflows via the CLI.


    Load adaptor documentation

    The CLI can list adaptor documentation in the terminal. Note that it has to download the adaptor to the repo (if it's not already there), which can take a moment.

    Print a list of adaptor functions

    openfn docs http

    Show docs for a specific function

    openfn docs http post
    - + \ No newline at end of file diff --git a/documentation/cli-walkthrough.html b/documentation/cli-walkthrough.html index c03290c81119..497dfef01362 100644 --- a/documentation/cli-walkthrough.html +++ b/documentation/cli-walkthrough.html @@ -17,7 +17,7 @@ - + @@ -102,7 +102,7 @@ ignored configuration file that will contain necessary credentials that will be used to access the destination system. For example:

    {
    ...
    "configuration": "tmp/openMRS-credentials.json"
    },
  • Data Key: In case you need to pass initial data to your job, specify a path to a gitignored data file

    {
    ...
    "state": {
    "data": "tmp/initial-data.json",
    }
    }
  • - + \ No newline at end of file diff --git a/documentation/cli.html b/documentation/cli.html index d76c95af9534..ae5f47188541 100644 --- a/documentation/cli.html +++ b/documentation/cli.html @@ -17,7 +17,7 @@ - + @@ -41,7 +41,7 @@ command.

    Expand to see the expected output.
    [CLI] ♦ Versions:
    ▸ node.js 18.12.1
    ▸ cli 1.0.0
    [CLI] ℹ Running test workflow...

    [CLI] ℹ Execution plan:
    [CLI] ℹ {
    "options": {
    "start": "start"
    },
    "workflow": {
    "steps": [
    {
    "id": "start",
    "state": {
    "data": {
    "defaultAnswer": 42
    }
    },
    "expression": "const fn = () => (state) => { console.log('Starting computer...'); return state; }; fn()",
    "next": {
    "calculate": "!state.error"
    }
    },
    {
    "id": "calculate",
    "expression": "const fn = () => (state) => { console.log('Calculating to life, the universe, and everything..'); return state }; fn()",
    "next": {
    "result": true
    }
    },
    {
    "id": "result",
    "expression": "const fn = () => (state) => ({ data: { answer: state.data.answer || state.data.defaultAnswer } }); fn()"
    }
    ]
    }
    }

    [CLI] ✔ Compiled all expressions in workflow
    [R/T] ℹ Executing undefined
    [R/T] ℹ Starting step start
    [JOB] ℹ Starting computer...
    [R/T] ✔ Completed step start in 1ms
    [R/T] ℹ Starting step calculate
    [JOB] ℹ Calculating to life, the universe, and everything..
    [R/T] ✔ Completed step calculate in 1ms
    [R/T] ℹ Starting step result
    [R/T] ✔ Completed step result in 0ms
    [CLI] ✔ Result: 42

    All other output is the CLI telling us what it is doing internally.

    Check the version

    openfn -v

    Get help

    openfn help

    Updating the CLI

    To install a new version straight on top of your current installation, run the following command.

    npm install -g @openfn/cli

    Troubleshooting

    If you encounter installation issues, try uninstalling the current version first and then re-installing.

    npm uninstall -g @openfn/cli
    npm install -g @openfn/cli
    - + \ No newline at end of file diff --git a/documentation/collaboration.html b/documentation/collaboration.html index 73c69b43fccc..3f4096164f7e 100644 --- a/documentation/collaboration.html +++ b/documentation/collaboration.html @@ -17,7 +17,7 @@ - + @@ -46,7 +46,7 @@ Remove Collaborator button on the Collaboration page and confirm the removal through the pop up window. The owner of a project cannot be removed.

    The project collaborators page is also where you can configure failure

    alerts and digests for your projects. Learn more about it in this guide. :::

    - + \ No newline at end of file diff --git a/documentation/collections-cli.html b/documentation/collections-cli.html index ae215394170f..946e06576719 100644 --- a/documentation/collections-cli.html +++ b/documentation/collections-cli.html @@ -17,7 +17,7 @@ - + @@ -64,7 +64,7 @@ value. If it already exists, its value will be updated.

    Removing items

    You can also remove items from a collection with the collections remove command:

    openfn collections remove <collection-name> <key>

    Key-patterns are supported and allow you to remove multiple keys.

    Use --dry-run to get a list of the keys that would be deleted without actually running the delete:

    openfn collections remove my-collection 2024* --dry-run
    - + \ No newline at end of file diff --git a/documentation/contribute/openfn-roadmap.html b/documentation/contribute/openfn-roadmap.html index a118219407e1..4df645f96519 100644 --- a/documentation/contribute/openfn-roadmap.html +++ b/documentation/contribute/openfn-roadmap.html @@ -17,7 +17,7 @@ - + @@ -83,7 +83,7 @@ issues for bugs via product repository. You can also independently start contributing to the OpenFn software, adaptors, or documentation by getting started here.

    - + \ No newline at end of file diff --git a/documentation/contribute/writing-code.html b/documentation/contribute/writing-code.html index a773ec37bf50..46271c7f8bf9 100644 --- a/documentation/contribute/writing-code.html +++ b/documentation/contribute/writing-code.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ tools themselves. (The more feedback the better!). If you want to propose some new language for the documentation, you can make those changes by clicking the "Edit this page" link at the bottom of any page and submit a pull request!

    - + \ No newline at end of file diff --git a/documentation/contribute/writing-docs.html b/documentation/contribute/writing-docs.html index a4dc992a5857..5aadf5a61d78 100644 --- a/documentation/contribute/writing-docs.html +++ b/documentation/contribute/writing-docs.html @@ -17,7 +17,7 @@ - + @@ -43,7 +43,7 @@ reviewers judge whether the doc fix solves the stated problem.

    Get prompt and good quality reviews from team members

    Trust team members to value docs, ensure technical accuracy and consistency, respect end users’ needs, and advocate for the best doc deliverables for consumers.

    Make beautiful docs

    Design is important. Create beautiful and modern looking docs.

    Use developer tools and workflows

    Automate the process as much as possible, so we can focus on content creation.

    - + \ No newline at end of file diff --git a/documentation/converting-triggers.html b/documentation/converting-triggers.html index 6dac3c6f7e88..edc7bc2946f7 100644 --- a/documentation/converting-triggers.html +++ b/documentation/converting-triggers.html @@ -17,7 +17,7 @@ - + @@ -46,7 +46,7 @@ Webhook, you can use a custom Path Condition that matches a JavaScript expression to decide whether a subsequent job should be executed or not.

    For example, if on v1 you had a Message Filter trigger that looked like this:

    Trigger Example

    The matching v2 JavaScript Path Condition would look like this:

    Path Condition Example

    - + \ No newline at end of file diff --git a/documentation/deploy/options.html b/documentation/deploy/options.html index 41377ce615cc..19602519c214 100644 --- a/documentation/deploy/options.html +++ b/documentation/deploy/options.html @@ -17,7 +17,7 @@ - + @@ -63,7 +63,7 @@ the export).
  • Test your locally deployed project.
  • Technical Guidelines

    For detailed deployment documentation instructions, head to the Lightning developer docs page, paying special attention to several sections:

    1. Getting Started
    2. Deployment Considerations
    3. Benchmarking
    - + \ No newline at end of file diff --git a/documentation/deploy/portability-versions.html b/documentation/deploy/portability-versions.html index 3faa3196c2b7..8e84d2d7c1d3 100644 --- a/documentation/deploy/portability-versions.html +++ b/documentation/deploy/portability-versions.html @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@
    Version: v2 ⚡

    Versions of the Portability Proposal

    OpenFn is currently designing a portable project configuration schema that can be used to import or export projects between OpenFn/platform and OpenFn/engine.

    Current

    See the current specification here.

    v2

    Used for export from the legacy platform.

    jobs:
    job-1:
    expression: >
    registerPatient({
    patient-id: state.data.id,
    dob: state.data.birth
    })
    adaptor: '@openfn/language-openmrs'
    trigger: trigger-1
    credential: my-secret-credential
    recurring-job:
    expression: >
    fn(state => {
    console.log("Hi there!")
    return state;
    })
    adaptor: '@openfn/language-common'
    trigger: every-minute
    flow-job:
    expression: >
    fn(state => {
    state.data.number = state.data.number * 3
    return state;
    })
    adaptor: '@openfn/language-common'
    trigger: after-j1
    catch-job:
    expression: >
    fn(state => {
    state.message = "handled it."
    return state;
    })
    adaptor: '@openfn/language-common'
    trigger: j1-fails

    triggers:
    trigger-1:
    criteria: '{"number":2}'
    every-minute:
    cron: '* * * * *'
    after-j1:
    success: job-1
    j1-fails:
    failure: job-1

    # Note that credential keys get copied, but values must be manually entered
    # after the export is completed.
    credentials:
    my-secret-credential:
    username: '******'
    password: '******'

    v1

    Initial portability proposal

    const project = {
    async: true,
    triggers: {
    uniqueTriggerId: {
    // trigger properties
    },
    otherTrigger: {
    // other trigger properties
    },
    },
    credentials: {
    // for now, credentials will not be synced //
    // secret1: {
    // username: 'mamadou',
    // pass: 'shhh',
    },
    staticData: {
    // static objects that can be accessed from any job
    },
    jobs: {
    payHealthWorker: { trigger: 'otherTrigger' },
    syncToSalesforce: {
    expression: 'uri://github.com/jobs/expresion.js',
    trigger: 'uniqueTriggerId',
    credential: 'secret1',
    },
    },
    };
    - + \ No newline at end of file diff --git a/documentation/deploy/portability.html b/documentation/deploy/portability.html index 2ea11342632e..40b816f4ff95 100644 --- a/documentation/deploy/portability.html +++ b/documentation/deploy/portability.html @@ -17,7 +17,7 @@ - + @@ -73,7 +73,7 @@ between IDs of workflows in your projectSpec and your OpenFn instance. When this occurs, the error will be written out in an error object as shown below:

    [CLI] ✘ Failed to deploy project openfn-data-buffers-prototype:
    {
    "errors": {
    "workflows": {
    "1-ingest-messages": {
    "base": [
    "extraneous parameters: workflow_id"
    ]
    },
    "2-calculate-indicators": {
    "base": [
    "extraneous parameters: workflow_id"
    ]
    }
    }
    }

    Solution

    Run openfn pull to update your local instance and keep IDs in sync, incorporate your changes and run openfn deploy again.

    Other Versions

    - + \ No newline at end of file diff --git a/documentation/deploy/requirements.html b/documentation/deploy/requirements.html index 5cae33fb6dc4..4d1c057fbd92 100644 --- a/documentation/deploy/requirements.html +++ b/documentation/deploy/requirements.html @@ -17,7 +17,7 @@ - + @@ -71,7 +71,7 @@ specialist, the following sample configurations may provide useful starting points.

    (a) Simple

    Deploy the application and database on the same machine.

    Deploy the application and database on separate machines.

    (c) Ideal

    Auto-scale different optimized node pools in a Kubernetes cluster for the Erlang orchestration app and the Javascript worker app.

    Consider high-availability Postgres-as-a-service, or also run it in a cluster.

    - + \ No newline at end of file diff --git a/documentation/design/api-discovery.html b/documentation/design/api-discovery.html index 7273b27bf7bc..6644933ec419 100644 --- a/documentation/design/api-discovery.html +++ b/documentation/design/api-discovery.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Version: v2 ⚡

    Discovering APIs to inform your workflow automation design

    This article explains how to analyze API documentation and draft a technical workflow diagram.

    What is an API?

    APIs tell applications how to communicate. An API is the “messenger” that:

    1. Tells you how to form a request,
    2. Delivers your request to the provider that you’re requesting it from, and then
    3. Delivers the response back to you
    Workflow
    Source

    OpenFn connects with APIs via http requests sent via the web. OpenFn can automate any tasks supported by the APIs of the applications it integrates with (e.g., if an app’s API supports sending payments, then OpenFn can automate sending payments).

    How to analyze API documentation

    In the beginning of the design process, you should explore the target system’s API documentation to determine the options for integration.

    Determine integration options

    Consider these questions to determine your integration options–even if an API is not available. :

    1. Is there a RESTful API?
      • If yes, OpenFn can connect out-of-box! REST API is the gold standard for most modern web apps, and typically supports JSON data format.
    2. Is there a webhook?
      • Most mobile data collection apps offer this feature. Some call it “data forwarding”, “web callback”, or “HTTP push API”.
      • Webhooks automatically send messages or notifications when something happens (e.g., when a new form is submitted, notify external services like OpenFn). These event-based notifications enable real-time data integration or automated actions.
    3. Otherwise, what are other options for importing/exporting data from the target applications?
      • Can you connect directly to a database?
      • Is there a way to import/export files? (JSON, CSV, XLS, or XML)
      • Is there a legacy API (e.g., SOAP) that we can communicate with via HTTP requests?
    tip

    OpenFn can connect any app, even if an API is not supported. See the “Adaptors” section to learn more.

    Authentication

    API documentation will typically have a section dedicated to authentication options. Look for this to discover which authentication methods are supported, and whether configuration work will be required to set up a new user or API credential.

    Consider that authentication methods that leverage API Keys or OAuth are typically more secure than basic authentication (username/password).

    tip

    As early as possible, request an API credential from the system administrator of the app you’re trying to integrate with. This way, you can test authentication with a developer/test environment to verify that you’re able to connect.

    API Endpoints

    Analyze the documentation to see which resources/entities and features are supported by the API. For example, if you want to register Patient records via the API, search for reference to the “/patients” endpoint (or whatever this resource is called in your target application).

    This section of the documentation will include an overview of which HTTP request methods (i.e., POST, GET, etc.) and request parameters are supported, as well as example HTTP requests you can send to the API.

    HTTP request methods will inform you which operations are supported by the API.

    1. Create → POST
    2. Read → GET
    3. Update → PUT or PATCH
    4. Delete → DELETE

    For example, if you want to query Patient records from an app, see if the API documentation supports GET ‘/patients’.

    Limits

    Be on the lookout for API limits. Documentation will often have a dedicated section that will describe if there are any limits or considerations for API requests and rates, concurrency, and record limits. Understanding these limits upfront can inform your integration design to ensure high-performing, scalable automation.

    Technical Workflow Diagramming

    The output of API discovery should be a “technical” workflow diagram. This diagram is different from the functional workflow diagram produced during “Discovery” in that it captures the technical specifications for how to integrate with target applications. These specifications include the specific methods/operations (e.g., GET, POST) and the database/API names of the target resources (i.e., specific API endpoints or database tables).

    Workflow

    When drafting your technical specifications, consider the following:

    1. Plan for failure. Your workflows will fail. Consider what happens when they do…
      • Should individuals be notified?
      • How can the workflow be re-processed safely?
      • How to ensure no duplicate data is created?
    2. Where possible, use unique identifiers to build idempotent automation. Check for existing records in the target system using an available unique identifier:
      • System record UUIDs (e.g., record_id: asjd2910-b8zy1s0a),
      • Unique codes (e.g., HOUSEHOLD-10013) and
      • Unique combination of attributes (e.g., familyName + phoneNumber + village + districtCode)
    3. If the target system does not have native “upsert” operation or built-in duplicate-checking before insert, implement an upsert (“update or insert”) pattern to…
      • Check if a record exists using a unique identifier…
      • If yes, update the record.
      • If not, insert a new record.
    4. Don’t forget to consider data volumes. Depending on whether you need to handle 1, 10000, or 1M+ records, your workflow approach may need change.
      • Estimate the file size of the data to be extracted
      • Consider API limits (records returned per page, request rate limits)
      • Consider bulk operations & batching requests

    Check out the technical workflow diagram below for syncing forms submissions from KoboToolBox to DHIS2. The original functional diagram can be found here.

    Workflow

    - + \ No newline at end of file diff --git a/documentation/design/design-overview.html b/documentation/design/design-overview.html index 5e56ca106ea3..fd8d654500ab 100644 --- a/documentation/design/design-overview.html +++ b/documentation/design/design-overview.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Version: v2 ⚡

    Design Process Overview

    This article outlines the high-level steps to design automated workflows, inspired by the OpenFn core team’s standard implementation process.

    Typically the design process happens outside of OpenFn, in conversation and collaboration with relevant business/program and technical stakeholders. Then, once the design is finalized, the workflow configuration, testing, monitoring, and management is handled in OpenFn.

    Key Terms

    Before you dive in, make sure you have a clear understanding of these key terms we’ll reference throughout this documentation:

    Workflow

    The set of instructions that determine how to solve a problem or accomplish a task. They are often broken down into smaller, independent tasks.

    Workflow

    Workflow Automation

    The use of software to perform these tasks independently, in accordance with predefined business rules, and without the need for human input.

    Workflow Automation

    Data Integration

    The process of combining data from different sources into a centralized view. Data integration is a means of achieving workflow automation. Its tasks may be streamlined, automated, and managed by a workflow automation tool.

    Data Integration

    Introduction

    Workflow automation design features 5 main steps that are covered in depth in other articles:

    1. Discovery & Scoping
    2. Workflow Design
    3. API Discovery and Technical Design
    4. Data Element Mapping Specifications
    5. Workflow Specifications

    Example Use Case

    Throughout the design documentation we will reference the fictional data collection & workflow automation scenario below:

    PatientCare is a health NGO that runs a network of community health workers who provide care to patients in remote areas in Guinea. PatientCare workers collect patient data in KoboToolBox. The Guinean government uses DHIS2 as its national health information system (HIS) and requires PatientCare to register all patient data in the HIS.

    - + \ No newline at end of file diff --git a/documentation/design/design-workflow.html b/documentation/design/design-workflow.html index f5628658d004..1bb4b6a1a057 100644 --- a/documentation/design/design-workflow.html +++ b/documentation/design/design-workflow.html @@ -17,7 +17,7 @@ - + @@ -34,7 +34,7 @@ instances") from my country's DHIS2 system, so that I can enroll them as contacts in my SMS campaign configured on RapidPro to send them automated alerts and program updates.

    - + \ No newline at end of file diff --git a/documentation/design/discovery.html b/documentation/design/discovery.html index 727541f61e7d..679a9d00186d 100644 --- a/documentation/design/discovery.html +++ b/documentation/design/discovery.html @@ -17,7 +17,7 @@ - + @@ -72,7 +72,7 @@ organization and between third party services)
  • Types of data exchanged
  • Authentication/access points
  • Such diagrams promote transparency, help to identify potential data exposure risks, and provide documentation of compliance with data protection requirements. Check out the example solution architecture diagrams below.

    Example 1:

    Workflow

    Example 2:

    Workflow
    Source
    - + \ No newline at end of file diff --git a/documentation/design/mapping-specs.html b/documentation/design/mapping-specs.html index aab6e0916080..f464ed3088a2 100644 --- a/documentation/design/mapping-specs.html +++ b/documentation/design/mapping-specs.html @@ -17,7 +17,7 @@ - + @@ -89,7 +89,7 @@ to start. For example, you might collect individual patient records in KoboToolBox, but want to send an aggregated count of patients to DHIS2 for key indicator results reporting (e.g. the number of patients under 18 years old).

    - + \ No newline at end of file diff --git a/documentation/design/overview.html b/documentation/design/overview.html index a951945e1c02..0d3a2cbd8266 100644 --- a/documentation/design/overview.html +++ b/documentation/design/overview.html @@ -17,7 +17,7 @@ - + @@ -104,7 +104,7 @@ implementing partners.

    Share this documentation with any technical implementation team, or check out the Build documentation section to learn how to implement these design specifications using OpenFn.

    - + \ No newline at end of file diff --git a/documentation/design/workflow-specs.html b/documentation/design/workflow-specs.html index fc69cd7787aa..42deac10dd76 100644 --- a/documentation/design/workflow-specs.html +++ b/documentation/design/workflow-specs.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Version: v2 ⚡

    Writing specifications for workflow automation solutions

    The key outputs of the the design process are:

    1. Functional Workflow diagram
    2. Technical Workflow diagram
    3. Solution Architecture Diagram
    4. Data element mapping specifications

    Given these, you’ll be ready to finalize your workflow specifications and hand-off to developers for job-writing!

    Each “task” or “step” in the OpenFn swimlane of your technical diagram can be implemented as a distinct operation in your workflow configuration. In the example diagram below, you might implement 1 job with 3 chained operations, or 3 jobs with 1 operation each.

    workflow

    The workflow specifications should link to all of the design artifacts and highlight the following:

    1. The required number of OpenFn jobs and the function of each
    2. Links to sample input/output and API documentation
    3. Unique identifiers
    4. Expected data volumes
    5. Authentication requirements
    - + \ No newline at end of file diff --git a/documentation/get-help/support.html b/documentation/get-help/support.html index 0762a13bf44a..b36edf2c62e2 100644 --- a/documentation/get-help/support.html +++ b/documentation/get-help/support.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Version: v2 ⚡

    Support for OpenFn Implementations

    Ask the Community!

    If you need help getting started, have questions, or product feedback, first check out our Community. Our core team and other OpenFn implementers monitor all posts to help each other out, share examples, and circulate product updates.

    Have a question about your project on OpenFn.org?

    If you're using the hosted OpenFn platform SaaS, and have a private question about your project, account, or billing, contact our core team at support@openfn.org.

    Need helping hands?

    The OpenFn core team and our certified partners offer enterprise support, implementation & developer services, and training to jump-start your team. Check out our website:

    - + \ No newline at end of file diff --git a/documentation/get-started/glossary.html b/documentation/get-started/glossary.html index 0fe6896b6038..383048ea42f1 100644 --- a/documentation/get-started/glossary.html +++ b/documentation/get-started/glossary.html @@ -17,7 +17,7 @@ - + @@ -99,7 +99,7 @@ accordance with predefined business rules, and without the need for human input.

    Writeback

    Refers to a destination system making a change in a data source. When my destination application receives information from a data source and wants to do something back to the source in response, that's writeback.

    - + \ No newline at end of file diff --git a/documentation/get-started/implementation-checklist.html b/documentation/get-started/implementation-checklist.html index 24270da6b67f..9daec6fc2bed 100644 --- a/documentation/get-started/implementation-checklist.html +++ b/documentation/get-started/implementation-checklist.html @@ -17,7 +17,7 @@ - + @@ -36,7 +36,7 @@ openfn.github.io/unicef-cambodia/

    (1) Preparing for the Implementation

    Set the project up for success by creating a project plan, defining roles responsibilities, documenting the business value of the implementation, and confirming the technical feasibility of the implementation.

    Key Outputs:

    • Business Value Assessment
    • High-level workflow requirements
    • Technical Feasibility Assessment
    • Capacity Assessment

    (2) Discovery & Design - Functional Workflow Requirements

    Gather and document user stories and functional workflow requirements.

    Key Outputs:

    • Solution Architecture Diagram
    • Workflow Diagrams (functional)
    • Data Element Mapping Specifications (functional)

    (3) Discovery & Design - Technical Specifications

    Iterate on workflow requirements to define technical specifications for how the workflow will be implemented. For instance, consider specific API endpoints to access and HTTP methods/operations to use for each.

    Key Outputs:

    • Solution Architecture Diagram
    • Workflow Diagrams (technical)
    • Data Element Mapping Specifications (technical)

    (4) Build

    Configure the workflow on OpenFn.org and develop and test the jobs and adaptors to be used in the workflow.

    Key Outputs:

    • OpenFn Project configuration
    • Jobs
    • Adaptors - new/updated (if needed)
    • Drafted “Project Security Configuration Checklist” to document config settings implemented

    (5) Testing

    Create a test suite and conduct UAT. After UAT, Incorporate any feedback and iterate on the testing process.

    Key Outputs:

    • Completed test suite
    • Backlog of new requests (if feedback identified for future phases)
    • Completed “Project Security Configuration Checklist”

    (6) Training & Prep for Go-Live

    Train OpenFn administrators and target system end users and document what was implemented. This is also the phase where the configuration and code is migrated to production environments.

    Key Outputs:

    • Published documentation
    • Training video recording
    • Signed-off “Project Security Configuration Checklist”
    • Ready-to-go OpenFn project

    (7) Rollout & Support

    Turn “on” OpenFn workflows to go-live and establish support structures & a governance model for change management.

    Key Outputs:

    • “Live” OpenFn project
    • Documented support model

    Questions or feedback?

    If you have any inputs, comments, or questions—please contribute! Submit a pull request to this documentation page on GitHub or leave a comment in OpenFn Community.

    Interested in receiving training on the OpenFn implementation process? Contact partnerships@openfn.org.

    - + \ No newline at end of file diff --git a/documentation/get-started/security-compliance.html b/documentation/get-started/security-compliance.html index 907a580f0ccc..3ebf3d53264d 100644 --- a/documentation/get-started/security-compliance.html +++ b/documentation/get-started/security-compliance.html @@ -17,7 +17,7 @@ - + @@ -39,7 +39,7 @@ partners to rapidly configure and pilot projects using the turnkey OpenFn cloud-hosted platform, before migrating to a local deployment when they’re ready to scale.

    Sample Architecture

    - + \ No newline at end of file diff --git a/documentation/get-started/security.html b/documentation/get-started/security.html index 1e7e04e4382b..2e84577e9c06 100644 --- a/documentation/get-started/security.html +++ b/documentation/get-started/security.html @@ -17,7 +17,7 @@ - + @@ -46,7 +46,7 @@ openfn.org/trust and openfn.org/compliance.

    Here are the key OpenFn templates and resources referenced in the Guidebook:

    Communities of practice & other experts

    Here are some other communities you may consider following for more security guidance.

    1. OpenHIE Privacy & Security Working Group
    2. GovStack
    3. DHIS2 Security Team & Community of Practice
    4. Asia eHealth Information Network (AeHIN) Communities of Practice
    - + \ No newline at end of file diff --git a/documentation/get-started/standards.html b/documentation/get-started/standards.html index 9d82c5d3d2e9..3bde824d6c61 100644 --- a/documentation/get-started/standards.html +++ b/documentation/get-started/standards.html @@ -17,7 +17,7 @@ - + @@ -72,7 +72,7 @@ quickly develop automation that reformats data received from CommCare and maps it to the DHIS2 data model.

    swisstph

    GovStack

    OpenFn is compliant with GovStack's standard specification for workflow engines.

    Pricinciples for Digital Development

    OpenFn was designed for the social sector and has been actively prioritizing the Principles of Digital Development since its inception.

    OpenFn solutions are:

    • interoperable (connect any application);
    • reusable (utilize existing OpenFn configurations as templates, or easily share, copy, and modify your own configurations; see docs.openfn.org/library);
    • sustainable (flexible implementation options with no lock-in);
    • scalable (OpenFn leverages enterprise-grade tech to handle high data volumes and provides a range of deployment options to ensure total solution ownership on any server);
    • promote open standards and open access (through our open-source software, documentation, and features to help users implement open standards in their information exchange solutions), and
    • address privacy & security.

    FHIR for health data exchange

    FHIR (pronounced "fire" 🔥) is a standard for health care data exchange, published by HL7®.

    OpenFn is used by health organizations to connect multiple FHIR- and non-FHIR compliant systems in a secure, stable, and scalable manner. OpenFn can facilitate 2 categories of FHIR workflows:

    1. Non-FHIR to FHIR Data Exchange

    OpenFn users can configure workflows to convert non-FHIR data to FHIR-compliant formats, and then route to FHIR systems.

    For example, get data from CommCare mobile app, convert to FHIR, and send to national health system's FHIR store. nonFHIR Workflow

    2. FHIR to FHIR Data Exchange

    OpenFn users can also configure Workflows to automate the exchange and routing of already FHIR-compliant data to other FHIR-compliant systems.

    For example, get data from OpenMRS's FHIR API, and forward to the national health system's FHIR store (no data transformation needed).

    FHIR Workflow

    FHIR Adaptors

    OpenFn adaptors aim to fast-track integration setup with target applications (including FHIR endpoints!). The core team is currently working on a suite of FHIR-specific adaptors to enable interoperability with FHIR systems.

    Version-specific adaptors (fhir-r4, fhir-r5) are coming soon!

    Other Data Standards

    OpenFn Workflows can automate data transformation, cleaning, and formatting rules to ensure compliance with your organization's specific standards.

    Ask on the community to explore how OpenFn can be leverage to help automate application and enforcement of other data standards.

    - + \ No newline at end of file diff --git a/documentation/get-started/terminology.html b/documentation/get-started/terminology.html index 6735765fb90b..074732088dcc 100644 --- a/documentation/get-started/terminology.html +++ b/documentation/get-started/terminology.html @@ -17,7 +17,7 @@ - + @@ -113,7 +113,7 @@ are either passed to the next Step in the workflow and/or to the connected destination app.

    Example Output if that form submission example (see above section) was mapped to a connected case management app:

    {
    "data": {
    "patient": {
    "full_name": "John Doe",
    "age_at_enrollment": 16,
    "type": "new",
    "source": "mobile-app"
    }
    }
    }
    - + \ No newline at end of file diff --git a/documentation/get-started/try-out.html b/documentation/get-started/try-out.html index f42f89a22439..cf603f7dad9d 100644 --- a/documentation/get-started/try-out.html +++ b/documentation/get-started/try-out.html @@ -17,7 +17,7 @@ - + @@ -39,7 +39,7 @@ github.com/OpenFn/lightning.

    Questions?

    Check out these docs for more details on specific features (see menu sidebar), browse the main docs page, or post your questions on Community.

    - + \ No newline at end of file diff --git a/documentation/hosted/overview.html b/documentation/hosted/overview.html index 3c9ea72d31de..6706ab2f6ca9 100644 --- a/documentation/hosted/overview.html +++ b/documentation/hosted/overview.html @@ -17,7 +17,7 @@ - + @@ -69,7 +69,7 @@ cycle ends as you have already pre-paid for usage during that cycle. When the cycle ends, the lower limits will be applied and your next charge will be for the price of your new plan.

    - + \ No newline at end of file diff --git a/documentation/jobs/javascript.html b/documentation/jobs/javascript.html index 1a2cd8c3d5d7..b9e846815ad2 100644 --- a/documentation/jobs/javascript.html +++ b/documentation/jobs/javascript.html @@ -17,7 +17,7 @@ - + @@ -79,7 +79,7 @@ expression. See the documentation on mapping specifications for more information on globals.

    //Workflow step 1
    //First we use fn() to tranform, map & clean our data
    fn(state => {

    //Global mapping rules you want to implement in your workflow
    const locationMap = {
    //location_id from source app: location value in destination app
    01: 'Western Cape',
    02: 'Eastern Cape',
    03: 'Gauteng'
    }

    // Here we build the payload of our http request body...
    // We assume the input is an array of records
    const payload = state.data.map(record => ({
    location: locationMap[record.location_id] //translate location_id to the mapped value
    external_id: record.case_id
    }));

    return {...state, payload};
    });

    //Workflow step 2
    //Then we post the payload built in the prior operation to create a record
    post('/api/myEndpoint', {
    headers: {
    'Content-Type': 'application/json',
    },
    body: (state) => state.payload
    });
    - + \ No newline at end of file diff --git a/documentation/jobs/job-examples.html b/documentation/jobs/job-examples.html index 9cc92da76cff..55e22c1e9577 100644 --- a/documentation/jobs/job-examples.html +++ b/documentation/jobs/job-examples.html @@ -17,7 +17,7 @@ - + @@ -40,7 +40,7 @@ language-common: combine

    Create many child records WITHOUT a repeat group in ODK

    beta.each(
    '$.data.data[*]',
    upsert(
    'Outlet__c',
    'Outlet_Code__c',
    fields(
    field('Outlet_Code__c', dataValue('outlet_code')),
    field('Location__Latitude__s', dataValue('gps:Latitude')),
    field('Location__Longitude__s', dataValue('gps:Longitude'))
    )
    )
    ),
    beta.each(
    '$.data.data[*]',
    upsert(
    'Outlet_Call__c',
    'Invoice_Number__c',
    fields(
    field('Invoice_Number__c', dataValue('invoice_number')),
    relationship('Outlet__r', 'Outlet_Code__c', dataValue('outlet_code')),
    relationship('RecordType', 'name', 'No Call Card'),
    field('Trip__c', 'a0FN0000008jPue'),
    relationship(
    'Sales_Person__r',
    'Sales_Rep_Code__c',
    dataValue('sales_rep_code')
    ),
    field('Date__c', dataValue('date')),
    field('Comments__c', dataValue('comments'))
    )
    )
    );

    Salesforce: perform an update

    update("Patient__c", fields(
    field("Id", dataValue("pathToSalesforceId")),
    field("Name__c", dataValue("patient.first_name")),
    field(...)
    ));

    Salesforce: Set record type using 'relationship(...)'

    create(
    'custom_obj__c',
    fields(
    relationship(
    'RecordType',
    'name',
    dataValue('submission_type'),
    field('name', dataValue('Name'))
    )
    )
    );

    Salesforce: Set record type using record Type ID

    each(
    '$.data.data[*]',
    create(
    'fancy_object__c',
    fields(
    field('RecordTypeId', '012110000008s19'),
    field('site_size', dataValue('size'))
    )
    )
    );

    Telerivet: Send SMS based on Salesforce workflow alert

    send(
    fields(
    field(
    'to_number',
    dataValue(
    'Envelope.Body.notifications.Notification.sObject.phone_number__c'
    )
    ),
    field('message_type', 'sms'),
    field('route_id', ''),
    field('content', function (state) {
    return 'Hey there. Your name is '.concat(
    dataValue('Envelope.Body.notifications.Notification.sObject.name__c')(
    state
    ),
    '.'
    );
    })
    )
    );

    HTTP: fetch but don't fail!

    // =============
    // We use "fetchWithErrors(...)" so that when the
    // SMS gateway returns an error the run does not "fail".
    // It "succeeds" and then delivers that error message
    // back to Salesforce with the "Update SMS Status" job.
    // =============
    fetchWithErrors({
    getEndpoint: 'send_to_contact',
    query: function (state) {
    return {
    msisdn:
    state.data.Envelope.Body.notifications.Notification.sObject
    .SMS__Phone_Number__c,
    message:
    state.data.Envelope.Body.notifications.Notification.sObject
    .SMS__Message__c,
    api_key: 'some-secret-key',
    };
    },
    externalId: state.data.Envelope.Body.notifications.Notification.sObject.Id,
    postUrl: 'https://www.openfn.org/inbox/another-secret-key',
    });

    Sample DHIS2 events API job:

    event(
    fields(
    field('program', 'eBAyeGv0exc'),
    field('orgUnit', 'DiszpKrYNg8'),
    field('eventDate', dataValue('properties.date')),
    field('status', 'COMPLETED'),
    field('storedBy', 'admin'),
    field('coordinate', {
    latitude: '59.8',
    longitude: '10.9',
    }),
    field('dataValues', function (state) {
    return [
    {
    dataElement: 'qrur9Dvnyt5',
    value: dataValue('properties.prop_a')(state),
    },
    {
    dataElement: 'oZg33kd9taw',
    value: dataValue('properties.prop_b')(state),
    },
    {
    dataElement: 'msodh3rEMJa',
    value: dataValue('properties.prop_c')(state),
    },
    ];
    })
    )
    );

    Sample DHIS2 data value sets API job:

    dataValueSet(
    fields(
    field('dataSet', 'pBOMPrpg1QX'),
    field('orgUnit', 'DiszpKrYNg8'),
    field('period', '201401'),
    field('completeData', dataValue('date')),
    field('dataValues', function (state) {
    return [
    { dataElement: 'f7n9E0hX8qk', value: dataValue('prop_a')(state) },
    { dataElement: 'Ix2HsbDMLea', value: dataValue('prop_b')(state) },
    { dataElement: 'eY5ehpbEsB7', value: dataValue('prop_c')(state) },
    ];
    })
    )
    );

    sample openMRS expression, creates a person and then a patient

    person(
    fields(
    field('gender', 'F'),
    field('names', function (state) {
    return [
    {
    givenName: dataValue('form.first_name')(state),
    familyName: dataValue('form.last_name')(state),
    },
    ];
    })
    )
    ),
    patient(
    fields(
    field('person', lastReferenceValue('uuid')),
    field('identifiers', function (state) {
    return [
    {
    identifier: '1234',
    identifierType: '8d79403a-c2cc-11de-8d13-0010c6dffd0f',
    location: '8d6c993e-c2cc-11de-8d13-0010c6dffd0f',
    preferred: true,
    },
    ];
    })
    )
    );

    merge many values into a child path

    each(
    merge(
    dataPath("CHILD_ARRAY[*]"),
    fields(
    field("metaId", dataValue("*meta-instance-id*")),
    field("parentId", lastReferenceValue("id"))
    )
    ),
    create(...)
    )

    arrayToString

    arrayToString(arr, separator_string);

    access an image URL from an ODK submission

    // In ODK the image URL is inside an image object...
    field("Photo_URL_text__c", dataValue("image.url")),

    alterState (alter state) to make sure data is in an array

    // Here, we make sure CommCare gives us an array to use in each(merge(...), ...)
    fn(state => {
    const idCards = state.data.form.ID_cards_given_to_vendor;
    if (!Array.isArray(idCards)) {
    state.data.form.ID_cards_given_to_vendor = [idCards];
    }
    return state;
    });

    // Now state has been changed, and we carry on...
    each(
    merge(
    dataPath('form.ID_cards_given_to_vendor[*]'),
    fields(
    field('Vendor_Id', dataValue('form.ID_vendor')),
    field('form_finished_time', dataValue('form.meta.timeEnd'))
    )
    ),
    upsert(
    'Small_Packet__c',
    'sp_id__c',
    fields(
    field('sp_id__c', dataValue('ID_cards_given_to_vendor')),
    relationship('Vendor__r', 'Badge_Code__c', dataValue('Vendor_Id')),
    field(
    'Small_Packet_Distribution_Date__c',
    dataValue('form_finished_time')
    )
    )
    )
    );

    Login in to a server with a custom SSL Certificate

    This snippet describes how you would connect to a secure server ignoring SSL certificate verification. Set strictSSL: false in the options argument of the post function in language-http.

    post(
    `${state.configuration.url}/${path}`,
    {
    headers: { 'content-type': 'application/json' },
    body: {
    email: 'Luka',
    password: 'somethingSecret',
    },
    strictSSL: false,
    },
    callback
    );
    - + \ No newline at end of file diff --git a/documentation/jobs/job-snippets.html b/documentation/jobs/job-snippets.html index 627d5e87a885..acb6f6da27b4 100644 --- a/documentation/jobs/job-snippets.html +++ b/documentation/jobs/job-snippets.html @@ -17,7 +17,7 @@ - + @@ -37,7 +37,7 @@ Salesforce, you're taking the id of the 1st thing, or 2nd thing if you replace "length-1" with "length-2".

    Salesforce

    Convert date string to standard ISO date for Salesforce

    field('Payment_Date__c', function (state) {
    return new Date(dataValue('payment_date')(state)).toISOString();
    });

    NOTE: The output of this function will always be formatted according to GMT time-zone.

    Use external ID fields for relationships during a bulk load in Salesforce

    array.map(item => {
    return {
    Patient_Name__c: item.fullName,
    'Account.Account_External_ID__c': item.account
    'Clinic__r.Unique_Clinic_Identifier__c': item.clinicId,
    'RecordType.Name': item.type,
    };
    });

    Bulk upsert with an external ID in Salesforce

    bulk(
    'Visit_new__c',
    'upsert',
    {
    extIdField: 'commcare_case_id__c',
    failOnError: true,
    allowNoOp: true,
    },
    dataValue('patients')
    );
    - + \ No newline at end of file diff --git a/documentation/jobs/job-writing-guide.html b/documentation/jobs/job-writing-guide.html index ea34daf710c8..d8b18550a650 100644 --- a/documentation/jobs/job-writing-guide.html +++ b/documentation/jobs/job-writing-guide.html @@ -17,7 +17,7 @@ - + @@ -290,7 +290,7 @@ Workflow Design Process docs.

    Questions?

    If you have any job-writing questions, ask on Community to seek assistance from the OpenFn core team and other implementers.

    - + \ No newline at end of file diff --git a/documentation/jobs/state.html b/documentation/jobs/state.html index bcb15d80919a..b92edb79cedb 100644 --- a/documentation/jobs/state.html +++ b/documentation/jobs/state.html @@ -17,7 +17,7 @@ - + @@ -55,7 +55,7 @@ operation.

    {
    data: { patients: [] },
    references: [1, 2, 3]
    }

    On failure

    When a step in a workflow fails, the error will be added to an errors object on state, keyed by the ID of the job that failed.

    {
    data: { patients: [] },
    references: [1, 2, 3],
    errors: {
    jobId: { /* error details */ }
    }
    }

    See the below diagram for a visual description of how state might be passed between Steps in a Workflow.

    Passing State

    - + \ No newline at end of file diff --git a/documentation/keyboard-shortcuts.html b/documentation/keyboard-shortcuts.html index 10de82deab2c..abb32aa71e70 100644 --- a/documentation/keyboard-shortcuts.html +++ b/documentation/keyboard-shortcuts.html @@ -17,7 +17,7 @@ - + @@ -32,7 +32,7 @@ alternate run button.

    Selected Editor Shortcuts

    See the command pallette (right click or press F1) for the full list. Note that to access these shortcuts you must click into a specific editor—there are multiple editors in the Inspector interface.

    CommandAvailabilityMacLinux/Windows
    View Editor CommandsInspector, Run ViewerF1F1
    Format CodeInspectorShift+Option+FShift+Alt+F
    Comment Code Out/InInspector⌘+/Ctrl+/
    - + \ No newline at end of file diff --git a/documentation/kobo-to-dhis2.html b/documentation/kobo-to-dhis2.html index 2890124bc76b..49a38dbee9ef 100644 --- a/documentation/kobo-to-dhis2.html +++ b/documentation/kobo-to-dhis2.html @@ -17,7 +17,7 @@ - + @@ -71,7 +71,7 @@ Introduction to Workflows and History tutorial or post your questions on the Community to get help!

    - + \ No newline at end of file diff --git a/documentation/legacy.html b/documentation/legacy.html index 9407b657876c..5961b0d9d21f 100644 --- a/documentation/legacy.html +++ b/documentation/legacy.html @@ -17,7 +17,7 @@ - + @@ -70,7 +70,7 @@ community.openfn.org. Sign up and join the conversation. Usually, that's the quickest way to get help if you've got questions that aren't answered here.

    - + \ No newline at end of file diff --git a/documentation/legacy/about-lightning.html b/documentation/legacy/about-lightning.html index 43fb014966eb..6cf0cd3bb0fd 100644 --- a/documentation/legacy/about-lightning.html +++ b/documentation/legacy/about-lightning.html @@ -17,7 +17,7 @@ - + @@ -137,7 +137,7 @@ OpenFn Community.

    When will Lightning Beta be ready?

    Lightning is currently in Beta. You can register for an account on app.openfn.org. Lightning will be released in Q4 2023.

    - + \ No newline at end of file diff --git a/documentation/legacy/about.html b/documentation/legacy/about.html index 6b5ff8c5155b..264f409f384e 100644 --- a/documentation/legacy/about.html +++ b/documentation/legacy/about.html @@ -17,7 +17,7 @@ - + @@ -29,7 +29,7 @@ and a huge number of open-source workflow automation, data integration, and "ETL" tools which you can find on our GitHub.

    The platform is trusted by some of the leading development organizations in the world, including UNICEF, the WHO, the IRC, and Population Council.

    You can learn more about the people at Open Function Group here.

    - + \ No newline at end of file diff --git a/documentation/legacy/build/credentials.html b/documentation/legacy/build/credentials.html index 8a515d3b0093..40a81d1d8783 100644 --- a/documentation/legacy/build/credentials.html +++ b/documentation/legacy/build/credentials.html @@ -17,7 +17,7 @@ - + @@ -38,7 +38,7 @@ and checking for the value of a predetermined identifier. Based on that value, present in the data for a given source message, for example, another credential will be selected and applied for that particular job run.

    - + \ No newline at end of file diff --git a/documentation/legacy/build/example-build.html b/documentation/legacy/build/example-build.html index cfa2d1eabf58..682d9a33ca36 100644 --- a/documentation/legacy/build/example-build.html +++ b/documentation/legacy/build/example-build.html @@ -17,7 +17,7 @@ - + @@ -95,7 +95,7 @@ every time a message matches the trigger inclusion criteria, turn on auto-process.

    autoprocess

    You're all set! Try out your job by submitting another form response to see the data automatically populate your google sheet.

    - + \ No newline at end of file diff --git a/documentation/legacy/build/inbox.html b/documentation/legacy/build/inbox.html index bc4068e7d94d..621557821fb4 100644 --- a/documentation/legacy/build/inbox.html +++ b/documentation/legacy/build/inbox.html @@ -17,7 +17,7 @@ - + @@ -61,7 +61,7 @@ 5XX. This is not recommended for high volume systems, but may be a requirement for some implementations; the sprit of OpenFn/microservice is to give as much control as possible to whoever is deploying it on their servers.

    - + \ No newline at end of file diff --git a/documentation/legacy/build/jobs.html b/documentation/legacy/build/jobs.html index 770e870495f7..421ca594be56 100644 --- a/documentation/legacy/build/jobs.html +++ b/documentation/legacy/build/jobs.html @@ -17,7 +17,7 @@ - + @@ -140,7 +140,7 @@ Salesforce, you're taking the id of the 1st thing, or 2nd thing if you replace "length-1" with "length-2".

    Convert date string to standard ISO date for Salesforce

    field('Payment_Date__c', function (state) {
    return new Date(dataValue('payment_date')(state)).toISOString();
    });

    NOTE: The output of this function will always be formatted according to GMT time-zone.

    Use external ID fields for relationships during a bulk load in Salesforce

    array.map(item => {
    return {
    Patient_Name__c: item.fullName,
    'Account.Account_External_ID__c': item.account
    'Clinic__r.Unique_Clinic_Identifier__c': item.clinicId,
    'RecordType.Name': item.type,
    };
    });

    Bulk upsert with an external ID in salesforce

    bulk(
    'Visit_new__c',
    'upsert',
    {
    extIdField: 'commcare_case_id__c',
    failOnError: true,
    allowNoOp: true,
    },
    dataValue('patients')
    );
    - + \ No newline at end of file diff --git a/documentation/legacy/build/lightning-quick-start.html b/documentation/legacy/build/lightning-quick-start.html index 3fa66a9d751b..beaf27f1a653 100644 --- a/documentation/legacy/build/lightning-quick-start.html +++ b/documentation/legacy/build/lightning-quick-start.html @@ -17,7 +17,7 @@ - + @@ -94,7 +94,7 @@ Give it a go, and don't forget to post on our community forum if you get stuck - or to let us know what you built.

    - + \ No newline at end of file diff --git a/documentation/legacy/build/triggers.html b/documentation/legacy/build/triggers.html index b3e7b72fac51..b152edd4aa32 100644 --- a/documentation/legacy/build/triggers.html +++ b/documentation/legacy/build/triggers.html @@ -17,7 +17,7 @@ - + @@ -78,7 +78,7 @@ but we then want to start excluding those that have body.survey_type == 'practice'. Our filter trigger would look need to like this:

    inclusionexclusion
    { "form": "bns_survey" }{"body": {"survey_type": "practice"}}

    We'd set it up from the trigger form like this:

    img

    And verify the result on the inbox:

    img

    - + \ No newline at end of file diff --git a/documentation/legacy/build/troubleshooting.html b/documentation/legacy/build/troubleshooting.html index 142f3a99cfbb..49f8ec0ac2c0 100644 --- a/documentation/legacy/build/troubleshooting.html +++ b/documentation/legacy/build/troubleshooting.html @@ -17,7 +17,7 @@ - + @@ -75,7 +75,7 @@ and enable a better "OK, how should we solve this given the current chronological and commercial constraints" conversation between the Implementation Team and the Engineering Team.

    - + \ No newline at end of file diff --git a/documentation/legacy/cli.html b/documentation/legacy/cli.html index 115b08a29f6c..51e229088370 100644 --- a/documentation/legacy/cli.html +++ b/documentation/legacy/cli.html @@ -17,7 +17,7 @@ - + @@ -161,7 +161,7 @@ will do a number of things to make your code robust, portable, and easier to debug from a pure JS perspective.

    openfn compile [path]

    Will compile the openfn job and print or save the resulting js.

    Learn more about CLI github.com/OpenFn/kit/

    - + \ No newline at end of file diff --git a/documentation/legacy/core.html b/documentation/legacy/core.html index 68db5eaf0cad..28f62b327dc8 100644 --- a/documentation/legacy/core.html +++ b/documentation/legacy/core.html @@ -17,7 +17,7 @@ - + @@ -35,7 +35,7 @@ be incredibly helpful for debugging.

    Using the new CLI.

    If you're a new OpenFn user and want to build or test jobs for Lighting (v2) and beyond in 2023, use the new CLI instead!

    How do I use it?

    Check out the official documentation on GitHub.

    The tl;dr: is that you execute jobs from the command line by passing in an expression, state, and the path to an adaptor.

    npm install @openfn/core
    core execute -l ../language-http.Adaptor -e ./some-exprsesion.js -s ./some-state.json

    The full options are:

    -l, --language    resolvable language/adaptor path                [required]
    -e, --expression target expression to execute [required]
    -s, --state Path to initial state file. [required]
    -o, --output Path to write result from expression
    -t, --test Intercepts and logs all HTTP requests to console
    - + \ No newline at end of file diff --git a/documentation/legacy/deploy/options.html b/documentation/legacy/deploy/options.html index c939c93adce3..1391fa81d33b 100644 --- a/documentation/legacy/deploy/options.html +++ b/documentation/legacy/deploy/options.html @@ -17,7 +17,7 @@ - + @@ -63,7 +63,7 @@ the export).
  • Test your locally deployed project.
  • Technical Guidelines

    For detailed deployment documentation instructions, head to the Lightning developer docs page, paying special attention to several sections:

    1. Getting Started
    2. Deployment Considerations
    3. Benchmarking
    - + \ No newline at end of file diff --git a/documentation/legacy/deploy/requirements.html b/documentation/legacy/deploy/requirements.html index 90e515ec9006..9b916321aa83 100644 --- a/documentation/legacy/deploy/requirements.html +++ b/documentation/legacy/deploy/requirements.html @@ -17,7 +17,7 @@ - + @@ -71,7 +71,7 @@ specialist, the following sample configurations may provide useful starting points.

    (a) Simple

    Deploy the application and database on the same machine.

    Deploy the application and database on separate machines.

    (c) Ideal

    Auto-scale different optimized node pools in a Kubernetes cluster for the Erlang orchestration app and the Javascript worker app.

    Consider high-availability Postgres-as-a-service, or also run it in a cluster.

    - + \ No newline at end of file diff --git a/documentation/legacy/design/design-quickstart.html b/documentation/legacy/design/design-quickstart.html index 883e76659692..891e83debeaf 100644 --- a/documentation/legacy/design/design-quickstart.html +++ b/documentation/legacy/design/design-quickstart.html @@ -17,7 +17,7 @@ - + @@ -104,7 +104,7 @@ implementing partners.

    Share this documentation with any technical implementation team, or check out the Build documentation section to learn how to implement these design specifications using OpenFn.

    - + \ No newline at end of file diff --git a/documentation/legacy/design/when-to-integrate.html b/documentation/legacy/design/when-to-integrate.html index f86c6eac2ef4..8196c98bbccb 100644 --- a/documentation/legacy/design/when-to-integrate.html +++ b/documentation/legacy/design/when-to-integrate.html @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@
    - + \ No newline at end of file diff --git a/documentation/legacy/devtools/home.html b/documentation/legacy/devtools/home.html index 2d6486c6bbda..3069698dc63a 100644 --- a/documentation/legacy/devtools/home.html +++ b/documentation/legacy/devtools/home.html @@ -17,7 +17,7 @@ - + @@ -112,7 +112,7 @@ access token in GitHub.

    In your ~/.bash_profile or ~/.zshrc file, export the newly created token by adding this line:

    export GH_TOKEN=<TOKEN>

    Using a new adaptor in an OpenFn/platform instance

    1. Add your release to the scripts/install-lp script.
    2. Add the version number to priv/adaptors.json.
    3. Add the bodySchema to CredentialView.js.
    - + \ No newline at end of file diff --git a/documentation/legacy/faqs.html b/documentation/legacy/faqs.html index cbd920f7cc15..b00f5fdc07ef 100644 --- a/documentation/legacy/faqs.html +++ b/documentation/legacy/faqs.html @@ -17,7 +17,7 @@ - + @@ -163,7 +163,7 @@ this page to talk now. Or Email our team at admin@openfn.org, chat us on OpenFn.org, or post a question in our Community Forum.

    - + \ No newline at end of file diff --git a/documentation/legacy/for-devs.html b/documentation/legacy/for-devs.html index 4543b7720763..b2a63cf90534 100644 --- a/documentation/legacy/for-devs.html +++ b/documentation/legacy/for-devs.html @@ -17,7 +17,7 @@ - + @@ -66,7 +66,7 @@ must allow either basic, token, or digest authenticated POST, PUT, or GET requests. (Though it is not advisable to create an API that requires GET requests to create or update data.)

    - + \ No newline at end of file diff --git a/documentation/legacy/getting-started/commcare-project-walkthrough.html b/documentation/legacy/getting-started/commcare-project-walkthrough.html index 2a14e29939cd..4ccbd14751ee 100644 --- a/documentation/legacy/getting-started/commcare-project-walkthrough.html +++ b/documentation/legacy/getting-started/commcare-project-walkthrough.html @@ -17,7 +17,7 @@ - + @@ -96,7 +96,7 @@ follow these same steps for other database types (e.g., MS SQL or MySQL)—simply leverage a different adaptor in your job configuration.

    Other resources to check out:

    1. OpenFn Job Library
    2. OpenFn Docs ‘App’ pages for CommCare and Postgres

    Any questions? Comments? New configuration ideas? Please reach out to us with a post on the OpenFn Community forum.

    - + \ No newline at end of file diff --git a/documentation/legacy/getting-started/glossary.html b/documentation/legacy/getting-started/glossary.html index 70c76c4bc1a0..9992fe4978ce 100644 --- a/documentation/legacy/getting-started/glossary.html +++ b/documentation/legacy/getting-started/glossary.html @@ -17,7 +17,7 @@ - + @@ -93,7 +93,7 @@ data type, field size, and so on.

    Writeback

    Refers to a destination system making a change in a data source. When my destination application receives information from a data source and wants to do something back to the source in response, that's writeback.

    - + \ No newline at end of file diff --git a/documentation/legacy/getting-started/implementation-checklist.html b/documentation/legacy/getting-started/implementation-checklist.html index 55819e63a285..447ac8be0a8b 100644 --- a/documentation/legacy/getting-started/implementation-checklist.html +++ b/documentation/legacy/getting-started/implementation-checklist.html @@ -17,7 +17,7 @@ - + @@ -39,7 +39,7 @@ Read about mapping specs here..
  • Data element mapping specifications finalized (functional/business-friendly version)
  • Client sign-offs on workflow diagram & mapping specs
  • Workflow assumptions documented (e.g., what human, manual steps does the workflow rely on; what are the unique identifiers)
  • Testing scenarios drafted
  • (3) Discovery & Design - Technical Specifications

    • Documentation on APIs or target connection points secured
    • Connection points & authentication methods confirmed
    • Access secured to developer/sandbox environments for testing
    • Authentication and authorization methods & credentials tested
    • Target API endpoints determined based on functional specifications & review of API docs
    • Target API endpoints tested to validate the functional data element specifications can be delivered
    • Workflow BPMN diagram capturing the technical steps of the workflow finalized
    • Technical version of data element mapping specifications created
    • Workflow assumptions updated to include any technical considerations
    • Test scenarios updated to include any technical considerations
    • Project Security Configuration Checklist drafted to capture data security & compliance considerations
    • GitHub repository created
    • Job specifications written for developers

    (4) Build

    • OpenFn platform: project space created & relevant users invited
    • OpenFn platform: Jobs, triggers, and credentials configured
    • OpenFn platform: Version control configured to connect GitHub repo
    • Jobs written & pushed to branch on GitHub
    • Job code review complete and merged to main branch on GitHub
    • OpenFn platform: GitHub paths updated on each job to link to source file
    • Test data created (if needed)
    • Engineer updates mapping specifications (if needed)

    (5) Testing

    • Testing Round 1: Developers run jobs locally with sample data provided
    • Testing Round 2: Analysts complete Test Scenarios & run jobs on platform
    • Iteration: Analysts submit feedback to developers & re-test
    • UAT Round 1: Client completes Test Scenarios
    • Iteration: Analysts submit feedback to developers & re-test
    • UAT Round 2 (if needed): Client completes Test Scenarios
    • Iteration: Analysts submit feedback to developers & re-test

    (6) Training & Prep for Go-Live

    • Training materials drafted for client administrators
    • Documentation drafted, and all project artefacts/docs linked
    • Project Security Configuration Checklist reviewed to determine if any configuration changes or settings need to be implemented post-testing
    • Confirm that production system(s) have been configured
    • Production credentials secured & tested (authentication & authorization)
    • OpenFn platform: "production" project created (cloned from "staging" project), job configuration migrated, & jobs connected to production credentials
    • OpenFn administrator users & access levels confirmed and granted?
    • Support POCs identified for each target system?
    • Establish support structures & governance model for change management
    • Training session delivered to designated OpenFn and target system administrators and any other ToTs

    Rollout & Support

    • Go Live: Turn "on" OpenFn jobs in production platform project so that the workflow is now live in production systems
    • Confirm administrators have OpenFn notifications turned on to "Each Time" so that they will receive failure notifications (see OpenFn Account Settings)
    • Communicate to end users as needed about the go-live and its implications

    Questions or feedback?

    If you have any inputs, comments, or questions–please contribute! Submit a pull request to this documentation page or leave a comment in OpenFn Community.

    - + \ No newline at end of file diff --git a/documentation/legacy/getting-started/integrating-using-openfn.html b/documentation/legacy/getting-started/integrating-using-openfn.html index 4cc6600eb0ff..fb829fbf92a9 100644 --- a/documentation/legacy/getting-started/integrating-using-openfn.html +++ b/documentation/legacy/getting-started/integrating-using-openfn.html @@ -17,7 +17,7 @@ - + @@ -29,7 +29,7 @@ Why->not our problem/data mapping How->All of this stuff How safely->Credentials

    - + \ No newline at end of file diff --git a/documentation/legacy/getting-started/integration-toolkit.html b/documentation/legacy/getting-started/integration-toolkit.html index 420b9b57b863..55d0088d5079 100644 --- a/documentation/legacy/getting-started/integration-toolkit.html +++ b/documentation/legacy/getting-started/integration-toolkit.html @@ -17,7 +17,7 @@ - + @@ -69,7 +69,7 @@ changes.

    The OSSC's membership and decision making process are defined in the OSSC's internal governance policy if if you're interested in joining, we'd love to hear from you!

    - + \ No newline at end of file diff --git a/documentation/legacy/getting-started/security.html b/documentation/legacy/getting-started/security.html index 4010fcb76948..8842f6a11f1f 100644 --- a/documentation/legacy/getting-started/security.html +++ b/documentation/legacy/getting-started/security.html @@ -17,7 +17,7 @@ - + @@ -46,7 +46,7 @@ openfn.org/trust and openfn.org/compliance.

    Here are the key OpenFn templates and resources referenced in the Guidebook:

    Communities of practice & other experts

    Here are some other communities you may consider following for more security guidance.

    1. OpenHIE Privacy & Security Working Group
    2. GovStack
    3. DHIS2 Security Team & Community of Practice
    4. Asia eHealth Information Network (AeHIN) Communities of Practice
    - + \ No newline at end of file diff --git a/documentation/legacy/getting-started/so-you-want-to-integrate.html b/documentation/legacy/getting-started/so-you-want-to-integrate.html index ac59f4edb365..c59170234d1b 100644 --- a/documentation/legacy/getting-started/so-you-want-to-integrate.html +++ b/documentation/legacy/getting-started/so-you-want-to-integrate.html @@ -17,7 +17,7 @@ - + @@ -33,7 +33,7 @@ it is you really want before you start writing (or borrowing) a job.

    There are plenty of different reasons to integrate your data systems. Maybe you -want one "master" view that you or your clients can trust as a source of truth.

    Maybe you want to automate some data viz that you currently have to do manually.

    Or maybe you just want to expose a small slice of data from one user group to a +want one "master" view that you or your clients can trust as a source of truth.

    Maybe you want to automate some data viz that you currently have to do manually.

    Or maybe you just want to expose a small slice of data from one user group to a different app used exclusively by some other part of your company.

    Regardless of the reason, what every integration boils down to is connecting two or more disconnected applications. But as you can see, not all integrations look alike. This basic structure comes in many shapes and sizes. There's plenty of @@ -42,7 +42,7 @@ any integration and weigh potential outcomes of design decisions against that ultimate goal.

    1. When you move the data.

    Usually, you can articulate the best case scenario here in plain English pretty easily.

    I want Salesforce to ___ when one of our field workers submits a new -CommCare form.

    or

    I want Postgres to ___ every two weeks.

    A crucial difference between these two whens is that the first turns on an +CommCare form.

    or

    I want Postgres to ___ every two weeks.

    A crucial difference between these two whens is that the first turns on an action, whereas the second is based on a set period of time, regardless of what happens in that window.

    1. How you move the data, namely whether the destination system is pulling or the source system is pushing (or some other pattern), what format the data @@ -63,7 +63,7 @@ this slice of the world as authentication.

      These are all very important questions to consider when designing an integration. Check out our docs on integration design to learn more about how we begin to answer these questions and more:

      - + \ No newline at end of file diff --git a/documentation/legacy/getting-started/terminology.html b/documentation/legacy/getting-started/terminology.html index 7deeda52ca39..8e79e5f6823f 100644 --- a/documentation/legacy/getting-started/terminology.html +++ b/documentation/legacy/getting-started/terminology.html @@ -17,7 +17,7 @@ - + @@ -98,7 +98,7 @@ for that message, and this third run succeeded, you'd still only see 2 "job-states" in the inbox, but they'd both be successful:

      1. Referral (success - run 1)
      2. Payment (success - run 3)

      Browsing to the receipt inspector would show all three runs for this single message.

      - + \ No newline at end of file diff --git a/documentation/legacy/gsoc.html b/documentation/legacy/gsoc.html index 024dd95ed6e4..81be319e59dc 100644 --- a/documentation/legacy/gsoc.html +++ b/documentation/legacy/gsoc.html @@ -17,7 +17,7 @@ - + @@ -64,7 +64,7 @@ community.openfn.org for more information.

      Difficulty level: medium

      You'll be working in NodeJs and Typescript.

      - + \ No newline at end of file diff --git a/documentation/legacy/instant-openhie.html b/documentation/legacy/instant-openhie.html index 895030e6f013..ba32cf70185c 100644 --- a/documentation/legacy/instant-openhie.html +++ b/documentation/legacy/instant-openhie.html @@ -17,7 +17,7 @@ - + @@ -177,7 +177,7 @@ the microservice endpoint (localhost:4001/inbox) and checking to see that resources are created in HAPI FHIR.
    2. Note how the test.js file handles this verification with the sample project.yaml
    3. - + \ No newline at end of file diff --git a/documentation/legacy/jobs/each.html b/documentation/legacy/jobs/each.html index 9b5bca8d1094..9926005e74d4 100644 --- a/documentation/legacy/jobs/each.html +++ b/documentation/legacy/jobs/each.html @@ -17,7 +17,7 @@ - + @@ -49,7 +49,7 @@ the data, and then create new records for each item in the second repeat group. Using beta.each(...) lets you enter the first array, create your records, then return to the top level and be able to enter the second array.

      // create some schools from the state.data.form.schools array...
      beta.each(
      dataPath('form.schools[*]'),
      upsert(
      'School__c',
      'School_ID__c',
      fields(
      field('School_ID__c', dataValue('schoolId')),
      field('School_Name__c', dataValue('schoolName')),
      )
      )
      );

      // back up at the top level, we scope the next array with each...
      beta.each(
      dataPath('form.participants[*]'),
      upsert(
      'Person__c',
      'Participant_Identification_Number_PID__c',
      fields(
      field('Participant_Identification_Number_PID__c', dataValue('pid')),
      relationship('RecordType', 'Name', 'Participant'),
      field('First_Name__c', dataValue('participant_first_name')),
      field('Surname__c', dataValue('participant_surname')),
      field('Mobile_Number_1__c', dataValue('mobile_number'))
      field('Sex__c', dataValue('gender')),
      )
      )
      );
      - + \ No newline at end of file diff --git a/documentation/legacy/jobs/editing_locally.html b/documentation/legacy/jobs/editing_locally.html index 83f749fe35f2..9e9dc2ab729e 100644 --- a/documentation/legacy/jobs/editing_locally.html +++ b/documentation/legacy/jobs/editing_locally.html @@ -17,7 +17,7 @@ - + @@ -50,7 +50,7 @@ git docs).

    From there, the version control integration will update changed jobs in your OpenFn project and you can test those changes on the platform.

    Once you're ready to start running jobs and testing your changes locally, head over to the The CLI docs for guidance.

    - + \ No newline at end of file diff --git a/documentation/legacy/jobs/errors.html b/documentation/legacy/jobs/errors.html index db06e4d3e9d0..7c165861bb59 100644 --- a/documentation/legacy/jobs/errors.html +++ b/documentation/legacy/jobs/errors.html @@ -17,7 +17,7 @@ - + @@ -50,7 +50,7 @@ subsequently aborted by request of an administrator or owner of that project.

    11: Node.js Error

    Exit code 11 means that there was an error in the NodeVM execution but the exit code itself couldn't be captured by our application.

    Limits

    We've shifted this content to a dedicated limits page.

    NodeVM memory limits

    Job state limits

    - + \ No newline at end of file diff --git a/documentation/legacy/jobs/job-design-intro.html b/documentation/legacy/jobs/job-design-intro.html index 459c4b734822..c75629e2543b 100644 --- a/documentation/legacy/jobs/job-design-intro.html +++ b/documentation/legacy/jobs/job-design-intro.html @@ -17,7 +17,7 @@ - + @@ -41,7 +41,7 @@ doesn’t; references an external Id b. Example from language-dhis2 using Tracked Entity Instances (TEI)
  • updateTEI(...)
  • upsertTEI(...)
  • Example upsert job:

    upsert('mainDataTable', 'AnswerId', {
      AnswerId: dataValue('\_id'), //external Id for upsert
      column: dataValue('firstQuestion)'),
      LastUpdate: new Date().toISOString(),
      Participant: dataValue('participant'),
      Surveyor: dataValue('surveyor'),
      ...
    });
    - + \ No newline at end of file diff --git a/documentation/legacy/jobs/job-studio.html b/documentation/legacy/jobs/job-studio.html index 729899ec345c..71c4de58024d 100644 --- a/documentation/legacy/jobs/job-studio.html +++ b/documentation/legacy/jobs/job-studio.html @@ -17,7 +17,7 @@ - + @@ -32,7 +32,7 @@ paste it as a dataValue in your job.

    You can find a list of avaible helper functions for your chosen adaptor in the job writing panel heading. Clicking the function name copies the function code that you can directly paste into the job.

    Job_Studio_Edit

    By clicking "Save and Run" run logs are shown real-time in the Output panel.

    Stream

    - + \ No newline at end of file diff --git a/documentation/legacy/jobs/limits.html b/documentation/legacy/jobs/limits.html index 04d258be73e2..9efe82803a63 100644 --- a/documentation/legacy/jobs/limits.html +++ b/documentation/legacy/jobs/limits.html @@ -17,7 +17,7 @@ - + @@ -46,7 +46,7 @@ a CRON job, remains below 10MB.

    Sometimes, this necessitates streaming data from A -> B in the same job. Other times it will necessitate storing data as local variables and then posting data to your inbox in chunks before cleaning up state.

    - + \ No newline at end of file diff --git a/documentation/legacy/jobs/multiple-operations.html b/documentation/legacy/jobs/multiple-operations.html index 0a986bc58696..1da1f302061e 100644 --- a/documentation/legacy/jobs/multiple-operations.html +++ b/documentation/legacy/jobs/multiple-operations.html @@ -17,7 +17,7 @@ - + @@ -37,7 +37,7 @@ job be triggered by a message filter.

    get('somePath', { query: { after: '2020-10-12' } }, post('my-inbox-uuid'));
    • You'd like to store the result of the first operation for later use or inspection and not have to retry that operation in order to reproduce the data.
    • You don't care about small delays between the first and second job being run.
    - + \ No newline at end of file diff --git a/documentation/legacy/jobs/operations.html b/documentation/legacy/jobs/operations.html index 51f1e4a8eb2b..62f483289737 100644 --- a/documentation/legacy/jobs/operations.html +++ b/documentation/legacy/jobs/operations.html @@ -17,7 +17,7 @@ - + @@ -31,7 +31,7 @@ credentials, or any dynamic data that you may be available at runtime.

    function create(objectName, data) {
    return function (state) {
    // expand the data argument using state
    // actually do the work
    };
    }

    In this snippet is a simple example of what most functions in OpenFn look like. The create function returns a function that takes state, this is an Operation. The runtime using execute will call all Operations with state.

    - + \ No newline at end of file diff --git a/documentation/legacy/jobs/state.html b/documentation/legacy/jobs/state.html index 98adb1e92167..cef10548de07 100644 --- a/documentation/legacy/jobs/state.html +++ b/documentation/legacy/jobs/state.html @@ -17,7 +17,7 @@ - + @@ -37,7 +37,7 @@ will instead receive the initial state of the previous (failed) run, plus a new error key that contains the stringified logs from the previous run. See below for details.

    States by job trigger type

    Triggering EventInitial State
    http request{ data: httpRequest.body, configuration: job.credential.body }
    cron{ ...finalStateOfLastSuccessfulRun, configuration: job.credential.body }
    flow: success{ ...finalStateOfTriggeringRun, configuration: job.credential.body }
    flow: failure{ ...initialStateOfTriggeringRun, error: logsFromTriggeringRun, configuration: job.credential.body }
    - + \ No newline at end of file diff --git a/documentation/legacy/jobs/understanding.html b/documentation/legacy/jobs/understanding.html index aabdbb9b533c..f31c81baff52 100644 --- a/documentation/legacy/jobs/understanding.html +++ b/documentation/legacy/jobs/understanding.html @@ -17,7 +17,7 @@ - + @@ -40,7 +40,7 @@ inside an alterState operation, but WAIT for those functions to resolve before moving on to your next operation. If execute doesn't work for your use case, you could use Promise.all and return an async function.

    fn(state => {
    console.log('Here we will await the result of a LOT of async operations.');
    console.log('First we define a bunch of different async functions.');
    const postClinics = async c => {
    return post(state.configuration.inboxUrl, {
    body: { clinics: c },
    })(state);
    };

    const postPatients = async p => {
    return post(state.configuration.inboxUrl, {
    body: { patients: p },
    })(state);
    };

    const postVisits = async v => {
    return post(state.configuration.inboxUrl, {
    body: { visits: v },
    })(state);
    };

    console.log(
    'Then we define a single function that wraps them all up and waits for all the individual functions to resolve.'
    );
    async function makePosts() {
    return Promise.all([
    ...state.data.clinicSets.map(item => postClinics(item)),
    ...state.data.patientSets.map(item => postPatients(item)),
    ...state.data.visitSets.map(item => postVisits(item)),
    ]);
    }

    console.log(
    'Then we return that function, forcing our next operation to await the result of this one.'
    );
    return makePosts();
    });

    fn(state => {
    console.log('I get called AFTER those async functions are resolved.');
    return state;
    });
    - + \ No newline at end of file diff --git a/documentation/legacy/jobs/working_with_branches.html b/documentation/legacy/jobs/working_with_branches.html index 995922ec4cf4..2def09641337 100644 --- a/documentation/legacy/jobs/working_with_branches.html +++ b/documentation/legacy/jobs/working_with_branches.html @@ -17,7 +17,7 @@ - + @@ -45,7 +45,7 @@ with git checkout main and hit git pull to pull any changes.

  • If you're still working on your separate branch while main has been updated, use git checkout {branch_name} followed by git merge main to copy over new changes from main to your branch.

  • - + \ No newline at end of file diff --git a/documentation/legacy/manage/platform-mgmt.html b/documentation/legacy/manage/platform-mgmt.html index 8152c9bf79f8..1b713d1c73d2 100644 --- a/documentation/legacy/manage/platform-mgmt.html +++ b/documentation/legacy/manage/platform-mgmt.html @@ -17,7 +17,7 @@ - + @@ -370,7 +370,7 @@ selecting that version (by its commit date and SHA) on the job view page. A new commit will be made, updating the job to the state it was in at the time of the old commit.

    - + \ No newline at end of file diff --git a/documentation/legacy/manage/troubleshooting-tips-on-platform.html b/documentation/legacy/manage/troubleshooting-tips-on-platform.html index d4578b0972a6..f0e82a04009a 100644 --- a/documentation/legacy/manage/troubleshooting-tips-on-platform.html +++ b/documentation/legacy/manage/troubleshooting-tips-on-platform.html @@ -17,7 +17,7 @@ - + @@ -113,7 +113,7 @@ editing and re-submission of data. You can use OpenFn to edit the source data before retrying the attempt.

    Common Error Messages

    The most common error messages with English explanations are:

    DUPLICATE_VALUE: duplicate value found: ODK_uuid__c duplicates value on record with id: a0524000005wNw0
    The insert is blocked because you are attempting to create a new record with a
    unique field with the same value as an existing record.
    Required value missing
    ExternalId not found
    { INVALID_FIELD_FOR_INSERT_UPDATE: Unable to create/update fields: Contact__c.
    Please check the security settings of this field and verify that it is
    read/write for your profile or permission set. }

    This last one may arise if a master-detail relationship in Salesforce is not set as reparentable and the user attempts to run an upsert.

    - + \ No newline at end of file diff --git a/documentation/legacy/microservice/home.html b/documentation/legacy/microservice/home.html index a95c74565594..7260d7d3c35c 100644 --- a/documentation/legacy/microservice/home.html +++ b/documentation/legacy/microservice/home.html @@ -17,7 +17,7 @@ - + @@ -77,7 +77,7 @@ Development Up and Running Guide.

  • If you export as microservice.zip, you'll get your microservice folder ready to run with docker, containing

    • a docker-compose.yaml config file
    • a project folder containing project.yaml
    • .env file with the default environment variables for docker
    • a Readme file

    cd into the folder and run the project with docker-compose up. If you don't have the docker image, it will be auto-pulled from hub.docker.com.

    Export Microservice Zip

    - + \ No newline at end of file diff --git a/documentation/legacy/openfn-roadmap.html b/documentation/legacy/openfn-roadmap.html index 337afe7c06d9..a1fb91a2b1ee 100644 --- a/documentation/legacy/openfn-roadmap.html +++ b/documentation/legacy/openfn-roadmap.html @@ -17,7 +17,7 @@ - + @@ -35,7 +35,7 @@ community.openfn.org, or consider contributing to the OpenFn software, adaptors, or documentation (learn more in the Contributing section).

    - + \ No newline at end of file diff --git a/documentation/legacy/portability-versions.html b/documentation/legacy/portability-versions.html index 9dc2c3176b35..98fe2b289a0c 100644 --- a/documentation/legacy/portability-versions.html +++ b/documentation/legacy/portability-versions.html @@ -17,7 +17,7 @@ - + @@ -36,7 +36,7 @@ Digital Square Global Goods grant.

    The project.zip structure and files:

    /globals
    sample-clinic-map.json
    sample-translations.json
    /workflow-a
    job-1.js
    job-2.js
    job-3.js
    /workflow-b
    job-4.js
    project.yaml
    project.state.yaml

    The project.yaml:

    name: "My Project" # The project name

    globals: # All global constants accessible to this project
    clinic-map: file://./globals/clinic-map.json
    project-expense-codes: file://./globals/project-expense-codes.json
    service-codes:
    body:
    m126: Medical Referral
    g01: General Checkup
    ps: Psycho-social Support

    workflows: # All workflows in a project
    CommCare-to-OpenMRS: #The workflow name. Workflow names won't have spaces
    jobs: # All jobs/steps in a workflow
    Coerce-to-FHIR: # The job/step name
    trigger: webhook #webhook urls are uids so are not included
    adaptor: language-fhir
    enabled: true
    credential: my-fihr-credential #looks up credential in state by its name
    # when running locally, the credentials values are taken from the overrides file
    # cli run workflow "CommCare-to-OpenMRS" --overrides ./keys-and-values.yaml
    body: "file://./CommCare-to-OpenMRS/Coerce-to-FHIR.js" # each job job-body is stored in a separate file, within a folder for the whole workflow

    Load-to-openmrs:
    trigger:
    on-success: Coerce-to-FHIR
    adaptor: language-openmrs
    credential: my-other-credential
    enabled: true
    body:
    # no "include", but pathlike doesn't work: if you're doing a uri you need to be explicit about it
    # default to local fs -- no numbering because too complicated if users change the order
    "file://./CommCare-to-OpenMRS/Load-to-openmrs.js"

    Send-Wrap-Up-Reports:
    trigger:
    on-success: Load-to-openmrs
    enabled: true
    adaptor: language-mailgun
    globals:
    - service-codes
    - clinic-map
    body: >
    # this triggers a new workflow
    fn(state => state)
    sendEmail(state => state.emailContent)

    Kobo-to-DHIS2: #This is a second workflow
    Fetch-Kobo-Submissions:
    trigger:
    cron: * 5 * * *
    enabled: true
    adaptor: language-kobotoolbox
    body: "file://./Kobo-to-DHIS2/Fetch-Kobo-Submissions.js"

    Upload-to-DHIS2:
    trigger:
    on-success: Fetch-Kobo-Submissions
    adaptor: language-kobotoolbox
    enabled: false
    body: "file://./Kobo-to-DHIS2/Upload-to-DHIS2.js"

    The project.state.yaml:

    project:
    - id: '45bffee'
    key: 'My Project'

    globals:
    - id: 'sj23n36'
    key: 'clinic-map'
    - id: 'bss522g'
    key: 'project-expense-codes'
    - id: '22aa4st'
    key: 'service-codes'

    workflows:
    - id: 'cfd7c68'
    key: 'CommCare-to-OpenMRS' # this is the NAME and the KEY
    - id: 'd1ecc4f'
    key: 'Kobo-to-DHIS2'

    jobs:
    - id: 'ns6yw54'
    key: 'Coerce-to-FHIR'
    - id: '12bs52j'
    key: 'Load-to-openmrs'
    - id: 'lk81hs6'
    key: 'Send-Wrap-Up-Reports'

    - id: 'sn26sh2'
    key: 'Fetch-Kobo-Submissions'
    - id: 'sk1722h'
    key: 'Upload-to-DHIS2'

    credentials:
    - id: '12ms62y'
    key: 'My FHIR Credential'

    Proposal v3

    v3 introduces URI schemes file://, https://, gcs://

    jobs:
    job-1:
    expression: 'file://my-job.js' # URIs may be used (e.g., https://raw.githubusercontent.com/org/repo/my-job.js)
    adaptor: '@openfn/language-common'
    trigger: trigger-1
    credential: my-secret-credential
    recurring-job:
    expression: >
    fn(state => {
    console.log("Hi there!")
    return state;
    })
    adaptor: '@openfn/language-common'
    trigger: every-minute
    flow-job:
    expression: >
    fn(state => {
    state.data.number = state.data.number * 3
    return state;
    })
    adaptor: '@openfn/language-common'
    trigger: after-j1
    catch-job:
    expression: >
    fn(state => {
    state.message = "handled it."
    return state;
    })
    adaptor: '@openfn/language-common'
    trigger: j1-fails

    triggers:
    trigger-1:
    criteria: '{"number":2}'
    every-minute:
    cron: '* * * * *'
    after-j1:
    success: job-1
    j1-fails:
    failure: job-1

    credentials:
    my-secret-credential:
    username: '******' # Credential keys get exported, but values must be manually reentered
    password: '******'
    my-other-credential: 'file://gcp_credential.json' # And URIs may be specified directly for the credential body

    Proposal v2

    jobs:
    job-1:
    expression: >
    registerPatient({
    patient-id: state.data.id,
    dob: state.data.birth
    })
    adaptor: '@openfn/language-openmrs'
    trigger: trigger-1
    credential: my-secret-credential
    recurring-job:
    expression: >
    fn(state => {
    console.log("Hi there!")
    return state;
    })
    adaptor: '@openfn/language-common'
    trigger: every-minute
    flow-job:
    expression: >
    fn(state => {
    state.data.number = state.data.number * 3
    return state;
    })
    adaptor: '@openfn/language-common'
    trigger: after-j1
    catch-job:
    expression: >
    fn(state => {
    state.message = "handled it."
    return state;
    })
    adaptor: '@openfn/language-common'
    trigger: j1-fails

    triggers:
    trigger-1:
    criteria: '{"number":2}'
    every-minute:
    cron: '* * * * *'
    after-j1:
    success: job-1
    j1-fails:
    failure: job-1

    # Note that credential keys get copied, but values must be manually entered
    # after the export is completed.
    credentials:
    my-secret-credential:
    username: '******'
    password: '******'

    Proposal v1

    const project = {
    async: true,
    triggers: {
    uniqueTriggerId: {
    // trigger properties
    },
    otherTrigger: {
    // other trigger properties
    },
    },
    credentials: {
    // for now, credentials will not be synced //
    // secret1: {
    // username: 'mamadou',
    // pass: 'shhh',
    },
    staticData: {
    // static objects that can be accessed from any job
    },
    jobs: {
    payHealthWorker: { trigger: 'otherTrigger' },
    syncToSalesforce: {
    expression: 'uri://github.com/jobs/expresion.js',
    trigger: 'uniqueTriggerId',
    credential: 'secret1',
    },
    },
    };
    - + \ No newline at end of file diff --git a/documentation/legacy/portability.html b/documentation/legacy/portability.html index 84803236162b..a45ccbceab1a 100644 --- a/documentation/legacy/portability.html +++ b/documentation/legacy/portability.html @@ -17,7 +17,7 @@ - + @@ -79,7 +79,7 @@ as openfn deploy --help will result in a help message describing the command and the options available when using this command. See an example below

    openfn deploy --help
    openfn deploy

    Deploy a project's config to a remote Lightning instance

    Options:
    --version Show version number [boolean]
    --help Show help [boolean]
    -c, --config, --config-path The location of your config file [default: "./.config.json"]
    --no-confirm Skip confirmation prompts (e.g. 'Are you sure?') [boolean]
    --describe Downloads the project yaml from the specified instance [boolean]
    -l, --log Set the log level [string]
    --log-json Output all logs as JSON objects [boolean]
    -p, --project-path The location of your project.yaml file [string]
    -s, --state-path Path to the state file

    Other Versions

    - + \ No newline at end of file diff --git a/documentation/legacy/release-notes.html b/documentation/legacy/release-notes.html index fdb5747e82c5..c9f140c0efcd 100644 --- a/documentation/legacy/release-notes.html +++ b/documentation/legacy/release-notes.html @@ -17,7 +17,7 @@ - + @@ -191,7 +191,7 @@ takes a url and a body object. At the end, the user is setting state.lastSubmissionDate to submissions[submissions.length-1].SubmissionDate.

    See the functions themselves at language-http.

    get('forms/data/wide/json/someForm', {
    query: function (state) {
    return { date: state.lastSubmissionDate || 'Aug 29, 2016 4:44:26 PM' };
    },
    callback: function (state) {
    // Pick submissions out in order to avoid `post` overwriting `response`.
    var submissions = state.response.body;
    // return submissions
    return submissions
    .reduce(function (acc, item) {
    // tag submissions as part of the "someForm" form
    item.formId = 'someForm';
    return acc.then(
    post('https://www.openfn.org/inbox/some-inbox-uuid', { body: item })
    );
    }, Promise.resolve(state))
    .then(function (state) {
    if (submissions.length) {
    state.lastSubmissionDate =
    submissions[submissions.length - 1].SubmissionDate;
    }
    return state;
    })
    .then(function (state) {
    delete state.response;
    return state;
    });
    },
    });
    - + \ No newline at end of file diff --git a/documentation/legacy/roadmap.html b/documentation/legacy/roadmap.html index 853784defda5..1dbbcd353894 100644 --- a/documentation/legacy/roadmap.html +++ b/documentation/legacy/roadmap.html @@ -17,7 +17,7 @@ - + @@ -41,7 +41,7 @@ walkthrough

    Creation of documentation/tutorial “pathways”

    Presenting guides and for new users and new devs from existing documentation resources to flatten the learning curve

    Quickstart

    Rewrite to be dev-centered; should read as a page for users who understand the above already and are ready to dive into technical setup

    Project walk-through

    Revise to incorporate the below app-specific tutorials in a cohesive manner

    How to integrate CommCare with Salesforce

    The Project walkthrough, but specific to these two tools.

    How to integrate DHIS2 and CommCare

    How to integrate Kobo Toolbox and a custom Postgres database

    - + \ No newline at end of file diff --git a/documentation/legacy/source-apps.html b/documentation/legacy/source-apps.html index a4f37121ed64..17c3f45cc68f 100644 --- a/documentation/legacy/source-apps.html +++ b/documentation/legacy/source-apps.html @@ -17,7 +17,7 @@ - + @@ -52,7 +52,7 @@ the user to control which fields (and even which related resources) are sent in a given payload, but often the default is to send everything and let them pick and choose what they want to use.

    - + \ No newline at end of file diff --git a/documentation/legacy/standards/digital-public-goods.html b/documentation/legacy/standards/digital-public-goods.html index 8945552fbd56..4e18821e7461 100644 --- a/documentation/legacy/standards/digital-public-goods.html +++ b/documentation/legacy/standards/digital-public-goods.html @@ -17,7 +17,7 @@ - + @@ -31,7 +31,7 @@ by design and are of high relevance for attainment of the United Nations 2030 Sustainable Development Goals (SDGs)

    You can read more about the DPG standard here.

    - + \ No newline at end of file diff --git a/documentation/legacy/standards/global-goods.html b/documentation/legacy/standards/global-goods.html index 390e6c515c0f..f2efc62c87d8 100644 --- a/documentation/legacy/standards/global-goods.html +++ b/documentation/legacy/standards/global-goods.html @@ -17,7 +17,7 @@ - + @@ -32,7 +32,7 @@ effectiveness, is designed to be interoperable, and is an emergent standard application.

    You can read more about Global Goods for Health here.

    - + \ No newline at end of file diff --git a/documentation/legacy/standards/openhie.html b/documentation/legacy/standards/openhie.html index 8d36d3f2d603..bd0dc5df4c66 100644 --- a/documentation/legacy/standards/openhie.html +++ b/documentation/legacy/standards/openhie.html @@ -17,7 +17,7 @@ - + @@ -58,7 +58,7 @@ leveraging OpenFn’s out-of-box DHIS2 adaptor and reusable workflow templates to quickly develop automation that reformats data received from CommCare and maps it to the DHIS2 data model.

    swisstph

    - + \ No newline at end of file diff --git a/documentation/legacy/style-guide.html b/documentation/legacy/style-guide.html index 706129da0ad6..826553050e1a 100644 --- a/documentation/legacy/style-guide.html +++ b/documentation/legacy/style-guide.html @@ -17,7 +17,7 @@ - + @@ -40,7 +40,7 @@ everyone. Oh, you can put Markdown into a blockquote.


    Inline HTML

    Definition list
    Is something people use sometimes.
    Markdown in HTML
    Does *not* work **very** well. Use HTML tags.

    Line Breaks

    Here's a line for us to start with.

    This line is separated from the one above by two newlines, so it will be a separate paragraph.

    This line is also a separate paragraph, but... This line is only separated by a single newline, so it's a separate line in the same paragraph.


    Admonitions

    note

    This is a note

    tip

    This is a tip

    info

    This is important

    caution

    This is a caution

    danger

    This is a warning

    Tabs

    Note how we import tabs first, then use them as below:

    import Tabs from '@theme/Tabs';
    import TabItem from '@theme/TabItem';

    <Tabs
    defaultValue="apple"
    values={[
    { label: 'Apple', value: 'apple' },
    { label: 'Orange', value: 'orange' },
    { label: 'Banana', value: 'banana' },
    ]}
    >
    <TabItem value="apple">This is an apple 🍎</TabItem>
    <TabItem value="orange">This is an orange 🍊</TabItem>
    <TabItem value="banana">This is a banana 🍌</TabItem>
    </Tabs>;
    This is an apple 🍎
    - + \ No newline at end of file diff --git a/documentation/legacy/writing-code.html b/documentation/legacy/writing-code.html index 5c05885d8981..58a242a80ab7 100644 --- a/documentation/legacy/writing-code.html +++ b/documentation/legacy/writing-code.html @@ -17,7 +17,7 @@ - + @@ -30,7 +30,7 @@ tools themselves. (The more feedback the better!). If you want to propose some new language for the documentation, you can make those changes by clicking the "Edit this page" link at the bottom of any page and submit a pull request!

    - + \ No newline at end of file diff --git a/documentation/legacy/writing-docs.html b/documentation/legacy/writing-docs.html index 8d3544f7ff11..3a49405655c3 100644 --- a/documentation/legacy/writing-docs.html +++ b/documentation/legacy/writing-docs.html @@ -17,7 +17,7 @@ - + @@ -43,7 +43,7 @@ reviewers judge whether the doc fix solves the stated problem.

    Get prompt and good quality reviews from team members

    Trust team members to value docs, ensure technical accuracy and consistency, respect end users’ needs, and advocate for the best doc deliverables for consumers.

    Make beautiful docs

    Design is important. Create beautiful and modern looking docs.

    Use developer tools and workflows

    Automate the process as much as possible, so we can focus on content creation.

    - + \ No newline at end of file diff --git a/documentation/link-to-GitHub.html b/documentation/link-to-GitHub.html index ace44b21fbf7..09d3ea510667 100644 --- a/documentation/link-to-GitHub.html +++ b/documentation/link-to-GitHub.html @@ -17,7 +17,7 @@ - + @@ -123,7 +123,7 @@ ensuring that future syncs are not affected. Changes can include adding, renaming, deleting a file or updating a file path. :::

    Troubleshooting

    Github Sync Error: Unexpected inputs provided: ["snapshots"]

    If you installed GitHub sync before July 17th, 2024 you may need to update your .github/workflows/openfn-pull.yml file to match:

    on:
    workflow_dispatch:
    inputs:
    projectId:
    description: 'OpenFN Project ID'
    required: true
    apiSecretName:
    description: 'OpenFN API Key secret name i.e OPENFN_project_API_KEY'
    required: true
    pathToConfig:
    description: 'Path to config.json'
    required: true
    branch:
    description: 'Branch to commit the project state and spec'
    required: true
    commitMessage:
    description: 'Commit message for project state and spec'
    required: true
    snapshots:
    description: 'IDs of snapshots separated by spaces'
    required: false

    jobs:
    pull-from-lightning:
    runs-on: ubuntu-latest
    permissions:
    contents: write
    name: A job to pull changes from Lightning
    steps:
    - name: openfn pull and commit
    uses: openfn/cli-pull-action@v1.1.0
    with:
    secret_input: ${{ secrets[inputs.apiSecretName] }}
    project_id_input: ${{ inputs.projectId }}
    config_path_input: ${{ inputs.pathToConfig }}
    branch_input: ${{ inputs.branch }}
    commit_message_input: ${{ inputs.commitMessage }}
    snapshots_input: ${{ inputs.snapshots }}
    - + \ No newline at end of file diff --git a/documentation/manage-projects/io-data-storage.html b/documentation/manage-projects/io-data-storage.html index 587c93ca2850..736a34e0d6aa 100644 --- a/documentation/manage-projects/io-data-storage.html +++ b/documentation/manage-projects/io-data-storage.html @@ -17,7 +17,7 @@ - + @@ -61,7 +61,7 @@ filename, date of export, user who requested the export and the status.

    List of history exports

    Configuring storage for exports

    OpenFn instance administrators can configure the storage for work order exports for local deployments. OpenFn currently supports local storage and Google Cloud Storage as destinations for exporting work orders.

    - + \ No newline at end of file diff --git a/documentation/manage-projects/manage-credentials.html b/documentation/manage-projects/manage-credentials.html index c75549118b64..f496391b2f7a 100644 --- a/documentation/manage-projects/manage-credentials.html +++ b/documentation/manage-projects/manage-credentials.html @@ -17,7 +17,7 @@ - + @@ -46,7 +46,7 @@ schema might look like the below code snippet. Because client_id isn't an option in the default Http credential form, I can create my own custom credential using the Raw JSON type.

    Example Raw JSON credential body or configuration:

    {
    "baseUrl": "https://myapp.com/api",
    "client_id": "test-j01",
    "password": "testing123",
    "customInput": "whateverYouWant"
    }
    - + \ No newline at end of file diff --git a/documentation/manage-projects/platform-mgmt.html b/documentation/manage-projects/platform-mgmt.html index cced02fd3038..55d2a68c6bcd 100644 --- a/documentation/manage-projects/platform-mgmt.html +++ b/documentation/manage-projects/platform-mgmt.html @@ -17,7 +17,7 @@ - + @@ -35,7 +35,7 @@ sidebar). Setup allows you to view or edit the project name and description.

    Project Overview

    You can also export your entire project "as code" - either to save it, or to edit your project locally. You can learn more about this feature on our Portability page.

    - + \ No newline at end of file diff --git a/documentation/manage-projects/retention-periods.html b/documentation/manage-projects/retention-periods.html index bab01f607718..cf1070d1a3fe 100644 --- a/documentation/manage-projects/retention-periods.html +++ b/documentation/manage-projects/retention-periods.html @@ -17,7 +17,7 @@ - + @@ -34,7 +34,7 @@ work order history exports, you'll still be able to access exported CSVs via the history export page in project settings.

    - + \ No newline at end of file diff --git a/documentation/manage-projects/user-roles-permissions.html b/documentation/manage-projects/user-roles-permissions.html index 3d5ff6067549..1fe8dd75c743 100644 --- a/documentation/manage-projects/user-roles-permissions.html +++ b/documentation/manage-projects/user-roles-permissions.html @@ -17,7 +17,7 @@ - + @@ -32,7 +32,7 @@ projects, audit trail, and third-party authentication, with the below Super User privileges:

    AspectDescriptionFeatures/Permissions
    User ManagementThe management of users on an OpenFn instanceCreating, editing, removing users
    Project ManagementHow projects are created and managed on the instanceCreate, delete, edit a project, assign users
    AuthenticationThird-party access management for users on the instanceSet up OpenID Auth for the instance
    Audit TrailingAuditability and change managementView history of relevant user actions on the instance for audits

    If you're using the hosted OpenFn platform (e.g., app.openfn.org), contact support@openfn.org if you need to get in touch with the super user to request new projects or configuration changes.

    - + \ No newline at end of file diff --git a/documentation/migration-steps.html b/documentation/migration-steps.html index e7a6a5527f09..2d1c77b11255 100644 --- a/documentation/migration-steps.html +++ b/documentation/migration-steps.html @@ -17,7 +17,7 @@ - + @@ -108,7 +108,7 @@ your project, post on Community or contact support@openfn.org for paid support options and private queries.

    - + \ No newline at end of file diff --git a/documentation/migration/automated-migration.html b/documentation/migration/automated-migration.html index 88365bf1f958..17ed5a45f3f9 100644 --- a/documentation/migration/automated-migration.html +++ b/documentation/migration/automated-migration.html @@ -17,7 +17,7 @@ - + @@ -72,7 +72,7 @@ above.
    More on local deployment

    To learn more about OpenFn deployment, be sure to check out our planning guide and technical guidelines.

    - + \ No newline at end of file diff --git a/documentation/monitor-history/activity-history.html b/documentation/monitor-history/activity-history.html index 926bdcd79213..33ea0f197f29 100644 --- a/documentation/monitor-history/activity-history.html +++ b/documentation/monitor-history/activity-history.html @@ -17,7 +17,7 @@ - + @@ -52,7 +52,7 @@ orders. If the output dataclips of the third step in the first run of work order "123" matches your text search, you'll see work order "123" in your results.

    - + \ No newline at end of file diff --git a/documentation/monitor-history/inspect-runs.html b/documentation/monitor-history/inspect-runs.html index 4008f98b2b1c..ccd6d2956f18 100644 --- a/documentation/monitor-history/inspect-runs.html +++ b/documentation/monitor-history/inspect-runs.html @@ -17,7 +17,7 @@ - + @@ -34,7 +34,7 @@ through on inspecting Runs via the History page.

    Search History and Runs

    To learn how to search and filter Work Order and Run history via the History page, check out the below video tutorial (or see link).

    - + \ No newline at end of file diff --git a/documentation/monitor-history/rerunning-workflow.html b/documentation/monitor-history/rerunning-workflow.html index b32e75ec54d2..fb382ee9bcb6 100644 --- a/documentation/monitor-history/rerunning-workflow.html +++ b/documentation/monitor-history/rerunning-workflow.html @@ -17,7 +17,7 @@ - + @@ -39,7 +39,7 @@ completed the Work Order.
  • If you prefer to create a new Work Order (instead of retrying the same Work Order), you can click the dropdown next to "Rerun from here" and instead choose Create New Work Order.
  • - + \ No newline at end of file diff --git a/documentation/monitor-history/status-codes.html b/documentation/monitor-history/status-codes.html index c744d66ad9e3..f6f590a147a6 100644 --- a/documentation/monitor-history/status-codes.html +++ b/documentation/monitor-history/status-codes.html @@ -17,7 +17,7 @@ - + @@ -36,7 +36,7 @@ the OpenFn worker will continue processing the workflow as there may be error handling rules in downstream edges. (E.g., "If step 3 fails, execute step 4.")

    If a step fails with a crash (e.g., Syntax Error) the worker won't be able to execute any downstream logic and the whole attempt will be aborted.

    - + \ No newline at end of file diff --git a/documentation/monitor-history/troubleshooting.html b/documentation/monitor-history/troubleshooting.html index c02413055697..825536b6fd97 100644 --- a/documentation/monitor-history/troubleshooting.html +++ b/documentation/monitor-history/troubleshooting.html @@ -17,7 +17,7 @@ - + @@ -69,7 +69,7 @@ editing and re-submission of data. You can use OpenFn to edit the source data before retrying the attempt.

    Common Error Messages

    The most common error messages with explanations are:

    DUPLICATE_VALUE: duplicate value found: ODK_uuid__c duplicates value on record with id: a0524000005wNw0
    The insert is blocked because you are attempting to create a new record with a
    unique field with the same value as an existing record.
    Required value missing
    ExternalId not found
    { INVALID_FIELD_FOR_INSERT_UPDATE: Unable to create/update fields: Contact__c.
    Please check the security settings of this field and verify that it is
    read/write for your profile or permission set. }

    This last one may arise if a master-detail relationship in Salesforce is not set as reparentable and the user attempts to run an upsert.

    - + \ No newline at end of file diff --git a/documentation/monitoring-workflows.html b/documentation/monitoring-workflows.html index a004ce1086db..23c6988790a1 100644 --- a/documentation/monitoring-workflows.html +++ b/documentation/monitoring-workflows.html @@ -17,7 +17,7 @@ - + @@ -31,7 +31,7 @@ are the 7 Work Orders in a failed state:

    Failed Work Orders

    Check out our History docs for more on managing and monitoring Runs and Work Orders.

    - + \ No newline at end of file diff --git a/documentation/notifications.html b/documentation/notifications.html index f05e791a0b9d..e226ac37c532 100644 --- a/documentation/notifications.html +++ b/documentation/notifications.html @@ -17,7 +17,7 @@ - + @@ -32,7 +32,7 @@ can inspect and begin troubleshooting.

    Failure Email

    Failure Run

    Email Digests

    Also in Project Settings > Collaboration, you can choose to receive daily, weekly or monthly email digests from a project, summarizing successful and failed runs for each of your workflows.

    Digest Email Setting

    Digest Email

    note

    If you want to adjust your notifications settings and you are a Collaborator on more than 1 Project, then you will need to go to the Project Settings > Collaboration page for each Project you belong to.

    - + \ No newline at end of file diff --git a/documentation/oauth.html b/documentation/oauth.html index 47dde0dde220..21f9ee4be9fe 100644 --- a/documentation/oauth.html +++ b/documentation/oauth.html @@ -17,7 +17,7 @@ - + @@ -83,7 +83,7 @@ managing user credentials to learn more about credential management for the applications you are integrating with on OpenFn.

    - + \ No newline at end of file diff --git a/documentation/release-notes.html b/documentation/release-notes.html index 72bf5d01d17c..0565f3895199 100644 --- a/documentation/release-notes.html +++ b/documentation/release-notes.html @@ -17,7 +17,7 @@ - + @@ -191,7 +191,7 @@ takes a url and a body object. At the end, the user is setting state.lastSubmissionDate to submissions[submissions.length-1].SubmissionDate.

    See the functions themselves at language-http.

    get('forms/data/wide/json/someForm', {
    query: function (state) {
    return { date: state.lastSubmissionDate || 'Aug 29, 2016 4:44:26 PM' };
    },
    callback: function (state) {
    // Pick submissions out in order to avoid `post` overwriting `response`.
    var submissions = state.response.body;
    // return submissions
    return submissions
    .reduce(function (acc, item) {
    // tag submissions as part of the "someForm" form
    item.formId = 'someForm';
    return acc.then(
    post('https://www.openfn.org/inbox/some-inbox-uuid', { body: item })
    );
    }, Promise.resolve(state))
    .then(function (state) {
    if (submissions.length) {
    state.lastSubmissionDate =
    submissions[submissions.length - 1].SubmissionDate;
    }
    return state;
    })
    .then(function (state) {
    delete state.response;
    return state;
    });
    },
    });
    - + \ No newline at end of file diff --git a/documentation/security-for-devs.html b/documentation/security-for-devs.html index 42f2b4145588..a16d5b4f16de 100644 --- a/documentation/security-for-devs.html +++ b/documentation/security-for-devs.html @@ -17,7 +17,7 @@ - + @@ -91,7 +91,7 @@ (not just developers), be sure to check out the complete OpenFn Security Guidebook. For more on job-writing, see the job-writing guide.

    - + \ No newline at end of file diff --git a/documentation/staging-prod.html b/documentation/staging-prod.html index 3b7559199530..2c25a13c992d 100644 --- a/documentation/staging-prod.html +++ b/documentation/staging-prod.html @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@
    Version: v2 ⚡

    Version Control for Staging and Production Projects

    It's a safe and efficient practice to use separate production and staging/testing projects to build out and test your workflows before starting to use them in production. This can be made seamless using Version Control. This guide walks you through how to set up your OpenFn projects and GitHub repo and gives you two examples of how to manage your Staging > Production workflow: one for new projects, and one for existing projects where you want to add a staging project and branch.

    Setup for new projects

    1. First, create a Production and a Staging project on OpenFn (2 projects)

    Prod and Staging Projects

    1. Choose/create a GitHub repo for your project, and create a staging branch

    Prod and Main Branches

    1. Connect your projects to the main and staging respectively - use this guide to set up the connection

    2. In each repo, create an empty .js file for your job. Make sure they have the same name and path on each repo (e.g. upsert-contacts.js). These will store the code for the job they'll be linked to in the next step.

    3. When you connected the branches to your projects in step 3 above, there was a spec.yaml file automatically created on the branch after the first sync (along with two other configuration files). Open these files on GitHub, and locate your job in the file. Replace the contents of body with: path: {path to the related js file}. Do this on both your main and staging branches.

    Spec Main Spec Staging

    1. You're now all set up!
    2. To sync a change from your Staging project to Production using the OpenFn app, go to your Staging project on OpenFn and make edits to your job. Then go to your project's Settings > Sync to GitHub, and click Initiate Sync to Branch.
    3. Alternatively, you can make edits directly to the job code on Github, and commit them to the staging branch on Github.
    4. Once you've committed edits to your staging branch, on Github you'll see an update that there have been recent changes. Click Compare & pull request.

    Create Pull Request

    1. Create a Pull Request. This will automatically include all changes that happened to the files on the staging branch.

    Save Pull Request

    1. Depending on your team's Github workflow, either have someone to approve and merge the Pull Request, or click Merge pull request.

    2. Your changes will now be automatically deployed to your OpenFn Production project (linked to the main Github branch).

    Setup for existing projects

    1. First, make sure that the code of all your jobs are stored in separate .js files (like Notify-CHW-upload-successful.js) on Github that are linked in your spec.yaml like so:

    Notify-CHW-upload-successful:
    name: Notify-CHW-upload-successful
    adaptor: '@openfn/language-http@latest'
    enabled: true
    # credential:
    # globals:
    body: |
    path: ./workflow/Notify-CHW-upload-successful.js

    You can find more information on this setup in our Github docs.

    1. When this is set up, create a new staging branch on Github based on your existing production main branch that stores your current project. To do this, on your Github repo click into Branches (where it show 1 Branch in the screenshot below).

    Branches

    1. Click New branch, give it a name like staging, make sure the source is main if you have multiple branches already. Then click Create new branch.

    New Branche

    1. Navigate over to your new staging branch. Here comes an important step. Note how the new branch now contains the 3 configurations files (config.json, spec.yaml and state.json) that were present on the main branch. Delete these from the staging branch. New ones specific to the staging branch will be created in the subsequent steps.

    2. Now head over to OpenFn, and create a new Staging project.

    3. Following this guide, set up Github connection with your staging branch, and click Initiate a sync (via the project Settings > Sync to Github page). This will create the necessary config files in the Github branch.

    4. In the newly generated spec.yaml file on the staging branch on Github, link your job .js files as explained in Step 1.

    5. When you initiate a new sync from OpenFn, the job code from the workflows configured in the app will be synced to the individual OpenFn job files on Github.

    6. To make future changes to your "Staging" project, see steps #7-12 above in the Setup for new projects section of this guide.

    - + \ No newline at end of file diff --git a/documentation/style-guide.html b/documentation/style-guide.html index 11e3f490b7d1..66460d184491 100644 --- a/documentation/style-guide.html +++ b/documentation/style-guide.html @@ -17,7 +17,7 @@ - + @@ -40,7 +40,7 @@ everyone. Oh, you can put Markdown into a blockquote.


    Inline HTML

    Definition list
    Is something people use sometimes.
    Markdown in HTML
    Does *not* work **very** well. Use HTML tags.

    Line Breaks

    Here's a line for us to start with.

    This line is separated from the one above by two newlines, so it will be a separate paragraph.

    This line is also a separate paragraph, but... This line is only separated by a single newline, so it's a separate line in the same paragraph.


    Admonitions

    note

    This is a note

    tip

    This is a tip

    info

    This is important

    caution

    This is a caution

    danger

    This is a warning

    - + \ No newline at end of file diff --git a/documentation/tutorials/commcare-to-db.html b/documentation/tutorials/commcare-to-db.html index 1357d32e808e..c811abce3cc2 100644 --- a/documentation/tutorials/commcare-to-db.html +++ b/documentation/tutorials/commcare-to-db.html @@ -17,7 +17,7 @@ - + @@ -72,7 +72,7 @@ follow these same steps for other database types (e.g., MS SQL or MySQL)—simply leverage a different adaptor in your step configuration.

    Other resources to check out:

    1. OpenFn Job Library
    2. OpenFn Docs ‘App’ pages for CommCare and Postgres

    Any questions? Comments? New configuration ideas? Please reach out to us with a post on the OpenFn Community forum.

    - + \ No newline at end of file diff --git a/documentation/tutorials/http-to-googlesheets.html b/documentation/tutorials/http-to-googlesheets.html index b628f7e7d328..757981a28c24 100644 --- a/documentation/tutorials/http-to-googlesheets.html +++ b/documentation/tutorials/http-to-googlesheets.html @@ -17,7 +17,7 @@ - + @@ -57,7 +57,7 @@ Workflow or Troubleshooting docs.

    Are you blocked? Have questions?

    Reminder to watch the video or post on the Community to ask for help!

    - + \ No newline at end of file diff --git a/documentation/tutorials/tutorial.html b/documentation/tutorials/tutorial.html index 06f62e97bb33..5e497c92a811 100644 --- a/documentation/tutorials/tutorial.html +++ b/documentation/tutorials/tutorial.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Version: v2 ⚡

    Tutorial: Creating your first workflow

    QuickStart: Creating your first workflow

    1. Go to your OpenFn Project > Workflows
    2. Create a new Workflow
    3. Choose your Trigger type: Webhook Event (for real-time integration) or Cron Expression (for timer/scheduled-based integration)
    4. Name your first Step (e.g., "Import form submission") and open it to choose the Adaptor, Adaptor Version, and Credential
    5. Click the </> code button to open the Inspector and add job code to the Editor panel to define the specific business logic or transformation rules for this workflow
    6. In the Input panel on the left, add a custom input (e.g., a payload from a webhook request) or simply add empty brackets ({}) to run a Workflow with a cron trigger. See the Workflow docs for help with running and testing Workflow.
    7. If the Step suceeds, navigate back to the Canvase view and click the + icon to add a second Step.
    8. If you want to define conditions for if/when this second Step should execute, update the Path condition.
    9. Then repeat the instruction steps #3-6 to finishing configuring this next Step, until the Workflow is complete.
    tip

    Check out the video and docs on the Workflows page in the Build docs for in-depth help, or ask your questions on Community!

    - + \ No newline at end of file diff --git a/documentation/user-credentials.html b/documentation/user-credentials.html index 81911e65ad6e..967d5985b826 100644 --- a/documentation/user-credentials.html +++ b/documentation/user-credentials.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@
    Version: v2 ⚡

    Manage User Credentials

    You can manage all the Credentials you own under the Credentials page of your profile. This article, we'll walk you through how to manage and share the Credentials you own across projects.

    All your Credentials in one place

    The Credentials page of your User Settings allows you to add, view, edit or delete the Credentials you own. It is the central place to manage your Credentials across all projects you collaborate on.

    User Credential

    User Credentials List

    For guidance on how to set up a new Credential, head over to our Manage Credentials page.

    You can update the name and login details of a Credential after clicking Edit.

    User Credential Edit View

    Share Credentials

    You can also allow multiple projects to have access to a Credential you own.

    To add or remove project access, click Edit on the Credential you want to share, and choose the project from the dropdown under Project Access.

    Update Project Access

    Shared Credentials remain secret

    If you share a Credential with a Project, Collaborators of that Project can use the Credential in their Workflows, but they won't be able to see the login details contained.

    tip

    If you want to share the login details contained in the Credential, use a secure sharing protocol like a password manager or an encrypted messaging platform.

    - + \ No newline at end of file diff --git a/documentation/user-profile.html b/documentation/user-profile.html index 6936b8bca653..1802c020c0f1 100644 --- a/documentation/user-profile.html +++ b/documentation/user-profile.html @@ -17,7 +17,7 @@ - + @@ -42,7 +42,7 @@ audit trail and the instance administrator may not be allowed to permanently delete your account.

    If you are using https://app.openfn.org you will need to cancel any active subscriptions before you can delete your account.

    - + \ No newline at end of file diff --git a/documentation/webhook-security.html b/documentation/webhook-security.html index 9a19756490a0..4af17fcff15c 100644 --- a/documentation/webhook-security.html +++ b/documentation/webhook-security.html @@ -17,7 +17,7 @@ - + @@ -43,7 +43,7 @@ these.

    Once you've added an auth method, it will show up in your Webhook Trigger configuration.

    Linked Triggers

    Only requests using these required auth details will be able to send data to your Workflow.

    - + \ No newline at end of file diff --git a/documentation/workflow-snapshots.html b/documentation/workflow-snapshots.html index 33d644a09cb3..3727d89ae749 100644 --- a/documentation/workflow-snapshots.html +++ b/documentation/workflow-snapshots.html @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@
    Version: v2 ⚡

    Workflow Snapshots

    Workflow snapshots capture and store a state/version of a workflow (a combination of input, workflow configuration and job code) at a specific point in time when a workflow was updated or run. Snapshots are helpful with debugging, auditing, and improving overall workflow performance.

    When is a snapshot made?

    Snapshots are created in 2 ways:

    1. When a user saves changes to their workflow either through the canvas or the Inspector
    2. When a run is made either by creating a new work order or retrying a run

    How can I view a snapshot?

    To view a snapshot, go to the History page. Expand a work order to see the runs included.

    Snapshot1

    From the expanded history view, there are two ways to visualize snapshots:

    1. By inspecting a step in the run
    2. From the Run view

    Viewing a snapshot by inspecting a step in the run

    Click on the inspect icon in front of the step you would like to view.

    Inspect

    This will open the inspector screen for that step in the run with all associated artifacts: logs and input/output data. On the inspector, you'll notice that you're in a read-only mode, and hovering on the workflow snapshot ID chip, you’ll see a message that reads “You are viewing a snapshot of this workflow that was taken on ….”

    Snapshot2

    To view the corresponding canvas for this snapshot, close this inspector view by clicking the X on the top right corner of the page. This will open the associated canvas with the step selected as shown below.

    Snapshot3

    From the canvas, you can inspect any step by clicking on the step and opening the inspector for the run associated with the step and snapshot.

    Viewing a snapshot from the Run view

    From the expanded history view, click on the run ID to open the run view.

    Snapshot4

    From this view, click on the Workflow name (Simple Flow) to open the workflow canvas for this snapshot. Similar to viewing a snapshot by inspecting a step, you can click the inspect icon in front of the steps to open the inspector for the step.

    Editing a Snapshot

    Snapshots are read-only and serve as a reference for the state of a workflow when saved or a run is executed. As only the latest version can be edited, in order to edit the workflow you can click on the Switch to latest version on the canvas or use the toggle at the bottom right of the inspector page to switch to the latest version of the workflow.

    When you switch to the latest version, the snapshot ID tag will change to blue colour and the text will be latest.

    Snapshot5

    Snapshot6

    Retrying a Snapshot

    When retrying a run with a snapshot, the retry will be executed with the latest version of the workflow and job code. You cannot retry a workflow with an earlier snapshot, only with the latest version.

    Snapshots and Version Control

    As they save a workflow as a particular set of configuration, input data and job code, snapshots are mainly tools to help administrators with auditing and dealing with errors (such as, for example, why a case hasn't been updated correctly in a database).

    OpenFn offers dedicated tools for version control that allows you and your team to manage changes in job code for faster and safer development, debugging and revision.

    - + \ No newline at end of file diff --git a/index.html b/index.html index 338a0b3ab671..aae01c0e2060 100644 --- a/index.html +++ b/index.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@ - + \ No newline at end of file diff --git a/search.html b/search.html index 2c976e6ccc48..844799dca03f 100644 --- a/search.html +++ b/search.html @@ -17,7 +17,7 @@ - + @@ -25,7 +25,7 @@

    Search the documentation

    - + \ No newline at end of file