npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mobilecaddy-app-addon-mcrest

v0.0.1

Published

AngularJS service used to access Salesforce REST calls from within a MobileCaddy application

Downloads

1

Readme

MobileCaddy App Addon - McRest

Overview

AngularJS service used to access Salesforce REST calls from within a MobileCaddy application.

Build Status

Installation

npm install mobilecaddy-app-addon-mcrest

The installation will include the tasks of moving the relevant scripts into the correct place of your MobileCaddy appication project structure. Included in this copying of files will be the relevant unit tests

Setup

  • Ensure that the MobileCaddy appDataUtils is exposed in your project's www/js/services/service.module.js. It should contain these lines;
angular.module('appDataUtils', [])
  .factory('appDataUtils', function() {
    return mobileCaddy.require('mobileCaddy/appDataUtils');
});

And the appDataUtils should be included in this line also;

angular.module('starter.services', ['underscore', 'devUtils', 'vsnUtils', 'smartStoreUtils', 'syncRefresh', 'appDataUtils', 'logger']);

Configuring

You can configure the API version to be used like this. If no API version is set, the default shall be used. This can be run in the .run in the app.js. The format of the version number is strict, and the call will return false if the supplied value is not valid.

McRestService.config({apiVersion: "v41.0"});

Calls Available

For example usage please checkout the MobileCaddy KitchenSink App

query

For SOQL queries

Example

Seardhing for a contact

var soql = "SELECT name, id FROM Contact WHERE name LIKE 'dave'";

McRestService.query(soql).then(function(result){
	console.log("My results", result.records);
}

request

Generic calls

Examples

Getting the latest chatter posts.

var obj = {
	method: 'GET',
	contentType: 'application/json',
	path: '/services/data/v36.0/chatter/feeds/news/me/feed-elements'
};
McRestService.request(obj).then(function(result){
	console.log("getLatestChatter result",
		result.elements[0].actor.displayName,
		result.elements[0].body.text);
});

List Salesforce files

var obj = {
	method: 'GET',
	contentType: 'application/json',
	path: '/services/data/v40.0/connect/files/users/me'
};
McRestService.request(obj).then(function(result){
	console.log("restCall result", result);
	vm.fs = result.files;
});

requestBuffer

Retrieves Salesforce files

Example

var obj = {
	method: 'GET',
	path: myfile.downloadUrl
};
McRestService.requestBuffer(obj).then(function(result){
	console.log("downloadRemote result", result);
	var dataObj = new Blob([result]);
});

upload

Uploads files to Salesforce. Returns an object representing the file on Salesforce, if successful.

Example

McRestService.upload(vm.file).then(function(result){

});