Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

Commit

Permalink
fix: aligned file case
Browse files Browse the repository at this point in the history
  • Loading branch information
pozil committed Jun 20, 2023
1 parent 6a19f5c commit 2990aad
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 0 deletions.
6 changes: 6 additions & 0 deletions force-app/main/default/dw/csvSeparatorToJson.dwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
%dw 2.0
// CSV Reader properties https://docs.mulesoft.com/dataweave/2.2/dataweave-formats#format_csv
input records application/csv separator=';'
output application/json
---
records
7 changes: 7 additions & 0 deletions force-app/main/default/dw/csvSeparatorToJson.dwl-meta.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<DataWeaveResource xmlns="http://soap.sforce.com/2006/04/metadata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<content xsi:nil="true"/>
<apiVersion>58.0</apiVersion>
<isGlobal>false</isGlobal>
<isProtected>false</isProtected>
</DataWeaveResource>
23 changes: 23 additions & 0 deletions force-app/main/default/dw/csvToJson.dwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
%dw 2.0
input data application/csv
output application/json
fun renameKey(key: Key) = key match {
case "first_name" -> "FirstName"
case "last_name" -> "LastName"
case "company_name" -> "Company"
case "phone1" -> "HomePhone"
case "phone" -> "Phone"
case "email" -> "Email"
case "date" -> "DateofBirth"
case "address" -> "MailingStreet"
case "city" -> "MailingCity"
case "county" -> "MailingCountry"
case "state" -> "MailingState"
case "zip" -> "MailingPostalCode"
else -> (key)
}
---
data map (contact) ->
contact mapObject (value, key) -> {
(renameKey(key)) : value
}
7 changes: 7 additions & 0 deletions force-app/main/default/dw/csvToJson.dwl-meta.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<DataWeaveResource xmlns="http://soap.sforce.com/2006/04/metadata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<content xsi:nil="true"/>
<apiVersion>58.0</apiVersion>
<isGlobal>false</isGlobal>
<isProtected>false</isProtected>
</DataWeaveResource>
3 changes: 3 additions & 0 deletions force-app/main/default/dw/helloWorld.dwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
%dw 2.0
---
log("Hello World")
7 changes: 7 additions & 0 deletions force-app/main/default/dw/helloWorld.dwl-meta.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<DataWeaveResource xmlns="http://soap.sforce.com/2006/04/metadata" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<content xsi:nil="true"/>
<apiVersion>58.0</apiVersion>
<isGlobal>false</isGlobal>
<isProtected>false</isProtected>
</DataWeaveResource>

0 comments on commit 2990aad

Please sign in to comment.