This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Edgar Moran | |
* March 2022 | |
*/ | |
public with sharing class Walmart { | |
@InvocableMethod(label='Send Message') | |
public static List<String> sendMessage(List<String> message) { | |
String consumerId ='CONSUMER_ID'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.commons.codec.binary.Base64; | |
import java.security.KeyFactory; | |
import java.security.PrivateKey; | |
import java.security.Signature; | |
import java.security.spec.PKCS8EncodedKeySpec; | |
public class WalmartHeaderSignature { | |
private static String consumerId = "CONSUMER_ID"; // Trimmed for security reason | |
private static String baseUrl = "URL"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>com.emoran</groupId> | |
<artifactId>yucelmoran-azure-pipeline</artifactId> | |
<version>1.0.0-SNAPSHOT</version> | |
<packaging>mule-application</packaging> | |
<name>yucelmoran-azure-pipeline</name> | |
<properties> | |
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> | |
<servers> | |
<server> | |
<id>yucelmoran-azure-pipeline</id> | |
<username>yucelmorans</username> | |
<!-- Treat this auth token like a password. Do not share it with anyone, including Microsoft support. --> | |
<!-- The generated token expires on or before 17/11/2019 --> | |
<password>${azure.password}</password> | |
</server> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%dw 2.0 | |
import try, fail from dw::Runtime | |
output application/java | |
fun isDate(value: Any): Boolean = try(() -> value as Date).success | |
fun getDate(value: Any): Date | Null | Any = ( if ( isDate(value) ) value | |
as Date as String else value ) | |
--- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(payload.fields filter ($."type" != "LOCATION") map { | |
fieldName : $.name | |
}).fieldName joinBy "," |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%dw 2.0 | |
input payload application/java | |
output application/java | |
fun validateField(field) = if ( (field == "REFERENCE") | |
or (field == "ID") or | |
(field == "PICKLIST") or | |
(field == "TEXTAREA") or | |
(field == "ADDRESS")or | |
(field == "EMAIL")or | |
(field == "PHONE") or |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
payload.sobjects filter ( $.queryable == true and | |
$.replicateable == true and | |
$.retrieveable == true and | |
$.searchable == true and | |
$.triggerable == true and | |
($.name == "Account" or | |
$.name == "Contact" or | |
$.name =="Project__c")) map $ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%dw 2.0 | |
import try, fail from dw::Runtime | |
output application/java | |
fun isDate(value: Any): Boolean = try(() -> value as Date).success | |
fun getDate(value: Any): Date | Null | Any = ( if ( isDate(value) ) value | |
as Date as String else value ) | |
--- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%dw 2.0 | |
output application/json | |
--- | |
flatten (dw::core::Objects::entrySet (payload) map ($[1].payload)) | |