Code Monkey home page Code Monkey logo

kaiseki's People

Contributors

adamloving avatar charltoons avatar gonecoding avatar gtmtg avatar mnapoleon avatar programmerdave avatar radialglo avatar rosswaycaster avatar sabernar avatar sdf611097 avatar shiki avatar snyk-community avatar webjay avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kaiseki's Issues

Global instance?

I'll explain my case, I need to init the library and then use the same instance on another files of the same server, lets say I've an express app and each controller its on different file, so the think is share the instance between all the controllers so I don't need to instantiate it.

I can do a pull request but better to listen what would be the inconvenient or if there is a better approach to this problem.

Regards

How do we logout from Parse

Hi Shiki,

If I want to logout from parse database, Which API is need to call to logout from Parse.?

Could you help me on that.
Thanks in Advance.

loginUser callback broken

Error isn't passed as first parameter.

client.loginUser('username', 'password', function (e, _, user) {
  console.log(e, user)
})

// null { code: 101, error: 'invalid login parameters' }

ubuntu install

When installing on ubuntu it fails with these errors:
"
npm ERR! Error: EACCES, mkdir '/home/_/.npm/underscore/1.5.2'
npm ERR! { [Error: EACCES, mkdir '/home/_
_/.npm/underscore/1.5.2']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/home/
_**/.npm/underscore/1.5.2',
npm ERR! parent: 'kaiseki' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Linux 3.13.0-32-generic
npm ERR! command "node" "/usr/bin/npm" "install"
npm ERR! cwd /media/_/data/__/my_code/_**
npm ERR! node -v v0.10.30
npm ERR! npm -v 1.4.23
npm ERR! path /home/_/.npm/underscore/1.5.2
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/home/_
_/.npm/underscore/1.5.2'
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /media/
__/data/__/my_code/_**/npm-debug.log
npm ERR! not ok code 0
"

Can you switch to request-promise ?

First, thank you for this library. I switched from build headers, call each request myself and parse response to couple line of code.
However, I'm in callback hell now. Explicit naming all my callback function did solve the pyramid problem but a hell is still a hell when it is flat.
Can you switch to https://www.npmjs.com/package/request-promise I wonder? And return the promise to us so I can make my code readable.

Thank you very much!

object created = { error: 'unauthorized' } parse server and a mongodb instance on a local device and using port forwarding

Does this work with parse-server?

I am running parse server and a mongodb instance on a local device and using port forwarding. Will kaiseki work with this setup?

I try to save an object like so but I get back:

Code that can't seem to save an object

`

// instantiate kaiseki
var config = {
serverUrl: 'http://42.3.160.96:1337/parse',
applicationId: 'x',
// restAPIKey: 'x'
// masterKey: 'x' // optional
// mountPath: '/parse' // optional ("/parse" by default)
};

// var kaiseki = new Kaiseki(config);

var APP_ID = 'x';
var REST_API_KEY = 'x';
var kaiseki = new Kaiseki(config, REST_API_KEY);

//new tumblr to query
var blog = new tumblr.Blog('the-streetstyle.tumblr.com', oauth);

var tumblrAccount = {};

//username - profile picture - website for parse
blog.info(function (error, response) {
if (error) {
throw new Error(error);
}
console.log('blog.INFO.RES ------------');
console.log('blog.title ------------');
console.log(response.blog.title);
tumblrAccount.title = response.blog.title;

console.log('blog.user_name ------------');
console.log(response.blog.name);
tumblrAccount.user_name = response.blog.name;

console.log('blog.url ------------');
console.log(response.blog.url);
tumblrAccount.url = response.blog.url;

console.log('tumblrAccount ------------');
console.log(tumblrAccount);
// use kaiseki
var className = 'Tumblr';

kaiseki.createObject(className, tumblrAccount, function (err, res, body, success) {
    console.log('object created = ', body);
    console.log('object id = ', body.objectId);
});

});

blog.avatar(512, function (error, response) {
if (error) {
throw new Error(error);
}
console.log('blog.AVATAR.RES ------------');
console.log(response.avatar_url);
tumblrAccount.avatar_url = response.avatar_url;
});

`
CLI response below:

`

object created = { error: 'unauthorized' }
object id = undefined

`

missing parameter for deleteObject example in readme

The ClassName parameter is in the definition, but missing from the example. It is added below:

kaiseki.deleteObject('Dogs', '<object-id>', function(err, res, body) {
  if (res.statusCode == 200)
    console.log('deleted!');
  else
    console.log('failed!');
});

Backbone.js Sync Adapter based off this

I'm thinking of using this with Backbone.js on the server side with node, and as such would require a backbone.js sync adapter that uses it. Would be done as a separate project. What would your thoughts be on such a thing? The file stuff seems it could be an issue. Here is a client-side library that integrates backbone and parse together: https://github.com/neebz/backbone-parse

countObjects does not work on User class, returns 0 (zero)

I noticed that in order to make it work, we need to pass it as '_User'
I haven't tried it yet, but I'm assuming it would also be the same thing for the other default classes (Role, Session, Installation)

It would be great to have it taken care of automatically.

e.g.

 if(className == 'User') className = '_' + className;
 if(className == 'Role') className = '_' + className;
 if(className == 'Session') className = '_' + className;
 if(className == 'Installation') className = '_' + className;

in the countObject method.

Let me know what you think. I will PR it if it makes sense!

updateUser throws exception

_\node_modules\kaiseki\lib\kaiseki.js:315
opts.callback(err, res, body, success);
^
TypeError: Property 'callback' of object # is not a function
at Request.Kaiseki._jsonRequest [as callback](****node
moduleskaisekilibkaiseki.js:315:12)
at Request.init.self.callback (__\node_modules\kaiseki\n
ode_modules\request\main.js:122:22)
at Request.EventEmitter.emit (events.js:99:17)
at Request. (__\node_modules\kaiseki\node_mod
ules\request\main.js:655:16)
at Request.EventEmitter.emit (events.js:126:20)
at IncomingMessage.Request.start.self.req.self.httpModule.request.buffer (
*_*\node_modules\kaiseki\node_modules\request\main.js:617:14)
at IncomingMessage.EventEmitter.emit (events.js:126:20)
at IncomingMessage._emitEnd (http.js:366:10)
at HTTPParser.parserOnMessageComplete as onMessageComplete
at CleartextStream.socketOnData as ondata

Please fix this issu! Or is there any fault im doing?
Call looks like:

kaiseki.sessionToken = body.sessionToken;
kaiseki.updateUser(email: '[email protected]'}, function(err, res, body, success) {
console.log(err);
console.log('updated at = ', body.updatedAt);
});

seems to be simple hope this get fixed! Thx for suppoting.

Changelog?

Would be great to see a changelog here. Usually they go in a History.md folder. Example

Parse only supports batches of up to 50 requests

Just reading the Parse API guide, it mentions:

To reduce the amount of time spent on network round trips, you can create, update, or delete up to 50 objects in one call, using the batch endpoint.

But reading kaiseki's source just now, it doesn't seem to do anything to handle or break up the batches in createObjects or updateObjects into groups of 50. Is this something you've run into or considered, @shiki?

Thanks!

How do I query for a month?

I'm trying to query posts from one specific month.
Current not working version:

var params = {
where: {
userId: userId,
dated: {
$gte: startDate,
$lte: endDate
}
},
order: 'dated'
}
kaiseki.getObjects('Posts', params, function(err, response, body, success) {
// ....
});

How do I achieve this in kaiseki?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.