All Projects → orcaman → node-swagger-salesforce

orcaman / node-swagger-salesforce

Licence: MIT license
auto generate a node/express swagger CRUD API for your Salesforce

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to node-swagger-salesforce

HTTPCalloutFramework
HTTP Callout Framework - A light weight callout framework for apex HTTP callouts in Salesforce
Stars: ✭ 43 (+152.94%)
Mutual labels:  salesforce, salesforce-rest-api
Apex-Integration-Services
Apex REST Callouts, Apex SOAP Callouts, Apex Web Services
Stars: ✭ 36 (+111.76%)
Mutual labels:  salesforce, salesforce-rest-api
ssjs-lib
An open-source library that takes the repetitive and complex tasks and simplifies them, enabling you to get the most out of Salesforce Marketing Cloud.
Stars: ✭ 28 (+64.71%)
Mutual labels:  salesforce, salesforce-rest-api
apex-graphql-query
A library for building GraphQL queries in apex
Stars: ✭ 31 (+82.35%)
Mutual labels:  salesforce
lwc-soql-builder
Awesome SOQL execution tool developed in Lightning Web Components Open Source
Stars: ✭ 85 (+400%)
Mutual labels:  salesforce
ecars
Sample application for Lightning Web Components and Salesforce Platform runtime and compute capabilities. Part of the sample gallery. Electric car manufacturer use case. Get inspired and learn best practices.
Stars: ✭ 132 (+676.47%)
Mutual labels:  salesforce
fast-sfdc
A VSCode plugin to develop Salesforce projects in vscode
Stars: ✭ 16 (-5.88%)
Mutual labels:  salesforce
go-sfdc
go-sfdc is a library used to interface to Salesforce APIs using golang
Stars: ✭ 59 (+247.06%)
Mutual labels:  salesforce
sfdx-js
A TypeScript compatible JavaScript wrapper for Salesforce DX CLI.
Stars: ✭ 30 (+76.47%)
Mutual labels:  salesforce
backup-force.com
Export and backup salesforce.com Database locally
Stars: ✭ 30 (+76.47%)
Mutual labels:  salesforce
artefactory-connectors-kit
ACK is an E(T)L tool specialized in API data ingestion. It is accessible through a Command-Line Interface. The application allows you to easily extract, stream and load data (with minimum transformations), from the API source to the destination of your choice.
Stars: ✭ 34 (+100%)
Mutual labels:  salesforce
APEX-Q
A promise library for Salesforce
Stars: ✭ 30 (+76.47%)
Mutual labels:  salesforce
omakase
Java-based, plugin-oriented CSS3+ parser
Stars: ✭ 13 (-23.53%)
Mutual labels:  salesforce
sf-cross-cutting-concerns
Apex Cross cutting concerns for Salesforce
Stars: ✭ 29 (+70.59%)
Mutual labels:  salesforce
northern-trail-outfitters
Salesforce Sample App part of the sample gallery. Retail use case. Get inspired and learn best practices.
Stars: ✭ 46 (+170.59%)
Mutual labels:  salesforce
Salesforce-Short-Hands
The main purpose of this repository is to put all the utilities in one place so that other developers can get help and they can also contribute to this repo.
Stars: ✭ 31 (+82.35%)
Mutual labels:  salesforce
functions-recipes
Functions Recipes is a library of examples to help you getting started with Salesforce Functions and get used to their main features.
Stars: ✭ 150 (+782.35%)
Mutual labels:  salesforce
sfdx-lightning-api-component
⚡️ Promise-based service component for calling REST API from Lightning Aura Components without Named Credentials.
Stars: ✭ 62 (+264.71%)
Mutual labels:  salesforce
apex-query-builder
Convenient query builder for dynamic SOQL queries
Stars: ✭ 37 (+117.65%)
Mutual labels:  salesforce
ApexTriggerHandler
Another library implements Apex trigger handler design pattern.
Stars: ✭ 40 (+135.29%)
Mutual labels:  salesforce

node-swagger-salesforce

swagger screenshot

node-swagger-salesforce may be used to easily and automatically create a REST API containning CRUD operations covering Salesforce entities. The generator connects to your Salesforce instance (for example, your sandbox environment) using credentials supplied as env vars and proceeds to automatically generate an entire swagger project (controllers, configuration, etc.) over an express.js API server.

You can choose to auto generate controllers for all your Salesforce entities, or you can configure a white or a black list of entities.

Read more about swagger here and here.

motivation

  • Get swagger goodness over the plain old Salesforce REST API - declarative coding, documentation, API playground, etc.
  • Be able to manipulate Salesforce API results using node (express middlewares and more)
  • The vanilla Salesforce REST API is designed for client apps, not server integrations (it only offers OAuth authentication). Projects created with node-swagger-salesforce may be easily used for server integrations simply by supplying users credentials (no need to work with the OAuth endpoint).
  • The result project may be deployed to a PaaS like Heroku with just a few clicks

usage

  1. Install swagger for node
$ npm install -g swagger
  1. Get the project and install it's dependancies
$ git clone https://github.com/skyline-ai/node-swagger-salesforce.git
$ cd node-swagger-salesforce && npm install
  1. Build the project (this will run the gulpfile)
$ npm run build
  1. Set required env vars - credentials for Salesforce (mandatory) and login URL (this value is optional, the value https://test.salesforce.com should be used in order to connect to sandbox envs). see configuration section for more available config options
# for example: [email protected]
$ export SF_USER=your Salesforce username
$ export SF_PASSWORD=your Salesforce password
# if you don't know what your token is, you can **RESET** it by following this link:
# https://YOUR_SALES_FORCE_DOMAIN/_ui/system/security/ResetApiTokenConfirm?retURL=%2Fui%2Fsetup%2FSetup%3Fsetupid%3DPersonalInfo&setupid=ResetApiToken
$ export SF_TOKEN=your sales force security token
# optional: connect to sandbox env
$ export SF_LOGIN_URL=https://test.salesforce.com
  1. Finally, generated your swagger project and run it. The project uses es6 syntax and therefore needs to be transpiled in order for node to run it (at the time of this post the latest dev version of node still doesn't support things like es6 import). By default, the babel configuration will create an output at dist directory. The output is the generator in es5 code that node can run. This is the actual generator code that you need to run in order to create the final swagger project. By default the dist node app will create your new swagger project at the out directory under dist.
$ cd dist && node app.js
$ cd out && npm install
$ swagger project start

To edit your swagger project:

$ swagger project edit

optional: using white-lists or black-lists

If you want the generator to only create controllers for specific entities, use a white list. Configure the location of the list as the env var SF_WL_PATH:

$ export SF_WL_PATH=../lists/wl.txt

If you want the generator to dismiss specific entities and create controllers for the rest, use a black list. Configure the location of the list as the env var SF_BL_PATH:

$ export SF_BL_PATH=../lists/bl.txt

The list should be a UTF-8 text file where every line contains the name of the entity in lower case. For example, the following list is set to tell the generator to only create a controller for the account entity:

$ cat lists/wl.txt 
account

TODO

  • tests converage
  • auto generate tests for the controllers
  • work with Salesforce API to extract mandatory fields and make them mandatory in the swagger api level
  • add API key style auth by default
  • add Heroku deployment examples
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].