Skip to content

Commit 272b35b

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 56e4aa8 + c34ddaf commit 272b35b

File tree

6 files changed

+395
-14
lines changed

6 files changed

+395
-14
lines changed

libs/backendless.d.ts

Lines changed: 125 additions & 7 deletions
Large diffs are not rendered by default.

libs/backendless.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Backendless.js 3.1.13
1+
// Backendless.js 3.1.16
22

33
(function(factory) {
44
var root = (typeof self == 'object' && self.self === self && self) ||
@@ -38,7 +38,7 @@
3838
emptyFn = (function() {
3939
});
4040

41-
Backendless.VERSION = '3.1.13';
41+
Backendless.VERSION = '3.1.16';
4242
Backendless.serverURL = 'https://api.backendless.com';
4343

4444
Backendless.noConflict = function() {
@@ -417,6 +417,8 @@
417417

418418
if (currentUser != null && !!currentUser["user-token"]) {
419419
options.headers["user-token"] = currentUser["user-token"];
420+
} else if (Backendless.LocalCache.exists("user-token")) {
421+
options.headers["user-token"] = Backendless.LocalCache.get("user-token");
420422
}
421423

422424
var buffer;
@@ -1858,14 +1860,17 @@
18581860
});
18591861
},
18601862

1861-
loginWithFacebookSdk: function(fieldsMapping, stayLoggedIn, async) {
1863+
loginWithFacebookSdk: function(fieldsMapping, stayLoggedIn, options, async) {
18621864
if (!FB) {
18631865
throw new Error("Facebook SDK not found");
18641866
}
18651867

18661868
if (stayLoggedIn instanceof Async) {
18671869
async = stayLoggedIn;
18681870
stayLoggedIn = false;
1871+
} else if (options instanceof Async) {
1872+
async = options;
1873+
options = undefined;
18691874
}
18701875

18711876
var me = this;
@@ -1875,7 +1880,7 @@
18751880
} else {
18761881
FB.login(function(response) {
18771882
me._sendSocialLoginRequest(me, response, "facebook", fieldsMapping, stayLoggedIn, async);
1878-
});
1883+
}, options);
18791884
}
18801885
});
18811886
},

libs/backendless.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "backendless",
3-
"version": "3.1.13",
3+
"version": "3.1.16",
44
"description": "Backendless JavaScript SDK for Node.js and the browser",
55
"main": "./libs/backendless.js",
66
"scripts": {

tests/es6-promise.d.ts

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
// Type definitions for es6-promise
2+
// Project: https://github.com/jakearchibald/ES6-Promise
3+
// Definitions by: François de Campredon <https://github.com/fdecampredon/>, vvakame <https://github.com/vvakame>
4+
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
5+
6+
interface Thenable<T> {
7+
then<U>(onFulfilled?: (value: T) => U | Thenable<U>, onRejected?: (error: any) => U | Thenable<U>): Thenable<U>;
8+
then<U>(onFulfilled?: (value: T) => U | Thenable<U>, onRejected?: (error: any) => void): Thenable<U>;
9+
}
10+
11+
declare class Promise<T> implements Thenable<T> {
12+
/**
13+
* If you call resolve in the body of the callback passed to the constructor,
14+
* your promise is fulfilled with result object passed to resolve.
15+
* If you call reject your promise is rejected with the object passed to reject.
16+
* For consistency and debugging (eg stack traces), obj should be an instanceof Error.
17+
* Any errors thrown in the constructor callback will be implicitly passed to reject().
18+
*/
19+
constructor(callback: (resolve : (value?: T | Thenable<T>) => void, reject: (error?: any) => void) => void);
20+
21+
/**
22+
* onFulfilled is called when/if "promise" resolves. onRejected is called when/if "promise" rejects.
23+
* Both are optional, if either/both are omitted the next onFulfilled/onRejected in the chain is called.
24+
* Both callbacks have a single parameter , the fulfillment value or rejection reason.
25+
* "then" returns a new promise equivalent to the value you return from onFulfilled/onRejected after being passed through Promise.resolve.
26+
* If an error is thrown in the callback, the returned promise rejects with that error.
27+
*
28+
* @param onFulfilled called when/if "promise" resolves
29+
* @param onRejected called when/if "promise" rejects
30+
*/
31+
then<U>(onFulfilled?: (value: T) => U | Thenable<U>, onRejected?: (error: any) => U | Thenable<U>): Promise<U>;
32+
then<U>(onFulfilled?: (value: T) => U | Thenable<U>, onRejected?: (error: any) => void): Promise<U>;
33+
34+
/**
35+
* Sugar for promise.then(undefined, onRejected)
36+
*
37+
* @param onRejected called when/if "promise" rejects
38+
*/
39+
catch<U>(onRejected?: (error: any) => U | Thenable<U>): Promise<U>;
40+
}
41+
42+
declare namespace Promise {
43+
/**
44+
* Make a new promise from the thenable.
45+
* A thenable is promise-like in as far as it has a "then" method.
46+
*/
47+
function resolve<T>(value?: T | Thenable<T>): Promise<T>;
48+
49+
/**
50+
* Make a promise that rejects to obj. For consistency and debugging (eg stack traces), obj should be an instanceof Error
51+
*/
52+
function reject(error: any): Promise<any>;
53+
function reject<T>(error: T): Promise<T>;
54+
55+
/**
56+
* Make a promise that fulfills when every item in the array fulfills, and rejects if (and when) any item rejects.
57+
* the array passed to all can be a mixture of promise-like objects and other objects.
58+
* The fulfillment value is an array (in order) of fulfillment values. The rejection value is the first rejection value.
59+
*/
60+
function all<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(values: [T1 | Thenable<T1>, T2 | Thenable<T2>, T3 | Thenable<T3>, T4 | Thenable <T4>, T5 | Thenable<T5>, T6 | Thenable<T6>, T7 | Thenable<T7>, T8 | Thenable<T8>, T9 | Thenable<T9>, T10 | Thenable<T10>]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>;
61+
function all<T1, T2, T3, T4, T5, T6, T7, T8, T9>(values: [T1 | Thenable<T1>, T2 | Thenable<T2>, T3 | Thenable<T3>, T4 | Thenable <T4>, T5 | Thenable<T5>, T6 | Thenable<T6>, T7 | Thenable<T7>, T8 | Thenable<T8>, T9 | Thenable<T9>]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>;
62+
function all<T1, T2, T3, T4, T5, T6, T7, T8>(values: [T1 | Thenable<T1>, T2 | Thenable<T2>, T3 | Thenable<T3>, T4 | Thenable <T4>, T5 | Thenable<T5>, T6 | Thenable<T6>, T7 | Thenable<T7>, T8 | Thenable<T8>]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>;
63+
function all<T1, T2, T3, T4, T5, T6, T7>(values: [T1 | Thenable<T1>, T2 | Thenable<T2>, T3 | Thenable<T3>, T4 | Thenable <T4>, T5 | Thenable<T5>, T6 | Thenable<T6>, T7 | Thenable<T7>]): Promise<[T1, T2, T3, T4, T5, T6, T7]>;
64+
function all<T1, T2, T3, T4, T5, T6>(values: [T1 | Thenable<T1>, T2 | Thenable<T2>, T3 | Thenable<T3>, T4 | Thenable <T4>, T5 | Thenable<T5>, T6 | Thenable<T6>]): Promise<[T1, T2, T3, T4, T5, T6]>;
65+
function all<T1, T2, T3, T4, T5>(values: [T1 | Thenable<T1>, T2 | Thenable<T2>, T3 | Thenable<T3>, T4 | Thenable <T4>, T5 | Thenable<T5>]): Promise<[T1, T2, T3, T4, T5]>;
66+
function all<T1, T2, T3, T4>(values: [T1 | Thenable<T1>, T2 | Thenable<T2>, T3 | Thenable<T3>, T4 | Thenable <T4>]): Promise<[T1, T2, T3, T4]>;
67+
function all<T1, T2, T3>(values: [T1 | Thenable<T1>, T2 | Thenable<T2>, T3 | Thenable<T3>]): Promise<[T1, T2, T3]>;
68+
function all<T1, T2>(values: [T1 | Thenable<T1>, T2 | Thenable<T2>]): Promise<[T1, T2]>;
69+
function all<T>(values: (T | Thenable<T>)[]): Promise<T[]>;
70+
71+
/**
72+
* Make a Promise that fulfills when any item fulfills, and rejects if any item rejects.
73+
*/
74+
function race<T>(promises: (T | Thenable<T>)[]): Promise<T>;
75+
}
76+
77+
declare module 'es6-promise' {
78+
var foo: typeof Promise; // Temp variable to reference Promise in local context
79+
namespace rsvp {
80+
export var Promise: typeof foo;
81+
export function polyfill(): void;
82+
}
83+
export = rsvp;
84+
}

0 commit comments

Comments
 (0)