Commit Graph

302 Commits

Author SHA1 Message Date
Kenneth Geisshirt 20defad505 Merge branch '2.0.x' of github.com:realm/realm-js into fix-accountInfo-2.0 2017-09-27 10:01:20 +02:00
Thomas Goyne cf0f0d127f Align the error thrown for assigning to read-only collection properties 2017-09-26 13:43:01 -07:00
Thomas Goyne 741d19458b Pass negative indices over the RPC bridge rather than special-casing -1 2017-09-26 13:43:01 -07:00
Thomas Goyne d1248b6676 Add RPC handling for the type and optional properties 2017-09-26 13:43:01 -07:00
Kenneth Geisshirt b676201e03 Alignment of permission schemas with ROS 2 (#1344)
* Alignment of permission schemas with ROS 2
2017-09-26 11:23:36 +02:00
Ashwin Phatak e1b70c2f57 Workaround for RN >= 0.49 metro-bundler check for single string literal argument to require() (#1342) 2017-09-26 10:00:31 +05:30
Thomas Goyne 2298609ce5 Merge remote-tracking branch 'origin/master' into tg/merge-master-to-2.0.x
* origin/master: (23 commits)
  Fix api doc error
  fix progress notifications registrations
  Fix typo in Github issue template
  Fix port conflict between RN >= 0.48 and RPC server (#1294)
  Disable testAddListener when running in chrome
  Ensure RN has an event loop running for async tests
  Make permission tests better handle server delays
  Fix race conditions in testAddListener
  Separate build and test steps in xcode to reduce chance of hitting "Early unexpected exit"
  Ignore errors when sourcing nvm.sh
  Don't forward arguments to nvh.sh
  Skip sourcing nvm.sh if it's already available
  Fix some shellcheck warnings
  Ensure node 6.5.0 is installed on CI
  Build realm from source for each test-runner test
  Improve error reporting for incorrect argument counts for Realm methods
  Use the same error messages in the RPC code as the regular code
  Silence an unused variable warning when building with sync disabled
  Check the exception message in all Realm tests which assert an exception is thrown
  Don't discard the actual error message in validated_get_X
  ...
2017-09-25 09:40:56 -07:00
Kenneth Geisshirt 49392bd4c6 Merge branch '2.0.x' of github.com:realm/realm-js into kneth/v1_v2-upgrade 2017-09-25 16:04:43 +02:00
Kenneth Geisshirt 61ad47faf5 Fixing a few typos 2017-09-25 16:03:14 +02:00
Kenneth Geisshirt b1fb8ece57 Fix typo 2017-09-23 10:37:15 +02:00
Kenneth Geisshirt 39fe8c6280 Creating a proper IncompatibleSyncedRealmError class. 2017-09-23 00:05:33 +02:00
blagoev ec6e700d33 fix retrieveAccount endpoint 2017-09-22 20:10:04 +03:00
Morten Krogh 508a547898 Typescript definition for ssl_verify_callback. 2017-09-22 13:52:49 +02:00
Thomas Goyne c0db1a6eff Merge pull request #1315 from realm/tg/test-realm-errors
Check the exception message in all Realm tests which assert an exception is thrown
2017-09-19 07:40:48 -07:00
Kenneth Geisshirt eeb78d8e1b Merge branch 'master' of github.com:realm/realm-js into 2.0.x 2017-09-18 09:46:36 +02:00
Thomas Goyne 742ff99003 Use the same error messages in the RPC code as the regular code 2017-09-15 15:00:13 -07:00
Kenneth Geisshirt b3ff7ada62 Documenting sync.config properties (#1312)
* Documenting sync.config properties
* Updating TypeScript definitions
2017-09-15 15:22:44 +02:00
Kenneth Geisshirt 8606d37141 Fixes to issues reported by eslint (#1313) 2017-09-14 10:35:02 +02:00
astigsen 208aa8ee46 Added support for in-memory realms (#1304)
* Added support for in-memory realms
2017-09-13 20:42:23 +02:00
blagoev 064b487c07 Merge branch 'master' into blagoev/promise3 2017-09-13 14:27:04 +03:00
blagoev f7db865458 Fix typescript definitions
Fixes #1306
2017-09-13 12:37:44 +03:00
Kenneth Geisshirt 6444f3fa6f Adding missing instructions to TypeScript definitions (#1301) 2017-09-13 09:21:26 +02:00
blagoev ba9321834b Fix _authenticate method to use promises only 2017-09-12 23:04:20 +03:00
blagoev eba51066d9 fix AuthError object 2017-09-12 23:02:14 +03:00
blagoev 115a2c9902 add deprecated warnings 2017-09-12 20:38:43 +03:00
blagoev 3fbd1291e1 fix _authenticate call to always pass the json object 2017-09-12 20:26:08 +03:00
Maximilian Alexander 78515e3b48 adding promisified apis 2017-09-12 20:10:52 +03:00
Kenneth Geisshirt eac393571d checkTypes() must only check the shortest array (#1297)
* Allow optional arguments when checking types
2017-09-12 15:17:59 +02:00
Kenneth Geisshirt 12a8cd5398 Adding missing TypeScript declaration of setFeatureToken (#1295)
* Adding missing TypeScript declaration of setFeatureToken
2017-09-12 14:28:16 +02:00
Ashwin Phatak 532f517ded Add Realm.deleteModel API (#573) 2017-09-12 14:45:36 +05:30
blagoev 9d02165db1 update typescript definitions 2017-09-11 15:50:44 +03:00
blagoev 0214dff951 fix possible hang on iOS 2017-09-11 15:50:44 +03:00
blagoev 43d8f2967f Fix typo 2017-09-11 15:50:44 +03:00
blagoev f8bac2d24a Fix Chrome Debugger for RN 2017-09-11 15:50:44 +03:00
blagoev e5ebb75d22 add typescript definitions 2017-09-11 15:50:44 +03:00
blagoev e1cebe073a add progress notifications api 2017-09-11 15:50:44 +03:00
Kenneth Geisshirt 356033a8c4 Merge branch 'tg/update-object-store' of github.com:realm/realm-js into 2.0.x 2017-09-08 14:56:01 +02:00
Kenneth Geisshirt 38bceddfb1 Add missing TypeScript declaration (#1285)
* Adding missing TypeScript declaration
2017-09-08 10:19:13 +02:00
Ashwin Phatak 119cd79e5d Add Realm.deleteFile API (#363) 2017-09-07 10:12:59 +05:30
Kenneth Geisshirt 0c61716c08 Fix accessToken (#1275) 2017-09-01 11:53:52 +02:00
Thomas Goyne 736277084e Fix creating admin token users 2017-08-31 13:49:45 -07:00
Thomas Goyne 26b4cdf33f Report what went wrong when refreshAccessToken fails 2017-08-31 13:49:45 -07:00
Thomas Goyne e75496571f Fix unhandled promise rejection warnings when access token refreshing fails 2017-08-31 13:49:45 -07:00
Kenneth Geisshirt 8d7eac1b65 Fix linter error (#1271) 2017-08-31 10:18:10 +02:00
Kristian Dupont 402bf48f88 Permissions api (#1244)
* Add basic permissions skeleton

* ...

* Update permissions api

* Wait for server to process management realm, add offer api

* Fix test of apply and get permissions, add offer test

* Accept permission offer

* Accept permission offer test

* Invalidate permission offer

* Add basic docs (still need some links etc)

* Refactor tests

* Only run permission tests where sync is enabled

* Use legal syntax for user name generation

* Add changelog entry

* Streamline permission tests

* Fix casing for access level names etc.

* Add basic definitions to index.d.ts

* Use settimeout for resolving promise from listener

* Complete typescript defs

* Improve docs

* Allow 'any' as default recipient in getGrantedPermissions

* Fix getSpecialPurposeRealm on iOS

* Response to PR comments

* Respond to PR comments

* Fix offer description

* Skip permission tests in chrome debugger :-/
2017-08-29 15:23:22 +02:00
Constantin S. Pan a84f1ed75d Allow all log levels in Realm.Sync.setLogLevels() 2017-08-29 10:37:29 +02:00
Kenneth Geisshirt 85fb49b354 Adding methods and property to manually control write transactions (#1216)
* Adding methods and property to manually control write transactions
2017-08-21 17:48:53 +02:00
Kenneth Geisshirt bd28c05936 Add shouldCompactOnLaunch option to configuration (#1209)
* Adding shouldCompactOnLaunch option to configuration
* Adding Realm.compact()
2017-08-18 14:22:29 +02:00
blagoev fad3b369dc fix bad term 2017-08-15 12:36:15 +03:00
blagoev 86999412f0 Depreciate setAccessToken
rename setAccessToken to setFeatureToken
expose both functions while setAccessToken is depreciated
Trim token argument string
2017-08-15 12:36:15 +03:00
Nikola Irinchev bbe62c361b
Don’t execute callback in Realm.open either 2017-07-18 11:28:33 +03:00
Nikola Irinchev bd10a6d8e0
Don’t invoke openAsync callback twice 2017-07-18 00:16:25 +03:00
Yavor Georgiev 5dd9264225
Add `Realm.empty` 2017-07-12 13:02:21 +02:00
Yavor Georgiev b1d23bb782
Realm.open and Realm.openAsync should try/catch opening the realm
and pass the error on to the promise and callback respectively so that it can be handled by the caller
2017-07-11 17:47:10 +02:00
Yavor Georgiev ab29ac4490 Fix linter issues (#1132) 2017-07-10 16:53:00 +02:00
Yavor Georgiev 1ba9b434b4 Add a new optional server parameter to User.adminUser (#1111)
* add a new optional server parameter to User.adminUser

This enables `User.openManagementRealm()` for admin token users.

* changelog

* API docs
2017-07-10 15:04:55 +02:00
blagoev 9ea5dd7f8c address review comments 2017-07-07 16:38:13 +03:00
blagoev 55c7c8f68c add TS definition for retrieveAccount 2017-07-07 10:31:29 +03:00
blagoev e31529397f Add tests for retrieveAccount method
fix admin-user-helper wait for admin to correctly wait
2017-07-07 10:31:29 +03:00
blagoev 73c861dc74 Remove method from list 2017-07-07 10:31:29 +03:00
blagoev 42e03e038d Add support for getting user id
For #1090
2017-07-07 10:31:29 +03:00
Marius Rackwitz 9e0a9a3bd3 Add support for accessing linking objects / backlinks (#1101)
* Add support for linkingObjects

* Test linkingObjects

* Borrow names helper from list tests

* include computed properties when serializing the schema for the RN debugger

* add API docs

* review comments

* Expose admin users to JS (#1100)

The JS binding used to conflate `SyncUser::is_admin()` with the user being created by calling `Realm.Sync.User.adminToken()`, but now that we expose a user’s role on the server under `is_admin()` this supposition is no longer correct.

#1097 attempted to fix one such case, but fixing it only uncovered another: in `UserClass<T>::all_users()`.  I’ve gone through all the callsites of `SyncUser::is_admin()` to make sure they don’t assume an admin token user.

* [1.8.3] Bump version

* add linkingObjects method to Realm.Object

* changelog
2017-06-29 11:59:10 +02:00
Yavor Georgiev 7ab3aff82f Expose admin users to JS (#1100)
The JS binding used to conflate `SyncUser::is_admin()` with the user being created by calling `Realm.Sync.User.adminToken()`, but now that we expose a user’s role on the server under `is_admin()` this supposition is no longer correct.

#1097 attempted to fix one such case, but fixing it only uncovered another: in `UserClass<T>::all_users()`.  I’ve gone through all the callsites of `SyncUser::is_admin()` to make sure they don’t assume an admin token user.
2017-06-27 20:32:34 +02:00
astigsen db4e184524 Added method to find index of object in collections (#1094)
* Added method to find index of object in collections

* rework as the indexOf method
2017-06-26 13:43:49 +02:00
Ari Lazier 726d02e78f Make ssl SyncConfiguration parameters optional 2017-06-20 10:13:33 -07:00
Yavor Georgiev 7086ed745f Do not throw when the Sync constructor isn’t there (#1086)
* Do not throw when the Sync constructor isn’t there

with unified packaging it’s there all the time now

Closes #1084
Fixes #996

* Fix running the sync tests when Sync is disabled
2017-06-20 15:40:54 +02:00
Maximilian Alexander 775bd8e2ff adding ts and package.json typings (#1076)
* adding ts and package.json typings

* remove DefinitelyTyped needed comments, we are hosting this ourselves

* adding licensing comments

* Added initial contribution support

Thanks @akim95

* changing year

* adding parameters

* Expand on collection typings

* update the windows pre-gyp script (#1072)

* Extract admin status from the refresh token (#1078)

* Extract admin status from the refresh token

Fixes #1063

* wire up rpc

* Make sure all callbacks enqueue on the Node.js event loop (#1079)

Fixes #1077

* Use an uncached realm instance for _waitForDownload (#1083)

Fixes #1061

* Add objectSchema method to Realm Object (#1055)

* Add objectSchema property to Realm Object

* fix

* fixes

* move typings under lib/

* changelog
2017-06-20 13:09:01 +02:00
Adam Fish 37dba6bb36 Add objectSchema method to Realm Object (#1055)
* Add objectSchema property to Realm Object

* fix
2017-06-20 11:42:43 +02:00
Yavor Georgiev 3e80683ad8 Extract admin status from the refresh token (#1078)
* Extract admin status from the refresh token

Fixes #1063

* wire up rpc
2017-06-17 16:59:15 +02:00
Kristian Dupont af72770094 Replace calls to sync.cleanup with sync.removealllisteners (#1066) 2017-06-14 12:54:47 +02:00
blagoev 416632c9ad Merge pull request #1062 from realm/blagoev/fix-RN-debug-with-vscode
Return debugger context if running on node in vscode debugger
2017-06-13 12:27:45 +03:00
blagoev 3764d4bf55 Return debugger context if running on node in vscode debugger
Experimental
2017-05-29 09:33:06 +03:00
blagoev 2390f9b084 Merge pull request #869 from realm/kd/fix-execution-context-detection
Update index.js to report missing react-native link
2017-05-29 09:00:16 +03:00
blagoev f4528ae6f5 fix for open async in RN Debug 2017-05-20 09:41:51 +03:00
blagoev cc2e685594 Fix for react-tests in Debug 2017-05-20 09:17:48 +03:00
blagoev a0f963775b Fix download api for RN
fix tests when run in RN
2017-05-17 16:09:19 +03:00
blagoev 0d3fbccbe1 forgotten file 2017-05-17 16:09:05 +03:00
blagoev 4b67d883b6 Add a fix for RN hang with promises 2017-05-17 16:08:42 +03:00
blagoev 4aecf90176 enable all session-tests and Realm.openAsync 2017-05-17 16:08:24 +03:00
blagoev 315b8c1a7a Fix download api to wait correctly using schema less realm
Added tests using two processes (nodes only)
2017-05-17 16:08:01 +03:00
blagoev 4e77bf326f fix Realm.open to use the correct ctor function 2017-05-17 16:07:35 +03:00
blagoev 216484aede Initial download api support 2017-05-17 16:07:08 +03:00
Kristian Dupont 045b963d6f Change fragile test to wait for signal rather than for a period of time (#936)
* Change test to wait for signal rather than for 4 seconds

* Tiny refactoring
2017-03-24 12:49:28 +01:00
Kristian Dupont f551a51acc Add missing sync error (#925)
* Add missing sync error

* Make unit tests work without sync

* Wording fix
2017-03-22 13:52:41 +01:00
Kristian Dupont 5bece3d5c4 Validate user-methods parameters (#924)
* Validate user-methods parameters

* Switch homemade typeof operator for real one.

* Fix array prototype access
2017-03-20 12:52:41 +01:00
Kristian Dupont 94f8d5a891 Add optional userInfo param to registerWithProvider (#915)
* Add optional userInfo param to registerWithProvider

* Fixes per PR comments
2017-03-17 14:13:03 +01:00
Kristian Dupont 1c6f4e6a05 Fix analytics buffer creation (#913) 2017-03-15 11:23:14 +01:00
kristiandupont f48c9ce079 Check for chrome debugger when navigator.product is set as well 2017-03-15 11:21:16 +01:00
kristiandupont 1073a4bbc0 Update index.js to report missing react-native link 2017-02-16 10:53:30 +01:00
M 0ec11ce16e rpc.js: removed Buffer.from
There hasn't Buffer Object in react native environment.
2017-02-10 18:28:03 +13:00
M 079a810044 rpc.js: fixed issue: #736 2017-02-10 11:27:44 +13:00
Radu Tutueanu 716201a1fe Fix loading the constructor for node-server-sdk 2017-02-08 13:36:43 +01:00
Yavor Georgiev 7c1dab7079 Propagate token refresh errors to the session error handler (#843)
* Get a session’s error handler

* Change the signature of all methods to add the callee

* Deserialize rpc callbacks

* Expose the session error handle on its config property

* When a token refresh error occurs and there is a session error handler

propagate the error to the handler
2017-02-07 11:01:26 +01:00
Yavor Georgiev bb0dc575c9 Implement proactive access token refresh (#842)
Closes #840
2017-02-03 16:40:13 +01:00
Yavor Georgiev 0c6000a733 Enable running android sync tests on macOS (#834)
* start ROS and forward ports when running android tests on macOS

* rework AuthError so JSC likes it
2017-02-02 02:41:27 +01:00
Yavor Georgiev 19f00e1b4b Rework #832 (#833) 2017-02-02 02:41:11 +01:00
Yavor Georgiev b2da398559 Fix token refresh and session bugs in chrome debugging (#831) 2017-02-01 23:44:56 +01:00
Yavor Georgiev 9d1d970b1f Sync Session API (#825)
* Add Session class and expose it to JS

* Add error property on the sync config object for the event handler

* tests

* refactor access token refresh

* chrome debugging
2017-02-01 14:18:59 +01:00
Yavor Georgiev 408f5588f8 Add Permissions models and User Management Realm API (#824)
* Add Permissions models and User Management Realm API

* docs and changelog

* fix bad merge

* add test

* fix jsdoc annotation

* rename permissions to management schema
2017-01-31 22:56:09 +01:00
Kristian Dupont 0c9c5ac407 Add missing chrome debugging apis for Sync.User (#801)
* Add user tests

* Add Sync member to Realm

* Add a simple test for addListener

* Introduce browser User class

* Introduce Sync.User proxy

* Fix User.all

* Add User.logout

* Remove some console.log statements

* Update rpc.cpp from tests-folder

* Use user.current from user-methods, not cpp

* remove user.current from two missing places

* Start server in realmjs and react tests

* Add user tests

* Add Sync member to Realm

* Add a simple test for addListener

* Introduce browser User class

* Introduce Sync.User proxy

* Fix User.all

* Add User.logout

* Remove some console.log statements

* Update rpc.cpp from tests-folder

* Use user.current from user-methods, not cpp

* remove user.current from two missing places

* Start server in realmjs and react tests

* Replace needle with node-fetch

* Make AuthError work in the browser

* Allow for persistent callbacks

* Expose _authenticateRealm to native

* Use clear_test_state in roc

* Streamline test inclusion

* Fix login tests

* Promisify testLogin()

* Disable AsyncTests for now

* Mode jasmine timeout to spec/unit_tests.js

* Avoid use of global for fetch module

* Only include user-tests is sync is enabled

* Skip ROS for android tests

* Add some comments about persistent callbacks

* Fix results-test

* Run async-tests in node

* Add a comment about (user object)

* Cache all users in User.current and return promises in fetch

* node_require async-tests so RN doesn't try and package them

* Add missing parenthesis
2017-01-31 14:07:29 +01:00