Comparing version 0.9.0 to 1.0.0-rc.1
?.?.? Release notes (2020-??-??) | ||
============================================================= | ||
### Breaking Changes | ||
* None | ||
### Enhancements | ||
@@ -13,2 +16,19 @@ * None | ||
1.0.0-rc.1 Release notes (2020-10-09) | ||
============================================================= | ||
### Breaking Changes | ||
* Removed the `functions` and `services` properties from `App`, use the `functions` property and `mongoClient` method on `User` instances instead. ([#3298](https://github.com/realm/realm-js/pull/3298) and [#3322](https://github.com/realm/realm-js/pull/3322)) | ||
### Enhancements | ||
* Changing the behaviour when refreshing an access token fails. With this change, if the refresh token cannot be used to refresh an access token, the user is logged out. ([#3269](https://github.com/realm/realm-js/pull/3269)) | ||
* Moved the `getApp` function exported by the package onto the `App` class as a static method. This can be used to get or create an instance from an app-id. ([#3297](https://github.com/realm/realm-js/pull/3297)) | ||
### Fixed | ||
* Fixed forgetting the user's access and refresh tokens, even if the request to delete the session fails. ([#3269](https://github.com/realm/realm-js/pull/3269)) | ||
* `isLoggedIn` boolean property added to `User`. ([#3294](https://github.com/realm/realm-js/pull/3294)) | ||
### Internal | ||
* Sending device information in request body instead of a query parameter. ([#3295](https://github.com/realm/realm-js/pull/3295)) | ||
0.9.0 Release notes (2020-09-24) | ||
@@ -18,10 +38,10 @@ ============================================================= | ||
### Enhancements | ||
* Added support for linking credentials to an existing user. [#3088](https://github.com/realm/realm-js/pull/3088), [#3239](https://github.com/realm/realm-js/pull/3239) and [#3240](https://github.com/realm/realm-js/pull/3240) | ||
* Added a better toJSON() implementation on User objects. [#3221](https://github.com/realm/realm-js/pull/3221) | ||
* Added `watch` support to MongoDB Collections. [#3247](https://github.com/realm/realm-js/pull/3247) | ||
* Added support for linking credentials to an existing user. ([#3088](https://github.com/realm/realm-js/pull/3088), [#3239](https://github.com/realm/realm-js/pull/3239) and [#3240](https://github.com/realm/realm-js/pull/3240)) | ||
* Added a better toJSON() implementation on User objects. ([#3221](https://github.com/realm/realm-js/pull/3221)) | ||
* Added `watch` support to MongoDB Collections. ([#3247](https://github.com/realm/realm-js/pull/3247)) | ||
### Fixed | ||
* If the payload for `callFunction` included certain types the request would fail with `"invalid function call request (status 400)"`. All `EJSON` serialization is now done in canonical mode [#3157](https://github.com/realm/realm-js/pull/3157) | ||
* Fixed sending device information when authenticating a user. [#3220](https://github.com/realm/realm-js/pull/3220) | ||
* Fixed an issue where logging an `app` instance could result in a MongoDB Realm function being called. [#3223](https://github.com/realm/realm-js/pull/3223) | ||
* If the payload for `callFunction` included certain types the request would fail with `"invalid function call request (status 400)"`. All `EJSON` serialization is now done in canonical mode. ([#3157](https://github.com/realm/realm-js/pull/3157)) | ||
* Fixed sending device information when authenticating a user. ([#3220](https://github.com/realm/realm-js/pull/3220)) | ||
* Fixed an issue where logging an `app` instance could result in a MongoDB Realm function being called. ([#3223](https://github.com/realm/realm-js/pull/3223)) | ||
@@ -38,3 +58,3 @@ ### Internal | ||
### Fixed | ||
* Fixed error `"function not found: 'argsTransformation'"` when calling `user.functions.callFunction('functionName', args)` [#3134](https://github.com/realm/realm-js/pull/3134) | ||
* Fixed error `"function not found: 'argsTransformation'"` when calling `user.functions.callFunction('functionName', args)`. ([#3134](https://github.com/realm/realm-js/pull/3134)) | ||
@@ -41,0 +61,0 @@ ### Internal |
@@ -425,6 +425,5 @@ /// <reference types="node" /> | ||
* @param request The request which should be sent to the server. | ||
* @param attempts Number of times this request has been attempted. Used when retrying, callers don't need to pass a value. | ||
* @returns The response from the server. | ||
*/ | ||
fetch<RequestBody = unknown>(request: AuthenticatedRequest<RequestBody>, attempts?: number): Promise<FetchResponse>; | ||
fetch<RequestBody = unknown>(request: AuthenticatedRequest<RequestBody>): Promise<FetchResponse>; | ||
/** | ||
@@ -619,2 +618,6 @@ * Fetch a network resource as an authenticated user and parse the result as extended JSON. | ||
get state(): UserState; | ||
/** | ||
* @returns The logged in state of the user. | ||
*/ | ||
get isLoggedIn(): boolean; | ||
get customData(): CustomDataType; | ||
@@ -817,2 +820,6 @@ /** | ||
encode(): string; | ||
/** | ||
* @returns The defaults | ||
*/ | ||
toJSON(): this; | ||
} | ||
@@ -890,7 +897,15 @@ | ||
declare class App<FunctionsFactoryType extends object = Realm.DefaultFunctionsFactory, CustomDataType extends object = any> implements Realm.App<FunctionsFactoryType, CustomDataType> { | ||
/** | ||
* A map of app instances returned from calling getApp. | ||
*/ | ||
private static appCache; | ||
/** | ||
* Get or create a singleton Realm App from an id. | ||
* Calling this function multiple times with the same id will return the same instance. | ||
* | ||
* @param id The Realm App id visible from the MongoDB Realm UI or a configuration. | ||
* @returns The Realm App instance. | ||
*/ | ||
static getApp(id: string): Realm.App<Realm.DefaultFunctionsFactory, any> | App<Realm.DefaultFunctionsFactory, any>; | ||
/** @inheritdoc */ | ||
readonly functions: FunctionsFactoryType & Realm.BaseFunctionsFactory; | ||
/** @inheritdoc */ | ||
readonly services: Realm.Services; | ||
/** @inheritdoc */ | ||
readonly id: string; | ||
@@ -1096,5 +1111,6 @@ /** | ||
* Get or create a singleton Realm App from an id. | ||
* Calling this function multiple times with the same id will return the same instance. | ||
* | ||
* @param id The Realm App id visible from the MongoDB Realm UI or a configuration. | ||
* @returns The Realm App instance. Calling this function multiple times with the same id will return the same instance. | ||
* @returns The Realm App instance. | ||
*/ | ||
@@ -1101,0 +1117,0 @@ declare function getApp(id: string): Realm.App<Realm.DefaultFunctionsFactory, any> | App<Realm.DefaultFunctionsFactory, any>; |
{ | ||
"name": "realm-web", | ||
"version": "0.9.0", | ||
"version": "1.0.0-rc.1", | ||
"description": "Authenticate and communicate with the MongoDB Realm platform, from your web-browser", | ||
@@ -5,0 +5,0 @@ "main": "./dist/bundle.cjs.js", |
@@ -249,12 +249,2 @@ //////////////////////////////////////////////////////////////////////////// | ||
/** | ||
* Use this to call functions defined by the MongoDB Realm app. | ||
*/ | ||
readonly functions: FunctionsFactoryType & BaseFunctionsFactory; | ||
/** | ||
* Use this to call services within by the MongoDB Realm app. | ||
*/ | ||
services: Realm.Services; | ||
/** | ||
* Perform operations related to the email/password auth provider. | ||
@@ -277,5 +267,9 @@ */ | ||
/** | ||
* Get an app instance from the cache. | ||
* Get or create a singleton Realm App from an id. | ||
* Calling this function multiple times with the same id will return the same instance. | ||
* | ||
* @param id The Realm App id visible from the MongoDB Realm UI or a configuration. | ||
* @returns The Realm App instance. | ||
*/ | ||
static getCachedApp(appId: string): App; | ||
static getApp(appId: string): App; | ||
@@ -371,2 +365,7 @@ /** | ||
/** | ||
* The logged in state of the user. | ||
*/ | ||
readonly isLoggedIn: boolean; | ||
/** | ||
* The identities of the user at any of the app's authentication providers. | ||
@@ -373,0 +372,0 @@ */ |
@@ -545,3 +545,4 @@ //////////////////////////////////////////////////////////////////////////// | ||
*/ | ||
create<T>(type: string, properties: RealmInsertionModel<T>, mode?: Realm.UpdateMode): T & Realm.Object | ||
create<T>(type: string, properties: RealmInsertionModel<T>, mode?: Realm.UpdateMode.Never): T & Realm.Object; | ||
create<T>(type: string, properties: Partial<T> | Partial<RealmInsertionModel<T>>, mode: Realm.UpdateMode.All | Realm.UpdateMode.Modified): T & Realm.Object; | ||
@@ -554,25 +555,6 @@ /** | ||
*/ | ||
create<T extends Realm.Object>(type: {new(...arg: any[]): T; }, properties: RealmInsertionModel<T>, mode?: Realm.UpdateMode): T | ||
create<T extends Realm.Object>(type: {new(...arg: any[]): T; }, properties: RealmInsertionModel<T>, mode?: Realm.UpdateMode.Never): T; | ||
create<T extends Realm.Object>(type: {new(...arg: any[]): T; }, properties: Partial<T> | Partial<RealmInsertionModel<T>>, mode: Realm.UpdateMode.All | Realm.UpdateMode.Modified): T; | ||
/** | ||
* @param {string} type | ||
* @param {T} properties | ||
* @param {boolean} update? | ||
* @returns T & Realm.Object | ||
* | ||
* @deprecated, to be removed in future versions. Use `create(type, properties, UpdateMode)` instead. | ||
*/ | ||
create<T>(type: string, properties: RealmInsertionModel<T>, update?: boolean): T & Realm.Object | ||
/** | ||
* @param {Class} type | ||
* @param {T} properties | ||
* @param {boolean} update? | ||
* @returns T | ||
* | ||
* @deprecated, to be removed in future versions. Use `create(type, properties, UpdateMode)` instead. | ||
*/ | ||
create<T extends Realm.Object>(type: {new(...arg: any[]): T; }, properties: RealmInsertionModel<T>, update?: boolean): T | ||
/** | ||
* @param {Realm.Object|Realm.Object[]|Realm.List<any>|Realm.Results<any>|any} object | ||
@@ -594,9 +576,16 @@ * @returns void | ||
/** | ||
* @param {string|Realm.ObjectType|Function} type | ||
* @param {string} type | ||
* @param {number|string|ObjectId} key | ||
* @returns {T | undefined} | ||
*/ | ||
objectForPrimaryKey<T>(type: string | Realm.ObjectType | Function, key: number | string | Realm.ObjectId): T & Realm.Object | undefined; | ||
objectForPrimaryKey<T>(type: string, key: number | string | Realm.ObjectId): (T & Realm.Object) | undefined; | ||
/** | ||
* @param {Class} type | ||
* @param {number|string|ObjectId} key | ||
* @returns {T | undefined} | ||
*/ | ||
objectForPrimaryKey<T extends Realm.Object>(type: {new(...arg: any[]): T; }, key: number | string | Realm.ObjectId): T | undefined; | ||
/** | ||
* @param {string} type | ||
@@ -603,0 +592,0 @@ * @returns Realm.Results<T & Realm.Object> |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
997689
25803