All Projects → SparkFund → Sails Forth

SparkFund / Sails Forth

Licence: epl-1.0
A salesforce library designed to provide idiomatic clojure representations of salesforce data and metadata

Programming Languages

clojure
4091 projects

Projects that are alternatives of or similar to Sails Forth

quiz-host-app
Multiplayer quiz app built on Salesforce technology (host app)
Stars: ✭ 69 (+762.5%)
Mutual labels:  salesforce
Apex Recipes
A library of concise, meaningful examples of Apex code for common use cases following best practices.
Stars: ✭ 307 (+3737.5%)
Mutual labels:  salesforce
Salesforcedx Vscode
Salesforce Extensions for VS Code
Stars: ✭ 653 (+8062.5%)
Mutual labels:  salesforce
awesome-lwc
A list of interesting on platform Lightning Web Components resources and code examples
Stars: ✭ 124 (+1450%)
Mutual labels:  salesforce
Sfdc Ui Lookup Lwc
Salesforce Lookup Component built with Lightning Web Components.
Stars: ✭ 285 (+3462.5%)
Mutual labels:  salesforce
Forceworkbench
Web-based suite of tools for administrators and developers to interact with the Force.com APIs
Stars: ✭ 380 (+4650%)
Mutual labels:  salesforce
Script.apex
Evaluate Javascript expressions in Apex
Stars: ✭ 18 (+125%)
Mutual labels:  salesforce
Lightning Data Grid
A data grid for Lightning Component Framework
Stars: ✭ 24 (+200%)
Mutual labels:  salesforce
Ebikes Lwc
Sample application for Lightning Web Components and Communities on Salesforce Platform. Part of the sample gallery. Retail use case. Get inspired and learn best practices.
Stars: ✭ 299 (+3637.5%)
Mutual labels:  salesforce
Sfdc Trigger Framework
A minimal trigger framework for your Salesforce Apex Triggers
Stars: ✭ 527 (+6487.5%)
Mutual labels:  salesforce
json2apex
Generate strongly typed apex code from a json structure.
Stars: ✭ 121 (+1412.5%)
Mutual labels:  salesforce
Lightningflowcomponents
A collection of unofficial Lightning Components that can be used to enhance Salesforce Lightning Flow and Lightning Pages.
Stars: ✭ 252 (+3050%)
Mutual labels:  salesforce
Nforce
nforce is a node.js salesforce REST API wrapper for force.com, database.com, and salesforce.com
Stars: ✭ 432 (+5300%)
Mutual labels:  salesforce
amoss
Amoss - Apex Mock Objects, Spies and Stubs - A Simple Mocking framework for Apex (Salesforce)
Stars: ✭ 55 (+587.5%)
Mutual labels:  salesforce
Design System React
Salesforce Lightning Design System for React
Stars: ✭ 676 (+8350%)
Mutual labels:  salesforce
mrbelvedere
NOTE: See the old-master branch for the mrbelvedere codebase that was formerly in use.
Stars: ✭ 17 (+112.5%)
Mutual labels:  salesforce
Steedos Platform
华炎魔方低代码/无代码平台。内核采用了元数据、微服务、微前端、K8S等最新的技术架构。Steedos Low-Code / No-Code Platform in nodejs and mongodb.
Stars: ✭ 310 (+3775%)
Mutual labels:  salesforce
Affiliationsecurity
HEDA Affiliation-Based Security for Salesforce
Stars: ✭ 8 (+0%)
Mutual labels:  salesforce
Squery
Salesforce SOQL query builder
Stars: ✭ 16 (+100%)
Mutual labels:  salesforce
Npsp
The current version of the Salesforce.org Nonprofit Success Pack
Stars: ✭ 487 (+5987.5%)
Mutual labels:  salesforce

sails-forth

Sails-forth is a clojure salesforce library. It is specified with clojure.spec. It uses a stateful client object to transparently handle authentication and version detection.

Installation

[sparkfund/sails-forth "0.11.2"]

Note that the memory client now uses a dependency that does not exist in the common maven repositories. That repository is:

https://repository.mulesoft.org/releases/

If that presents a significant impediment, open an issue; we could look to include it in our jar or seek permission to publish it on a standard maven.

Usage

(require '[sails-forth.client :as sf])

(def config
  {:username "..."
   :password "..."
   :token "..."
   :consumer-key "..."
   :consumer-secret "..."
   :sandbox? false})

(def client (sf/build-http-client config))

(sf/limits! client {})

(def object-id
  (sf/create! client "contact" {:first_name "Spark" :last_name "Fund"}))

(sf/update! client "contact object-id {:last_name "Fondue"})

(sf/delete! client "contact" object-id)

(sf/query! client "select First_Name, Last_Name from contact__c")

A higher-level query ns leverages the salesforce schema to denote types and fields using more idiomatically clojure keywords. It also uses the field types to coerce values. Numbers will always be interpreted from the json payload as bigdecimals. Fixed point numbers with zero precision will become longs if possible, bigintegers otherwise. Ints will become longs. Dates and datetimes will become joda localdates and dates, respectively.

(require '[sails-forth.query as sq])

(sq/query client {:find [:contact :id :first-name :last-name]})
(sq/query client {:find [:contact :id :first-name :last-name [:faction :id :name]]})
(sq/query client {:find [:contact :id :first-name :last-name]
                  :where [[:= [:contract :last-name] "Organa"]]})

There is a memory client that operates on a schema and provides working impls of all of the client fns. The query fn is limited to a subset of the soql operators, including =, AND, OR, and IN, though adding support for more operators is very straightforward.

(def mc (sf/build-memory-client (sf/schema client #{:contact})))

There is support for building transactions which can be applied to datomic to record observations from salesforce queries:

(require '[sails-forth.datomic :as sd])

(def txns
  (sd/assert-query client "sf" {:find [:opportunity :id :name [:customer :id :name]]}))

Configuration

You may find http://www.calvinfroedge.com/salesforce-how-to-generate-api-credentials/ useful to help create your consumer-key and consumer-secret values.

License

Copyright © 2015-2019 Sparkfund

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].