strong-arc
Version:
A visual suite for the StrongLoop API Platform
1,457 lines (1,451 loc) • 141 kB
JavaScript
'use strict';
var angBase = "/api";
//var authBase = angBase;
var authBase = "https://auth2.strongloop.com/api";
/**
* @ngdoc overview
* @name lbServices
* @module
* @description
*
* The `lbServices` module provides services for interacting with
* the models exposed by the LoopBack server via the REST API.
*
*/
var module = angular.module("ArcUserAuthFactory", ['ngResource']);
/**
* @ngdoc object
* @name lbServices.User
* @object
*
* @description
*
* A $resource object for interacting with the `User` model.
*
* ## Example
*
* See
* {@link http://docs.angularjs.org/api/ngResource.$resource#example $resource}
* for an example of using this object.
*
*/
module.factory(
"User",
['LoopBackResource', 'LoopBackAuth', function(Resource, LoopBackAuth) {
return Resource(
angBase + "/users/:id",
{ 'id': '@id' },
{
/**
* @ngdoc method
* @name lbServices.User#login
* @methodOf lbServices.User
*
* @description
*
* <em>
* (The remote method definition does not provide any description.)
* </em>
*
* @param {Object=} parameters Request parameters.
*
* - `include` – `{string=}` - Related objects to include in the response. See the description of return value for more details.
*
* - `rememberMe` - `boolean` - Whether the authentication credentials
* should be remembered in localStorage across app/browser restarts.
* Default: `true`.
*
* @param {Object} postData Request data.
*
* This method expects a subset of model properties as request parameters.
*
* @param {Function(Object, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Object} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*
* The response body contains properties of the AccessToken created on login.
* Depending on the value of `include` parameter, the body may contain additional properties:
*
* - `user` - `{User}` - Data of the currently logged in user. (`include=user`)
*
*
*/
"login": {
url: authBase + "/users/login?include=user",
method: "POST",
interceptor: {
response: function(response) {
var accessToken = response.data;
var user = response.data.user;
LoopBackAuth.currentUserId = accessToken.userId;
LoopBackAuth.accessTokenId = accessToken.id;
LoopBackAuth.rememberMe = response.config.params.rememberMe !== false;
LoopBackAuth.currentUsername = user.displayName;
LoopBackAuth.currentUserEmail = user.email;
LoopBackAuth.save();
return response.resource;
}
}
},
/**
* @ngdoc method
* @name lbServices.User#logout
* @methodOf lbServices.User
*
* @description
*
* <em>
* (The remote method definition does not provide any description.)
* </em>
*
* @param {Object=} parameters Request parameters.
*
* This method does not accept any parameters.
* Supply an empty object or omit this argument altogether.
*
* @param {Object} postData Request data.
*
* - `access_token` – `{string}` - Do not supply this argument, it is automatically extracted from request headers.
*
* @param {Function(Object, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Object} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*
* This method returns no data.
*/
"logout": {
url: authBase + "/users/logout",
method: "POST",
interceptor: {
response: function(response) {
LoopBackAuth.currentUserId = null;
LoopBackAuth.accessTokenId = null;
LoopBackAuth.currentUsername = null;
LoopBackAuth.currentUserEmail = null;
LoopBackAuth.save();
return response.resource;
}
}
},
/**
* @ngdoc method
* @name lbServices.User#confirm
* @methodOf lbServices.User
*
* @description
*
* <em>
* (The remote method definition does not provide any description.)
* </em>
*
* @param {Object=} parameters Request parameters.
*
* - `uid` – `{string}` -
*
* - `token` – `{string}` -
*
* - `redirect` – `{string}` -
*
* @param {Function(Object, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Object} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*
* This method returns no data.
*/
"confirm": {
url: angBase + "/users/confirm",
method: "GET",
},
/**
* @ngdoc method
* @name lbServices.User#resetPassword
* @methodOf lbServices.User
*
* @description
*
* <em>
* (The remote method definition does not provide any description.)
* </em>
*
* @param {Object=} parameters Request parameters.
*
* This method does not accept any parameters.
* Supply an empty object or omit this argument altogether.
*
* @param {Object} postData Request data.
*
* This method expects a subset of model properties as request parameters.
*
* @param {Function(Object, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Object} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*
* This method returns no data.
*/
"resetPassword": {
url: angBase + "/users/reset",
method: "POST",
},
/**
* @ngdoc method
* @name lbServices.User#email
* @methodOf lbServices.User
*
* @description
*
* <em>
* (The remote method definition does not provide any description.)
* </em>
*
* @param {Object=} parameters Request parameters.
*
* This method does not accept any parameters.
* Supply an empty object or omit this argument altogether.
*
* @param {Object} postData Request data.
*
* This method does not accept any data. Supply an empty object.
*
* @param {Function(Object, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Object} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*
* This method returns no data.
*/
"email": {
url: angBase + "/users/Emails",
method: "POST",
},
/**
* @ngdoc method
* @name lbServices.User#accessToken
* @methodOf lbServices.User
*
* @description
*
* <em>
* (The remote method definition does not provide any description.)
* </em>
*
* @param {Object=} parameters Request parameters.
*
* This method does not accept any parameters.
* Supply an empty object or omit this argument altogether.
*
* @param {Object} postData Request data.
*
* This method does not accept any data. Supply an empty object.
*
* @param {Function(Object, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Object} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*
* This method returns no data.
*/
"accessToken": {
url: angBase + "/users/AccessTokens",
method: "POST",
},
/**
* @ngdoc method
* @name lbServices.User#create
* @methodOf lbServices.User
*
* @description
*
* Create a new instance of the model and persist it into the data source
*
* @param {Object=} parameters Request parameters.
*
* This method does not accept any parameters.
* Supply an empty object or omit this argument altogether.
*
* @param {Object} postData Request data.
*
* This method expects a subset of model properties as request parameters.
*
* @param {Function(Object, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Object} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*
* <em>
* (The remote method definition does not provide any description.
* This usually means the response is a `User` object.)
* </em>
*/
"create": {
url: angBase + "/users",
method: "POST",
},
/**
* @ngdoc method
* @name lbServices.User#updateOrCreate
* @methodOf lbServices.User
*
* @description
*
* Update an existing model instance or insert a new one into the data source
*
* @param {Object=} parameters Request parameters.
*
* This method does not accept any parameters.
* Supply an empty object or omit this argument altogether.
*
* @param {Object} postData Request data.
*
* This method expects a subset of model properties as request parameters.
*
* @param {Function(Object, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Object} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*
* <em>
* (The remote method definition does not provide any description.
* This usually means the response is a `User` object.)
* </em>
*/
"updateOrCreate": {
url: angBase + "/users",
method: "PUT",
},
/**
* @ngdoc method
* @name lbServices.User#upsert
* @methodOf lbServices.User
*
* @description
*
* Update an existing model instance or insert a new one into the data source
*
* @param {Object=} parameters Request parameters.
*
* This method does not accept any parameters.
* Supply an empty object or omit this argument altogether.
*
* @param {Object} postData Request data.
*
* This method expects a subset of model properties as request parameters.
*
* @param {Function(Object, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Object} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*
* <em>
* (The remote method definition does not provide any description.
* This usually means the response is a `User` object.)
* </em>
*/
"upsert": {
url: angBase + "/users",
method: "PUT",
},
/**
* @ngdoc method
* @name lbServices.User#exists
* @methodOf lbServices.User
*
* @description
*
* Check whether a model instance exists in the data source
*
* @param {Object=} parameters Request parameters.
*
* - `id` – `{*}` - Model id
*
* @param {Function(Object, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Object} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*
* Data properties:
*
* - `exists` – `{*=}` -
*/
"exists": {
url: angBase + "/users/:id/exists",
method: "GET",
},
/**
* @ngdoc method
* @name lbServices.User#findById
* @methodOf lbServices.User
*
* @description
*
* Find a model instance by id from the data source
*
* @param {Object=} parameters Request parameters.
*
* - `id` – `{*}` - Model id
*
* @param {Function(Object, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Object} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*
* <em>
* (The remote method definition does not provide any description.
* This usually means the response is a `User` object.)
* </em>
*/
"findById": {
url: authBase + "/users/:id",
method: "GET",
},
/**
* @ngdoc method
* @name lbServices.User#find
* @methodOf lbServices.User
*
* @description
*
* Find all instances of the model matched by filter from the data source
*
* @param {Object=} parameters Request parameters.
*
* - `filter` – `{object=}` - Filter defining fields, where, orderBy, offset, and limit
*
* @param {Function(Array.<Object>, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Array.<Object>} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*
* <em>
* (The remote method definition does not provide any description.
* This usually means the response is a `User` object.)
* </em>
*/
"find": {
url: angBase + "/users",
method: "GET",
isArray: true,
},
/**
* @ngdoc method
* @name lbServices.User#findOne
* @methodOf lbServices.User
*
* @description
*
* Find first instance of the model matched by filter from the data source
*
* @param {Object=} parameters Request parameters.
*
* - `filter` – `{object=}` - Filter defining fields, where, orderBy, offset, and limit
*
* @param {Function(Object, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Object} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*
* <em>
* (The remote method definition does not provide any description.
* This usually means the response is a `User` object.)
* </em>
*/
"findOne": {
url: angBase + "/users/findOne",
method: "GET",
},
/**
* @ngdoc method
* @name lbServices.User#destroyById
* @methodOf lbServices.User
*
* @description
*
* Delete a model instance by id from the data source
*
* @param {Object=} parameters Request parameters.
*
* - `id` – `{*}` - Model id
*
* @param {Function(Object, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Object} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*
* This method returns no data.
*/
"destroyById": {
url: angBase + "/users/:id",
method: "DELETE",
},
/**
* @ngdoc method
* @name lbServices.User#deleteById
* @methodOf lbServices.User
*
* @description
*
* Delete a model instance by id from the data source
*
* @param {Object=} parameters Request parameters.
*
* - `id` – `{*}` - Model id
*
* @param {Function(Object, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Object} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*
* This method returns no data.
*/
"deleteById": {
url: angBase + "/users/:id",
method: "DELETE",
},
/**
* @ngdoc method
* @name lbServices.User#removeById
* @methodOf lbServices.User
*
* @description
*
* Delete a model instance by id from the data source
*
* @param {Object=} parameters Request parameters.
*
* - `id` – `{*}` - Model id
*
* @param {Function(Object, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Object} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*
* This method returns no data.
*/
"removeById": {
url: angBase + "/users/:id",
method: "DELETE",
},
/**
* @ngdoc method
* @name lbServices.User#count
* @methodOf lbServices.User
*
* @description
*
* Count instances of the model matched by where from the data source
*
* @param {Object=} parameters Request parameters.
*
* - `where` – `{object=}` - Criteria to match model instances
*
* @param {Function(Object, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Object} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*
* Data properties:
*
* - `count` – `{number=}` -
*/
"count": {
url: angBase + "/users/count",
method: "GET",
},
/**
* @ngdoc method
* @name lbServices.User#prototype$updateAttributes
* @methodOf lbServices.User
*
* @description
*
* Update attributes for a model instance and persist it into the data source
*
* @param {Object=} parameters Request parameters.
*
* This method does not accept any parameters.
* Supply an empty object or omit this argument altogether.
*
* @param {Object} postData Request data.
*
* This method expects a subset of model properties as request parameters.
*
* @param {Function(Object, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Object} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*
* <em>
* (The remote method definition does not provide any description.
* This usually means the response is a `User` object.)
* </em>
*/
"prototype$updateAttributes": {
url: angBase + "/users/:id",
method: "PUT",
},
/**
* @ngdoc method
* @name lbServices.User#prototype$__get__accessTokens
* @methodOf lbServices.User
*
* @description
*
* Queries accessTokens of this model.
*
* @param {Object=} parameters Request parameters.
*
* - `filter` – `{object=}` -
*
* @param {Function(Array.<Object>, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Array.<Object>} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*
* <em>
* (The remote method definition does not provide any description.
* This usually means the response is a `User` object.)
* </em>
*/
"prototype$__get__accessTokens": {
url: angBase + "/users/:id/accessTokens",
method: "GET",
isArray: true,
},
/**
* @ngdoc method
* @name lbServices.User#prototype$__create__accessTokens
* @methodOf lbServices.User
*
* @description
*
* Creates a new instance in accessTokens of this model.
*
* @param {Object=} parameters Request parameters.
*
* This method does not accept any parameters.
* Supply an empty object or omit this argument altogether.
*
* @param {Object} postData Request data.
*
* This method expects a subset of model properties as request parameters.
*
* @param {Function(Object, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Object} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*
* <em>
* (The remote method definition does not provide any description.
* This usually means the response is a `User` object.)
* </em>
*/
"prototype$__create__accessTokens": {
url: angBase + "/users/:id/accessTokens",
method: "POST",
},
/**
* @ngdoc method
* @name lbServices.User#prototype$__delete__accessTokens
* @methodOf lbServices.User
*
* @description
*
* Deletes all accessTokens of this model.
*
* @param {Object=} parameters Request parameters.
*
* This method does not accept any parameters.
* Supply an empty object or omit this argument altogether.
*
* @param {Function(Object, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Object} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*
* <em>
* (The remote method definition does not provide any description.
* This usually means the response is a `User` object.)
* </em>
*/
"prototype$__delete__accessTokens": {
url: angBase + "/users/:id/accessTokens",
method: "DELETE",
},
/**
* @ngdoc method
* @name lbServices.User#getCurrent
* @methodOf lbServices.User
*
* @description
*
* Get data of the currently logged user. Fail with HTTP result 401
* when there is no user logged in.
*
* @param {Function(Object, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Object} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*/
"getCurrent": {
url: angBase + "/users/:id",
method: "GET",
params: {
id: function() {
var id = LoopBackAuth.currentUserId;
if (id == null) id = '__anonymous__';
return id;
}
},
__isGetCurrentUser__ : true
}
}
);
}]);
/**
* @ngdoc object
* @name lbServices.AccessToken
* @object
*
* @description
*
* A $resource object for interacting with the `AccessToken` model.
*
* ## Example
*
* See
* {@link http://docs.angularjs.org/api/ngResource.$resource#example $resource}
* for an example of using this object.
*
*/
module.factory(
"AccessToken",
['LoopBackResource', 'LoopBackAuth', function(Resource, LoopBackAuth) {
return Resource(
angBase + "/accessTokens/:id",
{ 'id': '@id' },
{
/**
* @ngdoc method
* @name lbServices.AccessToken#create
* @methodOf lbServices.AccessToken
*
* @description
*
* Create a new instance of the model and persist it into the data source
*
* @param {Object=} parameters Request parameters.
*
* This method does not accept any parameters.
* Supply an empty object or omit this argument altogether.
*
* @param {Object} postData Request data.
*
* This method expects a subset of model properties as request parameters.
*
* @param {Function(Object, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Object} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*
* <em>
* (The remote method definition does not provide any description.
* This usually means the response is a `AccessToken` object.)
* </em>
*/
"create": {
url: angBase + "/accessTokens",
method: "POST",
},
/**
* @ngdoc method
* @name lbServices.AccessToken#updateOrCreate
* @methodOf lbServices.AccessToken
*
* @description
*
* Update an existing model instance or insert a new one into the data source
*
* @param {Object=} parameters Request parameters.
*
* This method does not accept any parameters.
* Supply an empty object or omit this argument altogether.
*
* @param {Object} postData Request data.
*
* This method expects a subset of model properties as request parameters.
*
* @param {Function(Object, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Object} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*
* <em>
* (The remote method definition does not provide any description.
* This usually means the response is a `AccessToken` object.)
* </em>
*/
"updateOrCreate": {
url: angBase + "/accessTokens",
method: "PUT",
},
/**
* @ngdoc method
* @name lbServices.AccessToken#upsert
* @methodOf lbServices.AccessToken
*
* @description
*
* Update an existing model instance or insert a new one into the data source
*
* @param {Object=} parameters Request parameters.
*
* This method does not accept any parameters.
* Supply an empty object or omit this argument altogether.
*
* @param {Object} postData Request data.
*
* This method expects a subset of model properties as request parameters.
*
* @param {Function(Object, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Object} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*
* <em>
* (The remote method definition does not provide any description.
* This usually means the response is a `AccessToken` object.)
* </em>
*/
"upsert": {
url: angBase + "/accessTokens",
method: "PUT",
},
/**
* @ngdoc method
* @name lbServices.AccessToken#exists
* @methodOf lbServices.AccessToken
*
* @description
*
* Check whether a model instance exists in the data source
*
* @param {Object=} parameters Request parameters.
*
* - `id` – `{*}` - Model id
*
* @param {Function(Object, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Object} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*
* Data properties:
*
* - `exists` – `{*=}` -
*/
"exists": {
url: angBase + "/accessTokens/:id/exists",
method: "GET",
},
/**
* @ngdoc method
* @name lbServices.AccessToken#findById
* @methodOf lbServices.AccessToken
*
* @description
*
* Find a model instance by id from the data source
*
* @param {Object=} parameters Request parameters.
*
* - `id` – `{*}` - Model id
*
* @param {Function(Object, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Object} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*
* <em>
* (The remote method definition does not provide any description.
* This usually means the response is a `AccessToken` object.)
* </em>
*/
"findById": {
url: angBase + "/accessTokens/:id",
method: "GET",
},
/**
* @ngdoc method
* @name lbServices.AccessToken#find
* @methodOf lbServices.AccessToken
*
* @description
*
* Find all instances of the model matched by filter from the data source
*
* @param {Object=} parameters Request parameters.
*
* - `filter` – `{object=}` - Filter defining fields, where, orderBy, offset, and limit
*
* @param {Function(Array.<Object>, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Array.<Object>} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*
* <em>
* (The remote method definition does not provide any description.
* This usually means the response is a `AccessToken` object.)
* </em>
*/
"find": {
url: angBase + "/accessTokens",
method: "GET",
isArray: true,
},
/**
* @ngdoc method
* @name lbServices.AccessToken#findOne
* @methodOf lbServices.AccessToken
*
* @description
*
* Find first instance of the model matched by filter from the data source
*
* @param {Object=} parameters Request parameters.
*
* - `filter` – `{object=}` - Filter defining fields, where, orderBy, offset, and limit
*
* @param {Function(Object, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Object} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*
* <em>
* (The remote method definition does not provide any description.
* This usually means the response is a `AccessToken` object.)
* </em>
*/
"findOne": {
url: angBase + "/accessTokens/findOne",
method: "GET",
},
/**
* @ngdoc method
* @name lbServices.AccessToken#destroyById
* @methodOf lbServices.AccessToken
*
* @description
*
* Delete a model instance by id from the data source
*
* @param {Object=} parameters Request parameters.
*
* - `id` – `{*}` - Model id
*
* @param {Function(Object, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Object} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*
* This method returns no data.
*/
"destroyById": {
url: angBase + "/accessTokens/:id",
method: "DELETE",
},
/**
* @ngdoc method
* @name lbServices.AccessToken#deleteById
* @methodOf lbServices.AccessToken
*
* @description
*
* Delete a model instance by id from the data source
*
* @param {Object=} parameters Request parameters.
*
* - `id` – `{*}` - Model id
*
* @param {Function(Object, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Object} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*
* This method returns no data.
*/
"deleteById": {
url: angBase + "/accessTokens/:id",
method: "DELETE",
},
/**
* @ngdoc method
* @name lbServices.AccessToken#removeById
* @methodOf lbServices.AccessToken
*
* @description
*
* Delete a model instance by id from the data source
*
* @param {Object=} parameters Request parameters.
*
* - `id` – `{*}` - Model id
*
* @param {Function(Object, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Object} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*
* This method returns no data.
*/
"removeById": {
url: angBase + "/accessTokens/:id",
method: "DELETE",
},
/**
* @ngdoc method
* @name lbServices.AccessToken#count
* @methodOf lbServices.AccessToken
*
* @description
*
* Count instances of the model matched by where from the data source
*
* @param {Object=} parameters Request parameters.
*
* - `where` – `{object=}` - Criteria to match model instances
*
* @param {Function(Object, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Object} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*
* Data properties:
*
* - `count` – `{number=}` -
*/
"count": {
url: angBase + "/accessTokens/count",
method: "GET",
},
/**
* @ngdoc method
* @name lbServices.AccessToken#prototype$updateAttributes
* @methodOf lbServices.AccessToken
*
* @description
*
* Update attributes for a model instance and persist it into the data source
*
* @param {Object=} parameters Request parameters.
*
* This method does not accept any parameters.
* Supply an empty object or omit this argument altogether.
*
* @param {Object} postData Request data.
*
* This method expects a subset of model properties as request parameters.
*
* @param {Function(Object, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Object} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*
* <em>
* (The remote method definition does not provide any description.
* This usually means the response is a `AccessToken` object.)
* </em>
*/
"prototype$updateAttributes": {
url: angBase + "/accessTokens/:id",
method: "PUT",
},
/**
* @ngdoc method
* @name lbServices.AccessToken#prototype$__get__user
* @methodOf lbServices.AccessToken
*
* @description
*
* Fetches belongsTo relation user
*
* @param {Object=} parameters Request parameters.
*
* - `refresh` – `{boolean=}` -
*
* @param {Function(Object, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Object} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*
* <em>
* (The remote method definition does not provide any description.
* This usually means the response is a `AccessToken` object.)
* </em>
*/
"prototype$__get__user": {
url: angBase + "/accessTokens/:id/user",
method: "GET",
},
}
);
}]);
/**
* @ngdoc object
* @name lbServices.Application
* @object
*
* @description
*
* A $resource object for interacting with the `Application` model.
*
* ## Example
*
* See
* {@link http://docs.angularjs.org/api/ngResource.$resource#example $resource}
* for an example of using this object.
*
*/
module.factory(
"Application",
['LoopBackResource', 'LoopBackAuth', function(Resource, LoopBackAuth) {
return Resource(
angBase + "/applications/:id",
{ 'id': '@id' },
{
/**
* @ngdoc method
* @name lbServices.Application#create
* @methodOf lbServices.Application
*
* @description
*
* Create a new instance of the model and persist it into the data source
*
* @param {Object=} parameters Request parameters.
*
* This method does not accept any parameters.
* Supply an empty object or omit this argument altogether.
*
* @param {Object} postData Request data.
*
* This method expects a subset of model properties as request parameters.
*
* @param {Function(Object, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Object} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*
* <em>
* (The remote method definition does not provide any description.
* This usually means the response is a `Application` object.)
* </em>
*/
"create": {
url: angBase + "/applications",
method: "POST",
},
/**
* @ngdoc method
* @name lbServices.Application#updateOrCreate
* @methodOf lbServices.Application
*
* @description
*
* Update an existing model instance or insert a new one into the data source
*
* @param {Object=} parameters Request parameters.
*
* This method does not accept any parameters.
* Supply an empty object or omit this argument altogether.
*
* @param {Object} postData Request data.
*
* This method expects a subset of model properties as request parameters.
*
* @param {Function(Object, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Object} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*
* <em>
* (The remote method definition does not provide any description.
* This usually means the response is a `Application` object.)
* </em>
*/
"updateOrCreate": {
url: angBase + "/applications",
method: "PUT",
},
/**
* @ngdoc method
* @name lbServices.Application#upsert
* @methodOf lbServices.Application
*
* @description
*
* Update an existing model instance or insert a new one into the data source
*
* @param {Object=} parameters Request parameters.
*
* This method does not accept any parameters.
* Supply an empty object or omit this argument altogether.
*
* @param {Object} postData Request data.
*
* This method expects a subset of model properties as request parameters.
*
* @param {Function(Object, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Object} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*
* <em>
* (The remote method definition does not provide any description.
* This usually means the response is a `Application` object.)
* </em>
*/
"upsert": {
url: angBase + "/applications",
method: "PUT",
},
/**
* @ngdoc method
* @name lbServices.Application#exists
* @methodOf lbServices.Application
*
* @description
*
* Check whether a model instance exists in the data source
*
* @param {Object=} parameters Request parameters.
*
* - `id` – `{*}` - Model id
*
* @param {Function(Object, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `httpResponse`.
*
* @return {Object} An empty reference that will be
* populated with the actual data once the response is returned
* from the server.
*
* Data properties:
*
* - `exists` – `{*=}` -
*/
"exists": {
url: angBase + "/applications/:id/exists",
method: "GET",
},
/**
* @ngdoc method
* @name lbServices.Application#findById
* @methodOf lbServices.Application
*
* @description
*
* Find a model instance by id from the data source
*
* @param {Object=} parameters Request parameters.
*
* - `id` – `{*}` - Model id
*
* @param {Function(Object, Object)=} successCb
* Success callback with two arguments: `value`, `responseHeaders`.
*
* @param {Function(Object)=} errorCb Error callback with one argument:
* `ht