diff --git a/README.md b/README.md index 655f2d25..60635cc5 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,65 @@ +# ctrees hack of loopback-angular-admin +1. Setup + - git clone https://github.com/ctrees/loopback-angular-admin.git + - cd loopback-angular-admin + - npm install + - grunt build + - npm start + - browse to http://localhost:3000/ + - Open DevTools (so we can get an API token when login) + - login admin@admin.com admin + - Get token from network traffic monitor + - browse to http://localhost:3000/explorer + - paste token into setToken box +2. Mod some UI stuff to ID the project from it's fork + - hack server/boot/01-load-settings.js + - change appName value to: 'ctrees test' + - change appTheme value to: 'skin-black' + - grunt build + - npm start + - browse to http://localhost:3000/ login and verify changes +3. Mod to add new data model + - Go to http://localhost:3000/#/app/sandbox/faker and click Posts + - Go to http://localhost:3000/#/app/posts to verify you see data (this is what we will clone) + - shutdown server + - Create new common model and generate new lb-services.js + - cp common/models/post.json common/models/poke.json + - cleanup poke.json and add reference to server/model-config.json + - cd client/app + - mv js/lb-services.js js/lb-services_org + - lb-ng ../../server/server.js js/lb-services.js + - cd ../../ + - Create new model crud in UI + - cp -R client/app/modules/posts client/app/modules/pokes + - cleanup file and names in pokes tree + - cd client/app/modules/pokes/ + - mv app.posts.js app.pokes.js + - mv config/posts.config.js config/pokes.config.js + - mv config/posts.routes.js config/pokes.routes.js + - mv controllers/posts.ctrl.js controllers/pokes.ctrl.js + - mv services/posts.service.js services/pokes.service.js + - add to client/app/index.html + - script src="/modules/pokes/app.pokes.js"> + * (The remote method definition does not provide any description. + * This usually means the response is a `AccessToken` object.) + * + */ + "create": { + url: urlBase + "/accessTokens", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.AccessToken#createMany + * @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(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `AccessToken` object.) + * + */ + "createMany": { + isArray: true, + url: urlBase + "/accessTokens", + method: "POST" + }, + + /** + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `AccessToken` object.) + * + */ + "upsert": { + url: urlBase + "/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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `exists` – `{boolean=}` - + */ + "exists": { + url: urlBase + "/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 + * + * - `filter` – `{object=}` - Filter defining fields and include + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `AccessToken` object.) + * + */ + "findById": { + url: urlBase + "/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, include, order, offset, and limit + * + * @param {function(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `AccessToken` object.) + * + */ + "find": { + isArray: true, + url: urlBase + "/accessTokens", + method: "GET" + }, + + /** + * @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, include, order, 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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `AccessToken` object.) + * + */ + "findOne": { + url: urlBase + "/accessTokens/findOne", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.AccessToken#updateAll + * @methodOf lbServices.AccessToken + * + * @description + * + * Update instances of the model matched by where from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `where` – `{object=}` - Criteria to match model instances + * + * @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`. + * + * @returns {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. + */ + "updateAll": { + url: urlBase + "/accessTokens/update", + method: "POST" + }, + + /** + * @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`. + * + * @returns {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: urlBase + "/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`. + * + * @returns {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: urlBase + "/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. + * + * - `id` – `{*}` - AccessToken id + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `AccessToken` object.) + * + */ + "prototype$updateAttributes": { + url: urlBase + "/accessTokens/:id", + method: "PUT" + }, + + /** + * @ngdoc method + * @name lbServices.AccessToken#createChangeStream + * @methodOf lbServices.AccessToken + * + * @description + * + * Create a change stream. + * + * @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. + * + * - `options` – `{object=}` - + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `changes` – `{ReadableStream=}` - + */ + "createChangeStream": { + url: urlBase + "/accessTokens/change-stream", + method: "POST" + }, + + // INTERNAL. Use User.accessTokens.findById() instead. + "::findById::user::accessTokens": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/users/:id/accessTokens/:fk", + method: "GET" + }, + + // INTERNAL. Use User.accessTokens.destroyById() instead. + "::destroyById::user::accessTokens": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/users/:id/accessTokens/:fk", + method: "DELETE" + }, + + // INTERNAL. Use User.accessTokens.updateById() instead. + "::updateById::user::accessTokens": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/users/:id/accessTokens/:fk", + method: "PUT" + }, + + // INTERNAL. Use User.accessTokens() instead. + "::get::user::accessTokens": { + isArray: true, + url: urlBase + "/users/:id/accessTokens", + method: "GET" + }, + + // INTERNAL. Use User.accessTokens.create() instead. + "::create::user::accessTokens": { + url: urlBase + "/users/:id/accessTokens", + method: "POST" + }, + + // INTERNAL. Use User.accessTokens.createMany() instead. + "::createMany::user::accessTokens": { + isArray: true, + url: urlBase + "/users/:id/accessTokens", + method: "POST" + }, + + // INTERNAL. Use User.accessTokens.destroyAll() instead. + "::delete::user::accessTokens": { + url: urlBase + "/users/:id/accessTokens", + method: "DELETE" + }, + + // INTERNAL. Use User.accessTokens.count() instead. + "::count::user::accessTokens": { + url: urlBase + "/users/:id/accessTokens/count", + method: "GET" + }, + } + ); + + + + /** + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `AccessToken` object.) + * + */ + R["updateOrCreate"] = R["upsert"]; + + /** + * @ngdoc method + * @name lbServices.AccessToken#update + * @methodOf lbServices.AccessToken + * + * @description + * + * Update instances of the model matched by where from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `where` – `{object=}` - Criteria to match model instances + * + * @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`. + * + * @returns {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. + */ + R["update"] = R["updateAll"]; + + /** + * @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`. + * + * @returns {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. + */ + R["destroyById"] = R["deleteById"]; + + /** + * @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`. + * + * @returns {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. + */ + R["removeById"] = R["deleteById"]; + + + /** + * @ngdoc property + * @name lbServices.AccessToken#modelName + * @propertyOf lbServices.AccessToken + * @description + * The name of the model represented by this $resource, + * i.e. `AccessToken`. + */ + R.modelName = "AccessToken"; + + + /** + * @ngdoc method + * @name lbServices.AccessToken#user + * @methodOf lbServices.AccessToken + * + * @description + * + * Fetches belongsTo relation user. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - AccessToken id + * + * - `refresh` – `{boolean=}` - + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `User` object.) + * + */ + R.user = function() { + var TargetResource = $injector.get("User"); + var action = TargetResource["::get::accessToken::user"]; + return action.apply(R, arguments); + }; + + return R; + }]); + +/** + * @ngdoc object + * @name lbServices.RoleMapping + * @header lbServices.RoleMapping + * @object + * + * @description + * + * A $resource object for interacting with the `RoleMapping` model. + * + * ## Example + * + * See + * {@link http://docs.angularjs.org/api/ngResource.$resource#example $resource} + * for an example of using this object. + * + */ +module.factory( + "RoleMapping", + ['LoopBackResource', 'LoopBackAuth', '$injector', function(Resource, LoopBackAuth, $injector) { + var R = Resource( + urlBase + "/RoleMappings/:id", + { 'id': '@id' }, + { + + // INTERNAL. Use RoleMapping.role() instead. + "prototype$__get__role": { + url: urlBase + "/RoleMappings/:id/role", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.RoleMapping#create + * @methodOf lbServices.RoleMapping + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `RoleMapping` object.) + * + */ + "create": { + url: urlBase + "/RoleMappings", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.RoleMapping#createMany + * @methodOf lbServices.RoleMapping + * + * @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(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `RoleMapping` object.) + * + */ + "createMany": { + isArray: true, + url: urlBase + "/RoleMappings", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.RoleMapping#upsert + * @methodOf lbServices.RoleMapping + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `RoleMapping` object.) + * + */ + "upsert": { + url: urlBase + "/RoleMappings", + method: "PUT" + }, + + /** + * @ngdoc method + * @name lbServices.RoleMapping#exists + * @methodOf lbServices.RoleMapping + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `exists` – `{boolean=}` - + */ + "exists": { + url: urlBase + "/RoleMappings/:id/exists", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.RoleMapping#findById + * @methodOf lbServices.RoleMapping + * + * @description + * + * Find a model instance by id from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - Model id + * + * - `filter` – `{object=}` - Filter defining fields and include + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `RoleMapping` object.) + * + */ + "findById": { + url: urlBase + "/RoleMappings/:id", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.RoleMapping#find + * @methodOf lbServices.RoleMapping + * + * @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, include, order, offset, and limit + * + * @param {function(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `RoleMapping` object.) + * + */ + "find": { + isArray: true, + url: urlBase + "/RoleMappings", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.RoleMapping#findOne + * @methodOf lbServices.RoleMapping + * + * @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, include, order, 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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `RoleMapping` object.) + * + */ + "findOne": { + url: urlBase + "/RoleMappings/findOne", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.RoleMapping#updateAll + * @methodOf lbServices.RoleMapping + * + * @description + * + * Update instances of the model matched by where from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `where` – `{object=}` - Criteria to match model instances + * + * @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`. + * + * @returns {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. + */ + "updateAll": { + url: urlBase + "/RoleMappings/update", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.RoleMapping#deleteById + * @methodOf lbServices.RoleMapping + * + * @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`. + * + * @returns {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: urlBase + "/RoleMappings/:id", + method: "DELETE" + }, + + /** + * @ngdoc method + * @name lbServices.RoleMapping#count + * @methodOf lbServices.RoleMapping + * + * @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`. + * + * @returns {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: urlBase + "/RoleMappings/count", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.RoleMapping#prototype$updateAttributes + * @methodOf lbServices.RoleMapping + * + * @description + * + * Update attributes for a model instance and persist it into the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - PersistedModel id + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `RoleMapping` object.) + * + */ + "prototype$updateAttributes": { + url: urlBase + "/RoleMappings/:id", + method: "PUT" + }, + + /** + * @ngdoc method + * @name lbServices.RoleMapping#createChangeStream + * @methodOf lbServices.RoleMapping + * + * @description + * + * Create a change stream. + * + * @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. + * + * - `options` – `{object=}` - + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `changes` – `{ReadableStream=}` - + */ + "createChangeStream": { + url: urlBase + "/RoleMappings/change-stream", + method: "POST" + }, + + // INTERNAL. Use Role.principals.findById() instead. + "::findById::Role::principals": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/Roles/:id/principals/:fk", + method: "GET" + }, + + // INTERNAL. Use Role.principals.destroyById() instead. + "::destroyById::Role::principals": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/Roles/:id/principals/:fk", + method: "DELETE" + }, + + // INTERNAL. Use Role.principals.updateById() instead. + "::updateById::Role::principals": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/Roles/:id/principals/:fk", + method: "PUT" + }, + + // INTERNAL. Use Role.principals() instead. + "::get::Role::principals": { + isArray: true, + url: urlBase + "/Roles/:id/principals", + method: "GET" + }, + + // INTERNAL. Use Role.principals.create() instead. + "::create::Role::principals": { + url: urlBase + "/Roles/:id/principals", + method: "POST" + }, + + // INTERNAL. Use Role.principals.createMany() instead. + "::createMany::Role::principals": { + isArray: true, + url: urlBase + "/Roles/:id/principals", + method: "POST" + }, + + // INTERNAL. Use Role.principals.destroyAll() instead. + "::delete::Role::principals": { + url: urlBase + "/Roles/:id/principals", + method: "DELETE" + }, + + // INTERNAL. Use Role.principals.count() instead. + "::count::Role::principals": { + url: urlBase + "/Roles/:id/principals/count", + method: "GET" + }, + } + ); + + + + /** + * @ngdoc method + * @name lbServices.RoleMapping#updateOrCreate + * @methodOf lbServices.RoleMapping + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `RoleMapping` object.) + * + */ + R["updateOrCreate"] = R["upsert"]; + + /** + * @ngdoc method + * @name lbServices.RoleMapping#update + * @methodOf lbServices.RoleMapping + * + * @description + * + * Update instances of the model matched by where from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `where` – `{object=}` - Criteria to match model instances + * + * @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`. + * + * @returns {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. + */ + R["update"] = R["updateAll"]; + + /** + * @ngdoc method + * @name lbServices.RoleMapping#destroyById + * @methodOf lbServices.RoleMapping + * + * @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`. + * + * @returns {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. + */ + R["destroyById"] = R["deleteById"]; + + /** + * @ngdoc method + * @name lbServices.RoleMapping#removeById + * @methodOf lbServices.RoleMapping + * + * @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`. + * + * @returns {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. + */ + R["removeById"] = R["deleteById"]; + + + /** + * @ngdoc property + * @name lbServices.RoleMapping#modelName + * @propertyOf lbServices.RoleMapping + * @description + * The name of the model represented by this $resource, + * i.e. `RoleMapping`. + */ + R.modelName = "RoleMapping"; + + + /** + * @ngdoc method + * @name lbServices.RoleMapping#role + * @methodOf lbServices.RoleMapping + * + * @description + * + * Fetches belongsTo relation role. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - PersistedModel id + * + * - `refresh` – `{boolean=}` - + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Role` object.) + * + */ + R.role = function() { + var TargetResource = $injector.get("Role"); + var action = TargetResource["::get::RoleMapping::role"]; + return action.apply(R, arguments); + }; + + return R; + }]); + +/** + * @ngdoc object + * @name lbServices.Role + * @header lbServices.Role + * @object + * + * @description + * + * A $resource object for interacting with the `Role` model. + * + * ## Example + * + * See + * {@link http://docs.angularjs.org/api/ngResource.$resource#example $resource} + * for an example of using this object. + * + */ +module.factory( + "Role", + ['LoopBackResource', 'LoopBackAuth', '$injector', function(Resource, LoopBackAuth, $injector) { + var R = Resource( + urlBase + "/Roles/:id", + { 'id': '@id' }, + { + + // INTERNAL. Use Role.principals.findById() instead. + "prototype$__findById__principals": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/Roles/:id/principals/:fk", + method: "GET" + }, + + // INTERNAL. Use Role.principals.destroyById() instead. + "prototype$__destroyById__principals": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/Roles/:id/principals/:fk", + method: "DELETE" + }, + + // INTERNAL. Use Role.principals.updateById() instead. + "prototype$__updateById__principals": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/Roles/:id/principals/:fk", + method: "PUT" + }, + + // INTERNAL. Use Role.principals() instead. + "prototype$__get__principals": { + isArray: true, + url: urlBase + "/Roles/:id/principals", + method: "GET" + }, + + // INTERNAL. Use Role.principals.create() instead. + "prototype$__create__principals": { + url: urlBase + "/Roles/:id/principals", + method: "POST" + }, + + // INTERNAL. Use Role.principals.destroyAll() instead. + "prototype$__delete__principals": { + url: urlBase + "/Roles/:id/principals", + method: "DELETE" + }, + + // INTERNAL. Use Role.principals.count() instead. + "prototype$__count__principals": { + url: urlBase + "/Roles/:id/principals/count", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Role#create + * @methodOf lbServices.Role + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Role` object.) + * + */ + "create": { + url: urlBase + "/Roles", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.Role#createMany + * @methodOf lbServices.Role + * + * @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(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Role` object.) + * + */ + "createMany": { + isArray: true, + url: urlBase + "/Roles", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.Role#upsert + * @methodOf lbServices.Role + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Role` object.) + * + */ + "upsert": { + url: urlBase + "/Roles", + method: "PUT" + }, + + /** + * @ngdoc method + * @name lbServices.Role#exists + * @methodOf lbServices.Role + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `exists` – `{boolean=}` - + */ + "exists": { + url: urlBase + "/Roles/:id/exists", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Role#findById + * @methodOf lbServices.Role + * + * @description + * + * Find a model instance by id from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - Model id + * + * - `filter` – `{object=}` - Filter defining fields and include + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Role` object.) + * + */ + "findById": { + url: urlBase + "/Roles/:id", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Role#find + * @methodOf lbServices.Role + * + * @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, include, order, offset, and limit + * + * @param {function(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Role` object.) + * + */ + "find": { + isArray: true, + url: urlBase + "/Roles", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Role#findOne + * @methodOf lbServices.Role + * + * @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, include, order, 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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Role` object.) + * + */ + "findOne": { + url: urlBase + "/Roles/findOne", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Role#updateAll + * @methodOf lbServices.Role + * + * @description + * + * Update instances of the model matched by where from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `where` – `{object=}` - Criteria to match model instances + * + * @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`. + * + * @returns {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. + */ + "updateAll": { + url: urlBase + "/Roles/update", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.Role#deleteById + * @methodOf lbServices.Role + * + * @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`. + * + * @returns {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: urlBase + "/Roles/:id", + method: "DELETE" + }, + + /** + * @ngdoc method + * @name lbServices.Role#count + * @methodOf lbServices.Role + * + * @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`. + * + * @returns {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: urlBase + "/Roles/count", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Role#prototype$updateAttributes + * @methodOf lbServices.Role + * + * @description + * + * Update attributes for a model instance and persist it into the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - PersistedModel id + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Role` object.) + * + */ + "prototype$updateAttributes": { + url: urlBase + "/Roles/:id", + method: "PUT" + }, + + /** + * @ngdoc method + * @name lbServices.Role#createChangeStream + * @methodOf lbServices.Role + * + * @description + * + * Create a change stream. + * + * @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. + * + * - `options` – `{object=}` - + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `changes` – `{ReadableStream=}` - + */ + "createChangeStream": { + url: urlBase + "/Roles/change-stream", + method: "POST" + }, + + // INTERNAL. Use RoleMapping.role() instead. + "::get::RoleMapping::role": { + url: urlBase + "/RoleMappings/:id/role", + method: "GET" + }, + + // INTERNAL. Use User.roles.findById() instead. + "::findById::user::roles": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/users/:id/roles/:fk", + method: "GET" + }, + + // INTERNAL. Use User.roles.destroyById() instead. + "::destroyById::user::roles": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/users/:id/roles/:fk", + method: "DELETE" + }, + + // INTERNAL. Use User.roles.updateById() instead. + "::updateById::user::roles": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/users/:id/roles/:fk", + method: "PUT" + }, + + // INTERNAL. Use User.roles.link() instead. + "::link::user::roles": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/users/:id/roles/rel/:fk", + method: "PUT" + }, + + // INTERNAL. Use User.roles.unlink() instead. + "::unlink::user::roles": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/users/:id/roles/rel/:fk", + method: "DELETE" + }, + + // INTERNAL. Use User.roles.exists() instead. + "::exists::user::roles": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/users/:id/roles/rel/:fk", + method: "HEAD" + }, + + // INTERNAL. Use User.roles() instead. + "::get::user::roles": { + isArray: true, + url: urlBase + "/users/:id/roles", + method: "GET" + }, + + // INTERNAL. Use User.roles.create() instead. + "::create::user::roles": { + url: urlBase + "/users/:id/roles", + method: "POST" + }, + + // INTERNAL. Use User.roles.createMany() instead. + "::createMany::user::roles": { + isArray: true, + url: urlBase + "/users/:id/roles", + method: "POST" + }, + + // INTERNAL. Use User.roles.destroyAll() instead. + "::delete::user::roles": { + url: urlBase + "/users/:id/roles", + method: "DELETE" + }, + + // INTERNAL. Use User.roles.count() instead. + "::count::user::roles": { + url: urlBase + "/users/:id/roles/count", + method: "GET" + }, + } + ); + + + + /** + * @ngdoc method + * @name lbServices.Role#updateOrCreate + * @methodOf lbServices.Role + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Role` object.) + * + */ + R["updateOrCreate"] = R["upsert"]; + + /** + * @ngdoc method + * @name lbServices.Role#update + * @methodOf lbServices.Role + * + * @description + * + * Update instances of the model matched by where from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `where` – `{object=}` - Criteria to match model instances + * + * @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`. + * + * @returns {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. + */ + R["update"] = R["updateAll"]; + + /** + * @ngdoc method + * @name lbServices.Role#destroyById + * @methodOf lbServices.Role + * + * @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`. + * + * @returns {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. + */ + R["destroyById"] = R["deleteById"]; + + /** + * @ngdoc method + * @name lbServices.Role#removeById + * @methodOf lbServices.Role + * + * @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`. + * + * @returns {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. + */ + R["removeById"] = R["deleteById"]; + + + /** + * @ngdoc property + * @name lbServices.Role#modelName + * @propertyOf lbServices.Role + * @description + * The name of the model represented by this $resource, + * i.e. `Role`. + */ + R.modelName = "Role"; + + /** + * @ngdoc object + * @name lbServices.Role.principals + * @header lbServices.Role.principals + * @object + * @description + * + * The object `Role.principals` groups methods + * manipulating `RoleMapping` instances related to `Role`. + * + * Call {@link lbServices.Role#principals Role.principals()} + * to query all related instances. + */ + + + /** + * @ngdoc method + * @name lbServices.Role#principals + * @methodOf lbServices.Role + * + * @description + * + * Queries principals of Role. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - PersistedModel id + * + * - `filter` – `{object=}` - + * + * @param {function(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `RoleMapping` object.) + * + */ + R.principals = function() { + var TargetResource = $injector.get("RoleMapping"); + var action = TargetResource["::get::Role::principals"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.Role.principals#count + * @methodOf lbServices.Role.principals + * + * @description + * + * Counts principals of Role. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - PersistedModel id + * + * - `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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `count` – `{number=}` - + */ + R.principals.count = function() { + var TargetResource = $injector.get("RoleMapping"); + var action = TargetResource["::count::Role::principals"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.Role.principals#create + * @methodOf lbServices.Role.principals + * + * @description + * + * Creates a new instance in principals of this model. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - PersistedModel id + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `RoleMapping` object.) + * + */ + R.principals.create = function() { + var TargetResource = $injector.get("RoleMapping"); + var action = TargetResource["::create::Role::principals"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.Role.principals#createMany + * @methodOf lbServices.Role.principals + * + * @description + * + * Creates a new instance in principals of this model. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - PersistedModel id + * + * @param {Object} postData Request data. + * + * This method expects a subset of model properties as request parameters. + * + * @param {function(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `RoleMapping` object.) + * + */ + R.principals.createMany = function() { + var TargetResource = $injector.get("RoleMapping"); + var action = TargetResource["::createMany::Role::principals"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.Role.principals#destroyAll + * @methodOf lbServices.Role.principals + * + * @description + * + * Deletes all principals of this model. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - PersistedModel id + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {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. + */ + R.principals.destroyAll = function() { + var TargetResource = $injector.get("RoleMapping"); + var action = TargetResource["::delete::Role::principals"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.Role.principals#destroyById + * @methodOf lbServices.Role.principals + * + * @description + * + * Delete a related item by id for principals. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - PersistedModel id + * + * - `fk` – `{*}` - Foreign key for principals + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {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. + */ + R.principals.destroyById = function() { + var TargetResource = $injector.get("RoleMapping"); + var action = TargetResource["::destroyById::Role::principals"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.Role.principals#findById + * @methodOf lbServices.Role.principals + * + * @description + * + * Find a related item by id for principals. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - PersistedModel id + * + * - `fk` – `{*}` - Foreign key for principals + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `RoleMapping` object.) + * + */ + R.principals.findById = function() { + var TargetResource = $injector.get("RoleMapping"); + var action = TargetResource["::findById::Role::principals"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.Role.principals#updateById + * @methodOf lbServices.Role.principals + * + * @description + * + * Update a related item by id for principals. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - PersistedModel id + * + * - `fk` – `{*}` - Foreign key for principals + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `RoleMapping` object.) + * + */ + R.principals.updateById = function() { + var TargetResource = $injector.get("RoleMapping"); + var action = TargetResource["::updateById::Role::principals"]; + return action.apply(R, arguments); + }; + + return R; + }]); + +/** + * @ngdoc object + * @name lbServices.UserCredential + * @header lbServices.UserCredential + * @object + * + * @description + * + * A $resource object for interacting with the `UserCredential` model. + * + * ## Example + * + * See + * {@link http://docs.angularjs.org/api/ngResource.$resource#example $resource} + * for an example of using this object. + * + */ +module.factory( + "UserCredential", + ['LoopBackResource', 'LoopBackAuth', '$injector', function(Resource, LoopBackAuth, $injector) { + var R = Resource( + urlBase + "/userCredentials/:id", + { 'id': '@id' }, + { + + // INTERNAL. Use UserCredential.user() instead. + "prototype$__get__user": { + url: urlBase + "/userCredentials/:id/user", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.UserCredential#create + * @methodOf lbServices.UserCredential + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `UserCredential` object.) + * + */ + "create": { + url: urlBase + "/userCredentials", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.UserCredential#createMany + * @methodOf lbServices.UserCredential + * + * @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(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `UserCredential` object.) + * + */ + "createMany": { + isArray: true, + url: urlBase + "/userCredentials", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.UserCredential#upsert + * @methodOf lbServices.UserCredential + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `UserCredential` object.) + * + */ + "upsert": { + url: urlBase + "/userCredentials", + method: "PUT" + }, + + /** + * @ngdoc method + * @name lbServices.UserCredential#exists + * @methodOf lbServices.UserCredential + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `exists` – `{boolean=}` - + */ + "exists": { + url: urlBase + "/userCredentials/:id/exists", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.UserCredential#findById + * @methodOf lbServices.UserCredential + * + * @description + * + * Find a model instance by id from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - Model id + * + * - `filter` – `{object=}` - Filter defining fields and include + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `UserCredential` object.) + * + */ + "findById": { + url: urlBase + "/userCredentials/:id", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.UserCredential#find + * @methodOf lbServices.UserCredential + * + * @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, include, order, offset, and limit + * + * @param {function(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `UserCredential` object.) + * + */ + "find": { + isArray: true, + url: urlBase + "/userCredentials", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.UserCredential#findOne + * @methodOf lbServices.UserCredential + * + * @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, include, order, 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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `UserCredential` object.) + * + */ + "findOne": { + url: urlBase + "/userCredentials/findOne", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.UserCredential#updateAll + * @methodOf lbServices.UserCredential + * + * @description + * + * Update instances of the model matched by where from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `where` – `{object=}` - Criteria to match model instances + * + * @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`. + * + * @returns {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. + */ + "updateAll": { + url: urlBase + "/userCredentials/update", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.UserCredential#deleteById + * @methodOf lbServices.UserCredential + * + * @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`. + * + * @returns {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: urlBase + "/userCredentials/:id", + method: "DELETE" + }, + + /** + * @ngdoc method + * @name lbServices.UserCredential#count + * @methodOf lbServices.UserCredential + * + * @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`. + * + * @returns {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: urlBase + "/userCredentials/count", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.UserCredential#prototype$updateAttributes + * @methodOf lbServices.UserCredential + * + * @description + * + * Update attributes for a model instance and persist it into the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - UserCredential id + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `UserCredential` object.) + * + */ + "prototype$updateAttributes": { + url: urlBase + "/userCredentials/:id", + method: "PUT" + }, + + /** + * @ngdoc method + * @name lbServices.UserCredential#createChangeStream + * @methodOf lbServices.UserCredential + * + * @description + * + * Create a change stream. + * + * @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. + * + * - `options` – `{object=}` - + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `changes` – `{ReadableStream=}` - + */ + "createChangeStream": { + url: urlBase + "/userCredentials/change-stream", + method: "POST" + }, + + // INTERNAL. Use User.credentials.findById() instead. + "::findById::user::credentials": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/users/:id/credentials/:fk", + method: "GET" + }, + + // INTERNAL. Use User.credentials.destroyById() instead. + "::destroyById::user::credentials": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/users/:id/credentials/:fk", + method: "DELETE" + }, + + // INTERNAL. Use User.credentials.updateById() instead. + "::updateById::user::credentials": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/users/:id/credentials/:fk", + method: "PUT" + }, + + // INTERNAL. Use User.credentials() instead. + "::get::user::credentials": { + isArray: true, + url: urlBase + "/users/:id/credentials", + method: "GET" + }, + + // INTERNAL. Use User.credentials.create() instead. + "::create::user::credentials": { + url: urlBase + "/users/:id/credentials", + method: "POST" + }, + + // INTERNAL. Use User.credentials.createMany() instead. + "::createMany::user::credentials": { + isArray: true, + url: urlBase + "/users/:id/credentials", + method: "POST" + }, + + // INTERNAL. Use User.credentials.destroyAll() instead. + "::delete::user::credentials": { + url: urlBase + "/users/:id/credentials", + method: "DELETE" + }, + + // INTERNAL. Use User.credentials.count() instead. + "::count::user::credentials": { + url: urlBase + "/users/:id/credentials/count", + method: "GET" + }, + } + ); + + + + /** + * @ngdoc method + * @name lbServices.UserCredential#updateOrCreate + * @methodOf lbServices.UserCredential + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `UserCredential` object.) + * + */ + R["updateOrCreate"] = R["upsert"]; + + /** + * @ngdoc method + * @name lbServices.UserCredential#update + * @methodOf lbServices.UserCredential + * + * @description + * + * Update instances of the model matched by where from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `where` – `{object=}` - Criteria to match model instances + * + * @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`. + * + * @returns {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. + */ + R["update"] = R["updateAll"]; + + /** + * @ngdoc method + * @name lbServices.UserCredential#destroyById + * @methodOf lbServices.UserCredential + * + * @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`. + * + * @returns {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. + */ + R["destroyById"] = R["deleteById"]; + + /** + * @ngdoc method + * @name lbServices.UserCredential#removeById + * @methodOf lbServices.UserCredential + * + * @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`. + * + * @returns {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. + */ + R["removeById"] = R["deleteById"]; + + + /** + * @ngdoc property + * @name lbServices.UserCredential#modelName + * @propertyOf lbServices.UserCredential + * @description + * The name of the model represented by this $resource, + * i.e. `UserCredential`. + */ + R.modelName = "UserCredential"; + + + /** + * @ngdoc method + * @name lbServices.UserCredential#user + * @methodOf lbServices.UserCredential + * + * @description + * + * Fetches belongsTo relation user. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - UserCredential id + * + * - `refresh` – `{boolean=}` - + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `User` object.) + * + */ + R.user = function() { + var TargetResource = $injector.get("User"); + var action = TargetResource["::get::userCredential::user"]; + return action.apply(R, arguments); + }; + + return R; + }]); + +/** + * @ngdoc object + * @name lbServices.UserIdentity + * @header lbServices.UserIdentity + * @object + * + * @description + * + * A $resource object for interacting with the `UserIdentity` model. + * + * ## Example + * + * See + * {@link http://docs.angularjs.org/api/ngResource.$resource#example $resource} + * for an example of using this object. + * + */ +module.factory( + "UserIdentity", + ['LoopBackResource', 'LoopBackAuth', '$injector', function(Resource, LoopBackAuth, $injector) { + var R = Resource( + urlBase + "/userIdentities/:id", + { 'id': '@id' }, + { + + // INTERNAL. Use UserIdentity.user() instead. + "prototype$__get__user": { + url: urlBase + "/userIdentities/:id/user", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.UserIdentity#create + * @methodOf lbServices.UserIdentity + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `UserIdentity` object.) + * + */ + "create": { + url: urlBase + "/userIdentities", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.UserIdentity#createMany + * @methodOf lbServices.UserIdentity + * + * @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(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `UserIdentity` object.) + * + */ + "createMany": { + isArray: true, + url: urlBase + "/userIdentities", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.UserIdentity#upsert + * @methodOf lbServices.UserIdentity + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `UserIdentity` object.) + * + */ + "upsert": { + url: urlBase + "/userIdentities", + method: "PUT" + }, + + /** + * @ngdoc method + * @name lbServices.UserIdentity#exists + * @methodOf lbServices.UserIdentity + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `exists` – `{boolean=}` - + */ + "exists": { + url: urlBase + "/userIdentities/:id/exists", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.UserIdentity#findById + * @methodOf lbServices.UserIdentity + * + * @description + * + * Find a model instance by id from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - Model id + * + * - `filter` – `{object=}` - Filter defining fields and include + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `UserIdentity` object.) + * + */ + "findById": { + url: urlBase + "/userIdentities/:id", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.UserIdentity#find + * @methodOf lbServices.UserIdentity + * + * @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, include, order, offset, and limit + * + * @param {function(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `UserIdentity` object.) + * + */ + "find": { + isArray: true, + url: urlBase + "/userIdentities", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.UserIdentity#findOne + * @methodOf lbServices.UserIdentity + * + * @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, include, order, 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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `UserIdentity` object.) + * + */ + "findOne": { + url: urlBase + "/userIdentities/findOne", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.UserIdentity#updateAll + * @methodOf lbServices.UserIdentity + * + * @description + * + * Update instances of the model matched by where from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `where` – `{object=}` - Criteria to match model instances + * + * @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`. + * + * @returns {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. + */ + "updateAll": { + url: urlBase + "/userIdentities/update", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.UserIdentity#deleteById + * @methodOf lbServices.UserIdentity + * + * @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`. + * + * @returns {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: urlBase + "/userIdentities/:id", + method: "DELETE" + }, + + /** + * @ngdoc method + * @name lbServices.UserIdentity#count + * @methodOf lbServices.UserIdentity + * + * @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`. + * + * @returns {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: urlBase + "/userIdentities/count", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.UserIdentity#prototype$updateAttributes + * @methodOf lbServices.UserIdentity + * + * @description + * + * Update attributes for a model instance and persist it into the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - UserIdentity id + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `UserIdentity` object.) + * + */ + "prototype$updateAttributes": { + url: urlBase + "/userIdentities/:id", + method: "PUT" + }, + + /** + * @ngdoc method + * @name lbServices.UserIdentity#createChangeStream + * @methodOf lbServices.UserIdentity + * + * @description + * + * Create a change stream. + * + * @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. + * + * - `options` – `{object=}` - + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `changes` – `{ReadableStream=}` - + */ + "createChangeStream": { + url: urlBase + "/userIdentities/change-stream", + method: "POST" + }, + + // INTERNAL. Use User.identities.findById() instead. + "::findById::user::identities": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/users/:id/identities/:fk", + method: "GET" + }, + + // INTERNAL. Use User.identities.destroyById() instead. + "::destroyById::user::identities": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/users/:id/identities/:fk", + method: "DELETE" + }, + + // INTERNAL. Use User.identities.updateById() instead. + "::updateById::user::identities": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/users/:id/identities/:fk", + method: "PUT" + }, + + // INTERNAL. Use User.identities() instead. + "::get::user::identities": { + isArray: true, + url: urlBase + "/users/:id/identities", + method: "GET" + }, + + // INTERNAL. Use User.identities.create() instead. + "::create::user::identities": { + url: urlBase + "/users/:id/identities", + method: "POST" + }, + + // INTERNAL. Use User.identities.createMany() instead. + "::createMany::user::identities": { + isArray: true, + url: urlBase + "/users/:id/identities", + method: "POST" + }, + + // INTERNAL. Use User.identities.destroyAll() instead. + "::delete::user::identities": { + url: urlBase + "/users/:id/identities", + method: "DELETE" + }, + + // INTERNAL. Use User.identities.count() instead. + "::count::user::identities": { + url: urlBase + "/users/:id/identities/count", + method: "GET" + }, + } + ); + + + + /** + * @ngdoc method + * @name lbServices.UserIdentity#updateOrCreate + * @methodOf lbServices.UserIdentity + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `UserIdentity` object.) + * + */ + R["updateOrCreate"] = R["upsert"]; + + /** + * @ngdoc method + * @name lbServices.UserIdentity#update + * @methodOf lbServices.UserIdentity + * + * @description + * + * Update instances of the model matched by where from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `where` – `{object=}` - Criteria to match model instances + * + * @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`. + * + * @returns {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. + */ + R["update"] = R["updateAll"]; + + /** + * @ngdoc method + * @name lbServices.UserIdentity#destroyById + * @methodOf lbServices.UserIdentity + * + * @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`. + * + * @returns {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. + */ + R["destroyById"] = R["deleteById"]; + + /** + * @ngdoc method + * @name lbServices.UserIdentity#removeById + * @methodOf lbServices.UserIdentity + * + * @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`. + * + * @returns {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. + */ + R["removeById"] = R["deleteById"]; + + + /** + * @ngdoc property + * @name lbServices.UserIdentity#modelName + * @propertyOf lbServices.UserIdentity + * @description + * The name of the model represented by this $resource, + * i.e. `UserIdentity`. + */ + R.modelName = "UserIdentity"; + + + /** + * @ngdoc method + * @name lbServices.UserIdentity#user + * @methodOf lbServices.UserIdentity + * + * @description + * + * Fetches belongsTo relation user. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - UserIdentity id + * + * - `refresh` – `{boolean=}` - + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `User` object.) + * + */ + R.user = function() { + var TargetResource = $injector.get("User"); + var action = TargetResource["::get::userIdentity::user"]; + return action.apply(R, arguments); + }; + + return R; + }]); + +/** + * @ngdoc object + * @name lbServices.Page + * @header lbServices.Page + * @object + * + * @description + * + * A $resource object for interacting with the `Page` model. + * + * ## Example + * + * See + * {@link http://docs.angularjs.org/api/ngResource.$resource#example $resource} + * for an example of using this object. + * + */ +module.factory( + "Page", + ['LoopBackResource', 'LoopBackAuth', '$injector', function(Resource, LoopBackAuth, $injector) { + var R = Resource( + urlBase + "/pages/:id", + { 'id': '@id' }, + { + + /** + * @ngdoc method + * @name lbServices.Page#create + * @methodOf lbServices.Page + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Page` object.) + * + */ + "create": { + url: urlBase + "/pages", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.Page#createMany + * @methodOf lbServices.Page + * + * @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(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Page` object.) + * + */ + "createMany": { + isArray: true, + url: urlBase + "/pages", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.Page#upsert + * @methodOf lbServices.Page + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Page` object.) + * + */ + "upsert": { + url: urlBase + "/pages", + method: "PUT" + }, + + /** + * @ngdoc method + * @name lbServices.Page#exists + * @methodOf lbServices.Page + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `exists` – `{boolean=}` - + */ + "exists": { + url: urlBase + "/pages/:id/exists", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Page#findById + * @methodOf lbServices.Page + * + * @description + * + * Find a model instance by id from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - Model id + * + * - `filter` – `{object=}` - Filter defining fields and include + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Page` object.) + * + */ + "findById": { + url: urlBase + "/pages/:id", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Page#find + * @methodOf lbServices.Page + * + * @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, include, order, offset, and limit + * + * @param {function(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Page` object.) + * + */ + "find": { + isArray: true, + url: urlBase + "/pages", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Page#findOne + * @methodOf lbServices.Page + * + * @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, include, order, 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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Page` object.) + * + */ + "findOne": { + url: urlBase + "/pages/findOne", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Page#updateAll + * @methodOf lbServices.Page + * + * @description + * + * Update instances of the model matched by where from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `where` – `{object=}` - Criteria to match model instances + * + * @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`. + * + * @returns {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. + */ + "updateAll": { + url: urlBase + "/pages/update", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.Page#deleteById + * @methodOf lbServices.Page + * + * @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`. + * + * @returns {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: urlBase + "/pages/:id", + method: "DELETE" + }, + + /** + * @ngdoc method + * @name lbServices.Page#count + * @methodOf lbServices.Page + * + * @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`. + * + * @returns {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: urlBase + "/pages/count", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Page#prototype$updateAttributes + * @methodOf lbServices.Page + * + * @description + * + * Update attributes for a model instance and persist it into the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - PersistedModel id + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Page` object.) + * + */ + "prototype$updateAttributes": { + url: urlBase + "/pages/:id", + method: "PUT" + }, + + /** + * @ngdoc method + * @name lbServices.Page#createChangeStream + * @methodOf lbServices.Page + * + * @description + * + * Create a change stream. + * + * @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. + * + * - `options` – `{object=}` - + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `changes` – `{ReadableStream=}` - + */ + "createChangeStream": { + url: urlBase + "/pages/change-stream", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.Page#html + * @methodOf lbServices.Page + * + * @description + * + * + * (The remote method definition does not provide any description.) + * + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{string=}` - + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `content` – `{string=}` - + */ + "html": { + url: urlBase + "/pages/html", + method: "GET" + }, + } + ); + + + + /** + * @ngdoc method + * @name lbServices.Page#updateOrCreate + * @methodOf lbServices.Page + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Page` object.) + * + */ + R["updateOrCreate"] = R["upsert"]; + + /** + * @ngdoc method + * @name lbServices.Page#update + * @methodOf lbServices.Page + * + * @description + * + * Update instances of the model matched by where from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `where` – `{object=}` - Criteria to match model instances + * + * @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`. + * + * @returns {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. + */ + R["update"] = R["updateAll"]; + + /** + * @ngdoc method + * @name lbServices.Page#destroyById + * @methodOf lbServices.Page + * + * @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`. + * + * @returns {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. + */ + R["destroyById"] = R["deleteById"]; + + /** + * @ngdoc method + * @name lbServices.Page#removeById + * @methodOf lbServices.Page + * + * @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`. + * + * @returns {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. + */ + R["removeById"] = R["deleteById"]; + + + /** + * @ngdoc property + * @name lbServices.Page#modelName + * @propertyOf lbServices.Page + * @description + * The name of the model represented by this $resource, + * i.e. `Page`. + */ + R.modelName = "Page"; + + + return R; + }]); + +/** + * @ngdoc object + * @name lbServices.Note + * @header lbServices.Note + * @object + * + * @description + * + * A $resource object for interacting with the `Note` model. + * + * ## Example + * + * See + * {@link http://docs.angularjs.org/api/ngResource.$resource#example $resource} + * for an example of using this object. + * + */ +module.factory( + "Note", + ['LoopBackResource', 'LoopBackAuth', '$injector', function(Resource, LoopBackAuth, $injector) { + var R = Resource( + urlBase + "/notes/:id", + { 'id': '@id' }, + { + + /** + * @ngdoc method + * @name lbServices.Note#create + * @methodOf lbServices.Note + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Note` object.) + * + */ + "create": { + url: urlBase + "/notes", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.Note#createMany + * @methodOf lbServices.Note + * + * @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(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Note` object.) + * + */ + "createMany": { + isArray: true, + url: urlBase + "/notes", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.Note#upsert + * @methodOf lbServices.Note + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Note` object.) + * + */ + "upsert": { + url: urlBase + "/notes", + method: "PUT" + }, + + /** + * @ngdoc method + * @name lbServices.Note#exists + * @methodOf lbServices.Note + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `exists` – `{boolean=}` - + */ + "exists": { + url: urlBase + "/notes/:id/exists", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Note#findById + * @methodOf lbServices.Note + * + * @description + * + * Find a model instance by id from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - Model id + * + * - `filter` – `{object=}` - Filter defining fields and include + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Note` object.) + * + */ + "findById": { + url: urlBase + "/notes/:id", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Note#find + * @methodOf lbServices.Note + * + * @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, include, order, offset, and limit + * + * @param {function(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Note` object.) + * + */ + "find": { + isArray: true, + url: urlBase + "/notes", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Note#findOne + * @methodOf lbServices.Note + * + * @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, include, order, 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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Note` object.) + * + */ + "findOne": { + url: urlBase + "/notes/findOne", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Note#updateAll + * @methodOf lbServices.Note + * + * @description + * + * Update instances of the model matched by where from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `where` – `{object=}` - Criteria to match model instances + * + * @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`. + * + * @returns {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. + */ + "updateAll": { + url: urlBase + "/notes/update", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.Note#deleteById + * @methodOf lbServices.Note + * + * @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`. + * + * @returns {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: urlBase + "/notes/:id", + method: "DELETE" + }, + + /** + * @ngdoc method + * @name lbServices.Note#count + * @methodOf lbServices.Note + * + * @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`. + * + * @returns {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: urlBase + "/notes/count", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Note#prototype$updateAttributes + * @methodOf lbServices.Note + * + * @description + * + * Update attributes for a model instance and persist it into the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - PersistedModel id + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Note` object.) + * + */ + "prototype$updateAttributes": { + url: urlBase + "/notes/:id", + method: "PUT" + }, + + /** + * @ngdoc method + * @name lbServices.Note#createChangeStream + * @methodOf lbServices.Note + * + * @description + * + * Create a change stream. + * + * @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. + * + * - `options` – `{object=}` - + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `changes` – `{ReadableStream=}` - + */ + "createChangeStream": { + url: urlBase + "/notes/change-stream", + method: "POST" + }, + } + ); + + + + /** + * @ngdoc method + * @name lbServices.Note#updateOrCreate + * @methodOf lbServices.Note + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Note` object.) + * + */ + R["updateOrCreate"] = R["upsert"]; + + /** + * @ngdoc method + * @name lbServices.Note#update + * @methodOf lbServices.Note + * + * @description + * + * Update instances of the model matched by where from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `where` – `{object=}` - Criteria to match model instances + * + * @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`. + * + * @returns {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. + */ + R["update"] = R["updateAll"]; + + /** + * @ngdoc method + * @name lbServices.Note#destroyById + * @methodOf lbServices.Note + * + * @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`. + * + * @returns {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. + */ + R["destroyById"] = R["deleteById"]; + + /** + * @ngdoc method + * @name lbServices.Note#removeById + * @methodOf lbServices.Note + * + * @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`. + * + * @returns {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. + */ + R["removeById"] = R["deleteById"]; + + + /** + * @ngdoc property + * @name lbServices.Note#modelName + * @propertyOf lbServices.Note + * @description + * The name of the model represented by this $resource, + * i.e. `Note`. + */ + R.modelName = "Note"; + + + return R; + }]); + +/** + * @ngdoc object + * @name lbServices.Post + * @header lbServices.Post + * @object + * + * @description + * + * A $resource object for interacting with the `Post` model. + * + * ## Example + * + * See + * {@link http://docs.angularjs.org/api/ngResource.$resource#example $resource} + * for an example of using this object. + * + */ +module.factory( + "Post", + ['LoopBackResource', 'LoopBackAuth', '$injector', function(Resource, LoopBackAuth, $injector) { + var R = Resource( + urlBase + "/posts/:id", + { 'id': '@id' }, + { + + /** + * @ngdoc method + * @name lbServices.Post#create + * @methodOf lbServices.Post + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Post` object.) + * + */ + "create": { + url: urlBase + "/posts", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.Post#createMany + * @methodOf lbServices.Post + * + * @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(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Post` object.) + * + */ + "createMany": { + isArray: true, + url: urlBase + "/posts", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.Post#upsert + * @methodOf lbServices.Post + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Post` object.) + * + */ + "upsert": { + url: urlBase + "/posts", + method: "PUT" + }, + + /** + * @ngdoc method + * @name lbServices.Post#exists + * @methodOf lbServices.Post + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `exists` – `{boolean=}` - + */ + "exists": { + url: urlBase + "/posts/:id/exists", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Post#findById + * @methodOf lbServices.Post + * + * @description + * + * Find a model instance by id from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - Model id + * + * - `filter` – `{object=}` - Filter defining fields and include + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Post` object.) + * + */ + "findById": { + url: urlBase + "/posts/:id", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Post#find + * @methodOf lbServices.Post + * + * @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, include, order, offset, and limit + * + * @param {function(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Post` object.) + * + */ + "find": { + isArray: true, + url: urlBase + "/posts", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Post#findOne + * @methodOf lbServices.Post + * + * @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, include, order, 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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Post` object.) + * + */ + "findOne": { + url: urlBase + "/posts/findOne", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Post#updateAll + * @methodOf lbServices.Post + * + * @description + * + * Update instances of the model matched by where from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `where` – `{object=}` - Criteria to match model instances + * + * @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`. + * + * @returns {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. + */ + "updateAll": { + url: urlBase + "/posts/update", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.Post#deleteById + * @methodOf lbServices.Post + * + * @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`. + * + * @returns {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: urlBase + "/posts/:id", + method: "DELETE" + }, + + /** + * @ngdoc method + * @name lbServices.Post#count + * @methodOf lbServices.Post + * + * @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`. + * + * @returns {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: urlBase + "/posts/count", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Post#prototype$updateAttributes + * @methodOf lbServices.Post + * + * @description + * + * Update attributes for a model instance and persist it into the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - AppModel id + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Post` object.) + * + */ + "prototype$updateAttributes": { + url: urlBase + "/posts/:id", + method: "PUT" + }, + + /** + * @ngdoc method + * @name lbServices.Post#createChangeStream + * @methodOf lbServices.Post + * + * @description + * + * Create a change stream. + * + * @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. + * + * - `options` – `{object=}` - + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `changes` – `{ReadableStream=}` - + */ + "createChangeStream": { + url: urlBase + "/posts/change-stream", + method: "POST" + }, + } + ); + + + + /** + * @ngdoc method + * @name lbServices.Post#updateOrCreate + * @methodOf lbServices.Post + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Post` object.) + * + */ + R["updateOrCreate"] = R["upsert"]; + + /** + * @ngdoc method + * @name lbServices.Post#update + * @methodOf lbServices.Post + * + * @description + * + * Update instances of the model matched by where from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `where` – `{object=}` - Criteria to match model instances + * + * @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`. + * + * @returns {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. + */ + R["update"] = R["updateAll"]; + + /** + * @ngdoc method + * @name lbServices.Post#destroyById + * @methodOf lbServices.Post + * + * @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`. + * + * @returns {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. + */ + R["destroyById"] = R["deleteById"]; + + /** + * @ngdoc method + * @name lbServices.Post#removeById + * @methodOf lbServices.Post + * + * @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`. + * + * @returns {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. + */ + R["removeById"] = R["deleteById"]; + + + /** + * @ngdoc property + * @name lbServices.Post#modelName + * @propertyOf lbServices.Post + * @description + * The name of the model represented by this $resource, + * i.e. `Post`. + */ + R.modelName = "Post"; + + + return R; + }]); + +/** + * @ngdoc object + * @name lbServices.Setting + * @header lbServices.Setting + * @object + * + * @description + * + * A $resource object for interacting with the `Setting` model. + * + * ## Example + * + * See + * {@link http://docs.angularjs.org/api/ngResource.$resource#example $resource} + * for an example of using this object. + * + */ +module.factory( + "Setting", + ['LoopBackResource', 'LoopBackAuth', '$injector', function(Resource, LoopBackAuth, $injector) { + var R = Resource( + urlBase + "/settings/:id", + { 'id': '@id' }, + { + + /** + * @ngdoc method + * @name lbServices.Setting#create + * @methodOf lbServices.Setting + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Setting` object.) + * + */ + "create": { + url: urlBase + "/settings", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.Setting#createMany + * @methodOf lbServices.Setting + * + * @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(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Setting` object.) + * + */ + "createMany": { + isArray: true, + url: urlBase + "/settings", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.Setting#upsert + * @methodOf lbServices.Setting + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Setting` object.) + * + */ + "upsert": { + url: urlBase + "/settings", + method: "PUT" + }, + + /** + * @ngdoc method + * @name lbServices.Setting#exists + * @methodOf lbServices.Setting + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `exists` – `{boolean=}` - + */ + "exists": { + url: urlBase + "/settings/:id/exists", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Setting#findById + * @methodOf lbServices.Setting + * + * @description + * + * Find a model instance by id from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - Model id + * + * - `filter` – `{object=}` - Filter defining fields and include + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Setting` object.) + * + */ + "findById": { + url: urlBase + "/settings/:id", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Setting#find + * @methodOf lbServices.Setting + * + * @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, include, order, offset, and limit + * + * @param {function(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Setting` object.) + * + */ + "find": { + isArray: true, + url: urlBase + "/settings", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Setting#findOne + * @methodOf lbServices.Setting + * + * @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, include, order, 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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Setting` object.) + * + */ + "findOne": { + url: urlBase + "/settings/findOne", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Setting#updateAll + * @methodOf lbServices.Setting + * + * @description + * + * Update instances of the model matched by where from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `where` – `{object=}` - Criteria to match model instances + * + * @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`. + * + * @returns {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. + */ + "updateAll": { + url: urlBase + "/settings/update", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.Setting#deleteById + * @methodOf lbServices.Setting + * + * @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`. + * + * @returns {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: urlBase + "/settings/:id", + method: "DELETE" + }, + + /** + * @ngdoc method + * @name lbServices.Setting#count + * @methodOf lbServices.Setting + * + * @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`. + * + * @returns {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: urlBase + "/settings/count", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Setting#prototype$updateAttributes + * @methodOf lbServices.Setting + * + * @description + * + * Update attributes for a model instance and persist it into the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - PersistedModel id + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Setting` object.) + * + */ + "prototype$updateAttributes": { + url: urlBase + "/settings/:id", + method: "PUT" + }, + + /** + * @ngdoc method + * @name lbServices.Setting#createChangeStream + * @methodOf lbServices.Setting + * + * @description + * + * Create a change stream. + * + * @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. + * + * - `options` – `{object=}` - + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `changes` – `{ReadableStream=}` - + */ + "createChangeStream": { + url: urlBase + "/settings/change-stream", + method: "POST" + }, + } + ); + + + + /** + * @ngdoc method + * @name lbServices.Setting#updateOrCreate + * @methodOf lbServices.Setting + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Setting` object.) + * + */ + R["updateOrCreate"] = R["upsert"]; + + /** + * @ngdoc method + * @name lbServices.Setting#update + * @methodOf lbServices.Setting + * + * @description + * + * Update instances of the model matched by where from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `where` – `{object=}` - Criteria to match model instances + * + * @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`. + * + * @returns {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. + */ + R["update"] = R["updateAll"]; + + /** + * @ngdoc method + * @name lbServices.Setting#destroyById + * @methodOf lbServices.Setting + * + * @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`. + * + * @returns {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. + */ + R["destroyById"] = R["deleteById"]; + + /** + * @ngdoc method + * @name lbServices.Setting#removeById + * @methodOf lbServices.Setting + * + * @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`. + * + * @returns {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. + */ + R["removeById"] = R["deleteById"]; + + + /** + * @ngdoc property + * @name lbServices.Setting#modelName + * @propertyOf lbServices.Setting + * @description + * The name of the model represented by this $resource, + * i.e. `Setting`. + */ + R.modelName = "Setting"; + + + return R; + }]); + +/** + * @ngdoc object + * @name lbServices.Product + * @header lbServices.Product + * @object + * + * @description + * + * A $resource object for interacting with the `Product` model. + * + * ## Example + * + * See + * {@link http://docs.angularjs.org/api/ngResource.$resource#example $resource} + * for an example of using this object. + * + */ +module.factory( + "Product", + ['LoopBackResource', 'LoopBackAuth', '$injector', function(Resource, LoopBackAuth, $injector) { + var R = Resource( + urlBase + "/products/:id", + { 'id': '@id' }, + { + + // INTERNAL. Use Product.category() instead. + "prototype$__get__category": { + url: urlBase + "/products/:id/category", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Product#create + * @methodOf lbServices.Product + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Product` object.) + * + */ + "create": { + url: urlBase + "/products", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.Product#createMany + * @methodOf lbServices.Product + * + * @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(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Product` object.) + * + */ + "createMany": { + isArray: true, + url: urlBase + "/products", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.Product#upsert + * @methodOf lbServices.Product + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Product` object.) + * + */ + "upsert": { + url: urlBase + "/products", + method: "PUT" + }, + + /** + * @ngdoc method + * @name lbServices.Product#exists + * @methodOf lbServices.Product + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `exists` – `{boolean=}` - + */ + "exists": { + url: urlBase + "/products/:id/exists", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Product#findById + * @methodOf lbServices.Product + * + * @description + * + * Find a model instance by id from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - Model id + * + * - `filter` – `{object=}` - Filter defining fields and include + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Product` object.) + * + */ + "findById": { + url: urlBase + "/products/:id", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Product#find + * @methodOf lbServices.Product + * + * @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, include, order, offset, and limit + * + * @param {function(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Product` object.) + * + */ + "find": { + isArray: true, + url: urlBase + "/products", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Product#findOne + * @methodOf lbServices.Product + * + * @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, include, order, 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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Product` object.) + * + */ + "findOne": { + url: urlBase + "/products/findOne", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Product#updateAll + * @methodOf lbServices.Product + * + * @description + * + * Update instances of the model matched by where from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `where` – `{object=}` - Criteria to match model instances + * + * @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`. + * + * @returns {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. + */ + "updateAll": { + url: urlBase + "/products/update", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.Product#deleteById + * @methodOf lbServices.Product + * + * @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`. + * + * @returns {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: urlBase + "/products/:id", + method: "DELETE" + }, + + /** + * @ngdoc method + * @name lbServices.Product#count + * @methodOf lbServices.Product + * + * @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`. + * + * @returns {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: urlBase + "/products/count", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Product#prototype$updateAttributes + * @methodOf lbServices.Product + * + * @description + * + * Update attributes for a model instance and persist it into the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - PersistedModel id + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Product` object.) + * + */ + "prototype$updateAttributes": { + url: urlBase + "/products/:id", + method: "PUT" + }, + + /** + * @ngdoc method + * @name lbServices.Product#createChangeStream + * @methodOf lbServices.Product + * + * @description + * + * Create a change stream. + * + * @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. + * + * - `options` – `{object=}` - + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `changes` – `{ReadableStream=}` - + */ + "createChangeStream": { + url: urlBase + "/products/change-stream", + method: "POST" + }, + + // INTERNAL. Use Category.products.findById() instead. + "::findById::Category::products": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/categories/:id/products/:fk", + method: "GET" + }, + + // INTERNAL. Use Category.products.destroyById() instead. + "::destroyById::Category::products": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/categories/:id/products/:fk", + method: "DELETE" + }, + + // INTERNAL. Use Category.products.updateById() instead. + "::updateById::Category::products": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/categories/:id/products/:fk", + method: "PUT" + }, + + // INTERNAL. Use Category.products() instead. + "::get::Category::products": { + isArray: true, + url: urlBase + "/categories/:id/products", + method: "GET" + }, + + // INTERNAL. Use Category.products.create() instead. + "::create::Category::products": { + url: urlBase + "/categories/:id/products", + method: "POST" + }, + + // INTERNAL. Use Category.products.createMany() instead. + "::createMany::Category::products": { + isArray: true, + url: urlBase + "/categories/:id/products", + method: "POST" + }, + + // INTERNAL. Use Category.products.destroyAll() instead. + "::delete::Category::products": { + url: urlBase + "/categories/:id/products", + method: "DELETE" + }, + + // INTERNAL. Use Category.products.count() instead. + "::count::Category::products": { + url: urlBase + "/categories/:id/products/count", + method: "GET" + }, + } + ); + + + + /** + * @ngdoc method + * @name lbServices.Product#updateOrCreate + * @methodOf lbServices.Product + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Product` object.) + * + */ + R["updateOrCreate"] = R["upsert"]; + + /** + * @ngdoc method + * @name lbServices.Product#update + * @methodOf lbServices.Product + * + * @description + * + * Update instances of the model matched by where from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `where` – `{object=}` - Criteria to match model instances + * + * @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`. + * + * @returns {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. + */ + R["update"] = R["updateAll"]; + + /** + * @ngdoc method + * @name lbServices.Product#destroyById + * @methodOf lbServices.Product + * + * @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`. + * + * @returns {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. + */ + R["destroyById"] = R["deleteById"]; + + /** + * @ngdoc method + * @name lbServices.Product#removeById + * @methodOf lbServices.Product + * + * @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`. + * + * @returns {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. + */ + R["removeById"] = R["deleteById"]; + + + /** + * @ngdoc property + * @name lbServices.Product#modelName + * @propertyOf lbServices.Product + * @description + * The name of the model represented by this $resource, + * i.e. `Product`. + */ + R.modelName = "Product"; + + + /** + * @ngdoc method + * @name lbServices.Product#category + * @methodOf lbServices.Product + * + * @description + * + * Fetches belongsTo relation category. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - PersistedModel id + * + * - `refresh` – `{boolean=}` - + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Category` object.) + * + */ + R.category = function() { + var TargetResource = $injector.get("Category"); + var action = TargetResource["::get::Product::category"]; + return action.apply(R, arguments); + }; + + return R; + }]); + +/** + * @ngdoc object + * @name lbServices.Category + * @header lbServices.Category + * @object + * + * @description + * + * A $resource object for interacting with the `Category` model. + * + * ## Example + * + * See + * {@link http://docs.angularjs.org/api/ngResource.$resource#example $resource} + * for an example of using this object. + * + */ +module.factory( + "Category", + ['LoopBackResource', 'LoopBackAuth', '$injector', function(Resource, LoopBackAuth, $injector) { + var R = Resource( + urlBase + "/categories/:id", + { 'id': '@id' }, + { + + // INTERNAL. Use Category.products.findById() instead. + "prototype$__findById__products": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/categories/:id/products/:fk", + method: "GET" + }, + + // INTERNAL. Use Category.products.destroyById() instead. + "prototype$__destroyById__products": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/categories/:id/products/:fk", + method: "DELETE" + }, + + // INTERNAL. Use Category.products.updateById() instead. + "prototype$__updateById__products": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/categories/:id/products/:fk", + method: "PUT" + }, + + // INTERNAL. Use Category.products() instead. + "prototype$__get__products": { + isArray: true, + url: urlBase + "/categories/:id/products", + method: "GET" + }, + + // INTERNAL. Use Category.products.create() instead. + "prototype$__create__products": { + url: urlBase + "/categories/:id/products", + method: "POST" + }, + + // INTERNAL. Use Category.products.destroyAll() instead. + "prototype$__delete__products": { + url: urlBase + "/categories/:id/products", + method: "DELETE" + }, + + // INTERNAL. Use Category.products.count() instead. + "prototype$__count__products": { + url: urlBase + "/categories/:id/products/count", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Category#create + * @methodOf lbServices.Category + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Category` object.) + * + */ + "create": { + url: urlBase + "/categories", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.Category#createMany + * @methodOf lbServices.Category + * + * @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(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Category` object.) + * + */ + "createMany": { + isArray: true, + url: urlBase + "/categories", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.Category#upsert + * @methodOf lbServices.Category + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Category` object.) + * + */ + "upsert": { + url: urlBase + "/categories", + method: "PUT" + }, + + /** + * @ngdoc method + * @name lbServices.Category#exists + * @methodOf lbServices.Category + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `exists` – `{boolean=}` - + */ + "exists": { + url: urlBase + "/categories/:id/exists", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Category#findById + * @methodOf lbServices.Category + * + * @description + * + * Find a model instance by id from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - Model id + * + * - `filter` – `{object=}` - Filter defining fields and include + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Category` object.) + * + */ + "findById": { + url: urlBase + "/categories/:id", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Category#find + * @methodOf lbServices.Category + * + * @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, include, order, offset, and limit + * + * @param {function(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Category` object.) + * + */ + "find": { + isArray: true, + url: urlBase + "/categories", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Category#findOne + * @methodOf lbServices.Category + * + * @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, include, order, 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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Category` object.) + * + */ + "findOne": { + url: urlBase + "/categories/findOne", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Category#updateAll + * @methodOf lbServices.Category + * + * @description + * + * Update instances of the model matched by where from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `where` – `{object=}` - Criteria to match model instances + * + * @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`. + * + * @returns {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. + */ + "updateAll": { + url: urlBase + "/categories/update", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.Category#deleteById + * @methodOf lbServices.Category + * + * @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`. + * + * @returns {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: urlBase + "/categories/:id", + method: "DELETE" + }, + + /** + * @ngdoc method + * @name lbServices.Category#count + * @methodOf lbServices.Category + * + * @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`. + * + * @returns {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: urlBase + "/categories/count", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Category#prototype$updateAttributes + * @methodOf lbServices.Category + * + * @description + * + * Update attributes for a model instance and persist it into the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - PersistedModel id + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Category` object.) + * + */ + "prototype$updateAttributes": { + url: urlBase + "/categories/:id", + method: "PUT" + }, + + /** + * @ngdoc method + * @name lbServices.Category#createChangeStream + * @methodOf lbServices.Category + * + * @description + * + * Create a change stream. + * + * @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. + * + * - `options` – `{object=}` - + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `changes` – `{ReadableStream=}` - + */ + "createChangeStream": { + url: urlBase + "/categories/change-stream", + method: "POST" + }, + + // INTERNAL. Use Product.category() instead. + "::get::Product::category": { + url: urlBase + "/products/:id/category", + method: "GET" + }, + } + ); + + + + /** + * @ngdoc method + * @name lbServices.Category#updateOrCreate + * @methodOf lbServices.Category + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Category` object.) + * + */ + R["updateOrCreate"] = R["upsert"]; + + /** + * @ngdoc method + * @name lbServices.Category#update + * @methodOf lbServices.Category + * + * @description + * + * Update instances of the model matched by where from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `where` – `{object=}` - Criteria to match model instances + * + * @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`. + * + * @returns {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. + */ + R["update"] = R["updateAll"]; + + /** + * @ngdoc method + * @name lbServices.Category#destroyById + * @methodOf lbServices.Category + * + * @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`. + * + * @returns {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. + */ + R["destroyById"] = R["deleteById"]; + + /** + * @ngdoc method + * @name lbServices.Category#removeById + * @methodOf lbServices.Category + * + * @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`. + * + * @returns {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. + */ + R["removeById"] = R["deleteById"]; + + + /** + * @ngdoc property + * @name lbServices.Category#modelName + * @propertyOf lbServices.Category + * @description + * The name of the model represented by this $resource, + * i.e. `Category`. + */ + R.modelName = "Category"; + + /** + * @ngdoc object + * @name lbServices.Category.products + * @header lbServices.Category.products + * @object + * @description + * + * The object `Category.products` groups methods + * manipulating `Product` instances related to `Category`. + * + * Call {@link lbServices.Category#products Category.products()} + * to query all related instances. + */ + + + /** + * @ngdoc method + * @name lbServices.Category#products + * @methodOf lbServices.Category + * + * @description + * + * Queries products of Category. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - PersistedModel id + * + * - `filter` – `{object=}` - + * + * @param {function(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Product` object.) + * + */ + R.products = function() { + var TargetResource = $injector.get("Product"); + var action = TargetResource["::get::Category::products"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.Category.products#count + * @methodOf lbServices.Category.products + * + * @description + * + * Counts products of Category. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - PersistedModel id + * + * - `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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `count` – `{number=}` - + */ + R.products.count = function() { + var TargetResource = $injector.get("Product"); + var action = TargetResource["::count::Category::products"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.Category.products#create + * @methodOf lbServices.Category.products + * + * @description + * + * Creates a new instance in products of this model. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - PersistedModel id + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Product` object.) + * + */ + R.products.create = function() { + var TargetResource = $injector.get("Product"); + var action = TargetResource["::create::Category::products"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.Category.products#createMany + * @methodOf lbServices.Category.products + * + * @description + * + * Creates a new instance in products of this model. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - PersistedModel id + * + * @param {Object} postData Request data. + * + * This method expects a subset of model properties as request parameters. + * + * @param {function(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Product` object.) + * + */ + R.products.createMany = function() { + var TargetResource = $injector.get("Product"); + var action = TargetResource["::createMany::Category::products"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.Category.products#destroyAll + * @methodOf lbServices.Category.products + * + * @description + * + * Deletes all products of this model. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - PersistedModel id + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {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. + */ + R.products.destroyAll = function() { + var TargetResource = $injector.get("Product"); + var action = TargetResource["::delete::Category::products"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.Category.products#destroyById + * @methodOf lbServices.Category.products + * + * @description + * + * Delete a related item by id for products. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - PersistedModel id + * + * - `fk` – `{*}` - Foreign key for products + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {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. + */ + R.products.destroyById = function() { + var TargetResource = $injector.get("Product"); + var action = TargetResource["::destroyById::Category::products"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.Category.products#findById + * @methodOf lbServices.Category.products + * + * @description + * + * Find a related item by id for products. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - PersistedModel id + * + * - `fk` – `{*}` - Foreign key for products + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Product` object.) + * + */ + R.products.findById = function() { + var TargetResource = $injector.get("Product"); + var action = TargetResource["::findById::Category::products"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.Category.products#updateById + * @methodOf lbServices.Category.products + * + * @description + * + * Update a related item by id for products. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - PersistedModel id + * + * - `fk` – `{*}` - Foreign key for products + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Product` object.) + * + */ + R.products.updateById = function() { + var TargetResource = $injector.get("Product"); + var action = TargetResource["::updateById::Category::products"]; + return action.apply(R, arguments); + }; + + return R; + }]); + +/** + * @ngdoc object + * @name lbServices.Event + * @header lbServices.Event + * @object + * + * @description + * + * A $resource object for interacting with the `Event` model. + * + * ## Example + * + * See + * {@link http://docs.angularjs.org/api/ngResource.$resource#example $resource} + * for an example of using this object. + * + */ +module.factory( + "Event", + ['LoopBackResource', 'LoopBackAuth', '$injector', function(Resource, LoopBackAuth, $injector) { + var R = Resource( + urlBase + "/events/:id", + { 'id': '@id' }, + { + + /** + * @ngdoc method + * @name lbServices.Event#create + * @methodOf lbServices.Event + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Event` object.) + * + */ + "create": { + url: urlBase + "/events", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.Event#createMany + * @methodOf lbServices.Event + * + * @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(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Event` object.) + * + */ + "createMany": { + isArray: true, + url: urlBase + "/events", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.Event#upsert + * @methodOf lbServices.Event + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Event` object.) + * + */ + "upsert": { + url: urlBase + "/events", + method: "PUT" + }, + + /** + * @ngdoc method + * @name lbServices.Event#exists + * @methodOf lbServices.Event + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `exists` – `{boolean=}` - + */ + "exists": { + url: urlBase + "/events/:id/exists", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Event#findById + * @methodOf lbServices.Event + * + * @description + * + * Find a model instance by id from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - Model id + * + * - `filter` – `{object=}` - Filter defining fields and include + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Event` object.) + * + */ + "findById": { + url: urlBase + "/events/:id", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Event#find + * @methodOf lbServices.Event + * + * @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, include, order, offset, and limit + * + * @param {function(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Event` object.) + * + */ + "find": { + isArray: true, + url: urlBase + "/events", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Event#findOne + * @methodOf lbServices.Event + * + * @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, include, order, 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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Event` object.) + * + */ + "findOne": { + url: urlBase + "/events/findOne", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Event#updateAll + * @methodOf lbServices.Event + * + * @description + * + * Update instances of the model matched by where from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `where` – `{object=}` - Criteria to match model instances + * + * @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`. + * + * @returns {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. + */ + "updateAll": { + url: urlBase + "/events/update", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.Event#deleteById + * @methodOf lbServices.Event + * + * @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`. + * + * @returns {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: urlBase + "/events/:id", + method: "DELETE" + }, + + /** + * @ngdoc method + * @name lbServices.Event#count + * @methodOf lbServices.Event + * + * @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`. + * + * @returns {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: urlBase + "/events/count", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Event#prototype$updateAttributes + * @methodOf lbServices.Event + * + * @description + * + * Update attributes for a model instance and persist it into the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - PersistedModel id + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Event` object.) + * + */ + "prototype$updateAttributes": { + url: urlBase + "/events/:id", + method: "PUT" + }, + + /** + * @ngdoc method + * @name lbServices.Event#createChangeStream + * @methodOf lbServices.Event + * + * @description + * + * Create a change stream. + * + * @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. + * + * - `options` – `{object=}` - + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `changes` – `{ReadableStream=}` - + */ + "createChangeStream": { + url: urlBase + "/events/change-stream", + method: "POST" + }, + } + ); + + + + /** + * @ngdoc method + * @name lbServices.Event#updateOrCreate + * @methodOf lbServices.Event + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Event` object.) + * + */ + R["updateOrCreate"] = R["upsert"]; + + /** + * @ngdoc method + * @name lbServices.Event#update + * @methodOf lbServices.Event + * + * @description + * + * Update instances of the model matched by where from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `where` – `{object=}` - Criteria to match model instances + * + * @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`. + * + * @returns {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. + */ + R["update"] = R["updateAll"]; + + /** + * @ngdoc method + * @name lbServices.Event#destroyById + * @methodOf lbServices.Event + * + * @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`. + * + * @returns {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. + */ + R["destroyById"] = R["deleteById"]; + + /** + * @ngdoc method + * @name lbServices.Event#removeById + * @methodOf lbServices.Event + * + * @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`. + * + * @returns {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. + */ + R["removeById"] = R["deleteById"]; + + + /** + * @ngdoc property + * @name lbServices.Event#modelName + * @propertyOf lbServices.Event + * @description + * The name of the model represented by this $resource, + * i.e. `Event`. + */ + R.modelName = "Event"; + + + return R; + }]); + +/** + * @ngdoc object + * @name lbServices.AuthProvider + * @header lbServices.AuthProvider + * @object + * + * @description + * + * A $resource object for interacting with the `AuthProvider` model. + * + * ## Example + * + * See + * {@link http://docs.angularjs.org/api/ngResource.$resource#example $resource} + * for an example of using this object. + * + */ +module.factory( + "AuthProvider", + ['LoopBackResource', 'LoopBackAuth', '$injector', function(Resource, LoopBackAuth, $injector) { + var R = Resource( + urlBase + "/AuthProviders/:id", + { 'id': '@id' }, + { + + /** + * @ngdoc method + * @name lbServices.AuthProvider#create + * @methodOf lbServices.AuthProvider + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `AuthProvider` object.) + * + */ + "create": { + url: urlBase + "/AuthProviders", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.AuthProvider#createMany + * @methodOf lbServices.AuthProvider + * + * @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(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `AuthProvider` object.) + * + */ + "createMany": { + isArray: true, + url: urlBase + "/AuthProviders", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.AuthProvider#upsert + * @methodOf lbServices.AuthProvider + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `AuthProvider` object.) + * + */ + "upsert": { + url: urlBase + "/AuthProviders", + method: "PUT" + }, + + /** + * @ngdoc method + * @name lbServices.AuthProvider#exists + * @methodOf lbServices.AuthProvider + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `exists` – `{boolean=}` - + */ + "exists": { + url: urlBase + "/AuthProviders/:id/exists", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.AuthProvider#findById + * @methodOf lbServices.AuthProvider + * + * @description + * + * Find a model instance by id from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - Model id + * + * - `filter` – `{object=}` - Filter defining fields and include + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `AuthProvider` object.) + * + */ + "findById": { + url: urlBase + "/AuthProviders/:id", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.AuthProvider#find + * @methodOf lbServices.AuthProvider + * + * @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, include, order, offset, and limit + * + * @param {function(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `AuthProvider` object.) + * + */ + "find": { + isArray: true, + url: urlBase + "/AuthProviders", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.AuthProvider#findOne + * @methodOf lbServices.AuthProvider + * + * @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, include, order, 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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `AuthProvider` object.) + * + */ + "findOne": { + url: urlBase + "/AuthProviders/findOne", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.AuthProvider#updateAll + * @methodOf lbServices.AuthProvider + * + * @description + * + * Update instances of the model matched by where from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `where` – `{object=}` - Criteria to match model instances + * + * @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`. + * + * @returns {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. + */ + "updateAll": { + url: urlBase + "/AuthProviders/update", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.AuthProvider#deleteById + * @methodOf lbServices.AuthProvider + * + * @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`. + * + * @returns {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: urlBase + "/AuthProviders/:id", + method: "DELETE" + }, + + /** + * @ngdoc method + * @name lbServices.AuthProvider#count + * @methodOf lbServices.AuthProvider + * + * @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`. + * + * @returns {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: urlBase + "/AuthProviders/count", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.AuthProvider#prototype$updateAttributes + * @methodOf lbServices.AuthProvider + * + * @description + * + * Update attributes for a model instance and persist it into the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - PersistedModel id + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `AuthProvider` object.) + * + */ + "prototype$updateAttributes": { + url: urlBase + "/AuthProviders/:id", + method: "PUT" + }, + + /** + * @ngdoc method + * @name lbServices.AuthProvider#createChangeStream + * @methodOf lbServices.AuthProvider + * + * @description + * + * Create a change stream. + * + * @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. + * + * - `options` – `{object=}` - + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `changes` – `{ReadableStream=}` - + */ + "createChangeStream": { + url: urlBase + "/AuthProviders/change-stream", + method: "POST" + }, + } + ); + + + + /** + * @ngdoc method + * @name lbServices.AuthProvider#updateOrCreate + * @methodOf lbServices.AuthProvider + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `AuthProvider` object.) + * + */ + R["updateOrCreate"] = R["upsert"]; + + /** + * @ngdoc method + * @name lbServices.AuthProvider#update + * @methodOf lbServices.AuthProvider + * + * @description + * + * Update instances of the model matched by where from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `where` – `{object=}` - Criteria to match model instances + * + * @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`. + * + * @returns {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. + */ + R["update"] = R["updateAll"]; + + /** + * @ngdoc method + * @name lbServices.AuthProvider#destroyById + * @methodOf lbServices.AuthProvider + * + * @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`. + * + * @returns {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. + */ + R["destroyById"] = R["deleteById"]; + + /** + * @ngdoc method + * @name lbServices.AuthProvider#removeById + * @methodOf lbServices.AuthProvider + * + * @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`. + * + * @returns {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. + */ + R["removeById"] = R["deleteById"]; + + + /** + * @ngdoc property + * @name lbServices.AuthProvider#modelName + * @propertyOf lbServices.AuthProvider + * @description + * The name of the model represented by this $resource, + * i.e. `AuthProvider`. + */ + R.modelName = "AuthProvider"; + + + return R; + }]); + +/** + * @ngdoc object + * @name lbServices.User + * @header 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', '$injector', function(Resource, LoopBackAuth, $injector) { + var R = Resource( + urlBase + "/users/:id", + { 'id': '@id' }, + { + + // INTERNAL. Use User.accessTokens.findById() instead. + "prototype$__findById__accessTokens": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/users/:id/accessTokens/:fk", + method: "GET" + }, + + // INTERNAL. Use User.accessTokens.destroyById() instead. + "prototype$__destroyById__accessTokens": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/users/:id/accessTokens/:fk", + method: "DELETE" + }, + + // INTERNAL. Use User.accessTokens.updateById() instead. + "prototype$__updateById__accessTokens": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/users/:id/accessTokens/:fk", + method: "PUT" + }, + + // INTERNAL. Use User.identities.findById() instead. + "prototype$__findById__identities": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/users/:id/identities/:fk", + method: "GET" + }, + + // INTERNAL. Use User.identities.destroyById() instead. + "prototype$__destroyById__identities": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/users/:id/identities/:fk", + method: "DELETE" + }, + + // INTERNAL. Use User.identities.updateById() instead. + "prototype$__updateById__identities": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/users/:id/identities/:fk", + method: "PUT" + }, + + // INTERNAL. Use User.credentials.findById() instead. + "prototype$__findById__credentials": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/users/:id/credentials/:fk", + method: "GET" + }, + + // INTERNAL. Use User.credentials.destroyById() instead. + "prototype$__destroyById__credentials": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/users/:id/credentials/:fk", + method: "DELETE" + }, + + // INTERNAL. Use User.credentials.updateById() instead. + "prototype$__updateById__credentials": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/users/:id/credentials/:fk", + method: "PUT" + }, + + // INTERNAL. Use User.roles.findById() instead. + "prototype$__findById__roles": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/users/:id/roles/:fk", + method: "GET" + }, + + // INTERNAL. Use User.roles.destroyById() instead. + "prototype$__destroyById__roles": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/users/:id/roles/:fk", + method: "DELETE" + }, + + // INTERNAL. Use User.roles.updateById() instead. + "prototype$__updateById__roles": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/users/:id/roles/:fk", + method: "PUT" + }, + + // INTERNAL. Use User.roles.link() instead. + "prototype$__link__roles": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/users/:id/roles/rel/:fk", + method: "PUT" + }, + + // INTERNAL. Use User.roles.unlink() instead. + "prototype$__unlink__roles": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/users/:id/roles/rel/:fk", + method: "DELETE" + }, + + // INTERNAL. Use User.roles.exists() instead. + "prototype$__exists__roles": { + params: { + 'fk': '@fk' + }, + url: urlBase + "/users/:id/roles/rel/:fk", + method: "HEAD" + }, + + // INTERNAL. Use User.accessTokens() instead. + "prototype$__get__accessTokens": { + isArray: true, + url: urlBase + "/users/:id/accessTokens", + method: "GET" + }, + + // INTERNAL. Use User.accessTokens.create() instead. + "prototype$__create__accessTokens": { + url: urlBase + "/users/:id/accessTokens", + method: "POST" + }, + + // INTERNAL. Use User.accessTokens.destroyAll() instead. + "prototype$__delete__accessTokens": { + url: urlBase + "/users/:id/accessTokens", + method: "DELETE" + }, + + // INTERNAL. Use User.accessTokens.count() instead. + "prototype$__count__accessTokens": { + url: urlBase + "/users/:id/accessTokens/count", + method: "GET" + }, + + // INTERNAL. Use User.identities() instead. + "prototype$__get__identities": { + isArray: true, + url: urlBase + "/users/:id/identities", + method: "GET" + }, + + // INTERNAL. Use User.identities.create() instead. + "prototype$__create__identities": { + url: urlBase + "/users/:id/identities", + method: "POST" + }, + + // INTERNAL. Use User.identities.destroyAll() instead. + "prototype$__delete__identities": { + url: urlBase + "/users/:id/identities", + method: "DELETE" + }, + + // INTERNAL. Use User.identities.count() instead. + "prototype$__count__identities": { + url: urlBase + "/users/:id/identities/count", + method: "GET" + }, + + // INTERNAL. Use User.credentials() instead. + "prototype$__get__credentials": { + isArray: true, + url: urlBase + "/users/:id/credentials", + method: "GET" + }, + + // INTERNAL. Use User.credentials.create() instead. + "prototype$__create__credentials": { + url: urlBase + "/users/:id/credentials", + method: "POST" + }, + + // INTERNAL. Use User.credentials.destroyAll() instead. + "prototype$__delete__credentials": { + url: urlBase + "/users/:id/credentials", + method: "DELETE" + }, + + // INTERNAL. Use User.credentials.count() instead. + "prototype$__count__credentials": { + url: urlBase + "/users/:id/credentials/count", + method: "GET" + }, + + // INTERNAL. Use User.roles() instead. + "prototype$__get__roles": { + isArray: true, + url: urlBase + "/users/:id/roles", + method: "GET" + }, + + // INTERNAL. Use User.roles.create() instead. + "prototype$__create__roles": { + url: urlBase + "/users/:id/roles", + method: "POST" + }, + + // INTERNAL. Use User.roles.destroyAll() instead. + "prototype$__delete__roles": { + url: urlBase + "/users/:id/roles", + method: "DELETE" + }, + + // INTERNAL. Use User.roles.count() instead. + "prototype$__count__roles": { + url: urlBase + "/users/:id/roles/count", + method: "GET" + }, + + /** + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `User` object.) + * + */ + "create": { + url: urlBase + "/users", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.User#createMany + * @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(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `User` object.) + * + */ + "createMany": { + isArray: true, + url: urlBase + "/users", + method: "POST" + }, + + /** + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `User` object.) + * + */ + "upsert": { + url: urlBase + "/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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `exists` – `{boolean=}` - + */ + "exists": { + url: urlBase + "/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 + * + * - `filter` – `{object=}` - Filter defining fields and include + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `User` object.) + * + */ + "findById": { + url: urlBase + "/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, include, order, offset, and limit + * + * @param {function(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `User` object.) + * + */ + "find": { + isArray: true, + url: urlBase + "/users", + method: "GET" + }, + + /** + * @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, include, order, 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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `User` object.) + * + */ + "findOne": { + url: urlBase + "/users/findOne", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.User#updateAll + * @methodOf lbServices.User + * + * @description + * + * Update instances of the model matched by where from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `where` – `{object=}` - Criteria to match model instances + * + * @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`. + * + * @returns {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. + */ + "updateAll": { + url: urlBase + "/users/update", + method: "POST" + }, + + /** + * @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`. + * + * @returns {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: urlBase + "/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`. + * + * @returns {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: urlBase + "/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. + * + * - `id` – `{*}` - User id + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `User` object.) + * + */ + "prototype$updateAttributes": { + url: urlBase + "/users/:id", + method: "PUT" + }, + + /** + * @ngdoc method + * @name lbServices.User#createChangeStream + * @methodOf lbServices.User + * + * @description + * + * Create a change stream. + * + * @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. + * + * - `options` – `{object=}` - + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `changes` – `{ReadableStream=}` - + */ + "createChangeStream": { + url: urlBase + "/users/change-stream", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.User#login + * @methodOf lbServices.User + * + * @description + * + * Login a user with username/email and password. + * + * @param {Object=} parameters Request parameters. + * + * - `include` – `{string=}` - Related objects to include in the response. See the description of return value for more details. + * Default value: `user`. + * + * - `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`. + * + * @returns {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": { + params: { + include: "user" + }, + interceptor: { + response: function(response) { + var accessToken = response.data; + LoopBackAuth.setUser(accessToken.id, accessToken.userId, accessToken.user); + LoopBackAuth.rememberMe = response.config.params.rememberMe !== false; + LoopBackAuth.save(); + return response.resource; + } + }, + url: urlBase + "/users/login", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.User#logout + * @methodOf lbServices.User + * + * @description + * + * Logout a user with access token + * + * @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`. + * + * @returns {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": { + interceptor: { + response: function(response) { + LoopBackAuth.clearUser(); + LoopBackAuth.clearStorage(); + return response.resource; + } + }, + url: urlBase + "/users/logout", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.User#confirm + * @methodOf lbServices.User + * + * @description + * + * Confirm a user registration with email verification token + * + * @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`. + * + * @returns {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: urlBase + "/users/confirm", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.User#resetPassword + * @methodOf lbServices.User + * + * @description + * + * Reset password for a user with email + * + * @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`. + * + * @returns {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: urlBase + "/users/reset", + method: "POST" + }, + + // INTERNAL. Use AccessToken.user() instead. + "::get::accessToken::user": { + url: urlBase + "/accessTokens/:id/user", + method: "GET" + }, + + // INTERNAL. Use UserCredential.user() instead. + "::get::userCredential::user": { + url: urlBase + "/userCredentials/:id/user", + method: "GET" + }, + + // INTERNAL. Use UserIdentity.user() instead. + "::get::userIdentity::user": { + url: urlBase + "/userIdentities/:id/user", + method: "GET" + }, + + /** + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + */ + "getCurrent": { + url: urlBase + "/users" + "/:id", + method: "GET", + params: { + id: function() { + var id = LoopBackAuth.currentUserId; + if (id == null) id = '__anonymous__'; + return id; + }, + }, + interceptor: { + response: function(response) { + LoopBackAuth.currentUserData = response.data; + return response.resource; + } + }, + __isGetCurrentUser__ : true + } + } + ); + + + + /** + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `User` object.) + * + */ + R["updateOrCreate"] = R["upsert"]; + + /** + * @ngdoc method + * @name lbServices.User#update + * @methodOf lbServices.User + * + * @description + * + * Update instances of the model matched by where from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `where` – `{object=}` - Criteria to match model instances + * + * @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`. + * + * @returns {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. + */ + R["update"] = R["updateAll"]; + + /** + * @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`. + * + * @returns {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. + */ + R["destroyById"] = R["deleteById"]; + + /** + * @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`. + * + * @returns {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. + */ + R["removeById"] = R["deleteById"]; + + /** + * @ngdoc method + * @name lbServices.User#getCachedCurrent + * @methodOf lbServices.User + * + * @description + * + * Get data of the currently logged user that was returned by the last + * call to {@link lbServices.User#login} or + * {@link lbServices.User#getCurrent}. Return null when there + * is no user logged in or the data of the current user were not fetched + * yet. + * + * @returns {Object} A User instance. + */ + R.getCachedCurrent = function() { + var data = LoopBackAuth.currentUserData; + return data ? new R(data) : null; + }; + + /** + * @ngdoc method + * @name lbServices.User#isAuthenticated + * @methodOf lbServices.User + * + * @returns {boolean} True if the current user is authenticated (logged in). + */ + R.isAuthenticated = function() { + return this.getCurrentId() != null; + }; + + /** + * @ngdoc method + * @name lbServices.User#getCurrentId + * @methodOf lbServices.User + * + * @returns {Object} Id of the currently logged-in user or null. + */ + R.getCurrentId = function() { + return LoopBackAuth.currentUserId; + }; + + /** + * @ngdoc property + * @name lbServices.User#modelName + * @propertyOf lbServices.User + * @description + * The name of the model represented by this $resource, + * i.e. `User`. + */ + R.modelName = "User"; + + /** + * @ngdoc object + * @name lbServices.User.accessTokens + * @header lbServices.User.accessTokens + * @object + * @description + * + * The object `User.accessTokens` groups methods + * manipulating `AccessToken` instances related to `User`. + * + * Call {@link lbServices.User#accessTokens User.accessTokens()} + * to query all related instances. + */ + + + /** + * @ngdoc method + * @name lbServices.User#accessTokens + * @methodOf lbServices.User + * + * @description + * + * Queries accessTokens of user. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - User id + * + * - `filter` – `{object=}` - + * + * @param {function(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `AccessToken` object.) + * + */ + R.accessTokens = function() { + var TargetResource = $injector.get("AccessToken"); + var action = TargetResource["::get::user::accessTokens"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.User.accessTokens#count + * @methodOf lbServices.User.accessTokens + * + * @description + * + * Counts accessTokens of user. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - User id + * + * - `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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `count` – `{number=}` - + */ + R.accessTokens.count = function() { + var TargetResource = $injector.get("AccessToken"); + var action = TargetResource["::count::user::accessTokens"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.User.accessTokens#create + * @methodOf lbServices.User.accessTokens + * + * @description + * + * Creates a new instance in accessTokens of this model. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - User id + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `AccessToken` object.) + * + */ + R.accessTokens.create = function() { + var TargetResource = $injector.get("AccessToken"); + var action = TargetResource["::create::user::accessTokens"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.User.accessTokens#createMany + * @methodOf lbServices.User.accessTokens + * + * @description + * + * Creates a new instance in accessTokens of this model. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - User id + * + * @param {Object} postData Request data. + * + * This method expects a subset of model properties as request parameters. + * + * @param {function(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `AccessToken` object.) + * + */ + R.accessTokens.createMany = function() { + var TargetResource = $injector.get("AccessToken"); + var action = TargetResource["::createMany::user::accessTokens"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.User.accessTokens#destroyAll + * @methodOf lbServices.User.accessTokens + * + * @description + * + * Deletes all accessTokens of this model. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - User id + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {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. + */ + R.accessTokens.destroyAll = function() { + var TargetResource = $injector.get("AccessToken"); + var action = TargetResource["::delete::user::accessTokens"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.User.accessTokens#destroyById + * @methodOf lbServices.User.accessTokens + * + * @description + * + * Delete a related item by id for accessTokens. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - User id + * + * - `fk` – `{*}` - Foreign key for accessTokens + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {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. + */ + R.accessTokens.destroyById = function() { + var TargetResource = $injector.get("AccessToken"); + var action = TargetResource["::destroyById::user::accessTokens"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.User.accessTokens#findById + * @methodOf lbServices.User.accessTokens + * + * @description + * + * Find a related item by id for accessTokens. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - User id + * + * - `fk` – `{*}` - Foreign key for accessTokens + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `AccessToken` object.) + * + */ + R.accessTokens.findById = function() { + var TargetResource = $injector.get("AccessToken"); + var action = TargetResource["::findById::user::accessTokens"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.User.accessTokens#updateById + * @methodOf lbServices.User.accessTokens + * + * @description + * + * Update a related item by id for accessTokens. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - User id + * + * - `fk` – `{*}` - Foreign key for accessTokens + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `AccessToken` object.) + * + */ + R.accessTokens.updateById = function() { + var TargetResource = $injector.get("AccessToken"); + var action = TargetResource["::updateById::user::accessTokens"]; + return action.apply(R, arguments); + }; + /** + * @ngdoc object + * @name lbServices.User.identities + * @header lbServices.User.identities + * @object + * @description + * + * The object `User.identities` groups methods + * manipulating `UserIdentity` instances related to `User`. + * + * Call {@link lbServices.User#identities User.identities()} + * to query all related instances. + */ + + + /** + * @ngdoc method + * @name lbServices.User#identities + * @methodOf lbServices.User + * + * @description + * + * Queries identities of user. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - User id + * + * - `filter` – `{object=}` - + * + * @param {function(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `UserIdentity` object.) + * + */ + R.identities = function() { + var TargetResource = $injector.get("UserIdentity"); + var action = TargetResource["::get::user::identities"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.User.identities#count + * @methodOf lbServices.User.identities + * + * @description + * + * Counts identities of user. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - User id + * + * - `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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `count` – `{number=}` - + */ + R.identities.count = function() { + var TargetResource = $injector.get("UserIdentity"); + var action = TargetResource["::count::user::identities"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.User.identities#create + * @methodOf lbServices.User.identities + * + * @description + * + * Creates a new instance in identities of this model. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - User id + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `UserIdentity` object.) + * + */ + R.identities.create = function() { + var TargetResource = $injector.get("UserIdentity"); + var action = TargetResource["::create::user::identities"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.User.identities#createMany + * @methodOf lbServices.User.identities + * + * @description + * + * Creates a new instance in identities of this model. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - User id + * + * @param {Object} postData Request data. + * + * This method expects a subset of model properties as request parameters. + * + * @param {function(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `UserIdentity` object.) + * + */ + R.identities.createMany = function() { + var TargetResource = $injector.get("UserIdentity"); + var action = TargetResource["::createMany::user::identities"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.User.identities#destroyAll + * @methodOf lbServices.User.identities + * + * @description + * + * Deletes all identities of this model. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - User id + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {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. + */ + R.identities.destroyAll = function() { + var TargetResource = $injector.get("UserIdentity"); + var action = TargetResource["::delete::user::identities"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.User.identities#destroyById + * @methodOf lbServices.User.identities + * + * @description + * + * Delete a related item by id for identities. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - User id + * + * - `fk` – `{*}` - Foreign key for identities + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {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. + */ + R.identities.destroyById = function() { + var TargetResource = $injector.get("UserIdentity"); + var action = TargetResource["::destroyById::user::identities"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.User.identities#findById + * @methodOf lbServices.User.identities + * + * @description + * + * Find a related item by id for identities. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - User id + * + * - `fk` – `{*}` - Foreign key for identities + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `UserIdentity` object.) + * + */ + R.identities.findById = function() { + var TargetResource = $injector.get("UserIdentity"); + var action = TargetResource["::findById::user::identities"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.User.identities#updateById + * @methodOf lbServices.User.identities + * + * @description + * + * Update a related item by id for identities. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - User id + * + * - `fk` – `{*}` - Foreign key for identities + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `UserIdentity` object.) + * + */ + R.identities.updateById = function() { + var TargetResource = $injector.get("UserIdentity"); + var action = TargetResource["::updateById::user::identities"]; + return action.apply(R, arguments); + }; + /** + * @ngdoc object + * @name lbServices.User.credentials + * @header lbServices.User.credentials + * @object + * @description + * + * The object `User.credentials` groups methods + * manipulating `UserCredential` instances related to `User`. + * + * Call {@link lbServices.User#credentials User.credentials()} + * to query all related instances. + */ + + + /** + * @ngdoc method + * @name lbServices.User#credentials + * @methodOf lbServices.User + * + * @description + * + * Queries credentials of user. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - User id + * + * - `filter` – `{object=}` - + * + * @param {function(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `UserCredential` object.) + * + */ + R.credentials = function() { + var TargetResource = $injector.get("UserCredential"); + var action = TargetResource["::get::user::credentials"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.User.credentials#count + * @methodOf lbServices.User.credentials + * + * @description + * + * Counts credentials of user. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - User id + * + * - `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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `count` – `{number=}` - + */ + R.credentials.count = function() { + var TargetResource = $injector.get("UserCredential"); + var action = TargetResource["::count::user::credentials"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.User.credentials#create + * @methodOf lbServices.User.credentials + * + * @description + * + * Creates a new instance in credentials of this model. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - User id + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `UserCredential` object.) + * + */ + R.credentials.create = function() { + var TargetResource = $injector.get("UserCredential"); + var action = TargetResource["::create::user::credentials"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.User.credentials#createMany + * @methodOf lbServices.User.credentials + * + * @description + * + * Creates a new instance in credentials of this model. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - User id + * + * @param {Object} postData Request data. + * + * This method expects a subset of model properties as request parameters. + * + * @param {function(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `UserCredential` object.) + * + */ + R.credentials.createMany = function() { + var TargetResource = $injector.get("UserCredential"); + var action = TargetResource["::createMany::user::credentials"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.User.credentials#destroyAll + * @methodOf lbServices.User.credentials + * + * @description + * + * Deletes all credentials of this model. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - User id + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {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. + */ + R.credentials.destroyAll = function() { + var TargetResource = $injector.get("UserCredential"); + var action = TargetResource["::delete::user::credentials"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.User.credentials#destroyById + * @methodOf lbServices.User.credentials + * + * @description + * + * Delete a related item by id for credentials. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - User id + * + * - `fk` – `{*}` - Foreign key for credentials + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {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. + */ + R.credentials.destroyById = function() { + var TargetResource = $injector.get("UserCredential"); + var action = TargetResource["::destroyById::user::credentials"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.User.credentials#findById + * @methodOf lbServices.User.credentials + * + * @description + * + * Find a related item by id for credentials. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - User id + * + * - `fk` – `{*}` - Foreign key for credentials + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `UserCredential` object.) + * + */ + R.credentials.findById = function() { + var TargetResource = $injector.get("UserCredential"); + var action = TargetResource["::findById::user::credentials"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.User.credentials#updateById + * @methodOf lbServices.User.credentials + * + * @description + * + * Update a related item by id for credentials. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - User id + * + * - `fk` – `{*}` - Foreign key for credentials + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `UserCredential` object.) + * + */ + R.credentials.updateById = function() { + var TargetResource = $injector.get("UserCredential"); + var action = TargetResource["::updateById::user::credentials"]; + return action.apply(R, arguments); + }; + /** + * @ngdoc object + * @name lbServices.User.roles + * @header lbServices.User.roles + * @object + * @description + * + * The object `User.roles` groups methods + * manipulating `Role` instances related to `User`. + * + * Call {@link lbServices.User#roles User.roles()} + * to query all related instances. + */ + + + /** + * @ngdoc method + * @name lbServices.User#roles + * @methodOf lbServices.User + * + * @description + * + * Queries roles of user. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - User id + * + * - `filter` – `{object=}` - + * + * @param {function(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Role` object.) + * + */ + R.roles = function() { + var TargetResource = $injector.get("Role"); + var action = TargetResource["::get::user::roles"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.User.roles#count + * @methodOf lbServices.User.roles + * + * @description + * + * Counts roles of user. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - User id + * + * - `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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `count` – `{number=}` - + */ + R.roles.count = function() { + var TargetResource = $injector.get("Role"); + var action = TargetResource["::count::user::roles"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.User.roles#create + * @methodOf lbServices.User.roles + * + * @description + * + * Creates a new instance in roles of this model. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - User id + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Role` object.) + * + */ + R.roles.create = function() { + var TargetResource = $injector.get("Role"); + var action = TargetResource["::create::user::roles"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.User.roles#createMany + * @methodOf lbServices.User.roles + * + * @description + * + * Creates a new instance in roles of this model. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - User id + * + * @param {Object} postData Request data. + * + * This method expects a subset of model properties as request parameters. + * + * @param {function(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Role` object.) + * + */ + R.roles.createMany = function() { + var TargetResource = $injector.get("Role"); + var action = TargetResource["::createMany::user::roles"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.User.roles#destroyAll + * @methodOf lbServices.User.roles + * + * @description + * + * Deletes all roles of this model. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - User id + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {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. + */ + R.roles.destroyAll = function() { + var TargetResource = $injector.get("Role"); + var action = TargetResource["::delete::user::roles"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.User.roles#destroyById + * @methodOf lbServices.User.roles + * + * @description + * + * Delete a related item by id for roles. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - User id + * + * - `fk` – `{*}` - Foreign key for roles + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {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. + */ + R.roles.destroyById = function() { + var TargetResource = $injector.get("Role"); + var action = TargetResource["::destroyById::user::roles"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.User.roles#exists + * @methodOf lbServices.User.roles + * + * @description + * + * Check the existence of roles relation to an item by id. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - User id + * + * - `fk` – `{*}` - Foreign key for roles + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Role` object.) + * + */ + R.roles.exists = function() { + var TargetResource = $injector.get("Role"); + var action = TargetResource["::exists::user::roles"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.User.roles#findById + * @methodOf lbServices.User.roles + * + * @description + * + * Find a related item by id for roles. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - User id + * + * - `fk` – `{*}` - Foreign key for roles + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Role` object.) + * + */ + R.roles.findById = function() { + var TargetResource = $injector.get("Role"); + var action = TargetResource["::findById::user::roles"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.User.roles#link + * @methodOf lbServices.User.roles + * + * @description + * + * Add a related item by id for roles. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - User id + * + * - `fk` – `{*}` - Foreign key for roles + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Role` object.) + * + */ + R.roles.link = function() { + var TargetResource = $injector.get("Role"); + var action = TargetResource["::link::user::roles"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.User.roles#unlink + * @methodOf lbServices.User.roles + * + * @description + * + * Remove the roles relation to an item by id. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - User id + * + * - `fk` – `{*}` - Foreign key for roles + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {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. + */ + R.roles.unlink = function() { + var TargetResource = $injector.get("Role"); + var action = TargetResource["::unlink::user::roles"]; + return action.apply(R, arguments); + }; + + /** + * @ngdoc method + * @name lbServices.User.roles#updateById + * @methodOf lbServices.User.roles + * + * @description + * + * Update a related item by id for roles. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - User id + * + * - `fk` – `{*}` - Foreign key for roles + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Role` object.) + * + */ + R.roles.updateById = function() { + var TargetResource = $injector.get("Role"); + var action = TargetResource["::updateById::user::roles"]; + return action.apply(R, arguments); + }; + + return R; + }]); + +/** + * @ngdoc object + * @name lbServices.Container + * @header lbServices.Container + * @object + * + * @description + * + * A $resource object for interacting with the `Container` model. + * + * ## Example + * + * See + * {@link http://docs.angularjs.org/api/ngResource.$resource#example $resource} + * for an example of using this object. + * + */ +module.factory( + "Container", + ['LoopBackResource', 'LoopBackAuth', '$injector', function(Resource, LoopBackAuth, $injector) { + var R = Resource( + urlBase + "/containers/:id", + { 'id': '@id' }, + { + + /** + * @ngdoc method + * @name lbServices.Container#getContainers + * @methodOf lbServices.Container + * + * @description + * + * + * (The remote method definition does not provide any description.) + * + * + * @param {Object=} parameters Request parameters. + * + * This method does not accept any parameters. + * Supply an empty object or omit this argument altogether. + * + * @param {function(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Container` object.) + * + */ + "getContainers": { + isArray: true, + url: urlBase + "/containers", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Container#createContainer + * @methodOf lbServices.Container + * + * @description + * + * + * (The remote method definition does not provide any description.) + * + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Container` object.) + * + */ + "createContainer": { + url: urlBase + "/containers", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.Container#destroyContainer + * @methodOf lbServices.Container + * + * @description + * + * + * (The remote method definition does not provide any description.) + * + * + * @param {Object=} parameters Request parameters. + * + * - `container` – `{string=}` - + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `` – `{undefined=}` - + */ + "destroyContainer": { + url: urlBase + "/containers/:container", + method: "DELETE" + }, + + /** + * @ngdoc method + * @name lbServices.Container#getContainer + * @methodOf lbServices.Container + * + * @description + * + * + * (The remote method definition does not provide any description.) + * + * + * @param {Object=} parameters Request parameters. + * + * - `container` – `{string=}` - + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Container` object.) + * + */ + "getContainer": { + url: urlBase + "/containers/:container", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Container#getFiles + * @methodOf lbServices.Container + * + * @description + * + * + * (The remote method definition does not provide any description.) + * + * + * @param {Object=} parameters Request parameters. + * + * - `container` – `{string=}` - + * + * @param {function(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Container` object.) + * + */ + "getFiles": { + isArray: true, + url: urlBase + "/containers/:container/files", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Container#getFile + * @methodOf lbServices.Container + * + * @description + * + * + * (The remote method definition does not provide any description.) + * + * + * @param {Object=} parameters Request parameters. + * + * - `container` – `{string=}` - + * + * - `file` – `{string=}` - + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Container` object.) + * + */ + "getFile": { + url: urlBase + "/containers/:container/files/:file", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Container#removeFile + * @methodOf lbServices.Container + * + * @description + * + * + * (The remote method definition does not provide any description.) + * + * + * @param {Object=} parameters Request parameters. + * + * - `container` – `{string=}` - + * + * - `file` – `{string=}` - + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `` – `{undefined=}` - + */ + "removeFile": { + url: urlBase + "/containers/:container/files/:file", + method: "DELETE" + }, + + /** + * @ngdoc method + * @name lbServices.Container#upload + * @methodOf lbServices.Container + * + * @description + * + * + * (The remote method definition does not provide any description.) + * + * + * @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. + * + * - `req` – `{object=}` - + * + * - `res` – `{object=}` - + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `result` – `{object=}` - + */ + "upload": { + url: urlBase + "/containers/:container/upload", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.Container#download + * @methodOf lbServices.Container + * + * @description + * + * + * (The remote method definition does not provide any description.) + * + * + * @param {Object=} parameters Request parameters. + * + * - `container` – `{string=}` - + * + * - `file` – `{string=}` - + * + * - `res` – `{object=}` - + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {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. + */ + "download": { + url: urlBase + "/containers/:container/download/:file", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Container#create + * @methodOf lbServices.Container + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Container` object.) + * + */ + "create": { + url: urlBase + "/containers", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.Container#createMany + * @methodOf lbServices.Container + * + * @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(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Container` object.) + * + */ + "createMany": { + isArray: true, + url: urlBase + "/containers", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.Container#upsert + * @methodOf lbServices.Container + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Container` object.) + * + */ + "upsert": { + url: urlBase + "/containers", + method: "PUT" + }, + + /** + * @ngdoc method + * @name lbServices.Container#exists + * @methodOf lbServices.Container + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `exists` – `{boolean=}` - + */ + "exists": { + url: urlBase + "/containers/:id/exists", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Container#findById + * @methodOf lbServices.Container + * + * @description + * + * Find a model instance by id from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - Model id + * + * - `filter` – `{object=}` - Filter defining fields and include + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Container` object.) + * + */ + "findById": { + url: urlBase + "/containers/:id", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Container#find + * @methodOf lbServices.Container + * + * @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, include, order, offset, and limit + * + * @param {function(Array.,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Array.} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Container` object.) + * + */ + "find": { + isArray: true, + url: urlBase + "/containers", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Container#findOne + * @methodOf lbServices.Container + * + * @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, include, order, 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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Container` object.) + * + */ + "findOne": { + url: urlBase + "/containers/findOne", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Container#updateAll + * @methodOf lbServices.Container + * + * @description + * + * Update instances of the model matched by where from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `where` – `{object=}` - Criteria to match model instances + * + * @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`. + * + * @returns {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. + */ + "updateAll": { + url: urlBase + "/containers/update", + method: "POST" + }, + + /** + * @ngdoc method + * @name lbServices.Container#deleteById + * @methodOf lbServices.Container + * + * @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`. + * + * @returns {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: urlBase + "/containers/:id", + method: "DELETE" + }, + + /** + * @ngdoc method + * @name lbServices.Container#count + * @methodOf lbServices.Container + * + * @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`. + * + * @returns {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: urlBase + "/containers/count", + method: "GET" + }, + + /** + * @ngdoc method + * @name lbServices.Container#prototype$updateAttributes + * @methodOf lbServices.Container + * + * @description + * + * Update attributes for a model instance and persist it into the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `id` – `{*}` - PersistedModel id + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Container` object.) + * + */ + "prototype$updateAttributes": { + url: urlBase + "/containers/:id", + method: "PUT" + }, + + /** + * @ngdoc method + * @name lbServices.Container#createChangeStream + * @methodOf lbServices.Container + * + * @description + * + * Create a change stream. + * + * @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. + * + * - `options` – `{object=}` - + * + * @param {function(Object,Object)=} successCb + * Success callback with two arguments: `value`, `responseHeaders`. + * + * @param {function(Object)=} errorCb Error callback with one argument: + * `httpResponse`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * Data properties: + * + * - `changes` – `{ReadableStream=}` - + */ + "createChangeStream": { + url: urlBase + "/containers/change-stream", + method: "POST" + }, + } + ); + + + + /** + * @ngdoc method + * @name lbServices.Container#updateOrCreate + * @methodOf lbServices.Container + * + * @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`. + * + * @returns {Object} An empty reference that will be + * populated with the actual data once the response is returned + * from the server. + * + * + * (The remote method definition does not provide any description. + * This usually means the response is a `Container` object.) + * + */ + R["updateOrCreate"] = R["upsert"]; + + /** + * @ngdoc method + * @name lbServices.Container#update + * @methodOf lbServices.Container + * + * @description + * + * Update instances of the model matched by where from the data source. + * + * @param {Object=} parameters Request parameters. + * + * - `where` – `{object=}` - Criteria to match model instances + * + * @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`. + * + * @returns {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. + */ + R["update"] = R["updateAll"]; + + /** + * @ngdoc method + * @name lbServices.Container#destroyById + * @methodOf lbServices.Container + * + * @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`. + * + * @returns {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. + */ + R["destroyById"] = R["deleteById"]; + + /** + * @ngdoc method + * @name lbServices.Container#removeById + * @methodOf lbServices.Container + * + * @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`. + * + * @returns {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. + */ + R["removeById"] = R["deleteById"]; + + + /** + * @ngdoc property + * @name lbServices.Container#modelName + * @propertyOf lbServices.Container + * @description + * The name of the model represented by this $resource, + * i.e. `Container`. + */ + R.modelName = "Container"; + + + return R; + }]); + + +module + .factory('LoopBackAuth', function() { + var props = ['accessTokenId', 'currentUserId']; + var propsPrefix = '$LoopBack$'; + + function LoopBackAuth() { + var self = this; + props.forEach(function(name) { + self[name] = load(name); + }); + this.rememberMe = undefined; + this.currentUserData = null; + } + + LoopBackAuth.prototype.save = function() { + var self = this; + var storage = this.rememberMe ? localStorage : sessionStorage; + props.forEach(function(name) { + save(storage, name, self[name]); + }); + }; + + LoopBackAuth.prototype.setUser = function(accessTokenId, userId, userData) { + this.accessTokenId = accessTokenId; + this.currentUserId = userId; + this.currentUserData = userData; + } + + LoopBackAuth.prototype.clearUser = function() { + this.accessTokenId = null; + this.currentUserId = null; + this.currentUserData = null; + } + + LoopBackAuth.prototype.clearStorage = function() { + props.forEach(function(name) { + save(sessionStorage, name, null); + save(localStorage, name, null); + }); + }; + + return new LoopBackAuth(); + + // Note: LocalStorage converts the value to string + // We are using empty string as a marker for null/undefined values. + function save(storage, name, value) { + var key = propsPrefix + name; + if (value == null) value = ''; + storage[key] = value; + } + + function load(name) { + var key = propsPrefix + name; + return localStorage[key] || sessionStorage[key] || null; + } + }) + .config(['$httpProvider', function($httpProvider) { + $httpProvider.interceptors.push('LoopBackAuthRequestInterceptor'); + }]) + .factory('LoopBackAuthRequestInterceptor', [ '$q', 'LoopBackAuth', + function($q, LoopBackAuth) { + return { + 'request': function(config) { + + // filter out non urlBase requests + if (config.url.substr(0, urlBase.length) !== urlBase) { + return config; + } + + if (LoopBackAuth.accessTokenId) { + config.headers[authHeader] = LoopBackAuth.accessTokenId; + } else if (config.__isGetCurrentUser__) { + // Return a stub 401 error for User.getCurrent() when + // there is no user logged in + var res = { + body: { error: { status: 401 } }, + status: 401, + config: config, + headers: function() { return undefined; } + }; + return $q.reject(res); + } + return config || $q.when(config); + } + } + }]) + + /** + * @ngdoc object + * @name lbServices.LoopBackResourceProvider + * @header lbServices.LoopBackResourceProvider + * @description + * Use `LoopBackResourceProvider` to change the global configuration + * settings used by all models. Note that the provider is available + * to Configuration Blocks only, see + * {@link https://docs.angularjs.org/guide/module#module-loading-dependencies Module Loading & Dependencies} + * for more details. + * + * ## Example + * + * ```js + * angular.module('app') + * .config(function(LoopBackResourceProvider) { + * LoopBackResourceProvider.setAuthHeader('X-Access-Token'); + * }); + * ``` + */ + .provider('LoopBackResource', function LoopBackResourceProvider() { + /** + * @ngdoc method + * @name lbServices.LoopBackResourceProvider#setAuthHeader + * @methodOf lbServices.LoopBackResourceProvider + * @param {string} header The header name to use, e.g. `X-Access-Token` + * @description + * Configure the REST transport to use a different header for sending + * the authentication token. It is sent in the `Authorization` header + * by default. + */ + this.setAuthHeader = function(header) { + authHeader = header; + }; + + /** + * @ngdoc method + * @name lbServices.LoopBackResourceProvider#setUrlBase + * @methodOf lbServices.LoopBackResourceProvider + * @param {string} url The URL to use, e.g. `/api` or `//example.com/api`. + * @description + * Change the URL of the REST API server. By default, the URL provided + * to the code generator (`lb-ng` or `grunt-loopback-sdk-angular`) is used. + */ + this.setUrlBase = function(url) { + urlBase = url; + }; + + this.$get = ['$resource', function($resource) { + return function(url, params, actions) { + var resource = $resource(url, params, actions); + + // Angular always calls POST on $save() + // This hack is based on + // http://kirkbushell.me/angular-js-using-ng-resource-in-a-more-restful-manner/ + resource.prototype.$save = function(success, error) { + // Fortunately, LoopBack provides a convenient `upsert` method + // that exactly fits our needs. + var result = resource.upsert.call(this, {}, this, success, error); + return result.$promise || result; + }; + return resource; + }; + }]; + }); + +})(window, window.angular); diff --git a/client/app/modules/pokes/app.pokes.js b/client/app/modules/pokes/app.pokes.js new file mode 100644 index 00000000..a7a1ab24 --- /dev/null +++ b/client/app/modules/pokes/app.pokes.js @@ -0,0 +1,2 @@ +'use strict'; +angular.module('com.module.pokes', []); diff --git a/client/app/modules/pokes/config/pokes.config.js b/client/app/modules/pokes/config/pokes.config.js new file mode 100644 index 00000000..8a643ffb --- /dev/null +++ b/client/app/modules/pokes/config/pokes.config.js @@ -0,0 +1,12 @@ +'use strict'; +angular.module('com.module.pokes') + .run(function($rootScope, Poke, gettextCatalog) { + $rootScope.addMenu(gettextCatalog.getString('Pokes'), 'app.pokes.list', + 'fa-edit'); + + Poke.find(function(pokes) { + $rootScope.addDashboardBox(gettextCatalog.getString('Pokes'), + 'bg-red', 'ion-document-text', pokes.length, 'app.pokes.list'); + }); + + }); diff --git a/client/app/modules/pokes/config/pokes.routes.js b/client/app/modules/pokes/config/pokes.routes.js new file mode 100644 index 00000000..6cae2263 --- /dev/null +++ b/client/app/modules/pokes/config/pokes.routes.js @@ -0,0 +1,44 @@ +'use strict'; + +var app = angular.module('com.module.pokes'); + +app.config(function($stateProvider) { + $stateProvider.state('app.pokes', { + abstract: true, + url: '/pokes', + templateUrl: 'modules/pokes/views/main.html', + controller: 'PokesCtrl', + controllerAs: 'ctrl' + }).state('app.pokes.list', { + url: '', + templateUrl: 'modules/pokes/views/list.html', + resolve: { + pokes: ['PokesService', function(PokesService) { + return PokesService.getPokes(); + }] + }, + controller: function($scope, pokes) { + $scope.pokes = pokes; + } + }).state('app.pokes.add', { + url: '/add', + templateUrl: 'modules/pokes/views/form.html', + controller: 'PokesCtrl' + }).state('app.pokes.edit', { + url: '/:id/edit', + templateUrl: 'modules/pokes/views/form.html', + controller: 'PokesCtrl' + }).state('app.pokes.view', { + url: '/:id', + templateUrl: 'modules/pokes/views/view.html', + resolve: { + poke: ['$stateParams', 'PokesService', function($stateParams, + PokesService) { + return PokesService.getPoke($stateParams.id); + }] + }, + controller: function($scope, poke) { + $scope.poke = poke; + } + }); +}); diff --git a/client/app/modules/pokes/controllers/pokes.ctrl.js b/client/app/modules/pokes/controllers/pokes.ctrl.js new file mode 100644 index 00000000..9216baca --- /dev/null +++ b/client/app/modules/pokes/controllers/pokes.ctrl.js @@ -0,0 +1,64 @@ +'use strict'; +angular.module('com.module.pokes') + .controller('PokesCtrl', function($scope, $state, $stateParams, CoreService, + FormHelper, gettextCatalog, Poke, PokesService) { + + $scope.delete = function(id) { + PokesService.deletePoke(id, function() { + $state.reload(); + }); + }; + + this.formHelper = new FormHelper(Poke); + $scope.cancel = function() { + console.log('Cancel'); + console.log(this.formHelper); + //this.formHelper.cancel('app.pokes.list'); + }; + + var pokeId = $stateParams.id; + + if (pokeId) { + $scope.poke = Poke.findById({ + id: pokeId + }, function() {}, function(err) { + console.log(err); + }); + } else { + $scope.poke = {}; + } + + $scope.formFields = [{ + key: 'title', + type: 'text', + label: gettextCatalog.getString('Title'), + required: true + }, { + key: 'content', + type: 'textarea', + label: gettextCatalog.getString('Content'), + required: true + }, { + key: 'image', + type: 'text', + label: gettextCatalog.getString('image'), + required: true + }]; + + $scope.formOptions = { + uniqueFormId: true, + hideSubmit: false, + submitCopy: gettextCatalog.getString('Save') + }; + + $scope.onSubmit = function() { + Poke.upsert($scope.poke, function() { + CoreService.toastSuccess(gettextCatalog.getString('Poke saved'), + gettextCatalog.getString('Your poke is safe with us!')); + $state.go('^.list'); + }, function(err) { + console.log(err); + }); + }; + + }); diff --git a/client/app/modules/pokes/services/pokes.service.js b/client/app/modules/pokes/services/pokes.service.js new file mode 100644 index 00000000..5410ca23 --- /dev/null +++ b/client/app/modules/pokes/services/pokes.service.js @@ -0,0 +1,42 @@ +'use strict'; +var app = angular.module('com.module.pokes'); + +app.service('PokesService', ['CoreService', 'gettextCatalog', 'Poke', function( + CoreService, gettextCatalog, Poke) { + + this.getPokes = function() { + return Poke.find({ + filter: { + order: 'created DESC' + } + }).$promise; + }; + + this.getPoke = function(id) { + return Poke.findById({ + id: id + }).$promise; + }; + + this.deletePoke = function(id, cb) { + CoreService.confirm(gettextCatalog.getString('Are you sure?'), + gettextCatalog.getString('Deleting this cannot be undone'), + function() { + Poke.deleteById(id, function() { + CoreService.toastSuccess(gettextCatalog.getString( + 'Item deleted'), gettextCatalog.getString( + 'Your item has been deleted!')); + cb(); + }, function(err) { + CoreService.toastError(gettextCatalog.getString('Oops'), + gettextCatalog.getString('Error deleting item: ') + + err); + cb(); + }); + }, + function() { + return false; + }); + }; + +}]); diff --git a/client/app/modules/pokes/views/form.html b/client/app/modules/pokes/views/form.html new file mode 100644 index 00000000..1c6353a4 --- /dev/null +++ b/client/app/modules/pokes/views/form.html @@ -0,0 +1,18 @@ +

+ + + Add a new poke + Edit poke + +

+ + +
+
+
Could not add poke!
+ +
+
+
+ +
diff --git a/client/app/modules/pokes/views/list.html b/client/app/modules/pokes/views/list.html new file mode 100644 index 00000000..74de408f --- /dev/null +++ b/client/app/modules/pokes/views/list.html @@ -0,0 +1,62 @@ +
+
+

+ {{item.title}} +
+ + Created: + {{item.created | date:'medium'}} + + · modified: + {{item.modified | date:'medium'}} + + +

+ +
+ + + + + + + + + + +
+
+
+
+
{{item.content}}
+
+ +
+
+
+ + +
+ + +
+
+

+ There are no pokes +

+
+
+

Click here + to add a poke!

+
+
diff --git a/client/app/modules/pokes/views/main.html b/client/app/modules/pokes/views/main.html new file mode 100644 index 00000000..9673da76 --- /dev/null +++ b/client/app/modules/pokes/views/main.html @@ -0,0 +1,4 @@ +
+ Add +
+
diff --git a/client/app/modules/pokes/views/view.html b/client/app/modules/pokes/views/view.html new file mode 100644 index 00000000..78b6e7ca --- /dev/null +++ b/client/app/modules/pokes/views/view.html @@ -0,0 +1,17 @@ + +

+ + {{poke.title}} + + + + + + + + + + +

+
+
{{poke | json}}
diff --git a/common/models/poke.json b/common/models/poke.json new file mode 100644 index 00000000..4b13a931 --- /dev/null +++ b/common/models/poke.json @@ -0,0 +1,21 @@ +{ + "name": "Poke", + "plural": "pokes", + "base": "AppModel", + "properties": { + "title": { + "type": "string", + "required": true + }, + "content": { + "type": "string" + }, + "image": { + "type": "string" + } + }, + "validations": [], + "relations": {}, + "acls": [], + "methods": [] +} diff --git a/server/boot/01-load-settings.js b/server/boot/01-load-settings.js index 64f884b3..9a589221 100644 --- a/server/boot/01-load-settings.js +++ b/server/boot/01-load-settings.js @@ -13,11 +13,11 @@ module.exports = function(app) { var settings = [{ type: 'string', key: 'appName', - value: 'Loopback Admin' + value: 'ctrees test' }, { type: 'select', key: 'appTheme', - value: 'skin-blue', + value: 'skin-black', options: [ 'skin-blue', 'skin-black' diff --git a/server/model-config.json b/server/model-config.json index a3847de0..c77a806e 100644 --- a/server/model-config.json +++ b/server/model-config.json @@ -50,6 +50,10 @@ "dataSource": "db", "public": true }, + "Poke": { + "dataSource": "db", + "public": true + }, "Setting": { "dataSource": "db", "public": true