See how your Angular platform is evolving.
skip
and limit
and fetches up to 10000 items per call. #581kinvey appenv apply
--org <org>
(--app <app>
is no longer valid):flex init
flex create
flex list
service create
website create
app create
flex job
command--app
) matches more than one entityhttps
to https:
. #423query.ascending()
and query.descending()
. #424query.exists()
. #425query.notContainedId()
. #426query.notEqualTo()
. #427query.or()
, query.and()
, and query.nor()
. #428TimeoutError
is will be thrown when a request times out.Network
datastore type. #414import { NgModule } from '@angular/core';
import { KinveyModule } from 'kinvey-angular-sdk';
// You will need to set the API version to 5 when you initialize the SDK
@NgModule({
imports: [
KinveyModule.init({
appKey: '<appKey>',
appSecret: '<appSecret>',
apiVersion: 5
})
]
})
export class AppModule { }
import { Component } from '@angular/core';
import { DataStoreService, DataStoreType } from 'kinvey-angular-sdk';
@Component()
export class DataStoreComponent {
collection: any;
constructor(datastoreService: DataStoreService) {
this.collection = datastoreService.collection('Books', DataStoreType.Network);
}
// Insert an array of books using the new multi insert API
save(docs: any) {
return this.collection.save(docs);
}
}
init()
returns some missing properties that were returned in v3.x. #411Auto
datastore type. This new datastore type prioritzes using the network first. If a network connection is not available then it will fall back to using the local cache until a network connection is re-established. #409Cache
datastore type. You should now use the Auto
datastore type to instead.initialize()
to initialize the SDK. You should use init()
instead.website deploy
command:--force
flagnode12
(Node.js v.12) to flex
commands that support Node.js runtime selectionThe sdk has been updated to allow you to use dependency injection to inject Kinvey services into your modules. You can find out more information by taking a look at the updated Getting Started Guide.
website
command namespaceflex status
command outputs statuses using upper case lettersflex deploy --set-vars <env variables>
--runtime
app create
command now supports the --org
optionkinvey <namespace>
loginWithMIC()
to work properly when viewing a NativeScript application with the NativeScript Preview App. #377AuthorizationGrant
if null
is provded to loginWithMIC()
. #372_socialIdentity
properly with response from /me
endpoint. #374 #375Files.findById()
is called without a file id. #373x-kinvey-custom-request-properties
header when creating an entity. #360env
namespace to appenv
X-Kinvey-Device-Info
header nows sends the correct information. #330Kinvey.Files.downloadByUrl()
fails is now thrown properly. #333profile login
if requiredprofile login
if requiredFiles.upload()
will be overridden with the size calculated by the SDK. #313_kmd.local
property on an entity before it is send to the backend. _kmd.local
is a property created by the SDK used to track if an entity was created using the SDK. #310redirectUri
response. #307Flex-sdk 3.x contains several breaking changes as well as new features. To upgrade your service from Flex-sdk 2.x to 3.x:
skipBl
and useMasterSecret
have been removed and no longer function. Use useBl
and useUserContext
instead.Open the Flex SDK GitHub repo for more information and source code.
User.me()
to update the active users data, any data that was deleted since the last call will also be removed from the active user stored on the device. #299onNext
function while using an observable will cause the onError
function to be called with the thrown error. The subscriber will also be unsubscribed from the observable. #302flex create
.flex delete
. Note that this command name was used to clear Node.js project setting in previous versions.flex delete
command available in previous versions has a new name: flex clear
. It keeps its behavior.--no-prompt
flag (available only for delete commands).var datastore = Kinvey.DataStore.collection('books');
// Turn on for datastore instance
datastore.useDeltaSet = true; // Default is false
// Pass options.useDeltaSet to override datastore default for a pull() request.
// It will use value of datastore.useDeltaSet as default.
var promise = datastore.pull(query, { useDeltaSet: true });
// Pass options.useDeltaSet to override datastore default for a pull() request.
// It will use value of datastore.useDeltaSet as default.
var promise = datastore.find(query, { useDeltaSet: true });
kinveyEntity
moduledataStore
entityId
s for dataStore
, groupStore
, and userStore
request
module to 2.85.0code-task-receiver
to 2.2.3 to add response object parsing for FlexFunctionsOpen the Flex SDK GitHub repo for more information and source code.
redirectUri
provided to mic.login()
is a string. If the redirectUri
is not a string then an Error
will be thrown. #283kinveyFileTTL
and kinveyFileTLS
query parameters for KinveyFile references on a DataStore collection. #289var dataStore = Kinvey.DataStore.collection('pets');
dataStore.findById('3f583e9f-d064-4a25-a953-6cf0a3dc2ff1', { kinveyFileTTL: 3600, kinveyFileTLS: true })
.subscribe(function(pet) {
/*
{
"_id": "3f583e9f-d064-4a25-a953-6cf0a3dc2ff1",
"_acl": {...},
"dogName": "Bob",
"furColor": "brown with black spots",
"pawPrintPicture": {
"_type": "KinveyFile",
"_id": "325620e4-93dd-4a26-9f84-8a5e62c0db11",
"_filename": "bobsPawPrint.png",
"_acl": { ... },
"_downloadURL": <Google Cloud Storage download URL>,
"_expiresAt": "2018-06-18T23:07:23.394Z"
}
}
*/
}, function(error) {
// ...
});
profile login
command updates the token only.--2fa
global option.kinvey profile login
.kinvey init
.kinvey profile delete
.Open the Kinvey CLI GitHub repo for full documentation and source code.
instanceId
as a config option to init()
. This will setup the backend and Mobile Identity Connect API urls to use your instanceId
properly. #278Kinvey.init({
appKey: '<appKey>',
appSecret: '<appSecret>'
instanceId: '<my-subdomain>'
});
v3
. #259 #268The Kinvey backend imposes a limit of 10,000 entities on data requests. If your app needs to pull a larger number of entities to the cache, you can request the SDK to "auto-paginate". The SDK will then retrieve the entire set of entities page by page. This feature only applies to Cache and Sync stores.
var dataStore = Kinvey.DataStore.collection('books', Kinvey.DataStoreType.Sync);
//Pull the entire collection page by page.
var promise = dataStore.pull(null, { autoPagination: true })
.then(function onSuccess(count) {
// "count" represents the number of entities retrieved
}).catch(function onError(error) {
// ...
});
DataStore.pull()
returned an array of the retrieved entities. With this release, the response of pull
has changed to the count of retrieved entities.
If you need the array of entities retrieved by a pull
in your app, you should call find
after the pull
has completed.
flex deploy
command now accepts --serviceId
flex init
command now requires a profile and ignores the --email
, --password
, and --host
options--no-color
flag for disabling colors in outputOpen the Kinvey CLI GitHub repo for full documentation and source code.
CacheStore
methods create()
and update()
can now handle more concurrent requests.CacheStore.delete()
method now applies the same query both locally and against the backend, instead of making separate "by-id" requests for entities found in the cache.clear()
method for a CacheStore
or SyncStore
now clears the sync queue.WebSQL
are now cached. #241Number.isNaN()
so we added a polyfill. #243LiveServiceFacade
instead of LiveService
. #254Kinvey.init({
appKey: '<appKey>',
appSecret: '<appSecret>'
storage: Kinvey.StorageProvider.WebSQL // or [Kinvey.StorageProvider.WebSQL, Kinvey.StorageProvider.IndexedDB]
});
// Possible Values
enum StorageProvider {
WebSQL,
IndexedDB,
LocalStorage,
SessionStorage,
Memory
}
var datastore = Kinvey.DataStore.collection('books', Kinvey.DataStore.Sync, { tag: 'Kinvey' }); // Tag the datastore
var query = new Kinvey.Query().equalTo('author', 'Kinvey');
datastore.pull(query)
.then(function() {
return datastore.find().toPromise();
})
.then(function(books) {
// all of these books have Kinvey as their author
});
Install the latest beta using npm install -g kinvey-cli@next
.
status
becomes flex status
)init
—Initializes Kinvey CLI by prompting for credentials and configurations optionsflex init
—Configures Kinvey CLI to work with a specific Flex Serviceinit
) can now take credentials as command-line options or ENV variablesconfig
logout
flex
namespacestatus
command now reports the email address (plus first/last name, if set) of deployer and the date/time at which service was deployedstatus
command now reports the version of the most recently-deployed servicelogs
command enhancements--from
and --to
flags-n
(--number
) and --page
flags-n
flag is suppliedLocalStorageAdapter
and SessionStorageAdapter
.micId
to be added to the client_id
value sent for a Mobile Identity Connect request.hard
equal to false
.Kinvey.initialize()
. Please use Kinvey.init()
instead. If you use Kinvey.init()
you might not have an active user even though you had already logged in. To fix this, use Kinvey.initialize()
to move the active user to the correct storage. From then on you will be able to use Kinvey.init()
and retrieve your active user. Kinvey.init()
does not return a promise and is synchronous.// Will return the shared client instance
Kinvey.init({
appKey: '<appKey>',
appSecret: '<appSecret>'
});
_id
for an entity. #134es6-promise
to prevent Promise Undefiend
errors on environments that do not have a native promise implementation. #135message
property properly when logging errors to the console. #136try/catch
around openDatabase()
. This allows any errors thrown when opening a new database connection to WebSQL be caught and used to reject the pending promise. #17instance
param was not respected when running config [instance]
in a fresh environmentconfig
against the default instance (under certain scenarios)usePopupClass()
as a static function to the User
class for registering a popup class to be used for MIC authentication.operation
property to results returned when pushing sync items to the backend. The property either be equal to Kinvey.SyncOperation.Create
, Kinvey.SyncOperation.Update
, or Kinvey.SyncOperation.Delete
.var store = Kinvey.DataStore.collection('books', Kinvey.DataStoreType.Sync);
var query = new Kinvey.Query().equalTo('title', 'Kinvey');
store.remove(query)
.then(function(response) {
// response.count contains the count of books removed matching the query
return store.push();
})
.then(function(results) {
// Results is an array of responses from the pushing the sync items.
// Each result object now contains an operation set to Kinvey.SyncOperation.Delete
})
restore()
static function on the User
class to throw an error whenever it is called. This function required the master secret for an application. We strongly advise not to do this in your application.toJSON()
functions have now been replaced by toPlainObject()
. The returned result is the exact same.save()
, create()
, and update()
on datastore instances to no longer accept an array of entities. See the example below to see how to save an array of entities.var books = [{ name: 'book1' }, { name: 'book2' }];
var store = Kinvey.DataStore.collection('books');
var promises = [];
// Loop through each of the books and save them one by one.
// You can now reference a book easily in the event an error
// occurs when saving a book.
books.forEach(function(book) {
var promise = store.save(book)
.catch(function(error) {
console.log('Error saving book ' + book.name);
});
promises.push(promise);
});
// Using a third party library wait for all the promises to complete
RSVP.Promise.all(promises)
.then(function(books) {
// ...
});
remove()
and removeById()
on datastore instances to now return the count of entities removed and not the actual entity removed.var store = Kinvey.DataStore.collection('books');
// Remove books using a query
var query = new Kinvey.Query().equalTo('title', 'Kinvey');
store.remove(query)
.then(function(response) {
// response.count contains the count of books removed matching the query
});
// Remove a book using an id
store.removeById('1')
.then(function(response) {
// response.count will equal 1 if the book was removed or 0 if the book was not removed
});
init()
static function on Kinvey
namespace. This was deprecated with v3.3.3.baseUrl
, protocol
, and host
properties on a client
instance. These were deprecated with v3.0.0.syncCount()
and purge()
on CacheStore
and SyncStore
instances. These were deprecated with v3.2.0.Kinvey.Users
and Kinvey.UserStore
. These were deprecated with v3.2.0.Kinvey.Files
.data
property for Kinvey.User
type definitions.kinvey config
targets the default Kinvey instance for data link selection if a host is not provided (even if the CLI was previously configured with a custom host)kinvey job
kinvey config [instance]
config
command now prompts for a new service on every run (fixed prior bug where it did nothing if saved data was already present)kinvey-flex-sdk
(instead of kinvey-backend-sdk
)logs
command now takes optional runtime arguments (instead of prompting for log filters)kinvey config acme-us1
)status
command (no arg command) crashed if supplied with an argumentlogs
command