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
h1 { | |
font-size: 1.5rem; | |
font-weight: 600; | |
color: #1a1a1a; | |
text-align: center; | |
margin-bottom: 1rem; | |
} | |
.main-card { |
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 { LightningElement } from 'lwc'; | |
import encryptdata from '@salesforce/apex/encryptDecryptHandler.encryptdata'; | |
import decryptdata from '@salesforce/apex/encryptDecryptHandler.decryptdata'; | |
import generateRandomKey from '@salesforce/apex/encryptDecryptHandler.generateRandomKey'; | |
import app_wallpaper from '@salesforce/resourceUrl/Blog_Wallpaper'; | |
export default class encryptDecryptLWC extends LightningElement { | |
// Wallpaper & Algorithm Options | |
appWallpaper = app_wallpaper; |
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
<template> | |
<div style={divStyle} class="main-card"> | |
<div class="glass-container"> | |
<h1>Awesome Encryptor</h1> | |
<div> | |
<!-- Encryption Section --> | |
<div if:true={isNotEncrypted} class="glass-card"> | |
<lightning-combobox options={algoOptions} value={algoValue} label="Select Encryption Algorithm" |
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
public with sharing class encryptDecryptHandler { | |
@AuraEnabled | |
public static string encryptdata(String algorithmType, String secretKey, String clearText) { | |
String algorithmName = algorithmType; | |
Blob key = Blob.valueOf(secretKey); | |
Blob data = Blob.valueOf(clearText); | |
Blob encrypted = Crypto.encryptWithManagedIV(algorithmName, key, data); | |
String base64Encrypted = EncodingUtil.base64Encode(encrypted); | |
return base64Encrypted; | |
} |
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
public class CopilotCompanyAPI { | |
public static void createCompany() { | |
String name = 'Copilot Inc'; | |
String url = 'https://api.copilot.app/v1/companies'; | |
HttpRequest req = new HttpRequest(); | |
req.setEndpoint(url); | |
req.setMethod('POST'); | |
req.setHeader('Authorization', 'Bearer YOUR_API_KEY_HERE' ); | |
req.setHeader('Content-Type', 'application/json'); | |
req.setHeader('accept', 'application/json'); |
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
public class CopilotCompanyAPI { | |
public static void listCompanies() { | |
String url = 'https://api.copilot.app/v1/companies'; | |
HttpRequest req = new HttpRequest(); | |
req.setEndpoint(url); | |
req.setMethod( 'GET'); | |
req.setHeader('Authorization', 'Bearer YOUR_API_KEY_HERE' ); | |
req.setHeader('Content-Type', 'application/json'); | |
req.setHeader('accept', 'application/json'); |
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
public class CopilotAPI { | |
public static void createClient() { | |
String firstName='Salesforce'; | |
String lastName='Integration'; | |
String email='test@gmail.com'; | |
String url = 'https://api.copilot.app/v1/clients'; | |
HttpRequest req = new HttpRequest(); | |
req.setEndpoint(url); | |
req.setMethod('POST'); | |
req.setHeader('Authorization', 'Bearer YOUR_API_KEY_HERE'); |
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
public class CopilotAPI { | |
public static void getClient() { | |
String url = 'https://api.copilot.app/v1/clients'; | |
HttpRequest req = new HttpRequest(); | |
req.setEndpoint(url); | |
req.setMethod('GET'); | |
req.setHeader('Authorization', 'Bearer YOUR_API_KEY_HERE' ); | |
req.setHeader('Content-Type', 'application/json'); | |
req.setHeader('accept', 'application/json'); |
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
public with sharing class CDCDemoBlogController { | |
@AuraEnabled | |
public static List<Opportunity> getStatusFields(Id recordId) { | |
List<Opportunity> opportunityList = [SELECT Id, StageName FROM Opportunity WHERE ID =: recordId LIMIT 1]; | |
if(opportunityList != Null){ | |
return opportunityList; | |
} | |
return null; |
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 { LightningElement, wire, track, api } from 'lwc'; | |
import { CurrentPageReference } from "lightning/navigation"; | |
import updateStatus from '@salesforce/apex/CDCDemoBlogController.updateStatus'; | |
import getStatusFields from '@salesforce/apex/CDCDemoBlogController.getStatusFields'; | |
import { subscribe, unsubscribe, onError } from 'lightning/empApi'; | |
import { getRecordNotifyChange } from 'lightning/uiRecordApi'; | |
export default class CDCDemoBlog extends LightningElement { |
NewerOlder