New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

parse-utils

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse-utils

Parse JS SDK and Parse-Server utilities

  • 1.5.1
  • npm
  • Socket score

Version published
Weekly downloads
17
increased by21.43%
Maintainers
1
Weekly downloads
 
Created
Source

parse-utils

Parse JS SDK and Parse-Server utilities

Setup

This library is available on npm, install it with: npm install --save parse-utils

API

initializeParseSDK(appId, serverURL)

Initialize the Parse SDK.

createPointerFromId(className, objectId)ParseObject

Create a pointer to a Parse object given its id and the class name

setField(parseObject, fieldName, fieldValue)

Set the value of Parse object field (it mutates the object).

setPointer(parseObject, fieldName, pointerId, pointerClassName)

Set the value of Parse object field to a Parse pointer (it mutates the object).

setArrayOfPointers(parseObject, fieldName, pointersIds, pointersClassName)

Set the value of Parse object field to an array of pointers (it mutates the object).

uploadFile(fileName, file)ParseObject

Upload a file.

getUserByEmail(userEmail)ParseObject

Get a User given its email.

getUserById(userId)ParseObject

Get a User given its id.

getRoleByName(roleName)ParseObject

Get a Role given its name.

findAll(parseQuery, findOptions)Array.<ParseObject>

Execute a "find" Parse Query regardless of the limit imposed by Parse (which is 500).

saveAllInChunks(parseObjects, saveOptions, chunkSize)Array.<ParseObject>

Execute a "saveAll" Parse Query splitting in chunks the saveAll instructions.

createRoleIfNotExists(roleName, saveOptions)ParseObject

Create a Role with the specified name (only if it doesn't alrady exists).

isUserInRole(userId, roleName)Bool

Check if the the user is in a certain role.

initializeParseSDK

Initialize the Parse SDK.

Category: Synchronous.

ParamType
appIdString
serverURLString

createPointerFromId ⇒ ParseObject

Create a pointer to a Parse object given its id and the class name

Returns: ParseObject - Pointer to the Parse object.
Category: Synchronous.

ParamTypeDescription
classNameStringThe class name of the Parse object.
objectIdStringThe id of the Parse object.

setField

Set the value of Parse object field (it mutates the object).

Category: Synchronous.

ParamTypeDescription
parseObjectParseObjectThe Parse object with the field that must be set.
fieldNameStringThe name of the field.
fieldValueAnyThe value of the field.

setPointer

Set the value of Parse object field to a Parse pointer (it mutates the object).

Category: Synchronous.

ParamTypeDescription
parseObjectParseObjectThe Parse object with the field that must be set.
fieldNameStringThe name of the field.
pointerIdStringThe objectId of the object pointed by the Parse pointer.
pointerClassNameObjectThe class name of the pointed object.

setArrayOfPointers

Set the value of Parse object field to an array of pointers (it mutates the object).

Category: Synchronous.

ParamTypeDescription
parseObjectParseObjectThe object that with field that must be set.
fieldNameStringThe name of the field
pointersIdsArray.<String>The objectIds of the objects pointed by the Parse pointers.
pointersClassNameObjectThe class name of the pointed objects.

uploadFile ⇒ ParseObject

Upload a file.

Returns: ParseObject - The uploaded file.
Category: Asynchronous.

ParamType
fileNameString
fileFile

getUserByEmail ⇒ ParseObject

Get a User given its email.

Returns: ParseObject - The User object.
Category: Asynchronous.

ParamType
emailString

getUserById ⇒ ParseObject

Get a User given its id.

Returns: ParseObject - The User object.
Category: Asynchronous.

ParamType
objectIdString

getRoleByName ⇒ ParseObject

Get a Role given its name.

Returns: ParseObject - The Role object.
Category: Asynchronous.

ParamType
roleNameString

findAll ⇒ Array.<ParseObject>

Execute a "find" Parse Query regardless of the limit imposed by Parse (which is 500).

Returns: Array.<ParseObject> - The array with the found Parse objects.
Category: Asynchronous.

ParamTypeDescription
parseQueryParseQueryThe "find" Parse Query that will be executed.
findOptionsObjectOptions passed to the "find" function.

saveAllInChunks ⇒ Array.<ParseObject>

Execute a "saveAll" Parse Query splitting in chunks the saveAll instructions.

Returns: Array.<ParseObject> - An array with the saved Parse Objects Category: Asynchronous.

ParamTypeDescription
parseObjectsArray.<ParseObject>The array of Parse object that will be saved.
saveOptionsObjectOptions passed to the "saveAll" function.
chunkSizeNumberThe chunk size of the promises.

createRoleIfNotExists ⇒ ParseObject

Create a Role with the specified name (only if it doesn't alrady exists).

Returns: ParseObject - - The created Role (undefined if the role already exists).
Category: Asynchronous.

ParamTypeDescription
roleNameStringThe Role name.
saveOptionsObjectOptions passed to the "save" command.

isUserInRole ⇒ Bool

Check if the the user is in a certain role.

Returns: Bool - - Is the user in the role? Category: Asynchronous.

ParamTypeDescription
userIdStringThe user objectId.
roleNameStringThe role name.

FAQs

Package last updated on 13 Nov 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc