Socket
Socket
Sign inDemoInstall

parse-utils

Package Overview
Dependencies
10
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    parse-utils

Parse JS SDK and Parse-Server utilities


Version published
Weekly downloads
42
increased by44.83%
Maintainers
1
Install size
5.63 MB
Created
Weekly downloads
 

Readme

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

setParseLib(parseLib)

Set the Parse library to use (node/react-native).

initializeParseSDK(serverURL, appId, masterKey)

Initialize the Parse SDK.

createPointerFromId(className, objectId)ParseObject

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

getObjectWithoutParseAttributes(object)
Object

Strip off the Parse specific attributes from an Object

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.

loadClassesFromSchemas(parseServerDb, schemas, shouldUpdate)

Given an array of schemas of classes loads them in Parse Server.

setParseLib

Set the Parse library to use (node/react-native).

Category: Synchronous.

ParamTypeDescription
parseLibObjectThe Parse library instance.

initializeParseSDK

Initialize the Parse SDK.

Category: Synchronous.

ParamType
serverURLString
appIdString
masterKeyString

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.

getObjectWithoutParseAttributes ⇒ Object

Strip off the Parse specific attributes from an Object.

Returns: Object - Object without the Parse specific attributes. Category: Synchronous.

ParamTypeDescription
objectObjectPlain Javascript representation of a 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.
fieldValueNumber,Boolean,String,Array,ParseObjectThe 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.
pointerClassNameStringThe 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.
pointersClassNameStringThe 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
userEmailString

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 ⇒ Boolean

Check if the the user is in a certain role.

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

ParamTypeDescription
userIdStringThe user objectId.
roleNameStringThe role name.

loadClassesFromSchemas

Given an array of schemas of classes loads them in Parse Server

Category: Asynchronous.

ParamTypeDescription
parseServerDbObjectThe Parse Server DB instance.
schemasArrayArray of schemas.
shouldUpdateBooleanShould the class be updated if it already exists?

FAQs

Last updated on 09 Jan 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc